Jump to content

Tree stack automaton

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tdenk (talk | contribs) at 08:47, 21 June 2016 (minor edits and corrections to the definition of tree stack automata). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A tree stack automaton (plural: tree stack automata) is a theoretical device considered in automata theory. It is a finite state automaton with the additional ability to manipulate a tree-shaped stack. A restricted class of tree stack automata recognises exactly the languages generated by multiple context-free grammars[1] (or linear context-free rewriting systems).

Definition

Tree stack

A tree stack with stack pointer 1.2 and domain {1, 42, 1.2, 1.5, 1.5.3}

For a finite and non-empty set Γ, a tree stack over Γ is a tuple (t, p) where

  • t is a partial function from * to Γ ∪ {@} with prefix-closed[a] domain (called tree),
  • @ (called bottom symbol) is not in Γ and appears exactly at the root of t, and
  • p is an element of the domain of t (called stack pointer).

The set of all tree stacks over Γ is denoted by TS(Γ).

The set of predicates on TS(Γ), denoted by Pred(Γ), contains the following unary predicates:

  • true which is true for any tree stack over Γ,
  • bottom which is true for tree stacks whose stack pointer points to the bottom symbol, and
  • equals(γ) which is true for some tree stack (t, p) if t(p) = γ,

for every γΓ.

The set of instructions on TS(Γ), denoted by Instr(Γ), contains the following partial functions:

  • id: TS(Γ) → TS(Γ) which is the identity function on TS(Γ),
  • pushn,γ: TS(Γ) → TS(Γ) which adds for a given tree stack (t,p) a pair (pnγ) to the tree t and sets the stack pointer to pn (i.e. it pushes γ to the n-th child position) if pn is not yet in the domain of t,
  • upn: TS(Γ) → TS(Γ) which replaces the current stack pointer p by pn (i.e. it moves the stack pointer to the n-th child position) if pn is in the domain of t,
  • down: TS(Γ) → TS(Γ) which removes the last symbol from the stack pointer (i.e. it moves the stack pointer to the parent position), and
  • setγ: TS(Γ) → TS(Γ) which replaces the symbol currently under the stack pointer by γ,

for every natural number n and every γΓ.

Illustration of the instruction id on a tree stack
Illustration of the instruction push on a tree stack
Illustration of the instructions up and down on a tree stack
Illustration of the instruction set on a tree stack

Tree stack automata

A tree stack automaton is a 6-tuple A = (Q, Γ, Σ, qi, δ, Qf) where

  • Q, Γ, and Σ are finite sets (whose elements are called states, stack symbols, and input symbols, respectively),
  • qiQ (the initial state),
  • δfin. Q × (Σ ∪ {ε}) × Pred(Γ) × Instr(Γ) × Q (whose elements are called transitions), and
  • Qf ⊆ TS(Γ) (whose elements are called final states).

A configuration of A is a tuple (q, c, w) where

  • q is a state (the current state),
  • c is a tree stack (the current tree stack), and
  • w is a word over Σ (the remaining word to be read).

A transition τ = (q1, u, p, f, q2) is applicable to a configuration (q, c, w) if

  • q1 = q,
  • p is true on c, and
  • f is defined for c.

The transition relation of A is the binary relation on configurations of A that is the union of all the relations τ for a transition τ = (q1, u, p, f, q2) where, whenever τ is applicable to (q, c, w), we have (q, c, w) ⊢τ (q2, f(c), v) and v is obtained from w by removing the prefix u.

The language of A is the set of all words w for which there is some state qQf and some tree stack c such that (qi, ci, w) ⊢* (q, c, ε) where

  • * is the reflexive and transitive closure of and
  • ci = (ti, ε) such that ti assigns for ε the symbol @ and is undefined otherwise.

Notes

  1. ^ A set of strings is prefix closed if for every element w in the set, all prefixes of w are also in the set.

References

  1. ^ Denkinger, Tobias (2016). An automata characterisation for multiple context-free languages. Proceedings of the 20th International Conference on Developments in Language Theory (DLT 2016). arXiv:1606.02975 [cs.FL].