2.2 b. Use part (a) and DeMorgan's law to show that the class of CFLs is not closed under complementation.
Sol.
A = {ambncn | m,n ≥ 0}Sol.
Clearly, A ∩ B is not CFL(pumping lemma). Demorgans' law :
Ac = {ambicj | m, i, j ≥ 0 & i ≠ j} = {ambicj | m, i, j ≥ 0 & i > j} ∪ {ambicj | m, i, j ≥ 0 & i < j}
now prove that {ambicj | m, i, j ≥ 0 & i > j} is CFL.
{ambicj | m, i, j ≥ 0 & i < j} :
S → S1S2
S1 → aS1
S2 → bS2c | S2c | c
Similarly {ambicj | m, i, j ≥ 0 & i < j} is CFL and so is Ac. Similar argument holds for Bc. So Ac ∪ Bc is also CFL(Union of CFL is CFL) . Hence proved complement of CFL is not closed.
No comments:
Post a Comment