A Functorial Query Language. Ryan Wisnesky Harvard University DCP 2014

Size: px
Start display at page:

Download "A Functorial Query Language. Ryan Wisnesky Harvard University DCP 2014"

Transcription

1 A Functorial Query Language Ryan Wisnesky Harvard University DCP

2 History In the early 1990s, Rosebrugh et al noticed that finitely presented categories could be thought of as database schemas. A finitely presented category - a schema - is a directed multigraph with path equations. An instance I on a schema C is a functor C Set. This is, for each node X, a set of IDs IX, and for each edge X Y, a function IX IY. 2

3 Example Schema & Instance manager worksin Employee Department secretary Employee.manager.worksIn=Employee.worksIn Department.secretary.worksIn=Department Employee ID manager worksin q10 ID Department secretary x q10 3 q x02 101

4 History, continued A schema mapping F : C D takes nodes(c) nodes(d) and edges(c) paths(d) in a way that respects C s path equations. This is, a mapping is a functor. Given a mapping F : C D, there are three adjoint data migration operations: Δ F : D-Inst C-Inst (similar to projection) Σ F : C-Inst D-Inst (similar to disjoint union) F : C-Inst D-Inst (similar to cartesian product) We call this the functorial data model. 4

5 Example Migrations A a1 a2 a3 B b1 b2 A B F C A c1 c2 c3 B c1 c2 c3 F ΣF Δ F (A) = C ΔF Δ F (B) = C C (a1,b1) (a1,b2) (a2,b1) (a2,b2) (a3,b1) (a3,b2) C (a1,a) (a2,a) (a3,a) (b1,b) (b2,b) Σ F (C) = A+B F (C) = A B C c1 c2 c3 5

6 Advantages Schemas and mappings form a bi-cartesian closed category (BCCC), so we can take products of schemas, co-products, exponentials, etc. For each schema T, the T-instances and their homomorphisms (which are natural transformations) form a topos (a BCCC with a sub-object classifier). Data integrity constraints are built-in to schemas and path equations are a natural and expressive class of constraint. 6

7 Disadvantages Instances must be considered up to isomorphism, not equality. So every constant is a meaningless ID. There is no obvious query language, nor is it obvious how to implement the three data migration operators using, for example, SQL. So Rosebrugh et al moved on to a different categorical data model, that of sketches. We pick up where they left off, and address these challenges. 7

8 Historical Aside There have been many other uses of category theory for information management. Wong, Tannen, Buneman, and others used category theory to develop the nested relational calculus, but their work is not related to ours. Alagic and Bernstein defined a notion of a good data model using category theory; the functorial data model is good by their definition. The Δ,Σ, data migration operations appear in a different guise in categorical logic and type theory. Key phrase: quantification is adjoint to substitution. 8

9 Contributions I have been working with David Spivak to extend the functorial data model, and to build practical tools based on it. The second half of this talk will be a demo. Key results: A way to store concrete data (attributes) in instances. A functorial query language, FQL. An implementation of FQL in SQL, and vice versa. Project webpage: wisnesky.net/fql.html 9

10 Attributes We associate to each node in a schema a set of attribute names and domains (strings, integers, etc). An instance contains additional columns for attributes. The category theory required to describe schemas and instances with attributes is verbose, but straightforward. The key challenge is making sure the useful properties of the functorial data model continue to hold. Example: isomorphisms of instances preserve attributes. 10

11 Employees with Attributes manager worksin Employee Department secretary first last Employee.manager.worksIn=Employee.worksIn Department.secretary.worksIn=Department name Employee ID manager worksin first last q10 Al Akin x02 Bob Bo Department ID secretary name q CS x Math q10 Carl Cork 11

12 FQL Schemas with attributes still form a BCCC. We can define schemas and mappings using categorical abstract machine language. Equivalently, using the simply typed λ-calculus (STLC). Instances with attributes still form a topos. We can define instances and homomorphisms using higher-order logic (HOL) (= STLC + equality at all types). Some minor details about finite vs infinite domains apply. Migrations for the form Σ F o G o Δ H are closed under composition, provided F is a discrete op-fibration. An FQL query is a migration of the above form. 12

13 FQL Syntax schema S = { nodes Employee, Department; attributes name : Department -> string, first : Employee -> string, last : Employee -> string; arrows manager : Employee -> Employee, worksin : Employee -> Department, secretary : Department -> Employee; equations Employee.manager.worksIn = Employee.worksIn, Department.secretary.worksIn = Department } instance I = { nodes Employee -> { 101, 102, 103 }, Department -> { q10, x02 }; attributes first -> { (101, Alan), (102, Camille), (103, Andrey) }, last -> { (101, Turing), (102, Jordan), (103, Markov) }, name -> { (q10, AppliedMath), (x02, PureMath) }; arrows manager -> { (101, 103), (102, 102), (103, 103) }, worksin -> { (101, q10), (102, x02), (103, q10) }, secretary -> { (q10, 101), (x02, 102) }; } : S 13

