SlideShare une entreprise Scribd logo
1  sur  9
Télécharger pour lire hors ligne
EDUCATION HOLE PRESENTS
THEORY OF AUTOMATA & FORMAL LANGUAGES
Unit-IV
2014
WWW.EDHOLE.COM
Push Down Automata (PDA).................................................................................................... 2
Description and definition................................................................................................................3
Formal Definition..................................................................................................................................................3
Operation........................................................................................................................................3
Working of PDA....................................................................................................................... 5
Understanding the computation process..........................................................................................6
Acceptance of a string by PDA................................................................................................. 7
PDA and CFG ........................................................................................................................... 8
Introduction to auxiliary PDA .................................................................................................. 8
Two stack PDA .................................................................................................................................9
Push Down Automata (PDA)
The PDA is used in theories about what can be computed by machines. It is more capable than a
finite-state machine but less capable than a Turing machine. Because its input can be described
with a formal grammar, it can be used in parser design. The deterministic pushdown automaton
can handle all deterministic context-free languages while the nondeterministic version can
handle all context-free languages. The term "pushdown" refers to the fact that the stack can be
regarded as being "pushed down" like a tray dispenser at a cafeteria, since the operations never
work on elements other than the top element. A stack automaton, by contrast, does allow access
to and operations on deeper elements. Stack automata can recognize a strictly larger set of
languages than deterministic pushdown automata. A nested stack automaton allows full access,
and also allows stacked values to be entire sub-stacks rather than just single finite symbols.
Description and definition
Formal Definition
We use standard formal language notation: denotes the set of strings over alphabet and
denotes the empty string.
A PDA is formally defined as a 7-tuple:
where
• is a finite set of states
• is a finite set which is called the input alphabet
• is a finite set which is called the stack alphabet
• is a finite subset of , the transition relation.
• is the start state
• is the initial stack symbol
• is the set of accepting states
An element is a transition of . It has the intended meaning that , in
state , with on the input and with as topmost stack symbol, may
read , change the state to , pop , replacing it by pushing . The
component of the transition relation is used to formalize that the PDA can either read a letter
from the input, or proceed leaving the input untouched.
In many texts the transition relation is replaced by an (equivalent) formalization, where
• is the transition function, mapping into finite subsets of
.
Here contains all possible actions in state with on the stack, while reading on
the input. One writes for the function precisely when
for the relation. Note that finite in this definition is essential.
Operation
a diagram of the pushdown automaton
Pushdown automata differ from finite state machines in two ways:
1. They can use the top of the stack to decide which transition to take.
2. They can manipulate the stack as part of performing a transition.
Pushdown automata choose a transition by indexing a table by input signal, current state, and the
symbol at the top of the stack. This means that those three parameters completely determine the
transition path that is chosen. Finite state machines just look at the input signal and the current
state: they have no stack to work with. Pushdown automata add the stack as a parameter for
choice. Pushdown automata can also manipulate the stack, as part of performing a transition.
Finite state machines choose a new state, the result of following the transition. The manipulation
can be to push a particular symbol to the top of the stack, or to pop off the top of the stack. The
automaton can alternatively ignore the stack, and leave it as it is. The choice of manipulation (or
no manipulation) is determined by the transition table. Put together: Given an input signal,
current state, and stack symbol, the automaton can follow a transition to another state, and
optionally manipulate (push or pop) the stack. In general, pushdown automata may have several
computations on a given input string, some of which may be halting in accepting configurations.
If only one computation exists for all accepted strings, the result is a deterministic pushdown
automaton (DPDA) and the language of these strings is a deterministic context-free language.
Not all context-free languages are deterministic. As a consequence of the above the DPDA is a
strictly weaker variant of the PDA and there exists no algorithm for converting a PDA to an
equivalent DPDA, if such a DPDA exists. If we allow a finite automaton access to two stacks
instead of just one, we obtain a more powerful device, equivalent in power to a Turing machine.
A linear bounded automaton is a device which is more powerful than a pushdown automaton but
less so than a Turing machine.
Working of PDA
The following is the formal description of the PDA which recognizes the language
by final state:
PDA for (by final state)
, where
states:
input alphabet:
stack alphabet:
start state:
start stack symbol:
accepting states:
The transition relation consists of the following six instructions:
, , , , ,
and .
In words, the first two instructions say that in state any time the symbol is read, one is
pushed onto the stack. Pushing symbol on top of another is formalized as replacing top
by (and similarly for pushing symbol on top of a ).
The third and fourth instructions say that, at any moment the automaton may move from state
to state .
The fifth instruction says that in state , for each symbol read, one is popped. Finally, the
sixth instruction says that the machine may move from state to accepting state only when the
stack consists of a single .
There seems to be no generally used representation for PDA. Here we have depicted the
instruction by an edge from state to state labelled by (read ;
replace by ).
Understanding the computation process
accepting computation for
The following illustrates how the above PDA computes on different input strings. The subscript
from the step symbol is here omitted.
(a) Input string = 0011. There are various computations, depending on the moment the move
from state to state is made. Only one of these is accepting.
(i) . The final state is accepting, but
the input is not accepted this way as it has not been read.
(ii) . No further steps possible.
(iii)
. Accepting computation: ends in accepting
state, while complete input has been read.
(b) Input string = 00111. Again there are various computations. None of these is accepting.
(i) . The final state is accepting,
but the input is not accepted this way as it has not been read.
(ii) . No further steps possible.
(iii)
. The final state is accepting, but the input is
not accepted this way as it has not been (completely) read.
Acceptance of a string by PDA
A GPDA is a PDA which writes an entire string of some known length to the stack or removes
an entire string from the stack in one step. A GPDA is formally defined as a 6-tuple:
where Q, , , q0 and F are defined the same way as a PDA.
:
is the transition function. Computation rules for a GPDA are the same as a PDA except that the
ai+1's and bi+1's are now strings instead of symbols.
GPDA's and PDA's are equivalent in that if a language is recognized by a PDA, it is also
recognized by a GPDA and vice versa. One can formulate an analytic proof for the equivalence
of GPDA's and PDA's using the following simulation:
Let (q1, w, x1x2...xm) (q2, y1y2...yn) be a transition of the GPDA
where , , , , ,
.
Construct the following transitions for the PDA:
(q1, w, x1) (p1, )
(p1, , x2) (p2, )
(pm-1, , xm) (pm, )
(pm, , ) (pm+1, yn)
(pm+1, , ) (pm+2, yn-1)
(pm+n-1, , ) (q2, y1)
PDA and CFG
Every context-free grammar can be transformed into an equivalent pushdown automaton. The
derivation process of the grammar is simulated in a leftmost way. Where the grammar rewrites a
nonterminal, the PDA takes the topmost nonterminal from its stack and replaces it by the right-
hand part of a grammatical rule (expand). Where the grammar generates a terminal symbol, the
PDA reads a symbol from input when it is the topmost symbol on the stack (match). In a sense
the stack of the PDA contains the unprocessed data of the grammar, corresponding to a pre-order
traversal of a derivation tree.
Technically, given a context-free grammar, the PDA is constructed as follows.
1. for each rule (expand)
2. for each terminal symbol (match)
As a result we obtain a single state pushdown automata, the state here is , accepting the
context-free language by empty stack. Its initial stack symbol equals the axiom of the context-
free grammar.
The converse, finding a grammar for a given PDA, is not that easy. The trick is to code two
states of the PDA into the nonterminals of the grammar.
Theorem. For each pushdown automaton one may construct a context-free grammar such
that
Introduction to auxiliary PDA
A class of machines called one-way auxiliary pushdown automata, 1-APDA, is introduced.
These machines differ from the well-known auxiliary pushdown automata by their input tape,
which is one-way only. We restrict ourselves to f-tape-bounded 1-APDA with f(n) ≤ n and
investigate some of their properties. In particular, it is shown:
1. log log n is a lower bound for the tape complexity of 1-APDA to accept non-context-free
languages, and this is a sharp bound.
2. If f(n) < n, i.e. if lim f(n) / n = O, then
{w1cw2cw←1cw←2/w1,w2ε{o,1}∗,|w1|=|w2|}
is not accepted by any f-tape-bounded 1-APDA.
3. For every f with f(n) < n, nondeterministic f-tape-bounded 1-APDA are strictly more
powerful than deterministic f-tape-bounded 1-APDA. This is in opposition to (two-way)
auxiliary pushdown automata and to f-tape-bounded 1-APDA with f(n) ≥ c.n.
Two stack PDA
Pushdown automata choose a transition by indexing a table by input signal, current state, and the
symbol at the top of the stack. This means that those three parameters completely determine the
transition path that is chosen. Finite state machines just look at the input signal and the current
state: they have no stack to work with. Pushdown automata add the stack as a parameter for
choice. Pushdown automata can also manipulate the stack, as part of performing a transition.
Finite state machines choose a new state, the result of following the transition. The manipulation
can be to push a particular symbol to the top of the stack, or to pop off the top of the stack. The
automaton can alternatively ignore the stack, and leave it as it is. The choice of manipulation (or
no manipulation) is determined by the transition table. Put together: Given an input signal,
current state, and stack symbol, the automaton can follow a transition to another state, and
optionally manipulate (push or pop) the stack. In general pushdown automata may have several
computations on a given input string, some of which may be halting in accepting configurations
while others are not. Thus we have a model which is technically known as a "nondeterministic
pushdown automaton" (NPDA). No determinism means that there may be more than just one
transition available to follow, given an input signal, state, and stack symbol. If in every situation
only one transition is available as continuation of the computation, then the result is a
deterministic pushdown automaton (DPDA), a strictly weaker device. If we allow a finite
automaton access to two stacks instead of just one, we obtain a more powerful device, equivalent
in power to a Turing machine. A linear bounded automaton is a device which is more powerful
than a pushdown automaton but less so than a Turing machine.

