summaryrefslogtreecommitdiff
path: root/prolog/problems/family_relations/descendant_2/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'prolog/problems/family_relations/descendant_2/common.py')
-rw-r--r--prolog/problems/family_relations/descendant_2/common.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/prolog/problems/family_relations/descendant_2/common.py b/prolog/problems/family_relations/descendant_2/common.py
index b4d8f31..6cfe1cd 100644
--- a/prolog/problems/family_relations/descendant_2/common.py
+++ b/prolog/problems/family_relations/descendant_2/common.py
@@ -30,6 +30,7 @@ hint_type = {
'descendant_of_oneself_with_or': Hint('descendant_of_oneself_with_or'),
'descendant_need_not_be_parent': Hint('descendant_need_not_be_parent'),
'wrong_direction': Hint('wrong_direction'),
+ 'predicate_always_false': Hint('predicate_always_false'),
'timeout': Hint('timeout'),
'final_hint': Hint('final_hint'),
}
@@ -88,6 +89,10 @@ def hint(code, aux_code):
return [{'id': 'grandparent_used_markup', 'start': m[0], 'end': m[1]} for m in marks] + \
[{'id': 'grandparent_used'}]
+ # target predicate seems to always be false
+ if not prolog.engine.ask_truthTO(engine_id, 'descendant(_, _)'):
+ return [{'id': 'predicate_always_false'}]
+
# ancestor instead of descendant (wrong direction)
# warning: knowledge base dependent
if prolog.engine.ask_truthTO(engine_id,