Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!news.mathworks.com!tank.news.pipex.net!pipex!in2.uu.net!portal.austin.ibm.com!bocanews.bocaraton.ibm.com!watnews.watson.ibm.com!eclipse!usenet
From: paulward@torolab.vnet.ibm.com (paulward)
Subject: Re: is there a sound/complete implementation of negation as failure?
Sender: usenet@eclipse.torolab.ibm.com (eclipse sysadm)
Message-ID: <PAULWARD.95Sep25085816@skyhawk.torolab.vnet.ibm.com>
In-Reply-To: Slava A. Petukhin's message of Fri, 22 Sep 95 16:38:18 +0900
Date: Mon, 25 Sep 1995 12:58:16 GMT
Lines: 52
References: <DEqtF3.Dzo@uns.bris.ac.uk> <AAgVcOm863@uni.irkutsk.su>
Organization: IBM Toronto Lab

>>>>> "Slava" == Slava A Petukhin <slava@uni.irkutsk.su> writes:

Slava> John Lloyd writes:
>> In article <42q4gc$1vb@coopers.cs.ubc.ca>, poole@cs.ubc.ca (David Poole) writes:
>> |> I am looking for a version of a Prolog-like language that correctly
>> |> implements negation as failure, ...
>> |>
>> |> Here is the application:
>> |> I am constructing a list of terms of the form p(X,Y) and want to enforce
>> |> the constraint that p is functional (if the X's agree the Y's must agree).
>> |>
Slava>  ...
>> |> I expect the following results (all of which follow from the above program
>> |> using Clark's completion, or the stable model semantics or ... )
>> |>
Slava>  ...
>> |> ? functional([p(a,Y),p(Z,c),p(a,X)])
>> |> succeeds with two answers:
>> |>   X=Y & Z\=a
>> |>   Z=a X=Y=c
>> |> (or some other representation of the constraints on these)
>> 
>> Here is the Escher solution to this nice little challenge.
>> 
>> It would be interesting to hear about other LP systems which can handle
>> this kind of thing.


Slava> I work on an extension of logic programming (generalizing negation as
Slava> failure). Now it's called "logic programming with implications".
Slava> It solves this problem by a kind of the following (the syntax is not
Slava> finally defined) :

Slava> functional(L) :-
Slava>     forall [X,Y1,Y2] : (member(p(X,Y1),L), member(p(X,Y2),L) -> Y1 = Y2).

Slava> This definition results in just David Poole's answers.

Slava> I am sorry to say there is no implementation yet (but I intend do it).

You might be interested in checking out my Masters Thesis: A
Propositional Meta-Constraint System (University of Waterloo, March
1993), in which I generalize Saraswat's "store as constraint" from a
conjunction of constraints into a full propositional formula (I used a
disjunction of negated or base constraints; where the base constraints
are those of the system I was lifting).  It allows exactly the above
types of constraints
-- 
-- Paul (paulward@vnet.ibm.com)
   DB2/6000 and DB2/PE Development.
If your enemy is hungry, give him food to eat; 
if he is thirsty, give him water to drink.     Prov 25:21
