Conjunctive queries. Many computational problems are much easier for conjunctive queries than for general first-order queries.

Size: px
Start display at page:

Download "Conjunctive queries. Many computational problems are much easier for conjunctive queries than for general first-order queries."

Transcription

1 Conjunctive queries Relational calculus queries without negation and disjunction. Conjunctive queries have a normal form: ( y 1 ) ( y n )(p 1 (x 1,..., x m, y 1,..., y n ) p k (x 1,..., x m, y 1,..., y n )). They can also be expressed in Datalog: q(x 1,..., x m ) : p 1 (x 1,..., x m, y 1,..., y n ),..., p k (x 1,..., x m, y 1,..., y n ). Many computational problems are much easier for conjunctive queries than for general first-order queries. 1

2 Query containment For every query language, a query can be viewed as a mapping from the set of all possible database instances to all possible result instances. A query Q 1 is contained in a query Q 2 (Q 1 Q 2 ) if for every database instance D: Q 1 (D) Q 2 (D). Query containment is: undecidable for arbitrary first-order queries decidable (NP-complete) for conjunctive queries without built-in predicates decidable (Π p 2-complete) for conjunctive queries with built-in predicates Query equivalence can be determined using containment: Q 1 Q 2 iff Q 1 Q 2 Q 2 Q 1. 2

3 Checking conjunctive query containment Without built-in predicates. Assume Q 1 = A 0 : A 1,..., A n. Algorithm for checking Q 1 Q 2 : 1. to each goal A i, i = 1,..., n, in the body of Q 1 apply some ground substitution h that maps different variables to different (arbitrary) constants 2. apply T Q2 to the canonical database: the set of facts {A 1 h,..., A n h} 3. Q 1 Q 2 iff A 0 h is derived. This algorithm works also if Q 2 is an arbitrary Datalog program (the step 2 has to be repeated like in bottom-up evaluation) but not if Q 1 is an arbitrary Datalog program. 3

4 Queries with built-in predicates Arithmetic comparison predicates. Multiple canonical databases: all possible orderings for variables instantiate variables to integers For every canonical database D that makes the entire body of Q 1 true, T Q2 needs to derive the corresponding head of Q 1. 4

5 Integrity constraints A query Q 1 is contained in a query Q 2 under a set of integrity constraints F (Q 1 F Q 2 ) if for every database instance D satisfying F : Q 1 (D) Q 2 (D). Theorem: Q 1 F Q 2 iff chase F (Q 1 ) chase F (Q 2 ). 5

6 Chase A versatile tool, useful also for checking query containment under integrity constraints. Chase: apply chase steps to the body of a conjunctive query Q until no changes occur. Chase steps depend on the kind of constraints used. For functional dependencies: FD-step using X Y over P : if there are two P -goals in the body of Q that agree on X-attributes, apply to Q a substitution that will make them agree on Y -attributes (preferring the variables in the head). Chase terminates for FDs. 6

7 Views in data integration Basic model: many independent data sources containing all the data wrappers of data sources provide a single data model a single integrated database (virtual) relationships between the content of the sources and that of the integrated database: local-as-view global-as-view queries asked against the integrated database 7

8 Local-as-view Each data source is viewed as a goal G s and is defined using a query Q g over the integrated database. Notation: S is an instance of the source, D is a (virtual) instance of the integrated database. Source annotations: sound: S Q g (D) (the most common), complete: Q g (D) S, exact: Q g (D) = S. There may be more than one instance D satisfying the annotations, for a given S. 8

9 Global-as-view Each relation over the integrated database is defined using a goal G g as a view Q s over the data sources. Notation: S consists of instances of all the sources, D is a (virtual) instance of the integrated database. Source annotations: sound: Q s (S) G g (D), complete: G g (D) Q s (S), exact: G g (D) = Q s (S) (the most common). Under the exact annotations, there is only one satisfying instance D, for a given S. 9

10 Comparison Local-as-view: query evaluation rewriting in terms of views cannot be composed scalable Global-as-view: query evaluation view materialization (for exact annotations) can be composed (integrated database may be viewed as a data source) not scalable (adding sources requires the redefinition of the integrated database) 10

11 Query evaluation Semantics: a tuple t is a certain answer to a query Q given some source instances if it is in the answer to this query over every instance of the integrated database that satisfies all the source annotations. Computing certain answers is in most cases computationally hard. 11

12 Inverse rules An approach to query rewriting, used in Infomaster. Data source conjunctive query. Query a set of Datalog rules. Rewriting produces a set of nonrecursive Datalog rules with function symbols: EDB predicates: source relations IDB predicates: database relations Function symbols can be eliminated. 12

