next up previous
Next: findall Up: No Title Previous: No Title

Obtaining More Solutions

miles(sketches_of_spain).
miles(aura).
miles(do_bop).
miles(tutu).
miles(amandala).
miles(a_kind_of_blue).

jones(back_on_the_block).
jones(right_thing).
jones(swing).

Q: miles(X)
A: X = sketches_of_spain

Then need to explicitly ask for more solutions to the query - in which case it fails backtracking result and repeats the query starting from the point where the last call was satisfied.

A : X = aura

However, if we issue the query :

Q: findall(X,miles(X),L)  
A: X = _34 ; L = [ sketches_of_spain, aura, 
 do_bop, tutu, amandala, a_kind_of_blue ]





Omer F Rana
Thu Feb 20 20:05:17 GMT 1997