Contenu connexe

Tendances

Lecture 4 assembly language
Lecture 4   assembly languageLecture 4   assembly language
Lecture 4 assembly languagePradeep Kumar TS
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086techbed
 
N_Asm Assembly arithmetic instructions (sol)
N_Asm Assembly arithmetic instructions (sol)N_Asm Assembly arithmetic instructions (sol)
N_Asm Assembly arithmetic instructions (sol)Selomon birhane
 
Learning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C LanguageLearning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C LanguageAbhishek Dwivedi
 
Pointers-Computer programming
Pointers-Computer programmingPointers-Computer programming
Pointers-Computer programmingnmahi96
 
Computer programming(CP)
Computer programming(CP)Computer programming(CP)
Computer programming(CP)nmahi96
 
Intel µp instruction encoding and decoding
Intel µp instruction encoding and decodingIntel µp instruction encoding and decoding
Intel µp instruction encoding and decodingyocirem
 
Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language ApekshaShinde6
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programmingnmahi96
 
Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructionsProdip Ghosh
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_outputAnil Dutt
 

Tendances (20)

Lecture 4 assembly language
Lecture 4   assembly languageLecture 4   assembly language
Lecture 4 assembly language
 
Datatypes
DatatypesDatatypes
Datatypes
 
1344 Alp Of 8086
1344 Alp Of 80861344 Alp Of 8086
1344 Alp Of 8086
 
