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

Similar documents
Classical First-Order Logic

Classical First-Order Logic

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

First Order Logic (FOL) 1 znj/dm2017

Propositional Logic Language

AAA615: Formal Methods. Lecture 2 First-Order Logic

Herbrand Theorem, Equality, and Compactness

Predicate Logic: Sematics Part 1

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

First-Order Logic (FOL)

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

Logic Part I: Classical Logic and Its Semantics

03 Review of First-Order Logic

Exercises 1 - Solutions

Mathematical Logic. Reasoning in First Order Logic. Chiara Ghidini. FBK-IRST, Trento, Italy

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

if t 1,...,t k Terms and P k is a k-ary predicate, then P k (t 1,...,t k ) Formulas (atomic formulas)

Roadmap. Introduction

1 First-order logic. 1 Syntax of first-order logic. 2 Semantics of first-order logic. 3 First-order logic queries. 2 First-order query evaluation

THE LANGUAGE OF FIRST-ORDER LOGIC (FOL) Sec2 Sec1(1-16)

CS156: The Calculus of Computation Zohar Manna Winter 2010

First-Order Predicate Logic. Basics

06 From Propositional to Predicate Logic

4 Predicate / First Order Logic

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

Predicate Logic - Introduction

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

Lecture 1: Logical Foundations

Part 2: First-Order Logic

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

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

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

A Cut-Free Calculus for Second-Order Gödel Logic

185.A09 Advanced Mathematical Logic

First-order logic Syntax and semantics

Introduction to first-order logic:

First-Order Theorem Proving and Vampire

Applied Logic. Lecture 1 - Propositional logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Learning Goals of CS245 Logic and Computation


First Order Logic (FOL)

PROOFS IN PREDICATE LOGIC AND COMPLETENESS; WHAT DECIDABILITY MEANS HUTH AND RYAN 2.3, SUPPLEMENTARY NOTES 2

The Language. Elementary Logic. Outline. Well-Formed Formulae (wff s)

From Constructibility and Absoluteness to Computability and Domain Independence

Informal Statement Calculus

Introduction to Logic in Computer Science: Autumn 2006

Predicate Calculus - Semantics 1/4

INF3170 / INF4171 Notes on Resolution

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

INTRODUCTION TO PREDICATE LOGIC HUTH AND RYAN 2.1, 2.2, 2.4

Automated Reasoning Lecture 5: First-Order Logic

3 Propositional Logic

CHAPTER 2. FIRST ORDER LOGIC

Introduction to Logic in Computer Science: Autumn 2007

Syntax of FOL. Introduction to Logic in Computer Science: Autumn Tableaux for First-order Logic. Syntax of FOL (2)

Motivation. CS389L: Automated Logical Reasoning. Lecture 10: Overview of First-Order Theories. Signature and Axioms of First-Order Theory

Handout: Proof of the completeness theorem

Logic: Propositional Logic Truth Tables

Propositional and Predicate Logic - VII

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

22c:145 Artificial Intelligence. First-Order Logic. Readings: Chapter 8 of Russell & Norvig.

02 Propositional Logic

Sequent calculus for predicate logic

Classical Propositional Logic

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

Introduction to Sets and Logic (MATH 1190)

Predicate Calculus - Syntax

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

Propositional Logic: Models and Proofs

Notes on Satisfiability-Based Problem Solving. First Order Logic. David Mitchell October 23, 2013

First Order Logic: Syntax and Semantics

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

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

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

Predicate Logic. CSE 595 Semantic Web Instructor: Dr. Paul Fodor Stony Brook University

All psychiatrists are doctors All doctors are college graduates All psychiatrists are college graduates

Notation for Logical Operators:

KE/Tableaux. What is it for?

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

Existential Second-Order Logic and Modal Logic with Quantified Accessibility Relations

Predicate Calculus. CS 270 Math Foundations of Computer Science Jeremy Johnson

Relations to first order logic

Final Exam (100 points)

CSE 1400 Applied Discrete Mathematics Definitions

The predicate calculus is complete

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

First Order Logic vs Propositional Logic CS477 Formal Software Dev Methods

Logic: First Order Logic (Part I)

Introduction to Metalogic

CS 2800: Logic and Computation Fall 2010 (Lecture 13)

