W3C home > Mailing lists > Public > public-rule-workshop-discuss@w3.org > July 2005

Re: car color defaults: a story about Scoped Negation As Failure/log:notIncludes

From: Michael Kifer <kifer@cs.sunysb.edu>
Date: Thu, 07 Jul 2005 20:01:30 -0400
To: Dan Connolly <connolly@w3.org>
Cc: Gerd Wagner <wagnerg@tu-cottbus.de>, public-rule-workshop-discuss@w3.org
Message-Id: <20050708000130.CE352CB5D3@kiferserv.kiferhome.com>


> On Thu, 2005-07-07 at 18:28 -0400, Michael Kifer wrote:
> [...]
> > > But you (Michael) say 
> > > that FLORA-2 supports making the scope explicit, right? 
> > > Maybe you can give us an example how this looks like 
> > > in FLORA-2 and what it means in the underlying formal
> > > semantics? 
> > 
> > FLORA-2 has the concept of modules, ...
> 
> This explanation helps some, but I'd especially appreciate
> it if you'd try expressing this car color defaults case
> in FLORA-2.

In FLORA-2, this would look like this:

We need to assume that the info about the cars (over which we are going to
close off) is in module allAboutCars and the facts there have the form

12345:car[color->red].
45678:car[color->blue].
etc.
The 12345 thing is supposed to be the vehicle id number.
The first fact says that 12345 is an object in class car and the attribute
color has the value red, etc.

Now, to express N3's
    this log:forAll :car.
    { :car.auto:specification log:notIncludes {:car auto:color []}}
	=> {:car auto:color auto:black}.

one would write something like this:

?X[realColor->?Color] :- ?X[color->?Color]@allAboutCars.
?X[realColor->black] :- not ?X.color[]@allAboutCars.

The first rule says that if the module allAboutCars has an explicit color
for a car, then it is the real color of that car. You don't have this rule
in your N3 example, but of course it is easy to add.

The second rule says that if allAboutCars says nothing about a particular
car's color then its color is black. This is a counterpart of your default
rule, which involves log:notIncludes.


> Also, I'd appreciate a pointer to some documentation on this
> aspect of FLORA-2.

The most detailed reference is the FLORA-2 manual itself:
http://flora.sourceforge.net/docs/floraManual.pdf

There are several sections on the module system (including encapsulation,
persistent modules, etc.). But you probably don't want to read that much.

The last two papers at http://flora.sourceforge.net/aboutFlora.php
are a much shorter read. The last part of first of these two gives a brief
overview of the module system, incl encapsulation.
The last paper just highlights the scoped negation stuff as one of the
features. Basically, what I explained in my previous message.


This stuff is just a particular realization of scoped negation. As I said,
one can even say that Prolog implementations also realize this idea to some
extent. I don't know if there was something like this before modules were
added to Prolog.


	--michael  
Received on Friday, 8 July 2005 00:01:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:16:21 GMT