| CIS 554 -- Prolog Quiz | Name
__________________________________ |
last
that you can use to find the last element of a list. It declares that
the second parameter is the last element of the list given as the first
parameter. The predicate should fail if given an empty list. (Hint: two
clauses.)last predicate to find the last
element in the list [a, b, c].X
after you call your function as last(X, c).
? dynamic locked/1.
locked(cell_door).
escape :- locked(cell_door), !, write('You are locked
in!'), nl, fail.
escape :- write('You are free!'), nl.
Do it by completing
the following clause:
pick_lock :-female(X) ∧ rich(X) ⇒ loves(john, X). ∀x∀y, p(x,
y) ∀x∃y, p(x,
y) ∃x∀y, p(x,
y) ∃x∃y, p(x, y)