% 1) Top of UDC: realizing filler
s([],[]) --> np([],[]),
             s([gap(np)],[]).

s([],[]) --> pp([],[]),
             s([gap(pp)],[]).

% 2) Middle of UDC: passing info
s(GapIn,GapOut) --> np([],[]),    % no subject gaps
 	            vp(GapIn,GapOut).

vp(GapIn,GapOut) --> vt,
		     np(GapIn,GapOut).

vp(GapIn,GapOut) --> vd,
	             np(GapIn,GapMid),
		     pp(GapMid,GapOut).
	
pp(GapIn,GapOut) --> p,
		     np(GapIn,GapOut).

% 3) Bottom of UDC
np([gap(np)],[]) --> [].			
pp([gap(pp)],[]) --> [].

% "Lexicon"
np(X,X) --> [mary];[john];[fido].
p  --> [to].
vt --> [loves].
vd --> [gives].