Cut-Elimination and Quantification in Canonical Systems

Algebraizing Hybrid Logic. Evangelos Tzanis University of Amsterdam Institute of Logic, Language and Computation

COMP 409: Logic Homework 5

Syntactic Characterisations in Model Theory

Beyond First-Order Logic

Some consequences of compactness in Lukasiewicz Predicate Logic

First-Order Logic. Chapter Overview Syntax

Overview of Logic and Computation: Notes

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

3.17 Semantic Tableaux for First-Order Logic

Transcription:

First-Order Logic

Syntax The alphabet of a first-order language is organised into the following categories. Logical connectives:,,,,, and. Auxiliary symbols:.,,, ( and ). Variables: we assume a countable infinite set X of variables, ranged over by x, y, z,.... Constant symbols: we assume a countable set C of constant symbols, ranged over by a, b, c,.... Function symbols: we assume a countable set F of function symbols, ranged over by f, g, h,.... Each function symbol f has a fixed arity ar(f ), which is a positive integer. Predicate symbols: we assume a countable set P of predicate symbols, ranged over by P, Q, R,.... Each predicate symbol P has a fixed arity ar(p), which is a non-negative integer. (Predicate symbols with arity 0 play the role of propositions.) The union of the non-logical symbols of the language is called the vocabulary and is denoted by V, i.e. V = C F P. Notation Throughout, and when not otherwise said, we assume a vocabulary V = C F P.

Syntax The set of terms of a first-order language over a vocabulary V is given by: Term V t, u ::= x c f (t 1,..., t ar(f ) ) The set of variables occurring in t is denoted by Vars(t). The set of formulas of a first-order language over a vocabulary V is given by: Form V φ, ψ, θ ::= P(t 1,..., t ar(p) ) ( φ) (φ ψ) (φ ψ) (φ ψ) ( x.φ) ( x.φ) An atomic formula has the form or P(t 1,..., t ar(p) ). Remark We assume the conventions of propositional logic to omit parentheses, and additionally assume that quantifiers have the lowest precedence. Nested quantifications such as x. y. φ are abbreviated to x, y. φ. There are recursion and induction principles (e.g. structural ones) for Term V and Form V.

Syntax A formula ψ that occurs in a formula φ is called a subformula of φ. In a quantified formula x.φ or x.φ, x is the quantified variable and φ is the scope of the quantification. Occurrences of the quantified variable within the respective scope are said to be bound. Variable occurrences that are not bound are said to be free. The set of free variables (resp.bound variables) of a formula θ, is denoted FV(θ) (resp. BV(θ)). A sentence (or closed formula) is a formula without free variables. If FV(φ) = {x 1,..., x n }, the universal closure of φ is the formula x 1,..., x n.φ and the existential closure of φ is the formula x 1,..., x n.φ. A substitution is a mapping σ : X > Term V s.t. the set dom(σ) = {x X σ(x) x}, called the substitution domain, is finite. The notation [t 1 /x 1,..., t n /x n ] (for distinct x i s) denotes the substitution whose domain is contained in {x 1,..., x n } and maps each x i to t i.

Syntax The application of a substitution σ to a term t is denoted by t σ and is defined recursively by: x σ = σ(x) c σ = c f (t 1,..., t ar(f ) ) σ = f (t 1 σ,..., t ar(f ) σ) Remark The result of t [t 1 /x 1,..., t n /x n ] corresponds to the simultaneous substitution of t 1,..., t n for x 1,..., x n in t. This differs from the application of the corresponding singleton substitutions in sequence, ((t [t 1 /x 1 ])...) [t n /x n ]. Notation Given a function f : X Y, x X and y Y, the notation f [x y] stands for the function defined as f except possibly for x, to which y is assigned, called the patching of f in x to y.

