From eaaeb3af7acebe0e1414fb25c1b50cd5a383f2a3 Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Thu, 1 Oct 2015 19:29:15 +0200 Subject: Figures and hints updated for mother/2 problem. --- .../family_relations/mother_2/Mother-1.png | Bin 40513 -> 0 bytes .../family_relations/mother_2/Mother-2.png | Bin 36521 -> 0 bytes .../family_relations/mother_2/Mother-3.png | Bin 38712 -> 0 bytes .../family_relations/mother_2/Prolog_mother_01.svg | 370 +++++++++++++++++++++ .../family_relations/mother_2/Prolog_mother_02.svg | 359 ++++++++++++++++++++ .../family_relations/mother_2/Prolog_mother_03.svg | 319 ++++++++++++++++++ .../family_relations/mother_2/Prolog_mother_04.svg | 319 ++++++++++++++++++ .../problems/family_relations/mother_2/common.py | 6 + prolog/problems/family_relations/mother_2/sl.py | 15 +- 9 files changed, 1383 insertions(+), 5 deletions(-) delete mode 100644 prolog/problems/family_relations/mother_2/Mother-1.png delete mode 100644 prolog/problems/family_relations/mother_2/Mother-2.png delete mode 100644 prolog/problems/family_relations/mother_2/Mother-3.png create mode 100644 prolog/problems/family_relations/mother_2/Prolog_mother_01.svg create mode 100644 prolog/problems/family_relations/mother_2/Prolog_mother_02.svg create mode 100644 prolog/problems/family_relations/mother_2/Prolog_mother_03.svg create mode 100644 prolog/problems/family_relations/mother_2/Prolog_mother_04.svg diff --git a/prolog/problems/family_relations/mother_2/Mother-1.png b/prolog/problems/family_relations/mother_2/Mother-1.png deleted file mode 100644 index 239b54f..0000000 Binary files a/prolog/problems/family_relations/mother_2/Mother-1.png and /dev/null differ diff --git a/prolog/problems/family_relations/mother_2/Mother-2.png b/prolog/problems/family_relations/mother_2/Mother-2.png deleted file mode 100644 index e0179e4..0000000 Binary files a/prolog/problems/family_relations/mother_2/Mother-2.png and /dev/null differ diff --git a/prolog/problems/family_relations/mother_2/Mother-3.png b/prolog/problems/family_relations/mother_2/Mother-3.png deleted file mode 100644 index e0ea5c1..0000000 Binary files a/prolog/problems/family_relations/mother_2/Mother-3.png and /dev/null differ diff --git a/prolog/problems/family_relations/mother_2/Prolog_mother_01.svg b/prolog/problems/family_relations/mother_2/Prolog_mother_01.svg new file mode 100644 index 0000000..6f00449 --- /dev/null +++ b/prolog/problems/family_relations/mother_2/Prolog_mother_01.svg @@ -0,0 +1,370 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/mother_2/Prolog_mother_02.svg b/prolog/problems/family_relations/mother_2/Prolog_mother_02.svg new file mode 100644 index 0000000..c45a1d9 --- /dev/null +++ b/prolog/problems/family_relations/mother_2/Prolog_mother_02.svg @@ -0,0 +1,359 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/mother_2/Prolog_mother_03.svg b/prolog/problems/family_relations/mother_2/Prolog_mother_03.svg new file mode 100644 index 0000000..2efe52f --- /dev/null +++ b/prolog/problems/family_relations/mother_2/Prolog_mother_03.svg @@ -0,0 +1,319 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/mother_2/Prolog_mother_04.svg b/prolog/problems/family_relations/mother_2/Prolog_mother_04.svg new file mode 100644 index 0000000..122b04e --- /dev/null +++ b/prolog/problems/family_relations/mother_2/Prolog_mother_04.svg @@ -0,0 +1,319 @@ + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prolog/problems/family_relations/mother_2/common.py b/prolog/problems/family_relations/mother_2/common.py index d819ef5..d943b9c 100644 --- a/prolog/problems/family_relations/mother_2/common.py +++ b/prolog/problems/family_relations/mother_2/common.py @@ -91,6 +91,12 @@ def hint(program, solved_problems): 'findall(_, mother(X, Y), L), length(L, 50)'): return [{'id': 'or_instead_of_and'}] + # OR instead of AND written with two rules, namely: + # (r1) mother(X, Y):- female(X). (r2) mother(X, Y):- parent(X, Y). + if prolog.engine.ask_truth(engine_id, + 'findall(_, mother(X, Y), L), length(L, 50)'): + return [{'id': 'or_instead_of_and_two_rules'}] + # X must be female if prolog.engine.ask_truth(engine_id, 'male(X), mother(X, _)'): return [{'id': 'x_must_be_female'}] diff --git a/prolog/problems/family_relations/mother_2/sl.py b/prolog/problems/family_relations/mother_2/sl.py index bd4d57e..9e384c0 100644 --- a/prolog/problems/family_relations/mother_2/sl.py +++ b/prolog/problems/family_relations/mother_2/sl.py @@ -16,10 +16,10 @@ description = '''\ plan = [ '''\ -

Mama ima otroka in je ženskega spola.

-

Loni naj zbriše imena relacij (parent, mother) s te slike!

''', +

Mama ima otroka in je ženskega spola.

+''', '''\ -

Mama X je starš od Y in je ženskega spola.

''', +

Mama X je starš od Y in je ženskega spola.

''', '''\

Če je X ženska in je hkrati X starš od Y, potem je X mama od Y.

''' @@ -28,16 +28,21 @@ potem je X mama od Y.

''' hint = { 'or_instead_of_and': '''\

Si morda uporabil podpičje (ki pomeni ALI) namesto vejice (ki pomeni IN)?

+''', + + 'or_instead_of_and_two_rules': '''\ +

Si morda zapisal dve pravili, eno za spol in eno za "starševstvo"? +Pozor: velja eno ALI drugo, ne nujno eno IN drugo!

''', 'x_must_be_female': '''\

Mama je navadno ženskega spola.

-

+

''', 'x_must_be_parent': '''\

Mama naj bi imela vsaj enega otroka... torej je starš od nekoga.

-

+

''', 'y_can_be_of_any_gender': '''\ -- cgit v1.2.1