MSO Querying over Trees via Datalog Evaluation

Size: px
Start display at page:

Download "MSO Querying over Trees via Datalog Evaluation"

Transcription

1 MSO Querying over Trees via Datalog Evaluation Eugénie Foustoucos and Labrini Kalantzi M.Π.Λ.A., Department of Mathematics National and Capodistrian University of Athens Panepistimiopolis, Athens, Greece Abstract. The MSO evaluation problem on trees is the problem of computing, for any MSO formula φ and any finite tree T,thesetofsatisfying assignments of φ(x 1,...,X k )overt. In [3] we considered the MSO evaluation problem on full binary trees as a Datalog query evaluation problem, and gave a Datalog-theoretic solution to it for any MSO formula φ; we thus subsumed previous results obtained for a restricted class of MSO, namely for unary MSO queries. In the present paper we extend the results of [3] both to r-ary trees and to unranked trees, thus providing a general Datalog-theoretic solution to the problem for the class of finite trees. 1 Introduction Monadic second order logic (MSO) is an extension of first order logic (FO) with set variables over which quantification is allowed (see also [4]). The MSO evaluation problem or MSO querying problem on trees is the problem of evaluating k-ary (k 0) MSO formulas, i.e. it is the problem of computing, for any MSO formula φ(x 1,...,X k ) and any finite tree T, the set of satisfying assignments sat assign(φ, T )={(B 1,...,B k ) T = φ(b 1,...,B k )} of φ(x 1,...,X k )overt. In this paper we first deal with finite colored trees that are k-ranked and then with finite colored trees that are unranked. MSO over trees is a well studied logic (Doner [2], Thatcher & Wright [10]) presenting great interest due to its expressive power which makes it suitable for many computer science applications. Such an example is a very important database querying problem in the context of XML, namely the problem of selecting nodes in trees (representing semi-structured documents). Since node selecting queries Q can be expressed by MSO formulas φ with only one free variable which moreover is a first-order one (called unary MSO queries), answering Q on an XML document D means evaluating φ onthetreerepresentationofd. Itis due to the aforementioned connection with XML that the unary MSO querying problem has received so much attention recently and many representation formalisms have been proposed to address it: for instance Monadic Datalog [7], query automata [9], selection tree automata [6]. More precisely, in was proved in [7] that MSO and Monadic Datalog are equivalent in their power to define

2 MSO Querying over Trees via Datalog Evaluation 69 unary queries (over both ranked and unranked trees). The proof was based on the simulation of query automata (proved in [9] to capture the expressiveness of MSO with respect to unary queries) in Monadic Datalog. Moreover selection automata and Monadic Datalog have been related in [8] with respect to evaluation of unary queries over trees. In [3] we considered the whole class of MSO formulas, i.e. the class of formulas having k (k 0) free (either first- or second-order) variables, over full binary trees and we introduced a new automaton called assignment automaton, which evaluates MSO k-ary queries over trees. We then used assignment automaton, translating both its construction procedure (program Π φ ) and its run evaluation procedure (program Π eval φ ), to connect MSO to Datalog and further to solve the MSO querying problem via Datalog query evaluation. More precisely, we showed that for every MSO formula φ, we can define a Datalog program Π eval φ, such that the evaluation of φ over a finite tree T (viewed as database D T )is obtained by evaluating Π eval φ on input databases D φ (computed by program Π φ )andd T ; in the present paper we essentially follow the same lines to solve the MSO evaluation problem first on ranked trees and then on unranked trees. 2 Basic Notions of Trees, Automata and MSO-Logic Ranked Colored Trees, MSO over Ranked Trees. Let r be a natural number; a tree t of rank r (or r-ranked tree) is a finite tree (i.e. its set of nodes dom(t ) is finite) which is ordered (i.e. for each node n, the set of children of n is ordered) and where each inner node has degree (i.e. number of children) at most r. LetΓ be a finite set of symbols, called alphabet of colors. Anr-ranked Γ -colored tree T is a pair (t, c),wherec:dom(t) Γ is the coloring function and c(n) isthecolor of node n. Anr-ranked Γ -tree T is usually represented as a relational τ (Γ,r) -structure, τ (Γ,r) = {S 1,...,S r, (P γ ) γ Γ }, having domain dom(t ); S i (x, y), i =1,...,r,meansthaty is the i th child of x and P γ (x) means that node x has color γ. It is convenient for our Datalog approach, to view T as a slightly richer relational structure D T called the database of T ; D T has domain dom(t ) and signature (leaf, root, (degree i ) i=1,...,r, (child i ) i=1,...,r, (color γ ) γ Γ ), where predicates leaf, root, degree i, color γ are of arity 1, predicates child i are of arity 2 and their meaning is the obvious one. Without loss of generality, we consider MSO formulas having no FO variables at all, assuming that a formula has been translated to an equivalent formalism, called MSO [τ (Γ,r) ] (very similar to MSO 0 of [11] when r = 2) where the free variables of atomic formulas are interpreted as singleton sets. In particular, the atomic formulas of MSO [τ (Γ,r) ]arey (X), Si (X, Y ), P γ (X), with respective meaning: 1) the unique element of set X is included into set Y, 2) the unique element of set Y is the i th child of the unique element of set X, 3) the unique element of set X has color γ. Distinguishing between MSO and MSO is a technical detail (see also [3]) and we refer to it by simply saying MSO.

3 70 Eugénie Foustoucos and Labrini Kalantzi Unranked Colored Trees and MSO over Unranked Trees. An unranked Γ -colored tree T u, is a finite ordered tree having no a priori bound on the number of children of its nodes. T u is usually represented as a relational τ Γ -structure, τ Γ = {S first,next, Last, (P γ ) γ Γ }, having domain dom(t u ); the binary predicate symbol S first corresponds to the first (leftmost) child relation, Next (also binary) to the next-sibling relation and Last (unary) to the has-no-next-sibling relation. We view T u, as a slightly richer relational structure D T u, called the database of T u and defined analogously to the database D T of a ranked tree T. MSO formulas that are interpreted over unranked trees are formulas over the signature τ Γ (same remarks hold as before). MSO/Automata Connection: the Assignment Automaton. Definition 1 A non deterministic bottom up r-ranked colored tree automaton A is a tuple (Γ, Q,, F), whereγ is an alphabet of colors, Q is a finite set of states, F Q is the set of final states and is a family of transition relations ( i ) i=0,...,r,where 0 Q Γ and i Q Γ Q i.arun ρ of A on an r-ranked Γ -tree T is a mapping, assigning states to nodes s.t. i) if n is a leaf with color a, thenρ(n) =q if there exists a transition (q, a) 0, and ii) if n is a node of color a, having children n 1,...,n m, then the value ρ(n) is such that (ρ(n),a,ρ(n 1 ),...,ρ(n m )) m.arunissuccessful if it maps the root to a final state. A Γ -tree T is recognized by a Γ -automaton A if there exists a successful run of A on T.AclassofΓ -trees T is recognizable if there exists an automaton that recognizes it. Definition 2 (introduced in [3]) A k-assignment ranked automaton A is a non deterministic bottom up tree automaton (Γ, Q,, F) where the set of states Q has the special form Q = Q 0 {0, 1} k for some finite set Q 0.Thek-assignment automaton A computes an assignment B =(B 1,..., B k ) over T,ifthereisa successful run ρ of A on T computing it i.e. such that for i =1,...,k, B i = {n dom(t ) ρ i (n) =1}. Theorem 3 Given a k-ary MSO formula φ, ak-assignment automaton Assign φ can be constructed that computes the satisfying assignments of φ. Assign φ is called the assignment automaton of φ. Proof (Sketch). Let T =(t, c) bearankedγ-tree and let B =(B 1,...,B k )be a tuple of k subsets of dom(t ). We define a new Γ k -tree (Γ k = Γ {0, 1} k ), denoted (T,B), by extending the coloring function c of T with a new function c B : dom(t ) {0, 1} k. More precisely, c B (n) = (c B1 (n),...,c Bk (n)) where c Bi (n) =1iffn B i, i =1,...,k;(T,B) =(t, c )withc (n) =(c(n),c B (n)). Let φ be a k-ary MSO formula; the class of Γ k -trees (T,B) such that T = φ(b), is recognizable (Doner [2], Thatcher & Wright [10]). Let A φ be a Γ k -tree automaton recognizing this class and let A φ be the k-assignment automaton satisfying the following correspondence: (T,B) is recognized by A φ iff there is a successful run of A φ over T computing B. Clearly Assign φ = A φ.

