First Order Logic: Syntax and Semantics

Similar documents
First Order Logic: Syntax and Semantics

cis32-ai lecture # 18 mon-3-apr-2006

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Propositional Logic: Syntax

Logic. Propositional Logic: Syntax. Wffs

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

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Logic. Propositional Logic: Syntax

Automated Reasoning Lecture 2: Propositional Logic and Natural Deduction

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

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

How to determine if a statement is true or false. Fuzzy logic deal with statements that are somewhat vague, such as: this paint is grey.

Learning Goals of CS245 Logic and Computation

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:

Reasoning. Inference. Knowledge Representation 4/6/2018. User

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

Propositional Logic: Review

02 Propositional Logic

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logic: Propositional Logic Truth Tables

Natural Deduction for Propositional Logic

The Importance of Being Formal. Martin Henz. February 5, Propositional Logic

Propositional Logic Arguments (5A) Young W. Lim 11/29/16

Knowledge Representation and Reasoning

Introduction to Metalogic

Deductive Systems. Lecture - 3

Classical First-Order Logic

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

CS 730/730W/830: Intro AI

Logic: Propositional Logic (Part I)

03 Review of First-Order Logic

KB Agents and Propositional Logic

Marie Duží

Artificial Intelligence Knowledge Representation I

Completeness for FOL

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

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

COMP2411 Lecture 10: Propositional Logic Programming. Note: This material is not covered in the book. Resolution Applied to Horn Clauses

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

Overview of Logic and Computation: Notes

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

Logic: The Big Picture

Propositional Logic Language

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

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Logic. (Propositional Logic)

6.825 Techniques in Artificial Intelligence. Logic Miscellanea. Completeness and Incompleteness Equality Paramodulation

Intelligent Systems. Propositional Logic. Dieter Fensel and Dumitru Roman. Copyright 2008 STI INNSBRUCK

Price: $25 (incl. T-Shirt, morning tea and lunch) Visit:

GS03/4023: Validation and Verification Predicate Logic Jonathan P. Bowen Anthony Hall

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

Advanced Topics in LP and FP

CMPSCI 601: Tarski s Truth Definition Lecture 15. where

Semantics and Pragmatics of NLP

CHAPTER 11. Introduction to Intuitionistic Logic

Artificial Intelligence. Propositional Logic. Copyright 2011 Dieter Fensel and Florian Fischer

Handout: Proof of the completeness theorem

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

CS589 Principles of DB Systems Fall 2008 Lecture 4e: Logic (Model-theoretic view of a DB) Lois Delcambre

Gödel s Incompleteness Theorem. Overview. Computability and Logic

Propositional Logic: Deductive Proof & Natural Deduction Part 1

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

CS 2740 Knowledge Representation. Lecture 4. Propositional logic. CS 2740 Knowledge Representation. Administration

Logic Background (1A) Young W. Lim 12/14/15

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

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

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

15414/614 Optional Lecture 1: Propositional Logic

Math 267a - Propositional Proof Complexity. Lecture #1: 14 January 2002

MAI0203 Lecture 7: Inference and Predicate Calculus

Introduction to Logic

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

Artificial Intelligence Knowledge Representation I

Automated Reasoning Lecture 5: First-Order Logic

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

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Truth-Functional Logic

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

First Order Logic (1A) Young W. Lim 11/18/13

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

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

Agents that reason logically

Propositional Logic: Models and Proofs

Reasoning Under Uncertainty: Introduction to Probability

Gödel s Incompleteness Theorem. Overview. Computability and Logic

Lecture 9. Model theory. Consistency, independence, completeness, categoricity of axiom systems. Expanded with algebraic view.

6. Logical Inference

Propositional Logic. CS 3234: Logic and Formal Systems. Martin Henz and Aquinas Hobor. August 26, Generated on Tuesday 31 August, 2010, 16:54

Introduction to Logic in Computer Science: Autumn 2006

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

Logic for Computer Science - Week 4 Natural Deduction


The predicate calculus is complete

5. And. 5.1 The conjunction

Inference in first-order logic

06 From Propositional to Predicate Logic

CS 730/830: Intro AI. 1 handout: slides. Wheeler Ruml (UNH) Lecture 11, CS / 15. Propositional Logic. First-Order Logic

Transcription:

CS1081 First Order Logic: Syntax and Semantics COMP30412 Sean Bechhofer sean.bechhofer@manchester.ac.uk Problems Propositional logic isn t very expressive As an example, consider p = Scotland won on Saturday We have no access to any of the constituent parts of this proposition q = Sean drank beer on Saturday Can we tell from p Æ q that these both refer to the same day? 2 1

Problems Consider also the example Sean is a lecturer, lecturers are academics thus Sean is an academic What about: Bijan is a lecturer, lecturers are academics thus Bijan is an academic We can t capture this kind of inference using propositional logic. The propositions don t give us a general mechanism for talking about individuals in the world 3 Predicate Calculus First order or predicate calculus provides a solution to this Predicates allow us to express relations or properties Variables allow abstract and generalisation 4 2

