% DCG in Programm uebersetzen.

translate((Links --> Rechts), Tr) :-
  translate1(Links,Kopf,I,J),
  translate2(Rechts,Rumpf,I,J),
  Tr = (Kopf :- Rumpf).

translate1(Kat,Praed,I,J) :-
    Kat =.. [Fun|Args],
    append(Args,[I,J],MehrArgs),
    Praed =.. [Fun|MehrArgs].


% test:
translate2(Rechts,Rumpf,I,J) :-
    % Rechts = Kategorie
    translate1(Rechts,Rumpf,I,J).
    % Rechts = (Kat1 , Kat2)
    % Rechts = (Kat1 ; Kat2)
    % Rechts = [Atom] % [], [Atom|Atomen]
    % Rechts = {Prolog}
