Talk:Pushdown automaton
This is the talk page for discussing improvements to the Pushdown automaton article. This is not a forum for general discussion of the article's subject. 
Article policies

Find sources: Google (books · news · newspapers · scholar · free images · WP refs) · FENS · JSTOR · NYT · WP Library 
WikiProject Computer science  (Rated Bclass, Highimportance)  


Untitled[edit]
I thought a pushdown automton was called a pushdown automaton because of the last in  first out stack system, i.e. the pushdown store. When a new entry is put onto the stack, it "pushes the previous entries down". On the explanation in the article, there's no reason for the pushdown automaton to be particularly deserving of the name, since it needn't be implemented using a punch card system and any other abstract machine that could be implemented using a punch card system would also be a pushdown automaton, by the same logic. 71.197.85.71 03:12, 2 January 2007 (UTC)
I added an example to the page to make it easier to understand how pushdown automation works. Please verify that it's correct. An illustration of the corresponding state diagram would be nice but I don't have time to make one (source).
"Pushdown automata exist in deterministic and nondeterministic varieties, and the two are not equipotent."
A comment to the information in the page:
Nondeterministic pushdown automata are more potent than deterministic pushdown automata. Some deterministic pushdown automata cannot accept contextfree languages accepted by nondeterministic pushdown automata.
Pushdown automaton as a 7Tuple?[edit]
Isn't a pushdown automaton usually defined as a 6tuple, instead of a 7tuple? 82.82.120.201 18:53, 20 Feb 2004 (UTC)
Kozen's "Automata and Computability" defines it in terms of a 7tuple. However, as he later points out, if we're interested in acceptance by empty stack rather than acceptance by final state then the final state is irrelevant. So it could be dropped leaving a 6tuple. Is that how you've seen it? I can't say which is more common. Josh Cherry 01:38, 21 Feb 2004 (UTC)
Actually the Wikipedia entry was the first time, that I saw the 7tuple. I will surf the internet a to find out, which is the more common definition. Usually I saw definitions like 82.83.0.53 10:51, 21 Feb 2004 (UTC)
If you decide to include a formal definition, it should be a "complete" definition, not something based on hit count from Google. PDA is defined as 7tuple , where denotes the set of final states and cannot be omitted from the definition of PDA. PDAs form a set hierarchy with the most encompassing set being nondeterministic PDAs, then the more restrictive deterministic PDA with final state acceptance and the most restrictive set, deterministic PDAs with empty stack acceptance (This is not a comprehensive list, it only serves to illustrate the point). All of them are 7tuple, but for example, for DPDA with empty stack acceptance, it holds that is an empty set  you cannot just ommit it, you need to define it precisely. That's what formal definition is for  one look and you know what kind of PDA it is.oOo
Added a comment on the possible use of 6tuples instead. I cite John Reif (Duke University), and point out that if an additional start state and first transition are added, they are equivalent. I felt it against Wikipedia's style to include the citation the article, but I'm probably wrong about that, so please change it if I am. MikedeS
I had added...
Three ways of starting and recognizing are:
 Start with the stack holding , and then say it's done when then stack is empty.
 Start with an empty stack, and have the first state immediately push a symbol (like ) onto the stack, and say it's done when the stack is empty.
 Start with an empty stack, and say it's done when a special accept symbol is placed on the stack.
...but canceled, when I realized how incredibly petty the whole conversation is. There are many ways to signal the end of the stack FSM, and many ways to start it.
Both the formal definition and the computation definition should be consistent. In one there is a 7tuple and the other is only a 6tuple!!! 189.136.79.171 (talk) 14:58, 8 February 2008 (UTC)
Thomas A. Sudkamp's "Languages and Machines" defines it as a 6tuple.96.32.143.226 (talk) 04:31, 22 October 2008 (UTC)
Transition function[edit]
I am just a first year student, so I do not dare to correct the original text. But I wonder: Shouldn't the transition function read:
 σ is a finite transition relation (Q × ( Σ & {ε}) × Φ) ( Q × Φ^{*} )
( instead of ×)
 I think that the idea is that it is not necessarily a function since the automaton need not be deterministic. In general it is a relation. However, I think that you're right that something is wrong. I suspect that it should say the the relation is some subset of (Q × ( Σ & {ε}) × Φ) × ( Q × Φ^{*} ). But I'm no expert either. By the way, please sign your posts. Josh Cherry 00:13, 12 Oct 2004 (UTC)
