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

Similar documents
First-Order Predicate Logic. Basics

Introduction to Predicate Logic Part 1. Professor Anita Wasilewska Lecture Notes (1)

Automated Reasoning Lecture 5: First-Order Logic

Introduction to first-order logic:

Predicate Logic: Syntax

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

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

Predicate Logic: Sematics Part 1

First-order logic Syntax and semantics

2-4: The Use of Quantifiers

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

06 From Propositional to Predicate Logic

1 Introduction to Predicate Resolution

Propositional Functions. Quantifiers. Assignment of values. Existential Quantification of P(x) Universal Quantification of P(x)

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks

Quantifiers. P. Danziger

COMP 409: Logic Homework 5

Mathematical Logic Part Three

Predicate Calculus - Syntax

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Part 2: First-Order Logic

LING 501, Fall 2004: Quantification

Exercises 1 - Solutions

Propositional Logic Not Enough

Section Summary. Section 1.5 9/9/2014

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

Learning Goals of CS245 Logic and Computation

INTRODUCTION TO LOGIC

Formal (Natural) Deduction for Predicate Calculus

15414/614 Optional Lecture 3: Predicate Logic

CS156: The Calculus of Computation Zohar Manna Winter 2010

First-Order Logic (FOL)

4 Quantifiers and Quantified Arguments 4.1 Quantifiers

Logical Structures in Natural Language: First order Logic (FoL)


Ling 130 Notes: Predicate Logic and Natural Deduction

Quantifiers Here is a (true) statement about real numbers: Every real number is either rational or irrational.

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

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements


Final Exam (100 points)

Introduction to Logic in Computer Science: Autumn 2006

Predicate Logic - Introduction

Propositional Logic: Models and Proofs

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

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

Thinking of Nested Quantification

Predicate Calculus - Semantics 1/4

Topic #3 Predicate Logic. Predicate Logic

G52DOA - Derivation of Algorithms Predicate Logic

First order Logic ( Predicate Logic) and Methods of Proof

Predicate Logic: Introduction and Translations

Discrete Mathematics

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Final exam Logic & Set Theory (2IT61) (correction model)

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Comp487/587 - Boolean Formulas

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

Discrete Mathematics and Its Applications

CHAPTER 10. Predicate Automated Proof Systems


1.3 Predicates and Quantifiers

Predicate Logic. Andreas Klappenecker

CSI30. Chapter 1. The Foundations: Logic and Proofs Nested Quantifiers

Logic. Foundations of First Order Logic. franconi. Enrico Franconi

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

Philosophy 240 Symbolic Logic Russell Marcus Hamilton College Fall 2014

Logical Entailment A set of premises Δ logically entails a conclusion ϕ (Δ = ϕ) if and only if every interpretation that satisfies Δ also satisfies ϕ.

Negations of Quantifiers

First-Order Predicate Logic. First-Order Logic 153/467

PHIL 50 INTRODUCTION TO LOGIC 1 FREE AND BOUND VARIABLES MARCELLO DI BELLO STANFORD UNIVERSITY DERIVATIONS IN PREDICATE LOGIC WEEK #8

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

Logic: First Order Logic (Part I)

First-Order Logic. Chapter Overview Syntax

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

Logic. Readings: Coppock and Champollion textbook draft, Ch

Mathematical Logic Part Three

Handout #7 Predicate Logic Trees

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

2. Use quantifiers to express the associative law for multiplication of real numbers.

Definite Logic Programs

ICS141: Discrete Mathematics for Computer Science I

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

Mat 243 Exam 1 Review

Introduction to Sets and Logic (MATH 1190)

KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) RULES OF INFERENCE. Discrete Math Team

Predicate Calculus lecture 1

Reasoning with Quantified Boolean Formulas

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

INTRODUCTION TO LOGIC

It rains now. (true) The followings are not propositions.

COMP4418: Knowledge Representation and Reasoning First-Order Logic

CPSC 121: Models of Computation

Symbolising Quantified Arguments

Predicate in English. Predicates and Quantifiers. Predicate in Logic. Propositional Functions: Prelude. Propositional Function

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. February 9, :30 pm Duration: 1:50 hs. Closed book, no calculators

Proving Arguments Valid in Predicate Calculus

Discrete Structures for Computer Science

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

Transcription:

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

Predicate Logic In propositional logic there are: propositional variables p, q, r,... that can be T or F In predicate logic there are: variables a, b,... that represent objects (or individuals), predicates P(x) or relations R(x, y) on the objects 1-ary predicates like P(_) can express properties of objects: e.g. P(x) can express that x is green 2-ary predicates like R(_, _) can express relations: e.g. R(x, y) can express x knows y. Name natural examples of 3-ary predicates? L(x, y, z) = x, y, z are points on same line in the plane

Formulas and Logic Connectives In predicate logic, the role of propositional variables is taken over by the atomic formulas with object/predicate-structure: The atomic formulas are predicates over objects: P(x) R(x, y) Logic connectives,,, keep their role. We can build formulas using propositional connectives, starting from the smallest building blocks of atomic formulas: P(x) (x is green) P(x) R(x, y) (x is green and x knows y) R(x, y) R(y, x) (if x knows y then y does not know x) Predicate logic is more expressive In propositional logic, we could only state p, p q, p q.

Quantifiers Instead of x is green we now want to say: somebody is green, or everybody is green. Existential quantifier x φ means: there exists some x such that the formula φ is true. x P(x) (somebody is green) Universal quantifier x φ means: for every x the formula φ is true. x P(x) (everybody is green)