4 MSO Querying over Trees via Datalog Evaluation 71 Example 4 The satisfying assignments of formula Pw (X) over a 3-ranked {w, b}- colored tree (w stands for white and b stands for black) with four nodes (n 1 is root of color w having 1st, 2nd and 3rd child n 2, n 3, n 4 of color w, b, b respectively) are computed by Assign P w via its successful runs n 1 (q a, 0) n 1 (q a, 1) n 2 (q a, 1) n 3 (q 0, 0) n 4 (q 0, 0) n 2 (q 0, 0) n 3 (q 0, 0) n 4 (q 0, 0) corresponding to assignments {n 2 }, {n 1 } respectively. 3 From MSO to Datalog : the Ranked Case 3.1 MSO/Datalog Connection over Ranked Trees Based on our assignment automaton, we translate the MSO/automata connection into an MSO/Datalog connection. We assume some familiarity with Datalog; the reader is also referred to [1]. Definition 5 (Program Π φ ) Given an MSO[τ (Γ,r) ] formula φ (with maximal subformulas φ 1 and φ 2 if φ = φ 1 φ 2 ; with maximal subformula φ 1 if either φ = φ 1 or φ = φ 1 ), program Π φ is a ground Datalog program consisting of 1) programs Π ψ where ψ maximal subformula of φ and 2) of a last stratum defining φ-predicates i.e. IDB predicate symbols either of arity 0, of the form φ f q,φ s q or of the same arity as φ and of the form φ [q] γ 0 or φ [q, q 1,...,q i ] γ i, 1 i r, γ Γ.Symbolsq, q 1,...,q i appearing in the φ-predicates form set Q φ called the set of state symbols of program Π φ. More precisely, Π φ is constructed by induction on the structure of φ. Wegive the 3 cases where φ is atomic. If φ = Y (X), thenπ φ consists of facts written below in compact form ( denotes any value of the set of valid values for the corresponding argument, i.e. in the following {0, 1}): - φ [q 0 ] γ 0 (0, ), φ [q f ] γ 0 (1, 0), φ [q a ] γ 0 (1, 1). - φ [q 0, q 0 i ] γ i (0, ), φ [q f, q 0 i ] γ i (1, 0), φ [q a, q 0 i ] γ i (1, 1), 1 i r, where q 0 i denotes a sequence of length i of q 0 s, i.e. of the form q 0,...,q 0. - φ [q a, q 0 n, q a, q 0 m ] γ i (0, ), φ [q f, q 0 n, q a, q 0 m ] γ i (1, ), 1 i r and n, m 0, n + m +1=i. - φ [q f, s] γ i (, ), i 2, fors sequence of length i over Q φ, containing at least two occurrences of state q a or at least one occurrence of state q f. - φ s q a, φ s q 0, φ s q f, φ f q a. If φ = Sj (X, Y ), thenπ φ consists of facts written below in condensed form: - φ [q f, s] γ i (1, 1), fors sequence of length i over Q φ, 0 i r.

