Question: 1. The text defined a predicate elem(x, y) that held when x was an element of the list y. Consider the following variant: elem3(X,[X]). elem3(X,[_|L])
1. The text defined a predicate elem(x, y) that held when x was an element of the list y. Consider the following variant:
elem3(X,[X]).
elem3(X,[_|L]) :- elem3(X,L).
Give an example of an x and a y such that elem(x, y) holds but where elem3(x, y)
does not hold. Describe in English when the predicate elem3(x, y) holds in general.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
