Part 2: First-Order Logic

Similar documents
First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

Syntax. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Lecture 2: First-Order Logic - Syntax, Semantics, Resolution

Automated Reasoning in First-Order Logic

First Order Logic (FOL) 1 znj/dm2017

Automated Reasoning Lecture 5: First-Order Logic

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

1 Introduction to Predicate Resolution

Outline. Formale Methoden der Informatik First-Order Logic for Forgetters. Why PL1? Why PL1? Cont d. Motivation

Propositional Logic Language

Propositional and Predicate Logic. jean/gbooks/logic.html

Logic and Modelling. Introduction to Predicate Logic. Jörg Endrullis. VU University Amsterdam

Predicate Logic: Sematics Part 1

Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/26)

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

CS156: The Calculus of Computation

03 Review of First-Order Logic

Exercises 1 - Solutions

Propositional Logic: Models and Proofs

Informal Statement Calculus

First-Order Predicate Logic. Basics

Logic as a Tool Chapter 4: Deductive Reasoning in First-Order Logic 4.4 Prenex normal form. Skolemization. Clausal form.

Proseminar on Semantic Theory Fall 2013 Ling 720 First Order (Predicate) Logic: Syntax and Natural Deduction 1

Predicate Calculus - Syntax

Logic Part I: Classical Logic and Its Semantics

Predicate Logic. Xinyu Feng 09/26/2011. University of Science and Technology of China (USTC)

Notes. Corneliu Popeea. May 3, 2013

First-Order Theorem Proving and Vampire

Propositional Logic Not Enough

AAA615: Formal Methods. Lecture 2 First-Order Logic

First-Order Logic. Chapter Overview Syntax

07 Equational Logic and Algebraic Reasoning

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing

Outline. Logic. Definition. Theorem (Gödel s Completeness Theorem) Summary of Previous Week. Undecidability. Unification

Notes on Propositional and First-Order Logic (CPSC 229 Class Notes, January )

Model Theory MARIA MANZANO. University of Salamanca, Spain. Translated by RUY J. G. B. DE QUEIROZ

Herbrand Theorem, Equality, and Compactness

Classical Propositional Logic

Overview. CS389L: Automated Logical Reasoning. Lecture 7: Validity Proofs and Properties of FOL. Motivation for semantic argument method

06 From Propositional to Predicate Logic

Chapter 2: Basic Notions of Predicate Logic

CHAPTER 10. Predicate Automated Proof Systems

Predicate Logic. x. x + 0 = x. Predicate logic over integer expressions: a language of logical assertions, for example. Why discuss predicate logic?

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

MATH 770 : Foundations of Mathematics. Fall Itay Ben-Yaacov

Lecture 1: Logical Foundations

Cooperation of Background Reasoners in Theory Reasoning by Residue Sharing

Comp487/587 - Boolean Formulas

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

First-Order Logic (FOL)


First Order Logic (FOL)

Normal Forms for First-Order Logic

Predicate Logic: Syntax

Constructions of Models in Fuzzy Logic with Evaluated Syntax

Introduction to Metalogic

Inference in Propositional Logic

Computational Logic Automated Deduction Fundamentals

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Equational Logic. Chapter Syntax Terms and Term Algebras

CS156: The Calculus of Computation Zohar Manna Winter 2010

On the Complexity of the Reflected Logic of Proofs

Automated Reasoning in First-Order Logic

Applied Logic for Computer Scientists. Answers to Some Exercises

PROPOSITIONAL LOGIC. VL Logik: WS 2018/19

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Logic: Propositional Logic (Part I)

Computational Logic. Recall of First-Order Logic. Damiano Zanardini

Mathematical Logic. An Introduction

Introduction to Sets and Logic (MATH 1190)

4 Predicate / First Order Logic

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2015/16

A Little Logic. Propositional Logic. Satisfiability Problems. Solving Sudokus. First Order Logic. Logic Programming

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Mathematical Preliminaries. Sipser pages 1-28

