Re: [PRD] Rule instances, refraction and Modify [Was: Re: Fwd: Clips behavior]

CLIPS I think does not have "slot specific" modify but Jess, OBR, Drools 
(I think), ILOG (I think) all have it. I am not in favor of treating 
modify as retract-all-slots/reassert-all-slots because in our experience 
this semantics makes too many common business rules loop and is very 
hard to use.

We need to consider some test cases to be sure we are all talking about 
the same thing. Here is a variation of a no-loop test. I think this 
should never loop (we should not pick a semantics that causes this to loop):

Document(
Prefix(ex <http://example.org/example#>)
Prefix(func <http://www.w3.org/2007/rif-builtin-function#>)
Prefix(pred <http://www.w3.org/2007/rif-builtin-predicate#>)

Group (
Forall ?X ?C1
If
And( ?X[ex:count1 -> ?C1] pred:numeric-greater-than(?C1 0) )
Then Do (
(?C2 (?X[ex:count2 -> ?C2]))
Modify (?X[ex:count2-> func:numeric-subtract(?C2 1)])
)
)

ex:foo[ex:count1 -> 10 ex:count2->10]

)
)

The above entails
ex:foo[ex:count1 -> 10 ex:count2->9]
but does NOT entail
ex:foo[ex:count1 -> 10 ex:count2->8]

Christian De Sainte Marie wrote:
>
> All,
>
> csma wrote on 18/01/2010 15:43:48:
> >
> > [...]
> >
> > I started modifying the spec tentatively along these lines, in case
> > we would agree that the proposed changes are needed, and that they
> > are correct.
>
> I finished the tentative modifications for point 1 (taking 
> intermediate states into account) and 3 (taking the matched facts into 
> account in the characterisation of a rule instance).
>
> I reversed to the published version before doing the modification 
> (thus rolling back some other tentative modifications I had made in 
> between). To find the modifications, you have to compare with Sandro's 
> version from October 1 [1]. Notice that I re-ordered the definitions 
> somewhat, to improve readibility (that is, there are less 
> modifications, really, than the comparison shows :-)
>
> [1] 
> http://www.w3.org/2005/rules/wiki/index.php?title=PRD&diff=11952&oldid=11437 
> <http://www.w3.org/2005/rules/wiki/index.php?title=PRD&diff=11952&oldid=11437> 
>
>
> I did do any modification wrt the Modify issue, yet (since one 
> possibility is to, simply, remove it :-)
>
> Cheers,
>
> Christian
>
> IBM
> 9 rue de Verdun
> 94253 - Gentilly cedex - FRANCE
> Tel. +33 1 49 08 35 00
> Fax +33 1 49 08 35 10
>
>
> Sauf indication contraire ci-dessus:/ Unless stated otherwise above:
> Compagnie IBM France
> Siege Social : 17 avenue de l'Europe, 92275 Bois-Colombes Cedex
> RCS Nanterre 552 118 465
> Forme Sociale : S.A.S.
> Capital Social : 611.451.766,20 €
> SIREN/SIRET : 552 118 465 03644
>

Received on Tuesday, 19 January 2010 16:45:52 UTC