13 Query rewriting: 1. for every source rule A : B 1,..., B n, produce n inverse rules B 1 : A,..., B n : A 2. B i is like B i, except that each variable that occur only in the body of the source rule is replaced by the (Skolem) term f(x 1,..., X n ) where: f is a unique function symbol X 1,..., X n are all the variables in the head of the source rule 3. all the occurrences of the same variable are replaced by the same term Query evaluation: the query rule and the inverse rules are evaluated bottom-up the evaluation terminates only the substitutions that do not contain Skolem terms are returned to the user 13

14 Bucket algorithm An approach to query rewriting, used in Information Manifold. Data source a view defined as a conjunctive query. Query a conjunctive query Q D 0 : D 1,..., D n Rewriting of the query Q produces a set S, initially empty, of conjunctive queries. 14

15 Buckets: 1. create a bucket for every goal D 1,..., D n in Q 2. if A : B 1,..., B n is a data source definition such that for some j, B j unifies with D i, if D i has a head variable in some argument, then B j also has a head variable in the same argument, then Aσ (with new variables substituted for those variables that do not occur in B j ) is added to the bucket D i where σ is a most general unifier of B j and D i preferring the variables in the query Query rewriting: for each query rewriting Q which is a conjunction of one subgoal from each bucket: if the expansion of Q is contained in Q, then add Q to S the final rewriting is the union of the queries in S. 15

16 Constraints in the query and the views To prevent irrelevant goals from being placed in the buckets: if the constraints in the data source definition together with the constraints in the query are unsatisfiable after applying σ limited to the head variables of the view, then the source is useless for the query. To help pass the containment test: constraints may be added to a query rewriting. 16

17 Properties Not always a rewriting equivalent to the original query exists: data sources are insufficient data sources are incomplete. If the query does not contain any constraints, and there are only sound annotations, then the inverse rules and bucket algorithms are guaranteed to produce the maximally contained rewriting (in terms of the given sources) and the given query language. The rewriting computes exactly the certain answers. 17

18 Source limitations Sometimes data sources impose limitations on access paths to the data: some arguments have to be provided as inputs. This is represented by adorning each data source with a string of b and f: each argument is labelled with a b or an f b stands for mandatory input f stands for input or output To obtain a maximally-contained rewriting sometimes a recursive Datalog program is necessary. 18

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Foundations of AI 9. Predicate Logic Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution Wolfram Burgard, Andreas Karwath, Bernhard Nebel, and Martin Riedmiller 09/1 Contents Motivation

More information

OPTIMIZING RECURSIVE INFORMATION GATHERING PLANS. Eric M. Lambrecht

OPTIMIZING RECURSIVE INFORMATION GATHERING PLANS. Eric M. Lambrecht OPTIMIZING RECURSIVE INFORMATION GATHERING PLANS by Eric M. Lambrecht A Thesis Presented in Partial Fulfillment of the Requirements for the Degree Master of Science ARIZONA STATE UNIVERSITY December 1998

More information

Range Restriction for General Formulas

Range Restriction for General Formulas Range Restriction for General Formulas 1 Range Restriction for General Formulas Stefan Brass Martin-Luther-Universität Halle-Wittenberg Germany Range Restriction for General Formulas 2 Motivation Deductive

More information

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation

Integrity Constraints (Chapter 7.3) Overview. Bottom-Up. Top-Down. Integrity Constraint. Disjunctive & Negative Knowledge. Proof by Refutation CSE560 Class 10: 1 c P. Heeman, 2010 Integrity Constraints Overview Disjunctive & Negative Knowledge Resolution Rule Bottom-Up Proof by Refutation Top-Down CSE560 Class 10: 2 c P. Heeman, 2010 Integrity

More information

Database Theory: Beyond FO

Database Theory: Beyond FO Database Theory: Beyond FO CS 645 Feb 11, 2010 Some slide content based on materials of Dan Suciu, Ullman/Widom 1 TODAY: Coming lectures Limited expressiveness of FO Adding recursion (Datalog) Expressiveness

More information

Resolution (14A) Young W. Lim 6/14/14

Resolution (14A) Young W. Lim 6/14/14 Copyright (c) 2013-2014. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free

More information

Foundations of Databases

Foundations of Databases Foundations of Databases Free University of Bozen Bolzano, 2004 2005 Thomas Eiter Institut für Informationssysteme Arbeitsbereich Wissensbasierte Systeme (184/3) Technische Universität Wien http://www.kr.tuwien.ac.at/staff/eiter

More information

Datalog. Rules Programs Negation

Datalog. Rules Programs Negation Datalog Rules Programs Negation 1 Review of Logical If-Then Rules body h(x, ) :- a(y, ) & b(z, ) & head subgoals The head is true if all the subgoals are true. 2 Terminology Head and subgoals are atoms.

More information

Data Integration: A Theoretical Perspective

Data Integration: A Theoretical Perspective Data Integration: A Theoretical Perspective Maurizio Lenzerini Dipartimento di Informatica e Sistemistica Università di Roma La Sapienza Via Salaria 113, I 00198 Roma, Italy lenzerini@dis.uniroma1.it ABSTRACT