X86 operation types
X86 operation typesX86 operation types
X86 operation types
 
[ASM]Lab4
[ASM]Lab4[ASM]Lab4
[ASM]Lab4
 
N_Asm Assembly arithmetic instructions (sol)
N_Asm Assembly arithmetic instructions (sol)N_Asm Assembly arithmetic instructions (sol)
N_Asm Assembly arithmetic instructions (sol)
 
Learning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C LanguageLearning c - An extensive guide to learn the C Language
Learning c - An extensive guide to learn the C Language
 
Pointers-Computer programming
Pointers-Computer programmingPointers-Computer programming
Pointers-Computer programming
 
Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)Fafl notes [2010] (sjbit)
Fafl notes [2010] (sjbit)
 
Computer programming(CP)
Computer programming(CP)Computer programming(CP)
Computer programming(CP)
 
Intel µp instruction encoding and decoding
Intel µp instruction encoding and decodingIntel µp instruction encoding and decoding
Intel µp instruction encoding and decoding
 
C notes.pdf
C notes.pdfC notes.pdf
C notes.pdf
 
Introduction to Assembly Language
Introduction to Assembly Language Introduction to Assembly Language
Introduction to Assembly Language
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
 
Flow control instructions
Flow control instructionsFlow control instructions
Flow control instructions
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
Compilers
CompilersCompilers
Compilers
 
