Nested stack automaton
   HOME

TheInfoList



OR:

In
automata theory Automata theory is the study of abstract machines and automata, as well as the computational problems that can be solved using them. It is a theory in theoretical computer science. The word ''automata'' comes from the Greek word αὐτόματο ...
, a nested stack automaton is a
finite automaton A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number o ...
that can make use of a
stack Stack may refer to: Places * Stack Island, an island game reserve in Bass Strait, south-eastern Australia, in Tasmania’s Hunter Island Group * Blue Stack Mountains, in Co. Donegal, Ireland People * Stack (surname) (including a list of people ...
containing data which can be additional stacks. Like a
stack automaton In the theory of computation, a branch of theoretical computer science, a pushdown automaton (PDA) is a type of automaton that employs a stack. Pushdown automata are used in theories about what can be computed by machines. They are more capa ...
, a nested stack automaton may step up or down in the stack, and read the current symbol; in addition, it may at any place create a new stack, operate on that one, eventually destroy it, and continue operating on the old stack. This way, stacks can be nested recursively to an arbitrary depth; however, the automaton always operates on the innermost stack only. A nested stack automaton is capable of recognizing an indexed language, and in fact the class of indexed languages is exactly the class of languages accepted by one-way nondeterministic nested stack automata. Nested stack automata should not be confused with
embedded pushdown automata An embedded pushdown automaton or EPDA is a computational model for parsing languages generated by tree-adjoining grammars (TAGs). It is similar to the context-free grammar-parsing pushdown automaton, but instead of using a plain stack to store sym ...
, which have less computational power.


Formal definition


Automaton

A (nondeterministic two-way) nested stack automaton is a tuple where * ''Q'', Σ, and Γ is a nonempty finite set of states, input symbols, and stack symbols, respectively, * and ] are distinct special symbols not contained in Σ ∪ Γ, ** is used as left endmarker for both the input string and a (sub)stack string, ** is used as right endmarker for these strings, ** ] is used as the final endmarker of the string denoting the whole stack.Aho originally used "$", "¢", and "#" instead of " , ", and "]", respectively. See Aho (1969), p.385 top. * An extended input alphabet is defined by Σ' = Σ ∪ { , an extended stack alphabet by Γ' = Γ ∪ {]}, and the set of input move directions by ''D'' = {-1,0,+1}. * δ, the finite control, is a mapping from ''Q'' × Σ' × (Γ' ∪ ' ∪ {'', ''''}) into finite subsets of ''Q'' × ''D'' × ( *_∪_''D''),_such_that_δ_mapsJuxataposition_denotes_string_concatenation#Concatenation_of_sets_of_strings.html" ;"title="Kleene_star.html" ;"title="Kleene star">* ∪ ''D''), such that δ mapsJuxataposition denotes string concatenation#Concatenation of sets of strings">string (set) concatenation, and has a higher binding priority than set union ∪. For example, [Γ' denotes the set of all length-2 strings starting with "[" and ending with a symbol from Γ'. {, , - ,       , , ''Q'' × Σ' × [Γ , , into subsets of ''Q'' × ''D'' × * , , (pushdown mode), , - , , , ''Q'' × Σ' × Γ' , , into subsets of ''Q'' × ''D'' × ''D'' , , (reading mode), , - , , , ''Q'' × Σ' × [Γ' , , into subsets of ''Q'' × ''D'' × {+1} , , (reading mode), , - , , , ''Q'' × Σ' × {]} , , into subsets of ''Q'' × ''D'' × {-1} , , (reading mode), , - , , , ''Q'' × Σ' × (Γ' ∪ [Γ') , , into subsets of ''Q'' × ''D'' × [Γ*] , , (stack creation mode), and , - , , , ''Q'' × Σ' × { ''''} , , into subsets of ''Q'' × ''D'' × { ε}, , , (stack destruction mode), :Informally, the top symbol of a (sub)stack together with its preceding left endmarker "[" is viewed as a single symbol; then δ reads :* the current state, :* the current input symbol, and :* the current stack symbol, : and outputs :* the next state, :* the direction in which to move on the input, and :* the direction in which to move on the stack, or the string of symbols to replace the topmost stack symbol. * ''q''0 ∈ ''Q'' is the initial state, * ''Z''0 ∈ Γ is the initial stack symbol, * ''F'' ⊆ ''Q'' is the set of final states.


Configuration

A configuration, or instantaneous description of such an automaton consists in a triple , where * ''q'' ∈ ''Q'' is the current state, * [''a''1''a''2...''a''''i''...''a''''n''-1] is the input string; for convenience, ''a''0 = [ and ''a''''n'' = ] is definedAho originally used the left and right stack marker, viz. $ and ¢, as right and left input marker, respectively. The current position in the input, viz. ''i'' with 0 ≤ ''i'' ≤ ''n'', is marked by underlining the respective symbol. * 'Z''1''X''2...''X''''j''...''X''''m''-1'' is the stack, including substacks; for convenience, ''X''1 = _and_''X''''m''_=_.html" ;"title="'Z''1 The top symbol of a (sub)stack together with its preceding left endmarker "[" is viewed as a single symbol. and ''X''''m'' = ">'Z''1 The top symbol of a (sub)stack together with its preceding left endmarker "[" is viewed as a single symbol. and ''X''''m'' = '' is defined. The current position in the stack, viz. ''j'' with 1 ≤ ''j'' ≤ ''m'', is marked by underlining the respective symbol.


Example

An example run (input string not shown): {, , - ! Action ! Step ! colspan=11 , Stack , - , , 1:       , style="font-family:monospace", [''a'' , , style="font-family:monospace", ''b'' , , style="font-family:monospace", [''k'' , , style="font-family:monospace", ] , , style="font-family:monospace", 'p'' , , style="font-family:monospace", , , style="font-family:monospace", ''c'' , , style="font-family:monospace", ] , colspan=3 ,   , - , create substack       , 2: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , style="font-family:monospace", [''r'' , , style="font-family:monospace", ''s'' , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , - , pop , 3: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", [''s'' , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", ,   , - , pop , 4: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", [] , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , colspan=2 ,   , - , destroy substack , 5: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", ] , , style="font-family:monospace", , , style="font-family:monospace", , colspan=4 ,   , - , move down , 6: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", ] , , style="font-family:monospace", ''c'' , , style="font-family:monospace", , colspan=4 ,   , - , move up , 7: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", ] , , style="font-family:monospace", ''c'' , , style="font-family:monospace", , colspan=4 ,   , - , move up , 8: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", 'p'' , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , colspan=4 ,   , - , push , 9: , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", [''n'' , , style="font-family:monospace", ''o'' , , style="font-family:monospace", ''p'' , , style="font-family:monospace", , , style="font-family:monospace", , , style="font-family:monospace", , colspan=2 ,  


Properties

When automata are allowed to re-read their input ("Two-way automaton, two-way automata"), nested stacks do not result in additional language recognition capabilities, compared to plain stacks. Gilman and Shapiro used nested stack automata to solve the Word problem for groups, word problem in certain Group (mathematics), groups.


Notes


References

{{Formal languages and grammars Models of computation Automata (computation)