More information

Rewriting Ontology-Mediated Queries. Carsten Lutz University of Bremen

Rewriting Ontology-Mediated Queries. Carsten Lutz University of Bremen Rewriting Ontology-Mediated Queries Carsten Lutz University of Bremen Data Access and Ontologies Today, data is often highly incomplete and very heterogeneous Examples include web data and large-scale

More information

Outline. q Database integration & querying. q Peer-to-Peer data management q Stream data management q MapReduce-based distributed data management

Outline. q Database integration & querying. q Peer-to-Peer data management q Stream data management q MapReduce-based distributed data management Outline n Introduction & architectural issues n Data distribution n Distributed query processing n Distributed query optimization n Distributed transactions & concurrency control n Distributed reliability

More information

Datalog Evaluation. Linh Anh Nguyen. Institute of Informatics University of Warsaw

Datalog Evaluation. Linh Anh Nguyen. Institute of Informatics University of Warsaw Datalog Evaluation Linh Anh Nguyen Institute of Informatics University of Warsaw Outline Simple Evaluation Methods Query-Subquery Recursive Magic-Set Technique Query-Subquery Nets [2/64] Linh Anh Nguyen

More information

Local Stratiæcation. Instantiate rules; i.e., substitute all. possible constants for variables, but reject. instantiations that cause some EDB subgoal

Local Stratiæcation. Instantiate rules; i.e., substitute all. possible constants for variables, but reject. instantiations that cause some EDB subgoal Local Stratication Instantiate rules; i.e. substitute all possible constants for variables but reject instantiations that cause some EDB subgoal to be false. Ground atom = atom with no variables. Build

More information

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 37 Resolution Rules Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras Lecture - 37 Resolution Rules If some literals can be unified, the same algorithm should be able

More information

Data integration lecture 2

Data integration lecture 2 PhD course on View-based query processing Data integration lecture 2 Riccardo Rosati Dipartimento di Informatica e Sistemistica Università di Roma La Sapienza {rosati}@dis.uniroma1.it Corso di Dottorato

More information

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur Module 6 Knowledge Representation and Logic (First Order Logic) 6.1 Instructional Objective Students should understand the advantages of first order logic as a knowledge representation language Students

More information

Complexity of Answering Queries Using Materialized Views

Complexity of Answering Queries Using Materialized Views Complexity of Answering Queries Using Materialized Views Serge Abiteboul, Olivier Duschka To cite this version: Serge Abiteboul, Olivier Duschka. Complexity of Answering Queries Using Materialized Views.

More information

Computing Query Answers with Consistent Support

Computing Query Answers with Consistent Support Computing Query Answers with Consistent Support Jui-Yi Kao Advised by: Stanford University Michael Genesereth Inconsistency in Databases If the data in a database violates the applicable ICs, we say the

More information

(i.e., produced only a subset of the possible answers). We describe the novel class

(i.e., produced only a subset of the possible answers). We describe the novel class Recursive Query Plans for Data Integration Oliver M. Duschka Michael R. Genesereth Department of Computer Science, Stanford University, Stanford, CA 94305, USA Alon Y. Levy 1 Department of Computer Science

More information

PCP and Hardness of Approximation

PCP and Hardness of Approximation PCP and Hardness of Approximation January 30, 2009 Our goal herein is to define and prove basic concepts regarding hardness of approximation. We will state but obviously not prove a PCP theorem as a starting

More information

DATABASE THEORY. Lecture 11: Introduction to Datalog. TU Dresden, 12th June Markus Krötzsch Knowledge-Based Systems

DATABASE THEORY. Lecture 11: Introduction to Datalog. TU Dresden, 12th June Markus Krötzsch Knowledge-Based Systems DATABASE THEORY Lecture 11: Introduction to Datalog Markus Krötzsch Knowledge-Based Systems TU Dresden, 12th June 2018 Announcement All lectures and the exercise on 19 June 2018 will be in room APB 1004

More information

Answering Queries with Useful Bindings

Answering Queries with Useful Bindings Answering Queries with Useful Bindings CHEN LI University of California at Irvine and EDWARD CHANG University of California, Santa Barbara In information-integration systems, sources may have diverse and

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

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence

Knowledge Representation. CS 486/686: Introduction to Artificial Intelligence Knowledge Representation CS 486/686: Introduction to Artificial Intelligence 1 Outline Knowledge-based agents Logics in general Propositional Logic& Reasoning First Order Logic 2 Introduction So far we

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

Chapter 9: Constraint Logic Programming

Chapter 9: Constraint Logic Programming 9. Constraint Logic Programming 9-1 Deductive Databases and Logic Programming (Winter 2007/2008) Chapter 9: Constraint Logic Programming Introduction, Examples Basic Query Evaluation Finite Domain Constraint

More information

Chapter 10 Part 1: Reduction

