ArticleslgStudy

computer science

Deterministic pushdown automaton

Deterministic pushdown automaton is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Deterministic pushdown automaton rather than just read about it. In short: In automata theory, a deterministic pushdown automaton (DPDA or DPA) is a variation of the pushdown automaton. The class of deterministic pushdown automata accepts the deterministic context-free languages, a proper subset of context-free languages.

Key takeaways

  • Deterministic pushdown automaton belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Deterministic pushdown automaton to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Deterministic pushdown automaton from memory before moving on to harder problems.

Reference excerpt

In automata theory, a deterministic pushdown automaton (DPDA or DPA) is a variation of the pushdown automaton. The class of deterministic pushdown automata accepts the deterministic context-free languages, a proper subset of context-free languages. Machine transitions are based on the current state and input symbol, and also the current topmost symbol of the stack. Symbols lower in the stack are not visible and have no immediate effect. Machine actions include pushing, popping, or replacing the stack top. A deterministic pushdown automaton has at most one legal transition for the same combination of input symbol, state, and top stack symbol. This is where it differs from the nondeterministic pushdown automaton.

Formal definition A (not necessarily deterministic) PDA M can be defined as a 7-tuple:

M=(Q,Σ,Γ,q0,Z0,A,δ) where

Q is a finite set of states Σ is a finite set of input symbols Γ is a finite set of stack symbols q0∈Q is the start state Z0∈Γ is the starting stack symbol A⊆Q, where A is the set of accepting, or final, states δ is a transition function, where δ:(Q×(Σ∪{ε})×Γ)⟶𝒫(Q×Γ∗) where ∗ is the Kleene star, meaning that Γ∗ is "the set of all finite strings (including the empty string ε) of elements of Γ", ε denotes the empty string, and 𝒫(X) is the power set of a set X. M is deterministic if it satisfies both the following conditions:

For any q∈Q,a∈Σ∪{ε},x∈Γ, the set δ(q,a,x) has at most one element. For any q∈Q,x∈Γ, if δ(q,ε,x)≠∅︀, then δ(q,a,x)=∅︀ for every a∈Σ. There are two possible acceptance criteria: acceptance by empty stack and acceptance by final state. The two are not equivalent for the deterministic pushdown automaton (although they are for the non-deterministic pushdown automaton). The languages accepted by empty stack are those languages that are accepted by final state and are prefix-free: no word in the language is the prefix of another word in the language. The usual acceptance criterion is final state, and it is this acceptance criterion which is used to define the deterministic context-free languages.

Languages recognized If L(A) is a language accepted by a PDA A, it can also be accepted by a DPDA if and only if there is a single computation from the initial configuration until an accepting one for all strings belonging to L(A). If L(A) can be accepted by a PDA it is a context free language and if it can be accepted by a DPDA it is a deterministic context-free language (DCFL). Not all context-free languages are deterministic. This makes the DPDA a strictly weaker device than the PDA. For example, the language Lp of even-length palindromes on the alphabet of 0 and 1 has the context-free grammar S → 0S0 | 1S1 | ε. If a DPDA for this language exists, and it sees a string 0n, it must use its stack to memorize the length n, in order to be able to distinguish its possible continuations 0n 11 0n ∈ Lp and 0n 11 0n+2 ∉ Lp. Hence, after reading 0n 11 0n, comparing the post-"11" length to the pre-"11" length will make the stack empty again. For this reason, the strings 0n 11 0n 0n 11 0n ∈ Lp and 0n 11 0n 0n+2 11 0n+2 ∉ Lp cannot be distinguished. Restricting the DPDA to a single state reduces the class of languages accepted to the LL(1) languages, which is a proper subclass of the DCFL. In the case of a PDA, this restriction has no effect on the class of languages accepted.

Properties

Closure Closure properties of deterministic context-free languages (accepted by deterministic PDA by final state) are drastically different from the context-free languages. As an example they are (effectively) closed under complementation, but not closed under union. To prove that the complement of a language accepted by a deterministic PDA is also accepted by a deterministic PDA is tricky because one has to avoid infinite computations and correctly handle transitions that manipulate the stack without reading input symbols. As a consequence of the complementation it is decidable whether a deterministic PDA accepts all words over its input alphabet, by testing its complement for emptiness. This is not possible for context-free grammars (hence not for general PDA).

Equivalence problem Géraud Sénizergues (1997) proved that the equivalence problem for deterministic PDA (i.e. given two deterministic PDA A and B, is L(A)=L(B)?) is decidable, a proof that earned him the 2002 Gödel Prize. For nondeterministic PDA, equivalence is undecidable.

Notes

Further reading Hamburger, Henry; Dana S. Richards (2002). Logic and Language Models for Computer Science. Upper Saddle River, NJ 07458: Prentice Hall. pp. 284–331. ISBN 0-13-065487-6.{{cite book}}: CS1 maint: location (link)

Worked examples

Example 1 — a first encounter with Deterministic pushdown automaton

Start with the simplest possible case. Write down what Deterministic pushdown automaton claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Deterministic pushdown automaton before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Deterministic pushdown automaton ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Deterministic pushdown automaton

In research
Deterministic pushdown automaton appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Deterministic pushdown automaton in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Deterministic pushdown automaton is common in secondary-school and first-year university syllabi. It links to neighbouring topics Automata (computation), Formal languages, Models of computation, so understanding it makes those chapters shorter.
In everyday life
Look for Deterministic pushdown automaton outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Deterministic pushdown automaton” →

How to study Deterministic pushdown automaton in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Deterministic pushdown automaton means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Deterministic pushdown automaton out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Deterministic pushdown automaton in simple terms?

In automata theory, a deterministic pushdown automaton (DPDA or DPA) is a variation of the pushdown automaton. The class of deterministic pushdown automata accepts the deterministic context-free languages, a proper subset of context-free languages.

Why does Deterministic pushdown automaton matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Deterministic pushdown automaton?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Deterministic pushdown automaton.

Tags

  • Automata (computation)
  • Formal languages
  • Models of computation

Keep exploring