W3C home > Mailing lists > Public > public-cwm-talk@w3.org > October to December 2005

list sum and difference

From: <jos.deroo@agfa.com>
Date: Wed, 28 Dec 2005 14:51:03 +0100
To: public-cwm-talk@w3.org
Message-ID: <OF3AE42E81.85661153-ONC12570E5.0049F3B9-C12570E5.004C0ED2@agfa.com>

while testing with euler I am getting that

@prefix : <http://eulersharp.sourceforge.net/2005/11swap/list#>.
((:a :b :c) (:d :e :f :g)) :sum (:a :b :c :d :e :f :g). 
((:a :b :c :d :e :f :g) (:g :f :b :e)) :difference (:a :c :d). 

using

{} => {(() ?L) :sum ?L}.
{(?L1 ?L2) :sum ?L} => {([rdf:first ?A; rdf:rest ?L1] ?L2) :sum [rdf:first 
?A; rdf:rest ?L]}.

{} => {(() ?A) :remove ()}.
{(?L1 ?A) :remove ?L} => {([rdf:first ?A; rdf:rest ?L1] ?A) :remove ?L}.
{?A log:notEqualTo ?B. (?L1 ?A) :remove ?L} => {([rdf:first ?B; rdf:rest 
?L1] ?A) :remove [rdf:first ?B; rdf:rest ?L]}.

{} => {(?L ()) :difference ?L}.
{(?L1 ?A) :remove ?R. (?R ?L2) :difference ?L} => {(?L1 [rdf:first ?A; 
rdf:rest ?L2]) :difference ?L}.


but with those rules cwm seems to stay running
is it possible to run those rules in forward chaining mode? any other 
rules that do the job?

a bit like the prolog notation, I'm also testing with (?A/?L) as shorthand 
for [rdf:first ?A; rdf:rest ?L]
 
-- 
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
Received on Wednesday, 28 December 2005 13:51:28 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:01:04 UTC