Syntax The application of a substitution σ to a formula φ, written φ σ, is given recursively by: σ = P(t 1,..., t ar(p) ) σ = P(t 1 σ,..., t ar(p) σ) ( φ) σ = (φ σ) (φ ψ) σ = (φ σ) (ψ σ) (Qx. φ) σ = Qx. (φ(σ[x x])) where {, } and Q {, }. Remark Only free occurrences of variables can change when a substitution is applied to a formula. Unrestricted application of substitutions to formulas can cause capturing of variables as in: ( x.p(x, y)) [g(x)/y] = x.p(x, g(x)) Safe substitution (which we assume throughout) is achieved by imposing that a substitution when applied to a formula should be free for it. A term t is free for x in θ iff x has no free occurrences in the scope of a quantifier Qy (y x) s.t. y Vars(t). A substitution σ is free for θ iff σ(x) is free for x in θ, for all x dom(σ).

Semantics Given a vocabulary V, a V -structure is a pair M = (D, I) where D is a nonempty set, called the interpretation domain, and I is called the interpretation function, and assigns constants, functions and predicates over D to the symbols of V as follows: for each c C, the interpretation of c is a constant I(c) D; for each f F, the interpretation of f is a function I(f ) : D ar(f ) D; for each P P, the interpretation of P is a function I(P) : D ar(p) {F,T}. In particular, 0-ary predicate symbols are interpreted as truth values. V -structures are also called models for V. Let D be the interpretation domain of a structure. An assignment for D is a function α : X D from the set of variables to the domain D. Notation In what follows, we let M, M,... range over the structures of an intended vocabulary, and α, α,... range over the assignments for the interpretation domain of an intended structure.

Semantics Let M = (D, I) be a V -structure and α an assignment for D. The value of a term t w.r.t. M and α is an element of D, denoted by [[t]] M,α, and recursively given by: [[x]] M,α = α(x) [[c]] M,α = I(c) [[f (t 1,..., t ar(f ) )]] M,α = I(f )([[t 1 ]] M,α,..., [[t ar(f ) ]] M,α ) The (truth) value of a formula φ w.r.t. M and α, is denoted by [[φ]] M,α, and recursively given by: [[ ]] M,α = F [[P(t 1,..., t ar(p) )]] M,α = I(P)([[t 1 ]] M,α,..., [[t ar(p) ]] M,α ) [[ φ]] M,α = T iff [[φ]] M,α = F [[φ ψ]] M,α = T iff [[φ]] M,α = T and [[ψ]] M,α = T [[φ ψ]] M,α = T iff [[φ]] M,α = T or [[ψ]] M,α = T [[φ ψ]] M,α = T iff [[φ]] M,α = F or [[ψ]] M,α = T [[ x.φ]] M,α = T iff [[φ]] M,α[x a] = T for all a D [[ x.φ]] M,α = T iff [[φ]] M,α[x a] = T for some a D

Semantics Remark Universal and existential quantifications are indeed a gain over PL. They can be read (resp.) as generalised conjunction and disjunction (possibly infinite): [[ x.φ]] M,α = a D [[φ]] M,α[x a] [[ x.φ]] M,α = a D [[φ]] M,α[x a] Let V be a vocabulary and M a V -structure. M satisfies φ with α, denoted by M, α = φ, iff [[φ]] M,α = T. M satisfies φ (or that φ is valid in M, or M is a model of φ), denoted by M = φ, iff for every assignment α, M, α = φ. φ is satisfiable if exists M s.t. M = φ, and it is valid, denoted by = φ, if M = φ for every M. φ is unsatisfiable (or a contradiction) if it is not satisfiable, and refutable if it is not valid. Lemma Let M be a structure, t and u terms, φ a formula, and α, α assignments. If for all x Vars(t), α(x) = α (x), then [[t]] M,α = [[t]] M,α If for all x FV(φ), α(x) = α (x), then M, α = φ iff M, α = φ. [[t [u/x]]] M,α = [[t]] M,α[x [u]m,α ] If t is free for x in φ, then M, α = φ[t/x] iff M, α[x [[M]] α,t ] = φ.

Semantics Proposition (Lifting validity of PL) Let : Prop > Form V, be a mapping from the set of proposition symbols to first-order formulas and denote also by its homomorphic extension to all propositional formulas. Then, for all propositional formulas A and B: M, α = A iff M α = PL A, where M α = {P M, α = P }. If = PL A, then = FOL A. If A PL B, then A FOL B. Some properties of logical equivalence The properties of logical equivalence listed for PL hold for FOL. The following equivalences hold: x.φ x. φ x.φ ψ ( x.φ) ( x.ψ) x.φ x. φ x.φ ψ ( x.φ) ( x.ψ) For Q {, }, if y is free for x in φ and y FV(φ), then Qx. φ Qy. φ[y/x]. For Q {, }, if x FV(φ), then Qx. φ φ. For Q {, } and {, }, if x FV(ψ), then Qx. φ ψ (Qx. φ) ψ.