14 FQL Syntax, continued //From products example schema S = { } //products of schemas schema T = { } schema A = (S * T) mapping p1 = fst S T mapping p2 = snd S T mapping p = (p1 * p2) //is id //products of instances instance I = { } : S instance J = { } : S instance A = (I * J) transform K = A.fst transform L = A.snd transform M = A.(K * L) //is id //From co-products example schema S = { } //co-products of schemas schema T = { } schema A = (S + T) mapping p1 = inl S T mapping p2 = inr S T mapping p = (p1 + p2) //is id //co-products of instances instance I = { } : S instance J = { } : S instance A = (I + J) transform K = A.inl transform L = A.inr transform M = A.(K + L) //is id 14

15 FQL / SQL Let SPCU denote the select-project-product-union relational algebra. Let guidgen denote the operation taking n-ary tables to n+1- ary tables by adding a new column with globally unique IDs. Every FQL query can be implemented using SPCU+guidgen. Every SPCU query under bag semantics can be implemented using FQL. FQL can be extended with an operation, relationalize, such that every SPCU query under set semantics can be implemented using FQL+relationalize. 15

16 FQL to SQL Δ migrations are compositions of tables, implementable with SPC. Σ migrations are unions of compositions of tables, implementable with SPCU. migrations are implementable with SPC+guidgen, but are much more complex to describe than Δ, Σ. Their construction requires comma categories and implementing diagram limits using joins. Products and co-products are implementable with SPCU. 16

17 SQL to FQL Consider a relational schema with two relations: R(c 1,, c n ) R (c 1,, c n ) It is encoded in FQL with an active domain and an attribute: c1 R R c1 cn cn adom att Using this encoding, Δ implements projection, implements selection and product, and Σ implements union. 17

18 FQL IDE Demo Download fql.jar from wisnesky.net/fql.html Run by double-clicking or java -jar fql.jar Requires Java 7 Internally, FQL emits SQL and runs it using the H2 SQL engine (h2database.com) The FQL IDE does allow additional operations that can t be implemented in SQL. The FQL IDE can execute against external instances using JDBC. FQL is case insensitive. 18

19 Home Screen 19

20 Employees 20

21 Delta - Mapping 21

22 Delta - Projection 22

23 Sigma - Mapping 23

24 Sigma - Union 24

25 Pi - Mapping 25

26 Pi - Product 26

27 Other FQL IDE Features Translates from SPCU (in SQL syntax) to FQL. Category of elements view displays an instance as a graph where every ID is a node. Observables view shows all the different attributes associated with an ID. Generates FQL from attribute correspondences. Supports enumerated (finite) types. Compiles FQL to embedded dependencies, an alternative relational language. 27

28 Conclusion We are excited about the functorial data model as an alternative basis for studying problems in information management. It has a number of useful properties that the relational model does not: Its schemas are naturally based on graphs and build-in constraints. It is naturally ID and bag based, and can be extended to work with sets. It can implement a number of information integration scenarios that relational tools like Clio and Rondo cannot (see my thesis). It can implement SPCU via an encoding. As the FQL IDE demonstrates, functorial data migration is more than just generalized abstract nonsense. Send questions/comments to ryan@cs.harvard.edu. 28

FQL IDE Manual. Ryan Wisnesky April 18, Introduction 2

FQL IDE Manual. Ryan Wisnesky April 18, Introduction 2 Contents FQL IDE Manual Ryan Wisnesky April 18, 2014 1 Introduction 2 2 FQL Basics 3 2.1 Schemas................................................ 3 2.1.1 Cyclic Schemas........................................

More information

Categorical databases

Categorical databases Categorical databases David I. Spivak dspivak@math.mit.edu Mathematics Department Massachusetts Institute of Technology Presented on 2017/03/29 at the Broad Institute David I. Spivak (MIT) Categorical

More information

Databases = Categories

Databases = Categories Databases = Categories David I. Spivak dspivak@math.mit.edu Mathematics Department Massachusetts Institute of Technology Presented on 2010/09/16 David I. Spivak (MIT) Databases = Categories Presented on

More information

Algebraic Model Management: A Survey

Algebraic Model Management: A Survey Algebraic Model Management: A Survey Patrick Schultz 1, David I. Spivak 1, and Ryan Wisnesky 2 1 Massachusetts Institute of Technology 2 Categorical Informatics, Inc. Abstract. We survey the field of model

