6.2 Inverses of a Finite Automaton 189
a non-empty subset of T
(Y,X,τ − 1). We “join” trees in T
0
(Y,X,τ − 1) to
the partial finite automaton
¯
M
τ
to get a partial finite automaton, say M
=
Y,X,S
,δ
,λ
, as follows. The state alphabet S
of M
is the union set
of
¯
S
τ
and all vertices with level <τ of all trees in T
0
(Y,X,τ − 1); we assume
that states in
¯
S
τ
and such vertices are different from each other. For any state
t in S
and any y in Y , we define δ
(t, y)andλ
(t, y)asfollows.Inthecase
of t ∈
¯
S
τ
, define δ
(t, y)=
¯
δ
(t, y)andλ
(t, y)=
¯
λ
(t, y). In the case where t
is a vertex with level <τ−1ofsometreeinT
0
(Y,X,τ − 1), if there is an arc
with input label y emitted from t, then define δ
(t, y)=t
and λ
(t, y)=x,
where t
is the terminal vertex of the arc and x is the output label of the arc;
if there is no arc with input label y emitted from t,thenδ
(t, y)andλ
(t, y)
are undefined. In the case where t is a vertex with level τ − 1 of some tree in
T
0
(Y,X,τ − 1), let y
0
, y
1
, ..., y
τ−2
be the input label sequence of arcs in the
path from the root to t. If there is an arc with input label y emitted from t,
then define δ
(t, y)=δ
M
(S, y
0
...y
τ−2
y), y, y
τ−2
,...,y
0
,astateof
¯
M
τ
,
and λ
(t, y)=x,wherex is the output label of the arc; if there is no arc
with input label y emitted from t,thenδ
(t, y)andλ
(t, y) are undefined.
The states corresponding to roots of trees in T
0
(Y,X,τ − 1) are called root
states of M
.WeuseJ
(M,M
) to denote the set of all such M
.
For any M
in J
(M,M
), states of M
are reachable from root states
of M
. In fact, for any state t of M
, in the case where t is a vertex of
some tree with root t
0
,itisevidentthatthereexistsβ ∈ Y
∗
such that
δ
(t
0
,β)=t. Suppose that t ∈
¯
S
τ
. From the definition of
¯
M
τ
,thereex-
ist a state ¯s
of
¯
M
and β
2
in Y
∗
such that |β
2
| = τ and
¯
δ
(¯s
,β
2
)=t.
From the definition of
¯
M
, there exist a state S, s
of
¯
M
and β
1
in Y
∗
such that ¯s
= δ
M
(S, β
1
),δ
(s
,β
1
).Thus¯s
=
¯
δ
(S, s
,β
1
). It follows that
¯
δ
(S, s
,β
1
β
2
)=t.Letβ
1
β
2
= β
3
β
4
with |β
3
| = τ ,and
¯
δ
(S, s
,β
3
)=¯s
0
.
Then ¯s
0
is a state of
¯
M
τ
,¯s
0
= δ
M
(S, β
3
), y
τ−1
,...,y
0
,and
¯
δ
(¯s
0
,β
4
)=t,
where β
3
= y
0
...y
τ−1
.Lett
0
be any root state of M
. From the construc-
tion of M
, noticing that β
3
∈ R
M
and β
3
is an input label sequence of trees
in T
(Y,X,τ − 1), we have δ
(t
0
,β
3
)=¯s
0
. This yields that δ
(t
0
,β
3
β
4
)=
δ
(δ
(t
0
,β
3
),β
4
)=δ
(¯s
0
,β
4
)=
¯
δ
(¯s
0
,β
4
)=t. We conclude that for any
state t of M
there exist a root state t
0
and β in Y
∗
such that δ
(t
0
,β)=t.
Let
˜
M = Y,X,
˜
S,
˜
δ,
˜
λ be a partial finite automaton such that
˜
λ(s, y)
is defined if and only if
˜
δ(s, y) is defined. Each state s
0
of
˜
M determines a
labelled tree with level τ − 1, denoted by T
˜
M
τ−1
(s
0
), which can be recurrently
constructed from
˜
M and s
0
as follows. We assign s
0
to the root of T
˜
M
τ−1
(s
0
)
temporarily. For any vertex with level <τ of T
˜
M
τ−1
(s
0
)andanyy in Y ,lets
be the label of the vertex. If
˜
δ(s, y)isdefined,thenanarcisemittedfromthe
vertex and y, called the input label, and
˜
λ(s, y), called the output label, are