Basics Sentences in predicate logic are built up from constants, predicates and functions. Constants, which refer to the objects we want to talk about Sean, Scotland, COMP30412 Predicates express relationships or properties likes, teaches Red, Blue, Lecturer, Person, Academic Functions allow us to indirectly refer to other objects parent_of Predicates and functions have an arity they take a number of arguments. 5 Atomic Sentences teaches( Sean, COMP30412 ) Sean teaches COMP30412 Lecturer( Sean ) Sean is a Lecturer Academic( Sean ) Sean is an Academic knows( Sean, Bijan ) Sean knows Bijan Academic( father_of( Sean ) ) The father of Sean is an Academic These are all atomic sentences a predicate of arity n, with n arguments. As with propositional logic, we can form compound sentences using connectives, Æ, Ç, ) and,. 6 3

Compound Sentences teaches( Sean, COMP30412 ) Æ Academic ( Sean ) Sean teaches COMP30412 and Sean is an Academic knows( Sean, Bijan ) ) Lecturer( Sean ) If Sean knows Bijan then Sean is a Lecturer Academic( Sean ) Ç drinks( Sean, Beer ) Sean is an academic or Sean drinks Beer (or both) This is all very well, but all these predicates are about constants (or functions applied to constants). How can we talk about more general situations? 7 Variables & Quantifiers Variables allow us to assert more general or abstract sentences that don t talk about particular objects Academic( x ) ) drinks( x, Beer ) If x is an Academic, then x drinks Beer teaches( x, COMP30412 ) Æ knows( x, y ) Æ Academic( y ) x teaches COMP30412 and x knows y and y is not an Academic Quantifiers tell us how to interpret the variables 9 (exists) is used to indicate that there is something that can be subsituted for the variable such that the sentence holds (but doesn t necessarily tell us what it is). 8 (for all) is used to indicate that the sentence should hold when anything is substituted for the variable 8 4

Quantification 9 x. Red( x ) There is a red thing. 8 x.9 y. teaches( x, y ) ) Lecturer( x ) For any x, if there is some y that x teaches, then x is a Lecturer. 9 Formal Definition of Syntax Symbols A set of constant symbols A set of variables A set of function symbols (with associated arities) A set of predicate symbols (with associated arities) A term is defined as either A constant A variable A function expression f(t 1,,t n ), where f has arity n and t 1, t n are terms. Note that n may be zero 10 5

Well Formed Formulae An expression P(t 1,,t n ) where P is a predicate symbol of arity n and t 1, t n are terms is a WFF If S is a WFF then so is S If S 1 and S 2 are WFFs then so is S 1 Æ S 2 If S 1 and S 2 are WFFs then so is S 1 Æ S 2 If S 1 and S 2 are WFFs then so is S 1 Æ S 2 If x is a variable and S is a WFF then so is 8 x. S We say that any occurrence of x in S is bound. If x is a variable and S is a WFF then so is 9 x. S We say that any occurrence of x in S is bound. 11 Sentences WFF may still contain unbound variables, for example: 8 x. teaches( x, y ) Æ Lecturer( x ) This can cause us problems when we try and interpret them as it s not clear what we should do with the variable. To cope with this we define a further class of formulae known as sentences. A sentence is a WFF with no unbound (or free) variables. Any variable occurring in the formula is bound by a quantifier 12 6

Interpretations How do we interpret the truth (or falsehood) of a statement? For example, given teaches( Sean, COMP30412 ) how do I know whether this is true or not? As with propositional logic, the truth of this statement has to be determined within some context. It depends on my interpretation of the constants Sean and COMP30412 13 Interpretations In the propositional case, our interpretations were based on a truth valuation that assigned T or F to each atomic proposition. We then used truth tables to determine whether a sentence was true or not. In the predicate case, our interpretations are based on functions that map the symbols in the language to elements and sets of objects in a domain. The intuition here is that the domain consists of the objects that we re talking about, while the interpretation tells us how the symbols in the language map to those objects. 14 7

Interpretations To keep things simple here, we ll only consider a language with: A set of constants C A set of variables V A set of unary predicates P A set of binary predicates R 15 Interpretations An interpretation I consists of a set Δ known as the domain, along with functions: I C : C! Δ Constants map to elements of the domain I P : P! P(Δ) Unary predicates map to sets of elements of the domain I R : R! P(Δ Δ) Binary predicates map to sets of pairs of elements of the domain The functions tell us how to interpret atomic predicates. 16 8

Interpretations: Atoms Given an atomic sentence (e.g. one with no quantifiers or connectives), we define the notion of satisfaction: I ² A(c) iff I C (c) 2 I P (A) for A a unary predicate A(c) is satisfied iff the interpretation of c is in the interpretation of A I ² S(c,d) iff (I C (c),i C (d)) 2 I R (S) for S a binary predicate S(c,d) is satisfied iff the pair of objects given by the interpretations of c and d are in the interpretation of S 17 Interpretations: Connectives As with the propositional case, we can extend the interpretation function to sentences that contain connectives For sentences A, B we define I ² A if, and only if I 2 A I ² A Æ B if, and only if I ² A and I ² B I ² A Ç B if, and only if I ² A or I ² B I ² A ) B if, and only if If I ² A then I ² B I ² A, B if, and only if I ² A if and only if I ² B 18 9

