CIS 554 -- Prolog Quiz Name __________________________________
1. (3 points) Resolve the following pairs of clauses:
1. Turn the following into clause form:
`(dog(X) ⇒ mammal(X)) ∧ (fish(X) ⇒ ¬mammal(X))`

2. Resolve the above clauses.

3. State the conclusion in English.

2. (1 point) Write a Prolog predicate `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.

3. (2 points) Consider the following code:
```    mystery([H|T]) :- mys2(H, T).
mys2(X, [X]).
mys2(X, [_|T]) :- mys2(X, T).```
1. On what kind of lists will the `mystery` predicate succeed?

2. What will be the result of the call` mys2([1, 2, 3, 4])` ?

4. (1 point) Consider the following code:
```    dump(X) :- member(A, X), write(A), nl, fail.
dump(_).```

What will be printed by the call` dump([this, is, a, problem]) `?

5. (1 point) Briefly define the term nonmonotonic logic.

6. (1 point) In "The Free Lunch is Over," what does Herb Sutter claim about the current status of Moore's Law?

7. (1 point) State as briefly as you can what the "Blub Paradox" is.