Thursday 17 October 2013

Sipser 2.2 b. CFLs are not closed under Intersection.

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}
B = {anbncm | m,n ≥ 0}
A ∩ B = {anbncn | n ≥ 0}
Clearly, A ∩ B is not CFL(pumping lemma). Demorgans' law :

(A ∩ B)c = Ac ∪ Bc

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