Chapter 10 Part 1: Reduction //06 Polynomial-Time Reduction Suppose we could solve Y in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Chapter 0 Part : Reduction Reduction. Problem X

More information

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 14. Example. Datalog syntax: rules. Datalog query. Meaning of Datalog rules

Plan of the lecture. G53RDB: Theory of Relational Databases Lecture 14. Example. Datalog syntax: rules. Datalog query. Meaning of Datalog rules Plan of the lecture G53RDB: Theory of Relational Databases Lecture 14 Natasha Alechina School of Computer Science & IT nza@cs.nott.ac.uk More Datalog: Safe queries Datalog and relational algebra Recursive

More information

Implementing mapping composition

Implementing mapping composition The VLDB Journal (2008) 17:333 353 DOI 10.1007/s00778-007-0059-9 SPECIAL ISSUE PAPER Implementing mapping composition Philip A. Bernstein Todd J. Green Sergey Melnik Alan Nash Received: 17 February 2007

More information

DATABASE THEORY. Lecture 15: Datalog Evaluation (2) TU Dresden, 26th June Markus Krötzsch Knowledge-Based Systems

DATABASE THEORY. Lecture 15: Datalog Evaluation (2) TU Dresden, 26th June Markus Krötzsch Knowledge-Based Systems DATABASE THEORY Lecture 15: Datalog Evaluation (2) Markus Krötzsch Knowledge-Based Systems TU Dresden, 26th June 2018 Review: Datalog Evaluation A rule-based recursive query language father(alice, bob)

More information

Query Containment for Data Integration Systems

Query Containment for Data Integration Systems Query Containment for Data Integration Systems Todd Millstein University of Washington Seattle, Washington todd@cs.washington.edu Alon Levy University of Washington Seattle, Washington alon@cs.washington.edu

More information

Lecture 1: Conjunctive Queries

Lecture 1: Conjunctive Queries CS 784: Foundations of Data Management Spring 2017 Instructor: Paris Koutris Lecture 1: Conjunctive Queries A database schema R is a set of relations: we will typically use the symbols R, S, T,... to denote

More information

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi is another way of showing that an argument is correct. Definitions: Literal: A variable or a negation of a variable is called a literal. Sum and Product: A disjunction of literals is called a sum and a

More information

CSE-6490B Assignment #1

CSE-6490B Assignment #1 29 October 2008 CSE-6490B Assignment #1 p. 1 of 5 CSE-6490B Assignment #1 1. Queries in Datalog. Enroll now in Datalog U.! (5 points) Consider the following schema. student(s#, sname, dob, d#) FK (d#)

More information

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur Module 6 Knowledge Representation and Logic (First Order Logic) Lesson 15 Inference in FOL - I 6.2.8 Resolution We have introduced the inference rule Modus Ponens. Now we introduce another inference rule

More information

COMP718: Ontologies and Knowledge Bases

COMP718: Ontologies and Knowledge Bases 1/35 COMP718: Ontologies and Knowledge Bases Lecture 9: Ontology/Conceptual Model based Data Access Maria Keet email: keet@ukzn.ac.za home: http://www.meteck.org School of Mathematics, Statistics, and

More information

An Evolution of Mathematical Tools

An Evolution of Mathematical Tools An Evolution of Mathematical Tools From Conceptualization to Formalization Here's what we do when we build a formal model (or do a computation): 0. Identify a collection of objects/events in the real world.

More information

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England

The Formal Semantics of Programming Languages An Introduction. Glynn Winskel. The MIT Press Cambridge, Massachusetts London, England The Formal Semantics of Programming Languages An Introduction Glynn Winskel The MIT Press Cambridge, Massachusetts London, England Series foreword Preface xiii xv 1 Basic set theory 1 1.1 Logical notation

More information

On the Hardness of Counting the Solutions of SPARQL Queries

On the Hardness of Counting the Solutions of SPARQL Queries On the Hardness of Counting the Solutions of SPARQL Queries Reinhard Pichler and Sebastian Skritek Vienna University of Technology, Faculty of Informatics {pichler,skritek}@dbai.tuwien.ac.at 1 Introduction

More information

The Inverse of a Schema Mapping

The Inverse of a Schema Mapping The Inverse of a Schema Mapping Jorge Pérez Department of Computer Science, Universidad de Chile Blanco Encalada 2120, Santiago, Chile jperez@dcc.uchile.cl Abstract The inversion of schema mappings has

More information

DATABASE THEORY. Lecture 18: Dependencies. TU Dresden, 3rd July Markus Krötzsch Knowledge-Based Systems

DATABASE THEORY. Lecture 18: Dependencies. TU Dresden, 3rd July Markus Krötzsch Knowledge-Based Systems DATABASE THEORY Lecture 18: Dependencies Markus Krötzsch Knowledge-Based Systems TU Dresden, 3rd July 2018 Review: Databases and their schemas Lines: Line Type 85 bus 3 tram F1 ferry...... Stops: SID Stop

