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. --- prolog/problems/family_relations/mother_2/common.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'prolog/problems/family_relations/mother_2/common.py') 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'}] -- cgit v1.2.1