Weighted tree automata and weighted logics

Size: px
Start display at page:

Download "Weighted tree automata and weighted logics"

Transcription

1 Theoretical Computer Science 366 (2006) Weighted tree automata and weighted logics Manfred Droste a,, Heiko Vogler b a Institute of Computer Science, Leipzig University, D Leipzig, Germany b Department of Computer Science, Dresden University of Technology, D Dresden, Germany Abstract We define a weighted monadic second order logic for trees where the weights are taken from a commutative semiring. We prove that a restricted version of this logic characterizes the class of formal tree series which are accepted by weighted bottom-up finite state tree automata. The restriction on the logic can be dropped if additionally the semiring is locally finite. This generalizes corresponding classical results of Thatcher, Wright, and Doner for tree languages and it extends recent results of Droste and Gastin [Weighted automata and weighted logics, in: Automata, Languages and Programming 32nd International Colloquium, ICALP 2005, Lisbon, Portugal, 2005, Proceedings, Lecture Notes in Computer Science, Vol. 3580, Springer, Berlin, 2005, pp , full version in Theoretical Computer Science, to appear.] from formal power series on words to formal tree series Elsevier B.V. All rights reserved. Keywords: Weighted automata; Tree automata; MSO-logics; Formal power series 1. Introduction In automata theory, Büchi s and Elgot s fundamental theorems [12,20] on the coincidence of regular languages with languages definable in monadic second order logic (for short: MSO-logic) led to various extensions. Thatcher and Wright [39] and Doner [16] established a corresponding equivalence for trees. Engelfriet [22,23] and Courcelle [14] proved a characterization of a large class of context-free graph languages as images of MSO-definable functions on sets of trees. Bloem and Engelfriet [4] proved that the tree transductions computed by a particular class of attributed tree transducers coincide with the MSO-definable tree transductions. On a different strand, following Schützenberger [35], weighted automata form a quantitative extension of classical automata, cf. [34,3,31] for surveys; this recently led to practical applications in digital image compression [15,28], in model-checking of probabilistic systems [38,1] and in natural language processing [13]. Very recently, Droste and Gastin [18] defined a weighted logic and obtained a characterization of the behavior of weighted automata on words by sentences of this weighted logic, thereby extending Büchi s and Elgot s classical results. Intuitively, this logic allows us to count how often a formula is true, thus it includes quantitative aspects. In this paper, we will consider a weighted logic for trees and we will achieve an extension of the result of Thatcher and Wright [39] and Doner [16] to the case of weighted tree automata. Corresponding author. addresses: droste@informatik.uni-leipzig.de (M. Droste), vogler@tcs.inf.tu-dresden.de (H. Vogler) /$ - see front matter 2006 Elsevier B.V. All rights reserved. doi: /j.tcs

2 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Weighted tree automata have been considered by a number of researchers [10,2,37,29,24,33,6,19] and have been used for efficient code selection [25,7]. In such tree automata, transitions are assigned a weight which might model, e.g., resources used for its execution, length of time needed, or its reliability. To cope with such situations uniformly, the weights are taken as elements of a semiring. In our weighted logic we take the elements of the given semiring as atomic formulas. In order to define the semantics of the negation of a formula, we restrict in our syntax negation to atomic formulas. In comparison to the classical logics for trees, this is no essential restriction but forces us to include universal quantification into the syntax. However, already in weighted logics for words [18], in general there are series definable in this general weighted logic which are not recognizable by weighted automata. Fortunately, we can restrict universal quantification appropriately. Our main result states that for any commutative semiring the behaviors of weighted tree automata are precisely the series arising as semantics of sentences of our restricted weighted MSO-logic (cf. Theorem 5.1). If the semiring is locally finite, all sentences of our weighted MSO-logic have recognizable semantics (cf. Theorem 6.5). The development of our weighted logic for trees is quite similar to the weighted logic for words [18]. Assuming familiarity with the unweighted logics for trees, background results on weighted tree automata, and the arguments for the word case in [18], several of our proofs can be obtained straightforwardly as an amalgamation and adjustment of the existing proofs from these three strands. However, a main difference arises for the treatment of the universal quantifier on first order variables. Roughly speaking, this difference is due to the need for synchronizing of variables in different subtrees; this problem does not arise in the case of words. Moreover, crucial differences and open problems occur with respect to constructibility and decidability questions. Given any computable field (e.g., the rational numbers), we can show that for any restricted weighted MSO-sentence we can effectively construct an equivalent weighted tree automaton (cf. Corollary 5.8). Hence, given two such sentences, we can decide whether their semantics are equal (cf. Corollary 5.9). But, our procedures are not primitive recursive. This is due to the present lack of a comparable algebraic theory for weighted tree automata like it was developed for weighted automata on words, cf. [3,31]. Consequently, it is open at present how to check (for suitable semirings like arbitrary fields) whether a given weighted MSO-sentence for trees is restricted; for words this is possible [18]. This calls for further research on such questions for weighted tree automata. 2. Tree languages and tree automata Let N ={0, 1, 2,...}. Aranked alphabet is a tuple (Σ,rk Σ ) where Σ is a finite set and rk Σ : Σ N. For every m 0, the set of all symbols of Σ with rank m is denoted by Σ (m). In the sequel we use the phrase let Σ be a ranked alphabet, if either the function rk is an arbitrary one or it is known from the context. We denote the value max{rk Σ (σ) σ Σ} by max Σ. In examples, a particular ranked alphabet Σ is specified by showing the set Σ and attaching the respective rank to every symbol as superscript as, e.g., Σ ={σ (2), α (0) }. The set of (finite, labeled and ordered) Σ-trees, denoted by T Σ, is the smallest subset T of (Σ {(, )} {, }) such that if σ Σ (m) with m 0 and s 1,...,s m T, then σ(s 1,...,s m ) T. In case m = 0, we identify σ()with σ. Clearly T Σ = iff Σ (0) =. Since we are not interested in the case that T Σ =, we assume that Σ (0) = for every ranked alphabet Σ appearing in this paper. We define the set of positions in a tree by means of the mapping pos: T Σ P(N ) inductively as follows: (i) if t Σ (0), then pos(t) ={ε}, and (ii) if t = σ(s 1,...,s m ) where σ Σ (m), m 1 and s 1,...,s m T Σ, then pos(t) ={ε} {i.v 1 i m, v pos(s i )}. For every t T Σ and w pos(t), the label of t at w and the subtree of t at w, denoted by t(w) Σ and t w T Σ, respectively, are defined inductively as follows: if t = σ(s 1,...,s m ) for some σ Σ (m) with m 0 and s 1,...,s m T Σ, then t(ε) = σ and t ε = t, and if w = i.v and 1 i m, then t(w) = s i (v) and t w = s i v. Next we recall, for the convenience of the reader, basic back-ground on bottom-up finite state tree automata, also see [26,27]. A bottom-up finite state tree automaton (for short: bu-fta) is a tuple M = (Q, Σ, δ,f)where Q is a finite set (of states), Σ is a ranked alphabet (of input symbols), δ = (δ σ σ Σ) is a family of transition functions of the form δ σ : Q m P(Q) where m 0 and σ Σ (m), and F Q (final states). A bottom-up finite state tree automaton is deterministic if for every m 0, σ Σ (m), and q 1,...,q m Q, the set δ σ (q 1,...,q m ) is a singleton. In this case we identify the set δ σ (q 1,...,q m ) with its element. Now we define the run semantics of a bu-fta M. Let t T Σ.Arun of M on t is a mapping r : pos(t) Q. A run r is valid if whenever w pos(t) and t(w) = σ Σ (m) for some m 0, then r(w) δ σ (r(w.1),...,r(w.m)). In other

3 230 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) words, a run r is valid if at every position w the state r(w) is the result of applying the transition performed at w to the states assigned to the predecessors of w. Let R M (t) and RM v (t) denote the sets of all runs of M on t and all valid runs of M on t, respectively. We note that if M is deterministic, then there is a unique valid run of M on t, denoted by r t. The tree language accepted by M is the set L(M) ={t T Σ r RM v (t) : r(ε) F }. (We note that the run semantics of M is equivalent to the initial algebra semantics which is usually associated with M, cf. e.g. [39, p. 58].) A tree language L is recognizable (resp. deterministically recognizable) if there is a (resp. deterministic) bottom-up finite state tree automaton M such that L = L(M). By applying the usual powerset construction, one obtains that every recognizable tree language is also deterministically recognizable (cf. [39, Theorem 1]). It is well known that the class of recognizable tree languages is closed under the boolean operations (i.e., union, intersection, and complement; cf. [39, Theorem 2]). Next we briefly recall the MSO-logic on trees and the generalization of Büchi s result, namely that MSO-definable tree languages are exactly the recognizable tree languages [39,16]. Let Σ be a ranked alphabet. The set MSO(Σ) of all formulas of MSO-logic over Σ is defined as the smallest set F such that (1) F contains all atomic formulas label σ (x), edge i (x, y), and x X and (2) if φ, ψ F, then also φ ψ, φ ψ, φ, x.φ, X.φ, x.φ, X.φ F, where σ Σ, x,y are first order variables, 1 i max Σ, and X is a second order variable. The set of free variables of φ is denoted by Free(φ). Let V be a finite set of first order and second order variables. The ranked alphabet Σ V = (Σ {0, 1} V,rk)is defined by rk((σ,f)) = rk Σ (σ) for every f {0, 1} V. For a symbol (σ,f) Σ V we denote σ by (σ,f) 1 and f by (σ,f) 2. A Σ V -tree s is valid if for every first order variable x V, there is exactly one w pos(s) such that (s(w) 2 )(x) = 1. The subset of T ΣV containing all valid trees is denoted by TΣ v V. We put Σ φ = Σ Free(φ). Every valid Σ V -tree s corresponds to a pair (t, ρ) where t T Σ and ρ is a (V,t)-assignment; such an assignment is a function which maps first order variables in V to elements of pos(t) and second order variables in V to subsets of pos(t). More precisely, we say that s and (t, ρ) correspond to each other if pos(t) = pos(s), t is obtained from s by replacing s(w) by s(w) 1 for every w pos(t), and for every first order variable x, second order variable X, and w pos(s), we have that (s(w) 2 )(x) = 1iffρ(x) = w, and (s(w) 2 )(X) = 1iffw ρ(x). In the sequel we will identify a valid Σ V -tree with the corresponding pair (t, ρ). Let s be an arbitrary Σ V -tree, x be a first order variable, and w pos(s). Then s[x w] is the Σ V {x} -labeled tree obtained from s by putting (s[x w](v) 2 )(x) = 1iffv = w. Similarly, if X is a second order variable and I pos(s), then s[x I] is the Σ V {X} -tree obtained from s by putting (s[x I](v) 2 )(X) = 1iffv I. If here s = (t, ρ), we also write s[x w] =(t, ρ[x w]) and s[x I] =(t, ρ[x I]). Let φ be a formula in MSO(Σ) and s = (t, ρ) be a valid Σ V -tree such that Free(φ) V. Then the relation (t, ρ) satisfies φ, denoted by (t, ρ) φ, is defined as usual. We put L V (φ) ={(t, ρ) T v Σ V (t, ρ) φ} and we will simply write L(φ) instead of L Free(φ) (φ). Now we recall the equivalence between recognizable tree languages and MSO-definable tree language; cf. [39, Theorems 14 and 17], [16, Theorems 3.7 and 3.9], or [27, Proposition 12.2]: The tree language L V (φ) is recognizable over Σ V. Conversely, for every recognizable tree language L over Σ, there is an MSO-sentence φ such that L = L(φ). It follows from this, but can also easily be shown directly, that the set T v Σ V is recognizable. Let us denote by MSO (Σ) the set of all MSO(Σ)-formulas in which negation is applied only to atomic formulas. By applying de Morgan s laws and by pulling negation over a first or second order quantifier (as, e.g., by ( x.φ) x. φ), we obtain the well-known fact that for every φ MSO(Σ) there is a ψ MSO (Σ) such that L(φ) = L(ψ). 3. Tree series and weighted tree automata A semiring is an algebraic structure (K, +,, 0, 1) with operations sum + and product and constants 0 and 1 such that (K, +, 0) is a commutative monoid and (K,, 1) is a monoid, multiplication distributes over addition, and a 0 = 0 a = 0 for every a K. Whenever the operations and constants of a semiring are clear from the context,

