lists and the N3 abstract syntax

Consider swap/test/lists/list_include.n3 ,
which I just checked in:

{
  { bob likes (apple banana) }
  log:includes
  { bob likes [ rdf:first apple] }
}
 => { thisTest a Pass }.

Cwm does conclude thisTest a Pass.
Jos, does Euler?

I'm working on some code to explore N3 abstract syntax
  http://www.w3.org/2000/10/swap/n3absyn.py

It uses RDFStore.load() to read a formula (so it
groks both RDF/XML and N3) and converts it to a
JSON datastructure; i.e. something just using
strings, integers, lists, and dictionaries.

It can then print it out as a lisp s-expression
suitable for use with ACL2
(see notes on my visit with the ACL2 folks
http://dig.csail.mit.edu/breadcrumbs/node/160 )
and just today I added support for the design
being kicked around in the RIF WG.
http://lists.w3.org/Archives/Public/public-rif-wg/2006Sep/0073.html

In both cases, I had to decide whether N3 list
syntax is
 - short-hand notation for a bunch of
   existential variables and first/rest triples

 - a first-class part of N3 abstract syntax

In both cases, I chose the latter.


This means that this formula:

 bob likes [ rdf:first apple; rdf:rest nil ].

is a different formula from this formula:

 bob likes ( apple ).

cwm parses those two the same, but the parts
of the list_include.n3 rule are distinct.
It seems that log:includes does more than
just RDF simple entailment; it also does
some sort of "list entailment"; i.e. it
has rules sorta like this built in:

 { ?L = (?X ?Y) } => { ?L rdf:first ?X }

I think the way this is implemented is that rdf:first
is registered as a built-in, and log:includes does
built-ins, right?

Weird... no... I get :sumNotIncluded     a :Pass 
when I add these tests:

{ { bob eats peas } log:includes { (1 1) math:sum 2 }
} => { includesDoesBuiltinsTest a Pass }.

{ { bob eats peas } log:notIncludes { (1 1) math:sum 2 }
} => { sumNotIncluded a Pass }.

-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E

Received on Monday, 25 September 2006 22:52:45 UTC