In automata theory, a tree is a particular way of representing a
tree structure
A tree structure, tree diagram, or tree model is a way of representing the hierarchical nature of a structure in a graphical form. It is named a "tree structure" because the classic representation resembles a tree, although the chart is genera ...
as sequences of natural numbers.

For example, each node of the tree is a
word
A word is a basic element of language that carries an objective or practical meaning, can be used on its own, and is uninterruptible. Despite the fact that language speakers often have an intuitive grasp of what a word is, there is no consen ...
over set of
natural numbers
In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country").
Numbers used for counting are called '' cardinal ...
(
), which helps this definition to be used 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 ''tree'' is a set ''T'' ⊆
* such that if ''t''.''c'' ∈ ''T'', with ''t'' ∈
* and ''c'' ∈
, then ''t'' ∈ ''T'' and ''t''.''c''
1 ∈ ''T'' for all 0 ≤ ''c''
1 < ''c''. The elements of ''T'' are known as ''nodes'', and the empty word ε is the (single) ''root'' of ''T''. For every ''t'' ∈ ''T'', the element ''t''.''c'' ∈ ''T'' is a ''successor'' of ''t'' in ''direction'' ''c''. The number of successors of ''t'' is called its ''degree'' or ''arity'', and represented as ''d''(''t''). A node is a ''leaf'' if it has no successors. If every node of a tree has finitely many successors, then it is called a ''finitely'', otherwise an ''infinitely branching'' tree. A ''path'' π is a subset of ''T'' such that ε ∈ π and for every ''t'' ∈ ''T'', either ''t'' is a leaf or there exists a unique ''c'' ∈
such that ''t''.''c'' ∈ π. A path may be a finite or infinite set. If all paths of a tree are finite then the tree is called finite, otherwise infinite. A tree is called ''fully infinite'' if all its paths are infinite. Given an
alphabet
An alphabet is a standardized set of basic written graphemes (called letters) that represent the phonemes of certain spoken languages. Not all writing systems represent language in this way; in a syllabary, each character represents a s ...
Σ, a ''Σ-labeled tree'' is a pair (''T'',''V''), where ''T'' is a tree and ''V'': ''T'' → Σ maps each node of ''T'' to a symbol in Σ. A labeled tree formally defines a commonly used
term tree structure. A set of labeled trees is called a ''tree language''.
A tree is called ''ordered'' if there is an order among the successors of each of its nodes. The above definition of tree naturally suggests an order among the successors, which can be used to make the tree ranked.
In the case of
ranked alphabets, an extra function ''Ar'': Σ →
is defined. This function associates a fixed arity to each symbol of the alphabet. In this case, each ''t'' ∈ ''T'' has to satisfy ''Ar''(''V''(''t'')) = ''d''(''t''). The trees that satisfy this property are called ''ranked'' trees. The trees that do not (necessarily) satisfy that property are called ''unranked''.
For example, the above definition is used in the definition of an
infinite tree automaton.
Example
Let ''T'' =
* and Σ = . We define a labeling function ''V'' as follows: the labeling for the root node is ''V''(ε) = ''a'' and, for every other node ''t'' ∈
*, the labellings for its successor nodes are ''V''(''t''.0) = ''a'' and ''V''(''t''.1) = ''b''. It is clear from the picture that ''T'' forms a (fully) infinite binary tree.
References
* {{cite book, first1=Hubert, last1=Comon, first2=Max, last2=Dauchet, first3=Rémi, last3=Gilleron, first4=Florent, last4=Jacquemard, first5=Denis, last5=Lugiez, first6=Christof, last6=Löding, first7=Sophie, last7=Tison, first8=Marc, last8=Tommasi, title=Tree Automata Techniques and Applications, date=November 2008, chapter=Preliminaries , url=https://gforge.inria.fr/frs/download.php/10994/tata.pdf, accessdate=11 February 2014, ref={{harvid, Comon et al., 2008
Trees (data structures)
Automata (computation)
Formal languages
Theoretical computer science