From bbcb29a202436fc0e222e187f1fadf0b1f305465 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sun, 22 May 2016 17:48:30 +0200 Subject: Prolog: update denotational_semantics problems --- .../denotational_semantics/prog_8puzzle_2/common.py | 16 ++++++++++++++-- .../problems/denotational_semantics/prog_8puzzle_2/en.py | 13 +++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'prolog/problems/denotational_semantics/prog_8puzzle_2') diff --git a/prolog/problems/denotational_semantics/prog_8puzzle_2/common.py b/prolog/problems/denotational_semantics/prog_8puzzle_2/common.py index 71875d4..c5b69da 100644 --- a/prolog/problems/denotational_semantics/prog_8puzzle_2/common.py +++ b/prolog/problems/denotational_semantics/prog_8puzzle_2/common.py @@ -1,6 +1,6 @@ id = 172 -number = 81 -visible = False +number = 30 +visible = True facts = None solution = '''\ @@ -14,3 +14,15 @@ instr172 --> [right]. instr172 --> [up]. instr172 --> [down]. ''' + +initial = '''\ +prog_8puzzle --> [begin], instructs, [end]. + +instructs --> instr. +instructs --> instr, instructs. + +instr --> [left]. +instr --> [right]. +instr --> [up]. +instr --> [down]. +''' diff --git a/prolog/problems/denotational_semantics/prog_8puzzle_2/en.py b/prolog/problems/denotational_semantics/prog_8puzzle_2/en.py index 7969ba4..a91e22e 100644 --- a/prolog/problems/denotational_semantics/prog_8puzzle_2/en.py +++ b/prolog/problems/denotational_semantics/prog_8puzzle_2/en.py @@ -2,8 +2,17 @@ name = 'prog_8puzzle/2' slug = '8-puzzle-solving language' description = '''\ -

Write a DCG for solving 8-puzzles. The first symbol in every word is [begin], followed by any sequence of "instruction" symbols from the set {left, right, up, down}, and finally [end]. The starting symbol should be named prog_8puzzle.

+

+Write a DCG for solving 8-puzzles. The first symbol in every word is +[begin], followed by any sequence of "instruction" symbols from +the set {left, right, up, +down}, and finally [end]. The starting symbol should +be named prog_8puzzle. +

-

Example words: [begin,left,down,right,end], [begin,down,end].

''' +

+Example words: [begin,left,down,right,end], [begin,down,end]. +

+''' hint = {} -- cgit v1.2.1