Essential Gringo (Draft)

Size: px
Start display at page:

Download "Essential Gringo (Draft)"

Transcription

1 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 model of the input language of the grounder gringo [Gebser et al., 2015b] that includes as many gringo constructs as possible, including even those that are not essential not particularly useful to the programmer. The Essential Gringo language EG, described in this note, is a simplified, less ambitious version of AG. For example, gringo rules can use double negations : p :- q, not not r. This construct can be easily avoided; instead of the rule above we can write p ; not r :- q. In EG, double negations are not allowed. An smodels-style weight constraint 1 {p(x)} 1 in the body of a gringo rule can be also written as the dlv-style aggregate atom #count{x:p(x)} = 1. In EG, weight constraints in the bodies of rules are not allowed. The expression not #count{x:p(x)} = 1 in the body can be rewritten as #count{x:p(x)}!= 1. The syntax of EG does not allow us to negate aggregate atoms, so that the first version is not available. Classical ( strong ) negation, which is used in applications of ASP to knowledge representation [Gelfond and Kahl, 2014], is reflected in AG by distinguishing between symbolic constants and negated constants. Classical negation can be 1

2 easily eliminated from a program [Gelfond and Lifschitz, 1991, Section 4]; it is valuable as part of the methodology of knowledge representation but not so much as a syntactic construct. There are no negated constants in EG. EG is a subset of AG, except for a few details. We correct here a minor oversight in the design of AG that is related to arithmetic operations. (The list of operations in Section 2.1 of the AG paper does not include the absolute value, exponentiation, and some other operations implemented in the current version of gringo. In EG, an arbitrary collection of arithmetic operations is allowed.) The semantics of EG takes into account the fact that a logic program can accept an input the observation that led to the concept of an lp-function [Gelfond and Przymusinska, 1996]. In EG, an input can include input predicates and values of placeholders. 2 Syntax of EG We assume that five disjoint sets of symbols are selected: numerals, symbolic constants, variables, operation names of various arities, and aggregate names. We assume that these sets do not contain the interval symbol the relation symbols and the symbols.. = < > inf sup not, ; : ( ) { } All these symbols together form the alphabet of AG, and AG rules will be defined as strings over this alphabet. Terms are defined recursively, as follows: numerals, symbolic constants, variables, and the symbols inf and sup are terms; if f is a symbolic constant and t is a non-empty tuple of terms (separated by commas) then f(t) is a term; if op is an n-ary operation name and t is an n-tuple of terms then op(t) is a term; if t and s are terms then (t..s) is a term. 2

3 Atoms are expressions of the form p(t), where p is a symbolic constant and t is tuple of terms, possibly empty. An atom of the form p() can be written as p. A literal is an atom possibly preceded by not. A comparison is an expression of the form t s where t, s are terms and is a relation symbol. An aggregate expression is an expression of the form where where α is an aggregate name, t is a non-empty tuple of terms, α{t : C} s (1) C is a non-empty conjunction of literals and comparisons, is a relation symbol. s is a term. A choice expression is an expression of the form {A} where A is an atom. A rule is an expression of the form Head Body (2) Body is a conjunction of literals, comparisons, and aggregate expressions (possibly empty), and Head is either a disjunction of literals, possibly empty (then we say that (2) is a basic rule) or a choice expression (then (2) is a choice rule). If the body of a rule is empty and the head is not then the arrow can be dropped. A program is a set of rules. 3 Semantic Assumptions We assume that a 1 1 correspondence between the set of numerals and the set Z of integers is chosen. For every integer n, the corresponding numeral will be denoted by n. We will identify a numeral with the corresponding integer when this does not lead to confusion. We assume that for every operation name op, a function ôp from a subset of Z n to Z is chosen, where n is the arity of op. For instance, we can choose plus as 3

4 a binary operation name, define plus as the addition of integers, and use t + s as shorthand for plus(t, s). A term, or a tuple of terms, is precomputed if variables, operation names, and the interval symbol do not occur in it. We assume a total order on precomputed terms such that inf is its least element, sup is its greatest element, and, for any integers m and n, m n iff m n. We assume that for each aggregate name α a function α is chosen that maps every set of non-empty tuples of precomputed terms to a precomputed term. Two aggregate names are particularly useful. One is count; ĉount(t ) is defined as the cardinality of T if T is finite, and sup otherwise. The other is sum; ŝum(t ) is the sum of the weights of all tuples in T if T contains finitely many tuples with non-zero weights, and 0 otherwise. (The weight of a tuple t of precomputed terms is defined as the first member of t if it is a numeral, and 0 otherwise.) 4 Abbreviations An expression of the form p(t 1 ;... ; t m ) Body where m > 1, each t i is a non-empty tuple of terms, and Body is as in the definition of a rule, stands for the group of m rules p(t i ) Body (i = 1,..., m). An expression of the form s 1 {A : C} s 2 Body (3) where s 1 and s 2 are terms, A is an atom that does not contain the interval symbol, C is a non-empty conjunction of literals and comparisons, Body is as in the definition of a rule stands for the group of three rules: {A} Body C, (4) Body count{a : A C} < s 1, (5) Body count{a : A C} > s 2. (6) In (3), s 1 and s 2 are optional. If s 1 is missing then drop rule (5); if s 2 is missing then drop rule (6). 4

