Lecture 38 • Showing CFL’s not closed under set 1

Download Report

Transcript Lecture 38 • Showing CFL’s not closed under set 1

Lecture 38 • Showing CFL’s not closed under set intersection and set complement 1

Nonclosure Properties for CFL’s 2

CFL’s not closed under set intersection • How do we prove that CFL’s are not closed under set intersection?

– State closure property as IF-THEN statement • If L 1 and L 2 are CFL’s, then L 1 – Proof is by counterexample intersect L 2 is a CFL • Find 2 CFL’s L 1 NOT a CFL and L 2 such that L 1 intersect L 2 is 3

Counterexample • What is a possible L 1 intersect L 2 ?

– What non-CFL languages do we know?

• What could L 1 – L 1 = and L 2 be?

– L 2 = – How can we prove that L 1 free?

and L 2 are context 4

CFL’s not closed under complement • How can we prove that CFL’s are not closed under complement?

– We could do the same thing, find a counterexample – Another way • Use fact that any language class which is closed under union and complement must also be closed under intersection 5

Language class hierarchy H H Equal Equal-3 REG CFL REC RE All languages over alphabet S 6