More information

8.1 Polynomial-Time Reductions

8.1 Polynomial-Time Reductions 8.1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. Those with polynomial-time algorithms.

More information

Chapter 5: Other Relational Languages

Chapter 5: Other Relational Languages Chapter 5: Other Relational Languages Database System Concepts, 5th Ed. See www.db-book.com for conditions on re-use Chapter 5: Other Relational Languages Tuple Relational Calculus Domain Relational Calculus

More information

Data Integration: Logic Query Languages

Data Integration: Logic Query Languages Data Integration: Logic Query Languages Jan Chomicki University at Buffalo Datalog Datalog A logic language Datalog programs consist of logical facts and rules Datalog is a subset of Prolog (no data structures)

More information

DATABASE THEORY. Lecture 12: Evaluation of Datalog (2) TU Dresden, 30 June Markus Krötzsch

DATABASE THEORY. Lecture 12: Evaluation of Datalog (2) TU Dresden, 30 June Markus Krötzsch DATABASE THEORY Lecture 12: Evaluation of Datalog (2) Markus Krötzsch TU Dresden, 30 June 2016 Overview 1. Introduction Relational data model 2. First-order queries 3. Complexity of query answering 4.

More information

Chapter 5: Other Relational Languages.! Query-by-Example (QBE)! Datalog

Chapter 5: Other Relational Languages.! Query-by-Example (QBE)! Datalog Chapter 5: Other Relational Languages! Query-by-Example (QBE)! Datalog 5.1 Query-by by-example (QBE)! Basic Structure! Queries on One Relation! Queries on Several Relations! The Condition Box! The Result

More information

On the Computational Complexity of Minimal-Change Integrity Maintenance in Relational Databases

On the Computational Complexity of Minimal-Change Integrity Maintenance in Relational Databases On the Computational Complexity of Minimal-Change Integrity Maintenance in Relational Databases Jan Chomicki 1 and Jerzy Marcinkowski 2 1 Dept. of Computer Science and Engineering University at Buffalo

More information

Datalog. Susan B. Davidson. CIS 700: Advanced Topics in Databases MW 1:30-3 Towne 309

Datalog. Susan B. Davidson.   CIS 700: Advanced Topics in Databases MW 1:30-3 Towne 309 Datalog Susan B. Davidson CIS 700: Advanced Topics in Databases MW 1:30-3 Towne 309 http://www.cis.upenn.edu/~susan/cis700/homepage.html 2017 A. Alawini, S. Davidson Homework for this week Sign up to present

More information

Multi-event IDS Categories. Introduction to Misuse Intrusion Detection Systems (IDS) Formal Specification of Intrusion Signatures and Detection Rules

Multi-event IDS Categories. Introduction to Misuse Intrusion Detection Systems (IDS) Formal Specification of Intrusion Signatures and Detection Rules Formal Specification of Intrusion Signatures and Detection Rules By Jean-Philippe Pouzol and Mireille Ducassé 15 th IEEE Computer Security Foundations Workshop 2002 Presented by Brian Kellogg CSE914: Formal

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

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic.

Overview. CS389L: Automated Logical Reasoning. Lecture 6: First Order Logic Syntax and Semantics. Constants in First-Order Logic. Overview CS389L: Automated Logical Reasoning Lecture 6: First Order Logic Syntax and Semantics Işıl Dillig So far: Automated reasoning in propositional logic. Propositional logic is simple and easy to

More information

Foundations of Databases

Foundations of Databases Foundations of Databases Free University of Bozen Bolzano, 2004 2005 Thomas Eiter Institut für Informationssysteme Arbeitsbereich Wissensbasierte Systeme (184/3) Technische Universität Wien http://www.kr.tuwien.ac.at/staff/eiter

More information

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 CS 3512, Spring 2011 Instructor: Doug Dunham Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010 Prerequisites: Calc I, CS2511 Rough course outline:

More information

Processing Regular Path Queries Using Views or What Do We Need for Integrating Semistructured Data?

Processing Regular Path Queries Using Views or What Do We Need for Integrating Semistructured Data? Processing Regular Path Queries Using Views or What Do We Need for Integrating Semistructured Data? Diego Calvanese University of Rome La Sapienza joint work with G. De Giacomo, M. Lenzerini, M.Y. Vardi

More information

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance. Algorithm Design Patterns and Anti-Patterns Chapter 8 NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic

More information

Optimization of logical query plans Eliminating redundant joins

Optimization of logical query plans Eliminating redundant joins Optimization of logical query plans Eliminating redundant joins 66 Optimization of logical query plans Query Compiler Execution Engine SQL Translation Logical query plan "Intermediate code" Logical plan

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

Relational Databases

Relational Databases Relational Databases Jan Chomicki University at Buffalo Jan Chomicki () Relational databases 1 / 49 Plan of the course 1 Relational databases 2 Relational database design 3 Conceptual database design 4

