% Subcategorization, Number, Case
% Baumstruktur (Behandlung der Terminalen unvollständig)


% Regeln
% ------

s(s(NP,VP)) --> np(NP,Number,nom), vp(VP,Number).

vp(vp(V),Number)         --> v(1, V, Number).
vp(vp(V,NP),Number)      --> v(2, V, Number), np(NP,_,acc).
vp(vp(V,NP1,NP2),Number) --> v(3, V, Number), np(NP1,_,acc), np(NP2,_,acc).
vp(vp(V,S),Number)       --> v(4, V, Number), s(S).


np(np(Pron),Number,Case)    --> pron(Pron,Number, Case).
np(np(D,N),Number,_Case)    --> d(Number,D), n(Number,N).



% Lexikon
% -------

d(_, d(the))       --> [the].
d(singular, d(a))  --> [a].
d(plural, d(d0))   --> [].

pron(pron(_), singular, nom)    --> [he]; [she]. 
pron(pron(_), singular, acc)    --> [him]; [her]. 
pron(pron(they), plural, nom)   --> [they]. 
pron(pron(them), plural, acc)   --> [them]. 

n(singular, n(_)) --> [butler]; [cat]; [dog]; [garden]; [gardener]; [mouse]; [policeman].
n(plural, n(_))   --> [butlers]; [cats]; [dogs]; [gardens]; [gardeners]; [mice];
	              [policemen].

v(1, v(_), singular) --> [barks]; [sleeps].
v(1, v(_), plural)   --> [bark]; [sleep].
v(1, v(_), _)        --> [barked]; [slept].
v(2, v(_), singular) --> [chases]; [sees].
v(2, v(_), plural)   --> [chase]; [see].
v(2, v(_), _)        --> [chased]; [saw].
v(3, v(_), singular) --> [gives]; [sells].
v(3, v(_), plural)   --> [give]; [sell].
v(3, v(_), _)        --> [gave]; [sold].
v(4, v(_), singular) --> [says]; [thinks].
v(4, v(_), plural)   --> [say]; [think].
v(4, v(_), _)        --> [said]; [thought].


% --------------------------------------------------------

parse(List,Tree) :- s(Tree,List,[]).
