diff options
author | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2015-10-01 19:29:15 +0200 |
---|---|---|
committer | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2015-10-01 19:29:15 +0200 |
commit | eaaeb3af7acebe0e1414fb25c1b50cd5a383f2a3 (patch) | |
tree | c2e70e482e2dc6d25d9c83a6bf09a2be022e8469 /prolog/problems/family_relations/mother_2/common.py | |
parent | 02d0c132aeff34ffb763f06096bf8a7eb664aa63 (diff) |
Figures and hints updated for mother/2 problem.
Diffstat (limited to 'prolog/problems/family_relations/mother_2/common.py')
-rw-r--r-- | prolog/problems/family_relations/mother_2/common.py | 6 |
1 files changed, 6 insertions, 0 deletions
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'}] |