Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: Implication in Prolog (sigh...) Message-ID: <4451@goanna.cs.rmit.oz.au> Date: 6 Dec 90 08:59:51 GMT References: <1990Nov30.155356.7584@swift.cs.tcd.ie> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 36 In article <1990Nov30.155356.7584@swift.cs.tcd.ie>, brady@swift.cs.tcd.ie writes: > This is a really ignorant question, but I don't use C Prolog at all... > Is the -> predicate meant to mean some kind of implication? -> is a control structure. It is described in many Prolog textbooks. It is Prolog's version of "if". ( P -> Q ) if P succeeds, then commit to it and then do Q (similar to P, !, Q) ( P -> Q if P succeeds, then commit to it ; R and then do Q, or else do R ) (similar to (P, !, Q ; R)) > Is it defined as if by the following: > A -> B :- call(A),call(B). No. The definition works like this, ignoring cuts in P, Q, R. ;( ->( P, Q ), R ) :- P, !, Q. ;( ->( P, Q ), R ) :- !, R. ;( P, Q ) :- P. ;( P, Q ) :- Q. ->(P, Q) :- P, !, Q. > Has it got something to do with unsound negation? Yes. \+ (P) "P does not succeed/is not provable" is identical to (P -> fail ; true) -- The Marxists have merely _interpreted_ Marxism in various ways; the point, however, is to _change_ it. -- R. Hochhuth. Brought to you by Super Global Mega Corp .com