XPath with transitive closure

Size: px
Start display at page:

Download "XPath with transitive closure"

Transcription

1 XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb Navigating XML trees XPath with transitive closure Newton Institute: Logic and Databases Maarten Marx Feb 2006 Navigation is at the core of XML processing. Navigation is about paths between nodes. The two main XML query languages XSLT and XQuery have delegated the navigation part to XPath. This talk is about binary relations between nodes in finite, unbounded, sibling ordered, node labelled trees. XPath with transitive closure Logic and Databases Feb XPath XPath 2.0 is explicitly designed to be first order complete. XQuery is strong enough to define whatever more you want. So why would we consider stronger versions of XPath? XPath with transitive closure Logic and Databases Feb XPath with transitive closure: Why? It s natural Regular Path Queries [ABS 2000] Core XPath is a handicapped version of Propositional Dynamic Logic (PDL): only Kleene star on the basic steps. It s needed Both Saxon and Xalan provide implementations of the EXSLT closure function. Nentwich et al 2002 describe several use-cases. (They have an example of a university curriculum, with rules like A course cannot be a pre-requisite of itself.) It s clean and algebraic Simple extension of regular languages with a few extras. Easier to optimize than user-defined functions. It s fun Well, let s see... XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb Regular Path Queries, a.k.a. Caterpillars Regular Path Queries are the navigation language of [ABS2000, Data on the Web]. Caterpillars originate with [Brüggemann-Klein, Wood 2000]. On XML documents, they are the same. Design idea: a path in a tree is like a string of child, parent, left, right steps and tests on node labels. So use regular expressions over these and the four endtests root leaf first last. XPath with transitive closure Logic and Databases Feb The depth first traversal from the root to the last node: as a string: child child right parent right child... as a regular expression: XPath with transitive closure Logic and Databases Feb

2 XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb Regular Path Queries, a.k.a. Caterpillars: Syntax The atomic symbols of the language are axis ::= self child parent right left. test ::= p root leaf first last. The expressions are generated by the grammar: R ::= axis test R R R/R R +. We can take either or + as primitive. XPath with transitive closure Logic and Databases Feb Regular Path Queries, a.k.a. Caterpillars: Semantics Every expression denotes a path, a binary relation: [p] = {(x, x) x is labelled by p} [leaf ] = {(x, x) x is a leaf} [child] = {(x, y) y is a child of x} etc. [R S ] = union of [R] and [S ]. [R/S ] = [R] [S ] (composition of binary relations) [R + ] = transitive closure of [R]. XPath with transitive closure Logic and Databases Feb Caterpillars: results Positive The expressive power of the language is characterized by tree walk automata. Query evaluation is tractable. Very expressible as a tree language (e.g., DTD s). Theorem [Bojanczyk Colcombet 2004] Caterpillars cannot define all regular tree languages. Every expression defines a monadic second order definable binary relation. XPath with transitive closure Logic and Databases Feb Caterpillars as a navigation language Caterpillars are too weak for a navigation language: Simple structural tests on nodes are not expressible: {(x, x) the parent of x is labelled p} {(x, x) all nodes in the subtree of x are labelled p}. To summarize: F O caterpillars MSO. XPath with transitive closure Logic and Databases Feb

3 XPath with transitive closure Logic and Databases Feb Caterpillars loose their way. Try to program {(x, x) some child of x is labelled p} as a caterpillar expression. child/p/parent Now try its inverse {(x, x) the parent of x is labelled p}. parent/p/child only works on unary trees. We want parent/p/child self XPath with transitive closure Logic and Databases Feb Tree walk automata (TWA s) TWA s are a sequential alternative to (parallel) tree automata. A TWA is just a finite state automaton on the language axis test. axis ::= self child parent right left. test ::= p root leaf first last. The input of a TWA is a tree and two nodes. A formal proof of this inexpressibility result can be given using tree walk automata. XPath with transitive closure Logic and Databases Feb TWA s, transitions and acceptance The transition relation between state node pairs is defined from the transition function δ: t, q test t, q q δ( q, test ), and T = test(t) t, q axis t, q q δ( q, axis ), and T = t(axis)t. A TWA accepts a path from t to t in tree T if there exists an initial state q i and a final state q f such that t, q i t, q f. XPath with transitive closure Logic and Databases Feb Adding expressive power to caterpillars The literature shows three ways for expressing structural tests: 1. add explicit memory-devices: pebbles, variables (Pebble TWA s); 2. add a second sort of test expressions, with their own operations (e.g. XPath filters); 3. add new operations on binary relations. Theorem [Brüggeman-Klein, Wood 2000] TWA s and caterpillar expressions can define exactly the same paths. XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb Caterpillars with variable binders I Engelfriet Hoogeboom 2006 add pebbles to Tree Walk Automata. Pebbles can be placed on nodes in the tree, inspected, and picked up. Using pebbles one can remember nodes, and for instance, come back. Equivalently one can add variables and a binder to the caterpillar exppresions. XPath with transitive closure Logic and Databases Feb Caterpillars with variable binders II Idea: add a syntactic equivalent of pebbles to caterpillars: add variables to the language; allow testing of a variable; add a binder x (R). Example: In XPath 2.0: x (parent/p/child/x) I have a p parent. for $x in. return $x/parent::p/child::*[. is $x] XPath with transitive closure Logic and Databases Feb Caterpillars with variable binders: results The language is characterized by pebble TWA s (Gorris, M. 2005). Pebble TWA s are weaker than MSO (Bojańczyk, Samuelides, Schwentick, Segoufin 2006). Thus caterpillars with variable binders are weaker than MSO. Every FO relation with quantifier depth k is definable by a deterministic k-pebble TWA (Engelfriet, Hoogeboom 1999). From the proof it follows that there is a linear translation from FO to Caterpillars with variable binders. Hence, the combined complexity of query evaluation of caterpillars with binders is PSPACE complete.

