Subject: [SWIPL] negation

From: [email-masked]
Date: Wed, 7 Feb 2001 00:58:16 +0100

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