From dbbca6aaf0fa33c6ae152cc361a05522776f5a72 Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Wed, 9 Mar 2016 20:42:22 +0100 Subject: Hints for del/3 updated. --- prolog/problems/lists/del_3/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/prolog/problems/lists/del_3/common.py b/prolog/problems/lists/del_3/common.py index 65c51d1..deadbf8 100644 --- a/prolog/problems/lists/del_3/common.py +++ b/prolog/problems/lists/del_3/common.py @@ -97,7 +97,9 @@ def hint(code, aux_code): return [{'id': 'lost_heads'}] # used [X|T] instead of more general [H|T] in recursive case - if prolog.engine.ask_truth(engine_id, 'del(q, [a,b,c,d,q,x,y,z], [x,y,z])'): + if prolog.engine.ask_truth(engine_id, \ + 'findall(NL, del(q, [q,q,q,a,b,c], NL), [[q,q,a,b,c],[q,q,a,b,c],[q,q,a,b,c]]).') and \ + not prolog.engine.ask_truth(engine_id, 'del(q, [a,b,c,q,x,y,z], [a,b,c,x,y,z])'): return [{'id': 'leading_heads_all_x'}] # L=[H|T] at the end of the rule; this can be detected with test cases and can be wrong (in some sense) -- cgit v1.2.1