Quite right. The transitions can be specified as a finite relation (of five tuples) as Josh Cherry states. The preserve the idea of moving from a situation (state, input letter to be read, topmost stack symbol) to another situation (new state, new stack sequence) one sometimes defines a transition function as on the wikipage. This must introduce the powerset at the righthand side of the arrow, as the automaton may have several choices on the same initial situation. Though mathematically the formulations are close, personally I prefer the relation, since it avoids the powerset. Jochgem 16:40, 30 October 2007 (UTC)
NPDADPDA equivalence[edit]
I seem to recall that NPDA and DPDA are equivalent, as any NFA of n states can be written as a DFA of 2^{n} states (since there are only 2^n possible state combinations an NFA can be in). Thus I don't think that a DPDA is "strictly weaker" than an NPDA, though I could be misremembering (it's not like I've had to use this since getting my master's degree or anything). Or does the nondeterminism also apply to the stack? 207.171.180.101 23:06, 6 September 2006 (UTC)
 No, NFAs (nondeterministic finite automata) and DFAs (deterministic finite automata) are equivalent. These are finite automata, but we are talking about pushdown automata. NPDAs are strictly more powerful than DPDAs. Spoon! 02:57, 14 December 2006 (UTC)
 For example, the language of evenlength palindromes ww^{R} (where w is a string and w^{R} means the reverse of w) is contextfree, but cannot be recognized by any DPDA. Spoon! 01:01, 9 January 2007 (UTC)
Question added to article by anon[edit]
An anon user asked this question in an edit, so I thought I'd answer.
 SO I GOT HERE FROM THE PAGE ON COMPUTABILITY THEORY. THEY SHOWED A PROBLEM WHERE AN FSM WOULD FAIL. THE PROBLEM WAS TO SHOW THAT A STRING HAD THE SAME NUMBER OF A'S AS B'S. THEY PROVED HOW A FSM COULD ALIAS A SET OF A'S THAT WERE SUFFICIENTLY FAR ENOUGH APART TO LOOK THE SAME. THUS WHEN COMPARED TO THE NUMBER OF B'S WE GOT A FALSE ACCEPTANCE OF THIS STRING, I.E., WE THOUGHT THAT THE COUNT OF A'S WAS EQUAL TO THE COUNT OF B'S BUT WERE WRONG. CAN YOU SHOW HOW A PUSHDOWN AUTOMATON COULD CORRECTLY SOLVE THIS PROBLEM. I THINK THAT WOULD HELP ME QUICKLY UNDERSTAND THE USEFULNESS AND POWER OF A PUSHDOWN AUTOMATA. THANKS.
