Negations and Negated Conjuctions in Formulae.

I have a SML based N3 parser that does most of the core stuff and simple
formulae.  I am marrying up the Parser with a Rete implementation and
started to write simple N3 tests for the Rete and hit a couple of N3
notation issues.

I am assuming a simple block world.
i.e. 

:b1 :on :b2;
     :color :blue .
....	

1. Negated Conjunctions

{?x :on ?y . ?y :leftof ?z . ~ ( ?z :color :red . ?z :on ?w.) } => ...

This production matches if there is a stack of (at least) two blocks
designated by ?x and ?y to the left of some block, ?z, which is not both
red and on some other block.

With negated conjunctions the following works as well.
A production that checks whether every red block has a blue block on top
of it can be re-written as there is no red block that does not have a
blue block on top of it, i.e.

Using SOAR-like notation, not N3.

~{ (?x color red) ~{ (?y on ?x) (?y color blue) } } => ....

2. Simple Negated Condition

(?x on ?y) (?y leftof ?z) ~(?z color red) => ....

Matches if there is a stack of (at least) two blocks to the left of some
block which is "not" known to be red.

Does N3 have a notation to create these kind of Rules/Formulae?

Ray

Received on Tuesday, 19 October 2004 02:52:00 UTC