5 72 Eugénie Foustoucos and Labrini Kalantzi - φ [q 0 ] γ 0 (0, 0), φ [q 1 ] γ 0 (0, 1), φ [q f ] γ 0 (1, 0). - φ [q 0, q 0 i ] γ i (0, 0), φ [q 1, q 0 i ] γ i (0, 1), φ [q f, q 0 i ] γ i (1, 0), 1 i r. Again q 0 i denotes a sequence of the form q 0,...,q 0 of length i. - φ [q a, s] γ i (1, 0) and φ [q f, s] γ i (0, ), j i r, wheres=s 1,...,s i with s j =q 1,ands l =q 0 when l j. - φ [q a, q 0 n, q a, q 0 m ] γ i (0, 0) and φ [q f, q 0 n, q a, q 0 m ] γ i (e 1,e 2 ), 1 i r; n, m 0, n + m +1=i and (e 1,e 2 ) {(0, 1), (1, 0)}. - φ [q f, s] γ i (, ),1 i r, wheres is any sequence of length i over Q φ not considered in the previous cases. - φ s q a, φ s q f, φ s q 0, φ s q 1, φ f q a. For φ = P α (X), α Γ, Π φ consists of facts written below in condensed form, where γ Γ, α Γ \{α}: - φ [q 0 ] γ 0 (0), φ [q a ] α 0 (1), φ [q f ] α 0 (1). - φ [q 0, q 0 i ] γ i (0), φ [q a, q 0 i ] α i (1), φ [q f, q 0 i ] α i (1), 1 i r. - φ [q a, q 0 n, q a, q 0 m ] γ i (0) and φ [q f, q 0 n, q a, q 0 m ] γ i (1), 1 i r and n, m 0, n + m +1=i. - φ [q f, s] γ i ( ),1 i r, fors sequence of length i over Q φ, either having more than one occurrence of q a or having at least one occurrence of q f. - φ s q a, φ s q 0, φ s q f, φ f q a. When φ is not atomic, Π φ is constructed (by induction on the structure of φ) along the lines of [3] with slight modifications that take into account the degree of nodes. Definition 6 (Database D φ ) We call database D φ of the MSO formula φ(x 1,...,X k ),thesetdφ 1 D 2 φ ; Dφ 1 is the set of ground atoms over φ-predicates in program Π φ where argument vector (e 1,...,e k ) of atoms φ [q] γ i (e 1,...,e k ) has been replaced by word e 1 e k and Dφ 2 is the union of sets of facts {φ s [q]γ 0 φ [q] γ 0 (e) Dφ 1} and {φ s [q, q 1,...,q i ] γ i φ [q, q 1,...,q i ] γ i (e) Dφ 1}. It can be proved that D φ exactly describes Assign φ =(Γ, Q,, F); in particular φ [q, q 1,...,q i ] γ i (e) D φ iff there is a transition ((q, e),γ,(q 1, e 1 ),...,(q i, e i )) i, φ s q D φ iff (q, e) Q and φ f q D φ iff (q, e) F (for φ = P w (X) recall Example 4). 3.2 MSO-Evaluation via Datalog Evaluation We are now ready to present our Datalog solution to the MSO evaluation problem. Proposition 7 For every MSO formula φ(x) and for every integer m, adatalog program Π eval φ with goal predicate φ assign (of arity 2 m) can be constructed, such that for every ranked tree T of size m, T = φ(b) iff φ assign(n 1,

6 MSO Querying over Trees via Datalog Evaluation 73 ɛ 1,...,n m, ɛ m ) is computed by program Π eval φ on input database {D φ, D T }, where n 1 ɛ 1,...,n m ɛ m is a mapping codifying B = (B 1,...,B k ) i.e. satisfying ɛ j i =1iff n i B j,fori =1,...,m and j =1,...,k. Proof. Program Π eval φ consists of three strata, namely P, S, A, corresponding to the three steps of linear-time algorithm given in [5]. Definition of stratum P is the following: for each atom φ s [q] γ 0, φ s [q, q 1,...,q i ] γ i in D φ,createrules pot q(x) leaf(x), color γ (x),φ s [q] γ 0, pot q(x) degree i (x), child 1 (x, x 1 ),...,child i (x, x i ), color γ (x), pot q 1 (x 1 ),...,pot q i (x i ),φ s [q, q 1,...,q i ] γ i. Stratum S is defined: for φ f q, φ s [q, q 1,...,q i ] γ i in D φ,create suc q(x) pot q(x), root(x),φ f q, suc q j (x j ) suc q(x), pot q 1 (x 1 ),...,pot q i (x i ), child 1 (x, x 1 ),...,child i (x, x i ), degree i (x), color γ (x),φ s [q, q 1,...,q i ] γ i, j =1,...,i. Last, stratum A is defined: for each atom φ [q] γ 0 (e 1 e k )ind φ,create assign q 1 (x, e) suc q(x), leaf(x), color γ (x),φ [q] γ 0 (e), and for each atom φ [q, q 1,...,q i ] γ i (e 1 e k )ind φ,createrules assign q m1+ +mi+1 (x, e, x e 1,...,x e i ) suc q(x), degree i (x), color γ (x), child 1 (x, x 1 ),...,child i (x, x i ), m assign q 1 1 (x e 1 ),...,assign q mi i (x e i ),φ [q, q 1,...,q i ] γ i (e), m j 1, 1 + i j=1 m j dom(t ) and with x e j we denote the following sequence (of length 2 m j ): x 1 j, e1 j,...,x mj j, e mj j, j =1,...,i. φ assign(x 1, e 1,...,x m, e m ) assign q m (x 1, e 1,...,x m, e m ). Example 8 Consider MSO [τ ({w,b},2) ] formula ψ(x, Y )=Pw(X) S2(X, Y ). Then database Dψ 1 (recall Definition 6) of formula ψ(x, Y ) consists of the following facts (where γ {w, b}, e {0, 1} and U = {00, 01, 10, 11}) - ψ [q 0 ] γ 0 (00), ψ [q 1 ] γ 0 (01), ψ [q f ] γ 0 (1e). - ψ [q 0, q 0 ] γ 1 (00), ψ [q 1, q 0 ] γ 1 (01), ψ [q f, q 0 ] γ 1 (1e), ψ [q a, q a ] γ 1 (00), ψ [q f, q a ] γ 1 (g) for g U \{00}, ψ [q f, q 1 ] γ 1 (u), ψ [q f, q f ] γ 1 (u), u U. - ψ [q 0, q 0, q 0 ] γ 2 (00), ψ [q 1, q 0, q 0 ] γ 2 (01), ψ [q f, q 0, q 0 ] γ 2 (1e), ψ [q a, q 0, q a ] γ 2 (00), ψ [q a, q a, q 0 ] γ 2 (00), ψ [q f, q 0, q a ] γ 2 (g), ψ [q f, q a, q 0 ] γ 2 (g) for g U \{00}, ψ [q a, q 0, q 1 ] w 2 (10), ψ [q f, q 0, q 1 ] b 2 (10), ψ [q f, q 0, q 1 ] γ 2 (d) for d U \{10}, ψ [q f, q 1, q] γ 2 (u), ψ [q f, q a, q a ] γ 2 (u), ψ [q f, q a, q 1 ] γ 2 (u),

7 74 Eugénie Foustoucos and Labrini Kalantzi ψ [q f, q f, q] γ 2 (u), ψ [q f, q, q f ] γ 2 (u), u U, q {q 0, q 1, q a, q f }. - ψ s q 0, ψ s q 1, ψ s q f, ψ s q a, ψ f q a. Consider the 2-ranked {w, b}-tree T given below. We give the arguments of goal predicate ψ assign of Π eval ψ computed on input database {D ψ, D T }. v 1 v 2 v 3 v 4 v 5 v 6 v 7 ψ assign : (v 1, 00,v 2, 10,v 3, 00,v 5, 00,v 4, 01,v 6, 00,v 7, 00), (v 1, 00,v 2, 00,v 3, 00,v 5, 00,v 4, 10,v 6, 00,v 7, 01). sat assign(ψ, T) :({v 2 }, {v 4 }), ({v 4 }, {v 7 }). Proposition 9 For every unary MSO formula φ(x) we can construct a monadic Datalog program Π eval φ with only two strata and with goal predicate φ assign such that for every r-ranked tree T, T = φ(n) iff φ assign(n) is computed by program Π eval φ on input database {D φ, D T }. Proposition 10 Let D pre T be an enriched, with the pre-order node ordering information, tree database. For every MSO formula φ(x 1,...,X k ) we can construct a monadic Datalog program Π mon eval φ with goal predicates φ assign i ρ (ρ successful runs of Assign φ ) such that for every ranked tree T, T = φ(b 1,...,B k ) iff B i = {n Π mon eval φ {Dφ, D pre T } computes φ assign i ρ(n)}, i =1,...,k. Corollary of the above result is that for formulas with just first-order free variables, a Datalog program Π can be constructed such that T = φ(n 1,...,n k )iff φ assign(n 1,...,n k ) is computed by Π on input databases {D pre φ, D T }. 4 Unranked Trees In order to handle MSO queries over unranked trees (recall Sect. 2), we map unranked trees into binary trees of a special kind and readapt Definition 5. Definition 11 (Special Binary Tree T bin, Program Πφ bin ) A special bin- ary colored tree, denoted T bin,isa2-ranked colored tree where an inner node is allowed to have a second child although not having a first one. The corresponding tree database D T bin, is a database of signature (leaf, root, (child i ) i=1,2, (child i ) i=1,2, (color γ ) γ Γ );predicateschild 1, child 2 correspond to unique firstchild and unique second-child relations respectively. Program Πφ bin (producing database Dφ bin ) is derived by a slight modification of program Πφ 2 (Π2 φ denotes program Π φ of Definition 5 for 2-ranked colored trees). More precisely, φ-predicates of Πφ bin have form φ [q] γ 0, φ [q, q 1, q 2 ] γ 2 (as in Πφ 2)andalsoφ [q, q ] γ i, i =1, 2 (instead of φ [q, q 1 ] γ 1 in the Πφ 2 case). Furthermore facts corresponding to predicate symbols of the form φ [q] γ 0 and φ [q, q 1, q 2 ] γ 2 are the same for both Π bin φ and Π 2 φ.

