0% found this document useful (0 votes)
16 views3 pages

Automata Chapter Four

The document discusses pushdown automata and context-free languages. It defines pushdown automata and describes their components and transition functions. It also explains how pushdown automata are equivalent to context-free grammars in the languages they can generate and recognize.

Uploaded by

peaceforall5682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views3 pages

Automata Chapter Four

The document discusses pushdown automata and context-free languages. It defines pushdown automata and describes their components and transition functions. It also explains how pushdown automata are equivalent to context-free grammars in the languages they can generate and recognize.

Uploaded by

peaceforall5682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Automata and Complexity theory- 3rd Year chapter-4

Chapter Four
Pushdown Automata
 Push-Down Automata (PDA) is an abstract model of a machine –Finite State Automata.

 It has a finite set of states. However, in addition, it has a pushdown stack. Moves of the PDA
are as follows:

1. An input symbol is read and the top symbol on the stack is read.

2. Based on both inputs, the machine enters a new state and writes zero or more symbols onto
the pushdown stack.

3. Acceptance of a string occurs if the stack is ever empty. (Alternatively, acceptance can be
if the PDA is in a final state. Both models can be shown to be equivalent.)

Reviewing a Stack

 A stack is a data structure that allows addition/deletion/access of an element only at the top of
a stack.

-
-
-

A stack

Name Description Position


Push Adding an element Top of stack
Pop Deleting an element Top of stack
The above table summarizes the operations that can be performed on a stack.

 The length of the stack is unbounded.

Prepared by: Getahun T. 1


Automata and Complexity theory- 3rd Year chapter-4

 Contents of the entire stack is not visible to the automaton at any instant. Only the top element
is accessible.

- To get to an element the automaton has to “pop” its way down. Elements that are popped

are forgotten.

Non-deterministic pushdown automata (NPDA)

 An NPDA is a seven-tuple:

M = (Q, Σ, Г, δ, q0, z0, F)

 Q - A finite set of states,

 Σ - A finite input alphabet

 Г - A finite stack alphabet,

 q0 - The initial/starting state, q0 is in Q

 z0- A starting stack symbol, is in Г

 F-A set of final/accepting states, which is a subset of Q

 δ- A transition function, where

δ: Q x (Σ U {ε}) x Г –> finite subsets of Q x Г*

The complicated formal appearance of the domain and range of δ merits a closer examination.
The arguments of δ are the current state of the control unit, the current input symbol, and the
current symbol on top of the stack. The result is a set of pairs (q, x), where q is the next state of the
control unit and x is a string that is put on top of the stack in place of the single symbol there
before.

Example 1

Suppose the set of transition rules of an NPDA contains

δ (q1,a,b)={(q2,cd),(q3, ε)}

Prepared by: Getahun T. 2


Automata and Complexity theory- 3rd Year chapter-4

If at any time the control unit is in state q1, the input symbol read is a, and the symbol on top of
the stack is b, then one of two things can happen: (1) the control unit goes into state q2 and the
string cd replaces b on top of the stack, or (2) the control unit goes into state q3 with the symbol b
removed from the top of the stack. In our notation we assume that the insertion of a string into a
stack is done symbol by symbol, starting at the right end of the string.

Push down automata and context free languages

CFG and PDA are equivalent in power: a CFG generates a context-free language and a PDA
recognizes a context-free language. In addition, the equivalent PDA to be used to implement its
compiler. A language is context-free iff some pushdown automaton recognizes it.

Construction of PDA for context free language

Deterministic push down automata

 It is a variation of the pushdown automaton, which has at most one possible move.

Deterministic context free languages

 Let L be a language defined over the alphabet Σ, the language L is deterministic context-free
if and only if it accepted by a deterministic pushdown automaton.

 A language is context-free if there exists a context-free grammar that can generate it.

Note: This means that:

1. If a language is context-free then there is a PDA, ML that recognizes it


2. If a language is recognized by a PDA, GL then there is a CFG that generates

Prepared by: Getahun T. 3

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy