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

s(nogap) --> pp(nogap),
             s(gap(pp)).

% 2) Middle of UDC: passing info
s(GapInfo) --> np(nogap),    % no subject gaps
               vp(GapInfo).

vp(GapInfo) --> vt,
                np(GapInfo).

vp(GapInfo) --> vd,
                np(GapInfo),
                pp(nogap),
                {write('first ditransitive vp rule')}.

vp(GapInfo) --> vd,
                np(nogap),
                pp(GapInfo),
                {write('second ditransitive vp rule')}.
        
pp(GapInfo) --> p,
                np(GapInfo).

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

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


