Counter automaton

Diagram of a counter automaton. Each cell of its stack either contains an "A" or a space symbol.

In computer science, more particular in the theory of formal languages, a counter automaton, or counter machine, is a pushdown automaton with only two symbols, A {\displaystyle A} and the initial symbol in Γ {\displaystyle \Gamma } , the finite set of stack symbols.[1]: 171 

Equivalently, a counter automaton is a nondeterministic finite automaton with an additional memory cell that can hold one nonnegative integer number (of unlimited size), which can be incremented, decremented, and tested for being zero.[2]: 351 

Properties

The class of counter automata can recognize a proper superset of the regular[note 1] and a subset of the deterministic context free languages.[2]: 352 

For example, the language { a n b n : n N } {\displaystyle \{a^{n}b^{n}:n\in \mathbb {N} \}} is a non-regular[note 2] language accepted by a counter automaton: It can use the symbol A {\displaystyle A} to count the number of a {\displaystyle a} s in a given input string x {\displaystyle x} (writing an A {\displaystyle A} for each a {\displaystyle a} in x {\displaystyle x} ), after that, it can delete an A {\displaystyle A} for each b {\displaystyle b} in x {\displaystyle x} .

A two-counter automaton, that is, a two-stack Turing machine with a two-symbol alphabet, can simulate an arbitrary Turing machine.[1]: 172 

Notes

  1. ^ Every regular language L is accepted by some finite automaton F (see Regular language#Equivalent formalisms). Enriching F with a two-symbol stack which is ignored by F’s control makes it a counter automaton accepting L.
  2. ^ by the pumping lemma for regular languages

References

  1. ^ a b John E. Hopcroft and Jeffrey D. Ullman (1979). Introduction to Automata Theory, Languages, and Computation. Reading/MA: Addison-Wesley. ISBN 0-201-02988-X.
  2. ^ a b John E. Hopcroft and Rajeev Motwani and Jeffrey D. Ullman (2003). Introduction to Automata Theory, Languages, and Computation. Upper Saddle River/NJ: Addison Wesley. ISBN 0-201-44124-1.
  • v
  • t
  • e
Automata theory: formal languages and formal grammars
Chomsky hierarchyGrammarsLanguagesAbstract machines
  • Type-0
  • Type-1
  • Type-2
  • Type-3
Each category of languages, except those marked by a *, is a proper subset of the category directly above it. Any language in each category is generated by a grammar and by an automaton in the category in the same line.