8 MSO Querying over Trees via Datalog Evaluation 75 In particular, when φ is an atomic formula, for facts of Πφ bin corresponding to predicate symbols of the form φ [q, q i ] γ i, i =1, 2, the following hold: φ [q, q ] γ i (e) Πφ bin, i =1, 2, whenever φ [q, q ] γ 1 (e) Πφ 2, with the only exception when φ = Sj (X, Y ), j = 1, 2, q =q 1 and e = (1, 0). Recall that for this case we had φ [q a, q 1 ] γ 1 (1, 0) ΠS 2 and φ [q 1 f, q 1 ] γ 1 (1, 0) ΠS 2 ; 2 here we have φ [q a, q 1 ] γ 1 (1, 0),φ [q f, q 1 ] γ 2 (1, 0) ΠS bin and φ [q f, q 1 1 ] γ 1 (1, 0), φ [q a, q 1 ] γ 2 (1, 0) ΠS bin. 2 Lemma 12 Given an unranked colored tree database D T u, there exists a Datalog program Π u bin computing in linear time a special binary colored tree database D enc(t u ) such that the special binary tree enc(t u ) codifies the unranked tree T u. The basic idea of the above encoding is the interpretation of first-child, nextsibling relations as first- and second-child relations respectively. Example 13 Consider the unranked {w, b}-tree T u with seven nodes having database D T u={root(n 1 )} {leaf(n i ) i = 4, 5, 6, 7} {first child(n 1,n 2 ), first child(n 2,n 5 ), first child(n 3,n 7 )} {next sibling(n i,n i+1 ) i =2, 3, 5} {last sibling(n i ) i =4, 6, 7} Color T u,wherecolor T u={color w (n i ) i =1, 2, 3, 5} {color b (n i ) i =4, 6, 7}.ThenD enc(t u )={root(n 1 )} {leaf(n i ) i =4, 6, 7} {child1 (n 1,n 2 ), child 1 (n 2,n 5 ), child 1 (n 3,n 7 )} {child 2 (n i,n i+1 ) i =2, 3, 5} {child 1 (n 1,n 2 )} {child 2 (n 5,n 6 ) Color T u. T u n 1 enc(t u ) n 1 n 2 n 3 n 4 n 5 n 6 n 7 n 2 n 5 n 3 n 6 n 7 n 4 Proposition 14 For every MSO[τ Γ ] formula φ(x) and for every unranked colored tree T u of size m, a Datalog program Πeval u φ can be constructed, such that T u = φ(b) iff φ assign(n 1, ɛ 1,...,n m, ɛ m ) is computed by Πeval u φ on input database {Dφ, D T u} for an appropriate database D φ ; n 1 ɛ 1,...,n m ɛ m is the mapping codifying B. Proof. We translate MSO[τ Γ ]formulaφ(x)intoanmso[τ Γ,2 ]formulaencφ(x) such that T u = φ(b) iffenc(t u ) = encφ(b). Obviously such a formula is obtained from φ by replacing each occurrence of the form Sfirst (X, Y )bys 1 (X, Y ), Next (X, Y )bys2 (X, Y ), Last (X) bys 2 (X) = YS 2 (X, Y ). Let D φ = Denc bin φ and Πu eval φ =Π u bin Π eval enc φ,whereπeval enc φ is analogous to Datalog program of Proposition 7 for 2-ranked trees; then the requirements of the proposition hold.

9 76 Eugénie Foustoucos and Labrini Kalantzi Example 15 Consider the MSO[τ {w,b} ] formula φ(x, Y )=Pw (X) Next (X, Y ); enc φ(x, Y )=Pw(X) S2 (X, Y ). Formulaenc φ(x, Y ) isthesameasformula ψ(x, Y ) considered in Example 8; database Dψ bin 1 is derived from Dψ 1 by replacing 1) facts ψ [q f, q 1 ] γ 1 (10), γ {w, b}, byψ [q a, q 1 ] w 2 (10), ψ [q f, q 1 ] b 2 (10) and 2) all other facts of the form ψ [q, q ] γ 1 (e), byψ [q, q ] γ i (e), i =1, 2. Consider also the unranked {w, b}-tree T u of Example 13. Evaluating φ(x, Y ) over T u reduces to evaluating ψ(x, Y ) over enc(t u ).Wegivebelowthearguments of goal predicate ψ assign facts computed by Πeval ψ on input database {D enc(t u ), D bin } and the satisfying assignments they codify ψ ψ assign sat assign(ψ, enc(t u )) (n 1, 00,n 2, 00,n 5, 10,n 6, 01,n 3, 00,n 7, 00,n 4, 00) ({n 5 }, {n 6 }) (n 1, 00,n 2, 00,n 5, 00,n 6, 00,n 3, 10,n 7, 00,n 4, 01) ({n 3 }, {n 4 }) (n 1, 00,n 2, 10,n 5, 00,n 6, 00,n 3, 01,n 7, 00,n 4, 00) ({n 2 }, {n 3 }) Note the similarity in the structure of the 2-ranked tree T of Example 8 and the special binary tree enc(t u ). Identifying node sequence v 1,v 2,v 3,v 5,v 4,v 6,v 7 of T by node sequence n 1,n 2,n 5,n 6,n 3,n 7,n 4 of enc(t u ), observe that instead of child 1 (v 3,v 5 ) (first-child) we now have child 2 (n 5,n 6 ) (unique second-child) and thus one more satisfying assignment. Propositions analogous to Proposition 9 and Proposition 10 also hold for unranked trees. References 1. Abiteboul, S., Hull, R., Vianu V.: Foundations of Databases. Addison-Wesley, Doner, J.E.: Tree Acceptors and some of their Applications. Journal of Computer and System Sciences 4 (1970) Foustoucos, E., Kalantzi, L.: The MSO-evaluation problem on colored binary trees: a database-theoretic approach (2005, submitted) 4. Ebbinhaus, H.D., Flum, J.: Finite Model Theory. Springer-Verlag, 2nd edition, Flum, J., Frick, M., Grohe, M.: Query Evaluation via tree decompositions. Journal of the ACM 49 (2002), no. 6, Frick, M., Grohe, M., Koch, C.: Query Evaluation on Compressed Trees. Proceedings of the 18th Annual IEEE Symposium on Logic in Computer Science LICS (2003, to appear) 7. Gottlob, G., Koch, C.: Monadic Datalog and the Expressive Power of Web Information Extraction Languages. Proceedings of PODS (2002), also Journal of the ACM 51 (2004), no. 1, Grohe, M., Schweikardt, N.: Comparing the succinctness of monadic query languages over finite trees. CLS (2003)