5 5 Semantics The semantics of EG is defined using a syntactic transformation τ, which turns programs into sets of infinitary formulas formed from atoms of the form p(t), where p is a symbolic constant, and t is a tuple of precomputed terms. Then the stable models of a program Π are defined as the stable models of τπ in the sense of [Truszczynski, 2012]. 5.1 Ground Literals and Comparisons A term, literal, or comparison is ground if it does not contain variables. In this section we define how to apply τ to ground literals and comparisons. Semantically, every ground term t represents a finite set of precomputed terms [t], which is defined recursively: if t is a numeral, a symbolic constant, or one of the symbols inf, sup then [t] is the singleton {t}; if t is f(t 1,..., t n ) where f is a symbolic constant then [t] consists of the terms f(r 1,..., r n ) for all r 1 [t 1 ],..., r n [t n ]; if t is op(t 1,..., t n ) where op is an operation name then [t] consists of the numerals ôp(k 1,..., k n ) for all tuples k 1,..., k n in the domain of ôp such that k 1 [t 1 ],..., k n [t n ]; if t is (t 1.. t 2 ) then [t] consists of the numerals m for all integers m such that, for some integers k 1, k 2, For any ground atom p(t 1,..., t n ), k 1 [t 1 ], k 2 [t 2 ], k 1 m k 2. by [p(t 1,..., t n )] we denote the set consisting of the atoms p(r 1,..., r n ) for all r 1 [t 1 ],..., r n [t n ]; τp(t 1,..., t n ) stands for the disjunction of these atoms; by [not p(t 1,..., t n )] we denote the set consisting of the formulas p(r 1,..., r n ) for all r 1 [t 1 ],..., r n [t n ]; τ(not p(t 1,..., t n )) stands for the disjunction of these formulas. For any ground comparison t 1 t 2, τ(t 1 t 2 ) is the formula if the relation holds between some terms r 1, r 2 such that r 1 [t 1 ] and r 2 [t 2 ], and the formula otherwise. If each of the expressions C 1,..., C k (k > 1) is a ground literal or a ground comparison then τ(c 1 C k ) stands for τc 1 τc k. 5

6 5.2 Closed Aggregate Expressions An aggregate expression (1) is closed if the term s is ground. In this section we define how to apply τ to closed aggregate expressions. Let x be the list of variables occurring in the left-hand side α{t : C} of a closed aggregate expression (1), and let A be the set of tuples r of precomputed terms of the same length as x. A subset of A justifies the aggregate expression (1) if the relation holds between α({[t x r ] : r }) and an element of the set [s]. We define the result of applying τ to (1) as the conjunction of the implications τ(c x r ) τ(c x r ) r r A\ over all subsets of A that do not justify E. The definition of τ for conjunctions of ground literals and ground comparisons at the end of Section 5.1 extends in the obvious way to the case when some conjunctive members are closed aggrerate expressions. 5.3 Rules and Programs A variable V occurring in a rule R is local if every occurrence of V in R belongs to the left-hand side α{t : C} of one of the aggregate expressions (1) in its body, and global otherwise. A rule is closed if all its variables are local. It is clear that if a rule is closed then all aggregate expressions in its body are closed. If R is a closed basic rule then τr is the formula L 1 L k Body τ(body) [L 1 ] [L k ]. (Recall that S is the conjunction of all elements of a set S of formulas [Truszczynski, 2012].) If R is a closed choice rule then τr is the formula τ(body) {p(t 1,..., t n )} Body r 1 [t 1 ],...,r n [t n] (p(r 1,..., r n ) p(r 1,..., r n )). An instance of a rule R is a closed rule obtained from R by substituting precomputed terms for its global variables. For any program Π, τπ is the set consisting of all instances R of rules of Π. 6