More information

Categorical databases

Categorical databases Categorical databases David I. Spivak dspivak@math.mit.edu Mathematics Department Massachusetts Institute of Technology Presented on 2012/01/13 David I. Spivak (MIT) Categorical databases Presented on

More information

Denotational Semantics. Domain Theory

Denotational Semantics. Domain Theory Denotational Semantics and Domain Theory 1 / 51 Outline Denotational Semantics Basic Domain Theory Introduction and history Primitive and lifted domains Sum and product domains Function domains Meaning

More information

Categorical models of type theory

Categorical models of type theory 1 / 59 Categorical models of type theory Michael Shulman February 28, 2012 2 / 59 Outline 1 Type theory and category theory 2 Categorical type constructors 3 Dependent types and display maps 4 Fibrations

More information

Topos Theory. Lectures 3-4: Categorical preliminaries II. Olivia Caramello. Topos Theory. Olivia Caramello. Basic categorical constructions

Topos Theory. Lectures 3-4: Categorical preliminaries II. Olivia Caramello. Topos Theory. Olivia Caramello. Basic categorical constructions Lectures 3-4: Categorical preliminaries II 2 / 17 Functor categories Definition Let C and D be two categories. The functor category [C,D] is the category having as objects the functors C D and as arrows

More information

Data Modeling and Integration Using the Open Source Tool AQL

Data Modeling and Integration Using the Open Source Tool AQL Data Modeling and Integration Using the Open Source Tool AQL Peter Gates Categorical Informatics Inc. C i Σ Δ Π Σ Δ Π 11/5/2017 AQL Data Modeling 1 Category Theory, Applied? What constitutes a successful

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

Implementing database design (and manipulation) categorically

Implementing database design (and manipulation) categorically Implementing database design (and manipulation) categorically Bob Rosebrugh Department of Mathematics and Computer Science Mount Allison University NIST Comp CT Workshop / 2015-09-29 Outline Databases

More information

The language of categories

The language of categories The language of categories Mariusz Wodzicki March 15, 2011 1 Universal constructions 1.1 Initial and inal objects 1.1.1 Initial objects An object i of a category C is said to be initial if for any object

More information

The three faces of homotopy type theory. Type theory and category theory. Minicourse plan. Typing judgments. Michael Shulman.

The three faces of homotopy type theory. Type theory and category theory. Minicourse plan. Typing judgments. Michael Shulman. The three faces of homotopy type theory Type theory and category theory Michael Shulman 1 A programming language. 2 A foundation for mathematics based on homotopy theory. 3 A calculus for (, 1)-category

More information

CMPS 277 Principles of Database Systems. https://courses.soe.ucsc.edu/courses/cmps277/fall11/01. Lecture #11

CMPS 277 Principles of Database Systems. https://courses.soe.ucsc.edu/courses/cmps277/fall11/01. Lecture #11 CMPS 277 Principles of Database Systems https://courses.soe.ucsc.edu/courses/cmps277/fall11/01 Lecture #11 1 Limitations of Relational Algebra & Relational Calculus Outline: Relational Algebra and Relational

More information

Relational Model and Relational Algebra

Relational Model and Relational Algebra Relational Model and Relational Algebra CMPSCI 445 Database Systems Fall 2008 Some slide content courtesy of Zack Ives, Ramakrishnan & Gehrke, Dan Suciu, Ullman & Widom Next lectures: Querying relational

More information

Schema Mappings and Data Exchange

Schema Mappings and Data Exchange Schema Mappings and Data Exchange Lecture #2 EASSLC 2012 Southwest University August 2012 1 The Relational Data Model (E.F. Codd 1970) The Relational Data Model uses the mathematical concept of a relation

More information

On the Recognizability of Arrow and Graph Languages

On the Recognizability of Arrow and Graph Languages On the Recognizability of Arrow and Graph Languages Christoph Blume Sander Bruggink Barbara König Universität Duisburg-Essen, Germany Background Applications of finite automata and regular (word) languages

More information

A Database of Categories

A Database of Categories A Database of Categories Michael Fleming Department of Computer Science University of Waterloo Waterloo, Ont, Canada Ryan Gunther Department of Computer Science University of Waterloo Waterloo, Ont, Canada

More information

CS 4110 Programming Languages & Logics. Lecture 28 Recursive Types

CS 4110 Programming Languages & Logics. Lecture 28 Recursive Types CS 4110 Programming Languages & Logics Lecture 28 Recursive Types 7 November 2014 Announcements 2 Foster office hours 11-12pm Guest lecture by Fran on Monday Recursive Types 3 Many languages support recursive

More information

arxiv: v4 [cs.db] 3 Feb 2013

