I have the following function:
fillNonDrivers(Car, Pmd, Plo, ListOfPassengers) :-
select(Passenger, Pmd, Plo1),
Passenger = [_,n,_],
/* etc */
I invoke it with trace on in the following way:
fillNonDrivers([hello, 2], [[david, n, punk]], PLO, LOP).
1 1 Call: fillNonDrivers([hello,2],[[david,n,punk]],_29,_30) ? c
2 2 Call: select(_111,[[david,n,punk]],_112) ? c
2 2 Exit: select([david,n,punk],[[david,n,punk]],[]) ? c
2 2 Redo: select([david,n,punk],[[david,n,punk]],[]) ? c
2 2 Fail: select(_99,[[david,n,punk]],_100) ? c
1 1 Fail: fillNonDrivers([hello,2],[[david,n,punk]],_29,_30) ? c
no
I do not understand why Redo is called in the above trace. Shouldn't have the select "worked", and thus the next line invoked be
Passenger = [_,n,_],
Could someone help explain the appearance of redo here? Thank you in advance.