1 Introduction
Machine translation is a subfield of natural language processing. Every machine translation system uses a translation model, which is a formal model that describes the translation process. Such systems can be hand-crafted (in rule-based translation systems) or trained with the help of statistical processes. Automatically trainable translation models are discussed in Brown et al. (Reference Brown, Cocke, Della Pietra, Della Pietra, Jelinek, Lafferty, Mercer and Roossin1990). The ibm models of Brown et al. (Reference Brown, Della Pietra, Della Pietra and Mercer1993) are string-based in the sense that they base the translation decision on the words and the surrounding context. In the field of syntax-based machine translation, the translation models have access to the syntax (in the form of parse trees) of the sentences. A good exposition to both fields is presented in Knight (Reference Knight2007).
In this paper, we focus on syntax-based translation models, and in particular, synchronous tree substitution grammars (stsg), or the (essentially) equally powerful (linear and nondeleting) extended top-down tree transducers of Graehl, Knight and May (Reference Graehl, Knight and May2008). A good introduction to stsg, which originate from the syntax-directed translation schemes of Aho and Ullman (Reference Aho and Ullman1972) [nowadays more commonly known as synchronous context-free grammars] is presented in Chiang and Knight (Reference Chiang, Knight, Calzolari, Cardie and Isabelle2006). Roughly speaking, an stsg has rules in which a nonterminal is replaced by two trees containing terminal and nonterminal symbols. In addition, the nonterminals in the two trees are linked and a rule is only applied to such linked nonterminals.
Several algorithms for stsg have been discussed in the literature. For example, we can
• train them (Graehl et al. Reference Graehl, Knight and May2008),
• attempt to binarize them using the methods of Zhang et al. (Reference Zhang, Huang, Gildea, Knight, Moore, Bilmes, Chu-Carroll and Sanderson2006) or Huang et al. (Reference Huang, Zhang, Gildea and Knight2009) or DeNero, Pauls and Klein (Reference DeNero, Bansal, Pauls, Klein, Ostendorf, Collins, Narayanan, Oard and Vanderwende2009), or
• parse them (DeNero et al. Reference DeNero, Pauls, Klein, Su, Su, Wiebe and Li2009).
However, some important algorithms are partial because it is known that the construction is not possible in general. This is the case, for example, for binarization and composition.
Alternative models have been explored in the literature. One such alternative is the multi bottom-up tree transducer (mbot) of Arnold and Dauchet (Reference Arnold and Dauchet1982), Lilin (Reference Lilin, Astesiano and Böhm1981), and Engelfriet, Lilin and Maletti (Reference Engelfriet, Lilin and Maletti2009), which essentially is the bottom-up analogue of stsg with the additional feature that nonterminals can have an arbitrary rank (the rank of a nonterminal of an stsg can be considered to be fixed to 1). This model is more expressive than stsg, but offers good computational properties. In this contribution, we will compare stsg and mbot with respect to some standard algorithms. Generally, mbot offer algorithmic benefits over stsg, which can be summarized as follows:
• Every stsg can be transformed into an equivalent mbot in linear time.
• mbot can be binarized in linear time whereas only partial binarizations (or asynchronous binarizations) are possible for stsg.
• The input language of an mbotM can be regularly restricted in
(|M|⋅|P|3), whereas the corresponding Bar-Hillel construction for an stsgM runs in time
(|M|⋅|P|2rk(M)+5) where rk(M) is the maximal number of nonterminals in a rule of the stsgM and P are the states of the restricting string automaton.• The output language of an mbotM can be regularly restricted in time
(|M|⋅|P|2rk(M)+2), whereas the corresponding Bar-Hillel construction for an stsgM runs in time
(|M|⋅|P|2rk(M)+5).
Overall, we thus conclude that, from an algorithmic perspective, it would be beneficial to work with mbot instead of stsg. However, the full power of mbot should not be tapped because, in general, mbot are not symmetric and have the finite-copying property (Engelfriet, Rozenberg and Slutzki Reference Engelfriet, Rozenberg and Slutzki1980), which complicates the algorithms for forward and backward application (see Section 6) and makes the forward application partial. An implementation and experimental verification of these advantages is in preparation.
2 Preliminaries
The set of nonnegative integers is ℕ, and we let [n] = {i ∈ ℕ | 1 ≤ i ≤ n} for every n ∈ ℕ. An alphabet is a finite set Σ of symbols. The set of all strings over Σ is Σ*, of which the empty string is ϵ. Concatenation of strings is denoted by juxtaposition. For each w ∈ Σ*, the length |w| of w is the number of occurrences of symbols in w. The ith letter in w with 1 ≤ i ≤ |w| is denoted by w i.
A commutative semiring (Hebisch and Weinert Reference Hebisch and Weinert1998; Golan Reference Golan1999) is an algebraic structure (A, +, ⋅, 0, 1) such that
• (A, +, 0) and (A, ⋅, 1) are commutative monoids, and
• the multiplication ⋅ distributes over finite sums (in particular, a ⋅ 0 = 0 = 0 ⋅ a for every a ∈ A).
Examples of commutative semirings are
• the real number semiring (ℝ, +, ⋅, 0, 1),
• the Boolean semiring ({0, 1}, max, min, 0, 1), and
• the tropical semiring (ℕ ∪ {∞}, min, +, ∞, 0).
In addition, every commutative field or ring is a commutative semiring.
In the rest of the paper, let (A, +, ⋅, 0, 1) be a commutative semiring. For every mapping f : S → A, we let supp(f) = {s ∈ S | f(s) ≠ 0} be the support of f. As usual, we write Σs ∈ Sf(s) for the sum of the elements f(s) for every s ∈ S provided that supp(f) is finite. We also write ∏s∈Sf(s) for the product of the elements f(s) for every s ∈ S provided that S is finite.
A weighted string automaton (wsa) (Schützenberger Reference Schützenberger1961; Eilenberg Reference Eilenberg1974) is a system N = (P, Γ, J, ν, G), where
• P and Γ are alphabets of states and input symbols, respectively,
• J, G: P → A assign initial and final weights, respectively, and
• ν : P × Γ × P → A assigns a weight to each transition.
Let w = γ1 ⋅⋅⋅ γk ∈ Γ* be an input string with γi ∈ Γ for every i ∈ [k]. Every mapping r: [k+1] → P is a run on w. The set of all runs on w is denoted by Run N(w), and we write r i instead of r(i) for every r ∈ Run N(w) and i ∈ [k+1]. The weight wt N(r) of the run r ∈ Run N(w) is ∏i = 1k ν(r i, γi, r i+1). Finally, the semantics of the wsaN assigns to w the weight
A good introduction to wsa can be found in Mohri (Reference Mohri, Droste, Kuich and Vogler2009) or Sakarovitch (Reference Sakarovitch, Droste, Kuich and Vogler2009).
A ranked alphabet Σ = ⋃k∈ℕ Σk is an alphabet whose symbols have assigned ranks. Contrary to some of the standard literature, we do not assume that each symbol of a ranked alphabet has only one fixed rank. For every k ∈ ℕ, the set Σk contains all symbols of rank k. For a given set T, we let Σ(T) = {σ(t 1,. . .,t k) | σ ∈ Σk, t 1,. . .,t k ∈ T). The set T Σ(V) of Σ-trees indexed by a set V is the smallest set T such that V ⊆ T and Σ(T) ⊆ T. For every t ∈ T Σ(V) and S ⊆ Σ ∪ V, let pos S(t) ⊆ ℕ* be the set of positions labeled by elements of S. Formally, for every v ∈ V, σ ∈ Σk, and t 1,. . .,t k ∈ T Σ(V)