More information

Reconcilable Differences

Reconcilable Differences Theory of Computing Systems manuscript No. (will be inserted by the editor) Reconcilable Differences Todd J. Green Zachary G. Ives Val Tannen Received: date / Accepted: date Abstract In this paper we study

More information

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Finite Model Generation for Isabelle/HOL Using a SAT Solver Finite Model Generation for / Using a SAT Solver Tjark Weber webertj@in.tum.de Technische Universität München Winterhütte, März 2004 Finite Model Generation for / p.1/21 is a generic proof assistant: Highly

More information

Access Patterns (Extended Version) Chen Li. Department of Computer Science, Stanford University, CA Abstract

Access Patterns (Extended Version) Chen Li. Department of Computer Science, Stanford University, CA Abstract Computing Complete Answers to Queries in the Presence of Limited Access Patterns (Extended Version) Chen Li Department of Computer Science, Stanford University, CA 94305 chenli@db.stanford.edu Abstract

More information

Positive higher-order queries

Positive higher-order queries Positive higher-order queries Michael Benedikt, Gabriele Puppis, Huy u To cite this version: Michael Benedikt, Gabriele Puppis, Huy u. Positive higher-order queries. Proceedings of PODS 2010, 2010, Indianapolis,

More information

Finding Equivalent Rewritings in the Presence of Arithmetic Comparisons

Finding Equivalent Rewritings in the Presence of Arithmetic Comparisons Finding Equivalent Rewritings in the Presence of Arithmetic Comparisons Foto Afrati 1, Rada Chirkova 2, Manolis Gergatsoulis 3, and Vassia Pavlaki 1 1 Department of Electrical and Computing Engineering,

More information

A SQL-Middleware Unifying Why and Why-Not Provenance for First-Order Queries

A SQL-Middleware Unifying Why and Why-Not Provenance for First-Order Queries A SQL-Middleware Unifying Why and Why-Not Provenance for First-Order Queries Seokki Lee Sven Köhler Bertram Ludäscher Boris Glavic Illinois Institute of Technology. {slee95@hawk.iit.edu, bglavic@iit.edu}

More information

CSE 344 JANUARY 26 TH DATALOG

CSE 344 JANUARY 26 TH DATALOG CSE 344 JANUARY 26 TH DATALOG ADMINISTRATIVE MINUTIAE HW3 and OQ3 out HW3 due next Friday OQ3 due next Wednesday HW4 out next week: on Datalog Midterm reminder: Feb 9 th RELATIONAL ALGEBRA Set-at-a-time

More information

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Algorithm Design Patterns and Anti-Patterns Algorithm design patterns.

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages. Lambda calculus

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages. Lambda calculus Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Tuesday, February 19, 2013 The lambda calculus (or λ-calculus) was introduced by Alonzo Church and Stephen Cole Kleene in

More information

Midterm. Introduction to Data Management CSE 344. Datalog. What is Datalog? Why Do We Learn Datalog? Why Do We Learn Datalog? Lecture 13: Datalog

Midterm. Introduction to Data Management CSE 344. Datalog. What is Datalog? Why Do We Learn Datalog? Why Do We Learn Datalog? Lecture 13: Datalog Midterm Introduction to Data Management CSE 344 Lecture 13: Datalog Guest lecturer: Laurel Orr Monday, February 8 th in class Content Lectures 1 through 13 Homework 1 through 4 (due Feb 10) Webquiz 1 through

More information

Logical Query Languages. Motivation: 1. Logical rules extend more naturally to. recursive queries than does relational algebra. Used in SQL recursion.

Logical Query Languages. Motivation: 1. Logical rules extend more naturally to. recursive queries than does relational algebra. Used in SQL recursion. Logical Query Languages Motivation: 1. Logical rules extend more naturally to recursive queries than does relational algebra. Used in SQL recursion. 2. Logical rules form the basis for many information-integration

More information

Midterm. Database Systems CSE 414. What is Datalog? Datalog. Why Do We Learn Datalog? Why Do We Learn Datalog?

Midterm. Database Systems CSE 414. What is Datalog? Datalog. Why Do We Learn Datalog? Why Do We Learn Datalog? Midterm Database Systems CSE 414 Lecture 13: Datalog Guest lecturer: Jay Garlapati Friday, April 29, in class Content Lectures 1 through 13 Homework 1 through 3 Webquiz 1 through 4 (due Thursday) Closed

More information

Functional Logic Programming. Kristjan Vedel

Functional Logic Programming. Kristjan Vedel Functional Logic Programming Kristjan Vedel Imperative vs Declarative Algorithm = Logic + Control Imperative How? Explicit Control Sequences of commands for the computer to execute Declarative What? Implicit

More information

Figure 5.1: Query processing in a data integration system. This chapter focuses on the reformulation step, highlighted in the dashed box.