Propositional Logic: Part II - Syntax & Proofs 0-0

Resolution for mixed Post logic

Part II. Logic and Set Theory. Year

2.2 Lowenheim-Skolem-Tarski theorems

First-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms

LING 501, Fall 2004: Quantification

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

Learning Goals of CS245 Logic and Computation

Propositional Logic: Syntax

Introduction to Logic

Propositional and Predicate Logic - II

First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods

Superposition for Fixed Domains. Matthias Horbach and Christoph Weidenbach

Propositional logic. First order logic. Alexander Clark. Autumn 2014

Introduction to first-order logic:

SKETCHY NOTES FOR WEEKS 7 AND 8

Lecture 2: Syntax. January 24, 2018

Propositional logic (revision) & semantic entailment. p. 1/34

Predicate Logic - Introduction

Logic for Computer Scientists

TR : Binding Modalities

Propositional and Predicate Logic - V

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

The Syntax of First-Order Logic. Marc Hoyois

Transcription:

Part 2: First-Order Logic First-order logic formalizes fundamental mathematical concepts is expressive (Turing-complete) is not too expressive (e. g. not axiomatizable: natural numbers, uncountable sets) has a rich structure of decidable fragments has a rich model and proof theory First-order logic is also called (first-order) predicate logic. 1

2.1 Syntax Syntax: non-logical symbols (domain-specific) terms, atomic formulas logical symbols (domain-independent) Boolean combinations, quantifiers 2

Signature A signature Σ = (Ω,Π), fixes an alphabet of non-logical symbols, where Ω is a set of function symbols f with arity n 0, written f /n, Π is a set of predicate symbols p with arity m 0, written p/m. If n = 0 then f is also called a constant (symbol). If m = 0 then p is also called a propositional variable. We use letters P, Q, R, S, to denote propositional variables. 3

Signature Refined concept for practical applications: many-sorted signatures (corresponds to simple type systems in programming languages). Most results established for one-sorted signatures extend in a natural way to many-sorted signatures. 4

Variables Predicate logic admits the formulation of abstract, schematic assertions. (Object) variables are the technical tool for schematization. We assume that X is a given countably infinite set of symbols which we use for (the denotation of) variables. 5

Terms Terms over Σ (resp., Σ-terms) are formed according to these syntactic rules: s,t,u,v ::= x, x X (variable) f (s 1,...,s n ), f /n Ω (functional term) By T Σ (X) we denote the set of Σ-terms (over X). A term not containing any variable is called a ground term. By T Σ we denote the set of Σ-ground terms. 6

Terms In other words, terms are formal expressions with well-balanced brackets which we may also view as marked, ordered trees. The markings are function symbols or variables. The nodes correspond to the subterms of the term. A node v that is marked with a function symbol f of arity n has exactly n subtrees representing the n immediate subterms of v. 7

Atoms Atoms (also called atomic formulas) over Σ are formed according to this syntax: A,B [ ::= p(s 1,...,s m ), p/m Π (s t) (equation) ] Whenever we admit equations as atomic formulas we are in the realm of first-order logic with equality. Admitting equality does not really increase the expressiveness of first-order logic, (cf. exercises). But deductive systems where equality is treated specifically can be much more efficient. 8

Literals L ::= A (positive literal) A (negative literal) 9

Clauses C,D ::= (empty clause) L 1... L k, k 1 (non-empty clause) 10

General First-Order Formulas F Σ (X) is the set of first-order formulas over Σ defined as follows: F,G,H ::= (falsum) (verum) A (atomic formula) F (negation) (F G) (conjunction) (F G) (disjunction) (F G) (implication) (F G) (equivalence) xf (universal quantification) xf (existential quantification) 11

Notational Conventions We omit brackets according to the following rules: > p > p > p > p (binding precedences) and are associative and commutative is right-associative Qx 1,...,x n F abbreviates Qx 1...Qx n F. 12

