next up previous contents
Next: Query generator Up: Prolog implementation Previous: Utilities

 

Grammar and Lexicon

%% Grammar and lexicon

s(Declarative)  :- lp(Subject,Predicate,Declarative),
                   np(Subject), vp(Predicate).

np(Substantive) :- lp(Spec,Head,Substantive),
                   det(Spec), n(Head).
np(Substantive) :- n(Substantive).

vp(Predicate) :- lp(Verb,Object,Predicate),
                 np(Object), v(Verb).
vp(Predicate) :- v(Predicate).

n([man]).
n([woman]).
n([dog]).
n([cat]).
det([the]).
det([a]).
v([saw]).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



Dafydd Gibbon
Fri Nov 28 02:24:58 MET 1997