Crisp-determinization of weighted tree automata over strong bimonoids

We consider weighted tree automata (wta) over strong bimonoids and their initial algebra semantics and their run semantics. There are wta for which these semantics are different; however, for bottom-up deterministic wta and for wta over semirings, the difference vanishes. A wta is crisp-deterministic if it is bottom-up deterministic and each transition is weighted by one of the unit elements of the strong bimonoid. We prove that the class of weighted tree languages recognized by crisp-deterministic wta is the same as the class of recognizable step mappings. Moreover, we investigate the following two crisp-determinization problems: for a given wta A , (a) does there exist a crisp-deterministic wta which computes the initial algebra semantics of A and (b) does there exist a crisp-deterministic wta which computes the run semantics of A ? We show that the ﬁniteness of the Nerode algebra N ( A ) of A implies a positive answer for (a), and that the ﬁnite order property of A implies a positive answer for (b). We show a sufﬁcient condition which guarantees the ﬁniteness of N ( A ) and a sufﬁcient condition which guarantees the ﬁnite order property of A . Also, we provide an algorithm for the construction of the crisp-deterministic wta according to (a) if N ( A ) is ﬁnite, and similarly for (b) if A has ﬁnite order property. We prove that it is undecidable whether an arbitrary wta A is crisp-determinizable. We also prove that both, the ﬁniteness of N ( A ) and the ﬁnite order property of A are undecidable.