10 MSO Querying over Trees via Datalog Evaluation Neven, F., Schwentick, T.: Query Automata. Proceedings of the 18th ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (1999) Thatcher, J., Wright, J.: Generalized Finite Automata Theory with an Application to a Decision Problem of Second-order Logic. Mathematical Systems Theory 2 (1968), no. 1, Thomas, W.: Languages, Automata, and Logic. Handbook of Formal Languages 3, chap. 7, , Springer Verlag, 1997

On Model-theoretic Approaches to Monadic Second-Order Logic Evaluation

On Model-theoretic Approaches to Monadic Second-Order Logic Evaluation On Model-theoretic Approaches to Monadic Second-Order Logic Evaluation Stavros Cosmadakis Eugénie Foustoucos October 2013 Abstract We review the model-theoretic approaches to Monadic Second-Order Logic

More information

Monadic Datalog Containment on Trees Using the Descendant-Axis

Monadic Datalog Containment on Trees Using the Descendant-Axis Monadic Datalog Containment on Trees Using the Descendant-Axis André Frochaux and Nicole Schweikardt Institut für Informatik, Humboldt-Universität zu Berlin {frochaua,schweikn}@informatik.hu-berlin.de

More information

Introduction to Tree Logics

Introduction to Tree Logics 1 / 26 Introduction to Tree Logics Pierre Genevès CNRS (slides mostly based on the ones by W. Martens and T. Schwentick) University of Grenoble, 2014 2015 2 / 26 Why Logic? Tree automaton algorithm Logical

More information

Automata-theoretic and Datalog-based solutions of Monadic Second-order Logic Evaluation Problems over Structures of bounded-treewidth

Automata-theoretic and Datalog-based solutions of Monadic Second-order Logic Evaluation Problems over Structures of bounded-treewidth Automata-theoretic and Datalog-based solutions of Monadic Second-order Logic Evaluation Problems over Structures of bounded-treewidth Eugénie Foustoucos Labrini Kalantzi February 2011 Abstract We propose

More information

Compact Representation for Answer Sets of n-ary Regular Queries

Compact Representation for Answer Sets of n-ary Regular Queries Compact Representation for Answer Sets of n-ary Regular Queries Kazuhiro Inaba 1 and Haruo Hosoya 1 The University of Tokyo, {kinaba,hahosoya}@is.s.u-tokyo.ac.jp Abstract. An n-ary query over trees takes

More information

On the Satisfiability of Two-Variable Logic over Data Words

On the Satisfiability of Two-Variable Logic over Data Words On the Satisfiability of Two-Variable Logic over Data Words Claire David, Leonid Libkin, and Tony Tan School of Informatics, University of Edinburgh Abstract. Data trees and data words have been studied

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

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

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

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

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

First-Order Queries over One Unary Function

First-Order Queries over One Unary Function First-Order Queries over One Unary Function Arnaud Durand 1 and Frédéric Olive 2 1 Equipe de Logique Mathématique, CNRS UMR 7056 - Université Denis Diderot, 2 place Jussieu, 75251 Paris Cedex 05, France

More information

1 Efficient Reasoning about Data Trees via Integer Linear Programming

1 Efficient Reasoning about Data Trees via Integer Linear Programming 1 Efficient Reasoning about Data Trees via Integer Linear Programming CLAIRE DAVID, Université Paris-Est LEONID LIBKIN, University of Edinburgh TONY TAN, University of Edinburgh Data trees provide a standard

More information

arxiv: v1 [cs.lo] 4 Oct 2013

arxiv: v1 [cs.lo] 4 Oct 2013 A note on monadic datalog on unranked trees arxiv:1310.1316v1 [cs.lo] 4 Oct 2013 André Frochaux Nicole Schweikardt Goethe-Universität Frankfurt am Main {afrochaux schweika}@informatik.uni-frankfurt.de

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

A short tutorial on order-invariant first-order logic

A short tutorial on order-invariant first-order logic A short tutorial on order-invariant first-order logic Nicole Schweikardt Goethe-Universität Frankfurt am Main, Germany schweika@informatik.uni-frankfurt.de Abstract. This paper gives a short introduction

More information

Database Theory VU , SS Ehrenfeucht-Fraïssé Games. Reinhard Pichler

Database Theory VU , SS Ehrenfeucht-Fraïssé Games. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2018 7. Ehrenfeucht-Fraïssé Games Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Pichler 15

More information

1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation

1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation Knowledge Bases and Databases Part 1: First-Order Queries Diego Calvanese Faculty of Computer Science Master of Science in Computer Science A.Y. 2007/2008 Overview of Part 1: First-order queries 1 First-order

More information

Efficient Reasoning about Data Trees via Integer Linear Programming

Efficient Reasoning about Data Trees via Integer Linear Programming Efficient Reasoning about Data Trees via Integer Linear Programming Claire David Université Paris-Est Claire.David@univ-mlv.fr Leonid Libkin University of Edinburgh libkin@inf.ed.ac.uk Tony Tan University

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

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang

Overview of Topics. Finite Model Theory. Finite Model Theory. Connections to Database Theory. Qing Wang Overview of Topics Finite Model Theory Part 1: Introduction 1 What is finite model theory? 2 Connections to some areas in CS Qing Wang qing.wang@anu.edu.au Database theory Complexity theory 3 Basic definitions

More information

On the use of guards for logics with data

On the use of guards for logics with data Author manuscript, published in "Proceedings of MFCS 2011, Warsaw : Poland (2011)" DOI : 10.1007/978-3-642-22993-0_24 On the use of guards for logics with data Thomas Colcombet 1, Clemens Ley 2, Gabriele

More information

Compact Representation for Answer Sets of n-ary Regular Queries

Compact Representation for Answer Sets of n-ary Regular Queries Compact Representation for Answer Sets of n-ary Regular Queries Kazuhiro Inaba a, Haruo Hosoya b a National Institute of Informatics, 2-1-1, Hitotsubashi, Chiyoda-ku, Tokyo, Japan b The University of Tokyo,

More information

Expressive power of pebble automata

Expressive power of pebble automata Expressive power of pebble automata Miko laj Bojańczyk 1,2, Mathias Samuelides 2, Thomas Schwentick 3, Luc Segoufin 4 1 Warsaw University 2 LIAFA, Paris 7 3 Universität Dortmund 4 INRIA, Paris 11 Abstract.

More information

Query Reasoning on Data Trees with Counting

Query Reasoning on Data Trees with Counting Query Reasoning on Data Trees with Counting Everardo Bárcenas 1,2, Edgard Benítez-Guerrero 2, and Jesús Lavalle 3,4 1 CONACYT 2 Universidad Veracruzana 3 Benemérita Universidad Autónoma de Puebla 4 Instituto

