diff options
author | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2016-02-29 17:07:37 +0100 |
---|---|---|
committer | Aleksander Sadikov <aleksander.sadikov@fri.uni-lj.si> | 2016-02-29 17:07:37 +0100 |
commit | 815063053ef46e3baad68564585c306fc559eaad (patch) | |
tree | 615713417fe4f8423c714e602684944c4bd6b38d /prolog/problems/family_relations/cousin_2/common.py | |
parent | c3294f78c516f41b7ab40e67a88b874cf4a80cbb (diff) |
Some minor corrections in accompanying texts.
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) |