diff options
Diffstat (limited to 'prolog/problems/family_relations/cousin_2/common.py')
-rw-r--r-- | prolog/problems/family_relations/cousin_2/common.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/prolog/problems/family_relations/cousin_2/common.py b/prolog/problems/family_relations/cousin_2/common.py index c6d07c7..86ef5cc 100644 --- a/prolog/problems/family_relations/cousin_2/common.py +++ b/prolog/problems/family_relations/cousin_2/common.py @@ -40,6 +40,7 @@ hint_type = { 'cousin_vs_sibling': Hint('cousin_vs_sibling'), 'cousin_to_oneself': Hint('cousin_to_oneself'), 'cousin_need_not_be_parent': Hint('cousin_need_not_be_parent'), + 'predicate_always_false': Hint('predicate_always_false'), } test_cases = [ @@ -84,6 +85,10 @@ def hint(code, aux_code): return [{'id': 'gender_is_irrelevant_markup', 'start': m[0], 'end': m[1]} for m in marks] + \ [{'id': 'gender_is_irrelevant'}] + # target predicate seems to always be false + if not prolog.engine.ask_truth(engine_id, 'cousin(_, _)'): + return [{'id': 'predicate_always_false'}] + # precedence fail (AND block vs OR block) # case in point: parent(PX, X), parent(PY, Y), brother(PX, PY) ; sister(PX, PY) # or this case: parent(PX, X), parent(PY, Y), sister(PX, PY) ; brother(PX, PY) |