7 6 Inputs The predicate symbol of an atom p(t 1,..., t n ) is the pair p/n. An input is a function i defined on a finite set consisting of predicate symbols and symbolic constants such that if p/n is a predicate symbol in the domain of i then i(p/n) is a finite set of n-tuples of precomputed terms; if c is a symbolic constant in the domain of i then i(c) is a precomputed term. Occurrences of symbolic constants in a rule can be classified into three groups. We say that an occurrence of a symbolic constant is in the predicate position if it is at the beginning of an atom, and in the function position if it is at the beginning of a term of the form f(t). All other occurrences are in the argument position. 1 For any program Π and input i, by i(π) we denote the program obtained from Π by adding the facts p(t) for all predicate symbols p/n in the domain of i and all tuples t in i(p/n), and simultaneously substituting the terms i(c) for all occurrences of symbolic constants c in the domain of i that are in the argument position. Stable models of i(π) will be also called stable models of Π for input i, or i-stable models of Π. To use gringo for generating i-stable models of a program, we append to it the facts representing the values that i assigns to predicate symbols, and specify the terms that i assigns to symbolic constants by #const directives. In rare cases this may fail to produce the correct result because gringo executes #const directives sequentially, not simultaneously. 1 This distinction is essential for understanding how the #const directive of gringo [Gebser et al., 2015b, Section ] operates: it replaces an occurence of a placeholder only if it is in the argument position. For instance, the directives #const a=1. #const b=2. #const c=3. turn rule a(b(c)) b(c(a)) into a(b(3)) b(c(1)). 7

8 References [Gebser et al., 2015a] Martin Gebser, Amelia Harrison, Roland Kaminski, Vladimir Lifschitz, and Torsten Schaub. Abstract Gringo. Theory and Practice of Logic Programming, 15: , [Gebser et al., 2015b] Martin Gebser, Roland Kaminski, Benjamin Kaufmann, Marius Lindauer, Max Ostrowski, Javier Romero, Torsten Schaub, and Sven Thiele. Potassco User Guide, version 2.0. Available at [Gelfond and Kahl, 2014] Michael Gelfond and Yulia Kahl. Knowledge Representation, Reasoning, and the Design of Intelligent Agents: The Answer-Set Programming Approach. Cambridge University Press, [Gelfond and Lifschitz, 1991] Michael Gelfond and Vladimir Lifschitz. Classical negation in logic programs and disjunctive databases. New Generation Computing, 9: , [Gelfond and Przymusinska, 1996] Michael Gelfond and Halina Przymusinska. Towards a theory of elaboration tolerance: Logic programming approach. International Journal of Software Engineering and Knowledge Engineering, 6(1):89 112, [Truszczynski, 2012] Miroslaw Truszczynski. Connecting first-order ASP and the logic FO(ID) through reducts. In Esra Erdem, Joohyung Lee, Yuliya Lierler, and David Pearce, editors, Correct Reasoning: Essays on Logic-Based AI in Honor of Vladimir Lifschitz, pages Springer,

Answer Sets and the Language of Answer Set Programming. Vladimir Lifschitz

Answer Sets and the Language of Answer Set Programming. Vladimir Lifschitz Answer Sets and the Language of Answer Set Programming Vladimir Lifschitz Answer set programming is a declarative programming paradigm based on the answer set semantics of logic programs. This introductory

More information

A Model-Theoretic Counterpart of Loop Formulas

A Model-Theoretic Counterpart of Loop Formulas A Model-Theoretic Counterpart of Loop Formulas Joohyung Lee Department of Computer Sciences The University of Texas at Austin Austin, TX 78712, USA appsmurf@cs.utexas.edu Abstract In an important recent

More information

GrinGo: A New Grounder for Answer Set Programming

GrinGo: A New Grounder for Answer Set Programming GrinGo: A New Grounder for Answer Set Programming Martin Gebser, Torsten Schaub, and Sven Thiele Universität Potsdam, Institut für Informatik, August-Bebel-Str. 89, D-14482 Potsdam, Germany Abstract. We

More information

Handout on Answer Set Programming

Handout on Answer Set Programming Handout on Answer Set Programming Yuliya Lierler Univresity of Nebraska, Omaha Tell me and I forget. Show me and I remember. Involve me and I understand. (Chinese proverb) The Moore method is a deductive

More information

Stepping with SeaLion

Stepping with SeaLion Stepping with SeaLion April 26, 2013 Contents 1 Introduction 1 1.1 Stepping Terminology in a Nut Shell.......................... 2 1.2 Set-up........................................... 2 1.3 The Toy Problem.....................................

More information

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

Chapter 3: Propositional Languages

Chapter 3: Propositional Languages Chapter 3: Propositional Languages We define here a general notion of a propositional language. We show how to obtain, as specific cases, various languages for propositional classical logic and some non-classical

More information

Analysis of Grounders and Solvers for ASP Encodings of Argumentation Frameworks Bachelor Thesis

