RE: question about frames

Agree with Michael's comment.

 

Expressing a rule such as "forall(?x) Q(?x) => P(?x)" in a system mixing
objects and rules, usually comes in on of two complementary and easy
cases.

 

The trick is that with objects, all variables are typed, so you need to
accept not having "forall(?x)" statements, but rather "forall(?x:class)"
meaning that the quantification is restricted to "all instances of
class".

 

If you accept that then:

 

Case 1: Q and P are represented as in fact class predicates, then you
formulate "Q(?x) => P(?x)" as  "a Q is a P". (a Human is a Mammal)

 

Case 2: Q and P are unary predicates applied to objects of some classes,
then you state that "forall ?x:class, Q(?x) => P(?x)". (if a human is
retired then the human has free-time)

 

 

 

 Patrick. 

 

 

 

 

-----Original Message-----
From: public-rif-wg-request@w3.org [mailto:public-rif-wg-request@w3.org]
On Behalf Of Michael Kifer
Sent: vendredi 9 mai 2008 10:32
To: Gary Hallmark
Cc: RIF WG
Subject: Re: question about frames 

 

 

 

Yes, this is the closest that BLD has to what you need.

It is not an issue of frames vs. relations, but of the inability to have

existentials in the head of the rules in a Horn dialect.

 

For translating BLD->OBR, you could establish a convention that would
use a

fixed known function symbol, so your compiler would know to convert it
back

to new().

 

 

      --michael  

 

> 

> I think "f" could be useful for translating from OBR -> BLD.  I
glossed 

> over it at first because OBR does not support logical functions, so
I'm 

> not sure what to do if I get a logical function when translating from 

> BLD -> OBR.  I guess the translator could know about "f" and nothing 

> more just for roundtripping.

> 

> 

> kifer@cs.sunysb.edu wrote:

> >> I'm wondering how to write some simple rules using frames because
frames 

> >> map to the Java beans that Oracle Business Rules uses as its facts 

> >> better than relations.  Or so I hoped.  The problem I seem to be
having 

> >> is with frame OIDs.  I don't want to have to specify them in a rule


> >> conclusion.  For example, consider the simple rule using relations
p and q:

> >>

> >> forall(?x) Q(?x) :- P(?x)

> >>

> >> How do I do this using frames instead of relations?  I think I want

> >>

> >> forall(?x, ?p) and(exists(?q) ?q#Q[x->?x]) :- ?p#P[x->?x]

> >>

> >> Unfortunately this is illegal in BLD because heads cannot be
formulas, 

> >> only atomic.  How can I conclude (assert) that frame a instance
exists 

> >> without giving its OID?  Or do we need some kind of gensym builtin
for 

> >> this?

> >>     

> >

> > What you want to do is not possible *in principle* in a Horn-based
language

> > like BLD. The best you can do is to approximate this with a function
symbol:

> >

> > forall ?x ?p and(f(?p)#Q  f(?p)[x->?x]) :- and(?p#P ?p[x->?x])

> >

> > or (depends on what you are up to)

> >

> > forall ?x ?p and(f(?x ?p)#Q  f(?p)[x->?x]) :- and(?p#P ?p[x->?x])

> >

> >

> > What you want to do is possible in FLD, however. (More precisely, in
an

> > FLD-based extension of BLD.)

> >

> >

> >   --michael  

> >

> >   

> 

> 

 

 

 

Received on Friday, 9 May 2008 13:18:08 UTC