Re: On production rules and phase I&II

My comments are interspersed in Peter's mail below. -hak

Peter F. Patel-Schneider wrote:

> From: Hassan Aït-Kaci <hak@ilog.com>
> Subject: Re: On production rules and phase I&II
> Date: Wed, 08 Mar 2006 15:27:44 +0100
> 
> 
>>Peter F. Patel-Schneider wrote:
>>
>>>In the absence of any demonstration that appending two lists can be performed
>>>by recursive (Horn) rules, 
>>
>>Here's the requested demonstration for pure Horn and no meta-rules:
>>
>>	append([],L,L).
>>	append([H|T],L,[H|R]) :- append(T,L,R).
>>
>>>by recursive (Horn) rules, why should it be incumbent on me to show that it can
>>>be done in pure production rules?  
>>
>>I did my part. Now, it is your (or anyone's) turn in "Pure PRs" ...
> 
> How about
> 
>  	(p (cons ^head <H> ^tail <T> ^result <L>)
> 	   --->
> 	   (make append ^left nil ^right <L> ^result <L>) )
> 
>  	(p (append ^left <T> ^right <L> ^result <R>) 
> 	   (cons ^head <H> ^tail <T> ^result <M>) 
> 	   (cons ^head <H> ^tail <R> ^result <N>)
> 	   --->
> 	   (append ^left <M> ^right <L> ^result <N>) )
> 	   
> Well, yes, this doesn't work,  

Sorry won't do. Nothing short of a fully and correctly working example
will do to convince me, I'm afraid.

Incidentally, your (not working) OPS5 "append" example above still uses
a meta-encoding (the "p" symbol). This does not stand as a recursive
rule: the symbol "append" is used as a constructor.  Even then, there
is a more problematic situation here: as you assert partial lists
(which is what I assume "make" does in your OPS5 example), these objects
will also be matched by your rules in further rule applications. How
do you suggest preventing those matches to restrict matches only to
the topmost "cons" cell in the WM? (Without retracts or update of course).

>                               but only because pure production rules don't have
> functions, which are needed in Prolog to do things like append.  This isn't
> even a problem in theory, because we could simply provide the working memory
> elements corresponding to the cons's.

Ok, then: do not bother with Prolog. Let us retrict Pure Horn to Datalog
(already a substantial concession, but never mind!) and now your (or anyone's)
exercise is to do recursive transitive closure in pure PRs (i.e., using only
asserts and no meta-rules) as in:

	ancestor(X,Y) :- parent(X,Y).
	ancestor(X,Y) :- parent(X,Z), ancestor(Z,Y).

> peter

-hak
-- 
Hassan Aït-Kaci
ILOG, Inc. - Product Division R&D
tel/fax: +1 (604) 930-5603 - email: hak @ ilog . com

Received on Wednesday, 8 March 2006 15:54:08 UTC