Analysis of Grounders and Solvers for ASP Encodings of Argumentation Frameworks Bachelor Thesis Analysis of Grounders and Solvers for ASP Encodings of Argumentation Frameworks Bachelor Thesis Michael Petritsch September 2010 We present an experimental evaluation of popular answer-set programming

More information

Computing Answer Sets of a Logic Program via-enumeration of SAT certificates

Computing Answer Sets of a Logic Program via-enumeration of SAT certificates Computing Answer Sets of a Logic Program via-enumeration of SAT certificates Yuliya Lierler and Marco Maratea Department of Computer Sciences, University of Texas, Austin, USA Dipartimento di Informatica,

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

Qualitative Decision Making and Answer Set Programming Extended Abstract

Qualitative Decision Making and Answer Set Programming Extended Abstract Qualitative Decision Making and Answer Set Programming Extended Abstract Gerhard Brewka Universität Leipzig, Institut für Informatik Augustusplatz 10-11, 04109 Leipzig, Germany brewka@informatik.uni-leipzig.de

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

Automata Theory for Reasoning about Actions

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

More information

Conflict-driven ASP Solving with External Source Access

Conflict-driven ASP Solving with External Source Access Conflict-driven ASP Solving with External Source Access Thomas Eiter, Michael Fink, Thomas Krennwallner, Christoph Redl redl@krtuwienacat September 05, 2012 Redl C (TU Vienna) HEX-Programs September 05,

More information

Propositional Theories are Strongly Equivalent to Logic Programs

Propositional Theories are Strongly Equivalent to Logic Programs Under consideration for publication in Theory and Practice of Logic Programming 1 Propositional Theories are Strongly Equivalent to Logic Programs Pedro Cabalar Department of Computer Science, University

More information

nfn2dlp: A Normal Form Nested Programs Compiler

nfn2dlp: A Normal Form Nested Programs Compiler nfn2dlp: A Normal Form Nested Programs Compiler Annamaria Bria, Wolfgang Faber, and Nicola Leone Department of Mathematics, University of Calabria, 87036 Rende (CS), Italy {a.bria,faber,leone}@mat.unical.it

More information

Aggregates in Recursion: Issues and Solutions

Aggregates in Recursion: Issues and Solutions Aggregates in Recursion: Issues and Solutions Alpen-Adria-Universität Klagenfurt RuleML Webinar, 2018-05-25 Outline 1 2 3 4 Coincidence Results Complexity Results : Aggregates Aggregates facilitate problem

More information

Prolog and ASP Inference Under One Roof

Prolog and ASP Inference Under One Roof Prolog and ASP Inference Under One Roof Marcello Balduccini 1, Yuliya Lierler 2, and Peter Schüller 3 1 Eastman Kodak Company, USA marcello.balduccini@gmail.com 2 University of Nebraska at Omaha, USA ylierler@unomaha.edu

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

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

Conjunctive queries. Many computational problems are much easier for conjunctive queries than for general first-order queries. 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

More information

Answer Set Programming as SAT modulo Acyclicity

Answer Set Programming as SAT modulo Acyclicity Answer Set Programming as SAT modulo Acyclicity Martin Gebser, Tomi Janhunen, and Jussi Rintanen Helsinki Institute for Information Technology HIIT Department of Information and Computer Science Aalto

More information

Discrete Mathematics Lecture 4. Harper Langston New York University

Discrete Mathematics Lecture 4. Harper Langston New York University Discrete Mathematics Lecture 4 Harper Langston New York University Sequences Sequence is a set of (usually infinite number of) ordered elements: a 1, a 2,, a n, Each individual element a k is called a

More information

Term Algebras with Length Function and Bounded Quantifier Elimination

Term Algebras with Length Function and Bounded Quantifier Elimination with Length Function and Bounded Ting Zhang, Henny B Sipma, Zohar Manna Stanford University tingz,sipma,zm@csstanfordedu STeP Group, September 3, 2004 TPHOLs 2004 - p 1/37 Motivation: Program Verification

More information

This book is licensed under a Creative Commons Attribution 3.0 License

This book is licensed under a Creative Commons Attribution 3.0 License 6. Syntax Learning objectives: syntax and semantics syntax diagrams and EBNF describe context-free grammars terminal and nonterminal symbols productions definition of EBNF by itself parse tree grammars

More information

Modular Construction of Ground Logic Programs using LPCAT

Modular Construction of Ground Logic Programs using LPCAT Modular Construction of Ground Logic Programs using LPCAT Tomi Janhunen Aalto University School of Science and Technology Department of Information and Computer Science PO Box 15400, FI-00076 Aalto, Finland

More information

Higher-Order Logic. Specification and Verification with Higher-Order Logic

