🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.prolog
Article #1485

Re: Implication in Prolog (sigh...)

#1485
From: Richard A. O'Keefe
Date: Thu, 06 Dec 1990 08:59
36 lines
1485 bytes
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.
Technical Details
Message-ID: <4451@goanna.cs.rmit.oz.au>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!samsung!munnari.oz.au!goanna!ok
References: <1990Nov30.155356.7584@swift.cs.tcd.ie>

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