SlideShare uma empresa Scribd logo
1 de 38
Lecture Pushdown Automata
tape




tape head
              stack head




    finite
                  stack
    control
a   l   p   h   a   b   e   t




The tape is divided into finitely many cells.
Each cell contains a symbol in an alphabet
Σ.
The stack head always scans the top
symbol of the stack. It performs two
basic operations:

Push: add a new symbol at the top.

Pop: read and remove the top symbol.


 Alphabet of stack symbols: Γ
a




• The head scans at a cell on the tape and
  can read a symbol on the cell. In each
  move, the head can move to the right cell.
• The finite control has finitely many states
  which form a set Q. For each move, the
  state is changed according to the
  evaluation of a transition function
                                     Q x (Γ U {ε})
  δ : Q x (Σ U {ε}) x (Γ U {ε}) → 2 .
a                      a



     q       v                  p     u


• (p, u) ∈ δ(q, a, v) means that if the tape head
  reads a, the stack head read v, and the finite
  control is in the state q, then one of possible
  moves is that the next state is p, v is replaced
  by u at stack, and the tape head moves one cell
  to the right.
a                         a



     q        v                p       u


• (p, u) ∈ δ(q, ε, v) means that this a ε-move.
a                      a



     q                          p     u




• (p, u) ∈ δ(q, a, ε) means that a push operation
  performs at stack.
a                      a



     q       v                  p




• (p, ε) ∈ δ(q, a, v) means that a pop operation
  performs at stack
s




• There are some special states: an initial
  state s and a final set F of final states.
• Initially, the PDA is in the initial state s and
  the head scans the leftmost cell. The tape
  holds an input string. The stack is empty.
x




              f




• When the head gets off the tape, the PDA
  stops. An input string x is accepted by the
  PDA if the PDA stops at a final state and
  the stack is empty.
• Otherwise, the input string is rejected.
• The PDA can be represented by
        M = (Q, Σ, Γ, δ, s, F)
  where Σ is the alphabet of input symbols
  and Γ is the alphabet of stack symbols.
• The set of all strings accepted by a PDA M
  is denoted by L(M). We also say that the
  language L(M) is accepted by M.
• The transition diagram of a PDA is an
  alternative way to represent the PDA.
• For M = (Q, Σ, Γ, δ, s, F), the transition diagram
  of M is an edge-labeled digraph G=(V, E)
  satisfying the following:

   V = Q (s =        ,f=      for f   ∈   F)

            a, v/u
   E={q               p | (p,u) ∈ δ(q, a, v) }.
Example 1. Construct PDA to accept
                n n
           L= {0 1 | n > 0}

Solution 1.

              1, 0/ε


         0, ε/0        1, 0/ε
Solution 2.

     Consider a CFG
     G = ({S}, {0,1}, {S → ε | 0S1}, S).



                        ε, S/1
          ε, ε/S
                                    ε, ε/S
                           ε, ε/0
               ε, S/ε

               0, 0/ε
               1, 1/ε
Theorem Every CFL can be accepted by a PDA.

Proof.   Consider a CFL L = L(G) for a CFG
         G = (V, Σ, R, S).

                      ε, A/xn     A → x1 x2 …xn in R
           ε, ε/S

                        ε, ε/x1
          a, a/ε for a in Σ

 Theorem
A language L is CFL ⇔ it can be accepted by a PDA.
Sometimes, constructing the PDA is easier than
constructing CFG.
Example 2

