arXiv:2608.24247cs.FLAug 2026

Manuscript Offprint

arXiv:2608.24247

The Value Generating Power of Weighted Tree Automata with Initial Algebra Semantics

Manfred Droste, Zoltán Fülöp, Andreja Tepavčević, Heiko Vogler

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Manfred Droste

Leipzig University, Germany

Zoltán Fülöp*

University of Szeged, Hungary

Andreja Tepavčević

Mathematical Institute SANU, Belgrade

University of Novi Sad, Serbia

Heiko Vogler

Technische Universität Dresden, Germany

We consider the generating power of the initial algebra semantics of weighted tree automata over strong bimonoids (hence also over semirings) and the question under which conditions the weighted tree automata can produce only finitely many values. We show that there exists a right-distributive strong bimonoid which is bi-locally finite but not locally finite. We also show that if the ranked alphabet contains a symbol with rank at least two, then for any finitely generated strong bimonoid, weighted tree automata can generate, via their initial algebra semantics, all elements of the strong bimonoid. As a consequence of these results, for bi-locally finite right-distributive strong bimonoids which are not locally finite, weighted tree automata can generate infinitely many values, provided that the input ranked alphabet contains a symbol with rank at least two. This is in sharp contrast to the setting of weighted string automata, which can generate only finitely many values. As a further consequence, for any finitely generated semiring, there exists a weighted tree automaton which generates, via its run semantics, all elements of the semiring.

1 Introduction

Trees are a fundamental data structure in theoretical computer science, naturally modeling hierarchical information such as syntax in programming languages, structured data formats, and derivation trees in logic and linguistics. Correspondingly, tree automata provide a robust and well-studied framework for recognizing and processing tree-structured inputs, extending classical automata theory from strings to branching objects. In many applications, one also needs to consider quantitative information such as costs, probabilities, or multiplicities. This has led to the development of weighted tree automata, which combine the structural capabilities of tree automata with algebraic weight domains, typically given by semirings. Weighted tree automata have found applications in areas such as natural language processing and program analysis, cf., e.g., [24, 28, 6]; the rich theory of weighted automata, started with [31], is witnessed by the books and surveys [15, 30, 33, 25, 2, 29, 10, 11, 19].

A crucial property for weighted string and tree automata over semirings is that two descriptions of their behavior, the run semantics and the initial algebra semantics, coincide. This enables the application of methods from algebra for the solution of combinatorial and language-theoretic problems of weighted automata and even of classical unweighted automata. More recently, strong bimonoids have been investigated as weight structures for such automata [12, 13, 27, 7, 8]. Strong bimonoids are structures B=(B,⊕,⊗,0,1)\mathsf{B} = (B, \oplus, \otimes, \mathbb{0}, \mathbb{1}) where (B,⊕,0)(B, \oplus, \mathbb{0}) is a commutative monoid, (B,⊗,1)(B, \otimes, \mathbb{1}) is a monoid, and 0\mathbb{0} acts like a

*Project no TKP2021-NVA-09 has been implemented with the support provided by the Ministry of Culture and Innovation of Hungary from the National Research, Development and Innovation Fund, financed under the TKP2021-NVA funding scheme.

M. Hospodár et al. (Eds.): 17th International Conference on Automata and Formal Languages (AFL 2026) EPTCS 451, 2026, pp. 123–139, doi:10.4204/EPTCS.451.9

© M. Droste, Z. Fülöp, A. Tepavčević, and H. Vogler This work is licensed under the Creative Commons Attribution License.

The Value Generating Power of Weighted Tree Automata

multiplicative zero. Here, we will investigate weighted automata over right-distributive strong bimonoids; these can be viewed as semirings without requiring left-distributivity. Typical examples include, e.g., the standard real-valued polynomials with usual addition and with composition as multiplication operation (which is right-, but not left-distributive). It has been shown that the important coincidence of run and initial algebra semantics extends to weighted string automata over right-distributive strong bimonoids [12]. For many further results and examples for right-distributive strong bimonoids, see [19].

A central topic in the theory of weighted automata is the description of their generating power for outputs, including conditions under which weighted automata produce only finitely many values. If the right-distributive strong bimonoid B is bi-locally finite, i.e., both monoids (B,⊕,0)(B,\oplus,\mathbb{0}) and (B,⊗,1)(B,\otimes,\mathbb{1}) are locally finite, then the run semantics, and hence also its initial algebra semantics, of any weighted string automaton clearly is finite-valued.