Clearly, positions are lexicographically ordered. We denote this order simply by ≤. Moreover, let |t|S = |pos S(t| be the number of occurrences of symbols of S in t. If S = {s}, then we write pos s(t) and |t|s instead of pos S(t) and |t S, respectively. The positions pos(t) and the size |t| are pos Σ∪V(t) and |t|Σ∪V), respectively. Moreover, let var(t) = {v ∈ V | pos v(t) ≠ ∅}. A tree t ∈T Σ(V) is linear in V if |pos v(t)| ≤ 1 for every (v ∈ V.
Let S ⊆ Σ0 ∪ V. The S-yield yd S(t) of a tree t ∈ T Σ(V) is recursively defined as follows:

for every s ∈ Σ0 ∪ V, σ ∈ Σk with k > 1, and t 1,. . .,t k ∈ T Σ(V). If S = Σ0 ∪ V, then we simply write yd(t) instead of yd S(t).
Let ◻ be a distinguished symbol that has only the rank 0. Let Δ be the ranked alphabet such that Δ0 = Σ0 ∪ {◻} and Δk = Σk for every k ≥ 1. A Σ-context c indexed by V is a tree of T Δ(V) such that |c|◻ = 1. The set of all Σ-contexts indexed by V is C Σ(V). The tree c[t] is obtained from c by replacing the symbol ◻ by t. More generally, t[u]w denotes the result of replacing the subtree at position w ∈ pos(t) in t ∈ T Σ(V) by the tree u ∈ T Σ(V). In particular, c[t] = c[t]w where w is the unique element in pos ◻(c). Finally, any mapping θ: V′ → T Σ(V) with V′ ⊆ V is a substitution. The application tθ of the substitution θ to a tree t ∈ T Σ(V) is defined by

for every v ∈ V, σ ∈ Σk, and t 1,. . .,t k ∈ T Σ(V). We often use elements of the fixed set X = {x 1, x 2,. . .} of (formal) variables as substitution variables. If we write x i, then we implicitly assume that i ≥ 1. A tree t ∈ T Σ(X) is k-normed if yd X(t) = x 1 ⋅⋅⋅x k. Given t ∈ T Σ, we let
which is finite.
A weighted synchronous tree substitution grammar (stsg) (Chiang and Knight (Reference Chiang, Knight, Calzolari, Cardie and Isabelle2006) is a system M = (Q, Σ, Δ, I, R) where
• Q is an alphabet of nonterminals such that Q ∩ (Σ ∪ Δ) = ∅,
• Σ and Δ are ranked alphabets of input and output symbols, respectively,
• I : Q → A assigns initial weights, and
• R : T Σ(Q) × Q × T Δ(Q) → A are weighted rules such that supp(R) is finite and for every (t, q, u) ∈ supp(R)
— t and u are linear in Q,
— var(t) = var(u), and
— t ∉ Q or u ∉ Q.
In a rule (t, q, u) ∈ supp(R), the tree t is the left-hand side, q is the target state, and u is the right-hand side. The first two restrictions on rules ensure that exactly the same states occur in t and u. Moreover, no state is allowed to occur twice in the left- or right-hand side. Intuitively, the links between the states are implicit by the assumption that equal states in the left- and right-hand side are linked. A sample stsg rule is displayed in Figure 1, where the nonterminals are slanted, and we assume that the root terminal is also the nonterminal.
stsg rule and the same rule with binarized trees where @ is an arbitrary symbol that is introduced in the binarization process. We could (without harm) add another @-symbol to represent the children of S in a list.

The distinction between nonterminals and terminals is uncommon for stsg (Chiang Reference Chiang, Knight, Ng and Oflazer2005), but it increases the generative power. Our stsg are equivalent to the (nondeleting and linear) extended top-down tree transducers of Graehl et al. (Reference Graehl, Knight and May2008) and Maletti et al. (Reference Maletti, Graehl, Hopkins and Knight2009). The size |(t, q, u)| of a rule (t, q, u) ∈ supp(R) is |t| + |u|, and the size |M| of the stsg |M| is Σρ∈supp(R)|ρ|. The stsgM is a weighted synchronous context-free grammar (scfg) if t ∈ Σ(Q) and u ∈ Δ(Q) for every rule (t, q, u) ∈ supp(R). Finally, M is a weighted tree substitution grammar (tsg) if t = u for all rules (t, q, u) ∈ supp(R). A detailed exposition to stsg, scfg, and tsg can be found in Chiang (Reference Chiang, Knight, Ng and Oflazer2005), Berstel and Reutenauer (Reference Berstel and Reutenauer1982), or Fülöp and Vogler (Reference Fülöp, Vogler, Droste, Kuich and Vogler2009).
Let us proceed with the semantics of an stsgM = (Q, Σ, Δ, I, R). Equal nonterminals in t and u of a rule (t, q, u) ∈ supp(R) are linked. Those links need to be remembered in sentential forms. Given t ∈ T Σ(Q), u ∈ T Δ(Q), and ℓ : pos Q(t) → pos Q(u), the triple (t, ℓ, u) is a sentential form if
• ℓ is a bijection and
• ℓ(w) ∈ pos q(u) for every q ∈ Q and w ∈ pos q(t).
In other words, ℓ is a bijection that respects the nonterminals. Given two sentential forms ξ = (t 1, ℓ1, u 1) and (ζ = (t 2, ℓ2, u 2), we write
if there is a rule (t, q, u) ∈ supp(R) such that
• t 1 = t 1[q]w 1 and u 1 = u 1[q]w 2,
• t 2 = t 1[t]w 1 and u 2 = u 1[u]w 2,
• a = R(t, q, u), and
• ℓ2 = (ℓ1 ∖ {(w 1, w 2)}) ∪ {(w 1w′, w 2w″)|q ∈ Q, w′ ∈ pos q(t), w″ ∈ pos q(u)},
where w 1 = min(pos Q(t 1)) and w 2 = ℓ1(w 1). The selection of the minimal state-labeled position in t 1 ensures that we obtain a left-most derivation with respect to the input side. A sequence D = (ξ,. . .,ξk) of sentential forms is a derivation if there exist a 1,. . .,a k ∈ A such that
for every i ∈ [k]). Note that if such weights a 1,. . .,a k exist, then they are unique. Consequently, we define the weight wt M(D) of the derivation D to be
. Moreover, for every q ∈ Q and sentential form ζ = (t, ℓ, u) we let
Note that the set D Mq(ζ) is finite because each derivation step creates an input or an output symbol by the final condition on rules in the definition of stsg. The q-weight M q(ζ) assigned by the stsgM to ζ is
and
for every t ∈ T Σ and u ∈ T Δ.
For a tsgM = (Q, Σ, Σ, F, R), we will simply write R(q → t) instead of R(t, q, t) for every q ∈ Q and t ∈ T_ Σ(Q). Moreover, we write M q(t) and (M(t) instead of M q(t, ∅, t) and M(t, t) for every q ∈ Q and t ∈ T Σ. Finally, we drop the linearity requirement for tsg; i.e., t need not be linear in Q for a rule (q → t) ∈ supp(R). A mapping ϕ : T Σ → A is recognizable (Fülöp and Vogler Reference Fülöp, Vogler, Droste, Kuich and Vogler2009) if there exists a tsgN such that ϕ = N. The following proposition is well-known (Alexandrakis and Bozapalidis Reference Alexandrakis and Bozapalidis1987).
Proposition 1
For every tsg there exists an equivalent tsg that is also a scfg.
While the derivation semantics of an stsgM = (Q, Σ, Δ, I, R) is very instructive, it is difficult to handle in formal proofs. We observe the following equality:

for every q ∈ Q, t ∈ T Σ, and u ∈ T Δ. Note that we will write M q(t, ∅, u) instead of M q(t, u) if t ∈ T Σ. This equality can also be used as a recursive definition of M q(t, u) because the recursive calls M p(pθ, pθ′) are made to smaller trees (i.e., |pθ| ≤ |t| and |pθ′| ≤ |u| and one of these inequalities is strict) since t′ ∉ Q or u′ ∉ Q. Let us prove this equality. Note that we essentially separate the first derivation step, which is typical for top-down devices.
3 Multi bottom-up tree transducers
We already mentioned in the Introduction that we want to compare stsg to another model that we propose as an alternative. The alternative is the weighted (linear and nondeleting) multi bottom-up tree transducer, which has been introduced by Arnold and Dauchet (Reference Arnold and Dauchet1982) and Lilin (Reference Lilin, Astesiano and Böhm1981). A more detailed (and English) presentation is Engelfriet et al. (Reference Engelfriet, Lilin and Maletti2009). Let us quickly recall the formal definition, which we extend with weights. Recall that X = {x 1, x 2, . . .}.
Definition 2
A weighted multi bottom-up tree transducer (mbot) is a system (Q, Σ, Δ, F, R) where
• Q, Σ, and Δ are ranked alphabets of states, input symbols, and output symbols, respectively,
• F : Q 1 → A assigns final weights to unary states Q 1, and
• R : T Σ(Q(X)) × Q(T Δ(X)) → A are weighted rules such that supp(R) is finite and for every (l, r) ∈ supp(R)
— l and r are linear in X,
— var(l) = var(r), and
— l ∉ Q(X) or r ∉ Q(X).
The components l and r of a rule (l, r) ∈ supp(R) are called left- and right-hand side, respectively. Although we will not use a linking structure for mbot, the links can be imagined between equal variables of X (not between the symbols of Q) in the left- and right-hand side of a rule. Figure 2 displays example rules of an mbot. Roughly speaking, an mbot is a weighted (linear and nondeleting) extended bottom-up tree transducer (Engelfriet, Fülöp and Vogler Reference Engelfriet, Fülöp and Vogler2002; Engelfriet, Lilin and Maletti Reference Engelfriet, Lilin and Maletti2009), in which the states of Q can have ranks different from 1. To keep the presentation simple, we assume that final states have rank 1 (hence the final weight assignment F is of type F : Q 1 → A). The size |(l, r)| of a rule (l, r) ∈ supp(R) is |l| + |r|, and the size |M| of the mbotM is Σρ∈supp(R) |ρ|.
mbot rule (states are slanted) and the same rule with binarized trees where @ is an arbitrary symbol that is introduced in the binarization process.

The final condition on the rules in Definition 2 ensures that derivations are finite because each step will consume an input symbol or generate an output symbol. We continue with the rewrite semantics for the mbotM = (Q, Σ, Δ, F, R). Again, we define left-most derivations only.
Definition 3
Let c ∈ C Σ(Q(T Δ)) and θ : X → T Δ such that w < w′ for every w ∈ pos ◻(c) and w′ ∈ pos Q(c). Then
if R(l, r) = a). A sequence D = (ξ0,. . .,ξk) of ξi ∈ T Σ(Q(T Δ)) is a derivation if there are a 1,. . .,a k ∈ A such that
. Note that such weights a 1,. . .,a k are unique. The weight wt M(D) of the derivation D is
. Moreover, for every ξ, ζ ∈ T Σ(Q(T Δ)), we let
Note that the set D M(ξ, ζ) is finite. For every t ∈ T Σ, and r′ ∈ Q(T Δ), let
. The weight M(t, u) assigned by the mbotM is M(t, u) = Σq∈Q 1F(q)⋅M(t, q(u)) for every t ∈ T Σ and u ∈ T Δ.
Note that the condition on the context c in Definition 3 ensures that the derivation is left-most. The rules of Figure 3 are applied in a derivation in Figure 4. The first displayed derivation step uses the context S(NP(t 1), ◻) and any substitution θ such that θ(x 2) = t 2 and θ(x 3) = t 3.
Sample mbot rules in one-symbol normal form (see Definition 5; in essence each rule contains exactly one input or output symbol). The states of Q are slanted.

Derivation using the mbot rules of Figure 3.

Again, the derivation semantics is very instructive, but difficult to handle in proofs. To overcome this problem, we observe the following equality:

for every t ∈ T Σ and ξ ∈ Q(T Δ). Again, this equation also yields a recursive definition of M(t, ξ) because the recursive calls are made to smaller input or output trees.
Again, let us prove this equality, so that we have a solid base for the following proofs. For every t ∈ T Σ and ξ ∈ Q(T Δ),
This proof is similar to the corresponding proof for stsg, but here we separated the last derivation step, which is common for bottom-up devices.
It is argued by Chiang (Reference Chiang, Knight, Ng and Oflazer2005), Knight (Reference Knight2007), and Graehl et al. (Reference Graehl, Knight and May2008) that stsg (and extended top-down tree transducers) have sufficient power for syntax-based machine translation. mbot should be at least as powerful as stsg, we first demonstrate how each stsg can be encoded as an mbot.
Theorem 4
For every stsgM, we can construct an equivalent mbot in time
(|M|).
Proof
Let M = Q, Σ, Δ, I, R) be an stsg. Then we construct the mbotM′ = (Q′, Σ, Δ, I, R′) with Q′1 = Q and Q′k = ∅ for every k ≠ 1 and for every (t, q, u) ∈ supp(R) we let R′(l, r) = R(t, q, u) where
• var(t) = {q 1,. . .,q k},
•
and
with
and
for every i ∈ [k], and• l = tθq 1. . .q k and r = q(uθ′q 1. . .q k).
Clearly, M′ can be constructed in time
(|M|). To prove the correctness of the construction, we have to prove the statement M q(t′, u′) = M′(t′, q(u′)) for every q ∈ Q, t′ ∈ T Σ, and u′ ∈ T Δ.
With this auxiliary statement, the main statement is now easy to prove for every t ∈ T Σ and u ∈ T Δ.
□ stsg rules and their corresponding mbot rules according to the construction in the proof of Theorem 4 are displayed in Figures 1 and 2.
4 Binarization
Binarization is an important tool for efficiency reasons in nondeterministic devices. This is based on the simple and powerful observation (Wang, Knight and Marcu Reference Wang, Knight, Marcu and Eisner2007) that instead of making 5 choices from a space of n in one instant (represented by n 5 rules), we can sometimes make them one-by-one (represented by only 5n rules). The best-known example of this approach is the binarization of context-free grammars [see Chomsky normal form in Hopcroft and Ullman (Reference Hopcroft and Ullman1979)]. An stsgM = (Q, Σ, Δ, I, R) is binarized if |t|Q ≤ 2 for every (t, q, u) ∈ supp(R). The benefits of binarized stsg are presented in Zhang et al. (Reference Zhang, Huang, Gildea, Knight, Moore, Bilmes, Chu-Carroll and Sanderson2006) and Wang et al. (Reference Wang, Knight, Marcu and Eisner2007), which in addition, also present linear-time algorithms for the binarization of binarizable stsg. It should be mentioned that those algorithms are presented for tree-to-string devices (in which the right-hand side of an stsg rule is a string; for example, the yield of our right-hand sides), but they can easily be generalized to our tree-to-tree devices. However, not all (tree-to-tree or tree-to-string) stsg are binarizable. More precisely, binarizable (tree-to-tree) stsg cannot even handle simple rotations, which severely limits their expressive power.
Binarization consists of two steps: (i) binarization of the involved trees (using the auxiliary symbol @; see Figure 1) and (ii) binarization of the derivations of the processing device (e.g., tree automata, tree transducers, stsg, or mbot). Let us formalize binarization of trees next. Let t ∈ T Σ(V) and @ ∉ Σ ∪ V be a new binary symbol. Then bin(t) is recursively defined as follows:

for every v ∈ V, σ ∈ Σk, and t 1,. . .,t k ∈ T Σ(V). In fact, there are several ways to binarize trees, but to keep the presentation simple, we will always assume the presented form.
We show that the benefits of binarization can be reaped for all weighted tree transformations computable by stsg. We have already demonstrated that every stsg can be transformed into an equivalent mbot in linear time. Next, we show that mbot can be efficiently binarized. The mbotM = (Q, Σ, Δ, F, R) is (input) binarized if |l|Q ≤ 2 for every (l, r) ∈ supp(R).
Definition 5
The mbotM = (Q, Σ, Δ, F, R) is in one-symbol normal form if |l|Σ + |r|Δ = 1 for every (l, r) ∈ supp(R).
Figure 3 presents some mbot rules in one-symbol normal form. Given an input ranked alphabet Σ such that Σk = ∅ for every k ≥ 3 (i.e., there are at most binary input symbols), every mbotM in one-symbol normal form is (input) binarized. Every unweighted mbot can be transformed into one-symbol normal form in linear time (Raoult Reference Raoult and Kirchner1993; Engelfriet et al. Reference Engelfriet, Lilin and Maletti2009) in the size of the mbot. This procedure can easily be extended to the weighted case, which we show in the next theorem.
Theorem 6
For every mbotM an equivalent mbot in one-symbol normal form can be constructed in time
|M|).
Proof
Let M = (Q, Σ, Δ, F, R). The proof will have two stages. First, we ensure that |l|Σ ≤ 1 for every rule (l, r) ∈ supp(R). The same construction for the output side can then be used to also ensure that |r|Δ ≤ 1 for every (l, r) ∈ supp(R). Since they are essentially the same constructions, we will only cover the former (the input side). We decompose rules (l, r) ∈ supp(R) with more than one input symbol in the left-hand side l into several rules using essentially the construction in Lemma 14 and Theorem 15 of Engelfriet et al. (Reference Engelfriet, Lilin and Maletti2009), which in turn is (a variation of) the construction in Proposition II.B.5 of Lilin (Reference Lilin1978).
Let (l, r) ∈ supp(R) with |l|Σ ≥ 2. Then l = σ(l 1,. . .,1 k) for some σ ∈ Σk and l 1,. . .,l k ∈ T Σ(Q(X)). For every i ∈ [k], let var(l i) = {x i1,. . .,x in i} and q i ∉ Q be a new state of rank n i. Moreover, let