4 XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb Adding structural tests I Idea Add formulas in one free variable as tests. Bloem Engelfriet 1997 added all MSO definable tests φ(x) to caterpillars. Then every MSO definable binary relation becomes definable. One can implement this using e.g. the modal µ-calculus, or using Gottlob and Koch s unary Monadic Datalog for trees. XPath with transitive closure Logic and Databases Feb Adding structural tests II Both Propositional Dynamic Logic (PDL) and XPath add the same structural tests: domain(r) and all booleans. domain(r) = {x y : xry}. I have a p parent becomes expressible: PDL parent p? XPath self :: [parent :: p]. There is also an alternative way to achieve this: through the counterdomain operator. XPath with transitive closure Logic and Databases Feb Counterdomain and safety for bisimulation van Benthem considered the following puzzle: Consider a bisimulation B which preserves atomic labels P and bisimulates the relations R 1,... R n. Then B also bisimulates other relations: for instance, 1. R i /R j ; 2. R i ; 3. R i R j ; Question What are the first order definable binary relations which are safe for bisimulations? Answer Exactly those definable from R 1,... R n and atomic tests on P and using only composition, union, and counterdomain. XPath with transitive closure Logic and Databases Feb Counterdomain For R a binary relation, R = {(x, x) not y : xry}. Examples: 1. (parent/p) defines I am not in the domain of parent/p. 2. (parent/p) defines I have a p parent. 3. (child + / p) defines all my descendants are p XPath with transitive closure Logic and Databases Feb Caterpillars with counterdomain Adding counterdomain to caterpillars gives an alternative definition of PDL over ordered trees, because ( R φ)? = (R/φ?) ( φ)? = (φ?) (φ ψ)? = (φ)?/(ψ)? With counterdomain we can also give a very short definition of Core XPath. XPath with transitive closure Logic and Databases Feb Aside: Clean algebraic version of Core XPath The atomic symbols of the language are axis ::= child parent right left child + parent + right + left +. test ::= p. The expressions are generated by the grammar: R ::= axis test R R R/R R. self is definable as (child child). XPath with transitive closure Logic and Databases Feb is definable as self.

5 XPath with transitive closure Logic and Databases Feb We just saw counterdomain. Adding new operations XPath 2.0 even adds intersection and complementation of path expressions to the language. Then counterdomain becomes definable: R self R/all. Of particular interest is intersection with the identity. XPath with transitive closure Logic and Databases Feb Intersection with identity I have a p parent is expressed by parent/p/child self. This operation resembles equality in XPath: [. = parent :: p/child :: ]. [$R = $S] is true if there exists nodes r $R, s $S which have the same atomic value. We call this operation loop: R loop R self. XPath with transitive closure Logic and Databases Feb Looping Caterpillars: results Looping Caterpillars is caterpillars with the extra loop operation. (Gorris, M 2005) saw it as the synthesis between Regular Path expressions and XPath 2.0: every FO definable relation is expressible it contains the caterpillar expressions XPath with transitive closure Logic and Databases Feb Looping Caterpillars: open problems Are all PDL tests definable? More general, is the language closed under counterdomain? Query evaluation is tractable. Expressive power is characterized by a restricted version of pebble TWA s. So it is still a strict subset of MSO. XPath with transitive closure Logic and Databases Feb XPath with transitive closure Logic and Databases Feb Caterpillars with counterdomain: Regular XPath ten Cate (2005) tried to characterize Caterpillars with counterdomain in terms of a natural logical language. One can also think of this as PDL on trees (also known as Regular XPath). He conjectures that the following relation is not expressible in Caterpillars with counterdomain: {(x, x) x has an even number of descendants}. XPath with transitive closure Logic and Databases Feb I have an even number of descendants {(x, x) x has an even number of descendants} is expressible using loop. Let next denote the successor relation in the document order. This is already caterpillar definable. Then ((next/next) /(last/parent) ) loop does the job. Note that without loop one could shoot back too much. XPath with transitive closure Logic and Databases Feb Caterpillars with counterdomain and loop Ten Cate added loop to Regular XPath and calls it RegularXPath =. It has the following syntax: axis ::= child parent right left. test ::= p. R ::= axis test R R R/R R + R loop R. An alternative is to add the test loop(r) to PDL on trees. n = loop(r) (n, n) = R. Then R loop loop(r)? and loop(r) R loop.

