% file: norwgend
% this program forces gender and number agreement among the various
% elements of a noun phrase in Norwegian. The first example returns
% values for D (definiteness), N (number), and G (gender).
% sample query for first clause: np(D,N,G,[et, godt, hus],[])?
% sample query for second clause np([et, godt, hus],[])?

dcg!
np(D,N,G) --> det(D,N,G),adj(D,N,G),noun(D,N,G).
np --> det(D,N,G),adj(D,N,G),noun(D,N,G).

det(indef,sg,co) --> [en].
det(indef,sg,ne) --> [et].
det(def,sg,co) --> [den].
det(def,sg,ne) --> [det].
det(def,pl,_) --> [de].

adj(indef,sg,co) --> [god].
adj(indef,sg,ne) --> [godt].
adj(def, _, _) --> [gode].

noun(_,sg,co) --> [bok].
noun(_,pl,co) --> [boeker].

noun(_,_,ne) --> [hus].	% monosyllabic neuter nouns have zero plurals
