summaryrefslogtreecommitdiff
path: root/prolog/problems
diff options
context:
space:
mode:
authorAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-02-29 18:12:57 +0100
committerAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-02-29 18:12:57 +0100
commit5fc3637dadebf30edaf761f25523863cc409e52f (patch)
tree5bbc34790feae557db3ffb07f4d95b12b990e3d7 /prolog/problems
parent0c5bd3035d7e5b6b7a507b986def5a8ce42ba97b (diff)
Improved hints for ancestor/2.
Diffstat (limited to 'prolog/problems')
-rw-r--r--prolog/problems/family_relations/ancestor_2/common.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/prolog/problems/family_relations/ancestor_2/common.py b/prolog/problems/family_relations/ancestor_2/common.py
index 49df9ad..7f6beea 100644
--- a/prolog/problems/family_relations/ancestor_2/common.py
+++ b/prolog/problems/family_relations/ancestor_2/common.py
@@ -85,7 +85,7 @@ def hint(code, aux_code):
# TODO: how will ask_truth handle/return timeouts...
# TODO: timeout is the same as fail in this particular case
if prolog.engine.ask_truth(engine_id,
- 'parent(X, Y), \+ ancestor(X, Y)'):
+ '\+ (findall(X/Y, parent(X, Y), L), member(X/Y, L), \+ ancestor(X, Y))'):
return [{'id': 'base_case'}]
# ancestor to oneself