Introduction
The determinization problem shows up if one wants to specify a problem (e.g., a formal language) in a nondeterministic way and to calculate its solution (e.g., membership) in a deterministic way. More precisely, the determinization problem asks the following: for a given nondeterministic device A of a given type (or class) T , does there exist a deterministic device B of the same type which is semantically equivalent to A?
It is well known that the determinization problem is solved positively if T is the class of all finite-state (string) automata (cf., e.g., [HU79, Thm. 2.1]), i.e., for each nondeterministic finite-state automaton A there is an equivalent deterministic finite-state automaton B. The construction of B from A is called powerset construction. The same holds true for the class T of all finite-state tree automata [TW68,Thm. 1].
The situation changes drastically if one considers the class T of all weighted string automata (wsa), i.e., finite-state string automata in which each transition is weighted by some element of a semiring [Sch61] (cf. [Eil74,Ch. VI.6] and [SS78,KS86,Sak09,DKV09]). More precisely, there exists a wsa such that there is no equivalent deterministic wsa (see, e.g., [BV03,Lm. 6.3] for a weighted tree automaton over a monadic alphabet with this property) (i) On the other side, there are subclasses of T for which the determinization problem can be solved positively: the subclass of all wsa over locally finite semirings [KM05,p. 293], the subclass of all trim unambiguous wsa over the tropical semiring having the twins property [Moh97,Thm. 12], and the subclass of all wsa over min-semirings having the twins property [KM05,Thm. 5]. The same situation is present if T is the class of all weighted tree automata [BR82,AB87,Kui98,ÉK03], and subclasses for the positive solution of the determinization problem were identified in [BV03,Cor. 4.9 and Thm. 4.24], [FV09,Thm. 3.17], and [BMV10,Thm. 5.2]. In [AM03,BCPS03] results for deciding the twins property of wsa have been shown; we refer to [BF12] for results on deciding the twins property of weighted tree automata.
A special case of determinization of wsa over strong bimonoids is when we require that the resulting deterministic wsa is crisp-deterministic, i.e., each of its transitions is weighted by the additive zero or the multiplicative unit element of the strong bimonoid; that is, arbitrary weights can show up only at the final states.
Crisp-deterministic wsa are worth investigating because the class of weighted languages recognized by them is exactly the class of recognizable step mappings [DSV10,Lm. 8]. A recognizable step mapping is the sum of finitely many weighted languages, each of which is constant over a recognizable language (called step language) and zero over the complement of that language. Therefore, it is easy to give a recognizable step mapping effectively by the direct product of the finite automata for the step languages and a simple weight mapping over the set of states of the direct product automaton. We mention that recognizable step mappings play an important role in the characterization of recognizable weighted languages by weighted MSO-logic [DG05,DG07,DG09]. In fact, the semantics of the weighted MSO-formula ∀x.ϕ is a recognizable weighted language if the semantics of ϕ is a recognizable step mapping [DG09,Lm. 5.4]; moreover, there is a weighted MSO-formula ϕ of which the semantics is a recognizable weighted language and the semantics ∀x.ϕ is not recognizable [DG09,Ex. 3.6]. The same holds for weighted MSO-logic on trees [DV06].
For the class T of all wsa over strong bimonoids, the crisp-determinization problem asks the following: For a given wsa A, (a) does there exist a crisp-deterministic wsa B which computes the initial algebra semantics of A and (b) does there exist a crisp-deterministic wsa B which computes the run semantics of A? In [DSV10,CDIV10] subclasses of T were identified for which the crisp-determinization problem is solved positively. However, in [DSV10,CDIV10] no decidability results on the membership problem of (i) Weighted tree automata over monadic alphabets and wsa are equivalent, cf., [FV09,p. 324]. that subclass is given.
In this paper we consider the class T of all weighted tree automata (wta) over strong bimonoids. We will follow the lines of [CDIV10] and identify subclasses of T for which the crisp-determinization problem is solvable, i.e., for every wta A of that subclass, there exists a crisp-deterministic wta B such that A and B are i-equivalent, i.e., A and B have the same initial algebra semantics, and B can be constructed effectively. Also we deal with the modified problem in which initial algebra semantics and i-equivalence are replaced by run semantics and r-equivalence, respectively. In fact, we generalize the corresponding results of the papers [CDIV10] to the tree case.
Moreover, we deal with decidability problems concerning crisp-determinization of wta. We show that it is undecidable whether, for an arbitrary given wta, there is an i-equivalent crisp-deterministic wta. Moreover, we show the undecidability of two properties of wta which are relevant for crisp-determinization. These are as follows. To each wta A we can associate an algebra V(A) such that if the image im(h V(A) ) of the unique homomorphism h V(A) from the term algebra to V(A) is finite, then a crisp-deterministic wta can be constructed which is i-equivalent to A. For wsa over fields it is shown to be decidable whether this image is finite [BR88,Sec. IV. 2]. Moreover, in [Sei94] it was shown that for each wta A over the tropical or the arctic semiring it is decidable if A is bounded. Since these semirings are idempotent, the fact that A is bounded, implies that im(h V(A) ) is finite. In this paper we show that for arbitrary wta A it is undecidable whether im(h V(A) ) is finite. By restricting this result to the case of monadic input trees (i.e., strings), we have solved partially the open problem stated in [CDIV10,Sect. 12]. It would be interesting to find strong bimonoids such that it is decidable whether, for arbitrary wta A over such bimonoids, (i) A is crisp-determinizable or (ii) im(h V(A) ) is finite. Finite order property of a wta A is also important for crisp-determinization because if A has this property, then a crisp-deterministic wta can be constructed which is r-equivalent to A. We also show that for arbitrary wta A it is undecidable whether A has the finite order property.
Our paper is organized as follows. In Section 2 we recall the necessary definitions and concepts. We have tried to make the paper self-contained. In Section 3 we recall the concept of wta over strong bimonoid with its initial algebra semantics and its run semantics. We give a complete proof for the result in the folklore that • for bottom-up deterministic wta the two kinds of semantics coincide (Theorem 3.6). In Section 4 we introduce the auxiliary concept of algebras with root weights and define two basic constructions with them. These algebras may be infinite and the semantics of each algebra with root weights is a weighted tree language.
In Section 5 we show that crisp-deterministic wta and finite algebras with root weights are essentially the same concepts. Moreover, • we prove a characterization of the class of weighted tree languages which are recognized by crispdeterministic wta in terms of finite algebras with root weights, as well as in terms of recognizable step mappings (Theorem 5.3). In Section 6 we consider the problem whether, given a wta A, a crisp-deterministic wta can be constructed such that it is i-equivalent to A. For each wta A, we introduce the algebra N (A) with root weights, which we call the Nerode algebra of A. We show that A and N (A) are semantically equivalent. As a consequence, • we obtain that if N (A) is finite, then A and the crisp-deterministic wta rel(N (A)) derived from N (A) are i-equivalent (Theorem 6.3), • we characterize the case that N (A) is finite (Theorem 6.5), • we give an isomorphic representation of N (A) (Theorem 6.7), and • we show that if N (A) is finite, then rel(N (A)) is minimal among all crisp-deterministic wta which satisfy a certain condition concerning the initial algebra semantics of A (Theorem 6.9). (However, the last result does not mean that rel(N (A)) is minimal among all crisp-deterministic wta which are i-equivalent to A.) Moreover, • we give sufficient conditions which guarantee that N (A) is finite (Corollary 6.10), and • we design an algorithm of which the input is an arbitrary wta A, and which terminates if N (A) is finite and delivers the crisp-deterministic wta rel(N (A)) (Algorithm 1). In particular, the algorithm terminates if the above mentioned sufficient conditions hold.
In Section 7 we consider the problem whether, given a wta A, a crisp-deterministic wta can be constructed such that it is r-equivalent to A. We introduce the concept of finite order property for a wta A. Then • we prove that if A has the finite order property, then a crisp-deterministic wta can be constructed which is r-equivalent to A (Theorem 7.3), • we give sufficient conditions which guarantee that A has the finite order property (Corollary 7.5), and • we give an algorithm of which the input is an arbitrary wta A which has the finite order property, and which delivers the crisp-deterministic wta R(A) which is r-equivalent to A (Algorithm 3 ). In Section 8 we prove that it is undecidable whether • an arbitrary bottom-up deterministic wta is crisp-determinizable (Theorem 8.5), • for an arbitrary bottom-up deterministic wta, its Nerode algebra is finite (Theorem 8.7), and • an arbitrary bottom-up deterministic wta has the finite order property (Theorem 8.9).