Higher-Order Logic. Specification and Verification with Higher-Order Logic Higher-Order Logic Specification and Verification with Higher-Order Logic Arnd Poetzsch-Heffter (Slides by Jens Brandt) Software Technology Group Fachbereich Informatik Technische Universität Kaiserslautern

More information

(Re)configuration using Answer Set Programming

(Re)configuration using Answer Set Programming (Re)configuration using Answer Set Programming Gerhard Friedrich and Anna Ryabokon Universitaet Klagenfurt, Austria firstname.lastname@aau.at Andreas A. Falkner, Alois Haselböck, Gottfried Schenner and

More information

Translation of Aggregate Programs to Normal Logic Programs

Translation of Aggregate Programs to Normal Logic Programs Translation of Aggregate rograms to Normal Logic rograms Nikolay elov arc Denecker and aurice Bruynooghe Dept. of Computer Science.U.Leuven Celestijnenlaan 00A B-3001 Heverlee Belgium E-mail: pelovmarcdmaurice

More information

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N Mathematical Preliminaries Read pages 529-540 1. Set Theory 1.1 What is a set? A set is a collection of entities of any kind. It can be finite or infinite. A = {a, b, c} N = {1, 2, 3, } An entity is an

More information

Chapter 2 & 3: Representations & Reasoning Systems (2.2)

Chapter 2 & 3: Representations & Reasoning Systems (2.2) Chapter 2 & 3: A Representation & Reasoning System & Using Definite Knowledge Representations & Reasoning Systems (RRS) (2.2) Simplifying Assumptions of the Initial RRS (2.3) Datalog (2.4) Semantics (2.5)

More information

Review Material: First Order Logic (FOL)

Review Material: First Order Logic (FOL) Information Integration on the WEB with RDF, OWL and SPARQL Review Material: First Order Logic (FOL) Grant Weddell October 7, 2013 Syntax of FOL Signatures Vocabularies are called signatures in FOL. The

More information

Introduction to lambda calculus Part 3

Introduction to lambda calculus Part 3 Introduction to lambda calculus Part 3 Antti-Juhani Kaijanaho 2017-01-27... 1 Untyped lambda calculus... 2 Typed lambda calculi In an untyped lambda calculus extended with integers, it is required that

More information

Constraint Solving. Systems and Internet Infrastructure Security

Constraint Solving. Systems and Internet Infrastructure Security Systems and Internet Infrastructure Security Network and Security Research Center Department of Computer Science and Engineering Pennsylvania State University, University Park PA Constraint Solving Systems

More information

Debugging non-ground ASP programs with Choice Rules, Cardinality and Weight Constraints

Debugging non-ground ASP programs with Choice Rules, Cardinality and Weight Constraints Debugging non-ground ASP programs with Choice Rules, Cardinality and Weight Constraints Axel Polleres 1, Melanie Frühstück 1, Gottfried Schenner 1, and Gerhard Friedrich 2 1 Siemens AG Österreich, Siemensstraße

More information

Cplus2ASP: Computing Action Language C+ in Answer Set Programming

Cplus2ASP: Computing Action Language C+ in Answer Set Programming Cplus2ASP: Computing Action Language C+ in Answer Set Programming Joseph Babb and Joohyung Lee School of Computing, Informatics, and Decision Systems Engineering Arizona State University, Tempe, USA {Joseph.Babb,joolee}@asu.edu

More information

Part I Logic programming paradigm

Part I Logic programming paradigm Part I Logic programming paradigm 1 Logic programming and pure Prolog 1.1 Introduction 3 1.2 Syntax 4 1.3 The meaning of a program 7 1.4 Computing with equations 9 1.5 Prolog: the first steps 15 1.6 Two

More information

Writing Declarative Specifications for Clauses

Writing Declarative Specifications for Clauses Writing Declarative Specifications for Clauses Martin Gebser 1,2, Tomi Janhunen 1, Roland Kaminski 2, Torsten Schaub 2,3, Shahab Tasharrofi 1 1) Aalto University, Finland 2) University of Potsdam, Germany

More information

Choice Logic Programs and Nash Equilibria in Strategic Games

Choice Logic Programs and Nash Equilibria in Strategic Games Choice Logic Programs and Nash Equilibria in Strategic Games Marina De Vos and Dirk Vermeir Dept. of Computer Science Free University of Brussels, VUB Pleinlaan 2, Brussels 1050, Belgium Tel: +32 2 6293308

More information

SOFTWARE ENGINEERING DESIGN I

SOFTWARE ENGINEERING DESIGN I 2 SOFTWARE ENGINEERING DESIGN I 3. Schemas and Theories The aim of this course is to learn how to write formal specifications of computer systems, using classical logic. The key descriptional technique

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