6 XPath with transitive closure Logic and Databases Feb Caterpillars with counterdomain and loop: results Theorem [ten Cate 2005] The following are equivalent: 1. a binary relation is definable in caterpillars with counterdomain and loop; 2. a binary relation is definable as a formula φ(x, y) in first order logic expanded with the Kleene star. M = φ (a, b) if and only if there are a = c 1,..., c n = b such that M = φ(c i, c i+1 ). One can only apply the Kleene star to formulas with exactly two free variables. XPath with transitive closure Logic and Databases Feb Caterpillars with counterdomain and loop: open problems 1. Does loop contribute to the expressive power? 2. Is the language strictly less expressive than MSO? 3. What is a good automata model for this language? 4. What is the complexity of the containment problem for Regular XPath extended with loop? (Without loop it is known to be EXPTIME complete). 5. Find efficient algorithms for query evaluation. (Without loop, a linear algorithm exists). XPath with transitive closure Logic and Databases Feb Conclusion Caterpillars with counterdomain and loop form a nice synthesis between a number of approaches to XML reasoning: Caterpillar expressions, regular path queries, DTD s First order logic, XPath 2.0 Propositional Dynamic Logic Its expressive completeness shows that it is a natural choice of language.

Semantic Characterizations of XPath

Semantic Characterizations of XPath Semantic Characterizations of XPath Maarten Marx Informatics Institute, University of Amsterdam, The Netherlands CWI, April, 2004 1 Overview Navigational XPath is a language to specify sets and paths in

More information

Trees, Automata and XML

Trees, Automata and XML A Mini Course on Trees, Automata and XML Paris June 2004 Thomas Schwentick PODS 2004 Thomas Schwentick Trees, Automata & XML 1 Intro Three Questions Question 1 Why XML? Answer Have a look into the 20 XML

More information

Automata for XML A survey

Automata for XML A survey Journal of Computer and System Sciences 73 (2007) 289 315 www.elsevier.com/locate/jcss Automata for XML A survey Thomas Schwentick University of Dortmund, Department of Computer Science, 44221 Dortmund,

More information

Complementing deterministic tree-walking automata

Complementing deterministic tree-walking automata Complementing deterministic tree-walking automata Anca Muscholl LIAFA & CNRS, Université Paris 7, France Luc Segoufin INRIA & Université Paris 11, France September 12, 2005 Mathias Samuelides LIAFA and

More information

Counting multiplicity over infinite alphabets

Counting multiplicity over infinite alphabets Counting multiplicity over infinite alphabets Amal Dev Manuel and R. Ramanujam The Institute of Mathematical Sciences, Chennai, India {amal,jam}@imsc.res.in Summary Motivation for infinite data. We need

More information

Formal Methods for XML: Algorithms & Complexity

Formal Methods for XML: Algorithms & Complexity Formal Methods for XML: Algorithms & Complexity S. Margherita di Pula September 2004 Thomas Schwentick Schwentick XML: Algorithms & Complexity Introduction 1 Disclaimer About this talk It will be Theory

More information

Reasoning on Words and Trees with Data

Reasoning on Words and Trees with Data Ph.D. Thesis Summary Reasoning on Words and Trees with Data Author: Diego Figueira Supervisors: Luc Segoufin, Stéphane Demri Abstract A data word (resp. a data tree) is a finite word (resp. tree) whose

More information

XPath from a Logical Point of View

XPath from a Logical Point of View XPath from a Logical Point of View Tadeusz Litak (joint work with Balder ten Cate, Maarten Marx and Gaëlle Fontaine) Department of Computer Science University of Leicester 15 December 2010 MGS Christmas

More information

Automata, Logic, and XML

Automata, Logic, and XML Automata, Logic, and XML Frank Neven University of Limburg frank.neven@luc.ac.be Abstract. We survey some recent developments in the broad area of automata and logic which are motivated by the advent of

More information

XPath evaluation in linear time with polynomial combined complexity

XPath evaluation in linear time with polynomial combined complexity XPath evaluation in linear time with polynomial combined complexity Paweł Parys (Common work with Mikołaj Bojańczyk) XPath is a query language: XPath queries select nodes in a XML document tree. We consider

More information

Properties of binary transitive closure logics over trees. 8.1 Introduction

Properties of binary transitive closure logics over trees. 8.1 Introduction 8 Properties of binary transitive closure logics over trees STEPHAN KEPSER Abstract Binary transitive closure logic (FO for short) is the extension of first-order predicate logic by a transitive closure

More information

Regular Expressions for Data Words

Regular Expressions for Data Words Regular Expressions for Data Words Leonid Libkin and Domagoj Vrgoč School of Informatics, University of Edinburgh Abstract. In data words, each position carries not only a letter form a finite alphabet,

More information

Foundations of Computer Science Spring Mathematical Preliminaries

Foundations of Computer Science Spring Mathematical Preliminaries Foundations of Computer Science Spring 2017 Equivalence Relation, Recursive Definition, and Mathematical Induction Mathematical Preliminaries Mohammad Ashiqur Rahman Department of Computer Science College

More information

Lekker bomen. Loredana Afanasiev, Balder ten Cate and Maarten Marx ISLA, Universiteit van Amsterdam The Netherlands.

Lekker bomen. Loredana Afanasiev, Balder ten Cate and Maarten Marx ISLA, Universiteit van Amsterdam The Netherlands. Lekker bomen Loredana Afanasiev, Balder ten Cate and Maarten Marx ISLA, Universiteit van Amsterdam The Netherlands January 31, 2007 It has been proclaimed that logic is the calculus of computer science

More information

Containment of Data Graph Queries

Containment of Data Graph Queries Containment of Data Graph Queries Egor V. Kostylev University of Oxford and University of Edinburgh egor.kostylev@cs.ox.ac.uk Juan L. Reutter PUC Chile jreutter@ing.puc.cl Domagoj Vrgoč University of Edinburgh

More information

Craig Interpolation Theorems and Database Applications

Craig Interpolation Theorems and Database Applications Craig Interpolation Theorems and Database Applications Balder ten Cate! LogicBlox & UC Santa Cruz!!!! November 7, 2014, UC Berkeley - Logic Colloquium! 1 Craig Interpolation William Craig (1957): For all

More information

XML Research for Formal Language Theorists

XML Research for Formal Language Theorists XML Research for Formal Language Theorists Wim Martens TU Dortmund Wim Martens (TU Dortmund) XML for Formal Language Theorists May 14, 2008 1 / 65 Goal of this talk XML Research vs Formal Languages Wim

More information

Expressiveness of Minmax Automata

Expressiveness of Minmax Automata Expressiveness of Minmax Automata Amaldev Manuel LIAFA, Université Paris Diderot!! joint work with! Thomas Colcombet Stefan Göller Minmax Automata Finite state automaton equipped with +ve-integer registers

More information

Some Interdefinability Results for Syntactic Constraint Classes

Some Interdefinability Results for Syntactic Constraint Classes Some Interdefinability Results for Syntactic Constraint Classes Thomas Graf tgraf@ucla.edu tgraf.bol.ucla.edu University of California, Los Angeles Mathematics of Language 11 Bielefeld, Germany 1 The Linguistic

More information

Binary Trees

Binary Trees Binary Trees 4-7-2005 Opening Discussion What did we talk about last class? Do you have any code to show? Do you have any questions about the assignment? What is a Tree? You are all familiar with what

More information

1 Introduction... 1 1.1 A Database Example... 1 1.2 An Example from Complexity Theory...................... 4 1.3 An Example from Formal Language Theory................. 6 1.4 An Overview of the Book.................................

More information

Regular Path Queries on Graphs with Data

Regular Path Queries on Graphs with Data Regular Path Queries on Graphs with Data Leonid Libkin Domagoj Vrgoč ABSTRACT Graph data models received much attention lately due to applications in social networks, semantic web, biological databases

More information

XML databases. Jan Chomicki. University at Buffalo. Jan Chomicki (University at Buffalo) XML databases 1 / 9

XML databases. Jan Chomicki. University at Buffalo. Jan Chomicki (University at Buffalo) XML databases 1 / 9 XML databases Jan Chomicki University at Buffalo Jan Chomicki (University at Buffalo) XML databases 1 / 9 Outline 1 XML data model 2 XPath 3 XQuery Jan Chomicki (University at Buffalo) XML databases 2

More information

Finding Your Way in a Forest: On Different Types of Trees and Their Properties

Finding Your Way in a Forest: On Different Types of Trees and Their Properties Finding Your Way in a Forest: On Different Types of Trees and Their Properties Igor Walukiewicz To cite this version: Igor Walukiewicz. Finding Your Way in a Forest: On Different Types of Trees and Their

More information

XML and Databases. Lecture 9 Properties of XPath. Sebastian Maneth NICTA and UNSW

XML and Databases. Lecture 9 Properties of XPath. Sebastian Maneth NICTA and UNSW XML and Databases Lecture 9 Properties of XPath Sebastian Maneth NICTA and UNSW CSE@UNSW -- Semester 1, 2009 Outline 1. XPath Equivalence 2. No Looking Back: How to Remove Backward Axes 3. Containment

More information

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02

LTCS Report. Concept Descriptions with Set Constraints and Cardinality Constraints. Franz Baader. LTCS-Report 17-02 Technische Universität Dresden Institute for Theoretical Computer Science Chair for Automata Theory LTCS Report Concept Descriptions with Set Constraints and Cardinality Constraints Franz Baader LTCS-Report

More information

Automata Theory for Reasoning about Actions

Automata Theory for Reasoning about Actions Automata Theory for Reasoning about Actions Eugenia Ternovskaia Department of Computer Science, University of Toronto Toronto, ON, Canada, M5S 3G4 eugenia@cs.toronto.edu Abstract In this paper, we show

More information

Bounded depth data trees

Bounded depth data trees Bounded depth data trees Henrik Björklund 1 Miko laj Bojańczyk 2 1 University of Dortmund 2 Warsaw University Abstract. A data tree is a tree where each node has a label from a finite set, and a data value

More information

Graph algorithms based on infinite automata: logical descriptions and usable constructions

Graph algorithms based on infinite automata: logical descriptions and usable constructions Graph algorithms based on infinite automata: logical descriptions and usable constructions Bruno Courcelle (joint work with Irène Durand) Bordeaux-1 University, LaBRI (CNRS laboratory) 1 Overview Algorithmic