Basic concepts
for each a ∈ A ′ . We denote the set of all mappings f : A → B by B A . For two mappings f : A → B and g : B → C, the composition of f and g is denoted by g • f and is defined by (g • f )(a) = g(f (a)) for each a ∈ A.
Let A be a set. Then |A| denotes the cardinality of A and P(A) its set of subsets. For each k ∈ N, a mapping f : A k → A is also called a k-ary operation on A. The set of all k-ary operations on A is denoted by Ops (k) (A) and we define Ops An alphabet is a finite and nonempty set X of symbols. A string over X is a finite sequence x 1 . . . x n with n ∈ N and x i ∈ X for each i ∈ [n]. We denote by ε the empty sequence (where n = 0) and by X * the set of all strings (or words) over X.

Trees and tree languages
We assume that the reader is familiar with the fundamental concepts and results of the theory of tree automata and tree languages [Eng75, GS84, CDG + 07]. Here we only recall some basic definitions.
In the rest of this paper, Σ will denote an arbitrary ranked alphabet if not specified otherwise. In addition, we assume that Σ (0) = ∅.
Each subset L ⊆ T Σ is called a Σ-tree language (or just: tree language). A tree language L ⊆ T Σ is recognizable if there is a finite-state tree automaton over Σ which recognizes L.
Clearly, C e Σ ⊆ C Σ . For every c ∈ C Σ and ξ ∈ T Σ ∪ C Σ , we denote by c[ξ] the tree obtained from c by replacing the unique occurrence of by ξ. We note that c

Algebraic structures
We assume that the reader is familiar with the basic concepts and results of universal algebra [Grä68,BS81] as well as basic concepts of semigroups and strong bimonoids [DSV10,CDIV10]. However, here we recall those concepts which we will use in the paper without any reference.
Universal algebra. A Σ-algebra is a pair (A, θ) which consists of a nonempty set A and a Σ-indexed family θ = (θ(σ) | σ ∈ Σ) over Ops(A) such that θ(σ) : A k → A for every k ∈ N and σ ∈ Σ (k) . Then A is the carrier set and θ is the Σ-interpretation (or: interpretation of Σ), of that Σ-algebra. We call a Σ-algebra finite if its carrier set is finite. Next we show two examples of Σ-algebras.
We denote by X Σ ′ the smallest subset of A which contains X and is closed under , and a 1 , . . . , a k ∈ X Σ ′ . In particular, ( X Σ , θ ′ ) is a Σ-algebra, which we call the subalgebra of (A, θ) generated by X. The smallest subalgebra of (A, θ) is its subalgebra generated by ∅.
We say that (A, θ) is locally finite if for each finite subset X ⊆ A the set X Σ is finite.
If there is such an isomorphism, then we say that A 1 and A 2 isomorphic. We denote this fact by A 1 ∼ = A 2 .
For every c ∈ C Σ , we define the mapping c A : A → A by induction on c as follows.
(i) If c = ✷, then c A (a) = a for each a ∈ A.

