[Home] [By Thread] [By Date] [Recent Entries]
Richard Tobin wrote: > Try descendant(cain,adam), then swap around descendant so that it is > > descendant(N,N2) :- descendant(N3,N2), parent(N,N3). > descendant(N,N). > > and try again. It will recurse ad infinitum. Prolog just does a > depth-first search. Right enough: the stack blows up. Funny it can't notice that case (not in general, of course, just in static cases) and rearrange the alternatives. -- There is / one art || John Cowan <jcowan@r...> no more / no less || http://www.reutershealth.com to do / all things || http://www.ccil.org/~cowan with art- / lessness \\ -- Piet Hein
|

Cart