We construct the mbotM′ = (Q′, Σ, Δ, F′, R′) such that
• Q′ = Q ∪ {q 1,. .nbsp;.,q k},
• F′(q) = F(q) for every q ∈Q 1 and F′(q i) = 0 for every i ∈ [k] with n i = 1,
• for every (l′, r′) ∈ supp(R)

• R′(l i, l′i) = 1 for every i ∈ [k] such that l i ∉ Q(X), and
• R′(σ(l′1,. . .,l′k), r) = R(l, r).
It is straightforward to prove that M′ and M are equivalent. This can easily be proved using the derivation semantics because every derivation that uses the rule (l, r) of M can be simulated by several rules of M′. Moreover, since the states q 1,. . .,q k do not have any other rules any derivation in M′ will simulate the effect of the rule (l, r). Let m = max{|l|Σ | (l, r) ∈ supp(R)}. Clearly, M′ will have one less rule with m input symbols than M. Hence, repeated application of the above construction eventually yields an equivalent mbotM″ = (Q″, Σ, Δ, F″, R″) such that |l|Σ ≤ 1 for every (l, r) ∈ supp(R″). Moreover, the process clearly terminates in time
(|M|). □
In Figures 1 and 2 we show rules and their corresponding rules in binarized form (i.e., with binarized trees in the rules). It is known (Aho and Ullman Reference Aho and Ullman1972) that, in general, stsg (or scfg or extended top-down tree transducers) cannot be binarized. In Figure 3 we illustrate the binarization construction in the proof of Theorem 6 on the rule of Figure 2. How the decomposed rules combine into the original rule is demonstrated in Figure 4, which also shows two example derivation steps. In the next section, we show one benefit of the binarization on the Bar-Hillel construction.
Corollary 7 (of Theorem 6)
For every stsgM an equivalent, binarized mbot can be constructed in
(|M|).
Finally, let us shortly discuss why we call ‘binarized’ also ‘input binarized’. In a binarized mbot each rule concerns at most two input subtrees. Note that the variables of X in rules represent output trees. Consequently, we can call the mbotM = (Q, Σ, Δ, F, R) output binarized if |r|X ≤ 2 for all (l, r) ∈ supp(R). We already mentioned that stsg cannot be binarized and these problems translate into output binarization. More specifically, binarizable stsg (Zhang et al. Reference Zhang, Huang, Gildea, Knight, Moore, Bilmes, Chu-Carroll and Sanderson2006; Wang et al. Reference Wang, Knight, Marcu and Eisner2007) can be transformed into output-binarized mbot, but in general, mbot cannot be output-binarized.
5 Input and output restriction
A standard operation for tree transformations (and tree languages alike) is regular restriction. For transformations this operation can be applied to the input or output side. These constructions are used in parsing, integration of a language model, and the computation of certain metrics [see Nederhof and Satta (Reference Nederhof and Satta2003), Nederhof and Satta (Reference Nederhof and Satta2008), or Satta (Reference Satta2010) for a detailed account]. In addition, together with domain and range constructions (see Section 6), they can be used to prove preservation of recognizability. The construction is generally known as Bar-Hillel construction [see Bar-Hillel, Perles and Shamir (Reference Bar-Hillel, Perles, Shamir and Bar-Hillel1964) for the original construction on context-free grammars] if the restricting language is presented by a wsa.
Since stsg are symmetric, only one construction is needed for them. Let us formally define the input product. Given an stsgM = (Q, Σ, Δ, I, R) and a wsaN with states P, the input product is an stsgM′ such that
for every t ∈ T Σ and u ∈ T Δ. The construction of M′ is called Bar-Hillel construction for M and N. The rank of an stsg rule (t, q, u) ∈ supp(R) is rk(t, q, u) = |t|Q. The maximal rank rk(M) = maxρ∈supp(R)rk(ρ) of a rule of M enters as an exponent into the time complexity
(|M|⋅|P|2rk(M)+5) of the Bar-Hillel construction (Maletti and Satta Reference Maletti, Satta, Drewes and Kuhlmann2010). Since binarization is not possible in general, the maximal rank rk(M) cannot be limited to 2. In contrast, binarization is possible for mbot with only linear overhead, so we investigate whether we can exploit this advantage in a Bar-Hillel construction for mbot.
We start with a classical product construction for the input side. Given an mbotM = (Q, Σ, Δ, F, R) in one-symbol normal form such that the symbols in Σ ∪ Δ have rank at most 2 and a tsgN = (P, Σ, Σ, I, R′) that is also a scfg (see Proposition 1), we want to construct an mbotM′ such that M′(t, u) = M(t, u)⋅N(t) for every t ∈ T Σ and u ∈ T Δ. In other words, each input tree should be rescored according to N; in the unweighted case this yields that the translation of M is filtered to the set of input trees accepted by N.
We occasionally use the angled parentheses ‘〈’ and ‘〉’ instead of the standard parentheses.
Definition 8
The input product Prod(N, M) is the mbot
such that
• F″(〈p, q〉) = I(p)⋅F(q) for every p ∈ P and q ∈ Q 1,
• for every rule (l, r) ∈ supp(R) with l = q(xi 1,. . .,x i k) and r = q′(r 1,. . .,r n) where q ∈ Q k, q′ ∈ Q n, and r 1,. . .,r n ∈ T Δ(X), and for every p ∈ P, let

