First-Order Queries Chapter I First-Order Logic Outline

Total Page:16

File Type:pdf, Size:1020Kb

First-Order Queries Chapter I First-Order Logic Outline Overview of Part 1: First-order queries Knowledge Bases and Databases Part 1: First-Order Queries 1 First-order logic 1 Syntax of first-order logic Diego Calvanese 2 Semantics of first-order logic 3 First-order logic queries Faculty of Computer Science Master of Science in Computer Science 2 First-order query evaluation A.Y. 2007/2008 1 Query evaluation problem 2 Complexity of query evaluation 3 Conjunctive queries 1 Evaluation of conjunctive queries 2 Containment of conjunctive queries 3 Unions of conjunctive queries unibz.it D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (2/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic Outline Chapter I 1 Syntax of first-order logic First-Order Logic 2 Semantics of first-order logic 3 First-order logic queries D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (3/66) D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (4/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic Outline First-order logic 1 Syntax of first-order logic First-order logic (FOL) is the logic to speak about objects, which are the domain of discourse or universe. 2 Semantics of first-order logic FOL is concerned about properties of these objects and relations over objects (resp., unary and n-ary predicates). 3 First-order logic queries FOL also has functions including constants that denote objects. unibz.it D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (5/66) D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (6/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic FOL syntax – Terms FOL syntax – Formulas Def.: The set of Formulas is defined inductively as follows: We first introduce: k If t1, . , tk Terms and P is a k-ary predicate, then A set Vars = x1, . , xn of individual variables (i.e., variables ∈ { } P k(t , . , t ) Formulas (atomic formulas). that denote single objects). 1 k ∈ If t , t Terms, then t = t Formulas. A set of functions symbols, each of given arity 0. 1 2 ∈ 1 2 ∈ ≥ If ϕ Formulas and ψ Formulas then Functions of arity 0 are called constants. ∈ ∈ ϕ Formulas ϕ¬ ∈ψ Formulas ∧ ∈ Def.: The set of Terms is defined inductively as follows: ϕ ψ Formulas ϕ ∨ ψ∈ Formulas Vars Terms; → ∈ ⊆ If ϕ Formulas and x Vars then k ∈ ∈ If t1, . , tk Terms and f is a k-ary function symbol, then x.ϕ Formulas k ∈ ∃ ∈ f (t1, . , tk) Terms; x.ϕ Formulas ∈ ∀ ∈ Nothing else is in Terms. Nothing else is in Formulas. Note: a predicate of arity 0 is a proposition of propositional logic. D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (7/66) D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (8/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic Outline Interpretations Given an alphabet of predicates P1,P2,... and functions f1, f2,..., each with an associated arity, a FOL interpretation is: 1 Syntax of first-order logic = (∆I ,P I ,P I , . , f I , f I ,...) I 1 2 1 2 2 Semantics of first-order logic where: ∆I is the domain (a set of objects) 3 First-order logic queries if P is a k-ary predicate, then P ∆ ∆ (k times) i iI ⊆ I × · · · × I if f is a k-ary function, then f : ∆ ∆ ∆ (k times) i iI I × · · · × I −→ I if f is a constant (i.e., a 0-ary function), then f : () ∆ i iI −→ I (i.e., fi denotes exactly one object of the domain) unibz.it D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (9/66) D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (10/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic Assignment Truth in an interpretation wrt an assignment We define when a FOL formula ϕ is true in an interpretation wrt an Let Vars be a set of (individual) variables. I assignment α, written , α = ϕ: I | Def.: Given an interpretation , an assignment is a function , α = P (t , . , t ) if (ˆα(t ),..., αˆ(t )) P I I | 1 k 1 k ∈ I , α = t = t if αˆ(t ) =α ˆ(t ) I | 1 2 1 2 α : Vars ∆I , α = ϕ if , α = ϕ −→ I | ¬ I 6| that assigns to each variable x Vars an object α(x) ∆ . , α = ϕ ψ if , α = ϕ and , α = ψ I I | ∧ I | I | ∈ ∈ , α = ϕ ψ if , α = ϕ or , α = ψ I | ∨ I | I | , α = ϕ ψ if , α = ϕ implies , α = ψ I | → I | I | It is convenient to extend the notion of assignment to terms. We can do , α = x.ϕ if for some a ∆ we have , α[x a] = ϕ I | ∃ ∈ I I 7→ | so by defining a function αˆ : Terms ∆I inductively as follows: , α = x.ϕ if for every a ∆ we have , α[x a] = ϕ −→ I | ∀ ∈ I I 7→ | αˆ(x) = α(x), if x Vars ∈ Here, α[x a] stands for the new assignment obtained from α as αˆ(f(t1, . , tk)) = f I (ˆα(t1),..., αˆ(tk)) 7→ follows: α[x a](x) = a 7→ Note: for constants αˆ(c) = cI . α[x a](y) = α(y) for y = x 7→ 6 D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (11/66) D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (12/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic Open vs. closed formulas Outline Definitions A variable x in a formula ϕ is free if x does not occur in the scope of any quantifier, otherwise it is bounded. 1 Syntax of first-order logic An open formula is a formula that has some free variable. A closed formula, also called sentence, is a formula that has no free 2 Semantics of first-order logic variables. For closed formulas (but not for open formulas) we can define what it 3 First-order logic queries means to be true in an interpretation, written = ϕ, without I | mentioning the assignment, since the assignment α does not play any role in verifying , α = ϕ. I | Instead, open formulas are strongly related to queries — cf. relational databases. unibz.it D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (13/66) D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (14/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic FOL queries FOL boolean queries Def.: A FOL query is an (open) FOL formula. Def.: A FOL boolean query is a FOL query without free variables. When ϕ is a FOL query with free variables (x1, . , xk), then we sometimes write it as ϕ(x1, . , xk), and say that ϕ has arity k. Hence, the answer to a boolean query ϕ() is defined as follows: Given an interpretation , we are interested in those assignments that I map the variables x1, . , xk (and only those). We write an assignment ϕ()I = () , = ϕ() { | I hi | } α s.t. α(x ) = a , for i = 1, . , k, as a , . , a . i i h 1 ki Def.: Given an interpretation , the answer to a query ϕ(x , . , x ) is I 1 k Such an answer is ϕ(x1, . , xk)I = (a1, . , ak) , a1, . , ak = ϕ(x1, . , xk) (), if = ϕ { | I h i | } I | , if = ϕ. Note: We will also use the notation ϕI , which keeps the free variables ∅ I 6| implicit, and ϕ( ) making apparent that ϕ becomes a functions from As an obvious convention we read () as “true” and as “false”. I ∅ interpretations to set of tuples. D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (15/66) D. Calvanese Part 1: First-Order Queries KBDB – 2007/2008 (16/66) Syntax of first-order logic Semantics of first-order logic First-order logic queries Syntax of first-order logic Semantics of first-order logic First-order logic queries Chap. 1: First-Order Logic Chap. 1: First-Order Logic FOL formulas: logical tasks FOL queries – Logical tasks Validity: if ϕ is valid, then ϕ = ∆ ∆ for all , i.e., the I I × · · · × I I Definitions query always returns all the tuples of . I Validity: ϕ is valid iff for all and α we have that , α = ϕ. Satisfiability: if ϕ is satisfiable, then ϕ = for some , i.e., the I 6 ∅ I I I | query returns at least one tuple. Satisfiability: ϕ is satisfiable iff there exists an and α such that Logical implication: if ϕ logically implies ψ, then ϕ ψ for all I I ⊆ I , α = ϕ, and unsatisfiable otherwise.
Recommended publications
  • Optimizing Select-Project-Join Expressions
    Optimizing select-project-join expressions Jan Van den Bussche Stijn Vansummeren 1 Introduction The expression that we obtain by translating a SQL query q into the re- lational algebra is called the logical query plan for q. The ultimate goal is to further translate this logical query plan into a physical query plan that contains all details on how the query is to be executed. First, however, we can apply some important optimizations directly on the logical query plan. These optimizations transform the logical query plan into an equivalent log- ical query plan that is more efficient to execute. In paragraph 16.3.3, the book discusses the simple (but very important) logical optimizations of \pushing" selections and projections; and recogniz- ing joins, based on the algebraic equalities from section 16.2. In addition, in these notes, we describe another important logical opti- mization: the removal of redundant joins. 2 Undecidability of the general problem In general, we could formulate the optimization problem of relational algebra expressions as follows: Input: A relational algebra expression e. Output: A relational algebra expression e0 such that: 1. e0 is equivalent to e (denoted as e0 ≡ e), in the sense that e(D) = e0(D) for every database D. Here, e(D) stands for the relation resulting from evaluating e on D. 2. e0 is optimal, in the sense that there is no expression e0 that is shorter than e0, yet still equivalent to e. Of course, we have to define what the length of a relational algebra expression is. A good way to do this is to count the number of times a relational algebra operator is applied in the expression.
    [Show full text]
  • Conjunctive Queries
    Ontology and Database Systems: Foundations of Database Systems Part 3: Conjunctive Queries Werner Nutt Faculty of Computer Science Master of Science in Computer Science A.Y. 2013/2014 Foundations of Database Systems Part 3: Conjunctive Queries Looking Back . We have reviewed three formalisms for expressing queries Relational Algebra Relational Calculus (with its domain-independent fragment) Nice SQL and seen that they have the same expressivity However, crucial properties ((un)satisfiability, equivalence, containment) are undecidable Hence, automatic analysis of such queries is impossible Can we do some analysis if queries are simpler? unibz.it W. Nutt ODBS-FDBs 2013/2014 (1/43) Foundations of Database Systems Part 3: Conjunctive Queries Many Natural Queries Can Be Expressed . in SQL using only a single SELECT-FROM-WHERE block and conjunctions of atomic conditions in the WHERE clause; we call these the CSQL queries. in Relational Algebra using only the operators selection σC (E), projection πC (E), join E1 1C E2, renaming (ρA B(E)); we call these the SPJR queries (= select-project-join-renaming queries) . in Relational Calculus using only the logical symbols \^" and 9 such that every variable occurs in a relational atom; we call these the conjunctive queries unibz.it W. Nutt ODBS-FDBs 2013/2014 (2/43) Foundations of Database Systems Part 3: Conjunctive Queries Conjunctive Queries Theorem The classes of CSQL queries, SPJR queries, and conjunctive queries have all the same expressivity. Queries can be equivalently translated from one formalism to the other in polynomial time. Proof. By specifying translations. Intuition: By a conjunctive query we define a pattern of what the things we are interested in look like.
    [Show full text]
  • Conjunctive Queries
    DATABASE THEORY Lecture 5: Conjunctive Queries Markus Krotzsch¨ TU Dresden, 28 April 2016 Overview 1. Introduction | Relational data model 2. First-order queries 3. Complexity of query answering 4. Complexity of FO query answering 5. Conjunctive queries 6. Tree-like conjunctive queries 7. Query optimisation 8. Conjunctive Query Optimisation / First-Order Expressiveness 9. First-Order Expressiveness / Introduction to Datalog 10. Expressive Power and Complexity of Datalog 11. Optimisation and Evaluation of Datalog 12. Evaluation of Datalog (2) 13. Graph Databases and Path Queries 14. Outlook: database theory in practice See course homepage [) link] for more information and materials Markus Krötzsch, 28 April 2016 Database Theory slide 2 of 65 Review: FO Query Complexity The evaluation of FO queries is • PSpace-complete for combined complexity • PSpace-complete for query complexity • AC0-complete for data complexity { PSpace is rather high { Are there relevant query languages that are simpler than that? Markus Krötzsch, 28 April 2016 Database Theory slide 3 of 65 Conjunctive Queries Idea: restrict FO queries to conjunctive, positive features Definition A conjunctive query (CQ) is an expression of the form 9y1, ::: , ym.A1 ^ ::: ^ A` where each Ai is an atom of the form R(t1, ::: , tk). In other words, a conjunctive query is an FO query that only uses conjunctions of atoms and (outer) existential quantifiers. Example: “Find all lines that depart from an accessible stop” (as seen in earlier lectures) 9ySID, yStop, yTo.Stops(ySID, yStop,"true") ^ Connect(ySID, yTo, xLine) Markus Krötzsch, 28 April 2016 Database Theory slide 4 of 65 Conjunctive Queries in Relational Calculus The expressive power of CQs can also be captured in the relational calculus Definition A conjunctive query (CQ) is a relational algebra expression that uses only the operations select σn=m, project πa1,:::,an , join ./, and renaming δa1,:::,an!b1,:::,bn .
    [Show full text]
  • Conjunctive Queries Complexity & Decomposition Techniques
    Conjunctive Queries Complexity & Decomposition Techniques G. Gottlob Technical University of Vienna, Austria This talk reports about joint work with I. Adler, M. Grohe, N. Leone and F. Scarcello For papers and further material see: http://ulisse.deis.unical.it/~frank/Hypertrees/ Three Problems: CSP: Constraint satisfaction problem BCQ: Boolean conjunctive query evaluation HOM: The homomorphism problem Important problems in different areas. All these problems are hypergraph based. But actually: CSP = BCQ = HOM CSP Set of variables V={X1,...,Xn}, domain D, Set of constraints {C1,...,Cm} where: Ci= <Si, Ri> scope relation (Xj1,...,Xjr) 1 6 7 3 1 5 3 9 2 4 7 6 3 5 4 7 Solution to this CSP: A substitution h: VÆD such that ∀i: h(Si ∈ Ri) Associated hypergraph: {var(Si) | 1 ≤ i ≤ m } Example of CSP: Crossword Puzzle 1h: P A R I S 1v: L I M B O P A N D A L I N G O and so on L A U R A P E T R A A N I T A P A M P A P E T E R Conjunctive Database Queries are CSPs ! DATABASE: Enrolled Teaches Parent John Algebra 2003 McLane Algebra March McLane Lisa Robert Logic 2003 Kolaitis Logic May Kolaitis Robert Mary DB 2002 Lausen DB June Rahm Mary Lisa DB 2003 Rahm DB May ……… ….. ……. ……… ….. ……. ……… ….. QUERY: Is there any teacher having a child enrolled in her course? ans Å Enrolled(S,C,R) ∧ Teaches(P,C,A) ∧ Parent(P,S) Queries and Hypergraphs ans Å Enrolled(S,C’,R) ∧ Teaches(P,C,A) ∧ Parent(P,S) C’ C R A S P Queries, CSPs, and Hypergraphs Is there a teacher whose child attends some course? Enrolled(S,C,R) ∧ Teaches(P,C,A) ∧ Parent(P,S) C R A S P The Homomorphism Problem Given two relational structures A = (U , R1, R2,..., Rk ) B = (V , S1, S 2 ,..., Sk ) Decide whether there exists a homomorphism h from A to B h : U ⎯⎯→ V such that ∀x, ∀i x ∈ Ri ⇒ h(x) ∈ Si HOM is NP-complete (well-known) Membership: Obvious, guess h.
    [Show full text]
  • Terms First-Order Logic: Syntax - Formulas
    First-order logic FOL Query Evaluation Giuseppe De Giacomo • First-order logic (FOL) is the logic to speak about object, which are the domain of discourse or universe. Universita` di Roma “La Sapienza” • FOL is concerned about Properties of these objects and Relations over objects (resp. unary and n-ary Predicates) • FOL also has Functions including Constants that denote objects. Corso di Seminari di Ingegneria del Software: Data and Service Integration Laurea Specialistica in Ingegneria Informatica Universita` degli Studi di Roma “La Sapienza” A.A. 2005-06 G. De Giacomo FOL queries 1 First-order logic: syntax - terms First-order logic: syntax - formulas Ter ms : defined inductively as follows Formulas: defined inductively as follows k • Vars: A set {x1,...,xn} of individual variables (variables that denote • if t1,...,tk ∈ Ter ms and P is a k-ary predicate, then k single objects) P (t1,...,tk) ∈ Formulas (atomic formulas) • Function symbols (including constants: a set of functions symbols of given • φ ∈ Formulas and ψ ∈ Formulas then arity > 0. Functions of arity 0 are called constants. – ¬φ ∈ Formulas • Vars ⊆ Ter ms – φ ∧ ψ ∈ Formulas k – φ ∨ ψ ∈ Formulas • if t1,...,tk ∈ Ter ms and f is a k-ary function, then k ⊃ ∈ f (t1,...,tk) ∈ Ter ms – φ ψ Formulas • nothing else is in Ter ms . • φ ∈ Formulas and x ∈ Vars then – ∃x.φ ∈ Formulas – ∀x.φ ∈ Formulas G. De Giacomo FOL queries 2 G. De Giacomo FOL queries 3 • nothing else is in Formulas. First-order logic: Semantics - interpretations Note: if a predicate is of arity Pi , then it is a proposition of propositional logic.
    [Show full text]
  • Certain Conjunctive Query Answering in SQL
    Certain Conjunctive Query Answering in SQL Alexandre Decan, Fabian Pijcke, and Jef Wijsen Universit´ede Mons, Mons, Belgium, falexandre.decan, [email protected], [email protected] Abstract. An uncertain database db is defined as a database in which distinct tuples of the same relation can agree on their primary key. A repair (or possible world) of db is then obtained by selecting a maxi- mal number of tuples without ever selecting two distinct tuples of the same relation that agree on their primary key. Given a query Q on db, the certain answer is the intersection of the answers to Q on all re- pairs. Recently, a syntactic characterization was obtained of the class of acyclic self-join-free conjunctive queries for which certain answers are definable by a first-order formula, called certain first-order rewriting [15]. In this article, we investigate the nesting and alternation of quantifiers in certain first-order rewritings, and propose two syntactic simplifica- tion techniques. We then experimentally verify whether these syntactic simplifications result in lower execution times on real-life SQL databases. 1 Introduction Uncertainty can be modeled in the relational model by allowing primary key vi- olations. Primary keys are underlined in the conference planning database db0 in Fig. 1. There are still two candidate cities for organizing SUM 2016 and SUM 2017. The table S shows controversy about the attractiveness of Mons, while information about the attractiveness of Gent is missing. A repair (or pos- S Town Attractiveness R Conf Year Town Charleroi C SUM 2012 Marburg Marburg A SUM 2016 Mons Mons A SUM 2016 Gent Mons B SUM 2017 Rome Paris A SUM 2017 Paris Rome A Fig.
    [Show full text]
  • Queries with Guarded Negation
    Queries with Guarded Negation Vince Bar´ any´ Balder ten Cate Martin Otto TU Darmstadt, Germany UC Santa Cruz, CA, USA TU Darmstadt, Germany [email protected] [email protected] [email protected] ABSTRACT a single record in the database. For instance, if a A well-established and fundamental insight in database the- database schema contains relations Author(AuthID,Name) ory is that negation (also known as complementation) tends and Book(AuthID,Title,Year,Publisher), the query that to make queries difficult to process and difficult to reason asks for authors that did not publish any book with Elsevier about. Many basic problems are decidable and admit prac- since “not publishing a book with Elsevier” is a property tical algorithms in the case of unions of conjunctive queries, of an author. The query that asks for pairs of authors and but become difficult or even undecidable when queries are book titles where the author did not publish the book, on the allowed to contain negation. Inspired by recent results in fi- other hand, is not allowed, since it involves a negative con- nite model theory, we consider a restricted form of negation, dition (in this case, an inequality) pertaining to two values guarded negation. We introduce a fragment of SQL, called that do not necessarily co-occur in a record in the database. GN-SQL, as well as a fragment of Datalog with stratified The requirement of guarded negation can be formally stated negation, called GN-Datalog, that allow only guarded nega- most easily in terms of the Relational Algebra: we allow the tion, and we show that these query languages are compu- use of the difference operator E1 − E2 provided that E1 is a tationally well behaved, in terms of testing query contain- projection of a relation from the database.
    [Show full text]
  • 4Conjunctive Queries
    4 Conjunctive Queries Alice: Shall we start asking queries? Sergio: Very simple ones for the time being. Riccardo: But the system will answer them fast. Vittorio: And there is some nice theory. n this chapter we embark on the study of queries for relational databases, a rich topic Ithat spans a good part of this book. This chapter focuses on a limited but extremely natural and commonly arising class of queries called conjunctive queries. Five equivalent versions of this query family are presented here: one from each of the calculus and datalog paradigms, two from the algebra paradigm, and a final one that has a more visual form. In the context of conjunctive queries, the three nonalgebraic versions can be viewed as minor syntactic variants of each other; but these similarities diminish as the languages are generalized to incorporate negation and/or recursion. This chapter also discusses query composition and its interaction with user views, and it extends conjunctive queries in a straightforward manner to incorporate union (or disjunction). The conjunctive queries enjoy several desirable properties, including, for example, decidability of equivalence and containment. These results will be presented in Chapter 6, in which a basic tool, the Homomorphism Theorem, is developed. Most of these results extend to conjunctive queries with union. In the formal framework that we have developed in this book, we distinguish between a query, which is a syntactic object, and a query mapping, which is the function defined by a query interpreted under a specified semantics. However, we often blur these two concepts when the meaning is clear from the context.
    [Show full text]
  • Constraint Satisfaction Complexity and Logic Phokion G. Kolaitis IBM Almaden Research Center & UC Santa Cruz
    Constraint Satisfaction Complexity and Logic Phokion G. Kolaitis IBM Almaden Research Center & UC Santa Cruz 1 Goals Goals: ² Show that Constraint Satisfaction Problems (CSP) form a broad class of algorithmic problems that arise naturally in several di®erent areas. ² Present an overview of CSP with emphasis on the computational complexity aspects of CSP and on the connections with database theory, univeral algebra, and logic 2 Course Outline Constraint Satisfaction Problems (CSP) ² De¯nition & Examples of CSP ² CSP & the Homomorphism Problem ² CSP & Database Theory ² Computational Complexity of CSP { Uniform & Non-Uniform CSP { Schaefer's Dichotomy Theorem for Boolean CSP { The Feder-Vardi Dichotomy Conjecture for general CSP 3 Course Outline ² The Pursuit of Tractable Cases of CSP { Universal Algebra and Closure Properties of Constraints { Datalog, Finite-variable Logics, and Pebble Games { Bounded Treewidth and Finite-variable Log- ics 4 Algorithmic Problems ² k-SAT:(k ¸ 2 is ¯xed) Given a k-CNF formula, is it satis¯able? ² k-Colorability:(k ¸ 2 is ¯xed) Given a graph H = (V; E), is it k-colorable? ² Clique: Given a graph H = (V; E) and a positive inte- ger k, does H contain a k-clique? ² Hamiltonian Cycle: Given a graph H = (V; E), does it contain a Hamiltonian cycle? 5 Algorithmic Problems Latin Squares: L. Euler { 1783 A Latin square of order n is an n £ n matrix of n symbols such that each symbol occurs exactly once in each row and each column of the matrix. A Latin Square of Order 4 2 3 1 4 3 4 2 1 4 1 3 2 1 2 4 3 Latin Square
    [Show full text]
  • Block-Sorted Quantified Conjunctive Queries
    Block-Sorted Quantified Conjunctive Queries Hubie Chen1? and D´anielMarx2?? 1 Universidad del Pa´ısVasco and IKERBASQUE, E-20018 San Sebasti´an,Spain 2 Computer and Automation Research Institute, Hungarian Academy of Sciences (MTA SZTAKI), Budapest, Hungary Abstract. We study the complexity of model checking in quantified conjunctive logic, that is, the fragment of first-order logic where both quantifiers may be used, but conjunction is the only permitted connec- tive. In particular, we study block-sorted queries, which we define to be prenex sentences in multi-sorted relational first-order logic where two variables having the same sort must appear in the same quantifier block. We establish a complexity classification theorem that describes precisely the sets of block-sorted queries of bounded arity on which model check- ing is fixed-parameter tractable. This theorem strictly generalizes, for the first time, the corresponding classification for existential conjunc- tive logic (which is known and due to Grohe) to a logic in which both quantifiers are present. 1 Introduction Model checking, the problem of deciding if a logical sentence holds on a struc- ture, is a fundamental computational task that appears in many guises through- out computer science. Witness its appearance in areas such as computational logic, verification, artificial intelligence, constraint satisfaction, and computa- tional complexity. The case where one wishes to evaluate a first-order sentence on a finite structure is a problem of principal interest in database theory and is the topic of this article. This problem is well-known to be quite intractable in general: it is PSPACE-complete.
    [Show full text]
  • Chapter 6: Translations in Monadic Predicate Logic 223
    TRANSLATIONS IN 6 MONADIC PREDICATE LOGIC 1. Introduction ....................................................................................................222 2. The Subject-Predicate Form of Atomic Statements......................................223 3. Predicates........................................................................................................224 4. Singular Terms ...............................................................................................226 5. Atomic Formulas ............................................................................................228 6. Variables And Pronouns.................................................................................230 7. Compound Formulas ......................................................................................232 8. Quantifiers ......................................................................................................232 9. Combining Quantifiers With Negation ..........................................................236 10. Symbolizing The Statement Forms Of Syllogistic Logic ..............................243 11. Summary of the Basic Quantifier Translation Patterns so far Examined ......248 12. Further Translations Involving Single Quantifiers ........................................251 13. Conjunctive Combinations of Predicates.......................................................255 14. Summary of Basic Translation Patterns from Sections 12 and 13.................262 15. ‘Only’..............................................................................................................263
    [Show full text]
  • Handout 5 – the Semantics of Predicate Logic LX 502 – Semantics I October 17, 2008
    Handout 5 – The Semantics of Predicate Logic LX 502 – Semantics I October 17, 2008 1. The Interpretation Function This handout is a continuation of the previous handout and deals exclusively with the semantics of Predicate Logic. When you feel comfortable with the syntax of Predicate Logic, I urge you to read these notes carefully. The business of semantics, as I have stated in class, is to determine the truth-conditions of a proposition and, in so doing, describe the models in which a proposition is true (and those in which it is false). Although we’ve extended our logical language, our goal remains the same. By adopting a more sophisticated logical language with a lexicon that includes elements below the sentence-level, we now need a more sophisticated semantics, one that derives the meaning of the proposition from the meaning of its constituent individuals, predicates, and variables. But the essentials are still the same. Propositions correspond to states of affairs in the outside world (Correspondence Theory of Truth). For example, the proposition in (1) is true if and only if it correctly describes a state of affairs in the outside world in which the object corresponding to the name Aristotle has the property of being a man. (1) MAN(a) Aristotle is a man The semantics of Predicate Logic does two things. It assigns a meaning to the individuals, predicates, and variables in the syntax. It also systematically determines the meaning of a proposition from the meaning of its constituent parts and the order in which those parts combine (Principle of Compositionality).
    [Show full text]