CSC 501 Semantics of Programming Languages

CSC 501 Semantics of Programming Languages CSC 501 Semantics of Programming Languages Subtitle: An Introduction to Formal Methods. Instructor: Dr. Lutz Hamel Email: hamel@cs.uri.edu Office: Tyler, Rm 251 Books There are no required books in this

More information

CA4003 Compiler Construction Assignment Language Definition

CA4003 Compiler Construction Assignment Language Definition CA4003 Compiler Construction Assignment Language Definition David Sinclair 2017-2018 1 Overview The language is not case sensitive. A nonterminal, X, is represented by enclosing it in angle brackets, e.g.

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

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University March 22, 2012 Version: 58 Copyright c 2012 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Typed Lambda Calculus

Typed Lambda Calculus Department of Linguistics Ohio State University Sept. 8, 2016 The Two Sides of A typed lambda calculus (TLC) can be viewed in two complementary ways: model-theoretically, as a system of notation for functions

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

Using gringo, clingo and iclingo

Using gringo, clingo and iclingo Using gringo, clingo and iclingo Rev.522 Martin Gebser, Roland Kaminski, Benjamin Kaufmann, Max Ostrowski, Torsten Schaub, Sven Thiele September 25, 2008 Abstract This paper introduces the new tools gringo,

More information

Building a Knowledge Base System for an integration of Logic Programming and Classical Logic

Building a Knowledge Base System for an integration of Logic Programming and Classical Logic Building a Knowledge Base System for an integration of Logic Programming and Classical Logic Marc Denecker and Joost Vennekens Department Computer Science, Katholieke Universiteit Leuven Celestijnenlaan

More information

Declarative Semantics for Revision Programming and Connections to Active Integrity Constraints

Declarative Semantics for Revision Programming and Connections to Active Integrity Constraints Declarative Semantics for Revision Programming and Connections to Active Integrity Constraints Luciano Caroprese 1 and Mirosław Truszczyński 2 1 Università della Calabria, 87030 Rende, Italy, caroprese@deis.unical.it

More information

Systems integrating answer set programming and constraint programming

Systems integrating answer set programming and constraint programming Systems integrating answer set programming and constraint programming Michael Gelfond and Veena S. Mellarkod and Yuanlin Zhang {mgelfond,veena.s.mellarkod,yzhang}@cs.ttu.edu Texas Tech University, USA

More information

Enhancing ASP by Functions: Decidable Classes and Implementation Techniques

Enhancing ASP by Functions: Decidable Classes and Implementation Techniques Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence (AAAI-10) Enhancing ASP by Functions: Decidable Classes and Implementation Techniques Francesco Calimeri and Susanna Cozza and

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

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

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Spring 2005 Clancy/Wagner Notes 7 This lecture returns to the topic of propositional logic. Whereas in Lecture Notes 1 we studied this topic as a way of understanding

More information

2.1 Sets 2.2 Set Operations

2.1 Sets 2.2 Set Operations CSC2510 Theoretical Foundations of Computer Science 2.1 Sets 2.2 Set Operations Introduction to Set Theory A set is a structure, representing an unordered collection (group, plurality) of zero or more

More information

Nonmonotonic Databases and Epistemic Queries*

Nonmonotonic Databases and Epistemic Queries* Nonmonotonic Databases and Epistemic Queries* Vladimir Lifschitz Department of Computer Sciences and Department of Philosophy University of Texas at Austin Austin, TX 78712, U. S. A. Abstract The approach

More information

Data Analytics and Boolean Algebras

Data Analytics and Boolean Algebras Data Analytics and Boolean Algebras Hans van Thiel November 28, 2012 c Muitovar 2012 KvK Amsterdam 34350608 Passeerdersstraat 76 1016 XZ Amsterdam The Netherlands T: + 31 20 6247137 E: hthiel@muitovar.com

More information

Topic Maps Reference Model, version 6.0

Topic Maps Reference Model, version 6.0 Topic Maps Reference Model, 13250-5 version 6.0 Patrick Durusau Steven R. Newcomb July 13, 2005 This is a working draft of the Topic Maps Reference Model. It focuses on the integration of Robert Barta

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

Lecture 5. Logic I. Statement Logic

Lecture 5. Logic I. Statement Logic Ling 726: Mathematical Linguistics, Logic. Statement Logic V. Borschev and B. Partee, September 27, 2 p. Lecture 5. Logic I. Statement Logic. Statement Logic...... Goals..... Syntax of Statement Logic....2.

More information

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31 Sets MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Sets Fall 2014 1 / 31 Outline 1 Sets Introduction Cartesian Products Subsets Power Sets Union, Intersection, Difference

More information

