grammar simplif{
terminal a,b,d;
nonterminal S,B,A,C,D;
axiom S;
productions{
S:=A a| B | D;
B:=b;
A:=a A| b A | B;
C:= a b d;
}
}
/*
ENG: We are going to eliminate the productions of the grammar
that don't derivate in terminal strings. In this case
the production [S:=D] will be removed.
ESP: Es una gramatica a la que vamos a eliminar las producciones
que no derivan en cadenas de terminales en este caso se
eliminara la produccion [S:=D].
*/
print(simplif);
gramsimplificad = remnongen(simplif);