From sdg.ml@infinito.it Wed Feb  7 00:58:21 2001
Received: from sdegiorgi ([62.122.13.159])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f16NwKZ08557
	for <prolog@swi.psy.uva.nl>; Wed, 7 Feb 2001 00:58:21 +0100 (MET)
Received: from [127.0.0.1] by sdegiorgi
  (ArGoSoft Mail Server, Version 1.5 (1.5.0.8)); Wed, 7 Feb 2001 00.58.57 +0100
From: sdg.ml@infinito.it
To: prolog@swi.psy.uva.nl
Date: Wed, 7 Feb 2001 00:58:16 +0100
Lines: 51
Message-ID: <MWMail.lonmoodd@host.none>
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Mailer: Kaufman Mail Warrior 3,61 Final
Subject: [SWIPL] negation

Hi,

1st question
------------
A = universal quantifier
E = existential     "
~ = not

A n: p(n) -> s(n)
is equivalent to   s(N) :- r(N).


(1)  A n: ( p(n) & ~ E r: q(n,r) ) -> s(n).
is equivalent to
(2)  s(N) :- p(N), \+ q(N,R).  ?

Causifing (1)  result in

p(N) & ~q( N,Skf(N) ) -> s(N)
(a Skolem function appear instead of R)

are this equivalent to (2)?
Which is the correct translation of (1) in Prolog and why?


2nd question
-------------
negated goals must be ground for negation as failure in Prolog to work correctly

Hence,

?- \+ p(X), q(X).
fail even if there exists X (=2) such that q(X) and not p(X)

?- q(X), \+ p(X).
work because each time Prolog try \+ p(X)   X is grounded by q(X).

But what about  "?- \+ ( p(X), \+ q(X) )."   ?

Outermost negation isn't ground, then there will be situations in which Prolog
doesn't work correctly? Do you have an example of such situation?

The meaning of "\+ p(X)" in the Closed World Assumption" could be
paraphrased as:   ~ E x.p(x)   instead of  "x is such that ~p(x)"  ?



Thanks.
--
Stefano De Giorgi