It is the goal of this paper to investigate whether analogous results hold true for weighted tree automata. It is easy to see that if B is bi-locally finite, the run semantics of a weighted tree automaton is finite-valued. But, it is known that for right-distributive strong bimonoids B, the run semantics and the initial algebra semantics of weighted tree automata, in contrast to weighted string automata, may differ (cf. e.g. [27, 19]). Hence for bi-locally finite right-distributive strong bimonoids the question arises whether the initial algebra semantics of a weighted tree automaton is also finite-valued. If B is locally finite, i.e., each finitely generated strong submonoid of B is finite, then clearly the initial algebra semantics of any weighted tree automaton is finite-valued. Also, if B is locally finite, trivially B is bi-locally finite. Hence an important question is whether in general for right-distributive strong bimonoids local finiteness and bi-local finiteness are equivalent. Our first main result will be:

Main Theorem 1. There exists a bi-locally finite right-distributive strong bimonoid B which is not locally finite.

We note that right-distributive strong bimonoids are near-semirings, which have been investigated in algebra, cf. [23, 26]; hence Main Theorem 1 also shows that there are bi-locally finite near-semirings which are not locally finite. We will prove a slightly stronger version of Main Theorem 1 in Theorem 3.5. In our construction, we start with the free algebra of terms, with addition and multiplication as operations, over a set X. By a natural congruence, the quotient of the term algebra becomes the free right-distributive strong bimonoid over X. We construct two suitable further congruence conditions which ensure that the resulting quotient strong bimonoid B is bi-locally finite, but, using the freeness of the construction, we can show that B is not locally finite.

Now we turn to the question whether for all weighted tree automata A\mathcal{A} over a bi-locally finite right-distributive strong bimonoid, the image im([A]init)\text{im}([\mathcal{A}]^{\text{init}}) of its initial algebra semantics is finite. Our second main result will show (together with the above first main result) that this statement fails drastically as soon as the ranked alphabet contains a symbol of rank at least two. In fact, for any finitely generated strong bimonoid B there exist weighted tree automata over such a ranked alphabet and B which have the universality property:

Main Theorem 2. Let Σ\Sigma be an arbitrary ranked alphabet containing a symbol with rank at least 2, i.e., Σ≠Σ(0)∪Σ(1)\Sigma \neq \Sigma^{(0)} \cup \Sigma^{(1)}, and let B be any finitely generated strong bimonoid. Then there exists a weighted tree automaton A\mathcal{A} over Σ\Sigma and B such that im([A]init)=B\text{im}([\mathcal{A}]^{\text{init}}) = B.

Note that the values of im([A]init)\text{im}([\mathcal{A}]^{\text{init}}) are given by iterated sums and products of the finitely many weights occurring in the weighted tree automaton A\mathcal{A}. The constructed weighted tree automaton A\mathcal{A} produces, at proper branching points, also products of sums of weights occurring in A\mathcal{A} and, continuing in this way, generates all values of the underlying strong bimonoid B (provided it satisfies the necessary assumption of being finitely generated). In particular, trivially, if B is infinite, the image im([A]init)\text{im}([\mathcal{A}]^{\text{init}}) is also infinite. By Main Theorem 1, this may also happen if B is bi-locally finite and right-distributive, answering the question stated above and showing that weighted tree automata over ranked alphabets containing a symbol with rank a least 2 have much larger generating power than weighted string automata. Main Theorem 2 will be proved as Theorem 5.3.

To the best of our knowledge, Main Theorem 2 is new also for the case of semirings. As an immediate consequence of Main Theorem 2 and the coincidence of the run semantics and the initial algebra semantics for semirings, we obtain that for each ranked alphabet Σ\Sigma containing a symbol with rank at least two and for each finitely generated semiring B, there exists a weighted tree automaton A\mathcal{A} over Σ\Sigma and B such that im([A]run)=B\text{im}([\mathcal{A}]^{\text{run}}) = B. Note that we obtained this result as a consequence of the construction for the initial algebra semantics. It would be interesting to see whether a direct proof for the run semantics is possible.

Right-distributive strong bimonoids provide very natural generalizations of semirings. As mentioned, they are particular near-semirings studied in algebra. Polynomials and endomorphisms of monoids with pointwise addition and composition as multiplication form natural examples of near-semirings and right-distributive strong bimonoids. The usual multiplication of ordinal numbers is left- but not right-distributive over addition. In computer science, in compositional semantics and interprocedural dataflow analysis, trees represent structured computations where transfer functions are combined across branches and composed along evaluation paths, with joins aggregating alternative behaviors. This induces a non-distributive algebra of transformations with join as addition and composition as multiplication, naturally captured by weighted tree automata over near-semirings and right-distributive strong bimonoids, cf. [32, 28].

Open research questions are presented and discussed in Section 6. A preliminary version of this paper is published as [9].

References (31)