Definition sym_G (G : cfg) :=
    startsym G :: flat_map (fun '(a, x) => a :: x) (rules G).Definition CFP' (G : cfg) := exists x, L G x /\ x = List.rev x.Definition CFI' '(G1, G2) :=
  exists x, L G1 x /\ L G2 x.Definition S : symbol := fresh Sigma.

Lemma terminal_iff_G y : terminal G y <-> ~ S el y.