IISER M Course Content

IISER M Course Content

Want to contribute? Click here to suggest edits or additions.

Continued

G = (V, Σ, R, S) where -

Rules

supp. rule A → 0A1 And if w1 = 01A11 ⟹ w2 = 010A111 where w2 is derived from w1.

Also,

w1⟹w2⟹w3⟹w4⟹…⟹wn

Then w1 =*⟹ wn

Given a CFG G(= (V,Σ,R,S)), then the language generated by it is LG = { w | w∈Σ</sup> and S =⟹ w }

Example

In the previous case of the Grammar of arithmetic over add and sub,

Parse Tree

parsetree.jpg

Stack

FILO - First in Last out. You push into the stack, but you must pop out the last element only.