General
Material
Lecture 1
Lecture 2
Lecture 3
Lecture 4
Lecture 5

Solution

s(s(NpT,VpT)) --> np(NpT), vp(VpT).

np(np(DetT,NT)) --> det(DetT), n(NT).
np(np(DetT,NT,PpT)) --> det(DetT), n(NT), pp(PpT).
np(np(PnT)) --> pn(PnT).

pp(pp(PT,NpT)) --> p(PT), np(NpT).

vp(vp(ViT)) --> vi(ViT).
vp(vp(VtT,NpT)) --> vt(VtT), np(NpT).
vp(vp(VdtT,Np1T,Np2T)) --> vdt(VdtT), np(Np1T), np(Np2T).


%% Lexicon

det(det(a)) --> [a].
det(det(the)) --> [the].

n(n(bride)) --> [bride].
n(n(nurse)) --> [nurse].
n(n(yakuza)) --> [yakuza].
n(n(whiskey)) --> [whiskey].
n(n(whiskey)) --> [sword].
n(n('eye patch')) --> ['eye patch'].

p(p(with)) --> [with].

pn(pn(bill)) --> [bill].
pn(pn(gogo)) --> [gogo].

vi(vi(whistles)) --> [whistles].
vi(vi(fights)) --> [fights].

vt(vt(drinks)) --> [drinks].
vt(vt(kills)) --> [kills].

vdt(vdt(gives)) --> [gives].
    

Back to the exercise.