summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/conc_3
diff options
context:
space:
mode:
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'}]