IISER M Course Content

IISER M Course Content

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

Write a context free grammar for every rular language.

Every state is nothing but a rule. If δ(a,qi) = qj

then Ri → aRj

Rj → ϵ if qj ∈ F

And the Context free grammar is

Contd.

Parse to check if Expr.

  1. Initialise a Stack with $
  2. Push S to a Stack
  3. Branch and make stacks every possible rule
  4. If left most element

Push Down automaton

Defn: It is a Tuple P = (Q, Σ, Γ, δ, q0, F)

Example

0N1N

Informal-

  1. If read a zero, push to stack
  2. If read a one, pop from stack
  3. Accept if stack is empty

Formal

Build P = (Q, Σ, Γ, q0, F, δ)