diff options
Diffstat (limited to 'prolog/problems/lists/del_3/common.py')
-rw-r--r-- | prolog/problems/lists/del_3/common.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/prolog/problems/lists/del_3/common.py b/prolog/problems/lists/del_3/common.py index 125ece1..65c51d1 100644 --- a/prolog/problems/lists/del_3/common.py +++ b/prolog/problems/lists/del_3/common.py @@ -28,6 +28,7 @@ hint_type = { 'del_from_empty_list_success': Hint('del_from_empty_list_success'), 'lost_heads': Hint('lost_heads'), 'recursive_case': Hint('recursive_case'), + 'leading_heads_all_x': Hint('leading_heads_all_x'), } test_cases = [ @@ -95,6 +96,10 @@ def hint(code, aux_code): if prolog.engine.ask_truth(engine_id, 'del(q, [a,b,c,d,q,x,y,z], [x,y,z])'): 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])'): + 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) # TODO: implement it, and provide a good explanation (might be hard) |