4 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) we abbreviate (K, +,, 0, 1) by K. The semiring K is commutative if is commutative. Important examples of semirings are the boolean semiring B = ({0, 1},,, 0, 1) with disjunction and conjunction, the semiring of natural numbers (N, +,, 0, 1), abbreviated by N, with the usual addition and multiplication, the tropical semiring Trop = (N { }, min, +,, 0) where the sum and the product operations are min and +, resp., extended to N { } in the usual way. A(formal) tree series is a mapping S : T Σ K where usually (S, t) is written rather than S(t). The support of S is the set supp(s) ={t T Σ (S, t) = 0}, and the image of S is the set im(s) ={(S, t) t T Σ }. The set of all tree series (over Σ and K) is denoted by K T Σ. For two tree series S,T K T Σ and k K, the sum S + T, the Hadamard product S T, and the product k S are each defined pointwise for every t T Σ as follows: (S +T,t) = (S, t)+(t, t), (S T,t) = (S, t) (T, t), and (k S,t) = k (S, t). For every L T Σ, the characteristic tree series 1 L : T Σ K is defined for every t T Σ by (1 L,t) = 1ift L, and (1 L,t)= 0 otherwise. A tree series S : T Σ K is a recognizable step function if there are an n 1 and recognizable tree languages L 1,...,L n T Σ such that S = n k i 1 Li. Lemma 3.1. Let S : T Σ K be a recognizable step function. Then there is a partitioning U 1,...,U m of T Σ where U 1,...,U m are recognizable tree languages, and there are l 1,...,l m K such that S = m l i 1 Ui. Proof. Let S = n k i 1 Li for some n 1 and recognizable tree languages L 1,...,L n T Σ. Let F be the set of all mappings of type {1,...,n} {1,c}. For every mapping f F, define the tree language U f = n L f(i) i where L 1 i = L i and L c i = T Σ \ L i. Note that the U f s form a partitioning of T Σ. For every such f define l f = i f 1 (1) k i. Then clearly, S = f F l f 1 Uf. This shows that S is a recognizable step function iff im(s) is finite and for every k K, the set S 1 (k) ={t T Σ (S, t) = k} is a recognizable tree language. Now we introduce weighted bottom-up finite state tree automata and their behavior. For further investigations, see [2,29,11,24,33,6,19]. Let (K, +,, 0, 1) be a commutative semiring. Moreover, let Q be a finite set (of states) and Σ a ranked alphabet (of input symbols). A (bottom-up) tree representation (over Q, Σ, and K) is a family μ = (μ m m N) of mappings μ m : Σ (m) K Qm Q.Aweighted bottom-up finite state tree automaton (over K) (for short: wta) is a quadruple M = (Q, Σ, μ, γ) where μ is a tree representation over Q, Σ, and K, and γ : Q K is the weight function for leaving a state (final weights). (We note that we view K Qm Q as the set of (Q m Q)-matrices with entries taken from K; thus, following the usual matrix notations, for every m 0, σ Σ (m), and q 1,...,q m,q Q we write μ m (σ) q1...q m,q to denote the entry in the matrix μ m (σ) at row (q 1,...,q m ) and at column q.) In this paper we will associate the run semantics with a wta as defined, e.g., in [19]. (We note that the run semantics is equivalent to the initial algebra semantics, cf. [6, Lemma ].) Let t T Σ and r : pos(t) Q be a run of M on t; also let w pos(t). The weight wt M (t,r,w)of r on t at w is defined as follows: if t(w) = σ Σ (m) for some m 0, then wt M (t,r,w)= μ m (σ) r(w.1)...r(w.m),r(w). The weight of r on t is defined by wt M (t, r) = wt M (t,r,w) w pos(t) (recall that K is a commutative semiring). We note that here we associate with every run a weight and need not define the concept of valid runs; so to speak, a run on t is valid or makes sense, if all values wt M (t,r,w)(w pos(t)) are non-zero. Note that wt M (t, r) = 0 can also arise due to zero-divisors in K. The tree series accepted by M, denoted by S M K T Σ, is the tree series defined, for every t T Σ,by (S M,t)= wt M (t, r) γ(r(ε)). r R M (t)

5 232 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Fig. 1. Example of an input tree with its zig-zag path and the sets X and Y of nodes. A tree series S K T Σ is called recognizable if there is a wta M over K such that S = S M. The class of all recognizable tree series is denoted by K rec T Σ. Clearly, supp(b rec T Σ ) is the class of recognizable tree languages. Example 3.2 (length of the zig-zag path). Let Σ ={σ (2), α (0) } be a ranked alphabet. For every t T Σ, the zig-zag path of t is the unique path of t which starts at its root and alternatingly moves down to the first or second successor of the current node, until a leaf is reached. For instance, the zig-zag path of t = σ(σ(α, σ(α, α)), α) contains four nodes which are labeled by σ, σ, σ, and α, respectively (cf. Fig. 1 ignoring the sets X and Y at the time being). Thus, we can define the tree series zigzag N T Σ over the natural number semiring such that for every t T Σ, the value (zigzag,t)is the number of nodes (or positions) on the zig-zag path of t. Next we describe a wta M = (Q, Σ, μ, γ) over N such that S M = zigzag. Let t be an arbitrary input tree. The idea of processing t is as follows. M can read every input subtree in the blind state d thereby producing weight 1. At every node v, M can start to check, whether v lies on the zig-zag path of t or not (check for membership on the zig-zag path); this is done by using two states 1 and 2; the state 2 has final weight γ(2) = 1, all the other states have final weight 0. Formally, we define the wta M = (Q, Σ, μ, γ) over the semiring of natural numbers as follows: Q ={1, 2,d}, γ(2) = 1 and γ(1) = γ(d) = 0, blind acceptance: μ 0 (α) ε,d = μ 2 (σ) dd,d = 1, switching from blind acceptance to checking: μ 2 (σ) dd,1 = μ 2 (σ) dd,2 = 1 check for membership on the zig-zag path: μ 0 (α) ε,2 = μ 0 (α) ε,1 = μ 2 (σ) 1d,2 = μ 2 (σ) d2,1 = 1, for every other combination q 1,q 2,q 3 Q we define μ 2 (σ) q1 q 2,q 3 = 0. Clearly, we only have to take into consideration those runs on an input tree t which end up at the root in state 2 (because for every other run r we have wt M (t, r) γ(r(ε)) = 0). Intuitively, it is clear that there are as many such runs on t as the zig-zag path has positions; every such run has weight 1; this sums up to (zigzag,t). Next we turn to basic properties of recognizable tree series. Lemma 3.3. Let K be a semiring. (1) Let L T Σ be a recognizable tree language. Then 1 L K T Σ is recognizable.

6 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) (2) For every k K, the constant tree series k K T Σ which maps every tree to k, is recognizable. (3) Let K be commutative and S,T K T Σ be recognizable. Then S + T and S T are recognizable. Proof. (1) Let L T Σ be accepted by the deterministic bottom-up finite state tree automaton M = (Q, Σ, δ,f). Then construct the wta M K = (Q, Σ, μ, γ) over K as follows: for every m 0, σ Σ (m), and q,q 1,...,q m Q, let μ m (σ) q1...q m,q = 1ifq = δ m (q 1,...,q m ), and μ m (σ) q1...q m,q = 0 otherwise, and for every q Q, let γ(q) = 1if q F and γ(q) = 0 otherwise. Clearly, S MK = 1 L(M) = 1 L. (2) Consider the wta M = (Q, Σ, μ, γ) where Q ={q}, for every m 0 and σ Σ (m), define μ m (σ) q m,q = 1 where γ(q) = k. Clearly, S M = k. (3) Let S,T K T Σ be accepted by wta M 1 and M 2, respectively. We can assume that the sets of states of M 1 and M 2 are disjoint. Then we can construct in the well-known way (by taking the union of M 1 and M 2 ) a wta M such that S M = S + T (cf. e.g., [19, Lemma 6.4]). The claim for S T has been proved in [5, Corollary 3.9] (also cf. [2, Proposition 5.1]). As an immediate consequence of Lemma 3.3, every recognizable step function is a recognizable series. Finally, we recall that the class of recognizable tree series is closed under relabelings. For this, let Σ and Δ be two ranked alphabets and τ : Σ P(Δ) be a mapping such that τ(σ) Δ (m) for every m 0 and σ Σ (m). This mapping is extended to a mapping τ : T Σ P(T Δ ) by defining inductively τ (σ(s 1,...,s m )) ={δ(t 1,...,t m ) δ τ(σ), t 1 τ (s 1 ),...,t m τ (s m )} for every m 0, σ Σ (m), and s 1,...,s m T Σ. Note that every such mapping τ is a relabeling (in the sense of [21, Definition 3.1]); that is, it can be computed by a one-state, linear, and nondeleting bottom-up or top-down tree transducer. Also note that the set {s t τ (s)}) is finite for every t T Δ. We will denote τ also by τ. Next we extend τ to a mapping τ : K T Σ K T Δ by defining (τ(s), t) = s T Σ,t τ(s) (S, s) for every S K T Σ and t T Δ. In the sequel we call mappings like τ relabelings. We note that relabelings can be computed by particular linear nondeleting tree transducers in the sense of [30]. There the closure of the class of recognizable tree series under such transducers is proved, cf. [30, Corollary 14]; however, throughout that paper it is assumed that semirings are commutative and continuous. Since we want to prove our main results for commutative semirings which are not necessarily continuous, we give a direct construction for this closure property. Lemma 3.4. Let S K T Σ and τ : K T Σ K T Δ be a relabeling. If S is recognizable, then τ(s) is recognizable. Proof. Let M = (Q, Σ, μ, γ) be a wta over K and τ : Σ P(Δ) such that τ(σ) Δ (m) for every σ Σ (m). Construct the wta M = (Q, Δ, μ, γ) over K where μ m (δ) q 1...q m,q = σ Σ,δ τ(σ) μ m(σ) q1...q m,q for every m 0, δ Δ (m), and q 1,...,q m,q Q. First we note the following auxiliary statement: for every t T Δ and r R M (t) the equation wt M (t, r ) = wt M (s, r ) (1) s T Σ,t τ(s) holds. Note that for every s T Σ with t τ(s) we have pos(s) = pos(t) and thus also R M (s) = R M (t). The proof of Eq. (1) is straightforward and thus left to the reader. Then we can compute as follows: (S M,t)= r R M (t) wt M (t, r ) γ(r (ε)) (1) = r R M (t) s T Σ,t τ(s) wt M(s, r ) γ(r (ε)) = s T Σ,t τ(s) r R M (t) wt M(s, r ) γ(r (ε)) = s T Σ,t τ(s) (S M,s)= (τ(s M ), t). 4. Weighted MSO-logic on trees Here we will define the weighted MSO-logic on trees. This is a generalization of the weighted MSO-logic (on strings) as given in [18]. On the other hand, it generalizes (unweighted) MSO-logic on trees in the same way as weighted MSO-logic generalizes (unweighted) MSO-logic on strings. We will also provide basic properties of our weighted MSO-logic. In this section we will always assume that the underlying semiring (K, +,, 0, 1) is commutative. Moreover, we assume that Σ is a ranked alphabet.

