Warning:
This wiki has been archived and is now read-only.

Modify loop

From RIF
Jump to: navigation, search




Test TypePositiveEntailmentTest
ContributorGary Hallmark
StatusApproved
Record13 Oct 2009 telecon
DialectPRD
PurposeModify Action of RIF PRD
DescriptionDemonstrates the modify action in RIF PRD. The rule decrements a frame slot until it reaches 0.
SeeAlsoModify noloop
SpecRefhttp://www.w3.org/2005/rules/wiki/PRD
Premises
Presentation SyntaxDocument( 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 ?C ( If And( ?X[ex:count -> ?C] pred:numeric-greater-than(?C 0) ) Then Do ( Modify (?X[ex:count-> func:numeric-subtract(?C 1)]) ) ) ex:foo[ex:count -> 10] ) )
XMLview RIF/XML
Conclusion
Presentation Syntaxex:foo[ex:count-> 0]
XMLview RIF/XML