<s>
A	O
tree	B-Application
automaton	I-Application
is	O
a	O
type	O
of	O
state	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
Tree	B-Application
automata	I-Application
deal	O
with	O
tree	B-Data_Structure
structures	I-Data_Structure
,	O
rather	O
than	O
the	O
strings	O
of	O
more	O
conventional	O
state	B-Architecture
machines	I-Architecture
.	O
</s>
<s>
The	O
following	O
article	O
deals	O
with	O
branching	O
tree	B-Application
automata	I-Application
,	O
which	O
correspond	O
to	O
regular	O
languages	O
of	O
trees	O
.	O
</s>
<s>
As	O
with	O
classical	O
automata	O
,	O
finite	O
tree	B-Application
automata	I-Application
(	O
FTA	O
)	O
can	O
be	O
either	O
a	O
deterministic	B-Application
automaton	I-Application
or	O
not	O
.	O
</s>
<s>
According	O
to	O
how	O
the	O
automaton	O
processes	O
the	O
input	O
tree	O
,	O
finite	O
tree	B-Application
automata	I-Application
can	O
be	O
of	O
two	O
types	O
:	O
(	O
a	O
)	O
bottom	O
up	O
,	O
(	O
b	O
)	O
top	O
down	O
.	O
</s>
<s>
This	O
is	O
an	O
important	O
issue	O
,	O
as	O
although	O
non-deterministic	O
(	O
ND	O
)	O
top-down	O
and	O
ND	O
bottom-up	O
tree	B-Application
automata	I-Application
are	O
equivalent	O
in	O
expressive	O
power	O
,	O
deterministic	O
top-down	O
automata	O
are	O
strictly	O
less	O
powerful	O
than	O
their	O
deterministic	O
bottom-up	O
counterparts	O
,	O
because	O
tree	O
properties	O
specified	O
by	O
deterministic	O
top-down	O
tree	B-Application
automata	I-Application
can	O
only	O
depend	O
on	O
path	O
properties	O
.	O
</s>
<s>
(	O
Deterministic	O
bottom-up	O
tree	B-Application
automata	I-Application
are	O
as	O
powerful	O
as	O
ND	O
tree	B-Application
automata	I-Application
.	O
)	O
</s>
<s>
where	O
Q	O
is	O
a	O
set	O
of	O
states	O
,	O
F	O
is	O
a	O
ranked	B-Application
alphabet	I-Application
(	O
i.e.	O
,	O
an	O
alphabet	O
whose	O
symbols	O
have	O
an	O
associated	O
arity	O
)	O
,	O
Qf	O
⊆	O
Q	O
is	O
a	O
set	O
of	O
final	O
states	O
,	O
and	O
Δ	O
is	O
a	O
set	O
of	O
transition	O
rules	O
of	O
the	O
form	O
f(q1(x1 )	O
,...,	O
qn(xn )	O
)	O
→	O
q( f( x1	O
,...,	O
xn	O
)	O
)	O
,	O
for	O
an	O
n-ary	O
f	O
∈	O
F	O
,	O
q	O
,	O
qi	O
∈	O
Q	O
,	O
and	O
xi	O
variables	O
denoting	O
subtrees	O
.	O
</s>
<s>
A	O
bottom-up	B-Application
tree	I-Application
automaton	I-Application
is	O
run	O
on	O
a	O
ground	O
term	O
over	O
F	O
,	O
starting	O
at	O
all	O
its	O
leaves	O
simultaneously	O
and	O
moving	O
upwards	O
,	O
associating	O
a	O
run	O
state	O
from	O
Q	O
with	O
each	O
subterm	O
.	O
</s>
<s>
The	O
term	O
is	O
accepted	O
if	O
its	O
root	O
is	O
associated	O
to	O
an	O
accepting	B-Architecture
state	I-Architecture
from	O
Qf	O
.	O
</s>
<s>
with	O
two	O
differences	O
with	O
bottom-up	O
tree	B-Application
automata	I-Application
.	O
</s>
<s>
A	O
tree	B-Application
automaton	I-Application
is	O
called	O
deterministic	O
(	O
abbreviated	O
DFTA	B-Application
)	O
if	O
no	O
two	O
rules	O
from	O
Δ	O
have	O
the	O
same	O
left	O
hand	O
side	O
;	O
otherwise	O
it	O
is	O
called	O
nondeterministic	O
(	O
NFTA	O
)	O
.	O
</s>
<s>
Non-deterministic	O
top-down	O
tree	B-Application
automata	I-Application
have	O
the	O
same	O
expressive	O
power	O
as	O
non-deterministic	O
bottom-up	O
ones	O
;	O
the	O
transition	O
rules	O
are	O
simply	O
reversed	O
,	O
and	O
the	O
final	O
states	O
become	O
the	O
initial	O
states	O
.	O
</s>
<s>
In	O
contrast	O
,	O
deterministic	O
top-down	O
tree	B-Application
automata	I-Application
are	O
less	O
powerful	O
than	O
their	O
bottom-up	O
counterparts	O
,	O
because	O
in	O
a	O
deterministic	B-Application
tree	I-Application
automaton	I-Application
no	O
two	O
transition	O
rules	O
have	O
the	O
same	O
left-hand	O
side	O
.	O
</s>
<s>
For	O
tree	B-Application
automata	I-Application
,	O
transition	O
rules	O
are	O
rewrite	O
rules	O
;	O
and	O
for	O
top-down	O
ones	O
,	O
the	O
left-hand	O
side	O
will	O
be	O
parent	O
nodes	O
.	O
</s>
<s>
Consequently	O
,	O
a	O
deterministic	O
top-down	B-Application
tree	I-Application
automaton	I-Application
will	O
only	O
be	O
able	O
to	O
test	O
for	O
tree	O
properties	O
that	O
are	O
true	O
in	O
all	O
branches	O
,	O
because	O
the	O
choice	O
of	O
the	O
state	O
to	O
write	O
into	O
each	O
child	O
branch	O
is	O
determined	O
at	O
the	O
parent	O
node	O
,	O
without	O
knowing	O
the	O
child	O
branches	O
contents	O
.	O
</s>
<s>
Infinite-tree	B-Application
automata	I-Application
extend	O
top-down	O
automata	O
to	O
infinite	O
trees	O
,	O
and	O
can	O
be	O
used	O
to	O
prove	O
decidability	O
of	O
S2S	O
,	O
the	O
monadic	O
second-order	O
theory	O
with	O
two	O
successors	O
.	O
</s>
<s>
Finite	O
tree	B-Application
automata	I-Application
(	O
nondeterministic	O
if	O
top-down	O
)	O
suffice	O
for	O
WS2S	O
.	O
</s>
<s>
Employing	O
coloring	O
to	O
distinguish	O
members	O
of	O
F	O
and	O
Q	O
,	O
and	O
using	O
the	O
ranked	B-Application
alphabet	I-Application
F	O
={	O
,,,	O
(	O
.	O
,	O
.	O
)	O
</s>
<s>
Using	O
the	O
same	O
colorization	O
as	O
above	O
,	O
this	O
example	O
shows	O
how	O
tree	B-Application
automata	I-Application
generalize	O
ordinary	O
string	O
automata	O
.	O
</s>
<s>
Using	O
the	O
notions	O
from	O
Deterministic	B-General_Concept
finite	I-General_Concept
automaton	I-General_Concept
#Formal	O
definition	O
,	O
it	O
is	O
defined	O
by	O
:	O
</s>
<s>
In	O
the	O
tree	B-Application
automaton	I-Application
setting	O
,	O
the	O
input	O
alphabet	O
is	O
changed	O
such	O
that	O
the	O
symbols	O
and	O
are	O
both	O
unary	O
,	O
and	O
a	O
nullary	O
symbol	O
,	O
say	O
is	O
used	O
for	O
tree	O
leaves	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
binary	O
string	O
""	O
in	O
the	O
string	O
automaton	O
setting	O
corresponds	O
to	O
the	O
term	O
"	O
((( )	O
)	O
)	O
"	O
in	O
the	O
tree	B-Application
automaton	I-Application
setting	O
;	O
this	O
way	O
,	O
strings	O
can	O
be	O
generalized	O
to	O
trees	O
,	O
or	O
terms	O
.	O
</s>
<s>
The	O
top-down	O
finite	O
tree	B-Application
automaton	I-Application
accepting	O
the	O
set	O
of	O
all	O
terms	O
corresponding	O
to	O
multiples	O
of	O
3	O
in	O
binary	O
string	O
notation	O
is	O
then	O
defined	O
by	O
:	O
</s>
<s>
For	O
example	O
,	O
the	O
tree	O
"	O
((( )	O
)	O
)	O
"	O
is	O
accepted	O
by	O
the	O
following	O
tree	B-Application
automaton	I-Application
run	O
:	O
</s>
<s>
Since	O
there	O
are	O
no	O
other	O
initial	O
states	O
than	O
to	O
start	O
an	O
automaton	O
run	O
with	O
,	O
the	O
term	O
"	O
(( )	O
)	O
"	O
is	O
not	O
accepted	O
by	O
the	O
tree	B-Application
automaton	I-Application
.	O
</s>
<s>
The	O
tree	B-Application
language	I-Application
L(A )	O
accepted	O
,	O
or	O
recognized	O
,	O
by	O
a	O
tree	B-Application
automaton	I-Application
A	O
is	O
the	O
set	O
of	O
all	O
ground	O
terms	O
accepted	O
by	O
A	O
.	O
</s>
<s>
A	O
set	O
of	O
ground	O
terms	O
is	O
recognizable	O
if	O
there	O
exists	O
a	O
tree	B-Application
automaton	I-Application
that	O
accepts	O
it	O
.	O
</s>
<s>
Every	O
sufficiently	O
large	O
ground	O
term	O
t	O
in	O
a	O
recognizable	O
tree	B-Application
language	I-Application
L	O
can	O
be	O
vertically	O
tripartited	O
such	O
that	O
arbitrary	O
repetition	O
(	O
"	O
pumping	O
"	O
)	O
of	O
the	O
middle	O
part	O
keeps	O
the	O
resulting	O
term	O
in	O
L	O
.	O
</s>
<s>
The	O
class	O
of	O
recognizable	O
tree	B-Application
languages	I-Application
is	O
closed	O
under	O
union	O
,	O
under	O
complementation	O
,	O
and	O
under	O
intersection	O
.	O
</s>
<s>
A	O
congruence	O
on	O
the	O
set	O
of	O
all	O
trees	O
over	O
a	O
ranked	B-Application
alphabet	I-Application
F	O
is	O
an	O
equivalence	O
relation	O
such	O
that	O
u1	O
≡	O
v1	O
and	O
...	O
and	O
un	O
≡	O
vn	O
implies	O
f( u1	O
,...,	O
un	O
)	O
≡	O
f( v1	O
,...,	O
vn	O
)	O
,	O
for	O
every	O
f	O
∈	O
F	O
.	O
</s>
<s>
The	O
Myhill	O
–	O
Nerode	O
theorem	O
for	O
tree	B-Application
automata	I-Application
states	O
that	O
the	O
following	O
three	O
statements	O
are	O
equivalent	O
:	O
</s>
