summaryrefslogtreecommitdiff
path: root/prolog/problems/family_relations/mother_2/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'prolog/problems/family_relations/mother_2/common.py')
-rw-r--r--prolog/problems/family_relations/mother_2/common.py6
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'}]