[Home] [By Thread] [By Date] [Recent Entries]

  • From: John Cowan <jcowan@r...>
  • To: Richard Tobin <richard@c...>
  • Date: Tue, 08 May 2001 13:34:52 -0400

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


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member