diff options
author | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2016-02-29 15:13:44 +0100 |
---|---|---|
committer | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2016-02-29 15:13:44 +0100 |
commit | 5402c60cc2ff966eaaada82fefe71431abae1657 (patch) | |
tree | ed2e061e44734dce37d6a8656a68eb4ee9899de6 /prolog | |
parent | 0af0ca48ded7a72c1ba9d5c58f111877fffb9992 (diff) |
Hints for aunt/2 improved.
Diffstat (limited to 'prolog')
-rw-r--r-- | prolog/problems/family_relations/aunt_2/common.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/prolog/problems/family_relations/aunt_2/common.py b/prolog/problems/family_relations/aunt_2/common.py index d408041..50c82b4 100644 --- a/prolog/problems/family_relations/aunt_2/common.py +++ b/prolog/problems/family_relations/aunt_2/common.py @@ -79,7 +79,9 @@ def hint(code, aux_code): # independent: match on findall(X/Y, (sister(Y, P), parent(P, X)), L) if prolog.engine.ask_truth(engine_id, 'setof(X/Y, aunt(X, Y), [alessandro/daniela, alessandro/luana, jeffrey/andrew, \ - jeffrey/melanie, patricia/susan, vanessa/john, william/andrew, william/melanie])'): + jeffrey/melanie, patricia/susan, vanessa/john, william/andrew, william/melanie])') or \ + prolog.engine.ask_truth(engine_id, + 'setof(X/Y, aunt(X, Y), [joanne/melanie, patricia/sally, susan/patricia, vanessa/sally])'): return [{'id': 'x_and_y_mixed_up'}] # precedence fail (AND block vs OR block) @@ -103,7 +105,7 @@ def hint(code, aux_code): # X and P can be the same person # this can occur if the problem is not solved using sister/2 if prolog.engine.ask_truth(engine_id, - 'aunt(X, Y), mother(X, Y)'): + 'aunt(X, Y), female(X), parent(X, Y)'): return [{'id': 'aunt_vs_mother'}] # X must have sibling |