7 234 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Definition 4.1. The set MSO(K, Σ) of all formulas of weighted MSO-logic over K and Σ on trees (for short: weighted MSO-logic) is defined to be the smallest set F such that (1) F contains all the atomic formulas k, label σ (x), edge i (x, y), and x X and the negations label σ (x), edge i (x, y), and (x X), and (2) if φ, ψ F, then also φ ψ, φ ψ, x.φ, X.φ, x.φ, X.φ F, where k K, σ Σ, x,y are first order variables, 1 i max(rk Σ (Σ)), and X is a second order variable. Clearly, if we drop formulas of the form k from MSO(K, Σ), then we obtain MSO (Σ). That is, MSO (Σ) MSO(K, Σ). Definition 4.2. Let φ MSO(K, Σ) and V be a finite set of variables containing Free(φ). The semantics of φ is the formal tree series φ V K T ΣV defined as follows: if s T ΣV is not valid, then we put ( φ V,s)= 0. Otherwise, we define ( φ V,s) K inductively as follows where (t, ρ) corresponds to s. ( k V,s) = k, { 1 ift(ρ(x)) = σ, ( label σ (x) V,s) = 0 otherwise, { 1 ifρ(y) = ρ(x).i, ( edge i (x, y) V,s) = 0 otherwise, { 1 if ρ(x) ρ(x), ( x X V,s) = 0 otherwise, { 1 if ( φ V,s)= 0, ( φ V,s) = 0 if ( φ V,s)= 1 if φ is of the form label σ (x), edge i (x, y), or x X, ( φ ψ V,s) = ( φ V,s)+ ( ψ V,s), ( φ ψ V,s) = ( φ V,s) ( ψ V,s), ( x.φ V,s) = ( φ V {x},s[x w]), ( X.φ V,s) = ( x.φ V,s) = ( X.φ V,s) = w pos(s) I pos(s) w pos(s) I pos(s) ( φ V {X},s[X I]), ( φ V {x},s[x w]), ( φ V {X},s[X I]). We write φ rather than φ Free(φ). Note that if φ is a sentence, then φ K T Σ. Also note that the unweighted case is obtained by considering the Boolean semiring B: in fact, if we view an (unweighted) formula φ in MSO (Σ) as a formula in MSO(B, Σ), and calculate φ B T Σ, then the disjunction and the conjuction occurring in φ are interpreted (as usual) by infimum and supremum, respectively; so, in particular, both distributivity laws hold. In general, for arbitrary commutative semirings, only conjunction distributes over disjunction. In the weighted case we will also work with formulas from MSO (Σ) and, in particular, with the quantifier-free fragment of MSO (Σ), denoted by qf-mso (Σ); this is the set of all formulas in MSO (Σ) which do not contain any quantifier. For such formulas, it will be necessary to disambiguate disjunctions. For this purpose, we define the syntactic transformations (.) + and (.) on qf-mso (Σ) by simultaneous induction as follows: for every φ, ψ qf- MSO (Σ), (1) if φ is atomic or the negation of an atomic formula, then we define φ + = φ and φ = φ with the convention that ψ is ψ,

8 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) (2) (φ ψ) + = φ + (φ ψ + ) and (φ ψ) = φ ψ, and (3) (φ ψ) = φ (φ + ψ ) and (φ ψ) + = φ + ψ +. Clearly, L V (φ + ) = L V (φ) and L V (φ ) = TΣ v V \ L V (φ). While specifying a particular tree series by means of a weighted MSO-formula it is often helpful to use the implication symbol as a macro (as in the unweighted case). However, in the weighted case, the macro has to be defined more carefully, because negation is only available on atomic formulas. Also we want to disambiguate disjunctions. Formally, let φ qf-mso (Σ) and ψ MSO(K, Σ). Then we define φ ψ as a shorthand for the formula φ (φ + ψ). If φ, ψ qf-mso (Σ), let φ ψ abbreviate (φ ψ) (ψ φ). We can now show that the formal power series semantics of such disambiguous formulas only take 0 and 1 as values. Observation 4.3. Let φ qf-mso (Σ) and V be a finite set of variables containing Free(φ). Then φ + V = 1 LV (φ) and φ V = 1 LV ( φ). In particular, φ + V and φ V are recognizable. Proof. Straightforward induction on the structure of φ. Next we show that universal first order quantification preserves characteristic tree series. Observation 4.4. Let φ MSO (Σ) and V = Free(φ) {x}. If φ V = 1 LV (φ), then x.φ = 1 L( x.φ). Proof. Let s = (t, ρ) T ΣFree( x.φ). Clearly, ( x.φ,s) {0, 1}. In fact, ( x.φ,s)= 1iff w pos(s) : ( φ Free(φ) {x},s[x w]) = 1 iff w pos(s) : s[x w] L Free(φ) {x} (φ) iff s L( x.φ). Examples for sentences in this weighted logic for words have been given in [18]. Here we give two further examples for our setting of trees. Example 4.5 (number of leaves). Let Σ ={σ (2), α (0), β (0) } be a ranked alphabet and K be an arbitrary semiring. Consider the formula φ = x.label α (x) in MSO(K, Σ). For every tree t, then ( x.labelα (x),t ) = ( label α (x) {x},t[x w]) w pos(t) = {w pos(t) t(w) = α}, the number (in K) ofα-leaves of t. For instance, if K = N, the semiring of natural numbers, this is the actual number; if K = Z/3Z, this is the actual number modulo 3; if K = B, this is 1 if there is an α-leaf in t, and 0 otherwise. Example 4.6 (length of the zig-zag path). Consider the formal tree series zigzag of Example 3.2 which associates to every tree the number of the positions on its zig-zag path. Here we will show that zigzag is MSO(N, Σ)-definable. Consider the following formula in MSO(N, Σ) (cf. Fig. 1 for the input tree σ(σ(α, σ(α, α)), α), the zig-zag path indicated as double line, and the sets X and Y of nodes): φ = X. Y.(root X \ Y) (edge 1 (X) = Y) (edge 2 (Y ) = X) count(x, Y ), where the four macros are defined as follows: (root X \ Y) = z.root(z) (z X) (z Y), root(z) = z. edge 1 (z,z) edge 2 (z,z), (edge 1 (X) = Y) = x. y.edge 1 (x, y) ( (y X) (x X y Y) ), (edge 2 (Y ) = X) = x. y. edge 2 (y, x) ( (x Y) (y Y x X) ), count(x, Y ) = z.(z X) (z Y).

9 236 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Since the root of a tree is unique, we obtain that (root X \ Y) = 1 L for L = {(t, ρ) T Σ{X,Y } ε ρ(x) \ ρ(y )}. Since the predecessor of a node is uniquely determined, by Observation 4.4 the series (edge 1 (X) = Y) and (edge 2 (Y ) = X are recognizable step functions with values in {0, 1}. Also, for every s = (t, ρ) T Σ{X,Y }, the following two statements are equivalent: (1) ( (root X \ Y) (edge 1 (X) = Y) (edge 2 (Y ) = X),s)= 1, (2) ρ(x) ρ(y ) is exactly the set of nodes of the zig-zag path through the root of s, the root of s is in ρ(x) \ ρ(y ), for every w pos(s) ρ(y ), the predecessor of w is in ρ(x) \ ρ(y ), and for every w (pos(s) ρ(x)) \{ε}, the predecessor of w is in ρ(y ) \ ρ(x). Then φ N T Σ is the tree series such that, for every tree t T Σ, the number ( φ,t)is the length of the zig-zag path through t. For instance, ( φ, σ(σ(α, σ(α, α)), α)) = 4. Here, N can also be replaced by an arbitrary commutative semiring, and similar remarks as at the end of Example 4.5 apply. Recall that we have defined the semantics φ V for any finite set of variables V containing Free(φ). Now we show that these semantics are consistent with each other. Lemma 4.7. Let φ MSO(K, Σ) and V a finite set of variables containing Free(φ). Then, for every (t, ρ) T v Σ V, ( φ V,(t,ρ)) = ( φ,(t,ρ Free(φ) )). Moreover, φ is recognizable iff φ V is recognizable. Proof. The first statement can be proved analogously to [18, Proposition 3.3]. For the final claim consider the mapping π : Σ V Σ φ such that π(s) = (t, ρ Free(φ) ) for every s = (t, ρ) T ΣV. We first assume that φ is recognizable. We define the relabeling in the sense of Section 3 which is induced by π 1 : Σ φ P(Σ V ). Then φ V = π 1 ( φ ) 1 T v ΣV. Thus, by Lemma 3.4, also π 1 ( φ ) is recognizable. Since TΣ v V is a recognizable tree language, it follows from Lemma 3.3 that φ V is recognizable. Conversely, let φ V be recognizable. Let F TΣ v V be the set of those trees s = (t, ρ) such that ρ(x) = ε (resp. ρ(x) ={ε}) for every variable x (resp. X) inv \ Free(φ). Then F is a recognizable tree language and for every (t, ρ ) TΣ v φ there is a unique (t, ρ) F such that π((t, ρ)) = (t, ρ ). Then φ = π( φ V 1 F ) and by Lemmata 3.3 and 3.4 we have that φ is recognizable. Now let Z MSO(K, Σ). We will call a tree series S : T Σ KZ-definable if there is a sentence φ Z such that S = φ. It has been shown in [18] that there are MSO(Σ,K)-definable series which are not recognizable. Consider e.g. the formula φ = x. y.2 over the semiring N of natural numbers and a monadic ranked alphabet Σ ={δ (1), α (0) } (cf. [18, Example 3.4]). Then, for every t = δ n (α), ( φ,t) = 2 (n+1)2. However, these values cannot be reached by any wta. Thus, we look for a careful restriction of MSO(Σ,K)by means of which the class K rec T Σ is characterised. We follow the lines of [18]. Definition 4.8. A formula φ MSO(K, Σ) is restricted, if it does not contain a universal set quantification of the form X.ψ, and whenever φ contains a universal first order quantification of the form x.ψ, then ψ is a recognizable step function. The set of all restricted formulas of MSO(K, Σ) is denoted by RMSO(K, Σ). The set of all restricted existential formulas of MSO(K, Σ), denoted by REMSO(K, Σ), is the set of all restricted formulas of MSO(K, Σ) of the form φ = X 1,...,X n.ψ with ψ containing no set quantification. Observe that in contrast, in RMSO(K, Σ)-formulas existential set quantifiers might occur also in the interior of the formula, possibly after a universal first order quantifier. The set of all tree series S K T Σ which are definable by some sentence in RMSO(K, Σ) (resp. in REMSO(K, Σ)) is denoted by K rmso T Σ (resp. K remso T Σ ). An example of a formula in REMSO(K, Σ) is φ of Example 4.6. Only a very special case of the following lemma will be needed later on. We include a general statement due to the independent importance of implications.

10 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Lemma 4.9. Let φ qf-mso (Σ), let ψ MSO(K, Σ), and let V be a finite set of variables containing Free(φ) Free(ψ). Then φ ψ V = φ V + φ + V ψ V. Moreover, if ψ is a recognizable step function (resp., recognizable), then so is φ ψ. Proof. The equation claimed is immediate from the definition of the macro φ ψ. Since the intersection of two recognizable tree languages is again recognizable, it easily follows that the class of recognizable step functions is closed under the Hadamard product. This, Lemma 4.7, and Observation 4.3 imply the claim for φ ψ if ψ is a recognizable step function. If ψ is just recognizable, apply Lemma 4.7, Observation 4.3 and Lemma The main result The main result of this paper shows the coincidence of recognizability, RMSO-, and REMSO-definability of tree series. Theorem 5.1. Let Σ be a ranked alphabet and K any commutative semiring. Then K rec T Σ = K rmso T Σ = K remso T Σ. This result generalizes the corresponding result of [18] for series on words to series on trees; we obtain the word result from Theorem 5.1 by considering monadic ranked alphabets Σ. Theorem 5.1 will be proved in Sections 5.1 and 5.2. Throughout, we assume that K is a commutative semiring Definable tree series are recognizable As in the unweighted case, we prove this implication by induction on the structure of the formula. We start with atomic formulas. Lemma 5.2. Let φ MSO(K, Σ) be atomic or the negation of an atomic formula. Then φ is recognizable. Proof. If φ = k where k K, we apply Lemma 3.3. Now let φ be of the form label σ (x) or (edge i (x, y)) or (x X) or a negation of these formulas. Then φ qf-mso (Σ),soL(φ) is a recognizable tree language. Hence φ = 1 L(φ) is recognizable. Now we turn to disjunction and conjunction. Lemma 5.3. Let φ, ψ MSO(K, Σ) such that φ and ψ are recognizable tree series. Then φ ψ and φ ψ are recognizable. Proof. Let V = Free(φ) Free(ψ). By Definition 4.2, φ ψ = φ V + ψ V and φ ψ = φ V ψ V which are recognizable due to Lemmas 3.3 and 4.7. Next we prove that tree series defined by formulas of the form x.φ or X.φ are recognizable. Lemma 5.4. Let φ MSO(K, Σ) such that φ is recognizable. Then x.φ and X.φ are recognizable. Proof. X.φ : let V = Free( X.φ); note that X/ V. Consider the relabeling π : T ΣV {X} T ΣV defined by erasing the X-row, i.e., π(t, ρ) = (t, ρ V ). Let s T ΣV. We note that s is valid iff s[x I] is valid for every I pos(s). Hence, by definition of X.φ and of relabeling, we have for every s T ΣV : ( X.φ,s) = ( φ V {X},s[X I]) I pos(s) = ( φ V {X},t) t π 1 (s) = (π( φ V {X} ), s).

11 238 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Thus, X.φ = π( φ V {X} ). Since Free(φ) V {X} and φ is recognizable, by Lemma 4.7 also φ V {X} is recognizable. Hence by Lemma 3.4, also X.φ is recognizable. x.φ : Let V = Free( x.φ); note that x / V. Consider the relabeling π : T ΣV {x} T ΣV which is defined by erasing the x-row, as above. Let s T ΣV. We note that s is valid iff s[x w] is valid for every w pos(s). Then we have for every s T ΣV : ( x.φ,s)= ( φ V {x},s[x w]) w pos(s) = (1) ( φ V {x},t) t π 1 (s) tis valid = (2) t π 1 (s) ( φ V {x},t) = (π( φ V {x} ), s). At (1) observe that, if s is valid, there is a bijection between the index sets pos(s) and TΣ v V {x} π 1 (s); ifs is not valid, then the set TΣ v V {x} π 1 (s) is empty. For (2), note that ( φ V {x},t)= 0 for every non-valid t. Now we proceed as in the previous case and obtain that x.φ is recognizable. In the next lemma we prove that tree series definable by formulas of the form x.φ are recognizable if φ is a recognizable step function. The idea of the construction of the wta is the same as in [18, Lemma 4.4]. However, here we also have to synchronize variables in different subtrees (a more detailed explanation is given inside the proof); this problem does not arise in the case of words. Lemma 5.5. Let φ MSO(K, Σ) such that φ is a recognizable step function. Then x.φ is recognizable. Proof. Let W = Free(φ) and V = Free( x.φ) = W \{x}. By assumption, φ = n j=1 k j 1 Lj for some n 1, k j K, and recognizable tree languages L 1,...,L n T ΣW. By Lemma 3.1 we can assume that the sets L 1,...,L n form a partition of T ΣW. First we assume that x W. Let Σ = Σ {1,...,n} be the ranked alphabet with rank function rk((σ,j))= rk Σ (σ) for every (σ,j) Σ. A tree s T Σ V corresponds to the tuple (s, ν) where s T ΣV is obtained from s by dropping the second component from the label of every node, and ν : pos(s) {1,...,n} is defined by ν(w) = j if s(w) = (σ,j,f) for some σ Σ and f {0, 1} V. Vice versa, every such tuple (s, ν) corresponds to a tree s T Σ V. Hence we can assume that elements of T Σ V have the form (s, ν). Then let L ={(s, ν) T Σ V w pos(s ), 1 j n : if ν(w) = j, then s [x w] L j }. Note that for every s T ΣV there is a unique ν such that (s, ν) L, because the L j s form a partition of T ΣW. Next we prove that L is a recognizable tree language. In fact, L = 1 j n L j where L j ={(s, ν) T Σ V w pos(s ) : if ν(w) = j, then s [x w] L j }. We prove that L j is recognizable. Let M j = (Q, Σ W, δ,f)be a deterministic bottom-up finite state tree automaton such that L(M j ) = L j. We will construct the deterministic bottom-up finite state tree automaton M j = ( Q, Σ V, δ, F) which recognizes L j. The main idea in this construction is taken from the corresponding result of [18] and it is roughly described as follows. On an input tree s = (s, ν), the automaton M j simulates the work of M j on s and, whenever a position w of s is encountered for which ν(w) = j holds, then, additionally, M j splits off a copy of M j ; this copy behaves as if at w the x would occur. However, here we have to refine this idea a bit, because we have to guarantee that the placement of x is done at most once in s. For this, we maintain a bit b in every state of M j which indicates whether the x was placed (b = 1) or not (b = 0). Then, while traversing with M j over the input tree s, we only form the possible transitions on a k-ary symbol (σ,l,f)from those states of the successors for which the sum of their bits is not greater than 1.

12 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Formally, we construct M j = ( Q, Σ V, δ, F) by setting Q = P(Q {0, 1}) and F = {U Q {0, 1} U (Q {1}) F {1}}, and δ ={ δ (σ,l,f ) } (σ,l,f ) Σ V is defined for every (σ,l,f) Σ (m) V, m 0, and P 1,...,P m Q by where δ(σ,l,f ) (P 1,...,P m ) = P, P = { P if l = j, P P if l = j. and and P = {( δ (σ,f [x 0]) (p 1,...,p m ), m b i ) (p i,b i ) P i for every1 i m and m } b i 1 P = {( δ (σ,f [x 1]) (p 1,...,p m ), 1 ) (p i, 0) P i for every 1 i m}. Roughly speaking, P formalizes the propagation of the bit value 0, if all successors of the current symbol (labeled by (σ,l,f)) have bit value 0, or of the bit value 1, if exactly one of the successors has bit value 1. If l = j, then additionally to this propagation, M j can change from the bit vector (0,...,0) to the bit value 1, thereby placing the x to this position and splitting off a new copy of M j. Now we will show that M j recognizes L j. Since M j and M j are deterministic, we have that for every (s, ν) T Σ V the sets RM v j (s [x w]) and R ṽ ((s, ν)) of M j runs are singletons. Recall that these runs are denoted by r s [x w] and r (s,ν), respectively. Then for every (s, ν) T Σ V we have that r (s,ν)(ε) = {( r s [x ](ε), 0 )} {(r s [x w](ε), 1) w pos(s ), ν(w) = j}, (2) where s [x ] T ΣW denotes the tree obtained from s T ΣV by replacing every label (σ,f) by (σ,f x ) and f x : V {x} {0, 1} extends f by setting f x (x) = 0. Eq. (2) can be proved by structural induction on s = (s, ν) as follows. Let s = (σ,l,f)(s 1,...,s m ) T Σ V with s = (s, ν) and s i = (s i, ν i) for every 1 i m. Moreover, let s = (σ, f )(s 1,...,s m ). We assume that Eq. (2) holds for s 1,...,s m (I.H.). Then we first prove the following equation: {( δ (σ,f [x 0]) (p 1,...,p m ), m ) b i (p i,b i ) r si (ε), m } b i 1 ={(r s [x ](ε), 0)} {(r s [x uw](ε), 1) 1 u m, w pos(s u ), ν u(w) = j}. (3) Proof of Eq. (3). {( δ (σ,f [x 0]) (p 1,...,p m ), m I.H.2 = ) b i for every 1 i m: (p i,b i ) r si (ε) and m {( δ (σ,f [x 0]) (p 1,...,p m ), m ) b i for every 1 i m : } b i 1, } b i 1, [(p i,b i ) = (r s i [x ](ε), 0) or (p i,b i ) = (r s i [x w](ε), 1), w pos(s i ), ν i(w) = j] and m {( )} = δ (σ,f [x 0]) (r s 1 [x ](ε),...,r s m [x ](ε)), 0 { (δ (σ,f [x 0]) (r s 1 [x ](ε),...,r s u [x w](ε),...,r s m [x ](ε)), 1) 1 u m, w pos(s u ), ν u(w) = j = {( r s [x ](ε), 0 )} {( r s [x uw](ε), 1 ) 1 u m, w pos(s u ), ν u(w) = j }. },

13 240 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) This finishes the proof of Eq. (3). Now let l = j. Then r s (ε) = δ (σ,l,f ) (r s (1),...,r s (m)) = δ (σ,l,f ) (r s1 (ε),...,r sm (ε)) {( = δ (σ,f [x 0]) (p 1,...,p m ), m ) b i (p i,b i ) r si (ε), m Now let l = j. Then } b i 1 = {( r s [x ](ε), 0 )} {( r s [x uw](ε), 1 ) 1 u m, w pos(s u ), ν u(w) = j } (by Eq. (3)) = {( r s [x ](ε), 0 )} {( r s [x w](ε), 1 ) w pos(s ), ν(w) = j }. r s (ε) = δ (σ,l,f ) (r s1 (ε),...,r sm (ε)) {( = δ (σ,f [x 0]) (p 1,...,p m ), m ) b i (p i,b i ) r si (ε), m {(δ (σ,f [x 1]) (r s 1 [x ](ε),...,r s m [x ](ε)), 1)} } b i 1 = {( r s [x ](ε), 0 )} {( r s [x uw](ε), 1 ) 1 u m, w pos(s u ), ν u(w) = j } {(r s [x ε](ε), 1)} (by Eq.(3)and definition of run) = {( r s [x ](ε), 0 )} {( r s [x w](ε), 1 ) w pos(s ), ν(w) = j }. This finishes the proof of Eq. (2). Also, by the assumption that L(M j ) = L j, for every w pos(s ),wehave s [x w] L j iff r s [x w](ε) F. It follows that (s, ν) L j iff (for every w pos(s ): ν(w) = j implies r s [x w](ε) F )iff r (s,ν)(ε) F iff (s, ν) L( M j ) where we use Eq. (2) at the equivalence, which is indicated by the. Hence L j is recognizable by M j. Thus, there is a bottom-up finite state tree automaton M = ( Q, Σ V, δ, F)such that L( M) = L. We can assume that M is deterministic. Finally, we construct the wta M = ( Q, Σ V, μ, γ) by defining, for every m 0, (σ,l,f) Σ V, and q 1,...,q m,q Q, { kl if μ m ((σ,l,f)) q1...q m,q = δ (σ,l,f ) (q 1,...,q m ) = q, 0 if otherwise. Moreover, for every q Q, we define γ(q) = 1ifq F and 0 otherwise. Clearly, also M is deterministic. Thus, it should be clear that for every (s, ν) T Σ V (note that K is commutative) { (S M,(s (j), ν)) = 1 j n k ν 1 j if (s, ν) L, 0 if otherwise. Now we define the relabeling τ : K T Σ V K T ΣV by τ((σ, ν,f)) = (σ,f)for every (σ, ν,f) Σ V. Then for every s T ΣV : (τ(s M ), s ) = (S M,(s, θ)) (s,θ) τ 1 (s ) = (S M,(s, ν)) where ν : pos(s ) {1,...,n} is the unique mapping such that (s, ν) L = k ν 1 (j) j 1 j n = ( φ,s [x w]) due to the fact that φ is a recognizable step function w pos(s ) = ( x.φ,s ). Hence τ(s M ) = x.φ and thus, by Lemma 3.4 x.φ is recognizable. Now assume that x/ W, and thus V = W. Then we consider the formula φ = φ edge 1 (x, x). By Lemmas 5.2 and 5.3 we have that φ is recognizable, in particular, φ is a recognizable step function, and by an easy calculation,

14 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) we obtain that φ V {x} = φ V {x}. Thus, x.φ V = x.φ V which is recognizable by what we have shown above. Then the next theorem follows from Lemmata 5.2, 5.3, 5.4, and 5.5. Theorem 5.6. K rmso T Σ K rec T Σ. Next we turn to effectiveness and decidability questions and show results for a particular class of semirings, viz. computable fields. We will need the following preparation. Proposition 5.7 (Seidl [36, Theorem 4.2], also cf. Bozapalidis [10]). Let K be a computable field. It is decidable for two effectively given weighted bottom-up finite state tree automata M and M, whether S M = S M or not. Using this, we can show: Corollary 5.8. Let K be a computable field. There is an effective procedure which produces, for a given restricted MSO(K, Σ)-formula φ, a weighted bottom-up finite state tree automaton M such that φ = S M. Proof. By induction on the structure of φ. For this, we have to show that all our preceding proofs are constructive. This is mostly well known or easy, and it remains to consider the proof of Lemma 5.5. So let φ be a recognizable step function. We may assume that φ = S M for some given wta M, and we have to construct a wta which accepts the tree series x.φ. We list all tuples (k 1,...,k n,m 1,...,M n ) such that n 1, k 1,...,k n K and M 1,...,M n are deterministic bottom-up finite state tree automata. For each such tuple, we construct a wta M such that S M = 1 j n k j 1 L(Mj ), and we use Proposition 5.7 to check whether S M = S M. Since S M is a recognizable step function, working through our list we will eventually obtain a tuple for which this equality holds. Now we can use the values k j and automata M j of this tuple in our proof of Lemma 5.5 to construct the required weighted automaton for x.φ. The result of Corollary 5.8 also holds for other semirings K than fields, see Section 6. However, whether it holds for all commutative semirings remains open at present. As an immediate consequence of Corollary 5.8 and Proposition 5.7 we obtain: Corollary 5.9. Let K be a computable field, and let φ and φ be two RMSO(K, Σ)-sentences. Then it is decidable whether φ = φ Recognizable tree series are definable Here, let K again denote an arbitrary commutative semiring. In this section we show that recognizable tree series are REMSO-definable. That is, given a wta M, we will explicitly present a formula ξ of weighted REMSO-logic such that S M = ξ. As in the proof of the weighted case for strings [18], ξ can be chosen to have the form X 1... X n.φ where every second order variable X i corresponds to a transition of M and identifies those nodes of a tree t at which M applies this transition. The subformula φ represents a particular run of M, i.e., it (1) guarantees that the sets of nodes which are identified by X 1,...,X n, form a partitioning of the set of all nodes of t, and that the transitions of neighbored nodes match (cf. the subformula ψ M,ν given below), (2) computes the weight of the run, and (3) computes the weight for leaving M at the root of t. We prepare this theorem by defining some formulas and notions which are relevant for the description of runs of a wta by means of weighted logic. Definition Let M = (Q, Σ, μ, γ) be a wta. Let X 1,...,X n be set variables. The partition formula associated with X 1,...,X n is the formula partition MSO (Σ) defined as follows: partition = x. (x X i ) (x X j ). 1 i n 1 j n j =i

15 242 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) The set of all transitions at Σ-symbols is the set B M = {( q,σ,q) m 0, q Q m, σ Σ (m),q Q}. An enumeration of the set B M is a bijection ν : B M {1,...,n} where n = B M ; in the sequel we will abbreviate X ν(( q,σ,q)) by X q,σ,q. Let ν be an enumeration of B M. The run-formula associated with M and ν is the formula ψ M,ν MSO (Σ) with free variables X 1,...,X n defined as follows: ψ M,ν = partition ψ M,ν,1 ψ M,ν,2, where ψ M,ν,1 = ψ M,ν,2 = ( q,σ,q) B M x. ( q,σ,q) B M, q=(q 1,...,qm) ( ) (x X q,σ,q ) label σ (x), x. (x X q,σ,q) y 1... y m. edge(x, y 1...y m ) ( p 1,σ 1,q 1 ) B M,... ( p m,σ m,q m ) B M + (y 1 X p1,σ 1,q 1 ) (y m X pm,σ m,q m ), edge(x, y 1...y m ) = edge 1 (x, y 1 )... edge m (x, y m ). Let us make some observations on the formulas in Definition These formulas do not contain any set quantification and whenever there is a subformula of the form x.ψ, then ψ is a recognizable step function. Thus, the formula ψ M,ν is in RMSO(K, Σ). Moreover, by Observation 4.4 we have that ψ M,ν V = 1 LV (ψ M,ν ). Theorem K rec T Σ K remso T Σ. Proof. Let M = (Q, Σ, μ, γ) be a wta, ν : B M {1,...,n} be an enumeration of the set B M, and V ={X 1,...,X n }. We put ψ = ψ M,ν. Let t T Σ. First we show that there is a bijection between the set R M (t) of all runs of M on t and the set Ass t,m ={ρ ρ is a (V,t)-assignment,(t,ρ) ψ} of all (V,t)-assignments which satisfy ψ. For this, let r: pos(t) Q be a run of M on t. We define the (V,t)- assignment ρ r : V P(pos(t)) as follows: For every 1 i n, ifi = ν(((q 1,...,q m ), σ,q)), then define ρ r (X i ) = {w pos(t) r(w.1) = q 1,...,r(w.m) = q m, t(w) = σ, r(w) = q}. It is obvious that (t, ρ r ) ψ. Conversely, let ρ be a (V,t)-assignment such that (t, ρ) ψ. Then define the run r ρ : pos(t) Q as follows: for every w pos(t), due to the fact that in particular (t, ρ) partition, there are uniquely determined m 0, q Q m, σ Σ (m), and q Q such that w ρ(x q,σ,q ), and we put r ρ (w) = q. Since (t, ρ) ψ, it follows that r ρ is a run on t. Now consider the following formula of weighted MSO-logic: φ = ψ ( q,σ,q) B M x. ( ) ) ((x X q,σ,q ) μ m (σ) q,q z. root(z) (z X q,σ,q ) γ(q), ( q,σ,q) B M where root(z) = x. ( edge 1 (x, z) edge maxσ (x, z) ). Clearly, for every t T Σ there is exactly one w pos(t) such that (t, [z w]) root(z), namely w = ε. By Lemma 4.9, φ is restricted.

16 M. Droste, H. Vogler / Theoretical Computer Science 366 (2006) Let t T Σ and r : pos(t) Q be a run of M on t. By the discussion above there is a uniquely determined (V,t)-assignment ρ r such that (t, ρ r ) ψ. Then we can calculate as follows: ( ) φ V (t, ρ r ) = μ m (σ) ρ r (X q,σ,q) q,q γ(r(ε)) ( q,σ,q) B M (since K is commutative, we can now permute the occurrences of values μ m (σ) q,q ) ( ) = μ m (t(w)) r(w.1)...r(w.m),r(w) γ(r(ε)) w pos(t) (where m = rk Σ (t(w))) ( ) = wt M (t,r,w) γ(r(ε)) w pos(t) = wt M (t, r) γ(r(ε)). Now let ξ = X 1... X n.φ. Then ξ REMSO(K, Σ). We show that S M = ξ. Let t T Σ and put V = {X 1,...,X n }. Then ξ (t) = φ (t, ρ) ρ is a (V,t)-assignm. = φ (t, ρ) = φ (t, ρ r ) ρ is a (V,t)-assignm. r R M (t) (t,ρ) ψ = wt M (t, r) γ(r(ε)) = (S M,t). r R M (t) where the equation marked by is due to the bijection between runs and assignments shown above. Theorems 5.6 and 5.11 imply the main result, Theorem 5.1. Let us extend the syntax of our weighted logic by adding an atomic formula root(z) which holds for (t, ρ) iff ρ(z) = ε, the root of t. That is ( root(z),(t,ρ) ) = { 1 ifρ(z) = ε, 0 otherwise. Then an easy analysis of the proof of Theorem 5.11 shows that we can restrict ourselves to just one application of the universal first order quantifier. Corollary Let S K rec T Σ. Then S = ξ for a formula ξ of the form ξ = X 1... X n. x.θ where θ contains the formula root(z) and only first order existential quantifications, and θ is a recognizable step function. 6. Locally finite semirings As noted before, easy examples show that there are MSO(K, Σ)-definable series which are not recognizable (compare [18]). In this section, we wish to show that for a large class of semirings K, all MSO(K, Σ)-definable tree series are recognizable. Again let Σ denote an arbitrary ranked alphabet. If K is a semiring and A K, we denote by A the subsemiring of K generated by A. Clearly, we may construct A by first taking the closure A of A {0, 1} under multiplication, then A is the closure of A under addition. A semiring K is called locally finite, if each finitely generated subsemiring of K is finite. A monoid is called locally finite, if each finitely generated submonoid is finite. Clearly, a semiring (K, +,, 0, 1) is locally finite iff both monoids (K, +, 0) and (K,, 1) are locally finite (apply the remark on A above, or cf. [17, Section 4] or [9, Lemma 2.5]). For example, any Boolean algebra (B,,, 0, 1) is locally finite. The max min semiring R max,min = (R + { }, max, min, 0, ) of positive reals, used for maximum capacity problems of networks, is locally finite. More generally, any distributive lattice (L,,, 0, 1) with smallest element 0 and largest element 1 is locally finite.

M. Droste and P. Gastin. Weighted automata and weighted logics

M. Droste and P. Gastin. Weighted automata and weighted logics M. Droste and P. Gastin Weighted automata and weighted logics Research Report LSV-05-13 July 2005 Weighted automata and weighted logics Manfred Droste 1 and Paul Gastin 2 1 Institut für Informatik, Universität

More information

Weighted automata and weighted logics

Weighted automata and weighted logics Weighted automata and weighted logics Manfred Droste 1 and Paul Gastin 2 1 Institut für Informatik, Universität Leipzig Augustusplatz 10-11, D-04109 Leipzig, Germany, droste@informatik.uni-leipzig.de 2

More information

A Logical Characterization for Weighted Event-Recording Automata

A Logical Characterization for Weighted Event-Recording Automata A Logical Characterization for Weighted Event-Recording Automata June 23, 2009 Karin Quaas Institut für Informatik, Universität Leipzig 04009 Leipzig, Germany quaas@informatik.uni-leipzig.de Abstract.

More information

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza Automata theory An algorithmic approach Lecture Notes Javier Esparza July 2 22 2 Chapter 9 Automata and Logic A regular expression can be seen as a set of instructions ( a recipe ) for generating the words

More information

Weighted Logics for Nested Words and Algebraic Formal Power Series

Weighted Logics for Nested Words and Algebraic Formal Power Series Weighted Logics for Nested Words and Algebraic Formal Power Series Christian Mathissen Institut für Informatik, Universität Leipzig D-04009 Leipzig, Germany mathissen@informatik.uni-leipzig.de Abstract.

More information

Compositions of Tree Series Transformations

Compositions of Tree Series Transformations Compositions of Tree Series Transformations Andreas Maletti a Technische Universität Dresden Fakultät Informatik D 01062 Dresden, Germany maletti@tcs.inf.tu-dresden.de December 03, 2004 1. Motivation 2.

More information

Characterizing CTL-like logics on finite trees

Characterizing CTL-like logics on finite trees Theoretical Computer Science 356 (2006) 136 152 www.elsevier.com/locate/tcs Characterizing CTL-like logics on finite trees Zoltán Ésik 1 Department of Computer Science, University of Szeged, Hungary Research

More information

Recognizable Tree Series with Discounting

Recognizable Tree Series with Discounting Acta Cybernetica 19 (2009) 411 439. Recognizable Tree Series with Discounting Eleni Mandrali and George Rahonis Abstract We consider weighted tree automata with discounting over commutative semirings.

More information

The Complexity of Computing the Behaviour of Lattice Automata on Infinite Trees

The Complexity of Computing the Behaviour of Lattice Automata on Infinite Trees The Complexity of Computing the Behaviour of Lattice Automata on Infinite Trees Karsten Lehmann a, Rafael Peñaloza b a Optimisation Research Group, NICTA Artificial Intelligence Group, Australian National

More information

Monitor Logics for Quantitative Monitor Automata

Monitor Logics for Quantitative Monitor Automata Monitor Logics for Quantitative Monitor Automata Erik Paul epaul at informatik.uni-leipzig.de November 2, 2018 1 Introduction In the last years, there has been increasing interest in quantitative features

More information

Finite and Algorithmic Model Theory II: Automata-Based Methods

Finite and Algorithmic Model Theory II: Automata-Based Methods Finite and Algorithmic Model Theory II: Automata-Based Methods Anuj Dawar University of Cambridge Computer Laboratory Simons Institute, 30 August 2016 Review We aim to develop tools for studying the expressive

More information

Hasse Diagrams for Classes of Deterministic Bottom-Up Tree-to-Tree-Series Transformations

Hasse Diagrams for Classes of Deterministic Bottom-Up Tree-to-Tree-Series Transformations Hasse Diagrams for Classes of Deterministic Bottom-Up Tree-to-Tree-Series Transformations Andreas Maletti 1 Technische Universität Dresden Fakultät Informatik D 01062 Dresden Germany Abstract The relationship

More information

Automata, Logic and Games: Theory and Application

Automata, Logic and Games: Theory and Application Automata, Logic and Games: Theory and Application 1. Büchi Automata and S1S Luke Ong University of Oxford TACL Summer School University of Salerno, 14-19 June 2015 Luke Ong Büchi Automata & S1S 14-19 June

More information

Lecture 2: Syntax. January 24, 2018

Lecture 2: Syntax. January 24, 2018 Lecture 2: Syntax January 24, 2018 We now review the basic definitions of first-order logic in more detail. Recall that a language consists of a collection of symbols {P i }, each of which has some specified

More information

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas. 1 Chapter 1 Propositional Logic Mathematical logic studies correct thinking, correct deductions of statements from other statements. Let us make it more precise. A fundamental property of a statement is

More information

Weighted Automata and Logics on Infinite Graphs

Weighted Automata and Logics on Infinite Graphs Weighted Automata and Logics on Infinite Graphs Stefan Dück Institute of Computer Science, Leipzig University, D-04109 Leipzig, Germany dueck@informatik.uni-leipzig.de Abstract. We show a Büchi-like connection

More information

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and

7 RC Simulates RA. Lemma: For every RA expression E(A 1... A k ) there exists a DRC formula F with F V (F ) = {A 1,..., A k } and 7 RC Simulates RA. We now show that DRC (and hence TRC) is at least as expressive as RA. That is, given an RA expression E that mentions at most C, there is an equivalent DRC expression E that mentions

More information

Löwenheim-Skolem Theorems, Countable Approximations, and L ω. David W. Kueker (Lecture Notes, Fall 2007)

Löwenheim-Skolem Theorems, Countable Approximations, and L ω. David W. Kueker (Lecture Notes, Fall 2007) Löwenheim-Skolem Theorems, Countable Approximations, and L ω 0. Introduction David W. Kueker (Lecture Notes, Fall 2007) In its simplest form the Löwenheim-Skolem Theorem for L ω1 ω states that if σ L ω1

More information

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S) Lecturecise 22 Weak monadic second-order theory of one successor (WS1S) 2013 Reachability in the Heap Many programs manipulate linked data structures (lists, trees). To express many important properties

More information

Automata on linear orderings

Automata on linear orderings Automata on linear orderings Véronique Bruyère Institut d Informatique Université de Mons-Hainaut Olivier Carton LIAFA Université Paris 7 September 25, 2006 Abstract We consider words indexed by linear

More information

SYNTACTIC SEMIGROUP PROBLEM FOR THE SEMIGROUP REDUCTS OF AFFINE NEAR-SEMIRINGS OVER BRANDT SEMIGROUPS

SYNTACTIC SEMIGROUP PROBLEM FOR THE SEMIGROUP REDUCTS OF AFFINE NEAR-SEMIRINGS OVER BRANDT SEMIGROUPS SYNTACTIC SEMIGROUP PROBLEM FOR THE SEMIGROUP REDUCTS OF AFFINE NEAR-SEMIRINGS OVER BRANDT SEMIGROUPS JITENDER KUMAR AND K. V. KRISHNA Abstract. The syntactic semigroup problem is to decide whether a given

More information

Monadic Second Order Logic and Automata on Infinite Words: Büchi s Theorem

Monadic Second Order Logic and Automata on Infinite Words: Büchi s Theorem Monadic Second Order Logic and Automata on Infinite Words: Büchi s Theorem R. Dustin Wehr December 18, 2007 Büchi s theorem establishes the equivalence of the satisfiability relation for monadic second-order

More information

Algebras with finite descriptions

Algebras with finite descriptions Algebras with finite descriptions André Nies The University of Auckland July 19, 2005 Part 1: FA-presentability A countable structure in a finite signature is finite-automaton presentable (or automatic)

More information

Büchi Automata and Their Determinization

Büchi Automata and Their Determinization Büchi Automata and Their Determinization Edinburgh, October 215 Plan of the Day 1. Büchi automata and their determinization 2. Infinite games 3. Rabin s Tree Theorem 4. Decidability of monadic theories

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

Pure and O-Substitution

Pure and O-Substitution International Journal of Foundations of Computer Science c World Scientific Publishing Company Pure and O-Substitution Andreas Maletti Department of Computer Science, Technische Universität Dresden 01062

More information

Lecture 3: MSO to Regular Languages

Lecture 3: MSO to Regular Languages Lecture 3: MSO to Regular Languages To describe the translation from MSO formulas to regular languages one has to be a bit more formal! All the examples we used in the previous class were sentences i.e.,

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014

Logic and Automata I. Wolfgang Thomas. EATCS School, Telc, July 2014 Logic and Automata I EATCS School, Telc, July 2014 The Plan We present automata theory as a tool to make logic effective. Four parts: 1. Some history 2. Automata on infinite words First step: MSO-logic

More information

Unranked Tree Automata with Sibling Equalities and Disequalities

Unranked Tree Automata with Sibling Equalities and Disequalities Unranked Tree Automata with Sibling Equalities and Disequalities Wong Karianto Christof Löding Lehrstuhl für Informatik 7, RWTH Aachen, Germany 34th International Colloquium, ICALP 2007 Xu Gao (NFS) Unranked

More information

Syntactic Characterisations in Model Theory

Syntactic Characterisations in Model Theory Department of Mathematics Bachelor Thesis (7.5 ECTS) Syntactic Characterisations in Model Theory Author: Dionijs van Tuijl Supervisor: Dr. Jaap van Oosten June 15, 2016 Contents 1 Introduction 2 2 Preliminaries

More information

18.S097 Introduction to Proofs IAP 2015 Lecture Notes 1 (1/5/2015)

18.S097 Introduction to Proofs IAP 2015 Lecture Notes 1 (1/5/2015) 18.S097 Introduction to Proofs IAP 2015 Lecture Notes 1 (1/5/2015) 1. Introduction The goal for this course is to provide a quick, and hopefully somewhat gentle, introduction to the task of formulating

More information

Pattern Logics and Auxiliary Relations

Pattern Logics and Auxiliary Relations Pattern Logics and Auxiliary Relations Diego Figueira Leonid Libkin University of Edinburgh Abstract A common theme in the study of logics over finite structures is adding auxiliary predicates to enhance

More information

Logic Part I: Classical Logic and Its Semantics

Logic Part I: Classical Logic and Its Semantics Logic Part I: Classical Logic and Its Semantics Max Schäfer Formosan Summer School on Logic, Language, and Computation 2007 July 2, 2007 1 / 51 Principles of Classical Logic classical logic seeks to model

More information

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite

More information

MERGING STATES IN DETERMINISTIC FUZZY FINITE TREE AUTOMATA BASED ON FUZZY SIMILARITY MEASURES

MERGING STATES IN DETERMINISTIC FUZZY FINITE TREE AUTOMATA BASED ON FUZZY SIMILARITY MEASURES italian journal of pure and applied mathematics n. 33 2014 (225 240) 225 MERGING STATES IN DETERMINISTIC FUZZY FINITE TREE AUTOMATA BASED ON FUZZY SIMILARITY MEASURES Somaye Moghari Department of Mathematical

More information

Chapter 3 Deterministic planning

Chapter 3 Deterministic planning Chapter 3 Deterministic planning In this chapter we describe a number of algorithms for solving the historically most important and most basic type of planning problem. Two rather strong simplifying assumptions

More information

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P. First-Order Logic Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable

More information

Equational Logic. Chapter Syntax Terms and Term Algebras

Equational Logic. Chapter Syntax Terms and Term Algebras Chapter 2 Equational Logic 2.1 Syntax 2.1.1 Terms and Term Algebras The natural logic of algebra is equational logic, whose propositions are universally quantified identities between terms built up from

More information

Existential Second-Order Logic and Modal Logic with Quantified Accessibility Relations

Existential Second-Order Logic and Modal Logic with Quantified Accessibility Relations Existential Second-Order Logic and Modal Logic with Quantified Accessibility Relations preprint Lauri Hella University of Tampere Antti Kuusisto University of Bremen Abstract This article investigates

More information

On the bisimulation invariant fragment of monadic Σ 1 in the finite

On the bisimulation invariant fragment of monadic Σ 1 in the finite On the bisimulation invariant fragment of monadic Σ 1 in the finite Anuj Dawar 1 and David Janin 2 1 University of Cambridge Computer Laboratory, Cambridge CB3 0FD, UK, anuj.dawar@cl.cam.ac.uk. 2 LaBRI,

More information

Weighted Automata and Monadic Second Order Logic

Weighted Automata and Monadic Second Order Logic and Monadic Second Order Logic Nadia Labai and Johann A. Makowsky ************************* Revised and expanded slides originally presented at GandALF 2013 File:cd-title Probabilistic automata (Rabin

More information

Regular Expressions. Definitions Equivalence to Finite Automata

Regular Expressions. Definitions Equivalence to Finite Automata Regular Expressions Definitions Equivalence to Finite Automata 1 RE s: Introduction Regular expressions are an algebraic way to describe languages. They describe exactly the regular languages. If E is

More information

Hierarchy among Automata on Linear Orderings

Hierarchy among Automata on Linear Orderings Hierarchy among Automata on Linear Orderings Véronique Bruyère Institut d Informatique Université de Mons-Hainaut Olivier Carton LIAFA Université Paris 7 Abstract In a preceding paper, automata and rational

More information

SLD-Resolution And Logic Programming (PROLOG)

SLD-Resolution And Logic Programming (PROLOG) Chapter 9 SLD-Resolution And Logic Programming (PROLOG) 9.1 Introduction We have seen in Chapter 8 that the resolution method is a complete procedure for showing unsatisfiability. However, finding refutations

More information

Lecture 2: Connecting the Three Models

Lecture 2: Connecting the Three Models IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 2: Connecting the Three Models David Mix Barrington and Alexis Maciel July 18, 2000

More information

Automata Theory for Presburger Arithmetic Logic

Automata Theory for Presburger Arithmetic Logic Automata Theory for Presburger Arithmetic Logic References from Introduction to Automata Theory, Languages & Computation and Constraints in Computational Logic Theory & Application Presented by Masood

More information

Myhill-Nerode Theorem for Recognizable Tree Series Revisited?

Myhill-Nerode Theorem for Recognizable Tree Series Revisited? Myhill-Nerode Theorem for Recognizable Tree Series Revisited? Andreas Maletti?? International Comper Science Instite 1947 Center Street, Suite 600, Berkeley, CA 94704, USA Abstract. In this contribion

More information

Incomparability Results for Classes of Polynomial Tree Series Transformations

Incomparability Results for Classes of Polynomial Tree Series Transformations Journal of Automata, Languages and Combinatorics 10 (2005) 4, 535{568 c Otto-von-Guericke-Universitat Magdeburg Incomparability Results for Classes of Polynomial Tree Series Transformations Andreas Maletti

More information

Applied Automata Theory

Applied Automata Theory Applied Automata Theory Roland Meyer TU Kaiserslautern Roland Meyer (TU KL) Applied Automata Theory (WiSe 2013) 1 / 161 Table of Contents I 1 Regular Languages and Finite Automata Regular Languages Finite

More information

Automata on Infinite words and LTL Model Checking

Automata on Infinite words and LTL Model Checking Automata on Infinite words and LTL Model Checking Rodica Condurache Lecture 4 Lecture 4 Automata on Infinite words and LTL Model Checking 1 / 35 Labeled Transition Systems Let AP be the (finite) set of

More information

From Liveness to Promptness

From Liveness to Promptness From Liveness to Promptness Orna Kupferman Hebrew University Nir Piterman EPFL Moshe Y. Vardi Rice University Abstract Liveness temporal properties state that something good eventually happens, e.g., every

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

Partially Ordered Two-way Büchi Automata

Partially Ordered Two-way Büchi Automata Partially Ordered Two-way Büchi Automata Manfred Kufleitner Alexander Lauser FMI, Universität Stuttgart, Germany {kufleitner, lauser}@fmi.uni-stuttgart.de June 14, 2010 Abstract We introduce partially

More information

Counter Automata and Classical Logics for Data Words

Counter Automata and Classical Logics for Data Words Counter Automata and Classical Logics for Data Words Amal Dev Manuel amal@imsc.res.in Institute of Mathematical Sciences, Taramani, Chennai, India. January 31, 2012 Data Words Definition (Data Words) A

More information

Strong Deterministic Fuzzy Automata

Strong Deterministic Fuzzy Automata Volume-5, Issue-6, December-2015 International Journal of Engineering and Management Research Page Number: 77-81 Strong Deterministic Fuzzy Automata A.Jeyanthi 1, B.Stalin 2 1 Faculty, Department of Mathematics,

More information

NOTES ON AUTOMATA. Date: April 29,

NOTES ON AUTOMATA. Date: April 29, NOTES ON AUTOMATA 1. Monoids acting on sets We say that a monoid S with identity element ɛ acts on a set Q if q(st) = (qs)t and qɛ = q. As with groups, if we set s = t whenever qs = qt for all q Q, then

More information

A Uniformization Theorem for Nested Word to Word Transductions

A Uniformization Theorem for Nested Word to Word Transductions A Uniformization Theorem for Nested Word to Word Transductions Dmitry Chistikov and Rupak Majumdar Max Planck Institute for Software Systems (MPI-SWS) Kaiserslautern and Saarbrücken, Germany {dch,rupak}@mpi-sws.org

More information

What You Must Remember When Processing Data Words

What You Must Remember When Processing Data Words What You Must Remember When Processing Data Words Michael Benedikt, Clemens Ley, and Gabriele Puppis Oxford University Computing Laboratory, Park Rd, Oxford OX13QD UK Abstract. We provide a Myhill-Nerode-like

More information

The Inclusion Problem for Weighted Automata on Infinite Trees

The Inclusion Problem for Weighted Automata on Infinite Trees The Inclusion Problem for Weighted Automata on Infinite Trees Stefan Borgwardt and Rafael Peñaloza Theoretical Computer Science, TU Dresden, Germany {penaloza,stefborg}@tcs.inf.tu-dresden.de Abstract Weighted

More information

Backward and Forward Bisimulation Minimisation of Tree Automata

Backward and Forward Bisimulation Minimisation of Tree Automata Backward and Forward Bisimulation Minimisation of Tree Automata Johanna Högberg Department of Computing Science Umeå University, S 90187 Umeå, Sweden Andreas Maletti Faculty of Computer Science Technische

More information

From Monadic Second-Order Definable String Transformations to Transducers

From Monadic Second-Order Definable String Transformations to Transducers From Monadic Second-Order Definable String Transformations to Transducers Rajeev Alur 1 Antoine Durand-Gasselin 2 Ashutosh Trivedi 3 1 University of Pennsylvania 2 LIAFA, Université Paris Diderot 3 Indian

More information

6 Coalgebraic modalities via predicate liftings

6 Coalgebraic modalities via predicate liftings 6 Coalgebraic modalities via predicate liftings In this chapter we take an approach to coalgebraic modal logic where the modalities are in 1-1 correspondence with so-called predicate liftings for the functor

More information

Origin-equivalence of two-way word transducers is in PSPACE

Origin-equivalence of two-way word transducers is in PSPACE Origin-equivalence of two-way word transducers is in PSPACE Sougata Bose, Anca Muscholl, Vincent Penelle LaBRI, University of Bordeaux Gabriele Puppis CNRS, LaBRI Abstract We consider equivalence and containment

More information

The theory of regular cost functions.

The theory of regular cost functions. The theory of regular cost functions. Denis Kuperberg PhD under supervision of Thomas Colcombet Hebrew University of Jerusalem ERC Workshop on Quantitative Formal Methods Jerusalem, 10-05-2013 1 / 30 Introduction

More information

Pumping for Ordinal-Automatic Structures *

Pumping for Ordinal-Automatic Structures * Computability 1 (2012) 1 40 DOI IOS Press 1 Pumping for Ordinal-Automatic Structures * Martin Huschenbett Institut für Informatik, Ludwig-Maximilians-Universität München, Germany martin.huschenbett@ifi.lmu.de

More information

On the Average Complexity of Brzozowski s Algorithm for Deterministic Automata with a Small Number of Final States

On the Average Complexity of Brzozowski s Algorithm for Deterministic Automata with a Small Number of Final States On the Average Complexity of Brzozowski s Algorithm for Deterministic Automata with a Small Number of Final States Sven De Felice 1 and Cyril Nicaud 2 1 LIAFA, Université Paris Diderot - Paris 7 & CNRS

More information

CHURCH SYNTHESIS PROBLEM and GAMES

CHURCH SYNTHESIS PROBLEM and GAMES p. 1/? CHURCH SYNTHESIS PROBLEM and GAMES Alexander Rabinovich Tel-Aviv University, Israel http://www.tau.ac.il/ rabinoa p. 2/? Plan of the Course 1. The Church problem - logic and automata. 2. Games -

More information

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège Temporal logics and explicit-state model checking Pierre Wolper Université de Liège 1 Topics to be covered Introducing explicit-state model checking Finite automata on infinite words Temporal Logics and

More information

First Order Logic (FOL) 1 znj/dm2017

First Order Logic (FOL) 1   znj/dm2017 First Order Logic (FOL) 1 http://lcs.ios.ac.cn/ znj/dm2017 Naijun Zhan March 19, 2017 1 Special thanks to Profs Hanpin Wang (PKU) and Lijun Zhang (ISCAS) for their courtesy of the slides on this course.

More information

Tree Automata and Rewriting

Tree Automata and Rewriting and Rewriting Ralf Treinen Université Paris Diderot UFR Informatique Laboratoire Preuves, Programmes et Systèmes treinen@pps.jussieu.fr July 23, 2010 What are? Definition Tree Automaton A tree automaton

More information

Generalising Automaticity to Modal Properties of Finite Structures

Generalising Automaticity to Modal Properties of Finite Structures Generalising Automaticity to Modal Properties of Finite Structures Anuj Dawar University of Cambridge Computer Laboratory, Cambridge CB3 0FD, UK. anuj.dawar@cl.cam.ac.uk Stephan Kreutzer Institut für Informatik,

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

GENERATING SETS AND DECOMPOSITIONS FOR IDEMPOTENT TREE LANGUAGES

GENERATING SETS AND DECOMPOSITIONS FOR IDEMPOTENT TREE LANGUAGES Atlantic Electronic http://aejm.ca Journal of Mathematics http://aejm.ca/rema Volume 6, Number 1, Summer 2014 pp. 26-37 GENERATING SETS AND DECOMPOSITIONS FOR IDEMPOTENT TREE ANGUAGES MARK THOM AND SHEY

More information

A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ

A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ NICOLAS FORD Abstract. The goal of this paper is to present a proof of the Nullstellensatz using tools from a branch of logic called model theory. In

More information

Compositions of Bottom-Up Tree Series Transformations

Compositions of Bottom-Up Tree Series Transformations Compositions of Bottom-Up Tree Series Transformations Andreas Maletti a Technische Universität Dresden Fakultät Informatik D 01062 Dresden, Germany maletti@tcs.inf.tu-dresden.de May 17, 2005 1. Motivation

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

Statistical Machine Translation of Natural Languages

Statistical Machine Translation of Natural Languages 1/26 Statistical Machine Translation of Natural Languages Heiko Vogler Technische Universität Dresden Germany Graduiertenkolleg Quantitative Logics and Automata Dresden, November, 2012 1/26 Weighted Tree

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

Logical Characterization of Weighted Pebble Walking Automata

Logical Characterization of Weighted Pebble Walking Automata Logical Characterization of Weighted Pebble Walking Automata Benjamin Monmege Université libre de Bruxelles, Belgium Benedikt Bollig and Paul Gastin (LSV, ENS Cachan, France) Marc Zeitoun (LaBRI, Bordeaux

More information

A Lower Bound for the Size of Syntactically Multilinear Arithmetic Circuits

A Lower Bound for the Size of Syntactically Multilinear Arithmetic Circuits A Lower Bound for the Size of Syntactically Multilinear Arithmetic Circuits Ran Raz Amir Shpilka Amir Yehudayoff Abstract We construct an explicit polynomial f(x 1,..., x n ), with coefficients in {0,

More information

arxiv:math/ v1 [math.lo] 5 Mar 2007

arxiv:math/ v1 [math.lo] 5 Mar 2007 Topological Semantics and Decidability Dmitry Sustretov arxiv:math/0703106v1 [math.lo] 5 Mar 2007 March 6, 2008 Abstract It is well-known that the basic modal logic of all topological spaces is S4. However,

More information

Counting in trees. Helmut Seidl 1 Thomas Schwentick 2 Anca Muscholl 3. 1 Introduction

Counting in trees. Helmut Seidl 1 Thomas Schwentick 2 Anca Muscholl 3. 1 Introduction Counting in trees Helmut Seidl 1 Thomas Schwentick 2 Anca Muscholl 3 1 Institut für Informatik, I2 TU München Germany 2 Lehrstuhl Informatik I Universität Dortmund Germany 3 LaBRI Université Bordeaux France

More information

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming A Little Logic International Center for Computational Logic Technische Universität Dresden Germany Propositional Logic Satisfiability Problems Solving Sudokus First Order Logic Logic Programming A Little

More information

Informal Statement Calculus

Informal Statement Calculus FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example

More information

Part II. Logic and Set Theory. Year

Part II. Logic and Set Theory. Year Part II Year 2018 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2018 60 Paper 4, Section II 16G State and prove the ǫ-recursion Theorem. [You may assume the Principle of ǫ- Induction.]

More information

CS256/Spring 2008 Lecture #11 Zohar Manna. Beyond Temporal Logics

CS256/Spring 2008 Lecture #11 Zohar Manna. Beyond Temporal Logics CS256/Spring 2008 Lecture #11 Zohar Manna Beyond Temporal Logics Temporal logic expresses properties of infinite sequences of states, but there are interesting properties that cannot be expressed, e.g.,

More information

Another algorithm for nonnegative matrices

Another algorithm for nonnegative matrices Linear Algebra and its Applications 365 (2003) 3 12 www.elsevier.com/locate/laa Another algorithm for nonnegative matrices Manfred J. Bauch University of Bayreuth, Institute of Mathematics, D-95440 Bayreuth,

More information

Finite Universes. L is a fixed-length language if it has length n for some

Finite Universes. L is a fixed-length language if it has length n for some Finite Universes Finite Universes When the universe is finite (e.g., the interval 0, 2 1 ), all objects can be encoded by words of the same length. A language L has length n 0 if L =, or every word of

More information

Propositional Logic: Part II - Syntax & Proofs 0-0

Propositional Logic: Part II - Syntax & Proofs 0-0 Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems

More information

RELATING TREE SERIES TRANSDUCERS AND WEIGHTED TREE AUTOMATA

RELATING TREE SERIES TRANSDUCERS AND WEIGHTED TREE AUTOMATA International Journal of Foundations of Computer Science Vol. 16, No. 4 (2005) 723 741 c World Scientific Publishing Company RELATING TREE SERIES TRANSDUCERS AND WEIGHTED TREE AUTOMATA ANDREAS MALETTI

More information

Abstracting real-valued parameters in parameterised boolean equation systems

Abstracting real-valued parameters in parameterised boolean equation systems Department of Mathematics and Computer Science Formal System Analysis Research Group Abstracting real-valued parameters in parameterised boolean equation systems Master Thesis M. Laveaux Supervisor: dr.

More information

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

Characterizing First Order Logic

Characterizing First Order Logic Characterizing First Order Logic Jared Holshouser, Originally by Lindstrom September 16, 2014 We are following the presentation of Chang and Keisler. 1 A Brief Review of First Order Logic Definition 1.

More information

From Constructibility and Absoluteness to Computability and Domain Independence

From Constructibility and Absoluteness to Computability and Domain Independence From Constructibility and Absoluteness to Computability and Domain Independence Arnon Avron School of Computer Science Tel Aviv University, Tel Aviv 69978, Israel aa@math.tau.ac.il Abstract. Gödel s main

More information

Mathematical Preliminaries. Sipser pages 1-28

Mathematical Preliminaries. Sipser pages 1-28 Mathematical Preliminaries Sipser pages 1-28 Mathematical Preliminaries This course is about the fundamental capabilities and limitations of computers. It has 3 parts 1. Automata Models of computation

More information

Infinite and Finite Model Theory Part II

Infinite and Finite Model Theory Part II Infinite and Finite Model Theory Part II Anuj Dawar Computer Laboratory University of Cambridge Lent 2002 3/2002 0 Finite Model Theory Finite Model Theory motivated by computational issues; relationship

More information

Minimization of Weighted Automata

Minimization of Weighted Automata Minimization of Weighted Automata Andreas Maletti Universitat Rovira i Virgili Tarragona, Spain Wrocław May 19, 2010 Minimization of Weighted Automata Andreas Maletti 1 In Collaboration with ZOLTÁN ÉSIK,

More information

Composition Closure of ε-free Linear Extended Top-down Tree Transducers

Composition Closure of ε-free Linear Extended Top-down Tree Transducers Composition Closure of ε-free Linear Extended Top-down Tree Transducers Zoltán Fülöp 1, and Andreas Maletti 2, 1 Department of Foundations of Computer Science, University of Szeged Árpád tér 2, H-6720

More information

2. Syntactic Congruences and Monoids

2. Syntactic Congruences and Monoids IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 3: Algebra and Languages David Mix Barrington and Alexis Maciel July 19, 2000 1.

More information