Figure 5.1: Query processing in a data integration system. This chapter focuses on the reformulation step, highlighted in the dashed box. Chapter 5 Describing Data Sources In order for a data integration system to process a query over a set of data sources, the system must know which sources are available, what data exists in each source

More information

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance.

! Greed. O(n log n) interval scheduling. ! Divide-and-conquer. O(n log n) FFT. ! Dynamic programming. O(n 2 ) edit distance. Algorithm Design Patterns and Anti-Patterns 8. NP and Computational Intractability Algorithm design patterns. Ex.! Greed. O(n log n) interval scheduling.! Divide-and-conquer. O(n log n) FFT.! Dynamic programming.

More information

Relational Algebra and Relational Calculus. Pearson Education Limited 1995,

Relational Algebra and Relational Calculus. Pearson Education Limited 1995, Relational Algebra and Relational Calculus 1 Objectives Meaning of the term relational completeness. How to form queries in relational algebra. How to form queries in tuple relational calculus. How to

More information

Query Rewriting Using Views in the Presence of Inclusion Dependencies

Query Rewriting Using Views in the Presence of Inclusion Dependencies Query Rewriting Using Views in the Presence of Inclusion Dependencies Qingyuan Bai Jun Hong Michael F. McTear School of Computing and Mathematics, University of Ulster at Jordanstown, Newtownabbey, Co.

More information

2.2.2.Relational Database concept

2.2.2.Relational Database concept Foreign key:- is a field (or collection of fields) in one table that uniquely identifies a row of another table. In simpler words, the foreign key is defined in a second table, but it refers to the primary

More information

Data Integration: Datalog

Data Integration: Datalog Data Integration: Datalog Jan Chomicki University at Buffalo and Warsaw University Feb. 22, 2007 Jan Chomicki (UB/UW) Data Integration: Datalog Feb. 22, 2007 1 / 12 Plan of the course 1 Datalog 2 Negation

More information

Formal Predicate Calculus. Michael Meyling

Formal Predicate Calculus. Michael Meyling Formal Predicate Calculus Michael Meyling May 24, 2013 2 The source for this document can be found here: http://www.qedeq.org/0_04_07/doc/math/qedeq_formal_logic_v1.xml Copyright by the authors. All rights

More information

An Algorithm for Answering Queries Efficiently Using Views Prasenjit Mitra Infolab, Stanford University Stanford, CA, 94305, U.S.A.

An Algorithm for Answering Queries Efficiently Using Views Prasenjit Mitra Infolab, Stanford University Stanford, CA, 94305, U.S.A. An Algorithm for Answering Queries Efficiently Using Views Prasenjit Mitra Infolab, Stanford University Stanford, CA, 94305, U.S.A. mitra@db.stanford.edu September, 1999 Abstract Algorithms for answering

More information

Database Theory: Datalog, Views

Database Theory: Datalog, Views Database Theory: Datalog, Views CS 645 Mar 8, 2006 Some slide content courtesy of Ramakrishnan & Gehrke, Dan Suciu, Ullman & Widom 1 TODAY: Coming lectures Adding recursion: datalog Summary of Containment

More information

Foundations of Schema Mapping Management

Foundations of Schema Mapping Management Foundations of Schema Mapping Management Marcelo Arenas Jorge Pérez Juan Reutter Cristian Riveros PUC Chile PUC Chile University of Edinburgh Oxford University marenas@ing.puc.cl jperez@ing.puc.cl juan.reutter@ed.ac.uk

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

Introduction to Data Management CSE 344. Lecture 14: Datalog (guest lecturer Dan Suciu)

Introduction to Data Management CSE 344. Lecture 14: Datalog (guest lecturer Dan Suciu) Introduction to Data Management CSE 344 Lecture 14: Datalog (guest lecturer Dan Suciu) CSE 344 - Winter 2017 1 Announcements WQ 4 and HW 4 due on Thursday Midterm next Monday in class This week: Today:

More information

Expressive capabilities description languages and query rewriting algorithms q

Expressive capabilities description languages and query rewriting algorithms q The Journal of Logic Programming 43 (2000) 75±122 www.elsevier.com/locate/jlpr Expressive capabilities description languages and query rewriting algorithms q Vasilis Vassalos a, *, Yannis Papakonstantinou

More information

Lecture 17 of 41. Clausal (Conjunctive Normal) Form and Resolution Techniques

Lecture 17 of 41. Clausal (Conjunctive Normal) Form and Resolution Techniques Lecture 17 of 41 Clausal (Conjunctive Normal) Form and Resolution Techniques Wednesday, 29 September 2004 William H. Hsu, KSU http://www.kddresearch.org http://www.cis.ksu.edu/~bhsu Reading: Chapter 9,

More information

Database Theory VU , SS Codd s Theorem. Reinhard Pichler

Database Theory VU , SS Codd s Theorem. Reinhard Pichler Database Theory Database Theory VU 181.140, SS 2011 3. Codd s Theorem Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 29 March, 2011 Pichler 29 March,