More information

Finite Model Theory and Its Applications

Finite Model Theory and Its Applications Erich Grädel Phokion G. Kolaitis Leonid Libkin Maarten Marx Joel Spencer Moshe Y. Vardi Yde Venema Scott Weinstein Finite Model Theory and Its Applications With 35 Figures and 2 Tables Springer Contents

More information

FOUNDATIONS OF DATABASES AND QUERY LANGUAGES

FOUNDATIONS OF DATABASES AND QUERY LANGUAGES FOUNDATIONS OF DATABASES AND QUERY LANGUAGES Lecture 14: Database Theory in Practice Markus Krötzsch TU Dresden, 20 July 2015 Overview 1. Introduction Relational data model 2. First-order queries 3. Complexity

More information

Relative Expressive Power of Navigational Querying on Graphs

Relative Expressive Power of Navigational Querying on Graphs Relative Expressive Power of Navigational Querying on Graphs George H. L. Fletcher Eindhoven University of Technology g.h.l.fletcher@tue.nl Jan Van den Bussche Hasselt University & Transnational Univ.

More information

We ve studied the main models and concepts of the theory of computation:

We ve studied the main models and concepts of the theory of computation: CMPSCI 601: Summary & Conclusions Lecture 27 We ve studied the main models and concepts of the theory of computation: Computability: what can be computed in principle Logic: how can we express our requirements

More information

Monadic Datalog Containment on Trees

Monadic Datalog Containment on Trees Monadic Datalog Containment on Trees André Frochaux 1, Martin Grohe 2, and Nicole Schweikardt 1 1 Goethe-Universität Frankfurt am Main, {afrochaux,schweika}@informatik.uni-frankfurt.de 2 RWTH Aachen University,

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

Towards Schema-Guided XML Query Induction

Towards Schema-Guided XML Query Induction Towards Schema-Guided XML Query Induction Jérôme Champavère Rémi Gilleron Aurélien Lemay Joachim Niehren Université de Lille INRIA, France ICML-2007 Workshop on Challenges and Applications of Grammar Induction

More information

XML Type Checking with Macro Tree Transducers

XML Type Checking with Macro Tree Transducers XML Type Checking with Macro Tree Transducers S. Maneth École Polytechnique Fédérale de Lausanne 1015 Lausanne, Switzerland sebastian.maneth@epfl.ch A. Berlea, T. Perst, H. Seidl Technische Universität

More information

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2011 1. Introduction: Relational Query Languages Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 8 March,

More information

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,, CMPSCI 601: Recall From Last Time Lecture 5 Definition: A context-free grammar (CFG) is a 4- tuple, variables = nonterminals, terminals, rules = productions,,, are all finite. 1 ( ) $ Pumping Lemma for

More information

Modal logic of the planar polygons

Modal logic of the planar polygons Modal logic of the planar polygons David Gabelaia TSU Razmadze Mathematical Institute Kristina Gogoladze Ivane Javakhishvili Tbilisi State University Mamuka Jibladze TSU Razmadze Mathematical Institute

More information

Streaming Tree Transducers

Streaming Tree Transducers Streaming Tree Transducers Rajeev Alur and Loris D Antoni University of Pennsylvania Abstract. Theory of tree transducers provides a foundation for understanding expressiveness and complexity of analysis

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Lecture 9 - Jan. 22, 2018 CLRS 12.2, 12.3, 13.2, read problem 13-3 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures

More information

H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views

H2 Spring B. We can abstract out the interactions and policy points from DoDAF operational views 1. (4 points) Of the following statements, identify all that hold about architecture. A. DoDAF specifies a number of views to capture different aspects of a system being modeled Solution: A is true: B.

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Lecture 9 - Jan. 22, 2018 CLRS 12.2, 12.3, 13.2, read problem 13-3 University of Manitoba 1 / 12 Binary Search Trees (review) Structure

More information

Outline of this part (I) Part IV. Querying XML Documents. Querying XML Documents. Outline of this part (II)

Outline of this part (I) Part IV. Querying XML Documents. Querying XML Documents. Outline of this part (II) Outline of this part (I) Part IV Querying XML Documents Marc H. Scholl (DBIS, Uni KN) XML and Databases Winter 2007/08 164 8 XPath Navigational access to XML documents Overview Context Location steps Navigation

More information

Slides for Faculty Oxford University Press All rights reserved.

Slides for Faculty Oxford University Press All rights reserved. Oxford University Press 2013 Slides for Faculty Assistance Preliminaries Author: Vivek Kulkarni vivek_kulkarni@yahoo.com Outline Following topics are covered in the slides: Basic concepts, namely, symbols,

More information

Verifiable Hierarchical Protocols with Network Invariants on Parametric Systems

Verifiable Hierarchical Protocols with Network Invariants on Parametric Systems Verifiable Hierarchical Protocols with Network Invariants on Parametric Systems Opeoluwa Matthews, Jesse Bingham, Daniel Sorin http://people.duke.edu/~om26/ FMCAD 2016 - Mountain View, CA Problem Statement

More information