Recursive Aggregates in Disjunctive Logic Programs: Semantics and Complexity

Recursive Aggregates in Disjunctive Logic Programs: Semantics and Complexity Recursive Aggregates in Disjunctive Logic Programs: Semantics and Complexity Revised version as of September 5, 2005 Wolfgang Faber 1, Nicola Leone 2, and Gerald Pfeifer 1 1 Institut für Informationssysteme,

More information

Database Theory VU , SS Introduction to Datalog. Reinhard Pichler. Institute of Logic and Computation DBAI Group TU Wien

Database Theory VU , SS Introduction to Datalog. Reinhard Pichler. Institute of Logic and Computation DBAI Group TU Wien Database Theory Database Theory VU 181.140, SS 2018 2. Introduction to Datalog Reinhard Pichler Institute of Logic and Computation DBAI Group TU Wien 13 March, 2018 Pichler 13 March, 2018 Page 1 Database

More information

Defining an Abstract Core Production Rule System

Defining an Abstract Core Production Rule System WORKING PAPER!! DRAFT, e.g., lacks most references!! Version of December 19, 2005 Defining an Abstract Core Production Rule System Benjamin Grosof Massachusetts Institute of Technology, Sloan School of

More information

Module 3. Requirements Analysis and Specification. Version 2 CSE IIT, Kharagpur

Module 3. Requirements Analysis and Specification. Version 2 CSE IIT, Kharagpur Module 3 Requirements Analysis and Specification Lesson 6 Formal Requirements Specification Specific Instructional Objectives At the end of this lesson the student will be able to: Explain what a formal

More information

Data types for mcrl2

Data types for mcrl2 Data types for mcrl2 Aad Mathijssen April 5, 2018 We provide a syntax for the standard data types of the mcrl2 language. This syntax is intended to be a practical mix between standard mathematical notation

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

The Relational Model

The Relational Model The Relational Model David Toman School of Computer Science University of Waterloo Introduction to Databases CS348 David Toman (University of Waterloo) The Relational Model 1 / 28 The Relational Model

More information

Set and Set Operations

Set and Set Operations Set and Set Operations Introduction A set is a collection of objects. The objects in a set are called elements of the set. A well defined set is a set in which we know for sure if an element belongs to

More information

An Abductive Framework for General Logic Programs and other Nonmonotonic Systems

An Abductive Framework for General Logic Programs and other Nonmonotonic Systems An Abductive Framework for General Logic Programs and other Nonmonotonic Systems Gerhard Brewka Kurt Konolige GMD, Postfach 12 40 SRI International 5205 Sankt Augustin, Germany 333 Ravenswood Ave Menlo

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

Linear Time Unit Propagation, Horn-SAT and 2-SAT

Linear Time Unit Propagation, Horn-SAT and 2-SAT Notes on Satisfiability-Based Problem Solving Linear Time Unit Propagation, Horn-SAT and 2-SAT David Mitchell mitchell@cs.sfu.ca September 25, 2013 This is a preliminary draft of these notes. Please do

More information

Logic Programming and Reasoning about Actions

Logic Programming and Reasoning about Actions Chapter 4 Logic Programming and Reasoning about Actions [Chitta Baral & Michael Gelfond] In this chapter we discuss how recent advances in logic programming can be used to represent and reason about actions

More information

Safe Stratified Datalog With Integer Order Does not Have Syntax

Safe Stratified Datalog With Integer Order Does not Have Syntax Safe Stratified Datalog With Integer Order Does not Have Syntax Alexei P. Stolboushkin Department of Mathematics UCLA Los Angeles, CA 90024-1555 aps@math.ucla.edu Michael A. Taitslin Department of Computer

More information

System ASPMT2SMT: Computing ASPMT Theories by SMT Solvers

System ASPMT2SMT: Computing ASPMT Theories by SMT Solvers System ASPMT2SMT: Computing ASPMT Theories by SMT Solvers Michael Bartholomew and Joohyung Lee School of Computing, Informatics, and Decision Systems Engineering Arizona State University, Tempe, USA {mjbartho,joolee}@asu.edu

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 7 This lecture returns to the topic of propositional logic. Whereas in Lecture 1 we studied this topic as a way of understanding proper reasoning

More information

External Propagators in WASP: Preliminary Report

External Propagators in WASP: Preliminary Report External Propagators in WASP: Preliminary Report Carmine Dodaro 1, Francesco Ricca 1, and Peter Schüller 2 1 Department of Mathematics and Computer Science University of Calabria, Italy {dodaro,ricca}@mat.unical.it

More information

Towards a Logical Reconstruction of Relational Database Theory

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

More information

Efficiently Implementing GOLOG with Answer Set Programming

