Based on the successor notion define a relationship odd x


Recall the successor notation for representing natural numbers as terms in Prolog. In this notation, "0" stands for the number zero, "s (0)" stands for one, "s (s (0))" stands for two, and so on.

(a) Based on the successor notion, define a relationship "odd (X)" which is true if X is an odd number.

(b) Based on the successor notion, define a relationship "even (X)" which is true if X is an even number. Your definition should be built on top of the odd (X) relationship.

(c) How will Prolog answer the following question? ?- even(X). When several responses are possible, give two.

(d) How will Prolog answer the following question? ?- odd(s(X)). When several responses are possible, give two.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Based on the successor notion define a relationship odd x
Reference No:- TGS02914528

Expected delivery within 24 Hours