Ling/CSE 472: Introduction to Computational Linguistics. 4/6/15: Morphology & FST 2

Ling/CSE 472: Introduction to Computational Linguistics. 4/6/15: Morphology & FST 2 Ling/CSE 472: Introduction to Computational Linguistics 4/6/15: Morphology & FST 2 Overview Review: FSAs & FSTs XFST xfst demo Examples of FSTs for spelling change rules Reading questions Review: FSAs

More information

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1

Copyright 2007 Ramez Elmasri and Shamkant B. Navathe. Slide 27-1 Slide 27-1 Chapter 27 XML: Extensible Markup Language Chapter Outline Introduction Structured, Semi structured, and Unstructured Data. XML Hierarchical (Tree) Data Model. XML Documents, DTD, and XML Schema.

More information

Definability equals recognizability for graphs of bounded treewidth

Definability equals recognizability for graphs of bounded treewidth Definability equals recognizability for graphs of bounded treewidth Mikołaj Bojańczyk Michał Pilipczuk University of Warsaw {bojan,michal.pilipczuk}@mimuw.edu.pl Abstract We prove a conjecture of Courcelle,

More information

Graph Query Verification using Monadic 2 nd -Order Logic

Graph Query Verification using Monadic 2 nd -Order Logic 1 Graph Query Verification using Monadic 2 nd -Order Logic Graph Kazuhiro Inaba ( 稲葉一浩 ) kinaba@nii.ac.jp Oct 10, 2010 1 st PKU-NII International Joint Workshop on Advanced Software Engineering 2 Goal

More information

Schema-Guided Query Induction

Schema-Guided Query Induction Schema-Guided Query Induction Jérôme Champavère Ph.D. Defense September 10, 2010 Supervisors: Joachim Niehren and Rémi Gilleron Advisor: Aurélien Lemay Introduction Big Picture XML: Standard language for

More information

Journal of Computer and System Sciences

Journal of Computer and System Sciences Journal of Computer and System Sciences 78 (2012) 583 609 Contents lists available at SciVerse ScienceDirect Journal of Computer and System Sciences www.elsevier.com/locate/jcss A structural/temporal query

More information

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler

Database Theory VU , SS Introduction: Relational Query Languages. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2018 1. Introduction: Relational Query Languages Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 6 March,

More information

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1 Introduction to Automata Theory BİL405 - Automata Theory and Formal Languages 1 Automata, Computability and Complexity Automata, Computability and Complexity are linked by the question: What are the fundamental

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 2.1-2.7 p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

Logical Aspects of Spatial Databases

Logical Aspects of Spatial Databases Logical Aspects of Spatial Databases Part I: First-order geometric and topological queries Jan Van den Bussche Hasselt University Spatial data Q: what is a spatial dataset? A: a set S R n equivalently,

More information

Programming II (CS300)

Programming II (CS300) 1 Programming II (CS300) Chapter 11: Binary Search Trees MOUNA KACEM mouna@cs.wisc.edu Fall 2018 General Overview of Data Structures 2 Introduction to trees 3 Tree: Important non-linear data structure

More information

A Typed Lambda Calculus for Input Sanitation

A Typed Lambda Calculus for Input Sanitation A Typed Lambda Calculus for Input Sanitation Nathan Fulton Carthage College nfulton@carthage.edu April 11, 2013 Abstract Programmers often wish to validate or sanitize user input. One common approach to

More information

A Retrospective on Datalog 1.0

A Retrospective on Datalog 1.0 A Retrospective on Datalog 1.0 Phokion G. Kolaitis UC Santa Cruz and IBM Research - Almaden Datalog 2.0 Vienna, September 2012 2 / 79 A Brief History of Datalog In the beginning of time, there was E.F.

More information

Regular Languages. MACM 300 Formal Languages and Automata. Formal Languages: Recap. Regular Languages

Regular Languages. MACM 300 Formal Languages and Automata. Formal Languages: Recap. Regular Languages Regular Languages MACM 3 Formal Languages and Automata Anoop Sarkar http://www.cs.sfu.ca/~anoop The set of regular languages: each element is a regular language Each regular language is an example of a

More information

(2,4) Trees. 2/22/2006 (2,4) Trees 1

(2,4) Trees. 2/22/2006 (2,4) Trees 1 (2,4) Trees 9 2 5 7 10 14 2/22/2006 (2,4) Trees 1 Outline and Reading Multi-way search tree ( 10.4.1) Definition Search (2,4) tree ( 10.4.2) Definition Search Insertion Deletion Comparison of dictionary

More information

Figure 4.1: The evolution of a rooted tree.

Figure 4.1: The evolution of a rooted tree. 106 CHAPTER 4. INDUCTION, RECURSION AND RECURRENCES 4.6 Rooted Trees 4.6.1 The idea of a rooted tree We talked about how a tree diagram helps us visualize merge sort or other divide and conquer algorithms.

More information

Module 6 Lexical Phase - RE to DFA

Module 6 Lexical Phase - RE to DFA Module 6 Lexical Phase - RE to DFA The objective of this module is to construct a minimized DFA from a regular expression. A NFA is typically easier to construct but string matching with a NFA is slower.

