🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #637

Re: transitive and symetric relations

#637
From: Ken Johnson
Date: Fri, 14 Aug 1992 10:21
25 lines
1207 bytes
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
Technical Details
Message-ID: <7199@skye.ed.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!edcastle!aiai!ken
References: <SWK.92Aug10220513@seymour.mlb.semi.harris.com> <189@syllogi.syllogic.nl> <1992Aug13.111745.17980@odin.diku.dk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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