<s>
In	O
theoretical	O
computer	O
science	O
and	O
formal	O
language	O
theory	O
,	O
a	O
tree	B-General_Concept
transducer	I-General_Concept
(	O
TT	O
)	O
is	O
an	O
abstract	B-Application
machine	I-Application
taking	O
as	O
input	O
a	O
tree	B-Application
,	O
and	O
generating	O
output	O
–	O
generally	O
other	O
trees	O
,	O
but	O
models	O
producing	O
words	O
or	O
other	O
structures	O
exist	O
.	O
</s>
<s>
Roughly	O
speaking	O
,	O
tree	B-General_Concept
transducers	I-General_Concept
extend	O
tree	B-Application
automata	I-Application
in	O
the	O
same	O
way	O
that	O
word	O
transducers	O
extend	O
word	B-Architecture
automata	I-Architecture
.	O
</s>
<s>
Manipulating	O
tree	B-Application
structures	O
instead	O
of	O
words	O
enable	O
TT	O
to	O
model	O
syntax-directed	O
transformations	O
of	O
formal	O
or	O
natural	O
languages	O
.	O
</s>
<s>
In	O
particular	O
,	O
most	O
of	O
the	O
main	O
classes	O
are	O
not	O
closed	O
under	O
composition	B-Application
.	O
</s>
<s>
The	O
main	O
classes	O
of	O
tree	B-General_Concept
transducers	I-General_Concept
are	O
:	O
</s>
<s>
Σ	O
is	O
a	O
finite	O
ranked	B-Application
alphabet	I-Application
,	O
called	O
the	O
input	O
alphabet	O
;	O
</s>
<s>
Γ	O
is	O
a	O
finite	O
ranked	B-Application
alphabet	I-Application
,	O
called	O
the	O
output	O
alphabet	O
;	O
</s>
<s>
is	O
a	O
set	O
of	O
rules	O
of	O
the	O
form	O
,	O
where	O
f	O
is	O
a	O
symbol	O
of	O
Σ	O
,	O
n	O
is	O
the	O
arity	O
of	O
f	O
,	O
q	O
is	O
a	O
state	O
,	O
and	O
u	O
is	O
a	O
tree	B-Application
on	O
Γ	O
and	O
,	O
such	O
pairs	O
being	O
nullary	O
.	O
</s>
<s>
The	O
semantics	B-Application
of	O
each	O
state	O
of	O
the	O
transducer	O
T	O
,	O
and	O
of	O
T	O
itself	O
,	O
is	O
a	O
binary	O
relation	O
between	O
input	O
trees	O
(	O
on	O
Σ	O
)	O
and	O
output	O
trees	O
(	O
on	O
Γ	O
)	O
.	O
</s>
<s>
A	O
way	O
of	O
defining	O
the	O
semantics	B-Application
formally	O
is	O
to	O
see	O
as	O
a	O
term	O
rewriting	O
system	O
,	O
provided	O
that	O
in	O
the	O
right-hand	O
sides	O
the	O
calls	O
are	O
written	O
in	O
the	O
form	O
,	O
where	O
states	O
q	O
are	O
unary	O
symbols	O
.	O
</s>
<s>
The	O
semantics	B-Application
of	O
T	O
is	O
then	O
defined	O
as	O
the	O
union	O
of	O
the	O
semantics	B-Application
of	O
its	O
initial	O
states	O
:	O
</s>
<s>
As	O
with	O
tree	B-Application
automata	I-Application
,	O
a	O
TOP	O
is	O
said	O
to	O
be	O
deterministic	O
(	O
abbreviated	O
DTOP	O
)	O
if	O
no	O
two	O
rules	O
of	O
δ	O
share	O
the	O
same	O
left-hand	O
side	O
,	O
and	O
there	O
is	O
at	O
most	O
one	O
initial	O
state	O
.	O
</s>
<s>
In	O
that	O
case	O
,	O
the	O
semantics	B-Application
of	O
the	O
DTOP	O
is	O
a	O
partial	B-Algorithm
function	I-Algorithm
from	O
input	O
trees	O
(	O
on	O
Σ	O
)	O
to	O
output	O
trees	O
(	O
on	O
Γ	O
)	O
,	O
as	O
are	O
the	O
semantics	B-Application
of	O
each	O
of	O
the	O
DTOP	O
's	O
states	O
.	O
</s>
<s>
The	O
domain	B-Algorithm
of	O
a	O
transducer	O
is	O
the	O
domain	B-Algorithm
of	O
its	O
semantics	B-Application
.	O
</s>
<s>
Likewise	O
,	O
the	O
image	O
of	O
a	O
transducer	O
is	O
the	O
image	O
of	O
its	O
semantics	B-Application
.	O
</s>
<s>
The	O
domain	B-Algorithm
of	O
a	O
DTOP	O
is	O
a	O
regular	O
tree	B-Application
language	I-Application
.	O
</s>
<s>
Furthermore	O
,	O
the	O
domain	B-Algorithm
is	O
recognisable	O
by	O
a	O
deterministic	O
top-down	B-Application
tree	I-Application
automaton	I-Application
(	O
DTTA	O
)	O
of	O
size	O
at	O
most	O
exponential	O
in	O
that	O
of	O
the	O
initial	O
DTOP	O
.	O
</s>
<s>
That	O
the	O
domain	B-Algorithm
is	O
DTTA-recognizable	O
is	O
not	O
surprising	O
,	O
considering	O
that	O
the	O
left-hand	O
sides	O
of	O
DTOP	O
rules	O
are	O
the	O
same	O
as	O
for	O
DTTA	O
.	O
</s>
<s>
That	O
means	O
that	O
the	O
right	O
child	O
must	O
be	O
in	O
the	O
domain	B-Algorithm
of	O
.	O
</s>
<s>
As	O
for	O
the	O
left	O
child	O
,	O
it	O
must	O
be	O
in	O
the	O
domain	B-Algorithm
of	O
both	O
and	O
.	O
</s>
<s>
Thus	O
the	O
construction	O
of	O
the	O
DTTA	O
recognising	O
the	O
domain	B-Algorithm
of	O
a	O
DTOP	O
must	O
account	O
for	O
sets	O
of	O
states	O
and	O
compute	O
the	O
intersections	O
of	O
their	O
domains	O
,	O
hence	O
the	O
exponential	O
.	O
</s>
<s>
The	O
image	O
of	O
a	O
DTOP	O
is	O
not	O
a	O
regular	O
tree	B-Application
language	I-Application
.	O
</s>
<s>
Then	O
,	O
absent	O
any	O
restrictions	O
on	O
the	O
first	O
child	O
of	O
the	O
input	O
,	O
the	O
image	O
is	O
a	O
classical	O
non-regular	O
tree	B-Application
language	I-Application
.	O
</s>
<s>
However	O
,	O
the	O
domain	B-Algorithm
of	O
a	O
DTOP	O
cannot	O
be	O
restricted	O
to	O
a	O
regular	O
tree	B-Application
language	I-Application
.	O
</s>
<s>
That	O
is	O
to	O
say	O
,	O
given	O
a	O
DTOP	O
T	O
and	O
a	O
language	O
L	O
,	O
one	O
cannot	O
in	O
general	O
build	O
a	O
DTOP	O
such	O
that	O
the	O
semantics	B-Application
of	O
is	O
that	O
of	O
T	O
,	O
restricted	O
to	O
L	O
.	O
</s>
<s>
This	O
property	O
is	O
linked	O
to	O
the	O
reason	O
deterministic	O
top-down	O
tree	B-Application
automata	I-Application
are	O
less	O
expressive	O
than	O
bottom-up	O
automata	O
:	O
once	O
you	O
go	O
down	O
a	O
given	O
path	O
,	O
information	O
from	O
other	O
paths	O
is	O
inaccessible	O
.	O
</s>
<s>
Now	O
let	O
's	O
say	O
we	O
want	O
to	O
restrict	O
this	O
transducer	O
to	O
the	O
finite	O
(	O
and	O
thus	O
,	O
in	O
particular	O
,	O
regular	O
)	O
domain	B-Algorithm
.	O
</s>
<s>
DTOP	O
are	O
not	O
closed	O
under	O
composition	B-Application
.	O
</s>
<s>
However	O
this	O
problem	O
can	O
be	O
solved	O
by	O
the	O
addition	O
of	O
a	O
lookahead	O
:	O
a	O
tree	B-Application
automaton	I-Application
,	O
coupled	O
to	O
the	O
transducer	O
,	O
that	O
can	O
perform	O
tests	O
on	O
the	O
domain	B-Algorithm
which	O
the	O
transducer	O
is	O
incapable	O
of	O
.	O
</s>
<s>
This	O
follows	O
from	O
the	O
point	O
about	O
domain	B-Algorithm
restriction	O
:	O
composing	O
the	O
DTOP	O
encoding	O
identity	O
on	O
with	O
the	O
one	O
encoding	O
must	O
yield	O
a	O
transducer	O
with	O
the	O
semantics	B-Application
,	O
which	O
we	O
know	O
is	O
not	O
expressible	O
by	O
a	O
DTOP	O
.	O
</s>
<s>
The	O
typechecking	O
problem	O
—	O
testing	O
whether	O
the	O
image	O
of	O
a	O
regular	O
tree	B-Application
language	I-Application
is	O
included	O
in	O
another	O
regular	O
tree	B-Application
language	I-Application
—	O
is	O
decidable	O
.	O
</s>
<s>
The	O
equivalence	B-General_Concept
problem	I-General_Concept
—	O
testing	O
whether	O
two	O
DTOP	O
define	O
the	O
same	O
functions	O
—	O
is	O
decidable	O
.	O
</s>
<s>
As	O
in	O
the	O
simpler	O
case	O
of	O
tree	B-Application
automata	I-Application
,	O
bottom-up	O
tree	B-General_Concept
transducers	I-General_Concept
are	O
defined	O
similarly	O
to	O
their	O
top-down	O
counterparts	O
,	O
but	O
proceed	O
from	O
the	O
leaves	O
of	O
the	O
tree	B-Application
to	O
the	O
root	O
,	O
instead	O
of	O
from	O
the	O
root	O
to	O
the	O
leaves	O
.	O
</s>