More information

( A(x) B(x) C(x)) (A(x) A(y)) (C(x) C(y))

( A(x) B(x) C(x)) (A(x) A(y)) (C(x) C(y)) 1 Introduction Finite model theory studies the expressive power of logics on finite models. Classical model theory, on the other hand, concentrates on infinite structures: its origins are in mathematics,

More information

Towards a Logical Reconstruction of Relational Database Theory

Towards a Logical Reconstruction of Relational Database Theory Towards a Logical Reconstruction of Relational Database Theory On Conceptual Modelling, Lecture Notes in Computer Science. 1984 Raymond Reiter Summary by C. Rey November 27, 2008-1 / 63 Foreword DB: 2

More information

Regular Languages and Regular Expressions

Regular Languages and Regular Expressions Regular Languages and Regular Expressions According to our definition, a language is regular if there exists a finite state automaton that accepts it. Therefore every regular language can be described

More information

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014 Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation-6: Hardness of Inference Contents 1 NP-Hardness Part-II

More information

2 A topological interlude

2 A topological interlude 2 A topological interlude 2.1 Topological spaces Recall that a topological space is a set X with a topology: a collection T of subsets of X, known as open sets, such that and X are open, and finite intersections

More information

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph. Trees 1 Introduction Trees are very special kind of (undirected) graphs. Formally speaking, a tree is a connected graph that is acyclic. 1 This definition has some drawbacks: given a graph it is not trivial

More information

(Refer Slide Time: 0:19)