Anu DAA i1t unit
Anu DAA i1t unitAnu DAA i1t unit
Anu DAA i1t unit
 
Unit3 cspc
Unit3 cspcUnit3 cspc
Unit3 cspc
 
Chapt 06
Chapt 06Chapt 06
Chapt 06
 

Similaire à Free Ebooks Download ! Edhole

Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! EdholeEdhole.com
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! EdholeEdhole.com
 
Automata based programming
Automata based programmingAutomata based programming
Automata based programmingVisnuDharsini
 
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHYFINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHYnishimanglani
 
Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Editor IJARCET
 
String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,8neutron8
 
push down automata
 push down automata push down automata
push down automatanadiatariq6
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdfFariyaTasneem1
 
closure properties of regular language.pptx
closure properties of regular language.pptxclosure properties of regular language.pptx
closure properties of regular language.pptxThirumoorthy64
 
Finite automata
Finite automataFinite automata
Finite automataPusp Sunar
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxMeghnadh
 
PDA and Turing Machine (1).ppt
PDA and Turing Machine (1).pptPDA and Turing Machine (1).ppt
PDA and Turing Machine (1).pptAayushSingh233965
 
Finite State Machine by M. Arokiasamy
Finite State Machine by M. ArokiasamyFinite State Machine by M. Arokiasamy
Finite State Machine by M. ArokiasamyMark Arokiasamy
 
States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testinggeethawilliam
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptxssuser47f7f2
 

Similaire à Free Ebooks Download ! Edhole (20)

Unit iv
Unit ivUnit iv
Unit iv
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! Edhole
 
Automata based programming
Automata based programmingAutomata based programming
Automata based programming
 
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHYFINITE STATE MACHINE AND CHOMSKY HIERARCHY
FINITE STATE MACHINE AND CHOMSKY HIERARCHY
 
Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207Volume 2-issue-6-2205-2207
Volume 2-issue-6-2205-2207
 
String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,String Matching with Finite Automata,Aho corasick,
String Matching with Finite Automata,Aho corasick,
 
Ch2 finite automaton
Ch2 finite automatonCh2 finite automaton
Ch2 finite automaton
 
push down automata
 push down automata push down automata
push down automata
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
 
flat unit1
flat unit1flat unit1
flat unit1
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
Theory of computation and automata
Theory of computation and automataTheory of computation and automata
Theory of computation and automata
 
closure properties of regular language.pptx
closure properties of regular language.pptxclosure properties of regular language.pptx
closure properties of regular language.pptx
 
Finite automata
Finite automataFinite automata
Finite automata
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
PDA and Turing Machine (1).ppt
PDA and Turing Machine (1).pptPDA and Turing Machine (1).ppt
PDA and Turing Machine (1).ppt
 
Finite State Machine by M. Arokiasamy
Finite State Machine by M. ArokiasamyFinite State Machine by M. Arokiasamy
Finite State Machine by M. Arokiasamy
 