Notational Conventions We use infix-, prefix-, postfix-, or mixfix-notation with the usual operator precedences. Examples: s + t u for +(s, (t,u)) s u t + v for ( (s,u),+(t,v)) s for (s) 0 for 0() 13

Example: Peano Arithmetic Signature: Σ PA = (Ω PA, Π PA ) Ω PA = {0/0, +/2, /2, s/1} Π PA = { /2, < /2} +,, <, infix; > p + > p < > p Examples of formulas over this signature are: x,y(x y z(x + z y)) x y(x + y y) x,y(x s(y) x y + x) x,y(s(x) s(y) x y) x y(x < y z(x < z z < y)) 14

Remarks About the Example We observe that the symbols, <, 0, s are redundant as they can be defined in first-order logic with equality just with the help of +. The first formula defines, while the second defines zero. The last formula, respectively, defines s. Eliminating the existential quantifiers by Skolemization (cf. below) reintroduces the redundant symbols. Consequently there is a trade-off between the complexity of the quantification structure and the complexity of the signature. 15

Example: Specifying LISP lists Signature: Σ Lists = (Ω Lists, Π Lists ) Ω Lists = {car/1,cdr/1,cons/2} Π Lists = Examples of formulae: x, y car(cons(x, y)) x x, y cdr(cons(x, y)) y x cons(car(x), cdr(x)) x 16

Many-sorted signatures Example: Signature S = {array, index, element} Ω = {read, write} set of sorts Π = a(read) = array index element a(write) = array index element array X = {X s s S} Examples of formulae: x : array i : index j : index (i j write(x, i, read(x, j)) x) x : array y : array (x y i : index (read(x, i) read(y, i))) 17

Bound and Free Variables In QxF, Q {, }, we call F the scope of the quantifier Qx. An occurrence of a variable x is called bound, if it is inside the scope of a quantifier Qx. Any other occurrence of a variable is called free. Formulas without free variables are also called closed formulas or sentential forms. Formulas without variables are called ground. 18

Bound and Free Variables Example: scope { }} { scope {}}{ y ( x p(x) q(x,y)) The occurrence of y is bound, as is the first occurrence of x. The second occurrence of x is a free occurrence. 19

Substitutions Substitution is a fundamental operation on terms and formulas that occurs in all inference systems for first-order logic. In general, substitutions are mappings σ : X T Σ (X) such that the domain of σ, that is, the set dom(σ) = {x X σ(x) x}, is finite. The set of variables introduced by σ, that is, the set of variables occurring in one of the terms σ(x), with x dom(σ), is denoted by codom(σ). 20

Substitutions Substitutions are often written as [s 1 /x 1,...,s n /x n ], with x i pairwise distinct, and then denote the mapping s i, if y = x i [s 1 /x 1,...,s n /x n ](y) = y, otherwise We also write xσ for σ(x). The modification of a substitution σ at x is defined as follows: t, if y = x σ[x t](y) = σ(y), otherwise 21

Why Substitution is Complicated We define the application of a substitution σ to a term t or formula F by structural induction over the syntactic structure of t or F by the equations depicted on the next page. In the presence of quantification it is surprisingly complex: We need to make sure that the (free) variables in the codomain of σ are not captured upon placing them into the scope of a quantifier Qy, hence the bound variable must be renamed into a fresh, that is, previously unused, variable z. 22

Application of a Substitution Homomorphic extension of σ to terms and formulas: f (s 1,...,s n )σ = f (s 1 σ,...,s n σ) σ = σ = p(s 1,...,s n )σ = p(s 1 σ,...,s n σ) (u v)σ = (uσ vσ) Fσ = (Fσ) (FρG)σ = (Fσ ρgσ) ; for each binary connective ρ (Qx F)σ = Qz (F σ[x z]) ; with z a fresh variable 23