From 388b32039898cc8f1784378689007254eb7a33b6 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 13 Jan 2016 13:51:15 +0100 Subject: Remove space-padding from
 blocks

---
 .../problems/denotational_semantics/algol_3/en.py  | 40 +++++++++++-----------
 .../denotational_semantics/algol_for_3/en.py       | 16 ++++-----
 .../denotational_semantics/algol_if_3/en.py        | 18 +++++-----
 .../denotational_semantics/prog_8puzzle_3/en.py    |  4 +--
 .../denotational_semantics/prog_listswap_3/en.py   |  4 +--
 5 files changed, 41 insertions(+), 41 deletions(-)

(limited to 'prolog/problems/denotational_semantics')

diff --git a/prolog/problems/denotational_semantics/algol_3/en.py b/prolog/problems/denotational_semantics/algol_3/en.py
index c5da13e..59a9bd2 100644
--- a/prolog/problems/denotational_semantics/algol_3/en.py
+++ b/prolog/problems/denotational_semantics/algol_3/en.py
@@ -6,28 +6,28 @@ slug = 'interpreter for mini-algol'
 description = '''\
 

A DCG for mini-algol.

-  % apply a function to a starting state
-  ?- apply([a=2], Out, fun(_In, Out, eval(a+3, _In, Out))).
-    Out = 5.
+% apply a function to a starting state
+?- apply([a=2], Out, fun(_In, Out, eval(a+3, _In, Out))).
+  Out = 5.
 
-  % a := a+b
-  % b := a-b
-  % a := a-b
-  ?- _Program = [begin,a,:=,a+b,b,:=,a-b,a,:=,a-b,end],
-      algol(_F, _Program, []),
-      apply([a=3,b=5], Output, _F).
-    Output = [a=5,b=3,printout=[]].
+% a := a+b
+% b := a-b
+% a := a-b
+?- _Program = [begin,a,:=,a+b,b,:=,a-b,a,:=,a-b,end],
+    algol(_F, _Program, []),
+    apply([a=3,b=5], Output, _F).
+  Output = [a=5,b=3,printout=[]].
 
-  % a := 0
-  % while a < 10 do
-  % begin
-  %   print(a)
-  %   a := a+1
-  % end
-  ?- _Program = [begin,a,:=,0,while,a,<,10,do,begin,print(a),a,:=,a+1,end,end],
-      algol(_F, _Program, []),
-      apply([a=3], Output, _F).
-    Output = [a=10,printout=[0,1,2,3,4,5,6,7,8,9]].
+% a := 0
+% while a < 10 do
+% begin
+%   print(a)
+%   a := a+1
+% end
+?- _Program = [begin,a,:=,0,while,a,<,10,do,begin,print(a),a,:=,a+1,end,end],
+    algol(_F, _Program, []),
+    apply([a=3], Output, _F).
+  Output = [a=10,printout=[0,1,2,3,4,5,6,7,8,9]].
 
''' diff --git a/prolog/problems/denotational_semantics/algol_for_3/en.py b/prolog/problems/denotational_semantics/algol_for_3/en.py index d4b8144..91ff34d 100644 --- a/prolog/problems/denotational_semantics/algol_for_3/en.py +++ b/prolog/problems/denotational_semantics/algol_for_3/en.py @@ -6,14 +6,14 @@ slug = 'interpreter for mini-algol with for-statement' description = '''\

Extend the given DCG for mini-algol to support the for-statement. Example:

-  % for a := 0 & a < 5 & a := a + 1 do
-  % begin
-  %   print(a)
-  % end
-  ?- _Program = [begin,for,a,:=,0,&,a,<,5,&,a,:=,a+1,do,begin,print(a),end,end],
-      algol_for(_F, _Program, []),
-      apply([a=2], Output, _F).
-    Output = [a=5,printout=[0,1,2,3,4]].
+% for a := 0 & a < 5 & a := a + 1 do
+% begin
+%   print(a)
+% end
+?- _Program = [begin,for,a,:=,0,&,a,<,5,&,a,:=,a+1,do,begin,print(a),end,end],
+    algol_for(_F, _Program, []),
+    apply([a=2], Output, _F).
+  Output = [a=5,printout=[0,1,2,3,4]].
 
''' diff --git a/prolog/problems/denotational_semantics/algol_if_3/en.py b/prolog/problems/denotational_semantics/algol_if_3/en.py index fae6c45..66855e5 100644 --- a/prolog/problems/denotational_semantics/algol_if_3/en.py +++ b/prolog/problems/denotational_semantics/algol_if_3/en.py @@ -6,15 +6,15 @@ slug = 'interpreter for mini-algol with if-statement' description = '''\

Extend the given DCG for mini-algol to support the if-statement. You can assume that both branches are present in every if-statement. Example:

-  % if a < b then
-  %   print(a)
-  % else
-  %   print(b)
-  % end
-  ?- _Program = [begin,if,a,<,b,then,print(a),else,print(b),end,end],
-      algol_if(_F, _Program, []),
-      apply([a=3,b=5], Output, _F).
-    Output = [a=3,b=5,printout=[3]].
+% if a < b then
+%   print(a)
+% else
+%   print(b)
+% end
+?- _Program = [begin,if,a,<,b,then,print(a),else,print(b),end,end],
+    algol_if(_F, _Program, []),
+    apply([a=3,b=5], Output, _F).
+  Output = [a=3,b=5,printout=[3]].
 
''' diff --git a/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py b/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py index 1c23b18..6a31496 100644 --- a/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py +++ b/prolog/problems/denotational_semantics/prog_8puzzle_3/en.py @@ -9,8 +9,8 @@ description = '''\

The meaning of a word (program) in this language has the form In-->Out, mapping from input to output states. Each state is a (permuted) list of numbers from 0 to 8, where 0 stands for the empty square and other numbers for the corresponding tiles. The first three numbers in the list correspond to the top row of the 8-puzzle, the next three numbers to the middle row, and the last three numbers to the last row. The meaning of instructions left, right, up and down is to move the blank tile in the given direction.

-  ?- prog_8puzzle([0,1,2,3,4,5,6,7,8]-->Out, [begin,down,right,end], []).
-    Out = [3,1,2,4,0,5,6,7,8].
+?- prog_8puzzle([0,1,2,3,4,5,6,7,8]-->Out, [begin,down,right,end], []).
+  Out = [3,1,2,4,0,5,6,7,8].
 

Helper predicates (already defined):
diff --git a/prolog/problems/denotational_semantics/prog_listswap_3/en.py b/prolog/problems/denotational_semantics/prog_listswap_3/en.py index 5e85ce6..ad9dcf8 100644 --- a/prolog/problems/denotational_semantics/prog_listswap_3/en.py +++ b/prolog/problems/denotational_semantics/prog_listswap_3/en.py @@ -9,8 +9,8 @@ description = '''\

The meaning of a word (program) in this language has the form In-->Out, mapping from input to output lists. Besides the list contents, internal states also hold the current cursor position. The left and right instructions move the cursor one step in the given direction, while the swap instruction swaps the element under the cursor with its left neighbor (and fails if cursor is currently pointing to the first element of the list).

-  ?- prog_listswap([1,2,3,4]-->Out, [begin,right,swap,end], []).
-    Out = [2,1,3,4].
+?- prog_listswap([1,2,3,4]-->Out, [begin,right,swap,end], []).
+  Out = [2,1,3,4].
 

Helper predicate (already defined):
-- cgit v1.2.1