Examples Examples of formulas x P(x) Not everybody is green. x P(x) There exists someone who is not green. x R(x, x) Everybody does not know himself. x (R(x, x) P(x)) Everybody, who knows himself, is not green. x y (R(x, y) R(y, x)) For all x and y, if x knows y then y does not know x. What do these formulas mean given that P(x) means x is green R(x, y) means x knows y

Not Forall and Not Exists Let us reconsider two examples x P(x) x P(x) Not everybody is green. There exists someone who is not green. Note that both statements are equivalent! In general we have the following equivalences: x φ x φ x φ x φ x φ x φ x φ x φ Note that all these equivalences follow from each other.

Predicate Logic: Syntax The atomic formulas such as P(a), R(a, b),...,p(x),r(x, y) are the building blocks of formulas: here P, R,... are the predicate symbols, a, b, c,... are constants, x, y, z,... are variables. Complex formulas can be build from: atomic formulas, connectives,,, to connect fomulas φ φ ψ φ ψ φ ψ quantifiers x, y,... and x, y,... x φ x φ

Brackets Priority and Brackets The priority rules for and are the same as for. can be written as ( x D(x)) R(a, j) x D(x) R(a, j) x (D(x) R(a, x)) needs brackets! It is not equivalent to x D(x) R(a, x) which is short for ( x D(x)) R(a, x)

Parse Trees We make a parse tree from the formula y z ( x R(x, z) (R(x, z) R(y, z))) y z x R R R x z x z y z The x on the left is in the scope of x; the x in the middle not.

Bound and Free Variables A quantifier binds the free (not yet bound) variables of the same name in the scope of the quantifier. The x or x in x (φ) x (φ) binds all x in φ that are free, that is, not already bound. y z ( x R(x, z) (R(x, z) R(y, z))) x y z R R R x z x z y z The only black x is not bound, a free variable.

Exam Exercise Indicate by arrows which variable is bound by which quantifier: x ( y R(x, y) R(y, x)) x y (R(x, y) x R(y, x) P(x))

Substitution Substitution of t for x in φ φ [t/x] is the result of replacing all free occurrences of the variable x in φ with the term t. x P(x) Q(x) [y/x] = x P(x) Q(y) y R(x, y) [z/x] = y R(z, y) y R(x, y) [z/y] = y R(x, y) Attention! y R(x, y) [y/x] y R(y, y) This substitution is forbidden since y is not free for x in y R(x, y).

Examples: Semantics Intuitive Semantics Intuitive The semantics of a predicate logic formula are models. A model for a formula consists of a universe of objects/individuals predicates / relations over the universe such that the formula holds in this model. x P(x) This formula has a model; for example universe {1, 2, 3} P(1), P(2), P(3) In a picture, this looks as follows: a green dot indicates that P is T 1 2 3

Examples: Semantics Intuitive x y R(x, y) This formula has a model; for example universe {1, 2, 3} R(1, 2), R(2, 3), R(3, 1) is true (R(x, y) is false otherwise) We can draw this model as follows 1 3 Here an arrow from x to y means R(x, y). 2 Is the following formula valid in this model? y x R(x, y)

Examples: Semantics Intuitive y x R(x, y) Find a model for this formula! 1 3 2 Here the formula is true since for y = 2, we have: x R(x, y) R(1,2) R(2,2) R(3,2)

Examples: Semantics Intuitive x P(x) x ( P(x) y (Q(y) R(x, y)) ) Assume the following meaning of the predicates: P(x) = x is green, Q(x) = x is red, and R(x, y) = x knows y. What does the formula mean? there exists a green element, and every green element knows a red element. Find a model for this formula! 1 3 2

Examples: Semantics Intuitive Assume that R(x, y) means x knows y. What is then the intuitive meaning of the following formulas? x y R(x, y) Everybody knows somebody. y x R(x, y) Somebody is known by everybody. y x R(x, y) Everybody is known by somebody. x y R(x, y) Somebody knows everybody. For the exam you need to be able to interpret formulas!

Examples: Semantics Intuitive Typical exam question. Which of the following semantic implications are true? (a) x y R(x, y) = x y R(x, y) NO (b) x y R(x, y) = y x R(x, y) NO (c) y x R(x, y) = x y R(x, y) YES (d) y x R(x, y) = y x R(x, y) NO For the non-valid implications give counter-models. (Models that make the premise true, the conclusion false.) (a), (b) 1 3 (d) 1 3 2 2 Thus only (c) is a valid semantic implication!

Examples: Semantics Intuitive Find a model for this formula! x y (R(x, y) R(y, x)) 1 3 2 Other examples of models for this formula: 1 2 or a model with one element (universe is always non-empty): 1

Examples: Semantics Intuitive x y z (R(x, y) R(y, z) R(x, z)) What arrows are missing to make the following a model? 1 2 3 4 5 6 (Add only those arrows that are really needed.)

Examples: Semantics Intuitive This is a typical exam task! x y ( R(x, y) R(y, x) ) x y z ( R(x, y) R(y, z) R(x, z) ) x y R(x, y) Find a model for this formula, or explain why there is none. This formula has a model: universe N = {0, 1, 2, 3, 4, 5...} R(x, y) if x y We check that the formula holds in the model: for all x, y N, we have x y y x for all x, y, z N, we have x y y z x z for every x N there is y N such that x y