np([Def,3,Gen],[Num,Kas]) -->
    det([Def],[Gen,Num,Kas]), n([Gen],[Num,Kas]),
    { member(Def,[indef,def,qu,quant]) }.

np([Def,3,Gen],[Num,Kas]) -->
    pron([DefP],[Gen,Num,Kas]),
    { DefP = rel, Def = rel(Gen,Num)
    ; DefP = qu, Def = qu }.

np([def,3,Gen],[Num,Kas]) -->
    en([Gen],[Num,Kas]).

np([def,3,Gen],[Num,Kas]) -->
    det([def],[Gen,Num,Kas]),
    ( n([Gen1],[Num,Kas]), {Gen1 = Gen}
    ; [], {Gen2 = Gen} ),
    en([Gen2],[Num,nom]),
    (s([rel(Gen,Num)],[_Temp,_Mod,vl]) ; []).

np([def,3,Gen],[Num,Kas]) -->
    en([Gen],[Num,Kas]),
    s([rel(Gen,Num)],[_Temp,_Mod,vl]).  

np([Def,3,Gen],[Num,Kas]) -->
    det([Def],[Gen,Num,Kas]), n([Gen],[Num,Kas]),
    s([rel(Gen,Num)],[_Temp,_Mod,vl]).

np([indef,3,Gen],[pl,Kas]) -->
    n([Gen],[pl,Kas]).
np([indef,3,Gen],[pl,Kas]) -->
    rn([Gen],[pl,Kas]),
    (np([Def2,3,_Gen2],[_Num2,gen]), 
    { member(Def2,[def,indef]) } ; []).

np([Def,3,Gen],[Num,Kas]) -->
    det([Def],[Gen,Num,Kas]), rn([Gen],[Num,Kas]),
    np([Def2,3,_Gen2],[_Num2,gen]), { member(Def2,[def,indef]) },
    { member(Def,[indef,def,qu,quant]) }.

np([rel(Gen2,Num2),3,Gen],[Num,Kas]) -->
    poss([rel],[Gen2,Num2,gen]),
    rn([Gen],[Num,Kas]).

