% DCG-Grammatik (Definite Clause Grammar)
% Nur Pers = 3, daher ignoriert.

startsymbol(s([_Temp])).  % für später

s([Temp]) -->
    np([_Gen],[Num,nom]), vp([Temp,Num]).
np([Gen],[Num,Kas]) -->
    det([Gen,Num,Kas]), n([Gen],[Num,Kas]).
vp([Temp,Num]) -->
    ( v([Temp,Num])
    ; v([Temp,Num]), np([_Gen],[Num,akk])
    ).

det([Gen,sg,Kas]) -->
    ( [der], { Gen = mask, Kas = nom }
    ; [das], { Gen = neut, (Kas = nom; Kas = akk) }
    ).
n([mask],[Num,Kas]) -->
    ['Programmierer'], { (Num = sg ; Num = pl),
                         (Kas = nom; Kas = akk) }.
n([neut],[sg,Kas]) -->
    ['Programm'], { (Kas = nom; Kas = akk) }.

v([praes,sg]) --> [steht].
v([praet,sg]) --> [schrieb].

