s([Def1],[Temp,Mod,vz]) -->
    np([Def1,3,_Gen1],[Num,nom]),
    { member(Def1,[def,indef,quant,qu]) },
    v([sein],[3,Num,Temp,Mod]),
    np([Def2,3,_Gen2],[Num,nom]),
    { Def2 = indef ; Def2 = def }.

s([qu],[Temp,Mod,ve]) -->
    v([sein],[3,Num,Temp,Mod]),
    np([Def1,3,_Gen1],[Num,nom]),
    { Def1 = def ; Def1 = indef },
    np([Def2,3,_Gen2],[Num,nom]), % ,['?'],
    { Def2 = indef ; Def2 = def }. 

s([rel(Gen,Num)],[Temp,Mod,vl]) -->
    np([rel(Gen,Num),3,_Gen1],[_Num1,nom]),
    np([Def2,3,_Gen2],[Num2,nom]),
    { member(Def2,[def,indef]) }, % quant?
    v([sein],[3,Num2,Temp,Mod]).
    
s([Def1],[Temp,Mod,vz]) -->
    np([Def1,3,_Gen1],[Num,nom]),
    { member(Def1,[def,indef,quant,qu]) },
    v([sein],[3,Num,Temp,Mod]),
    ap([],[komp]).

s([qu],[Temp,Mod,ve]) -->
    v([sein],[3,Num,Temp,Mod]),
    np([Def1,3,_Gen1],[Num,nom]),
    { member(Def1,[def,indef,quant,qu]) },
    ap([],[komp]).

s([Def1],[Temp,Mod,vl]) -->
    np([Def1,3,_Gen1],[Num,nom]),
    { member(Def1,[def,indef,quant,qu, rel(_Gen2,_Num2)]) },
    ap([],[komp]),
    v([sein],[3,Num,Temp,Mod]).

ap([],[komp]) -->  % keine Artmerkmale
    a([als(nom)],[komp]), [als],
    np([Def2,3,_Gen2],[_Num,nom]),
    { Def2 = indef ; Def2 = def ; Def2 = quant}.

s([Def],[Temp,Mod,vz]) -->
    np([Def1,3,_Gen1],[Num1,Kas1]),
    { member(Def1,[def,indef,quant,qu]) },
    v([nom,akk],[3,Num,Temp,Mod]),
    np([Def2,3,_Gen2],[Num2,Kas2]),
    { member(Def2,[def,indef,quant]) },
    { ( [Num,nom,akk] = [Num1,Kas1,Kas2]
      ; [Num,nom,akk] = [Num2,Kas2,Kas1]
      ), ((qu = Def1 ; qu = Def2)
         -> Def = qu ; Def = def)
    }.

s([qu],[Temp,Mod,ve]) -->
    v([nom,akk],[3,Num,Temp,Mod]),
    { member(Def1,[def,indef,quant]) },
    np([Def1,3,_Gen1],[Num1,Kas1]),
    { member(Def2,[def,indef,quant]) },
    np([Def2,3,_Gen2],[Num2,Kas2]),
    { ( [Num,nom,akk] = [Num1,Kas1,Kas2]
      ; [Num,nom,akk] = [Num2,Kas2,Kas1] )
    }.

s([rel(Gen,Num)],[Temp,Mod,vl]) -->
    np([rel(Gen,Num),3,_Gen1],[Num1,Kas1]),
    np([Def2,3,_Gen2],[Num2,Kas2]),
    { member(Def2,[def,indef,quant]) },
    v([nom,akk],[3,Num,Temp,Mod]),
    { ( [Num,nom,akk] = [Num1,Kas1,Kas2]
      ; [Num,nom,akk] = [Num2,Kas2,Kas1] )
    }.