Semantics A formula is in prenex form if it is of the form Q 1 x 1.Q 2 x 2.... Q n x n.ψ (possibly with n = 0) where each Q i is a quantifier (either or ) and ψ is a quantifier-free formula. Proposition For any formula of first-order logic, there exists an equivalent formula in prenex form. Proof. Such a prenex form can be obtained by rewriting, using the logical equivalences listed before. Remark Unlike PL, the validity problem of FOL is not decidable, but it is semi-decidable, i.e. there are procedures s.t., given a formula φ, they terminate with yes if φ is valid but may fail to terminate if φ is not valid.

Semantics M satisfies Γ with α, denoted by M, α = Γ, if M, α = φ for every φ Γ. The notions of satisfiable, valid, unsatisfiable and refutable set of formulas are defined in the expected way. Γ entails φ (or φ is a logical consequence of Γ), denoted by Γ = φ, iff for every structure M and assignment α, if M, α = Γ then M, α = φ. φ is logically equivalent to ψ, denoted by φ ψ, iff [[φ]] M,α = [[ψ]] M,α for every structure M and assignment α. Some properties of semantic entailment The properties of semantic entailment listed for PL hold for FOL. If t is free for x in φ and Γ = x.φ, then Γ = φ[t/x]. If x FV(Γ) and Γ = φ, then Γ = x.φ. If t is free for x in φ and Γ = φ[t/x], then Γ = x.φ. If x FV(Γ {ψ}), Γ = x.φ and Γ, φ = ψ, then Γ = ψ.

Proof system The natural deduction system N FOL The proof system for FOL we consider is a natural deduction system in sequent style extending N PL. The various definitions made in the context of N PL carry over to N FOL. The difference is thatn FOL deals with first-order formulas and it has additional introduction and elimination rules to deal with the quantifiers. Quantifier rules of N FOL Γ φ[y/x] (I ) (a) Γ x.φ (E ) Γ x.φ Γ φ[t/x] (I ) Γ φ[t/x] Γ x.φ Γ x.φ Γ, φ[y/x] θ (E ) (b) Γ θ (a) y FV(Γ) and either x = y or y FV(φ). (b) y FV(Γ {θ}) and either x = y or y FV(φ). (c) Recall that we assume safe substitution, i.e. in a substitution φ[t/x], we assume that t is free for x in φ. Remark The properties of N PL can be extended to N FOL, in particular the soundness and completeness theorems. Theorem (Adequacy) Γ = ϕ iff Γ ϕ.

First-order theories Let V be a vocabulary of a first-order language. A first-order theory T is a set of V -sentences that is closed under derivability (i.e., T φ implies φ T ). A T -structure is a V -structure that validates every formula of T. A formula φ is T -valid (resp. T -satisfiable) if every (resp. some) T -structure validates φ. T = φ denotes the fact that φ is T -valid. Other concepts regarding validity of first-order formulas are carried over to theories in the obvious way. A subset A T is called an axiom set for the theory T when T is the deductive closure of A, i.e. ψ T iff A ψ, or equivalently, iff ψ can be derived in N FOL with an axiom-schema: if φ A Γ φ.

First-order theories Equality theory The theory of equality T E for V (which is assumed to have a binary equality predicate symbol = ) has the following axiom set: reflexivity: x.x = x symmetry: x, y.x = y y = x transitivity: x, y, z.x = y y = z x = z congruence for function symbols: for every f F with ar(f ) = n, x, y.x 1 = y 1... x n = y n f (x 1,..., x n ) = f (y 1,..., y n ) congruence for predicate symbols: for every P P with ar(p) = n, x, y.x 1 = y 1... x n = y n P(x 1,..., x n ) P(y 1,..., y n ) Theorem A sentence φ is valid in all normal structures (i.e. structures which interpret = as the equality relation over the interpretation domain) iff φ T E.