arxiv: v4 [cs.db] 3 Feb 2013 FUNCTORIAL DATA MIGRATION DAVID I. SPIVAK arxiv:1009.1166v4 [cs.db] 3 Feb 2013 Abstract. In this paper we present a simple database definition language: that of categories and functors. A database schema

More information

An introduction to Category Theory for Software Engineers*

An introduction to Category Theory for Software Engineers* An introduction to Category Theory for Software Engineers* Dr Steve Easterbrook Associate Professor, Dept of Computer Science, University of Toronto sme@cs.toronto.edu *slides available at http://www.cs.toronto.edu/~sme/presentations/cat101.pdf

More information

Ian Kenny. November 28, 2017

Ian Kenny. November 28, 2017 Ian Kenny November 28, 2017 Introductory Databases Relational Algebra Introduction In this lecture we will cover Relational Algebra. Relational Algebra is the foundation upon which SQL is built and is

More information

Functional Query Languages with Categorical Types

Functional Query Languages with Categorical Types Functional Query Languages with Categorical Types The Harvard community has made this article openly available. Please share how this access benefits you. Your story matters. Citation Accessed Citable

More information

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research - Almaden

Logic and Databases. Phokion G. Kolaitis. UC Santa Cruz & IBM Research - Almaden Logic and Databases Phokion G. Kolaitis UC Santa Cruz & IBM Research - Almaden 1 Logic and Databases are inextricably intertwined. C.J. Date -- 2007 2 Logic and Databases Extensive interaction between

More information

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes)

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes) ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes) Steve Vickers CS Theory Group Birmingham 1. Sheaves "Sheaf = continuous set-valued map" TACL Tutorial

More information

Arithmetic universes as generalized point-free spaces

Arithmetic universes as generalized point-free spaces Arithmetic universes as generalized point-free spaces Steve Vickers CS Theory Group Birmingham * Grothendieck: "A topos is a generalized topological space" *... it's represented by its category of sheaves

More information

The Relational Algebra

The Relational Algebra The Relational Algebra Relational Algebra Relational algebra is the basic set of operations for the relational model These operations enable a user to specify basic retrieval requests (or queries) 27-Jan-14

More information

CMPS 277 Principles of Database Systems. Lecture #4

CMPS 277 Principles of Database Systems.  Lecture #4 CMPS 277 Principles of Database Systems http://www.soe.classes.edu/cmps277/winter10 Lecture #4 1 First-Order Logic Question: What is First-Order Logic? Answer: Informally, First-Order Logic = Propositional

More information

Crash Course in Monads. Vlad Patryshev

Crash Course in Monads. Vlad Patryshev Crash Course in Monads Vlad Patryshev Introduction Monads in programming seem to be the most mysterious notion of the century. I find two reasons for this: lack of familiarity with category theory; many

More information

Relational Database: The Relational Data Model; Operations on Database Relations

Relational Database: The Relational Data Model; Operations on Database Relations Relational Database: The Relational Data Model; Operations on Database Relations Greg Plaxton Theory in Programming Practice, Spring 2005 Department of Computer Science University of Texas at Austin Overview

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

Inductive Types for Free

Inductive Types for Free Inductive Types for Free Representing Nested Inductive Types using W-types Michael Abbott (U. Leicester) Thorsten Altenkirch (U. Nottingham) Neil Ghani (U. Leicester) Inductive Types for Free p.1/22 Ideology

More information

I. An introduction to Boolean inverse semigroups

I. An introduction to Boolean inverse semigroups I. An introduction to Boolean inverse semigroups Mark V Lawson Heriot-Watt University, Edinburgh June 2016 1 0. In principio The monograph J. Renault, A groupoid approach to C - algebras, Lecture Notes

More information

Chapter 3: Relational Model

Chapter 3: Relational Model Chapter 3: Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational Calculus Extended Relational-Algebra-Operations Modification of the Database

More information

Mathematics for Computer Scientists 2 (G52MC2)

Mathematics for Computer Scientists 2 (G52MC2) Mathematics for Computer Scientists 2 (G52MC2) L07 : Operations on sets School of Computer Science University of Nottingham October 29, 2009 Enumerations We construct finite sets by enumerating a list

More information

Contents Introduction and Technical Preliminaries Composition of Schema Mappings: Syntax and Semantics

Contents Introduction and Technical Preliminaries Composition of Schema Mappings: Syntax and Semantics 1 Introduction and Technical Preliminaries... 1 1.1 Historical Background... 1 1.2 Introduction to Lattices, Algebras and Intuitionistic Logics... 5 1.3 Introduction to First-Order Logic (FOL)... 12 1.3.1

More information