Proof:
We prove by induction on c. For c = ✷ the proof is obvious.
Strong bimonoids. Now we recall a particular class of Σ-algebras: strong bimonoids [DSV10, CDIV10,Rad10]. This is specified by a particular Σ and particular algebraic laws which involve its operations.
Let (B, ⊕, ⊗, 0, 1) be a strong bimonoid. It is Let b ∈ B and n ∈ N. We abbreviate b ⊕ . . . ⊕ b, where b occurs n times, by nb. In particular, 0b = 0. We abbreviate b {⊕} = {nb | n ∈ N} by b . If b is finite, then we say that b has a finite order in (B, ⊕, 0). In this case there is a least number i ∈ N + such that ib = (i + k)b for some k ∈ N + , and b 2b there is a least number p ∈ N + such that ib = (i + p)b. We call i and p the index (of b) and the period (of b), respectively, and denote them by i(b) and p(b), respectively. Moreover, we call i + p − 1, i.e., the number of elements of b , the order of b. We illustrate the index and the period of b in Figure 1, where the directed arrow means addition of b.
We extend ⊕ to every finite set I and family (a i | i ∈ I) of elements of B. We denote the extended operation by and define it as follows: Since ⊕ is commutative, the sum above is well defined. Sometimes we abbreviate (a i | i ∈ I) by i∈I a i . If I = [k] for some k ∈ N, then we write k i=1 a i . Moreover, we extend ⊗ to every k ∈ N and family (a i | i ∈ [k]) of elements of B. We denote the extended operation by and define it by: A semiring is a strong bimonoid which is left distributive and right distributive.
In the rest of this paper, (B, ⊕, ⊗, 0, 1) will denote an arbitrary strong bimonoid if not specified otherwise.
In the following example, we recall particular strong bimonoids and semirings which we will use later. We refer the reader for more examples of strong bimonoids (also those which are not semirings) to is not a semiring, because there are a, b, c ∈ N ∞ with min(a, b + c) = min(a, b) + min(a, c) (e.g., take a = b = c = 0).

Weighted tree languages
Let H be a set disjoint with the ranked alphabet Σ and the strong bimonoid B. A weighted tree language over Σ, H and B is a mapping r : T Σ (H) → B. If H = ∅, then we say just weighted tree language over Σ and B or (Σ, B)-weighted tree language.
Let r and r ′ be (Σ, B)-weighted tree languages and b ∈ B. We define the (Σ, B)-weighted tree Let L ⊆ T Σ be a tree language. The characteristic mapping of L with respect to B is the mapping Next let r : T Σ → B be a (Σ, B)-weighted tree language and ξ ∈ T Σ . The quotient of r with respect ξ is the weighted context language ξ −1 r :