States, state graphs and transition testing
States, state graphs and transition testingStates, state graphs and transition testing
States, state graphs and transition testing
 
03-FiniteAutomata.pptx
03-FiniteAutomata.pptx03-FiniteAutomata.pptx
03-FiniteAutomata.pptx
 

Plus de Edhole.com

Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarkaEdhole.com
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarkaEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in suratEdhole.com
 
Website dsigning company in india
Website dsigning company in indiaWebsite dsigning company in india
Website dsigning company in indiaEdhole.com
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiEdhole.com
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarkaEdhole.com
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarkaEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in suratEdhole.com
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in indiaEdhole.com
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhiEdhole.com
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbaiEdhole.com
 
Website development company surat
Website development company suratWebsite development company surat
Website development company suratEdhole.com
 
Website desinging company in surat
Website desinging company in suratWebsite desinging company in surat
Website desinging company in suratEdhole.com
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in indiaEdhole.com
 

Plus de Edhole.com (20)

Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website dsigning company in india
Website dsigning company in indiaWebsite dsigning company in india
Website dsigning company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Ca in patna
Ca in patnaCa in patna
Ca in patna
 
Chartered accountant in dwarka
Chartered accountant in dwarkaChartered accountant in dwarka
Chartered accountant in dwarka
 
Ca firm in dwarka
Ca firm in dwarkaCa firm in dwarka
Ca firm in dwarka
 
Ca in dwarka
Ca in dwarkaCa in dwarka
Ca in dwarka
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website designing company in surat
Website designing company in suratWebsite designing company in surat
Website designing company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 
Website designing company in delhi
Website designing company in delhiWebsite designing company in delhi
Website designing company in delhi
 
Website designing company in mumbai
Website designing company in mumbaiWebsite designing company in mumbai
Website designing company in mumbai
 
Website development company surat
Website development company suratWebsite development company surat
Website development company surat
 
Website desinging company in surat
Website desinging company in suratWebsite desinging company in surat
Website desinging company in surat
 
Website designing company in india
Website designing company in indiaWebsite designing company in india
Website designing company in india
 

Dernier

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 

