collecting the moves of the monkey of the monkey banana problem



hi
i'm a real novice in prolog. our prof taught us the monkey-banana
problem, followed by some basic operations on list .
the real assignment is to add the valid moves of the monkey to the
list. the final result should not contain any invalid moves made that
does not enable the monkey to get the banana. i wud be grateful if
someone helps me out.

.