Textbook: Chapter 6! CS425 Fall 2013 Boris Glavic! Chapter 3: Formal Relational Query. Relational Algebra! Select Operation Example! Select Operation!

Textbook: Chapter 6! CS425 Fall 2013 Boris Glavic! Chapter 3: Formal Relational Query. Relational Algebra! Select Operation Example! Select Operation! Chapter 3: Formal Relational Query Languages CS425 Fall 2013 Boris Glavic Chapter 3: Formal Relational Query Languages Relational Algebra Tuple Relational Calculus Domain Relational Calculus Textbook:

More information

Lecture 18: Groupoids and spaces

Lecture 18: Groupoids and spaces Lecture 18: Groupoids and spaces The simplest algebraic invariant of a topological space T is the set π 0 T of path components. The next simplest invariant, which encodes more of the topology, is the fundamental

More information

DATABASE DESIGN II - 1DL400

DATABASE DESIGN II - 1DL400 DATABASE DESIGN II - 1DL400 Fall 2016 A second course in database systems http://www.it.uu.se/research/group/udbl/kurser/dbii_ht16 Kjell Orsborn Uppsala Database Laboratory Department of Information Technology,

More information

CMPS 277 Principles of Database Systems. https://courses.soe.ucsc.edu/courses/cmps277/fall11/01. Lecture #3

CMPS 277 Principles of Database Systems. https://courses.soe.ucsc.edu/courses/cmps277/fall11/01. Lecture #3 CMPS 277 Principles of Database Systems https://courses.soe.ucsc.edu/courses/cmps277/fall11/01 Lecture #3 1 Summary of Lectures #1 and #2 Codd s Relational Model based on the concept of a relation (table)

More information

CS34800 Information Systems. The Relational Model Prof. Walid Aref 29 August, 2016

CS34800 Information Systems. The Relational Model Prof. Walid Aref 29 August, 2016 CS34800 Information Systems The Relational Model Prof. Walid Aref 29 August, 2016 1 Chapter: The Relational Model Structure of Relational Databases Relational Algebra Tuple Relational Calculus Domain Relational

More information

Negations in Refinement Type Systems

Negations in Refinement Type Systems Negations in Refinement Type Systems T. Tsukada (U. Tokyo) 14th March 2016 Shonan, JAPAN This Talk About refinement intersection type systems that refute judgements of other type systems. Background Refinement

More information

Relational Algebra. Procedural language Six basic operators

Relational Algebra. Procedural language Six basic operators Relational algebra Relational Algebra Procedural language Six basic operators select: σ project: union: set difference: Cartesian product: x rename: ρ The operators take one or two relations as inputs

More information

Recursive Types and Subtyping

Recursive Types and Subtyping Recursive Types and Subtyping #1 One-Slide Summary Recall: Recursive types (e.g., τ list) make the typed lambda calculus as powerful as the untyped lambda calculus. If τ is a subtype of σ then any expression

More information

Algebraic Topology: A brief introduction

Algebraic Topology: A brief introduction Algebraic Topology: A brief introduction Harish Chintakunta This chapter is intended to serve as a brief, and far from comprehensive, introduction to Algebraic Topology to help the reading flow of this

More information

Web Science & Technologies University of Koblenz Landau, Germany. Relational Data Model

Web Science & Technologies University of Koblenz Landau, Germany. Relational Data Model Web Science & Technologies University of Koblenz Landau, Germany Relational Data Model Overview Relational data model; Tuples and relations; Schemas and instances; Named vs. unnamed perspective; Relational

More information

Languages and Compilers

Languages and Compilers Principles of Software Engineering and Operational Systems Languages and Compilers SDAGE: Level I 2012-13 3. Formal Languages, Grammars and Automata Dr Valery Adzhiev vadzhiev@bournemouth.ac.uk Office:

More information

Uncertainty in Databases. Lecture 2: Essential Database Foundations

Uncertainty in Databases. Lecture 2: Essential Database Foundations Uncertainty in Databases Lecture 2: Essential Database Foundations Table of Contents 1 2 3 4 5 6 Table of Contents Codd s Vision Codd Catches On Top Academic Recognition Selected Publication Venues 1 2

More information

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS What is discrete? Sets (Rosen, Chapter 2) TOPICS Discrete math Set Definition Set Operations Tuples Consisting of distinct or unconnected elements, not continuous (calculus) Helps us in Computer Science

More information

Category Theory & Functional Data Abstraction

Category Theory & Functional Data Abstraction Category Theory & Functional Data Abstraction Brandon Shapiro Math 100b 1. Introduction Throughout mathematics, particularly algebra, there are numerous commonalities between the studies of various objects

More information

Chapter 6: Formal Relational Query Languages

Chapter 6: Formal Relational Query Languages Chapter 6: Formal Relational Query Languages Database System Concepts, 6 th Ed. See www.db-book.com for conditions on re-use Chapter 6: Formal Relational Query Languages Relational Algebra Tuple Relational

More information

Query Processing and Optimization

Query Processing and Optimization Query Processing and Optimization (Part-1) Prof Monika Shah Overview of Query Execution SQL Query Compile Optimize Execute SQL query parse parse tree statistics convert logical query plan apply laws improved

More information

Syntax-semantics interface and the non-trivial computation of meaning

Syntax-semantics interface and the non-trivial computation of meaning 1 Syntax-semantics interface and the non-trivial computation of meaning APA/ASL Group Meeting GVI-2: Lambda Calculi, Type Systems, and Applications to Natural Language APA Eastern Division 108th Annual

More information

II. Structured Query Language (SQL)

II. Structured Query Language (SQL) II. Structured Query Language (SQL) Lecture Topics ffl Basic concepts and operations of the relational model. ffl The relational algebra. ffl The SQL query language. CS448/648 II - 1 Basic Relational Concepts

More information

CSC Discrete Math I, Spring Sets

CSC Discrete Math I, Spring Sets CSC 125 - Discrete Math I, Spring 2017 Sets Sets A set is well-defined, unordered collection of objects The objects in a set are called the elements, or members, of the set A set is said to contain its

More information

Relational Model & Algebra. Announcements (Tue. Sep. 3) Relational data model. CompSci 316 Introduction to Database Systems

Relational Model & Algebra. Announcements (Tue. Sep. 3) Relational data model. CompSci 316 Introduction to Database Systems Relational Model & Algebra CompSci 316 Introduction to Database Systems Announcements (Tue. Sep. 3) Homework #1 has been posted Sign up for Gradiance now! Windows Azure passcode will be emailed soon sign

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Recursive Types and Subtyping

Recursive Types and Subtyping Recursive Types and Subtyping #1 One-Slide Summary Recursive types (e.g., list) make the typed lambda calculus as powerful as the untyped lambda calculus. If is a subtype of then any expression of type

More information

Chapter 6 Part I The Relational Algebra and Calculus

Chapter 6 Part I The Relational Algebra and Calculus Chapter 6 Part I The Relational Algebra and Calculus Copyright 2004 Ramez Elmasri and Shamkant Navathe Database State for COMPANY All examples discussed below refer to the COMPANY database shown here.

More information

Relational Model, Relational Algebra, and SQL

Relational Model, Relational Algebra, and SQL Relational Model, Relational Algebra, and SQL August 29, 2007 1 Relational Model Data model. constraints. Set of conceptual tools for describing of data, data semantics, data relationships, and data integrity

More information

3. Relational Data Model 3.5 The Tuple Relational Calculus

3. Relational Data Model 3.5 The Tuple Relational Calculus 3. Relational Data Model 3.5 The Tuple Relational Calculus forall quantification Syntax: t R(P(t)) semantics: for all tuples t in relation R, P(t) has to be fulfilled example query: Determine all students

More information

Relational Algebra. Study Chapter Comp 521 Files and Databases Fall

Relational Algebra. Study Chapter Comp 521 Files and Databases Fall Relational Algebra Study Chapter 4.1-4.2 Comp 521 Files and Databases Fall 2010 1 Relational Query Languages Query languages: Allow manipulation and retrieval of data from a database. Relational model

More information

Cubical sets as a classifying topos

Cubical sets as a classifying topos Chalmers CMU Now: Aarhus University Homotopy Type Theory The homotopical interpretation of type theory: types as spaces upto homotopy dependent types as fibrations (continuous families of spaces) identity

More information

Relational Algebra 1. Week 4

Relational Algebra 1. Week 4 Relational Algebra 1 Week 4 Relational Query Languages Query languages: Allow manipulation and retrieval of data from a database. Relational model supports simple, powerful QLs: Strong formal foundation

More information

CS 317/387. A Relation is a Table. Schemas. Towards SQL - Relational Algebra. name manf Winterbrew Pete s Bud Lite Anheuser-Busch Beers

CS 317/387. A Relation is a Table. Schemas. Towards SQL - Relational Algebra. name manf Winterbrew Pete s Bud Lite Anheuser-Busch Beers CS 317/387 Towards SQL - Relational Algebra A Relation is a Table Attributes (column headers) Tuples (rows) name manf Winterbrew Pete s Bud Lite Anheuser-Busch Beers Schemas Relation schema = relation

More information

Lecture 5: The Halting Problem. Michael Beeson

Lecture 5: The Halting Problem. Michael Beeson Lecture 5: The Halting Problem Michael Beeson Historical situation in 1930 The diagonal method appears to offer a way to extend just about any definition of computable. It appeared in the 1920s that it

More information

Introduction to Query Processing and Query Optimization Techniques. Copyright 2011 Ramez Elmasri and Shamkant Navathe

Introduction to Query Processing and Query Optimization Techniques. Copyright 2011 Ramez Elmasri and Shamkant Navathe Introduction to Query Processing and Query Optimization Techniques Outline Translating SQL Queries into Relational Algebra Algorithms for External Sorting Algorithms for SELECT and JOIN Operations Algorithms

More information

THE RELATIONAL MODEL. University of Waterloo

THE RELATIONAL MODEL. University of Waterloo THE RELATIONAL MODEL 1-1 List of Slides 1 2 The Relational Model 3 Relations and Databases 4 Example 5 Another Example 6 What does it mean? 7 Example Database 8 What can we do with it? 9 Variables and

More information

An introduction to simplicial sets

An introduction to simplicial sets An introduction to simplicial sets 25 Apr 2010 1 Introduction This is an elementary introduction to simplicial sets, which are generalizations of -complexes from algebraic topology. The theory of simplicial

More information

Relational Metadata Integration. Cathy Wyss

Relational Metadata Integration. Cathy Wyss Relational Metadata Integration Cathy Wyss April 22, 2005 1 Talk Overview 1. Motivating Scenario 2. Foundations (TODS, June 2005) Federated Data Model FIRA FISQL 3. Current Work Data mapping as search

More information

λ-calculus Lecture 1 Venanzio Capretta MGS Nottingham

λ-calculus Lecture 1 Venanzio Capretta MGS Nottingham λ-calculus Lecture 1 Venanzio Capretta MGS 2018 - Nottingham Table of contents 1. History of λ-calculus 2. Definition of λ-calculus 3. Data Structures 1 History of λ-calculus Hilbert s Program David Hilbert

More information

CMPT 354: Database System I. Lecture 5. Relational Algebra

CMPT 354: Database System I. Lecture 5. Relational Algebra CMPT 354: Database System I Lecture 5. Relational Algebra 1 What have we learned Lec 1. DatabaseHistory Lec 2. Relational Model Lec 3-4. SQL 2 Why Relational Algebra matter? An essential topic to understand

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

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

CS 377 Database Systems

CS 377 Database Systems CS 377 Database Systems Relational Algebra and Calculus Li Xiong Department of Mathematics and Computer Science Emory University 1 ER Diagram of Company Database 2 3 4 5 Relational Algebra and Relational

More information

COMP 244 DATABASE CONCEPTS AND APPLICATIONS

COMP 244 DATABASE CONCEPTS AND APPLICATIONS COMP 244 DATABASE CONCEPTS AND APPLICATIONS Relational Algebra And Calculus 1 Relational Algebra A formal query language associated with the relational model. Queries in ALGEBRA are composed using a collection

More information

Outline. 1 CS520-5) Data Exchange

Outline. 1 CS520-5) Data Exchange Outline 0) Course Info 1) Introduction 2) Data Preparation and Cleaning 3) Schema matching and mapping 4) Virtual Data Integration 5) Data Exchange 6) Data Warehousing 7) Big Data Analytics 8) Data Provenance

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Lecture 15 Ana Bove May 23rd 2016 More on Turing machines; Summary of the course. Overview of today s lecture: Recap: PDA, TM Push-down

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

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

CS 275 Automata and Formal Language Theory. First Problem of URMs. (a) Definition of the Turing Machine. III.3 (a) Definition of the Turing Machine

CS 275 Automata and Formal Language Theory. First Problem of URMs. (a) Definition of the Turing Machine. III.3 (a) Definition of the Turing Machine CS 275 Automata and Formal Language Theory Course Notes Part III: Limits of Computation Chapt. III.3: Turing Machines Anton Setzer http://www.cs.swan.ac.uk/ csetzer/lectures/ automataformallanguage/13/index.html

More information

Relational Algebra. Lecture 4A Kathleen Durant Northeastern University

Relational Algebra. Lecture 4A Kathleen Durant Northeastern University Relational Algebra Lecture 4A Kathleen Durant Northeastern University 1 Relational Query Languages Query languages: Allow manipulation and retrieval of data from a database. Relational model supports simple,

More information

FRUCHT S THEOREM FOR THE DIGRAPH FACTORIAL

FRUCHT S THEOREM FOR THE DIGRAPH FACTORIAL Discussiones Mathematicae Graph Theory 33 (2013) 329 336 doi:10.7151/dmgt.1661 FRUCHT S THEOREM FOR THE DIGRAPH FACTORIAL Richard H. Hammack Department of Mathematics and Applied Mathematics Virginia Commonwealth

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

Relational Model & Algebra. Announcements (Thu. Aug. 27) Relational data model. CPS 116 Introduction to Database Systems

Relational Model & Algebra. Announcements (Thu. Aug. 27) Relational data model. CPS 116 Introduction to Database Systems Relational Model & Algebra CPS 116 Introduction to Database Systems Announcements (Thu. Aug. 27) 2 Homework #1 will be assigned next Tuesday Office hours: see also course website Jun: LSRC D327 Tue. 1.5

More information

Introduction III. Graphs. Motivations I. Introduction IV

Introduction III. Graphs. Motivations I. Introduction IV Introduction I Graphs Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Graph theory was introduced in the 18th century by Leonhard Euler via the Königsberg

More information

Today s Topics. What is a set?

Today s Topics. What is a set? Today s Topics Introduction to set theory What is a set? Set notation Basic set operations What is a set? Definition: A set is an unordered collection of objects Examples: Sets can contain items of mixed

More information

Substitution in Structural Operational Semantics and value-passing process calculi

Substitution in Structural Operational Semantics and value-passing process calculi Substitution in Structural Operational Semantics and value-passing process calculi Sam Staton Computer Laboratory University of Cambridge Abstract Consider a process calculus that allows agents to communicate

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

Composing Schema Mapping

Composing Schema Mapping Composing Schema Mapping An Overview Phokion G. Kolaitis UC Santa Cruz & IBM Research Almaden Joint work with R. Fagin, L. Popa, and W.C. Tan 1 Data Interoperability Data may reside at several different

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 19 Query Optimization Introduction Query optimization Conducted by a query optimizer in a DBMS Goal: select best available strategy for executing query Based on information available Most RDBMSs

More information

Recursively defined cpo algebras

Recursively defined cpo algebras Recursively defined cpo algebras Ohad Kammar and Paul Blain Levy July 13, 2018 Ohad Kammar and Paul Blain Levy Recursively defined cpo algebras July 13, 2018 1 / 16 Outline 1 Bilimit compact categories

More information

Foundations of Databases

Foundations of Databases Foundations of Databases Relational Query Languages with Negation Free University of Bozen Bolzano, 2009 Werner Nutt (Slides adapted from Thomas Eiter and Leonid Libkin) Foundations of Databases 1 Queries

More information

Uncertain Data Models

Uncertain Data Models Uncertain Data Models Christoph Koch EPFL Dan Olteanu University of Oxford SYNOMYMS data models for incomplete information, probabilistic data models, representation systems DEFINITION An uncertain data

More information

DERIVED DEFORMATION RINGS FOR GROUP REPRESENTATIONS

DERIVED DEFORMATION RINGS FOR GROUP REPRESENTATIONS DERIVED DEFORMATION RINGS FOR GROUP REPRESENTATIONS LECTURES BY SOREN GALATIUS, NOTES BY TONY FENG Contents 1. Homotopy theory of representations 1 2. The classical theory 2 3. The derived theory 3 References

More information

Relational Algebra. Relational Algebra. 7/4/2017 Md. Golam Moazzam, Dept. of CSE, JU

Relational Algebra. Relational Algebra. 7/4/2017 Md. Golam Moazzam, Dept. of CSE, JU Relational Algebra 1 Structure of Relational Databases A relational database consists of a collection of tables, each of which is assigned a unique name. A row in a table represents a relationship among

More information

DATABASE MANAGEMENT SYSTEMS

DATABASE MANAGEMENT SYSTEMS www..com Code No: N0321/R07 Set No. 1 1. a) What is a Superkey? With an example, describe the difference between a candidate key and the primary key for a given relation? b) With an example, briefly describe

More information

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes)

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes) ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes) Steve Vickers CS Theory Group Birmingham 4. Toposes and geometric reasoning How to "do generalized

More information

On the Expressiveness of Polyadicity in Higher-Order Process Calculi

On the Expressiveness of Polyadicity in Higher-Order Process Calculi On the Expressiveness of Polyadicity in Higher-Order Process Calculi Ivan Lanese, Jorge A. Pérez, Davide Sangiorgi (Univ. di Bologna) Alan Schmitt (INRIA Grenoble - Rhône Alpes) ICTCS 09 Cremona, September

More information

CS 4110 Programming Languages & Logics. Lecture 27 Recursive Types

CS 4110 Programming Languages & Logics. Lecture 27 Recursive Types CS 4110 Programming Languages & Logics Lecture 27 Recursive Types 4 November 2016 Announcements 2 My office hours are at the normal time today but canceled on Monday Guest lecture by Seung Hee Han on Monday

More information