More information

Outline. Forward chaining Backward chaining Resolution. West Knowledge Base. Forward chaining algorithm. Resolution-Based Inference.

Outline. Forward chaining Backward chaining Resolution. West Knowledge Base. Forward chaining algorithm. Resolution-Based Inference. Resolution-Based Inference Outline R&N: 9.3-9.6 Michael Rovatsos University of Edinburgh Forward chaining Backward chaining Resolution 10 th February 2015 Forward chaining algorithm West Knowledge Base

More information

Inverting Schema Mappings: Bridging the Gap between Theory and Practice

Inverting Schema Mappings: Bridging the Gap between Theory and Practice Inverting Schema Mappings: Bridging the Gap between Theory and Practice Marcelo Arenas Jorge Pérez Juan Reutter Cristian Riveros PUC Chile PUC Chile PUC Chile R&M Tech marenas@ing.puc.cl jperez@ing.puc.cl

More information

Lecture 9: Datalog with Negation

Lecture 9: Datalog with Negation CS 784: Foundations of Data Management Spring 2017 Instructor: Paris Koutris Lecture 9: Datalog with Negation In this lecture we will study the addition of negation to Datalog. We start with an example.

More information

SQL, DLs, Datalog, and ASP: comparison

SQL, DLs, Datalog, and ASP: comparison SQL, DLs, Datalog, and ASP: comparison Riccardo Rosati Knowledge Representation and Semantic Technologies Corso di Laurea in Ingegneria informatica Sapienza Università di Roma 2014/2015 CWA vs. OWA DLs

More information

Efficiently Computing Provenance Graphs for Queries with Negation

Efficiently Computing Provenance Graphs for Queries with Negation Efficiently Computing Provenance Graphs for Queries with Negation Seokki Lee, Sven Köhler, Bertram Ludäscher, Boris Glavic IIT DB Group Technical Report IIT/CS-DB-26-3 26- http://www.cs.iit.edu/ dbgroup/

More information

Logic Languages. Hwansoo Han

Logic Languages. Hwansoo Han Logic Languages Hwansoo Han Logic Programming Based on first-order predicate calculus Operators Conjunction, disjunction, negation, implication Universal and existential quantifiers E A x for all x...

More information

NP and computational intractability. Kleinberg and Tardos, chapter 8

NP and computational intractability. Kleinberg and Tardos, chapter 8 NP and computational intractability Kleinberg and Tardos, chapter 8 1 Major Transition So far we have studied certain algorithmic patterns Greedy, Divide and conquer, Dynamic programming to develop efficient

More information

. Relation and attribute names: The relation and attribute names in the mediated. Describing Data Sources. 3.1 Overview and Desiderata

. Relation and attribute names: The relation and attribute names in the mediated. Describing Data Sources. 3.1 Overview and Desiderata 3 Describing Data Sources In order for a data integration system to process a query over a set of data sources, the system must know which sources are available, what data exist in each source, and how

More information

Deductive Databases. Motivation. Datalog. Chapter 25

Deductive Databases. Motivation. Datalog. Chapter 25 Deductive Databases Chapter 25 1 Motivation SQL-92 cannot express some queries: Are we running low on any parts needed to build a ZX600 sports car? What is the total component and assembly cost to build

More information

Essential Gringo (Draft)

Essential Gringo (Draft) Essential Gringo (Draft) Vladimir Lifschitz, University of Texas 1 Introduction The designers of the Abstract Gringo language AG [Gebser et al., 2015a] aimed at creating a relatively simple mathematical

More information

Context-free Grammars

Context-free Grammars 1 contents of Context-free Grammars Phrase Structure Everyday Grammars for Programming Language Formal Definition of Context-free Grammars Definition of Language Left-to-right Application cfg ects Transforming

More information

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry.

Notes. Notes. Introduction. Notes. Propositional Functions. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 1.3 1.4 of Rosen cse235@cse.unl.edu Introduction

More information

Datalog. Susan B. Davidson. CIS 700: Advanced Topics in Databases MW 1:30-3 Towne 309

Datalog. Susan B. Davidson.  CIS 700: Advanced Topics in Databases MW 1:30-3 Towne 309 Datalog Susan B. Davidson CIS 700: Advanced Topics in Databases MW 1:30-3 Towne 309 http://www.cis.upenn.edu/~susan/cis700/homepage.html 2017 A. Alawini, S. Davidson References Textbooks Ramakrishnan and

More information

CS 512, Spring 2017: Take-Home End-of-Term Examination

CS 512, Spring 2017: Take-Home End-of-Term Examination CS 512, Spring 2017: Take-Home End-of-Term Examination Out: Tuesday, 9 May 2017, 12:00 noon Due: Wednesday, 10 May 2017, by 11:59 am Turn in your solutions electronically, as a single PDF file, by placing

More information