Computer science students almost certainly become familiar with the concept of a stack by the time they enroll in a course on the (meta)theory of computation. Let us think of a stack as a string γ, over some alphabet Γ, whose length we are allowed to vary by adding to it or deleting from it exactly one symbol at a time. We have some restrictions to our access to the stack γ:
(1) Adding takes place only at the left end of γ. This end is called the top of the stack. Thus, if A
Γ, we can perform a Push operation and go from γ to A γ. We say that we pushed A into the stack. One often writes γ ↓ A to indicate that we pushed A into γ.
(2) The reverse operation, deleting, is called a Pop operation and it also takes place only at the left end of γ. It is defined only if γ ≠
. Say then γ = B γ′. Then a pop operation on this γ yields the string γ′. One often writes γ ↑ to indicate that we popped the top of γ (assuming we knew γ ≠
).
(3) Read access is allowed only at the top of γ.
(1) We endanger no confusion between the notations γ ↓ and f ( a ) ↓ as one is about a string (stack) and the other about a function (cf. p. 43 ). One often encounters the notations γ ⇐ and ⇐ γ for γ ↓ and γ ↑, respectively. The danger of confusing this symbol is greater in this context, where we are using its long form,
, for the yields-relation in (grammar) derivations.
(2) A so-augmented NFA in essence has the ability—additionally to the NFA’s ability to read input, one symbol at a time, as well as the ability to make an
-move without reading input —to record an unbounded , that is, dependent on input size , amount of information γ in a stack variable . In the preamble of Chapter 3 we introduced the FA as a restricted URM with only one variable that can hold a single digit at a time. The PDA model of this section will additionally have another variable that can hold any string (equivalently, any natural number, just as the variables of the unrestricted URM do), but we will put restrictions on the modes of access to this string-variable. In what follows we will not refer to this variable explicitly any more than we do so for the “input variable” of an NFA.
Are we deviating from our “program” to introduce only subsidiary formalisms to that of the URM? What of “string variables” and, especially, “restricted access” to them? Notwithstanding the comment that we often make that strings and natural numbers are interchangeable objects since the latter are coded as strings anyway (e.g., decimal notation) and, conversely, they can code strings, can we claim that a URM can perform those string-specific operations, such as “push” and “pop”? Yes.
However, we do not want to digress on this issue here. See Chapter 5.