Could you explain me, how can I check, that the language of first context-free grammar (G1) is a subset of the language of second context-free grammar (G2).
G1 and G2 are two LL(1) grammars with identical alphabets:
{a, b, c, d, f}
Production rules are look like:
A -> αB
or
A -> α
and α is a non-epsilon string (of terminal symbols).
Context-free grammar G1:
S1 -> aK
K -> bC|cE
C -> cB|d
E -> bA|f
A -> abC
B -> acE
Context free grammar G2 :
S2 -> aX
X -> bZ|cY
Z -> cV|d
Y -> bU|f
V -> aQ
U -> aP
Q -> cY
P -> bZ
Automatic way is preferred.
In additional, how can I check that the languages of two arbitrary context-free grammars are equal.
Language equality is one of the questions that open in cs and not decidable..
but in this case, you can actually build G1' as Greinbach normal form by Sheila Greibach,
then you can prove L(G2)=L(G1') by the use of SUBSTITUTION (in order to change the Variants names) on G1' and get exactly G2 grammer.