Factorial Relational

From RIF
Revision as of 01:21, 23 March 2010 by StellaMitchell (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search




Test TypePositiveEntailmentTest
ContributorHarold Boley
StatusApproved
RecordF2F13
DialectBLD
Purposetest ground call to factorial predicate
DescriptionFactorial predicate using equality to assign computed values to variables. This test case also demonstrates recursion and the use of mathematical built-in predicates and functions corresponding to >, -, and *.
SeeAlsoFactorial Functional, Factorial Forward Chaining
SpecRef
Premises
Presentation SyntaxDocument( Prefix(pred <http://www.w3.org/2007/rif-builtin-predicate#>) Prefix(func <http://www.w3.org/2007/rif-builtin-function#>) Prefix(ex <http://example.org/example#>) Group ( ex:factorial(0 1) Forall ?N ?F ?N1 ?F1 ( ex:factorial(?N ?F) :- And(External(pred:numeric-greater-than(?N 0)) ?N1 = External(func:numeric-subtract(?N 1)) ex:factorial(?N1 ?F1) ?F = External(func:numeric-multiply(?N ?F1)) ) ) ) )
XMLview RIF/XML
Conclusion
Presentation Syntaxex:factorial(6 720)
XMLview RIF/XML