General
Material
Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5

Hint

Again, all the predicate mirror/2 will do is to call the predicate mirror/3 with a suitable instantiation of the accumulator.

What the 3-place mirror predicate should do is to take, one after the other, elements from the front of the list and stack them onto the accumulator. When the input list is empty, the accumulator will contain the reversed list. Here is a picture to illustrate this idea.

Solution

Back to the exercise.