% Syntaxregel aus Grammatik/bitransitiv.pl
/*
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,Obj2,Obj3],[3,Num,Temp,Mod]),
    np([Def2,3,_Gen2],[Num2,Kas2]),
    { member(Def2,[def,indef,quant]) }, % kein qu!
    np([Def3,3,_Gen3],[Num3,Kas3]),
    { member(Def3,[def,indef,quant]) }, % kein qu!
    { bitrKongruenz([Num,nom,Obj2,Obj3],[Num1,Kas1,Num2,Kas2,Num3,Kas3]) }.
*/

sem([s([_Def],[Temp,Mod,vz]),
     NP1, BTV, NP2, NP3], SemS) :-
    NP1 = [np([_Def1,3,_Gen1],[_Num1,Kas1])|_Cs1],
    NP2 = [np([_Def2,3,_Gen2],[_Num2,Kas2])|_Cs2],
    NP3 = [np([_Def3,3,_Gen3],[_Num3,Kas3])|_Cs3],
    BTV = [v([Obj1,Obj2,Obj3],[3,_Num,Temp,Mod]),_Btv],
    sem(NP1, SemNP1),
    sem(NP2, SemNP2),
    sem(NP3, SemNP3),
    sem(BTV, SemBTV),
    ( [Kas1,Kas2,Kas3]=[Obj1,Obj2,Obj3], [X1,X2,X3]=[X,Y,Z]
    ; [Kas1,Kas2,Kas3]=[Obj1,Obj3,Obj2], [X1,X2,X3]=[X,Z,Y]
    ; [Kas1,Kas2,Kas3]=[Obj3,Obj1,Obj2], [X1,X2,X3]=[Z,X,Y]
    ; [Kas1,Kas2,Kas3]=[Obj2,Obj1,Obj3], [X1,X2,X3]=[Y,X,Z]
    ),
    normalize(SemNP1*lam(X1,
                         SemNP2*lam(X2,
                                    SemNP3*lam(X3,
                                               SemBTV*X*Y*Z))),
              SemS).

sem([v([Obj1,Obj2,Obj3],Form),[Vollform]],LamTerm) :-
    kleinschreibung(Vollform,VollformKl),
    wort(Stammform,v([Obj1,Obj2,Obj3],Form),VollformKl),
    Formel =.. [Stammform,X,Y,Z],
    LamTerm = lam(X,lam(Y,lam(Z,Formel))).
   

