s([Def],[Temp,Mod,vz]) -->
    np([Def1,3,_Gen1],[Num,nom]),
    { (member(Def1,[def,indef,quant]), Def = def)
    ; (Def1 = qu, Def = 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 ; Def1 = quant },
    np([Def2,3,_Gen2],[Num,nom]), % ,['?'],
    { Def2 = indef ; Def2 = def }. 

s([rel(Gen,Num)],[Temp,Mod,vl]) -->
    np([rel(Gen,Num),3,_Gen1],[Num2,nom]),
    np([Def2,3,_Gen2],[Num2,nom]),
    { member(Def2,[def,indef]) }, % quant?
    v([sein],[3,Num2,Temp,Mod]).
    
s([Def],[Temp,Mod,vz]) -->
    np([Def1,3,_Gen1],[Num,nom]),
    { Def = def, member(Def1,[def,indef,quant])
    ; Def = qu, Def1 = qu },
    v([sein],[3,Num,Temp,Mod]),
    ap([def],[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([def],[komp]).

s([Def],[Temp,Mod,vl]) -->
    np([Def1,3,_Gen1],[Num,nom]),
    { Def = rel(_Gen,_Num), Def1 = Def
    ; Def = def, member(Def1,[def,indef,quant]) },
    ap([def],[komp]),
    v([sein],[3,Num,Temp,Mod]).

ap([def],[komp]) -->  
    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]),
      (Def1 = qu -> Def = qu ; Def = def) },
    v([nom,akk],[3,Num,Temp,Mod]),
    np([Def2,3,_Gen2],[Num2,Kas2]),
    { member(Def2,[def,indef,quant]) }, % kein qu!
    { ( [Num,nom,akk] = [Num1,Kas1,Kas2]
      ; [Num,nom,akk] = [Num2,Kas2,Kas1] )
    }.

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(GenR,NumR)],[Temp,Mod,vl]) -->
    np([rel(GenR,NumR),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] )
    }.