• for every (l, r) ∈ supp(R) with
and r = q(x j 1,. . .,x j n) where σ ∈ Σk, q, q 1,. . .,q k ∈ Q, and for every p, p 1,. . .,p k ∈ P, let
—
,—
, and—
.
The first type of rule constructed in the second item does not involve an input symbol. Thus, the nonterminal p of N is just forwarded to the new state in the right-hand side. Since no step with respect to the tsgN is made, the weight is taken from the rule of M. The second type of rule constructed in the third item uses a rule of R with the input symbol Σ and a rule of R′ that also contains Σ. Both rules are executed in parallel in the resulting rule and its weight is the product of the weights of the original rules. Overall, this is a classical product construction, which is similar to other product constructions such as Borchardt (Reference Borchardt2004).
Theorem 9
For every stsgM = (Q, Σ, Δ, F, R) in one-symbol normal form and tsgN = (P, Σ, Σ, I, R′) that is also an scfg, we have
for every t ∈ T Σ and u ∈ T Δ.
Proof
Let M″ = Prod(N, M) = (P × Q, Σ, Δ, F″, R″). We first prove that
for every p ∈ P, q ∈ Q n, t ∈ T Σ, and u 1,. . .,u n ∈ T Δ. Let ξ = 〈p, q〉(u 1,. . .,u n) and t = σ(t 1,. . .,t k) for some σ ∈ Σk and t 1,. . .,t k ∈ T Σ.
Now we can complete the proof as follows. For every t ∈ T Σ and u ∈ T Δ