More information

Efficient Inclusion Checking for Deterministic Tree Automata and DTDs

Efficient Inclusion Checking for Deterministic Tree Automata and DTDs Efficient Inclusion Checking for Deterministic Tree Automata and DTDs Jérôme Champavère, Rémi Gilleron, Aurélien Lemay, and Joachim Niehren INRIA Futurs and Lille University, LIFL, Mostrare project Abstract.

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

Static Analysis and Query Answering for Incomplete Data Trees with Constraints

Static Analysis and Query Answering for Incomplete Data Trees with Constraints Static Analysis and Query Answering for Incomplete Data Trees with Constraints Amélie Gheerbrant 1,2, Leonid Libkin 1, and Juan Reutter 1,3 1 School of Informatics, University of Edinburgh 2 LIAFA (Université

More information

Graph Reachability and Pebble Automata over Infinite Alphabets

Graph Reachability and Pebble Automata over Infinite Alphabets Graph Reachability and Pebble Automata over Infinite Alphabets Tony Tan Department of Computer Science Technion Israel Institute of Technology Haifa 32000, Israel Email: tantony@cs.technion.ac.il Abstract

More information

Regular n-ary Queries in Trees and Variable Independence

Regular n-ary Queries in Trees and Variable Independence Regular n-ary Queries in Trees and Variable Independence Emmanuel Filiot Sophie Tison Laboratoire d Informatique Fondamentale de Lille (LIFL) INRIA Lille Nord-Europe, Mostrare Project IFIP TCS, 2008 E.Filiot

More information

On the Expressive Power of Monadic Least Fixed Point Logic

On the Expressive Power of Monadic Least Fixed Point Logic On the Expressive Power of Monadic Least Fixed Point Logic Nicole Schweikardt Institut für Informatik, Humboldt-Universität Berlin, Unter den Linden 6, D-10099 Berlin, Germany, Email: schweika@informatik.hu-berlin.de,

More information

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO

More information

Regular n-ary Queries in Trees and Variable Independence

Regular n-ary Queries in Trees and Variable Independence Regular n-ary Queries in Trees and Variable Independence Emmanuel Filiot 1 and Sophie Tison 1 University of Lille 1, LIFL, UMR 8022 of CNRS, INRIA Lille - Nord Europe EmmanuelFiliot@liflfr SophieTison@liflfr

More information

Database Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler

Database Theory VU , SS Complexity of Query Evaluation. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2018 5. Complexity of Query Evaluation Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 17 April, 2018 Pichler

More information

Compact Representation for Answer Sets of n-ary Regular Queries

Compact Representation for Answer Sets of n-ary Regular Queries Compact Representation for Answer Sets of n-ary Regular Queries by Kazuhiro Inaba (National Institute of Informatics, Japan) and Hauro Hosoya (The University of Tokyo) CIAA 2009, Sydney BACKGROUND N-ary

More information

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic

Preliminaries. Introduction to EF-games. Inexpressivity results for first-order logic. Normal forms for first-order logic Introduction to EF-games Inexpressivity results for first-order logic Normal forms for first-order logic Algorithms and complexity for specific classes of structures General complexity bounds Preliminaries

More information

A Formalism for Graph Databases and its Model of Computation

A Formalism for Graph Databases and its Model of Computation A Formalism for Graph Databases and its Model of Computation Juan Reutter and Tony Tan University of Edinburgh Abstract. Graph databases are directed graphs in which the edges are labeled with symbols

More information

Reasoning about XML with Temporal Logics and Automata

Reasoning about XML with Temporal Logics and Automata Reasoning about XML with Temporal Logics and Automata Leonid Libkin 1 and Cristina Sirangelo 1,2 1 University of Edinburgh 2 LSV, ENS Cachan, INRIA Abstract. We show that problems arising in static analysis

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 and Christof Löding Lehrstuhl für Informatik 7, RWTH Aachen, Germany Abstract. We propose an extension of the tree automata

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

Tight Lower Bounds for Query Processing on Streaming and External Memory Data

Tight Lower Bounds for Query Processing on Streaming and External Memory Data Tight Lower Bounds for Query Processing on Streaming and External Memory Data Martin Grohe a, Christoph Koch b, and Nicole Schweikardt a a Institut für Informatik, Humboldt-Universität zu Berlin, Unter

More information

Undecidability and intractability results concerning Datalog programs and their persistency numbers

Undecidability and intractability results concerning Datalog programs and their persistency numbers Undecidability and intractability results concerning Datalog programs and their persistency numbers STAVROS COSMADAKIS University of Patras EUGENIE FOUSTOUCOS Athens University of Economics and Business

More information

Tree Automata with Generalized Transition Relations

Tree Automata with Generalized Transition Relations Technische Universität Dresden Faculty of Computer Science Institute of Theoretical Computer Science Chair for Automata Theory Master s Program in Computer Science Master s Thesis Tree Automata with Generalized

More information

Abstract model theory for extensions of modal logic

Abstract model theory for extensions of modal logic Abstract model theory for extensions of modal logic Balder ten Cate Stanford, May 13, 2008 Largely based on joint work with Johan van Benthem and Jouko Väänänen Balder ten Cate Abstract model theory for

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

Transitive Closure Logic, Nested Tree Walking Automata, and XPath

Transitive Closure Logic, Nested Tree Walking Automata, and XPath Transitive Closure Logic, Nested Tree Walking Automata, and XPath Balder ten Cate ISLA, Universiteit van Amsterdam and Luc Segoufin INRIA, ENS-Cachan We study FO(MTC), first-order logic with monadic transitive

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

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

On Datalog vs. LFP. Anuj Dawar and Stephan Kreutzer

On Datalog vs. LFP. Anuj Dawar and Stephan Kreutzer On Datalog vs. LFP Anuj Dawar and Stephan Kreutzer 1 University of Cambridge Computer Lab, anuj.dawar@cl.cam.ac.uk 2 Oxford University Computing Laboratory, kreutzer@comlab.ox.ac.uk Abstract. We show that

More information

On Incomplete XML Documents with Integrity Constraints

On Incomplete XML Documents with Integrity Constraints On Incomplete XML Documents with Integrity Constraints Pablo Barceló 1, Leonid Libkin 2, and Juan Reutter 2 1 Department of Computer Science, University of Chile 2 School of Informatics, University of

More information

Closure Under Reversal of Languages over Infinite Alphabets

Closure Under Reversal of Languages over Infinite Alphabets Closure Under Reversal of Languages over Infinite Alphabets Daniel Genkin 1, Michael Kaminski 2(B), and Liat Peterfreund 2 1 Department of Computer and Information Science, University of Pennsylvania,

More information

Linear Temporal Logic and Büchi Automata

Linear Temporal Logic and Büchi Automata Linear Temporal Logic and Büchi Automata Yih-Kuen Tsay Department of Information Management National Taiwan University FLOLAC 2009 Yih-Kuen Tsay (SVVRL @ IM.NTU) Linear Temporal Logic and Büchi Automata

More information

On Nondeterministic Unranked Tree Automata with Sibling Constraints

On Nondeterministic Unranked Tree Automata with Sibling Constraints LIPIcs Leibniz International Proceedings in Informatics On Nondeterministic Unranked Tree Automata with Sibling Constraints Christof Löding and Karianto Wong RWTH Aachen University, Germany ABSTRACT. We

More information

Two-Variable Logic on Data Trees and XML Reasoning

Two-Variable Logic on Data Trees and XML Reasoning Two-Variable Logic on Data Trees and XML Reasoning Miko laj Bojańczyk Warsaw University and Anca Muscholl LABRI & Université Bordeaux 1 and Thomas Schwentick Universität Dortmund and Luc Segoufin INRIA

More information

FIRST-ORDER QUERY EVALUATION ON STRUCTURES OF BOUNDED DEGREE

FIRST-ORDER QUERY EVALUATION ON STRUCTURES OF BOUNDED DEGREE FIRST-ORDER QUERY EVALUATION ON STRUCTURES OF BOUNDED DEGREE INRIA and ENS Cachan e-mail address: kazana@lsv.ens-cachan.fr WOJCIECH KAZANA AND LUC SEGOUFIN INRIA and ENS Cachan e-mail address: see http://pages.saclay.inria.fr/luc.segoufin/

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

Classical First-Order Logic

Classical First-Order Logic Classical First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) First-Order Logic (Classical) MFES 2008/09