Efficiently Implementing GOLOG with Answer Set Programming Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence Efficiently Implementing GOLOG with Answer Set Programming Malcolm Ryan School of Computer Science and Engineering University

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

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

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

More information

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

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

More information

Appendix 1. Description Logic Terminology

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

More information

cf2 Semantics Revisited 1

cf2 Semantics Revisited 1 cf2 Semantics Revisited 1 Sarah Alice GAGGL and Stefan WOLTRAN Institute of Information Systems 184, Vienna University of Technology, A-1040 Vienna, Austria Abstract. Abstract argumentation frameworks

More information

RIF RuleML Rosetta Ring: Round-Tripping the Dlex Subset of Datalog RuleML and RIF-Core

RIF RuleML Rosetta Ring: Round-Tripping the Dlex Subset of Datalog RuleML and RIF-Core RIF RuleML Rosetta Ring: Round-Tripping the Dlex Subset of Datalog RuleML and RIF-Core The International RuleML Symposium on Rule Interchange and Applications Las Vegas, Nevada, USA, Nov 5-7, 2009 Harold

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

Appendix 1. Description Logic Terminology

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

More information

Recursion and Structural Induction

Recursion and Structural Induction Recursion and Structural Induction Mukulika Ghosh Fall 2018 Based on slides by Dr. Hyunyoung Lee Recursively Defined Functions Recursively Defined Functions Suppose we have a function with the set of non-negative

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

arxiv: v2 [cs.ai] 20 Mar 2018

arxiv: v2 [cs.ai] 20 Mar 2018 Under consideration for publication in Theory and Practice of Logic Programming 1 Multi-shot ASP solving with Clingo arxiv:1705.09811v2 [cs.ai] 20 Mar 2018 Martin Gebser University of Potsdam, Germany

More information

Programs with infinite loops: from primitive recursive predicates to the arithmetic hierarchy

Programs with infinite loops: from primitive recursive predicates to the arithmetic hierarchy Programs with infinite loops: from primitive recursive predicates to the arithmetic hierarchy ((quite) preliminary) Armando B. Matos September 11, 2014 Abstract Infinite time Turing machines have been

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F 1 Logical Operations 1.1 And The and operator is a binary operator, denoted as, &,, or sometimes by just concatenating symbols, is true only if both parameters are true. A B A B F T F F F F The expression

More information

Exploiting Partial Assignments for Efficient Evaluation of Answer Set Programs with External Source Access

Exploiting Partial Assignments for Efficient Evaluation of Answer Set Programs with External Source Access Journal of Artificial Intelligence Research 62 (2018) 665-727 Submitted 1/18; published 7/18 Exploiting Partial Assignments for Efficient Evaluation of Answer Set Programs with External Source Access Thomas

More information

15-819M: Data, Code, Decisions

15-819M: Data, Code, Decisions 15-819M: Data, Code, Decisions 08: First-Order Logic André Platzer aplatzer@cs.cmu.edu Carnegie Mellon University, Pittsburgh, PA André Platzer (CMU) 15-819M/08: Data, Code, Decisions 1 / 40 Outline 1

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

Debugging Answer-Set Programs with Ouroboros Extending the SeaLion Plugin

Debugging Answer-Set Programs with Ouroboros Extending the SeaLion Plugin Debugging Answer-Set Programs with Ouroboros Extending the SeaLion Plugin Melanie Frühstück 1, Jörg Pührer 2, and Gerhard Friedrich 1 1 Siemens AG Österreich, Corporate Technology, Vienna, Austria melanie.fruehstueck@siemens.com

More information

2 Review of Set Theory

2 Review of Set Theory 2 Review of Set Theory Example 2.1. Let Ω = {1, 2, 3, 4, 5, 6} 2.2. Venn diagram is very useful in set theory. It is often used to portray relationships between sets. Many identities can be read out simply

More information

Exploiting Unfounded Sets for HEX-Program Evaluation

Exploiting Unfounded Sets for HEX-Program Evaluation Exploiting Unfounded Sets for HEX-Program Evaluation Thomas Eiter, Michael Fink, Thomas Krennwallner, Christoph Redl, Peter Schller redl@kr.tuwien.ac.at September 27, 2012 Redl C. (TU Vienna) HEX-Programs

More information

An Implementation of Consistency-Based Multi-Agent Belief Change using ASP

An Implementation of Consistency-Based Multi-Agent Belief Change using ASP An Implementation of Consistency-Based Multi-Agent Belief Change using ASP Paul Vicol 1, James Delgrande 1, and Torsten Schaub 2 1 Simon Fraser University Burnaby B.C, Canada V5A 1S6 pvicol@sfu.ca, jim@cs.sfu.ca

More information