Re: question about frames

> Thanks for clear answers to a not-so-clear question.  Let me expand just 
> a bit.  In my PR system (OBR), the action that corresponds most
> closely to a rule "head" or conclusion is the so-called "assert new" 
> action.  This action creates a new java object (a frame instance of a 
> given class) , initializes its javabean properties (slots) with given 
> values, and asserts it to Jess.
> 
> I want to translate some subset of my rules to BLD, namely rules without 
> negation, aggregation, or actions other than assert new.
> 
> Here is a simple rule (fusing OBR and BLD syntax):
> 
> IF and(?p#P ?p[x->?x]) THEN assert new Q[x->?x]
> 
> Do I translate to this:
> 
> forall ?x ?p (Q(?x) :- and(?p#P ?p[x->?x]))
> 
> That seems a little wrong.  OBR doesn't support relations, only frames, 
> but it lets one use frames instead of relations. But BLD doesn't really 
> let one dispense with relations and use only frames.  Is this also an 
> issue for RDF + RIF?

This is not an issue for RIF-RDF.  If people want to use relations in 
their rules about RDF data they can do so.  However, they need to keep 
in mind that there is no connection between frames and relations, other 
than the connections made in the rules.

> 
> Possibly this translation, that seems more faithful to the original, is 
> closer to legal BLD:
> 
> forall ?x ?p ?q (and(?q#Q ?q[x->?x]) :- and(?p#P ?p[x->?x] 
> ?q=external(new())))
> 
> here, new() is a builtin that returns a new instance of a frame.  Is 
> "new", not being a mathematical function, no-good for BLD semantics?
> it seems to interfere with removing the conjunct from the head.

I think there might indeed be problems giving a BLD-compatible semantics 
to "new".  At least, I do not see how to do so at the moment.

I think that Michael's suggestion for using function symbols is probably 
the way to go for translating your rules to BLD.

Best, Jos

> 
> 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 
>>   
> 

-- 
Jos de Bruijn            debruijn@inf.unibz.it
+390471016224         http://www.debruijn.net/
----------------------------------------------
An expert is a person who has made all the
mistakes that can be made in a very narrow
field.
   - Niels Bohr

Received on Friday, 9 May 2008 08:14:51 UTC