□
Finally, let us discuss the time complexity. The mbotProd(N, M) can be obtained in time
(|M|⋅|N|). Furthermore, it is known [see, for example, Maletti and Satta (Reference Maletti, Satta, de la Clergerie, Bunt and Danlos2009)] that for every wsaN with states P, we can construct a tsgN′ that is also a scfg, which has size
(|Σ|⋅|P|3), such that N′(t) = N(yd(t)) for every t ∈ T Σ. The main idea of this well-known construction is illustrated in Figure 5.
Constructing a tsg from a wsa.
Corollary 10 (of Theorem 9)
For every mbotM = (Q, Σ, Δ, F, R) and every wsaN = (P, Γ, I, ν, G), an mbotM′ can be constructed in time
(|M|⋅|P|3) such that M′(t, u) = M(t, u)⋅N(yd(t)) for every t ∈ T Σ and u ∈ T Δ.
Thus, our Bar-Hillel construction has the well-known (parsing) complexity
(|M|⋅|P|3). Compared to the time complexity
(|M|⋅[|P|2rk(M)+5) of the Bar-Hillel construction for an stsgM, a huge efficiency gain is achieved by binarization (and one-symbol normal form). In fact, if the original stsgM is binarizable (i.e., rk(M) = 2), then the Bar-Hillel construction can still run in time
(|M|⋅|P|6+3), which is due to the fact that several symbols can occur in each rule. This can be explained on the left illustration of Figure 5. If several symbols are present in the tree represented by a triangle in the illustration, then the arrows need no longer indicate identity. Consequently, all indicated state positions could hold different states, which yields the factor
(|P|6). Since we also have to run the wsaN on several symbols, we obtain a processing factor
(|P|3). The latter factor is a pure processing factor, so the size of the output stsg would be bound by
(|M|⋅|P|6). Only if a normal form analogous to one-symbol normal form can be achieved for M, then the complexity reduces to
(|M|⋅|P|3). Consequently, the stsgM should be transformed into an equivalent mbot in one-symbol normal form, which can be achieved in linear time (see Corollary 7, and the Bar-Hillel construction should be performed on this mbot.
Since mbot are not symmetric, a special construction is needed for the output side. We will see that we cannot obtain a similar efficiency improvement in this case. To simplify the presentation, we assume without loss of generality that the variables occur in order in l (i.e., l is k-normed) for every rule (l, r) ∈ supp(R).
Definition 11
The output product Prod(M, N) is the mbot
where
• F″(q〈p〉) = I(p)⋅F(q) for every p ∈ P and q ∈ Q 1,
• for every rule (l, r) ∈ supp(R) with l = q(x j 1,.–.–.,x j k) and
where q ∈ Q k, q′ ∈ Q n and δ ∈ Δm−j, and for every p, p 1,. . .p k ∈ P, let
—
,—
,—
, and—
,
• for all (l, r) ∈ supp(R) with l =
and
where
, and
, let
—
,—
,—
, and—
.
Since the first type of rule constructed in the second item involves an output symbol, we perform steps with respect to M and N. The second type of rule does not contain an output symbol, and thus, the nonterminals of N are just forwarded to the right-hand side.
Theorem 12
For every mbotM = (Q, Σ, Δ, F, R) in one-symbol normal form and tsgN = (P, Δ, Δ, I, R′) that is also an scfg, we have
for every t ∈ T_ Σ and u ∈ T Δ.
Proof
The proof is similar to the proof of Theorem 9. □
The Bar-Hillel construction for the output side of an mbotM with a wsaN with states P can be obtained in time
(|M|⋅|P|2rk(M)+2) where rk(M) is the maximal number of variables of X in a rule of M. Compared to the time complexity
(|M|⋅|P|2rk(M)+5) of the Bar-Hillel construction for an stsgM, the efficiency gain is minimal and only due to the fact that at most one output symbol needs to be processed in the Bar-Hillel construction for mbot (because the mbot can be assumed to be in one-symbol normal form). A similar normal form cannot, in general, be obtained for stsg, and thus, an additional evaluation effort
(|P|3) occurs, which represents the time complexity of running the wsaN on the output symbols present in a rule. It was already mentioned that if the stsgM is binarizable, then we can obtain an equivalent output-binarized mbot. In this case, the problem is symmetric and the results for the input product apply also for the output product.
6 Forward and backward application
Finally, we want to apply a weighted tree transformation not just to a single input or output tree, but rather to a set of (potentially weighted) input or output trees. Let M be an mbot or an stsg. Forward application aims to compute a tsg of output trees under M given a tsg of input trees. Conversely, backward application aims to compute a tsg of input trees given a tsg of output trees. Formally, let N = (P, Σ, Σ, I, R′) and N′ = (P′, Δ, Δ, I′, R″) be tsg. Then the forward application M 〈N〉) and the backward application M −1 〈N′〉 are

for every t ∈ T Σ and u ∈ T Δ. Note that the sums in the above equations might be infinite. We will later address this issue by additional restrictions, which will ensure that the sums are finite.
In general, forward and backward application can be reduced to range and domain, respectively, with the help of the product constructions of the previous section. Formally, the range ran M and the domain dom M of the transformation computed by M are
for every t ∈ T Σ and u ∈ T Δ. Again, those sums might be infinite. Let M be an mbot. The relation between the two notions is

for every t ∈ T Σ and u ∈ T Δ where M′ = Prod(N, M) and M″ = Prod(M, N′). The same relation also holds for an stsgM.
Let us first discuss stsg. Let M = (Q, Σ, Δ, I, R) be an stsg. It is input ϵ-free (respectively, output ϵ-free) if t ∉ Q (respectively, u ∉ Q) for every (t, q, u) ∈ supp(R). It is known (Fülöp, Maletti and Vogler Reference Fülöp, Maletti, Vogler, Drewes and Kuhlmann2010) that the forward application M〈N〉 (respectively, the backward application M −1〈N′〉) can be represented by a tsg if M is output ϵ-free (respectively, input ϵ-free). In other words, stsg preserve recognizability under forward and backward application in all reasonable cases.
Unfortunately, the range of an mbot is not necessarily representable by a tsg, which is not due to well-definedness problems (infinite sums) but rather the finite-copying property (Engelfriet et al. Reference Engelfriet, Rozenberg and Slutzki1980) of mbot. Because of this copying property the range might not be recognizable. Consequently, forward application suffers from the same problem, which yields that mbot do not preserve recognizability under forward application. In analogy to the definition for stsg, let the mbotM = (Q, Σ, Δ, F, R) be input ϵ-free} if l ∉ Q(X) for every (l, r) ∈ supp(R). For such mbot we will now discuss the domain (and backward application).
Definition 13
Let M = (Q, Σ, Δ, F, R) be an input ϵ-free mbot such that Q i ∩ Q j = ∅ for all i ≠ j. In other words, we assume without loss of generality that each state has a unique rank. We construct the tsgN = (Q, Σ, Σ, I, R′) such that
• I(q) = F(q) for every q ∈ Q 1 and I(q) = 0 for all q ∈ Q ∖ Q 1,
• for every t ∈ T Σ(Q)
where cut(l) ∈ T Σ(Q) is tree obtained from l ∈ T Σ(Q(X)) by deleting the nodes labeled by an element of X.
Theorem 14
Let M be an input ϵ-free mbot and N be the tsg as in Definition 13. Then dom M = N.
Proof
We need to prove that
for every q ∈ Q k and t ∈ T Σ.
Then