Dernier (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 

Free Ebooks Download ! Edhole

  • 1. EDUCATION HOLE PRESENTS THEORY OF AUTOMATA & FORMAL LANGUAGES Unit-IV 2014 WWW.EDHOLE.COM
  • 2. Push Down Automata (PDA).................................................................................................... 2 Description and definition................................................................................................................3 Formal Definition..................................................................................................................................................3 Operation........................................................................................................................................3 Working of PDA....................................................................................................................... 5 Understanding the computation process..........................................................................................6 Acceptance of a string by PDA................................................................................................. 7 PDA and CFG ........................................................................................................................... 8 Introduction to auxiliary PDA .................................................................................................. 8 Two stack PDA .................................................................................................................................9 Push Down Automata (PDA) The PDA is used in theories about what can be computed by machines. It is more capable than a finite-state machine but less capable than a Turing machine. Because its input can be described with a formal grammar, it can be used in parser design. The deterministic pushdown automaton can handle all deterministic context-free languages while the nondeterministic version can handle all context-free languages. The term "pushdown" refers to the fact that the stack can be regarded as being "pushed down" like a tray dispenser at a cafeteria, since the operations never work on elements other than the top element. A stack automaton, by contrast, does allow access to and operations on deeper elements. Stack automata can recognize a strictly larger set of languages than deterministic pushdown automata. A nested stack automaton allows full access, and also allows stacked values to be entire sub-stacks rather than just single finite symbols.
  • 3. Description and definition Formal Definition We use standard formal language notation: denotes the set of strings over alphabet and denotes the empty string. A PDA is formally defined as a 7-tuple: where • is a finite set of states • is a finite set which is called the input alphabet • is a finite set which is called the stack alphabet • is a finite subset of , the transition relation. • is the start state • is the initial stack symbol • is the set of accepting states An element is a transition of . It has the intended meaning that , in state , with on the input and with as topmost stack symbol, may read , change the state to , pop , replacing it by pushing . The component of the transition relation is used to formalize that the PDA can either read a letter from the input, or proceed leaving the input untouched. In many texts the transition relation is replaced by an (equivalent) formalization, where • is the transition function, mapping into finite subsets of . Here contains all possible actions in state with on the stack, while reading on the input. One writes for the function precisely when for the relation. Note that finite in this definition is essential. Operation
  • 4. a diagram of the pushdown automaton Pushdown automata differ from finite state machines in two ways: 1. They can use the top of the stack to decide which transition to take. 2. They can manipulate the stack as part of performing a transition. Pushdown automata choose a transition by indexing a table by input signal, current state, and the symbol at the top of the stack. This means that those three parameters completely determine the transition path that is chosen. Finite state machines just look at the input signal and the current state: they have no stack to work with. Pushdown automata add the stack as a parameter for choice. Pushdown automata can also manipulate the stack, as part of performing a transition. Finite state machines choose a new state, the result of following the transition. The manipulation can be to push a particular symbol to the top of the stack, or to pop off the top of the stack. The automaton can alternatively ignore the stack, and leave it as it is. The choice of manipulation (or no manipulation) is determined by the transition table. Put together: Given an input signal, current state, and stack symbol, the automaton can follow a transition to another state, and optionally manipulate (push or pop) the stack. In general, pushdown automata may have several computations on a given input string, some of which may be halting in accepting configurations. If only one computation exists for all accepted strings, the result is a deterministic pushdown automaton (DPDA) and the language of these strings is a deterministic context-free language. Not all context-free languages are deterministic. As a consequence of the above the DPDA is a strictly weaker variant of the PDA and there exists no algorithm for converting a PDA to an equivalent DPDA, if such a DPDA exists. If we allow a finite automaton access to two stacks instead of just one, we obtain a more powerful device, equivalent in power to a Turing machine. A linear bounded automaton is a device which is more powerful than a pushdown automaton but less so than a Turing machine.
  • 5. Working of PDA The following is the formal description of the PDA which recognizes the language by final state: PDA for (by final state) , where states: input alphabet: stack alphabet: start state: start stack symbol: accepting states: The transition relation consists of the following six instructions: , , , , , and . In words, the first two instructions say that in state any time the symbol is read, one is pushed onto the stack. Pushing symbol on top of another is formalized as replacing top by (and similarly for pushing symbol on top of a ). The third and fourth instructions say that, at any moment the automaton may move from state to state .
  • 6. The fifth instruction says that in state , for each symbol read, one is popped. Finally, the sixth instruction says that the machine may move from state to accepting state only when the stack consists of a single . There seems to be no generally used representation for PDA. Here we have depicted the instruction by an edge from state to state labelled by (read ; replace by ). Understanding the computation process accepting computation for The following illustrates how the above PDA computes on different input strings. The subscript from the step symbol is here omitted. (a) Input string = 0011. There are various computations, depending on the moment the move from state to state is made. Only one of these is accepting. (i) . The final state is accepting, but the input is not accepted this way as it has not been read. (ii) . No further steps possible. (iii) . Accepting computation: ends in accepting state, while complete input has been read. (b) Input string = 00111. Again there are various computations. None of these is accepting. (i) . The final state is accepting, but the input is not accepted this way as it has not been read. (ii) . No further steps possible.
  • 7. (iii) . The final state is accepting, but the input is not accepted this way as it has not been (completely) read. Acceptance of a string by PDA A GPDA is a PDA which writes an entire string of some known length to the stack or removes an entire string from the stack in one step. A GPDA is formally defined as a 6-tuple: where Q, , , q0 and F are defined the same way as a PDA. : is the transition function. Computation rules for a GPDA are the same as a PDA except that the ai+1's and bi+1's are now strings instead of symbols. GPDA's and PDA's are equivalent in that if a language is recognized by a PDA, it is also recognized by a GPDA and vice versa. One can formulate an analytic proof for the equivalence of GPDA's and PDA's using the following simulation: Let (q1, w, x1x2...xm) (q2, y1y2...yn) be a transition of the GPDA where , , , , , . Construct the following transitions for the PDA: (q1, w, x1) (p1, ) (p1, , x2) (p2, ) (pm-1, , xm) (pm, ) (pm, , ) (pm+1, yn) (pm+1, , ) (pm+2, yn-1)
  • 8. (pm+n-1, , ) (q2, y1) PDA and CFG Every context-free grammar can be transformed into an equivalent pushdown automaton. The derivation process of the grammar is simulated in a leftmost way. Where the grammar rewrites a nonterminal, the PDA takes the topmost nonterminal from its stack and replaces it by the right- hand part of a grammatical rule (expand). Where the grammar generates a terminal symbol, the PDA reads a symbol from input when it is the topmost symbol on the stack (match). In a sense the stack of the PDA contains the unprocessed data of the grammar, corresponding to a pre-order traversal of a derivation tree. Technically, given a context-free grammar, the PDA is constructed as follows. 1. for each rule (expand) 2. for each terminal symbol (match) As a result we obtain a single state pushdown automata, the state here is , accepting the context-free language by empty stack. Its initial stack symbol equals the axiom of the context- free grammar. The converse, finding a grammar for a given PDA, is not that easy. The trick is to code two states of the PDA into the nonterminals of the grammar. Theorem. For each pushdown automaton one may construct a context-free grammar such that Introduction to auxiliary PDA A class of machines called one-way auxiliary pushdown automata, 1-APDA, is introduced. These machines differ from the well-known auxiliary pushdown automata by their input tape, which is one-way only. We restrict ourselves to f-tape-bounded 1-APDA with f(n) ≤ n and investigate some of their properties. In particular, it is shown: 1. log log n is a lower bound for the tape complexity of 1-APDA to accept non-context-free languages, and this is a sharp bound. 2. If f(n) < n, i.e. if lim f(n) / n = O, then
  • 9. {w1cw2cw←1cw←2/w1,w2ε{o,1}∗,|w1|=|w2|} is not accepted by any f-tape-bounded 1-APDA. 3. For every f with f(n) < n, nondeterministic f-tape-bounded 1-APDA are strictly more powerful than deterministic f-tape-bounded 1-APDA. This is in opposition to (two-way) auxiliary pushdown automata and to f-tape-bounded 1-APDA with f(n) ≥ c.n. Two stack PDA Pushdown automata choose a transition by indexing a table by input signal, current state, and the symbol at the top of the stack. This means that those three parameters completely determine the transition path that is chosen. Finite state machines just look at the input signal and the current state: they have no stack to work with. Pushdown automata add the stack as a parameter for choice. Pushdown automata can also manipulate the stack, as part of performing a transition. Finite state machines choose a new state, the result of following the transition. The manipulation can be to push a particular symbol to the top of the stack, or to pop off the top of the stack. The automaton can alternatively ignore the stack, and leave it as it is. The choice of manipulation (or no manipulation) is determined by the transition table. Put together: Given an input signal, current state, and stack symbol, the automaton can follow a transition to another state, and optionally manipulate (push or pop) the stack. In general pushdown automata may have several computations on a given input string, some of which may be halting in accepting configurations while others are not. Thus we have a model which is technically known as a "nondeterministic pushdown automaton" (NPDA). No determinism means that there may be more than just one transition available to follow, given an input signal, state, and stack symbol. If in every situation only one transition is available as continuation of the computation, then the result is a deterministic pushdown automaton (DPDA), a strictly weaker device. If we allow a finite automaton access to two stacks instead of just one, we obtain a more powerful device, equivalent in power to a Turing machine. A linear bounded automaton is a device which is more powerful than a pushdown automaton but less so than a Turing machine.