summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/conc_3
diff options
context:
space:
mode:
authorAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-03-14 18:53:13 +0100
committerAleksander Sadikov <aleksander.sadikov@fri.uni-lj.si>2016-03-14 18:53:13 +0100
commit39dda4c1ad8bae96754b48b8ac14f3e21594f23c (patch)
tree891627e2ceef74d6cf731a68486410a73f249ab3 /prolog/problems/lists/conc_3
parent865425804481a4b002558ff2e794dcc3b54fd372 (diff)
Hint for conc/3 corrected.
Diffstat (limited to 'prolog/problems/lists/conc_3')
-rw-r--r--prolog/problems/lists/conc_3/common.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/prolog/problems/lists/conc_3/common.py b/prolog/problems/lists/conc_3/common.py
index 58152a6..108a334 100644
--- a/prolog/problems/lists/conc_3/common.py
+++ b/prolog/problems/lists/conc_3/common.py
@@ -82,6 +82,10 @@ def hint(code, aux_code):
# recursion is getting bigger and bigger
+ # base case succeeds with arbitrary result
+ if prolog.engine.ask_truthTO(engine_id, 'conc([], [a,b,c], L), var(L)'):
+ return [{'id': 'base_case_arbitrary'}]
+
# shortening the second list instead of first list
if prolog.engine.ask_truthTO(engine_id,
'conc([a,b,c], [1,2,3,4], L), (L = [1,2,3,4,a,b,c] ; L = [4,3,2,1,a,b,c])'):
@@ -108,10 +112,6 @@ def hint(code, aux_code):
return [{'id': 'two_heads_markup', 'start': m[0], 'end': m[1]} for m in marks] + \
[{'id': 'two_heads'}]
- # base case succeeds with arbitrary result
- if prolog.engine.ask_truthTO(engine_id, 'conc([], [a,b,c], L), var(L)'):
- return [{'id': 'base_case_arbitrary'}]
-
# missing/failed base case
if not prolog.engine.ask_one(engine_id, 'conc([], [qa,qb,qc], [qa,qb,qc])'):
return [{'id': 'base_case'}]