Informally: The pushdown automaton pushes each A onto the stack as it reads it in. Then, whem it comes to the string of Bs, it removes the top element of the stack for every B it reads in. If the stack is empty when the end of the input is reached, the automaton succeeds. Cadr 07:28, 4 May 2007 (UTC)
Missing a formal definition of computation for PDA[edit]
I have a background in pure mathematics and for computer science, I am just a beginer. I sometimes feel terrible in reading stuffs (articles, textbooks...) about computer science because of the lack of rigorous mathematical treatment. I don't think you can have a meaningful debate on the merits of a definition (6tuples or 7tuples) without formally defining the computation processs under each PDA definition. Having said that, I'd like to point out some inconsistencies between the formal definition and the illustrative example in this Article.
First, by formal definition, the image of is a subset of where is the set of all strings from and is a finite set of the stack alphabet. In the illustrative example, , which impies that is an element of which in turn implies that is an element of . How is it possible that is an element of ?
Secondly, formal definition requires that PDA be 7tuple whereas the illustrative example consider it a 6tuple.
Thirdly, there is no explanation of how the machine can get from a situation where the symbol at the top of the stack was to a situation where the symbol at the top of the stack was A. Keep in mind that every move and hence every change is driven by the transition function and therefore must be explained by the transition function.
In short, we need a formal definition of computation for the formal definition of PDA which we choose and then we need to demonstrate that this pair of definitions works on all situations.
CBKAtTopsails 19:57, 25 June 2007 (UTC) CBKAtTopsails 18:01, 27 June 2007 (UTC)
A formal definition of computation seems now part of the wikipage, based on the notion of computation path. I do not know where this idea comes from, but I feel this is a very bad choice for a definition. For PDA computations the isolated state sequence rarely is of value in technical arguments, instead one combines states and stack contents. In fact when the PDA has only a single state (a normal form for PDA) then a computation path consists of a repetition of that state which is hardly informative. The usual approach is as follows. Define a 'instantaneous description' (or global state) as a triplet (state, inputnotread, stack). Then define a single step (or move) of the PDA as a relation between instantaneous descriptions. Finally define computation as a sequence of steps.
Oh, the definition of determinism is more complex than the suggestion on the wikipage. It involves both state, input letter and topmost stack symbol. The latter is not present in the underlying finite state automaton. In particular, a PDA may be deterministic, while the underlying FSA is nondeterministic. Jochgem 16:32, 30 October 2007 (UTC)
Diagrams![edit]
Let's make some diagrams, for the love of god! My diagrammaking ability is limited to MS Paint, so might anybody be willing to generate something? Otherwise, I'll stick in something temporary. SamuelRiv 03:41, 6 November 2007 (UTC)
The Idea Of Computation Path[edit]
The idea of computation path is basically the concept of computation branch in any nondeterministic machine as used in some textbooks. For example, take a look at Michael Sipser's "Introduction to the Theory of Computation".
I believe the reason we need formal definition is we want to establish theorems using rigorous mathematical arguments. Any arguments that cannot tie back to the basic definitions would not be considered rigorous in the mathematical communty. I am not sure about the "usual approach" you mentioned here and what practical purposes it can serve. Let's say, if we accept this "usual approach" to define PDA, can we widely use this definition to establish many important theorems in theoretical computer science? How are you going to prove the following well known theorem in theoretical computer science:
"A language is contextfree iff some PDA recognizes it."
Keep in mind that every argument you make in your proof must tie back to your basic definition.
CBKAtTopsails 17:27, 9 November 2007 (UTC)
Some Additional Comments[edit]
"Oh, the definition of determinism is more complex than the suggestion on the wikipage. It involves both state, input letter and topmost stack symbol. The latter is not present in the underlying finite state automaton."
Response: I do not believe you are reading this page very carefully. The sequence s_{1}, s_{2}.....s_{n} tells you the stack contents. The sequences a_{1},a_{2}...a_{n} and b_{1},b_{2}....b_{n} tell you what is being read from the stack ,what is being removed and what is being pushed in. The sequence w_{1},w_{2}....w_{n}represents the input symbols.
"In particular, a PDA may be deterministic, while the underlying FSA is nondeterministic."
Response: I believe a deterministic PDA is just a special case of a nondeterministic PDA in which there is only one branch of computation. One can specify the transition function to obtain a deterministic PDA. If you don't see it that way, maybe you should put up a formal definition for deterministic PDA.
"In fact when the PDA has only a single state (a normal form for PDA) then a computation path consists of a repetition of that state which is hardly informative."
Response: I don't understand the logic in this statement. PDA is not a single state. It is a 6tuple containing a component called the transition function. When a string is input to the PDA, the transition function generates the computation paths. If you don't think this situation has any meaning, don't create it. You are the one to define the transition function.
CBKAtTopsails 17:03, 10 November 2007 (UTC)
Dear CBKAtTopsails. Sorry for the confusion I caused. I do very much agree with your opinion that a formal definition for the semantics of a PDA is needed before doing proofs. My problem is that the computation path itself includes only states; it is a state sequence. With this definition every PDA that happens to have only a single state will be deterministic (which is not true). Computation paths should include the stack contents too, and preferably also the input. In this way they record the full (global) state of the automaton, not only the internal (local, finite) state. Jochgem 22:23, 10 November 2007 (UTC)
I think I can understand some of your points here. Presumably, I can go back to rewrite the computation path replacing each q_{i} with a 4tuple (q_{i}, w_{i}, a_{i}, s_{i}) but this will make things look very cumbersome and not add any substance to the definition.
"With this definition every PDA that happens to have only a single state will be deterministic (which is not true)."
Response: I do not see how this definition would force any PDA with a single state into a deterministic one. In fact, if you look at condition (i) of Computation Definition 1, you will notice that this condition allows multiple values of b_{i+1} for any given set of q_{i}, w_{i+1} and a_{i+1} even when q_{i}=q_{i+1}. In this case, you have a nondeterministic PDA.
CBKAtTopsails 08:11, 11 November 2007 (UTC)
2PDA[edit]
Just learned about the 2stack pushdown automata in class, yet there's nothing here and there's no page for it...just throwing that out there. ThomasOwens (talk) 23:52, 28 January 2009 (UTC)
Thomas: they are mentioned on this page as equivalent to Turing machines. Jochgem (talk) 09:50, 25 April 2009 (UTC)
On PDA's and contextfree languages[edit]
In the section PDA and Contextfree Languages it says "Where the grammar rewrites a nonterminal, the PDA takes the topmost nonterminal from its stack and replaces it by the righthand part of a grammatical rule (expand)." But, in fact a nonterminal is associated with a grammar production which may consist of multiple rules (e.g. S > a b c  d e f is really one production with two rules S > a b c and S > d e f). I think we should make it clear that the nonterminal may have more than one "righthand side" and more than one edge may be added for a particular nonterminal. Furthermore, deciding to transition along an edge in this case will be nondeterministic (thus this method only corresponds to NPDA's). Rehno Lindeque (talk) 16:42, 3 June 2011 (UTC)
GPDA[edit]
The section on Generalized PDA is unimportant detail that should be dropped. Since PDA and GPDA are equivalent, and all users of PDAs use the PDA form and not the GPDA form, no general readers of this article need to review this. This appears to be a classroom or textbook exercise in proving equivalences. DBSand (talk) 17:39, 16 June 2012 (UTC)
 I think it does have encyclopedic significance as an aspect of PDA theory. It shows that extending a PDA to a GPDA does not increase its language recognition power. Nxavar (talk) 09:36, 11 September 2012 (UTC)
Merge with deterministic pushdown automata article[edit]
The commonalities and differences of deterministic and nondeterministic PDAs would be clearer if these two topics were covered in a single article rather than separate, competing articles. DBSand (talk) 17:56, 16 June 2012 (UTC)
Pushdown Transducers[edit]
Why is there absolutely no mention of PDTs, other than the page being redirected from the 'Pushdown Transducer' page? We covered this in my Theory of Computation class recently, and it seems like there's no mention of the word Transducer at all on this page, nor is there anything about dealing with outputs other than 'accept' and 'fail'. Ryokenohki (talk) 01:07, 3 May 2013 (UTC)