| CIS 554 -- Prolog Quiz | Name
__________________________________ |
(dog(X) ⇒ mammal(X)) ∧ (fish(X) ⇒ ¬mammal(X))first_dup that finds the first value in a list that is equal to the next value. For example, given the list [7, 3, 1, 3, 4, 4, 1, 6, 6], will find the value 4. The predicate should fail if the list does not contain equal adjacent values.mystery([H|T]) :- mys2(H, T).
mys2(X, [X]). mys2(X, [_|T]) :- mys2(X, T).
mystery predicate succeed?
mys2(X, [1, 2, 3, 4]) ? dump(X) :- member(A, X), write(A), nl, fail.
dump(_). dump([this, is, a, problem]) ?