From ca743bffb497dea794950bf2bbda45e3bb4c936b Mon Sep 17 00:00:00 2001 From: Aleksander Sadikov Date: Sat, 27 Aug 2016 03:31:18 +0200 Subject: English translation for conc/3 added. --- prolog/problems/lists_advanced/rev_2/en.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'prolog/problems/lists_advanced/rev_2') diff --git a/prolog/problems/lists_advanced/rev_2/en.py b/prolog/problems/lists_advanced/rev_2/en.py index 3b85a74..dbb08a2 100644 --- a/prolog/problems/lists_advanced/rev_2/en.py +++ b/prolog/problems/lists_advanced/rev_2/en.py @@ -25,7 +25,7 @@ and if I assume the recursion reverses tail T into reversed tail The operator == is "stricter" than operator = in the sense that -for the latter it is enough to be able to make two elements equal (unification). Perhaps by using = +for the latter it is enough to be able to make the two operands equal (unification). Perhaps by using = you can make the predicate rev/2 more general (e.g. able to work with output arguments becoming inputs).

Of course, you can also solve the exercise without explicit use of either of these two operators, just remember that unification is implicitly performed with the predicate's arguments (head of clause).

@@ -72,7 +72,7 @@ an assigned value)!

Don't force the result onto recursion, don't tell it what it should return. Just assume it will do its job. If this assumption is correct, then the rule will work for a larger case.

Is your recursive call of the form rev(T, [RevTail|H])? This forces the recursive call to -return the head at the end of the list. But it doesn't know of this head, because you just +return the head at the end of the list. But it doesn't know of this head, because you just took it away! Inserting the head into the result, returned by the recursive call, is your job. To put it shortly, insert H outside of the recursive call.

''', -- cgit v1.2.1