Show that {x ∈ {a, b} | #b ( x) ≤ # a ( x) ≤ 2#b ( x)} is a CFL


         Construct a PDA or a CFG?


                     PDA!!!



   Sometimes, constructing the PDA is easier than
   constructing CFG.
Idea
To check if #b ( x) ≤ # a ( x) ≤ 2#b ( x), we need to cancel a with b.
For each b, we need to cancel sometimes one a and sometimes
two a. Do we need to make a deterministic choice at each
cancellation? No, the concept of nondeterministic computation
solves this trouble : As long as a correct choice exists, the input
string x would be accepted!
a                    a



      s                    p   s


• (p, s) ∈ δ(s, ε, ε)


                ε ,ε / s
a                       a



    p                       p   a
             s
                                s
(q, s) ∈ δ(p, a, s)
(p, a) ∈ δ(q, ε, ε)
                 a, s / s

              ε ,ε / a
a                       a



    p                       p   a
             a
                                a
      ∈
(q1, a) δ(p, a, a)
(p, a) ∈ δ(q1, ε, ε)
                 a, a / a

             ε ,ε / a
a                         a



p                         p
    b




                  (p, ε) ∈ δ(p, a, b)

        a,b / ε
a                           a



p                           p       b’
    b




                    (p, b’)∈ δ(p, a, b)

        a, b / b'
a                            a



p                            p
    b’




                    (p, ε) ∈ δ(p, a, b’)

         a,b' / ε
b                       b



    p                       p   b
             s
                                s
(r1, s)∈ δ(p, b, s)
(p, b) ∈ δ(r1, ε, ε)
                 b, s / s

              ε ,ε / b
b                       b



    p                       p   b
             b
                                b
(r2, b)∈ δ(p, b, b)
(p, b) ∈ δ(r2, ε, ε)
                 b, b / b

              ε ,ε / b
b                      b



    p                      p   b
             b’
                               b’
(r3, b’) ∈ δ(p, b, b’)
(p, b) ∈ δ(r3, ε, ε)
              b, b' / b'

              ε ,ε / b
b                          b



p                          p
    a




                   (p, ε) ∈ δ(p, b, a)

        b, a / ε
b                              b



   p                              p
            a
            a



(t, ε) ∈ δ(p, b, a)        (p, ε) ∈ δ(t, ε, a)
                b, a / ε

             ε,a /ε
b                                     b



       p                                    p   b’
                  a
                  z                             z
                           z≠a

(t, ε) ∈ δ(p, b, a) (u, x) ∈ δ(t, ε, x) (p, b’)∈ δ(u, ε, ε)
                      b, a / ε

                                 ε, z / z
             ε ,b' / ε           z≠a
p                         p
    s




                 (p, ε) ∈ δ(p, ε, s)

        ε,s /ε
a,b / ε
                        a, b / b'
                        a,b' / ε
           ε ,ε / s                a, z / z
                                   z ≠ b,b'

                                   ε ,ε / a
                                               ε,s /ε
               b, a / ε
           b, a / ε                b, z / z
                                    z≠a
           ε,a /ε
ε, z / z                            ε ,ε / b
 z≠a                  ε , ε / b'
Example 3
Construct PDA accepting {x ∈ {a, b} | #b ( x) <# a ( x) ≤ 2#b ( x)}.


 Idea

To have #b ( x) <# a ( x), we must have a b which cancel two a ' s.
Let the first b do the job.
a,b / ε
Solution
                                    a, b / b'                 a, z / z
                                   a,b' / ε              1
                                                             z ≠ b,b'
     ε ,ε / s          a, b / b'             a, z / z
                  11                        z ≠ b,b'         ε ,ε / a
  b, a / ε        ε,a /ε
                             ε , ε / b'
                                            ε ,ε / a
              ε, z / z
               z≠a                                             ε,s /ε
                                 b, a / ε
                       b, a / ε              b, z / z
                                              z≠a
                                                             b, z / z
                        ε,a /ε                           1
           ε, z / z                           ε ,ε / b       z≠a
            z≠a                  ε , ε / b'
                                                             ε ,ε / b
Example 4
Construct PDA accepting {x ∈ {a, b} | #b ( x) ≤# a ( x) < 2#b ( x)}.


 Idea

To have # a ( x) < 2#b ( x), we must have a b which cancel one a.
Let the first b do the job.
a,b / ε
Solution
                          a, b / b'                         a, z / z
                          a,b' / ε                     1
                                                           z ≠ b,b'
   ε ,ε / s      a,b / ε           a, z / z
               1
               1
                                  z ≠ b,b'                 ε ,ε / a
                 b, a / ε
                                   ε ,ε / a
                                                             ε,s /ε
                               b, a / ε
                    b, a / ε                b, z / z
                                            z≠a
                                                           b, z / z
                    ε,a /ε                             1
         ε, z / z                           ε ,ε / b       z≠a
          z≠a                  ε , ε / b'
                                                           ε ,ε / b

Mais conteúdo relacionado

Mais procurados

Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computationBipul Roy Bpl
 
Automata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA ConversionAutomata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA ConversionAkila Krishnamoorthy
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Mohammad Ilyas Malik
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory Rajendran
 
Pushdown Automata Theory
Pushdown Automata TheoryPushdown Automata Theory
Pushdown Automata TheorySaifur Rahman
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture NotesFellowBuddy.com
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal languageRabia Khalid
 
Push down automata
Push down automataPush down automata
Push down automataSomya Bagai
 
Regular Expression to Finite Automata
Regular Expression to Finite AutomataRegular Expression to Finite Automata
Regular Expression to Finite AutomataArchana Gopinath
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal formsAkila Krishnamoorthy
 
Lecture: Context-Free Grammars
Lecture: Context-Free GrammarsLecture: Context-Free Grammars
Lecture: Context-Free GrammarsMarina Santini
 

Mais procurados (20)

Context free grammar
Context free grammar Context free grammar
Context free grammar
 
Pda
PdaPda
Pda
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 
Automata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA ConversionAutomata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA Conversion
 
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
 
Np cooks theorem
Np cooks theoremNp cooks theorem
Np cooks theorem
 
Intro automata theory
Intro automata theory Intro automata theory
Intro automata theory
 
Pushdown Automata Theory
Pushdown Automata TheoryPushdown Automata Theory
Pushdown Automata Theory
 
Theory of Computation Lecture Notes
Theory of Computation Lecture NotesTheory of Computation Lecture Notes
Theory of Computation Lecture Notes
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Push down automata
Push down automataPush down automata
Push down automata
 
Regular Expression to Finite Automata
Regular Expression to Finite AutomataRegular Expression to Finite Automata
Regular Expression to Finite Automata
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Role-of-lexical-analysis
Role-of-lexical-analysisRole-of-lexical-analysis
Role-of-lexical-analysis
 
Context free grammar
Context free grammarContext free grammar
Context free grammar
 
String matching algorithms
String matching algorithmsString matching algorithms
String matching algorithms
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal forms
 
Properties of cfg
Properties of cfgProperties of cfg
Properties of cfg
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
Lecture: Context-Free Grammars
Lecture: Context-Free GrammarsLecture: Context-Free Grammars
Lecture: Context-Free Grammars
 

Destaque

PUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINEPUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINEAbhishek Shivhare
 
Push Down Automata (PDA)
Push Down Automata (PDA)Push Down Automata (PDA)
Push Down Automata (PDA)dhea zafarina
 
Class8
 Class8 Class8
Class8issbp
 
Pushdown Automata - Materi 8 - TBO
Pushdown Automata - Materi 8 - TBOPushdown Automata - Materi 8 - TBO
Pushdown Automata - Materi 8 - TBOahmad haidaroh
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
Automata languages and computation
Automata languages and computationAutomata languages and computation
Automata languages and computationKarthik Velou
 
Turing Machine
Turing MachineTuring Machine
Turing MachineAyAn KhAn
 
Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4Abhimanyu Mishra
 
Context free grammars
Context free grammarsContext free grammars
Context free grammarsRonak Thakkar
 
Formal methods 3 - languages and machines
Formal methods   3 - languages and machinesFormal methods   3 - languages and machines
Formal methods 3 - languages and machinesVlad Patryshev
 
Copi and cohen's introduction to logic
Copi and cohen's introduction to logicCopi and cohen's introduction to logic
Copi and cohen's introduction to logicDr. Asif Kamran
 
Regular expressions and languages pdf
Regular expressions and languages pdfRegular expressions and languages pdf
Regular expressions and languages pdfDilouar Hossain
 

Destaque (20)

Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
 
PUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINEPUSH DOWN AUTOMATA VS TURING MACHINE
PUSH DOWN AUTOMATA VS TURING MACHINE
 
Pushdown autometa
Pushdown autometaPushdown autometa
Pushdown autometa
 
Push Down Automata (PDA)
Push Down Automata (PDA)Push Down Automata (PDA)
Push Down Automata (PDA)
 
Class8
 Class8 Class8
Class8
 
Turing machines
Turing machinesTuring machines
Turing machines
 
Theory of computation Lec7 pda
Theory of computation Lec7 pdaTheory of computation Lec7 pda
Theory of computation Lec7 pda
 
Turing machine by_deep
Turing machine by_deepTuring machine by_deep
Turing machine by_deep
 
Pushdown Automata - Materi 8 - TBO
Pushdown Automata - Materi 8 - TBOPushdown Automata - Materi 8 - TBO
Pushdown Automata - Materi 8 - TBO
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Automata languages and computation
Automata languages and computationAutomata languages and computation
Automata languages and computation
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Push Down Automata (PDA)
Push Down Automata (PDA)Push Down Automata (PDA)
Push Down Automata (PDA)
 
Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4Theory of automata and formal languages Unit 4
Theory of automata and formal languages Unit 4
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
 
Turing machine
Turing machineTuring machine
Turing machine
 
Formal methods 3 - languages and machines
Formal methods   3 - languages and machinesFormal methods   3 - languages and machines
Formal methods 3 - languages and machines
 
Copi and cohen's introduction to logic
Copi and cohen's introduction to logicCopi and cohen's introduction to logic
Copi and cohen's introduction to logic
 
Regular expressions and languages pdf
Regular expressions and languages pdfRegular expressions and languages pdf
Regular expressions and languages pdf
 
Page replacement
Page replacementPage replacement
Page replacement
 

Semelhante a pushdown automata

Discrete mathematic question answers
Discrete mathematic question answersDiscrete mathematic question answers
Discrete mathematic question answersSamet öztoprak
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdfBenoitValea
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdfBenoitValea
 
On Hadamard Product of P-Valent Functions with Alternating Type
On Hadamard Product of P-Valent Functions with Alternating TypeOn Hadamard Product of P-Valent Functions with Alternating Type
On Hadamard Product of P-Valent Functions with Alternating TypeIOSR Journals
 
The Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random ProjectionThe Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random ProjectionDon Sheehy
 
Owf 2013 rii veri t fontaine speaker4
Owf 2013 rii veri t fontaine speaker4Owf 2013 rii veri t fontaine speaker4
Owf 2013 rii veri t fontaine speaker4Patrick MOREAU
 
A sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentialsA sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentialsVjekoslavKovac1
 
Sensors and Samples: A Homological Approach
Sensors and Samples:  A Homological ApproachSensors and Samples:  A Homological Approach
Sensors and Samples: A Homological ApproachDon Sheehy
 
11.[29 35]a unique common fixed point theorem under psi varphi contractive co...
11.[29 35]a unique common fixed point theorem under psi varphi contractive co...11.[29 35]a unique common fixed point theorem under psi varphi contractive co...
11.[29 35]a unique common fixed point theorem under psi varphi contractive co...Alexander Decker
 
slides CIRM copulas, extremes and actuarial science
slides CIRM copulas, extremes and actuarial scienceslides CIRM copulas, extremes and actuarial science
slides CIRM copulas, extremes and actuarial scienceArthur Charpentier
 
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmString Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmKiran K
 
Lect1 No 873503264
Lect1 No 873503264Lect1 No 873503264
Lect1 No 873503264yangrong
 
Approximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsApproximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsStefano Cabras
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicManjula V
 
On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...
On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...
On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...IOSR Journals
 
Lundi 16h15-copules-charpentier
Lundi 16h15-copules-charpentierLundi 16h15-copules-charpentier
Lundi 16h15-copules-charpentierArthur Charpentier
 
Optimization of probabilistic argumentation with Markov processes
Optimization of probabilistic argumentation with Markov processesOptimization of probabilistic argumentation with Markov processes
Optimization of probabilistic argumentation with Markov processesEmmanuel Hadoux
 
Bayesian adaptive optimal estimation using a sieve prior
Bayesian adaptive optimal estimation using a sieve priorBayesian adaptive optimal estimation using a sieve prior
Bayesian adaptive optimal estimation using a sieve priorJulyan Arbel
 

Semelhante a pushdown automata (20)

Discrete mathematic question answers
Discrete mathematic question answersDiscrete mathematic question answers
Discrete mathematic question answers
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdf
 
590-Article Text.pdf
590-Article Text.pdf590-Article Text.pdf
590-Article Text.pdf
 
On Hadamard Product of P-Valent Functions with Alternating Type
On Hadamard Product of P-Valent Functions with Alternating TypeOn Hadamard Product of P-Valent Functions with Alternating Type
On Hadamard Product of P-Valent Functions with Alternating Type
 
The Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random ProjectionThe Persistent Homology of Distance Functions under Random Projection
The Persistent Homology of Distance Functions under Random Projection
 
Owf 2013 rii veri t fontaine speaker4
Owf 2013 rii veri t fontaine speaker4Owf 2013 rii veri t fontaine speaker4
Owf 2013 rii veri t fontaine speaker4
 
A sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentialsA sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentials
 
Sensors and Samples: A Homological Approach
Sensors and Samples:  A Homological ApproachSensors and Samples:  A Homological Approach
Sensors and Samples: A Homological Approach
 
11.[29 35]a unique common fixed point theorem under psi varphi contractive co...
11.[29 35]a unique common fixed point theorem under psi varphi contractive co...11.[29 35]a unique common fixed point theorem under psi varphi contractive co...
11.[29 35]a unique common fixed point theorem under psi varphi contractive co...
 
slides CIRM copulas, extremes and actuarial science
slides CIRM copulas, extremes and actuarial scienceslides CIRM copulas, extremes and actuarial science
slides CIRM copulas, extremes and actuarial science
 
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt AlgorithmString Matching with Finite Automata and Knuth Morris Pratt Algorithm
String Matching with Finite Automata and Knuth Morris Pratt Algorithm
 
Lect1 No 873503264
Lect1 No 873503264Lect1 No 873503264
Lect1 No 873503264
 
Approximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-LikelihoodsApproximate Bayesian Computation with Quasi-Likelihoods
Approximate Bayesian Computation with Quasi-Likelihoods
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
BAYSM'14, Wien, Austria
BAYSM'14, Wien, AustriaBAYSM'14, Wien, Austria
BAYSM'14, Wien, Austria
 
On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...
On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...
On Some Types of Fuzzy Separation Axioms in Fuzzy Topological Space on Fuzzy ...
 
Lundi 16h15-copules-charpentier
Lundi 16h15-copules-charpentierLundi 16h15-copules-charpentier
Lundi 16h15-copules-charpentier
 
Logic
LogicLogic
Logic
 
Optimization of probabilistic argumentation with Markov processes
Optimization of probabilistic argumentation with Markov processesOptimization of probabilistic argumentation with Markov processes
Optimization of probabilistic argumentation with Markov processes
 
Bayesian adaptive optimal estimation using a sieve prior
Bayesian adaptive optimal estimation using a sieve priorBayesian adaptive optimal estimation using a sieve prior
Bayesian adaptive optimal estimation using a sieve prior
 

Último

diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...Krashi Coaching
 
Benefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptxBenefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptxsbabel
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxheathfieldcps1
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/siemaillard
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Mohamed Rizk Khodair
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxMohamed Rizk Khodair
 
Poster_density_driven_with_fracture_MLMC.pdf
Poster_density_driven_with_fracture_MLMC.pdfPoster_density_driven_with_fracture_MLMC.pdf
Poster_density_driven_with_fracture_MLMC.pdfAlexander Litvinenko
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Celine George
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptxPoojaSen20
 
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...Sumit Tiwari
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽中 央社
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...Nguyen Thanh Tu Collection
 

Último (20)

diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
MSc Ag Genetics & Plant Breeding: Insights from Previous Year JNKVV Entrance ...
 
Benefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptxBenefits and Challenges of OER by Shweta Babel.pptx
Benefits and Challenges of OER by Shweta Babel.pptx
 
The basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptxThe basics of sentences session 4pptx.pptx
The basics of sentences session 4pptx.pptx
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
Championnat de France de Tennis de table/
Championnat de France de Tennis de table/Championnat de France de Tennis de table/
Championnat de France de Tennis de table/
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).Dementia (Alzheimer & vasular dementia).
Dementia (Alzheimer & vasular dementia).
 
demyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptxdemyelinated disorder: multiple sclerosis.pptx
demyelinated disorder: multiple sclerosis.pptx
 
Poster_density_driven_with_fracture_MLMC.pdf
Poster_density_driven_with_fracture_MLMC.pdfPoster_density_driven_with_fracture_MLMC.pdf
Poster_density_driven_with_fracture_MLMC.pdf
 
“O BEIJO” EM ARTE .
“O BEIJO” EM ARTE                       .“O BEIJO” EM ARTE                       .
“O BEIJO” EM ARTE .
 
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
Removal Strategy _ FEFO _ Working with Perishable Products in Odoo 17
 
ANTI PARKISON DRUGS.pptx
ANTI         PARKISON          DRUGS.pptxANTI         PARKISON          DRUGS.pptx
ANTI PARKISON DRUGS.pptx
 
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
Chapter 7 Pharmacosy Traditional System of Medicine & Ayurvedic Preparations ...
 
IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.IPL Online Quiz by Pragya; Question Set.
IPL Online Quiz by Pragya; Question Set.
 
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽會考英聽
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
BỘ LUYỆN NGHE TIẾNG ANH 8 GLOBAL SUCCESS CẢ NĂM (GỒM 12 UNITS, MỖI UNIT GỒM 3...
 

pushdown automata

  • 2. tape tape head stack head finite stack control
  • 3. a l p h a b e t The tape is divided into finitely many cells. Each cell contains a symbol in an alphabet Σ.
  • 4. The stack head always scans the top symbol of the stack. It performs two basic operations: Push: add a new symbol at the top. Pop: read and remove the top symbol. Alphabet of stack symbols: Γ
  • 5. a • The head scans at a cell on the tape and can read a symbol on the cell. In each move, the head can move to the right cell.
  • 6. • The finite control has finitely many states which form a set Q. For each move, the state is changed according to the evaluation of a transition function Q x (Γ U {ε}) δ : Q x (Σ U {ε}) x (Γ U {ε}) → 2 .
  • 7. a a q v p u • (p, u) ∈ δ(q, a, v) means that if the tape head reads a, the stack head read v, and the finite control is in the state q, then one of possible moves is that the next state is p, v is replaced by u at stack, and the tape head moves one cell to the right.
  • 8. a a q v p u • (p, u) ∈ δ(q, ε, v) means that this a ε-move.
  • 9. a a q p u • (p, u) ∈ δ(q, a, ε) means that a push operation performs at stack.
  • 10. a a q v p • (p, ε) ∈ δ(q, a, v) means that a pop operation performs at stack
  • 11. s • There are some special states: an initial state s and a final set F of final states. • Initially, the PDA is in the initial state s and the head scans the leftmost cell. The tape holds an input string. The stack is empty.
  • 12. x f • When the head gets off the tape, the PDA stops. An input string x is accepted by the PDA if the PDA stops at a final state and the stack is empty. • Otherwise, the input string is rejected.
  • 13. • The PDA can be represented by M = (Q, Σ, Γ, δ, s, F) where Σ is the alphabet of input symbols and Γ is the alphabet of stack symbols. • The set of all strings accepted by a PDA M is denoted by L(M). We also say that the language L(M) is accepted by M.
  • 14. • The transition diagram of a PDA is an alternative way to represent the PDA. • For M = (Q, Σ, Γ, δ, s, F), the transition diagram of M is an edge-labeled digraph G=(V, E) satisfying the following: V = Q (s = ,f= for f ∈ F) a, v/u E={q p | (p,u) ∈ δ(q, a, v) }.
  • 15. Example 1. Construct PDA to accept n n L= {0 1 | n > 0} Solution 1. 1, 0/ε 0, ε/0 1, 0/ε
  • 16. Solution 2. Consider a CFG G = ({S}, {0,1}, {S → ε | 0S1}, S). ε, S/1 ε, ε/S ε, ε/S ε, ε/0 ε, S/ε 0, 0/ε 1, 1/ε
  • 17. Theorem Every CFL can be accepted by a PDA. Proof. Consider a CFL L = L(G) for a CFG G = (V, Σ, R, S). ε, A/xn A → x1 x2 …xn in R ε, ε/S ε, ε/x1 a, a/ε for a in Σ Theorem A language L is CFL ⇔ it can be accepted by a PDA.
  • 18. Sometimes, constructing the PDA is easier than constructing CFG.
  • 19. Example 2 Show that {x ∈ {a, b} | #b ( x) ≤ # a ( x) ≤ 2#b ( x)} is a CFL Construct a PDA or a CFG? PDA!!! Sometimes, constructing the PDA is easier than constructing CFG.
  • 20. Idea To check if #b ( x) ≤ # a ( x) ≤ 2#b ( x), we need to cancel a with b. For each b, we need to cancel sometimes one a and sometimes two a. Do we need to make a deterministic choice at each cancellation? No, the concept of nondeterministic computation solves this trouble : As long as a correct choice exists, the input string x would be accepted!
  • 21. a a s p s • (p, s) ∈ δ(s, ε, ε) ε ,ε / s
  • 22. a a p p a s s (q, s) ∈ δ(p, a, s) (p, a) ∈ δ(q, ε, ε) a, s / s ε ,ε / a
  • 23. a a p p a a a ∈ (q1, a) δ(p, a, a) (p, a) ∈ δ(q1, ε, ε) a, a / a ε ,ε / a
  • 24. a a p p b (p, ε) ∈ δ(p, a, b) a,b / ε
  • 25. a a p p b’ b (p, b’)∈ δ(p, a, b) a, b / b'
  • 26. a a p p b’ (p, ε) ∈ δ(p, a, b’) a,b' / ε
  • 27. b b p p b s s (r1, s)∈ δ(p, b, s) (p, b) ∈ δ(r1, ε, ε) b, s / s ε ,ε / b
  • 28. b b p p b b b (r2, b)∈ δ(p, b, b) (p, b) ∈ δ(r2, ε, ε) b, b / b ε ,ε / b
  • 29. b b p p b b’ b’ (r3, b’) ∈ δ(p, b, b’) (p, b) ∈ δ(r3, ε, ε) b, b' / b' ε ,ε / b
  • 30. b b p p a (p, ε) ∈ δ(p, b, a) b, a / ε
  • 31. b b p p a a (t, ε) ∈ δ(p, b, a) (p, ε) ∈ δ(t, ε, a) b, a / ε ε,a /ε
  • 32. b b p p b’ a z z z≠a (t, ε) ∈ δ(p, b, a) (u, x) ∈ δ(t, ε, x) (p, b’)∈ δ(u, ε, ε) b, a / ε ε, z / z ε ,b' / ε z≠a
  • 33. p p s (p, ε) ∈ δ(p, ε, s) ε,s /ε
  • 34. a,b / ε a, b / b' a,b' / ε ε ,ε / s a, z / z z ≠ b,b' ε ,ε / a ε,s /ε b, a / ε b, a / ε b, z / z z≠a ε,a /ε ε, z / z ε ,ε / b z≠a ε , ε / b'
  • 35. Example 3 Construct PDA accepting {x ∈ {a, b} | #b ( x) <# a ( x) ≤ 2#b ( x)}. Idea To have #b ( x) <# a ( x), we must have a b which cancel two a ' s. Let the first b do the job.
  • 36. a,b / ε Solution a, b / b' a, z / z a,b' / ε 1 z ≠ b,b' ε ,ε / s a, b / b' a, z / z 11 z ≠ b,b' ε ,ε / a b, a / ε ε,a /ε ε , ε / b' ε ,ε / a ε, z / z z≠a ε,s /ε b, a / ε b, a / ε b, z / z z≠a b, z / z ε,a /ε 1 ε, z / z ε ,ε / b z≠a z≠a ε , ε / b' ε ,ε / b
  • 37. Example 4 Construct PDA accepting {x ∈ {a, b} | #b ( x) ≤# a ( x) < 2#b ( x)}. Idea To have # a ( x) < 2#b ( x), we must have a b which cancel one a. Let the first b do the job.
  • 38. a,b / ε Solution a, b / b' a, z / z a,b' / ε 1 z ≠ b,b' ε ,ε / s a,b / ε a, z / z 1 1 z ≠ b,b' ε ,ε / a b, a / ε ε ,ε / a ε,s /ε b, a / ε b, a / ε b, z / z z≠a b, z / z ε,a /ε 1 ε, z / z ε ,ε / b z≠a z≠a ε , ε / b' ε ,ε / b