Interpretations: Quantifiers We can also extend our interpretations to cover sentences that contain quantifiers I ² 9x.A(x) iff there is some object e in the domain such that A(e) is true Similarly for universal quantification I ² 8x.A(x) iff A(e) is true for all objects e in the domain. 19 Tautologies and Satisfiability A sentence is valid or is a tautology iff it is true under every interpretation. If A is a tautology, this is written ² A Just as in the propositional case A formula is said to be satisfiable (or consistent) iff it is true under at least one interpretation. A formula is said to be unsatisfiable (or inconsistent or contradictory) iff there is no interpretation under which it is true If a formula A is a tautology then A is unsatisfiable. 20 10

Logical Consequences B is a consequence of A 1,, A n if it s the case that whenever all the A i are true, then B must be true also. In other words, for any interpretation where A 1,, A n are satisfied then B is satisfied. We write: A 1,, A n ² B Again, like the propositional case For example, if we know that both A(e) and 8 x.(a(x) ) B(x)) hold, then we might want to be able to conclude that B(e) also holds. In the propositional case, we could do this by exhaustively writing down all the possible interpretations (truth tables) and checking them all. We can t do the same here though There might be an infinite number of different interpretations. 21 Proof Rules We can provide a proof theory for FOL that allows us to determine logical consequence using some mechanical process. The rules are similar to those for the propositional case, but extended in order to deal with variables. For example, we have the 8-elimination rule: 8 x.a(x) A(e) for any e in the domain If we know that A holds for all x, then it must hold for some particular x. There are similar rules for 9. 22 11

Proof By combining proof rules together, we can deduce consequences from premises. Ex: from A(e) and 8 x.(a(x) ) B(x)), can we prove B(e)? E.g. show that: A(e), 8 x.(a(x) ) B(x)) ` B(e) 1. 8 x.(a(x) ) B(x)) [given] 2. A(e) [given] 3. A(e) ) B(e) [1 8-elimination] 4. B(e) [2,3 modus ponens] 23 Proof Theory A proof theory allows us to determine satisfiability and entailments without having to consider the interpretations. It s similar to the propositional case, but a little more complex due to the extra machinery required for the quantifiers. 24 12

Relating Proofs and Semantics Again, we can relate the notions of validity (based on considering interpretations) and provability (based on proofs). Soundness and Completeness are again the properties that relate the two A Soundness theorem states that: If A 1,,A n ` B then A 1 Æ Æ A n ² B (i.e. A 1 Æ Æ A n ) B is valid) A Completeness theorem states that: If A 1 Æ Æ A n ² B (i.e. A 1 Æ Æ A n ) B is valid) then A 1,,A n ` B 25 Soundness and Completeness Informally, soundness gives us an assurance that our proof theory is producing correct answers Completeness gives us an assurance that if a formula is valid, we can construct a proof of it using our proof theory. Again it is important to note that completeness doesn t say anything at all about how we might go about constructing such a proof just that the proof exists. In the first order case, this is particularly important: provability in FOL is undecidable There is no procedure that will guarantee to find us a proof of the validity of a sentence. However, by restricting the expressivity of the language we can produce fragments of FOL that are decidable (e.g. Description Logics) 26 13

Knowledge Bases A Knowledge Base K = {A 1,,A n } is a collection of sentences that describe facts about a situation of affairs that we are trying to model. K = {8x.Lecturer(x)! Academic(x), 8x.Academic(x)! (Hairy(x) Ç Beardy(x)), Lecturer(Sean), Lecturer(Bijan), Lecturer(John)} We can then derive consequences from this knowledge base where B is a consequence if A 1,,A n ² B 27 Possible Worlds A key point here is that the sentences (or axioms) in the Knowledge Base do not describe a particular state of affairs but rather constrain the possible worlds that the knowledge describes. In the previous example, there are many different interpretations in which the axioms in K are satisfied However, in each of those interpretations it must be the case that Academic(Sean) must be true. It must also be the case that either Beardy(John) or Hairy(John) must be true, but this could differ in different interpretations. The consequences of the axioms are all those things that must hold in any possible interpretations This is in contrast to a database, where the facts in the database describe a particular, single state of affairs. 28 14

Possible Worlds This semantics based on interpretations allows us to represent incomplete or partial knowledge As we will see later, this is a useful and powerful aspect. 29 Recap Propositional logic gives us a language for reasoning about propositions The syntax defines the language The semantics tells us how to interpret compound propositions A proof theory allows us to reason about the consequences of propositions in a sound and complete way Predicate logic extends the propositional case allow us to talk about specific individuals, and generalise using variables. Again a syntax, semantics and proof theory. A Knowledge Base (KB) contains axioms that describe constraints on possible valid interpretations 30 15