More information

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories

Halting and Equivalence of Program Schemes in Models of Arbitrary Theories Halting and Equivalence of Program Schemes in Models of Arbitrary Theories Dexter Kozen Cornell University, Ithaca, New York 14853-7501, USA, kozen@cs.cornell.edu, http://www.cs.cornell.edu/~kozen In Honor

More information

Parikh s theorem. Håkan Lindqvist

Parikh s theorem. Håkan Lindqvist Parikh s theorem Håkan Lindqvist Abstract This chapter will discuss Parikh s theorem and provide a proof for it. The proof is done by induction over a set of derivation trees, and using the Parikh mappings

More information

Two-Variable Logic on Data Trees and XML Reasoning

Two-Variable Logic on Data Trees and XML Reasoning Two-Variable Logic on Data Trees and XML Reasoning Miko laj Bojańczyk Warsaw University and Anca Muscholl LABRI & Université Bordeaux 1 and Thomas Schwentick Universität Dortmund and Luc Segoufin INRIA

More information

The semijoin algebra and the guarded fragment

The semijoin algebra and the guarded fragment The semijoin algebra and the guarded fragment Dirk Leinders (dirk.leinders@luc.ac.be) Limburgs Universitair Centrum, Universitaire Campus, Diepenbeek, Belgium Maarten Marx (marx@science.uva.nl) Informatics

More information

Algorithmic Meta-Theorems

Algorithmic Meta-Theorems Algorithmic Meta-Theorems Stephan Kreutzer Oxford University Computing Laboratory stephan.kreutzer@comlab.ox.ac.uk Abstract. Algorithmic meta-theorems are general algorithmic results applying to a whole

More information

The Natural Order-Generic Collapse for ω-representable Databases over the Rational and the Real Ordered Group

The Natural Order-Generic Collapse for ω-representable Databases over the Rational and the Real Ordered Group The Natural Order-Generic Collapse for ω-representable Databases over the Rational and the Real Ordered Group Nicole Schweikardt Institut für Informatik / FB 17 Johannes Gutenberg-Universität, D-55099

More information

The expressive power of two-variable least fixed-point logics

The expressive power of two-variable least fixed-point logics The expressive power of two-variable least fixed-point logics Martin Grohe, Stephan Kreutzer, and Nicole Schweikardt Institut für Informatik, Humboldt-Universität, Berlin {grohe,kreutzer,schweika}@informatik.hu-berlin.de

More information

First-Order and Temporal Logics for Nested Words

First-Order and Temporal Logics for Nested Words First-Order and Temporal Logics for Nested Words Rajeev Alur Marcelo Arenas Pablo Barceló University of Pennsylvania Pontificia Universidad Católica de Chile Universidad de Chile Kousha Etessami Neil Immerman

More information

Tree Automata with Global Constraints

Tree Automata with Global Constraints Tree Automata with Global Constraints Emmanuel Filiot 1 Jean-Marc Talbot 2 Sophie Tison 1 1 INRIA Lille - Nord Europe, Mostrare Project, University of Lille 1 (LIFL, UMR 8022 of CNRS) 2 University of Provence

More information

Deciding Twig-definability of Node Selecting Tree Automata

Deciding Twig-definability of Node Selecting Tree Automata Deciding Twig-definability of Node Selecting Tree Automata Timos Antonopoulos Hasselt University and Transnational University of Limburg timos.antonopoulos@uhasselt.be Wim Martens Institut für Informatik

More information

TR : Binding Modalities

TR : Binding Modalities City University of New York (CUNY) CUNY Academic Works Computer Science Technical Reports Graduate Center 2012 TR-2012011: Binding Modalities Sergei N. Artemov Tatiana Yavorskaya (Sidon) Follow this and

More information

TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER

TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER Logical Methods in Computer Science Vol. 12(2:8)2016, pp. 1 31 www.lmcs-online.org Submitted Nov. 2, 2015 Published Jun. 23, 2016 TWO-VARIABLE LOGIC WITH COUNTING AND A LINEAR ORDER WITOLD CHARATONIK AND

More information

Foundations of Mathematics

Foundations of Mathematics Foundations of Mathematics Andrew Monnot 1 Construction of the Language Loop We must yield to a cyclic approach in the foundations of mathematics. In this respect we begin with some assumptions of language

More information

Minimizing Tree Automata for Unranked Trees

Minimizing Tree Automata for Unranked Trees Minimizing Tree Automata for Unranked Trees [Extended Abstract] Wim Martens 1, and Joachim Niehren 2 1 Hasselt University and Transnational University of Limburg, Agoralaan, gebouw D, B-3590 Diepenbeek,

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

Tractable Counting of the Answers to Conjunctive Queries

Tractable Counting of the Answers to Conjunctive Queries Tractable Counting of the Answers to Conjunctive Queries Reinhard Pichler and Sebastian Skritek Technische Universität Wien, {pichler, skritek}@dbai.tuwien.ac.at Abstract. Conjunctive queries (CQs) are

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

Learning MSO-definable hypotheses on strings

Learning MSO-definable hypotheses on strings Proceedings of Machine Learning Research 76:1 18, 2017 Algorithmic Learning Theory 2017 Learning MSO-definable hypotheses on strings Martin Grohe Christof Löding Martin Ritzert RWTH Aachen University Germany

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

VC-DENSITY FOR TREES

VC-DENSITY FOR TREES VC-DENSITY FOR TREES ANTON BOBKOV Abstract. We show that for the theory of infinite trees we have vc(n) = n for all n. VC density was introduced in [1] by Aschenbrenner, Dolich, Haskell, MacPherson, and

More information

On the relationships between theories of time granularity and the monadic second-order theory of one successor

