Question: FULL PROLOG CODE PLEASE Define a recursive predicate factorial / 2 , that returns the factorial of ( small ) integers factorial ( X ,
FULL PROLOG CODE PLEASE Define a recursive predicate factorial that returns the factorial of small integers factorialX should return Xie the first parameter is the factorial and the second is the integer factorial should return true factorialX should return Xthis may or may not work depending on the design of your code You don't need to ensure this you can still get without this feature. Discussion: You will need a base case a non recusive version of factorial It is: factorial The rest of the code required is what to do when the second argument is It is only one line of code.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
