% Prolog program 'grammar1' in Section 9.5.3 (page 275)

s(X, Y) :- np(X, U), vp(U, Y).

np(X, Y) :- det(X, U), noun(U, Y).

vp(X, Y) :- iverb(X, Y).
vp(X, Y) :- tverb(X, U), np(U, Y).

det([the | Y], Y).
det([a | Y], Y).

noun([giraffe | Y], Y).
noun([apple | Y], Y).

iverb([dreams | Y], Y).

tverb([dreams | Y], Y).
tverb([eats | Y], Y).


