Question: SWI Prolog We can use structures to represent positive integers in Prolog. For example zer 1 = inc ( zero) 2 = inc (inc (zero))
SWI Prolog

We can use structures to represent positive integers in Prolog. For example zer 1 = inc ( zero) 2 = inc (inc (zero)) 3 = inc (inc (inc (zero))) etc. Here inc(x) stands for the increment (add one) function. Define and test the predicate add(X, Y, Z), which represents the relationship Z = X + Here's a start: add (x, zero, ???) add (X, inc (Y), 2) :-? Define and test the predicate mul(X, Y, Z) which represents the relationship Z- X * Y. Define and test the predicate exp(X, Y, Z) which represents the relationship Z-X ^ Define and test the predicate less(X, Y), which represents the relationship X
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
