From c61d06eab2c15928a928fcea106f276013902bb0 Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Wed, 9 Mar 2016 01:39:55 +0100 Subject: Hints for memb/2 added. --- prolog/problems/lists/memb_2/common.py | 10 +++++----- prolog/problems/lists/memb_2/sl.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'prolog/problems/lists/memb_2') diff --git a/prolog/problems/lists/memb_2/common.py b/prolog/problems/lists/memb_2/common.py index 4f2a251..45e070a 100644 --- a/prolog/problems/lists/memb_2/common.py +++ b/prolog/problems/lists/memb_2/common.py @@ -72,14 +72,14 @@ def hint(code, aux_code): # recursion is getting bigger and bigger - # target predicate seems to always be false - if not prolog.engine.ask_truth(engine_id, 'memb(_, _)'): - return [{'id': 'predicate_always_false'}] - # missing/failed base case - if not prolog.engine.ask_truthTO(engine_id, 'memb(qq, [qq|_])'): + if not prolog.engine.ask_truthTO(engine_id, 'memb(qq, [qq,_,_,_])'): return [{'id': 'base_case'}] + # target predicate seems to always be false + if not prolog.engine.ask_truth(engine_id, 'memb(_, [_,_,_,_,_,_])'): + return [{'id': 'predicate_always_false'}] + # TODO: Tim, can we include 'fail'-used as a general hint? except socket.timeout as ex: diff --git a/prolog/problems/lists/memb_2/sl.py b/prolog/problems/lists/memb_2/sl.py index 5b44521..f2d0ce2 100644 --- a/prolog/problems/lists/memb_2/sl.py +++ b/prolog/problems/lists/memb_2/sl.py @@ -30,7 +30,7 @@ hint = { 'eq_instead_of_equ': '''\

Operator == je strožji od operatorja = v smislu, da je za slednjega dovolj, da elementa lahko naredi enaka (unifikacija). Morda z uporabo = narediš predikat -member/2 delujoč tudi v kakšni drugi smeri.

+memb/2 delujoč tudi v kakšni drugi smeri.

''', 'eq_instead_of_equ_markup': '''\ -- cgit v1.2.1