Factorial Functional




Test TypePositiveEntailmentTest
ContributorHarold Boley
StatusApproved
RecordF2F13
DialectBLD
Purposetest ground equational call to factorial function
DescriptionFactorial function using equality in the head to have function return value. This test case also demonstrates recursion and the use of mathematical built-in predicates and functions corresponding to >, -, and *.
SeeAlsoFactorial Relational, 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 ( ex:factorial(?N) = External(func:numeric-multiply( ?N ex:factorial(External(func:numeric-subtract(?N 1))))) :- External(pred:numeric-greater-than(?N 0)) ) ) )
XMLview RIF/XML
Conclusion
Presentation Syntax720 = ex:factorial(6)
XMLview RIF/XML
Last modified on 23 March 2010, at 01:20