Re: [Fwd: Re: PRD Review]

Christian de Sainte Marie wrote:
>>
>>
>> Do(Retract(?emp[salary->?salary]) 
>> ?emp[salary->func-numeric-multiply(?salary 1.1)]
>> :-
>> And(?emp#Employee ?emp[salary->?salary] pred:numeric-less-than(?salary 
>> 100000))
>>
>> In OBR and Jess, the above rule will give every employee with salary 
>> less than 100000 a 10% raise
>> only if no-repeat (metadata attached to the rule) is true.  If 
>> no-repeat is false, then the above rule will keep increasing 
>> employees' salaries by 10% until every employee earns at least 100000.
> 
> 
> This is also what the no-repeat strategy would give you, as it is 
> specified in the draft.

Wrong. The spec in the draft does not work because it fails to 
differentiate between the real rule variables (?emp in your example), 
that are scoped on the rule, and the helper variables (?salary in your 
example), that are not (you can declare them within an Exists on each 
side of the Implies).

I knew there was something wrong with that semantics :-(
(my pet example to check that pb is the rule that raise an alert if a 
sensor is above a threshold, and the value continue to increase after 
the alert has been raised; the rule must not re-fire unless the value 
dropped below the threshold in the mean time).

Cheers,

Christian

Received on Wednesday, 2 July 2008 15:50:02 UTC