From 6bda47fb45788f7464b7846bc58d7b90cc65240f Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Fri, 2 Oct 2015 22:27:57 +0200 Subject: Figures, hints and test cases added/updated for father, grandparent, brother, and sister problems. --- .../brother_2/Prolog_brother_01.svg | 317 +++++++++++++ .../brother_2/Prolog_brother_02.svg | 407 +++++++++++++++++ .../brother_2/Prolog_brother_03.svg | 311 +++++++++++++ .../brother_2/Prolog_brother_04.svg | 361 +++++++++++++++ .../brother_2/Prolog_brother_05.svg | 501 +++++++++++++++++++++ .../problems/family_relations/brother_2/common.py | 4 +- prolog/problems/family_relations/brother_2/sl.py | 16 +- 7 files changed, 1908 insertions(+), 9 deletions(-) create mode 100644 prolog/problems/family_relations/brother_2/Prolog_brother_01.svg create mode 100644 prolog/problems/family_relations/brother_2/Prolog_brother_02.svg create mode 100644 prolog/problems/family_relations/brother_2/Prolog_brother_03.svg create mode 100644 prolog/problems/family_relations/brother_2/Prolog_brother_04.svg create mode 100644 prolog/problems/family_relations/brother_2/Prolog_brother_05.svg (limited to 'prolog/problems/family_relations/brother_2') diff --git a/prolog/problems/family_relations/brother_2/Prolog_brother_01.svg b/prolog/problems/family_relations/brother_2/Prolog_brother_01.svg new file mode 100644 index 0000000..2c7a250 --- /dev/null +++ b/prolog/problems/family_relations/brother_2/Prolog_brother_01.svg @@ -0,0 +1,317 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/brother_2/Prolog_brother_02.svg b/prolog/problems/family_relations/brother_2/Prolog_brother_02.svg new file mode 100644 index 0000000..26f220d --- /dev/null +++ b/prolog/problems/family_relations/brother_2/Prolog_brother_02.svg @@ -0,0 +1,407 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/brother_2/Prolog_brother_03.svg b/prolog/problems/family_relations/brother_2/Prolog_brother_03.svg new file mode 100644 index 0000000..42608de --- /dev/null +++ b/prolog/problems/family_relations/brother_2/Prolog_brother_03.svg @@ -0,0 +1,311 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/brother_2/Prolog_brother_04.svg b/prolog/problems/family_relations/brother_2/Prolog_brother_04.svg new file mode 100644 index 0000000..fdc85c9 --- /dev/null +++ b/prolog/problems/family_relations/brother_2/Prolog_brother_04.svg @@ -0,0 +1,361 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/brother_2/Prolog_brother_05.svg b/prolog/problems/family_relations/brother_2/Prolog_brother_05.svg new file mode 100644 index 0000000..673859b --- /dev/null +++ b/prolog/problems/family_relations/brother_2/Prolog_brother_05.svg @@ -0,0 +1,501 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/brother_2/common.py b/prolog/problems/family_relations/brother_2/common.py index 327e746..3fb685f 100644 --- a/prolog/problems/family_relations/brother_2/common.py +++ b/prolog/problems/family_relations/brother_2/common.py @@ -34,6 +34,8 @@ test_cases = [ {'X': 'kramer'}, {'X': 'michael'}, {'X': 'william'}]), ('brother(andrew, X)', [{'X': 'melanie'}]), + ('brother(X, sally)', + [{'X': 'jeffrey'}, {'X': 'william'}]), ] def test(program, solved_problems): @@ -101,4 +103,4 @@ def hint(program, solved_problems): if engine_id: prolog.engine.destroy(engine_id) - return None + return [] diff --git a/prolog/problems/family_relations/brother_2/sl.py b/prolog/problems/family_relations/brother_2/sl.py index 2176bd8..f945026 100644 --- a/prolog/problems/family_relations/brother_2/sl.py +++ b/prolog/problems/family_relations/brother_2/sl.py @@ -14,27 +14,26 @@ description = '''\ plan = [ '''\ -

''', +

Brat je moškega spola in ima skupnega starša z Y.

''', '''\ -

''', +

Če je X moški in če imata X in Y skupnega starša, +potem je X brat od Y.

''', '''\ -

-
-parent(P, X)
-parent(P, Y)
-male(X)
-
''' +

Brat X je moškega spola in ima vsaj enega skupnega starša z Y.

''', ] hint = { 'x_y_must_be_different': '''\ +

Si pomislil, da sta X in Y lahko ista oseba? Poskusi naslednjo poizvedbo:

 ?- brother(william, Y).
 
+

VEČ... Kako naredim, da sta X in Y različna?

''', 'x_must_be_male': '''\ +

Brat je navadno moškega spola.

''', @@ -43,6 +42,7 @@ hint = { ''', 'common_parent_needed': '''\ +

Dobro bi bilo, da imata X in Y vsaj enega skupnega starša.

''', } -- cgit v1.2.1