Weighted tree automata
In this section we recall the definition of weighted tree automata [FV09], show examples, and compare the initial algebra semantics with the run semantics.
Before defining the semantics of (Σ, B)-wta, we introduce the following convention. We denote by im(δ) the set k∈N im(δ k ). Moreover, the elements of B Q are also called Q-vectors over B. For every v ∈ B Q and q ∈ Q, v(q) is called the q-component of v and it is denoted by v q frequently.
We note that i-recognizable (Σ, B)-weighted tree languages are the same as recognizable Σ-tree languages in the sense of [Eng75, GS84, CDG + 07]. Hence, we will specify a recognizable Σ-tree language L by showing a bu-deterministic and total (Σ, If ρ(ε) = q for some q ∈ Q, then we call ρ a q-run. We denote by R A (ξ) the set of all runs of A on ξ and by R A (q, ξ) the set of all q-runs of A on ξ. For every ρ ∈ R A (ξ) and w ∈ pos(ξ), the run induced by ρ at position w, denoted by ρ| w ∈ R A (ξ| w ), is the mapping ρ| w : pos(ξ| w ) → Q defined by ρ| w (w ′ ) = ρ(ww ′ ) for every w ′ ∈ pos(ξ| w ). For every ξ = σ(ξ 1 , . . . , ξ k ) ∈ T Σ , the weight wt A (ρ) of ρ is the element of B defined inductively by (2) The run semantics of A is the (Σ, B)-weighted tree language [[A]] run such that for every ξ ∈ T Σ

Examples
In this subsection we show three examples of wta: a wta for which the initial algebra semantics and the run semantics are different, a bu-deterministic wta, and a crisp-deterministic wta.
Moreover, we visualize wta by hypergraphs. A hypergraph over Σ (for short: Each Σ-hypergraph G = (V, E) can be illustrated by a figure as follows: we represent each node v by a circle, and each hyperedge v 1 , . . . , v k , σ, v by a box with σ inscribed and with one outgoing arc leading to the node v and with one ingoing arc coming from v i for each i ∈ [k]. In order to represent the order inherent in the list v 1 , . . . , v k , the ingoing arcs are drawn such that, when traversing them counterclockwise, starting from the outgoing arc, then the list of their source nodes is v 1 , . . . , v k . In • δ 0 (ε, α, q 1 ) = δ 1 (q 1 , γ, q 2 ) = 1 for every q 1 , q 2 ∈ Q, and • F p1 = F p2 = 1. Then A is not bu-deterministic because, e.g., δ 0 (ε, α, p 1 ) and δ 0 (ε, α, p 2 ) are not equal to 0. Figure 2 shows the Σ-hypergraph for A.
Let n ∈ N and let us compute where at ( * ) we have used the following fact. For every n ∈ N and q ∈ Q: This can be proved as follows.
where the second equality follows from (a) I.

Now we compute [[A]
] run (γ n α). It is easy to see that wt A (ρ) = 1 for each run ρ ∈ R A (γ n α). Then We consider the mapping As weight structure we use the tropical semiring TSR. Thus, the mapping size is a (Σ, TSR)-weighted tree language. We construct the (Σ, TSR)-wta C = (Q, δ, F ) such that its run semantics is size, as follows.
Let ξ ∈ T Σ and q ∈ Q. It is clear that Thus

Relationship between the initial algebra semantics and the run semantics.
As it is illustrated by Example 3.1, in general, the initial algebra semantics and the run semantics of wta are different (for the string case cf. [DSV10,CDIV10]). However, if B is a semiring, then the initial algebra semantics coincides with the run semantics. Also, the initial algebra semantics coincides with the run semantics for bu-deterministic (Σ, B)-wta. We will prove this fact after the following preparation.
then also the following statements hold.
Proof: Proof of (i): Let q ∈ Q be arbitrary. To prove (a), we calculate as follows: whereσ is the operation of the Σ-term algebra associated to σ; the second equality holds, because To prove (b), let ρ ∈ R A (q, ξ) and let us consider Equation (2). We have ρ| i ∈ R A (ρ(i), ξ i ), hence by our assumption wt A (ρ| i ) = 0. Then also wt A (ρ) = 0.
Proof of (ii): We prove (a) by induction on ξ. We assume that |Q , and we continue by case analysis.
Since A is bu-deterministic, there is at most one q ∈ Q such that δ k (p 1 . . . p k , σ, q) = 0, and thus, (σ(ξ 1 , . . . , ξ k ))| ≤ 1. (Since B may contain zero-divisors, the cardinality of this set can be 0.) Statement (b) is proved in a very similar way to Statement (a). Proof of (iii): We prove by induction on ξ.
Using the definition of ρ, the assumption that ρ i is the only , and the fact that A is bu-deterministic, we can easily show that wt A (ρ ′ ) = 0.

Algebras with root weights
In this section we introduce the concept of algebra with root weights in order to study crisp-deterministic wta. This concept can be considered as generalization of weighted automata with infinitely many states [CDIV10,p. 3502] to the tree case. The semantics of an algebra with root weights is a weighted tree language. Then we define two basic constructions with (Σ, B)-algebras. We will use both of them to give an isomorphic representation of the (Σ, B)-algebra N (A) of a (Σ, B)-wta A (cf. Section 6, in particular, Theorem 6.7).

General concepts
A Σ-algebra with root-weight vector in B (for short: (Σ, B)-algebra) is a triple K = (Q, θ, F ), where Q is a (possibly infinite) set, (Q, θ) is a Σ-algebra, and F : Q → B is mapping.
We denote by h K the unique Σ-algebra homomorphism from T Σ to Q. The semantics of K is the weighted tree language [[K]] : T Σ → B defined by Now we define some notions concerning (Σ, B)-algebras which we will use in the rest of this paper. For this, let The following lemma can be proved by using standard arguments.

Direct product of algebras with root-weight vector
Direct product of (Σ, B)-algebras is a generalization of the direct product of crisp-deterministic automata defined in [CDIV10,] to the tree case. It relies on the concept of direct product of Σ-algebras. We will use this concept to prove Theorem 6.7.
Let Π(K) = (Q, θ, F ) be the direct product of the family For every subset Q ′ of Q and i ∈ [n], the mapping pr i : Q ′ → Q i defined by pr i (q 1 , . . . , q n ) = q i , for each (q 1 , . . . , q n ) ∈ Q ′ , is called the ith projection mapping of Q ′ into Q i . Any (Σ, B)-subalgebra K ′ = (Q ′ , θ ′ , F ′ ) of Π(K) having the property that for each i ∈ [n] the ith projection mapping pr i : Q ′ → Q i is surjective is called a subdirect product of K.

Derivative (Σ, B)-algebra of a weighted tree language
The concept introduced below is a generalization of derivative automaton of [CDIV10,p. 3504] to the tree case. It uses the concept of quotient of weighted tree language with respect to a tree defined in Subsection 2.4. We will apply it to prove Theorem 6.7.
Clearly, for each finite (Σ, B)-algebra K there is exactly one crisp-deterministic (Σ, B)-wta A such that K and A are related. We denote this A by rel(K). Also vice versa, for each crisp-deterministic (Σ, B)-wta A there is exactly one finite (Σ, B)-algebra K such that K and A are related. We denote this K by rel(A).
Lemma 5.1. Let K be a finite (Σ, B)-algebra and A be a crisp-deterministic (Σ, B)-wta. If K and A are related, then for each ξ ∈ T Σ and each q ∈ Q we have that h V(A) (ξ) q = 1 if q = h K (ξ), and 0 otherwise.
Let r be a (Σ, B)-weighted tree language. Then r is a (Σ, B)-recognizable step mapping if there are n ∈ N + , recognizable Σ-tree languages L 1 , . . . , L n ⊆ T Σ , and b 1 , . . . , b n ∈ B such that r = n i=1 b i ⊗ 1 (B,Li) . Each tree language L i is called step language. We say that a (Σ, B)-recognizable step mapping is in normal form if the family of its step languages is a partitioning of T Σ .
(v) im(r) is finite and for each b ∈ B the Σ-tree language r −1 (b) is recognizable.
Proof: (i) ⇔ (ii): For a given crisp-deterministic (Σ, B)-wta A it is trivial to construct a finite (Σ, B)algebra K such that A and K are related. Then Lemma 5.1 implies (i) ⇒ (ii). In a similar way we can prove (ii) ⇒ (i).
• for every k ∈ N, σ ∈ Σ (k) , and q 1 , . . . , q n , q ∈ Q we let where ( q j ) i denotes the ith component of q j , and similarly for ( q) i , and • for every q ∈ Q we let F q = i∈[n]: 6 Crisp-determinization for the initial algebra semantics We first introduce, for each (Σ, B)-wta A, the (Σ, B)-algebra N (A), which we call the Nerode algebra of A. It is the generalization of the Nerode automaton of a wsa defined in [CDIV10,Sect. 6] to the tree case. Then we show that A and N (A) are semantically equivalent (cf. Lemma 6.2). In general N (A) is not finite, but if it is so, then we can derive the crisp-deterministic wta rel(N (A)) from N (A), which is i-equivalent to A (cf. Theorem 6.3). We prove two interesting properties of N (A): (1) we characterize the case that N (A) is finite (cf. Theorem 6.5) and (2) we give an isomorphic representation of N (A) (cf. Theorem 6.7). For the latter, we will use the constructions direct product of (Σ, B)-algebras and derivative (Σ, B)-algebra of a weighted tree language defined in Section 4. Then we show that if (1) B is locally finite or (2) B is multiplicatively locally finite and A is bu-deterministic, then N (A) is finite (cf. Corollary 6.10). Finally, we present an algorithm of which the input is an arbitrary (Σ, B)-wta A, and which terminates if N (A) is finite and delivers the crisp-deterministic wta rel(N (A)) (cf. Algorithm 1)).

Finiteness of the Nerode algebra implies crisp-determinization
In the rest of this paper, we denote the components of N (A) by Q N , θ N , and F N .
The next proposition follows from Proposition 2.2 and the fact that h V(A) is the unique homomorphism from T Σ to V(A). Proof: By Proposition 6.1 we have that σ(ξ 1 , . . . , ξ k )) for every k ∈ N, σ ∈ Σ (k) , and ξ 1 , . . . , ξ k ∈ T Σ . We recall that h N (A) is the unique Σ-algebra homomorphism from Then we obtain Example 6.4. Let Σ = {σ (2) , γ (1) , α (0) }. We consider the mapping size-mod-2 : T Σ → N defined as in Example 3.3. Here we will construct a wta D which is not bu-deterministic and which i-recognizes size-mod-2, and we will analyze the Nerode algebra of D.
We realize that rel (N (D)) and the crisp-deterministic wta of Example 3.3 are essentially the same. ✷

