Question: Define prolog relations, and answer 9b's followup question. /* Problem 9: The Ackermann function, named for and invented by Wilhelm Ackermann, is one of the
Define prolog relations, and answer 9b's followup question.
/* Problem 9: The Ackermann function, named for and invented by Wilhelm Ackermann, is one of the earliest discoved total non-primitive recursive functions. A total function is a function that is defined on every element of it's input domain (in this case, the natural numbers.) A primitive recursive function is, roughly, a function that can be written as a for loop- that, is the number of required recursive calls has an upper bound. One variation of the Ackermann function is (There are several different variants of this function. All are called Ackermann's functions and their values do NOT have to agree!) The Ackermann Number N of a compiler is the largest N for which ack (3,N) gives an answer without a stack overflow. In earlier decades a variation had been used as a of the benchmarking algorithms. (a) Define a prolog relation ack/3. Determine (by testing) the Ackermann Number of your prolog intepreter (b) Define a prolog relation ackmemo/3. This relation should make use of memoization, as discussed in class. Based on your observations, how does performance of ackmemo compare to ack? */ /* Problem 9a Answer: */ /* Problem 9b Answer: */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