On the relationships between theories of time granularity and the monadic second-order theory of one successor On the relationships between theories of time granularity and the monadic second-order theory of one successor Angelo Montanari * Adriano Peron ** Gabriele Puppis * * Dipartimento di Matematica e Informatica

More information

Efficient Reasoning about Data Trees via Integer Linear Programming

Efficient Reasoning about Data Trees via Integer Linear Programming Efficient Reasoning about Data Trees via Integer Linear Programming CLAIRE DAVID, Université Paris-Est LEONID LIBKIN and TONY TAN, University of Edinburgh Data trees provide a standard abstraction of XML

More information

Deciding XPath Containment with MSO

Deciding XPath Containment with MSO Deciding XPath Containment with MSO Pierre Genevès and Nabil Layaïda INRIA Rhône-Alpes, 655 avenue de l Europe, 38330 Montbonnot, France Abstract XPath is the standard language for addressing parts of

More information

Predicate Logic - Introduction

Predicate Logic - Introduction Outline Motivation Predicate Logic - Introduction Predicates & Functions Quantifiers, Coming to Terms with Formulas Quantifier Scope & Bound Variables Free Variables & Sentences c 2001 M. Lawford 1 Motivation:

More information

A Logical Formulation of the Granular Data Model

A Logical Formulation of the Granular Data Model 2008 IEEE International Conference on Data Mining Workshops A Logical Formulation of the Granular Data Model Tuan-Fang Fan Department of Computer Science and Information Engineering National Penghu University

More information

06 From Propositional to Predicate Logic

06 From Propositional to Predicate Logic Martin Henz February 19, 2014 Generated on Wednesday 19 th February, 2014, 09:48 1 Syntax of Predicate Logic 2 3 4 5 6 Need for Richer Language Predicates Variables Functions 1 Syntax of Predicate Logic

More information

Introduction to first-order logic:

Introduction to first-order logic: Introduction to first-order logic: First-order structures and languages. Terms and formulae in first-order logic. Interpretations, truth, validity, and satisfaction. Valentin Goranko DTU Informatics September

More information

Herbrand Theorem, Equality, and Compactness

Herbrand Theorem, Equality, and Compactness CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Herbrand Theorem, Equality, and Compactness The Herbrand Theorem We now consider a complete method for proving the unsatisfiability of sets of first-order

More information

Relational completeness of query languages for annotated databases

Relational completeness of query languages for annotated databases Relational completeness of query languages for annotated databases Floris Geerts 1,2 and Jan Van den Bussche 1 1 Hasselt University/Transnational University Limburg 2 University of Edinburgh Abstract.

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

Monadic Second Order Logic on Graphs with Local Cardinality Constraints

Monadic Second Order Logic on Graphs with Local Cardinality Constraints Monadic Second Order Logic on Graphs with Local Cardinality Constraints STEFAN SZEIDER Vienna University of Technology, Austria We introduce the class of MSO-LCC problems which are problems of the following

More information

arxiv: v5 [cs.fl] 21 Feb 2012

arxiv: v5 [cs.fl] 21 Feb 2012 Streaming Tree Transducers Rajeev Alur and Loris D Antoni University of Pennsylvania February 23, 2012 arxiv:1104.2599v5 [cs.fl] 21 Feb 2012 Abstract Theory of tree transducers provides a foundation for

More information

ON MONADIC LOGIC OF RECURSIVE PROGRAMS WITH PARAMETERS

ON MONADIC LOGIC OF RECURSIVE PROGRAMS WITH PARAMETERS Bulletin of the Section of Logic Volume 18/2 (1989), pp. 57 61 reedition 2006 [original edition, pp. 57 62] A. L. Rastsvetaev ON MONADIC LOGIC OF RECURSIVE PROGRAMS WITH PARAMETERS 1. Introduction The

More information

Automata for Branching and Layered Temporal Structures

Automata for Branching and Layered Temporal Structures Università degli Studi di Udine Dipartimento di Matematica e Informatica Dottorato di Ricerca in Informatica Thesis Automata for Branching and Layered Temporal Structures Gabriele Puppis March 31, 2006

More information

The complexity of first-order and monadic second-order logic revisited

The complexity of first-order and monadic second-order logic revisited The complexity of first-order and monadic second-order logic revisited Markus Frick Martin Grohe May 2, 2002 Abstract The model-checking problem for a logic L on a class C of structures asks whether a

More information

On the use of guards for logics with data

On the use of guards for logics with data On the use of guards for logics with data Thomas Colcombet 1, Clemens Ley 2, Gabriele Puppis 2 1 CNRS/LIAFA 2 Department of Computer Science, Oxford University Abstract. The notion of orbit finite data

More information

Composing Schema Mappings: Second-Order Dependencies to the Rescue

Composing Schema Mappings: Second-Order Dependencies to the Rescue Composing Schema Mappings: Second-Order Dependencies to the Rescue RONALD FAGIN IBM Almaden Research Center PHOKION G. KOLAITIS IBM Almaden Research Center LUCIAN POPA IBM Almaden Research Center WANG-CHIEW

More information

Computational Logic. Relational Query Languages with Negation. Free University of Bozen-Bolzano, Werner Nutt

Computational Logic. Relational Query Languages with Negation. Free University of Bozen-Bolzano, Werner Nutt Computational Logic Free University of Bozen-Bolzano, 2010 Werner Nutt (Slides adapted from Thomas Eiter and Leonid Libkin) Computational Logic 1 Queries with All Who are the directors whose movies are

More information

Comp487/587 - Boolean Formulas

Comp487/587 - Boolean Formulas Comp487/587 - Boolean Formulas 1 Logic and SAT 1.1 What is a Boolean Formula Logic is a way through which we can analyze and reason about simple or complicated events. In particular, we are interested

More information

Algebra for Infinite Forests with an Application to the Temporal Logic EF

Algebra for Infinite Forests with an Application to the Temporal Logic EF Algebra for Infinite Forests with an Application to the Temporal Logic EF Miko laj Bojańczyk and Tomasz Idziaszek University of Warsaw, Poland {bojan,idziaszek}@mimuw.edu.pl Abstract. We define an extension

More information

Regular transformations of data words through origin information

Regular transformations of data words through origin information Regular transformations of data words through origin information Antoine Durand-Gasselin 1 and Peter Habermehl 2 1 Aix Marseille Université, CNRS & Centrale Marseille Antoine.Durand-Gasselin@centrale-marseille.fr

More information

Containment for XPath Fragments under DTD Constraints

Containment for XPath Fragments under DTD Constraints Containment for XPath Fragments under DTD Constraints Peter Wood School of Computer Science and Information Systems Birkbeck College University of London United Kingdom email: ptw@dcs.bbk.ac.uk 1 Outline

More information

Halting and Equivalence of Schemes over Recursive Theories

Halting and Equivalence of Schemes over Recursive Theories Halting and Equivalence of Schemes over Recursive Theories Dexter Kozen Computer Science Department, Cornell University, Ithaca, New York 14853-7501, USA Abstract Let Σ be a fixed first-order signature.

More information