Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Now that you have multiplication for nat_nums, you can define a factorial function for nat_nums. Call your function facty_nn. It should take a nat_num as
Now that you have multiplication for nat_nums, you can define a factorial function for nat_nums. Call your function facty_nn. It should take a nat_num as its input and generate the factorial of that nat_num (as a nat_num) as its output, as illustrated below: # facty_nn (S(S(S(Z))));; - : nat_num = S (S (S (S (S (S Z))))) # nat_num_to_num (facty_nn (num_to_nat_num 5));; - : int = 120
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started