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

  • From: Richard Tobin <richard@c...>
  • To: xml-dev@l...
  • Date: Tue, 08 May 2001 17:36:24 +0100 (BST)


>> Change the order of the rules for 'human', however,
>> to 3412, however, and the system will have trouble
>> figuring out even that 'adam' is human.

> I fed both versions into GNU Prolog 1.2.1 and it
> handled both with no problem.

Michael's example wasn't quite right.

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.

-- Richard

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