1 use the constant z for the number zero and the unary functor s for the successor f 5346894

1) Use the constant z for the number zero and the unary functor s for the successor function to denote the non-negative integers(e.g. S(s(z)) denotes 2), and define in PROLOG the predicate numeral (X,N), which is true iff X is the term corresponding to the number N, and also the predicates representing the unary function predessor, the binary functions addition, subtraction, multiplication and factorial, and the finary relations equal, less than, and greater than. Hint: Assuming that the predicate add(X,Y,Z) is true iff X+Y=Z, where X, Y, and Z are the decimals, addition could be defined in PROLOG as follows: addition(0,X,X). addition(Y,X,Z) :- V is Y-1, addition(V,X,W), Z is w+1.

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now