Properties of the Nerode algebra
In this section we show two properties of the Nerode (Σ, B)-algebra N (A), cf. Theorem 6.5 and Theorem 6.7. For this, we introduce some preparatory concepts. In addition, let q ∈ Q. We define the mapping h q In the following we give some characterizations for the fact that N (A) is finite.
Before showing the second property of N (A), we exploit Theorem 6.5 and show that the reverse of Theorem 6.3 does not hold. This theorem says in particular that, for each (Σ, B)-wta A, if the Nerode algebra N (A) is finite, then [[A]] init is i-recognizable by a crisp-deterministic wta. However, the following also holds.
Let A = (Q, δ, F ) be a (Σ, B)-wta such that N (A) is finite. By (i) ⇒ (ii) of Theorem 6.5, rel(N (A)) has the property that, for each q ∈ Q, the weighted tree language . In the following we show that rel(N (A)) is minimal among all crisp-deterministic wta which have this property. Proof: As we saw, rel(N (A)) ∈ U A . Now let B = (Q ′ , δ ′ , F ′ ) be an arbitrary crisp-deterministic (Σ, B)-wta in U A . By definition, for every q ∈ Q there is a final variant . We will give a surjective mapping ϕ : Q ′ → Q N . Let rel(B ′ ) = (Q ′ , θ ′ , F ′ q ) be the (Σ, B)-algebra related to B ′ . We can assume that rel(B ′ ) is accessible, because otherwise if there is a state q ∈ Q ′ which is not accessible, then there is a final variant B ′′ of B with less states than B ′ .
We define a mapping ϕ by ϕ( Then ϕ is well-defined, which can be seen as follows. Let q ′ ∈ Q ′ and ξ, ζ ∈ T Σ such that In addition, ϕ is surjective because rel(B ′ ) is accessible. Thus, we conclude that |Q N | ≤ |Q ′ |. Therefore, we have proved that rel (N (A)) is a minimal crisp-deterministic (Σ, B)-wta in the set U A .

Sufficient conditions for finiteness and the algorithmic construction of the Nerode algebra
Next we give sufficient conditions for the strong bimonoid B and the wta A which guarantee that the Nerode algebra N (A) is finite. Moreover, we give an algorithm to construct the crisp-deterministic wta which is i-equivalent to A. Proof: Let A = (Q, δ, F ). First we consider the case that B is locally finite. Since im(δ) is finite and B is locally finite, the carrier set H of the subalgebra of B generated by im(δ) is finite. Since im(h V(A) ) ⊆ H Q , also im(h V(A) ) is finite. Thus, by Proposition 6.1, also N (A) is finite. Then the result follows from Theorem 6.3. Second we consider the case that B is multiplicatively locally finite and A is bu-deterministic. Let H = im(δ) {⊗} . Due to the fact that A is bu-deterministic we have h V(A) (ξ) ∈ H Q for each ξ ∈ T Σ . Thus im(h V(A) ) is finite. Then we can finish as in the first case.
Finally, we present the generalization (cf. Algorithm 1) of [CDIV10, Algorithm 6.4] which we can use to construct rel(N (A)) for a (Σ, B)-wta A if N (A) is finite. If Algorithm 1 is given a (Σ, B)-wta A = (Q, δ, F ) as input and it terminates, then it outputs the crisp-deterministic (Σ, B)-wta rel (N (A)). Algorithm 1 terminates of input A if and only if N (A) is finite.

Crisp-determinization for the run semantics
We introduce the concept of finite order property for a (Σ, B)-wta A. Then we prove that if A has the finite order property, then we can construct the crisp-deterministic wta R(A) which is r-equivalent to A (cf. Theorem 7.3). We show that if B is bi-locally finite, then A has the finite order property (cf. Corollary 7.5). Next we present an algorithm which, given an arbitrary wta A with the finite order property, delivers the crisp-deterministic wta R(A) (cf. Algorithm 3). Lastly, we relate the number of states of N (A) defined in Section 6 and R(A) (cf. Theorem 7.9).

Finite order property implies crisp-determinization
The following concepts are generalizations of the corresponding ones in [CDIV10,Sect. 8] has finite order in (N, min, ∞), because min is idempotent.
The (Σ, TSR)-wta A = (Q, δ, F ) of Example 6.4 does not have the finite order property, because, e.g., 2 ∈ im(δ) and {2} {+} is infinite, and thus H A is infinite too. ✷ In this subsection, let A = (Q, δ, F ) be a (Σ, B)-wta and we assume that A has the finite order property.
is a sum over the finite set H A ⊗ im(F ). The fact that each element of H A ⊗ im(F ) has a finite order guarantees that any sum over H A ⊗ im(F ) is equal to a finite sum over this set. In the following we formalize this phenomenon.
We denote by lcm(K) the least common multiple of K for each finite subset K ⊆ N + . We define the integers For each n ∈ N, we define the number where ≡ pA denotes the congruence modulo p A . Moreover, for every b ∈ H A , b ′ ∈ im(F ), and n ∈ N, Since H A is finite by assumption, the set Q × H A is also finite. We define the set of q-runs on ξ of which the weight is b by Moreover, for every ξ ∈ T Σ , let us define p ξ : Q × H A → N and π ξ : Then for every ξ ∈ T Σ , (q, b) ∈ Q × H A , and b ′ ∈ im(F ), we have • (δ R ) k (π ξ1 . . . π ξ k , σ, π ξ ) = 1 if ξ = σ(ξ 1 , . . . , ξ k ) 0 otherwise, for every k ∈ N, ξ, ξ 1 , . . . , ξ k ∈ T Σ , and σ ∈ Σ (k) , and • (F R ) π ξ = (q,b)∈Q×HA π ξ (q, b)(b ⊗ F q ) for every ξ ∈ T Σ . Since |Q R | ≤ (i A + p A ) |Q|·|HA| , the set Q R is finite. If, in particular, each element in H A ⊗ im(F ) is additively idempotent, then we have |Q R | ≤ 2 |Q|·|HA| .
• for each π ∈ Q R we have We note that the condition in Corollary 7.5 (that B is bi-locally finite) is different from the condition in Corollary 6.10 (that B is locally finite). Clearly, each locally finite strong bimonoid is also bi-locally finite. In the following we give an example of a bi-locally finite strong bimonoid which is not locally finite.
(i) B is bi-locally finite.
(ii) For every (Σ, B)-wta A, the weighted tree language [[A]] run is r-recognizable by a crispdeterministic wta.
Proof: The proof of (i) ⇒ (ii) follows from Corollary 7.5. The proof of (ii) ⇒ (i) can be obtained by an easy generalization of [DSV10, Lm. 12] from weighted string automata to wta.
To finish the proof, it is sufficient to give a surjective mapping ψ : Q R → Q N . We define it by ψ(π ξ ) = h V(A) (ξ) for each ξ ∈ T Σ . We show that ψ is well defined, i.e., that Let ξ, ζ ∈ T Σ such that π ξ = π ζ . Then we have for every q ∈ Q, where in the first and the last equality we use that B is right distributive. Hence ψ is a well-defined. Moreover it is surjective obviously, so we obtain that |Q N | ≤ |Q R |.

Undecidability results
The undecidability results of this section only make sense if we assume that the strong bimonoids we consider are computable. A strong bimonoid (B, ⊕, ⊗, 0, 1) is called computable if B is a recursive set and the operations ⊕ and ⊗ are computable (e.g., by a Turing machine).
In the rest of this section, we assume that all the mentioned strong bimonoids are computable.
We will show that each of the following problems is undecidable for arbitrary ranked alphabet Σ, strong bimonoid B, and bu-deterministic (Σ, B)-wta A: Each of these results is based on the reduction to an undecidability result of Mealy machines. Thus we devote the first subsection to the repetition of Mealy machines and their simulation by wta.

Mealy machines and their simulation by weighted tree automata
A Mealy machine is a tuple M = (Q, ∆, τ, ν) where Q is a finite nonempty set (states), ∆ is an alphabet, τ : Q × ∆ → Q is a mapping (transition mapping), and ν : Q × ∆ → ∆ is a mapping (output mapping).
We will prove our undecidability results by reducing them to the following one. In the proof of our undecidability results, we will simulate M {•} for an arbitrary Mealy machine M with input alphabet ∆ by a bu-deterministic wta A M . The weight algebra of A M is a strong bimonoid which, cum grano salis, contains the monoid (F (∆ * ), •, id F (∆ * ) ) as multiplicative part. In order to guarantee later that A M has the finite order property, we will extend (F (∆ * ), •, id F (∆ * ) ) into a strong bimonoid with an idempotent addition.

Undecidability of crisp-determinization under initial algebra semantics
Here we show that problem (Pi) is undecidable. For this we introduce the Σ M -algebra F M = (F (∆ * ∞ ), (σ M | σ ∈ Σ M )) by • e M = id F (∆ * ∞ ) and • q M (f ) = f • ν ′ q for every q ∈ Σ It would be nice to identify classes B of strong bimonoids for which a complete description of the inclusion relations can be given among the six classes (13) of wta. Let us form this problem more exactly.
A determinization classification is a pair (B, D) such that • B is a class of strong bimonoids, • D is the Hasse diagram of the classes (13).
Next we give some easy examples of determinization classifications. For the sake of brevity, for a singleton class {B}, we write just B.
For instance, (B, D) is a determinization classification, where D is the Hasse diagram which contains just one node and this node is labeled by all the six classes; indeed, all these classes are equal to the class of all (Σ, B)-wta for some ranked alphabet Σ.
As another example, (TSR, D) is also a determinization classification, where D is the Hasse diagram shown in Figure 7. The inclusions and equalities shown by D were justified above, except the inclusion C finop (TSR) ⊆ C finN (TSR), which follows from Theorem 7.9. Moreover, each inclusion is proper because • the wta D in Example 6.4 is in C finN (TSR) \ C finop (TSR) (cf Example 7.1), • the wta A in the proof of Lemma 6.6 is in C init crisp-det (TSR) \ C finN (TSR), and • the wta C of Example 3.2 is in C init bu-det (TSR) \ C init crisp-det (TSR).