W3C home > Mailing lists > Public > public-rif-wg@w3.org > September 2008

RE: more about object creation (ACTION-554)

From: Patrick Albert <palbert@ilog.fr>
Date: Thu, 4 Sep 2008 13:54:07 +0200
Message-ID: <4412C4FCD640F84794C7CF0A2FE890D2F1921B@parmbx02.ilog.biz>
To: "Gary Hallmark" <gary.hallmark@oracle.com>, "rif WG" <public-rif-wg@w3.org>

I like option A, because it is simple, and object creation in PRD has to
be very simple.

Two complementary remarks. 

1/ The variable that can be bound to the newly created object might not
need t be declared. It's name and it's type -- the class of the new
object -- suffice for the declaration.

2/ I don not understand why the initialization of the object is
described as '[' (TERM '->' TERM)* ']', I would replace  by '['
(SLOT-NAME '->' TERM)* ']'


 Patrick. 


-----Original Message-----
From: public-rif-wg-request@w3.org [mailto:public-rif-wg-request@w3.org]
On Behalf Of Gary Hallmark
Sent: mardi 2 septembre 2008 23:36
To: rif WG
Subject: more about object creation (ACTION-554)


At today's telecon we discussed object creation.  Christian and Patrick 
wonder how one obtains a reference to the new object.  I.e. how to 
support the following use case (expressed in FLD):

Forall ?x (Exists ?y ?z And(?y # _Y ?z # _Z ?y[_z->?z] ?z[_x->?x]) :- ?x

# _X)

The proposed syntax

'new' CLASS '[' (TERM '->' TERM)* ']'

provides no good way to do this.  I see several options:

Option A. 'new' [Var '#'] CLASS '[' (TERM '->' TERM)* ']'

e.g.
Forall ?x ?z (Do(new ?z # _Z[_x->?x] new _Y[_z->?z]) :- ?x # _X)

The Var ?z must be declared somewhere, presumably in the enclosing 
Forall.  What happens if the Var is also referenced in the rule
condition?

Option B. Use the FLD syntax for PRD.  The concern is that this is 
overly general and thus PRD would have many hard to specify restrictions

on the use of Exists in a conclusion.

Option C. use a builtin (e.g. rif:new) so that object creation could be 
in core.  E.g.

Forall ?x (And(rif:new(1 ?x) # _Z rif:new(1 ?x)[_x->?x] rif:new(2 ?x) # 
_Y rif:new(2 ?x)[_z->rif:new(1 ?x]) :- ?x # _X)

There are n+1 arguments to rif:new.  The n Forall variables and one 
"occurrence number".  There are m distinct occurrence numbers per 
ruleset, where m is the number of existential variables in the ruleset 
that are "skolemized".  In the above, n=1 and m=2.  Note that rif:new 
has variable arity (n+1).

The drawback of option C is that production rule engines don't typically

provide rif:new as a function.  A PRD translator would find it very 
difficult to translate rif:new in a condition, or indeed in an action 
except for when used in membership with a Class Constant and in frames.

Also, PRD would need to support And() and "#" in conclusions, but "#" 
only in the case where the left side is rif:new...
Received on Thursday, 4 September 2008 11:55:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:33:54 GMT