home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!uknet!edcastle!aiai!ken
- From: ken@aiai.ed.ac.uk (Ken Johnson)
- Newsgroups: comp.lang.prolog
- Subject: Re: transitive and symetric relations
- Message-ID: <7199@skye.ed.ac.uk>
- Date: 14 Aug 92 10:21:09 GMT
- References: <SWK.92Aug10220513@seymour.mlb.semi.harris.com> <189@syllogi.syllogic.nl> <1992Aug13.111745.17980@odin.diku.dk>
- Followup-To: comp.lang.prolog
- Organization: Bugs-R-Us
- Lines: 25
-
-
- In article <1992Aug13.111745.17980@odin.diku.dk> torbenm@diku.dk (Torben
- AEgidius Mogensen) writes:
-
- # A correct formulation of the transitive clause is
- #
- # distance(X,Z,D) :-
- # distance_fact(X,Y,D1),
- # distance(Y,Z,D2),
- # D is D1 + D2.
-
- This may loop indefinitely. For instance, suppose you invoked it with
-
- ?- distance(london,paris,X).
-
- when `paris' was not mentioned in any distance fact.
-
- -- Ken "old lag" Johnson
-
-
- --
- //// Advice to dieters: //// Ken Johnson, A I Applications Institute
- //// Never eat more than //// 80 South Bridge, EDINBURGH EH1 1HN
- //// you can carry. //// E-mail ken@aiai.ed.ac.uk
- //// -- Miss Piggy //// phone 031-650 2756 fax 031-650 6513
-