From 5402c60cc2ff966eaaada82fefe71431abae1657 Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Mon, 29 Feb 2016 15:13:44 +0100 Subject: Hints for aunt/2 improved. --- prolog/problems/family_relations/aunt_2/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'prolog/problems/family_relations/aunt_2') 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 -- cgit v1.2.1