for every t ∈ T Σ, which proves the statement. □
Consequently, every input ϵ-free mbot preserves recognizability under backward application, which is essentially the same statement as for stsg. However, the situation is entirely different for forward application. stsg preserve recognizability under forward application, but mbot do not necessarily.
Conclusion
We have shown that mbot have significant advantages over stsg since each stsg can be transformed into an equivalent mbot in linear time and the obtained mbot can be binarized and transformed into one-symbol normal form (also in linear time). The input and output product algorithms for mbot have a better asymptotic runtime complexity than their counterparts for stsg. This is illustrated in the following table:
where |M| is the size of the tree transformation device (stsg or mbot) and |P| is the number of states of the restricting wsa. We add that the output product for an mbot corresponding to a binarizable stsg can be constructed in time
(|M|⋅|P|6). An implementation of mbot and the experimental verification of these theoretical advantages remains future work.
In the final section, we showed that the additional power of mbot should be used carefully. The range of an mbot is, in general, not recognizable, which yields that forward application does not preserve recognizability. This is due to the finite-copying feature that mbot can employ. This feature is not present in mbot that have been obtained from stsg (i.e., that are equivalent to an stsg).
Acknowledgments
The author would like to thank the reviewers for their insightful comments, which improved the presentation of the article. In addition, the author gratefully acknowledges the financial support by the Ministerio de Educación y Ciencia (MEC) grants JDCI-2007-760 and MTM-2007-63422.





