19.05.2013 Views

Chapter 3 Context-Free Grammars, Context-Free Languages, Parse ...

Chapter 3 Context-Free Grammars, Context-Free Languages, Parse ...

Chapter 3 Context-Free Grammars, Context-Free Languages, Parse ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

54 CHAPTER 3. CONTEXT-FREE GRAMMARS AND LANGUAGES<br />

Then, writing the grammar G as<br />

we define the map<br />

such that<br />

A1 → α1,1 + ···+ α1,n1,<br />

···→···<br />

Ai → αi,1 + ···+ αi,ni ,<br />

···→···<br />

Am → αm,1 + ···+ αm,nn,<br />

ΦG:2 Σ∗<br />

×···×2 Σ∗<br />

<br />

→ 2<br />

m<br />

Σ∗<br />

×···×2 Σ∗<br />

<br />

m<br />

ΦG(L1,...Lm) = (Φ[Λ]({α1,1,...,α1,n1}),...,Φ[Λ]({αm,1,...,αm,nm}))<br />

for all Λ = (L1,...,Lm) ∈ 2 Σ∗<br />

×···×2 Σ∗<br />

<br />

.<br />

m<br />

One should verify that the map Φ[Λ] is well defined, but this is easy. The following<br />

lemma is easily shown:<br />

Lemma 3.8.2 Given a context-free grammar G =(V,Σ,P,S) with m nonterminals A1, ...,<br />

Am, themap<br />

ΦG:2 Σ∗<br />

×···×2 Σ∗<br />

<br />

→ 2<br />

m<br />

Σ∗<br />

×···×2 Σ∗<br />

<br />

m<br />

is ω-continuous.<br />

Now, 2 Σ∗<br />

×···×2 Σ∗<br />

<br />

is an ω-chain complete poset, and the map ΦG is ω-continous. Thus,<br />

m<br />

by lemma 3.7.4, the map ΦG has a least-fixed point. It turns out that the components of<br />

this least fixed-point are precisely the languages generated by the grammars (V,Σ,P,Ai).<br />

Before proving this fact, let us give an example illustrating it.<br />

Example. Consider the grammar G =({A, B, a, b}, {a, b},P,A) defined by the rules<br />

where<br />

A → BB + ab,<br />

B → aBb + ab.<br />

The least fixed-point of ΦG is the least upper bound of the chain<br />

(Φ n G(∅, ∅)) = ((Φ n G,A(∅, ∅), Φ n G,B(∅, ∅)),<br />

Φ 0 G,A(∅, ∅) =Φ 0 G,B(∅, ∅) =∅,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!