(Refer Slide Time: 0:19) Theory of Computation. Professor somenath Biswas. Department of Computer Science & Engineering. Indian Institute of Technology, Kanpur. Lecture-15. Decision Problems for Regular Languages. (Refer Slide

More information

XPath. by Klaus Lüthje Lauri Pitkänen

XPath. by Klaus Lüthje Lauri Pitkänen XPath by Klaus Lüthje Lauri Pitkänen Agenda Introduction History Syntax Additional example and demo Applications Xpath 2.0 Future Introduction Expression language for Addressing portions of an XML document

More information

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Logic Formal Syntax and Semantics. Computability and Logic Propositional Logic Formal Syntax and Semantics Computability and Logic Syntax and Semantics Syntax: The study of how expressions are structured (think: grammar) Semantics: The study of the relationship

More information

DISCRETE MATHEMATICS

DISCRETE MATHEMATICS DISCRETE MATHEMATICS WITH APPLICATIONS THIRD EDITION SUSANNA S. EPP DePaul University THOIVISON * BROOKS/COLE Australia Canada Mexico Singapore Spain United Kingdom United States CONTENTS Chapter 1 The

More information

Web Service Interfaces

Web Service Interfaces Web Service Interfaces Dirk Beyer EPFL, Lausanne, Switzerland dirk.beyer@epfl.ch Arindam Chakrabarti University of California, Berkeley, U.S.A. arindam@cs.berkeley.edu Thomas A. Henzinger EPFL, Lausanne,

More information

Computational Geometry

Computational Geometry Windowing queries Windowing Windowing queries Zoom in; re-center and zoom in; select by outlining Windowing Windowing queries Windowing Windowing queries Given a set of n axis-parallel line segments, preprocess

More information

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and Chapter 6 The Relational Algebra and Relational Calculus Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 Outline Unary Relational Operations: SELECT and PROJECT Relational

More information

Logical Characterization of Weighted Pebble Walking Automata

Logical Characterization of Weighted Pebble Walking Automata Logical Characterization of Weighted Pebble Walking Automata Benedikt Bollig, Paul Gastin LSV, ENS Cachan, CNRS, Inria, Cachan, France bollig,gastin@lsv.ens-cachan.fr Benjamin Monmege Université Libre

More information

CS402 - Theory of Automata Glossary By

CS402 - Theory of Automata Glossary By CS402 - Theory of Automata Glossary By Acyclic Graph : A directed graph is said to be acyclic if it contains no cycles. Algorithm : A detailed and unambiguous sequence of instructions that describes how

More information

From OCL to Propositional and First-order Logic: Part I

From OCL to Propositional and First-order Logic: Part I 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 From OCL to Propositional and First-order Logic: Part I Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally

More information

(2,4) Trees Goodrich, Tamassia (2,4) Trees 1

(2,4) Trees Goodrich, Tamassia (2,4) Trees 1 (2,4) Trees 9 2 5 7 10 14 2004 Goodrich, Tamassia (2,4) Trees 1 Multi-Way Search Tree A multi-way search tree is an ordered tree such that Each internal node has at least two children and stores d -1 key-element

More information

CSE 230 Intermediate Programming in C and C++ Binary Tree

CSE 230 Intermediate Programming in C and C++ Binary Tree CSE 230 Intermediate Programming in C and C++ Binary Tree Fall 2017 Stony Brook University Instructor: Shebuti Rayana shebuti.rayana@stonybrook.edu Introduction to Tree Tree is a non-linear data structure

More information

Structural characterizations of schema mapping languages

Structural characterizations of schema mapping languages Structural characterizations of schema mapping languages Balder ten Cate INRIA and ENS Cachan (research done while visiting IBM Almaden and UC Santa Cruz) Joint work with Phokion Kolaitis (ICDT 09) Schema

More information

XML: Extensible Markup Language

XML: Extensible Markup Language XML: Extensible Markup Language CSC 375, Fall 2015 XML is a classic political compromise: it balances the needs of man and machine by being equally unreadable to both. Matthew Might Slides slightly modified

More information

Exercises Computational Complexity

Exercises Computational Complexity Exercises Computational Complexity March 22, 2017 Exercises marked with a are more difficult. 1 Chapter 7, P and NP Exercise 1. Suppose some pancakes are stacked on a surface such that no two pancakes

More information

Data Structures and Algorithms

Data Structures and Algorithms Data Structures and Algorithms CS245-2008S-19 B-Trees David Galles Department of Computer Science University of San Francisco 19-0: Indexing Operations: Add an element Remove an element Find an element,

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Sipser Ch 1.2, 1.3 Design NFA recognizing a given language Convert an NFA (with or without

More information

Discrete mathematics II. - Graphs

Discrete mathematics II. - Graphs Emil Vatai April 25, 2018 Basic definitions Definition of an undirected graph Definition (Undirected graph) An undirected graph or (just) a graph is a triplet G = (ϕ, E, V ), where V is the set of vertices,

More information

Model checking pushdown systems

Model checking pushdown systems Model checking pushdown systems R. Ramanujam Institute of Mathematical Sciences, Chennai jam@imsc.res.in Update Meeting, IIT-Guwahati, 4 July 2006 p. 1 Sources of unboundedness Data manipulation: integers,

More information

The Streaming Complexity of Validating XML Documents

The Streaming Complexity of Validating XML Documents The Streaming Complexity of Validating XML Documents Christian Konrad christian.konrad@liafa.jussieu.fr and Frédéric Magniez frederic.magniez@liafa.jussieu.fr LIAFA University Paris Diderot - Paris 7 Paris

More information

PART 1 GRAPHICAL STRUCTURE

PART 1 GRAPHICAL STRUCTURE PART 1 GRAPHICAL STRUCTURE in this web service in this web service 1 Treewidth and Hypertree Width Georg Gottlob, Gianluigi Greco, Francesco Scarcello This chapter covers methods for identifying islands

More information

13.4 Deletion in red-black trees

13.4 Deletion in red-black trees Deletion in a red-black tree is similar to insertion. Apply the deletion algorithm for binary search trees. Apply node color changes and left/right rotations to fix the violations of RBT tree properties.

More information

Decision, Computation and Language

Decision, Computation and Language Decision, Computation and Language Regular Expressions Dr. Muhammad S Khan (mskhan@liv.ac.uk) Ashton Building, Room G22 http://www.csc.liv.ac.uk/~khan/comp218 Regular expressions M S Khan (Univ. of Liverpool)

More information

Appendix 1. Description Logic Terminology

Appendix 1. Description Logic Terminology Appendix 1 Description Logic Terminology Franz Baader Abstract The purpose of this appendix is to introduce (in a compact manner) the syntax and semantics of the most prominent DLs occurring in this handbook.

More information

Recognizability Equals Definability for Graphs of Bounded Treewidth and Bounded Chordality

Recognizability Equals Definability for Graphs of Bounded Treewidth and Bounded Chordality Recognizability Equals Definability for Graphs of Bounded Treewidth and Bounded Chordality Hans L. Bodlaender, Utrecht University and Eindhoven University of Technology Pinar Heggernes, University of Bergen

More information

A TriAL: A navigational algebra for RDF triplestores

A TriAL: A navigational algebra for RDF triplestores A TriAL: A navigational algebra for RDF triplestores Navigational queries over RDF data are viewed as one of the main applications of graph query languages, and yet the standard model of graph databases

More information

On Seese s Conjecture. Bruno Courcelle. Université Bordeaux 1, LaBRI

On Seese s Conjecture. Bruno Courcelle. Université Bordeaux 1, LaBRI On Seese s Conjecture Bruno Courcelle Université Bordeaux 1, LaBRI Summary 1. Graphs, Languages, Theories 2. MS-compatible structure transformations and MS-transductions 3. Seese s Conjecture 4. Tree-width

More information

Appendix 1. Description Logic Terminology

Appendix 1. Description Logic Terminology Appendix 1 Description Logic Terminology Franz Baader Abstract The purpose of this appendix is to introduce (in a compact manner) the syntax and semantics of the most prominent DLs occurring in this handbook.

More information

EXTENSIONS OF FIRST ORDER LOGIC

EXTENSIONS OF FIRST ORDER LOGIC EXTENSIONS OF FIRST ORDER LOGIC Maria Manzano University of Barcelona CAMBRIDGE UNIVERSITY PRESS Table of contents PREFACE xv CHAPTER I: STANDARD SECOND ORDER LOGIC. 1 1.- Introduction. 1 1.1. General

More information

Formal Methods in Software Engineering. Lecture 07

Formal Methods in Software Engineering. Lecture 07 Formal Methods in Software Engineering Lecture 07 What is Temporal Logic? Objective: We describe temporal aspects of formal methods to model and specify concurrent systems and verify their correctness

More information