From ca743bffb497dea794950bf2bbda45e3bb4c936b Mon Sep 17 00:00:00 2001
From: Aleksander Sadikov T
into reversed tail ==
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
-H
outside of the recursive call.