First-Order Logic. Announcements. General Logic. PL Review: Truth Tables. First-Order Logic. PL Review: Inference Rules

Similar documents
Propositional and First-Order Logic

A Short Introduction to Propositional Logic and First-Order Logic

ITS336 Lecture 6 First-Order Logic

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

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

KB Agents and Propositional Logic

Inference in first-order logic

Artificial Intelligence Knowledge Representation I

Chapter 8 First Order Logic

First Order Logic: Syntax and Semantics

Logic for Computer Science - Week 4 Natural Deduction

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

Nathan Sturtevant FOL

Inference in Propositional Logic

Knowledge Representation and Reasoning

LIN1032 Formal Foundations for Linguistics

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

A. Propositional Logic

CS 1571 Introduction to AI Lecture 14. First-order logic. CS 1571 Intro to AI. Midterm

Predicate Logic & Quantification

CS 730/730W/830: Intro AI

Logic. Propositional Logic: Syntax. Wffs

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

Propositional Logic: Review

First Order Logic: Syntax and Semantics

Today s Lecture. ICS 6B Boolean Algebra & Logic. Predicates. Chapter 1: Section 1.3. Propositions. For Example. Socrates is Mortal

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:

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

Logic for Computer Science Handout Week 8 DERIVED RULE MODUS TOLLENS DERIVED RULE RAA DERIVED RULE TND

Logic. Propositional Logic: Syntax

Lecture 3 : Predicates and Sets DRAFT

J Propositional logic is declarative J Propositional logic is compositional: q meaning of B 1,1 P 1,2 is derived from meaning of B 1,1 and of P 1,2

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

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

We have seen that the symbols,,, and can guide the logical

Propositional Logic Not Enough

Proseminar on Semantic Theory Fall 2013 Ling 720 Propositional Logic: Syntax and Natural Deduction 1

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

A Little Deductive Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

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

Inference in first-order logic

Logic III. Introduction to Artificial Intelligence CSE 150

AI Programming CS S-09 Knowledge Representation

Section Summary. Section 1.5 9/9/2014

Proving logical equivalencies (1.3)

Mathematical Logic Part Three

Natural deduction for truth-functional logic

First order logic (FOL) Chapters 8 & 9

A Little Deductive Logic

Logic and Proof. Aiichiro Nakano

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

Mathematical Logic Part Three

Mathematical Logic Part Three

Predicate Logic. Example. Statements in Predicate Logic. Some statements cannot be expressed in propositional logic, such as: Predicate Logic

Intermediate Logic. Natural Deduction for TFL

CS 730/830: Intro AI. 3 handouts: slides, asst 6, asst 7. Wheeler Ruml (UNH) Lecture 12, CS / 16. Reasoning.

First-Order Logic. Propositional logic. First Order logic. First Order Logic. Logics in General. Syntax of FOL. Examples of things we can say:

Chapter 3. The Logic of Quantified Statements

Ling 130 Notes: Predicate Logic and Natural Deduction

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

Proof. Theorems. Theorems. Example. Example. Example. Part 4. The Big Bang Theory

15414/614 Optional Lecture 1: Propositional Logic

Propositional Logic: Syntax

Chapter 4, Logic using Propositional Calculus Handout

CS:4420 Artificial Intelligence

Final Exam Theory Quiz Answer Page

Formal Logic. Critical Thinking

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

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

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Knowledge and reasoning 2

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

Introduction to Logic

Logical Agents. Outline

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

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

03 Propositional Logic II


First-order logic. Chapter 8. Chapter 8 1

DISCRETE MATH: LECTURE Chapter 3.3 Statements with Multiple Quantifiers If you want to establish the truth of a statement of the form

Artificial Intelligence. Propositional logic

Review: Potential stumbling blocks

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.

Nathan Sturtevant FOL

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

CS70 is a course about on Discrete Mathematics for Computer Scientists. The purpose of the course is to teach you about:

INF3170 Logikk Spring Homework #8 For Friday, March 18

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

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

Lecture 4. Predicate logic

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

Predicate Calculus. Lila Kari. University of Waterloo. Predicate Calculus CS245, Logic and Computation 1 / 59

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

CSC242: Intro to AI. Lecture 12. Tuesday, February 26, 13

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

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

Transcription:

irst-order Logic Announcements Homework #2 is assigned, it is due Monday, July 7 (1 week from today) Burr H. Settles CS-540, UW-Madison www.cs.wisc.edu/~cs540-1 Summer 2003 Project proposals are due today Read Chapter 9 in AI: A Modern Approach for next time 1 2 General Logic PL Review: ruth ables Logics are characterized by what they consider to be primitives Logic Propositional irst-order emporal Probability heory uzzy Primitives facts facts, objects, relations facts, objects, relations, times facts degree of truth Available Knowledge true/false/unknown true/false/unknown true/false/unknown degree of belief 0 1 degree of belief 0 1 3 ((A C) (A C)) (C B) (A (B C)) ((A B) (A C)) A B C satisfiable, but not valid ((A C) (A C)) (C B) valid unsatisfiable A B C (A (B C)) ((A B) (A C)) (A B) (A B) ( A B) ( A B) A B (A B) (A B) ( A B) ( A B) 4 PL Review: Inference Rules irst-order Logic Modus Ponens And-Elimination (AE): And-Introduction (AI): Or-Introduction (OI): Double-Negation Elimination (DNE): Unit Resolution (UR): Resolution (R): demorgan s Law (DML):, 1 2 n i 1, 2,, n 1 2 n i 1 2 n,, ( ) Given the following knowledge base: 1. P 2. P R 3. R W 4. S R 5. (P R) (S W) Prove S using natural deduction with these rules. 6. R (MP: 1,2) 7. W (MP: 3,6) 8. P R (AI: 1,6) 9. S W (MP: 5,8) 10. S (UR: 7,9) 5 Propositional logic has advantages Simple Inference is fast and easy But PL is limited in key ways Enumerate all facts as separate propositions No concept of individuals or objects Can t express relationships easily irst-order Logic is a logic language designed to remedy these problems 6 1

OL Syntax: Basic OL Syntax: Basic A term is used to denote an object in the world Constant: Bob, 2, Madison, Green, Variable: x, y, a, b, c, unction(term 1,, term n ): e.g. sqrt(9), distance(madison,chicago) Maps one or more objects to another object Can refer to an unnamed object: e.g. leftlegof(john) Represents a user defined functional relation A ground term is a term with no variables An atom is smallest expression to which a truth value can be assigned Predicate(term 1,, term n ): e.g. teacher(burr,you), lte(sqrt(2),sqrt(7)) Maps one or more objects to a truth value Represents a user defined relation erm 1 = erm 2 : e.g. height(burr) = 73in, 1 = 2 Represents the equality relation when two terms refer to the same object 7 8 OL Syntax: Basic OL Syntax: Basic A sentence represents a fact in the world that is assigned a truth value Atom Complex sentence using connectives: e.g. spouse(burr,nat) spouse(burr,nat) e.g. less(11,22) less(22,33) Complex sentence using quantified variables: More about these in a bit Sentences are assigned a truth value with respect to a model and an interpretation he model contains the objects and the relations among them he interpretation specifies what symbols refer to: Constants symbols refer to objects Predicate symbols refer to relations unctional symbols refer to functional relations 9 10 OL Semantics: Assigning ruth OL Syntax: Quantifiers he atom predicate(term 1,, term n ) is true iff the objects referred to by term 1,, term n are in the relation referred to by the predicate What is the truth value for s(b,n)? Model: Objects: Burr, Nat, hom, Mark Relation: spouse {<Burr,Nat>,<Nat,Burr>} Interpretation: B means Burr, N means Nat, means hom, etc. he universal quantifier: Sentence holds true for all values of x in the domain of variable x Main connective typically forming if-then rules All humans are mammals in OL becomes: x human(x) mammal(x) Means if x is a human then x is a mammal s(term 1,term 2 ) means term 1 is the spouse of term 2 11 12 2

OL Syntax: Quantifiers OL Syntax: Quantifiers x human(x) mammal(x) Equivalent to the conjunction of all the instantiations of variable x: (human(burr) mammal(burr)) (human(nat) mammal(nat)) (human(hom) mammal(hom)) Common mistake is to use as main connective Results in a blanket statement about everything or example: x human(x) mammal(x) (human(burr) mammal(burr)) (human(nat) mammal(nat)) (human(hom) mammal(hom)) But this means everything is human and a mammal! 13 14 OL Syntax: Quantifiers OL Syntax: Quantifiers he existential quantifier: x human(x) male(x) Sentence holds true for some value of x in the domain of variable x Main connective typically Some humans are male in OL becomes: x human(x) male(x) Means x is some human and x is a male Equivalent to the disjunction of all the instantiations of variable x: (human(burr) male(burr)) (human(nat) male(nat)) (human(hom) male(hom)) 15 16 OL Syntax: Quantifiers OL Syntax: Quantifiers Common mistake is to use Results in a weak statement as main connective. or example: x human(x) male(x) (human(burr) male(burr)) (human(nat) male(nat)) (human(hom) male(hom)) Can be true if there is something not human! x y is the same as y x x y is the same as y x x y likes(x,y) the active voice: Everyone likes everyone. y x likes(x,y) the passive voice: Everyone is liked by everyone. 17 18 3

OL Syntax: Quantifiers OL Syntax: Quantifiers x y is not the same as y x x y is not the same as y x x P(x) is the same as x P(x) x P(x) is the same as x P(x) x y likes(x,y) Everyone has someone they like. y x likes(x,y) here is someone who is liked by everyone. x sleep(x) Everybody sleeps. x sleep(x) double negative: Nobody don t sleep. 19 20 OL Syntax: Quantifiers OL Syntax: Basics x P(x) when negated is x P(x) x P(x) when negated is x P(x) A free variable is a variable that isn t bound by a quantifier i.e. y Likes(x,y): x is free, y is bound x sleeps(x) Everybody sleeps. x sleeps(x) negated: Somebody doesn t sleep. A well-formed formula is a sentence where all variables are quantified (none are free) 21 22 Summary So ar Summary So ar Constants: Bob, 2, Madison, Variables: x, y, a, b, c, unctions: Income, Address, Sqrt, Predicates: eacher, Sisters, Even, Prime Connectives: Equality: = Quantifiers: erm: Constant, variable, or function denotes an object in the world (a ground term has no variables) Atom: Is smallest expression assigned a truth value e.g. Predicate(term 1,, term n ), term 1 = term 2 Sentence: An atom, quantified sentence with variables, or complex sentence using connectives; assigned a truth value Well-ormed ormula (wff): A sentence where all variables are quantified 23 24 4

hinking in Logical Sentences hinking in Logical Sentences Convert the following sentences into OL: Bob is a fish. What is the constant? Bob What is the predicate? is a fish Answer: fish(bob) Burr and Mark are grad students. Burr, Mark, or Nat is not a rat. We can also do this with relations: America bought Alaska from Russia. What are the constants? America, Alaska, Russia What are the relations? bought Answer: bought(america, Alaska, Russia) Warm is between cold and hot. Burr and Nat are married. 25 26 hinking in Logical Sentences hinking in Logical Sentences Now let s think about quantification: Burr likes everything. What is the constant? Burr How are they variables quantified? All/universal Answer: x likes(burr, x) i.e. likes(burr, IceCream) likes(burr, Nat) likes(burr, Armadillos) Burr likes something. Somebody likes Burr. 27 All hings: anything, everything, whatever Persons: anybody, anyone, everybody, everyone, whoever Some (at least one) hings: something Persons: somebody, someone None hings: nothing Persons: nobody, no one 28 hinking in Logical Sentences hinking in Logical Sentences We can also have multiple quantifiers: Somebody heard something. What are the variables? somebody and something How are they quantified? both are at least one/existential Answer: x,y heard(x,y) Everybody heard everything. Somebody did not hear everything. 29 Let s allow more complex quantified relations: All stinky shoes are allowed. How are ideas connected? being a shoe and being stinky implies that it is allowed Answer: x shoe(x) stinky(x) allowed(x) No stinky shoes are allowed. Answer: x shoe(x) stinky(x) allowed(x) he equivalent: Stinky shoes are not allowed. Answer: x shoe(x) stinky(x) allowed(x) 30 5

hinking in Logical Sentences hinking in Logical Sentences And some more complex relations: No one sees everything. What are the variables and quantifiers? nothing and everything not one (i.e. not existential) and all (universal) Answer: x y sees(x,y) Equivalent: Everyone doesn t see something. Answer: x y sees(x,y) Everyone sees nothing. Answer: x And some really complex relations: Any good amateur can beat some professional. Lets break this down: x [ (x is a good amateur) (x can beat some professional) ] (x can beat some professional) is really: y [ (y is a professional) (x can beat y) ] x [ (x is a good amateur) y [ (y is a professional) (x can beat y) ] Answer: x [{amateur(x) good(x)} y {professional(y) beat(x,y)}] Some professionals can beat all amateurs. Answer: x [professional(x) y sees(x,y) 31 y {amateur(y) beat(x,y)}] 32 hinking in Logical Sentences hinking in Logical Sentences We can throw in functions and equalities, too: Burr and Nat are the same age. Are functional relations specified? Are equalities specified? Answer: age(burr) = age(nat) here are exactly two shoes. Are quantities specified? Are equalities implied? Answer: x y shoe(x) shoe(y) (x=y) z (shoe(z) (x=z) (y=z)) Interesting words: always, sometimes, never Good people always have friends. x person(x) good(x) y(friend(x,y)) Busy people sometimes have friends. x person(x) busy(x) y(friend(x,y)) Bad people never have friends. x person(x) bad(x) y(friend(x,y)) 33 34 hinking in Logical Sentences irst-order Inference hese are pretty tricky: Assume x is above y if x is directly on the top of y, or else there is a pile of one or more other objects directly on top of on another starting with x and ending with y. Answer: x y above(x,y) [onop(x,y) z{onop(x,z) above(z,y)}] President Lincoln: You can fool some of the people all of the time, and you can fool all of the people some of the time, but you cannot fool all of the people all of the time! 35 Recall that with PL, inference is pretty easy Enumerate all possibilities (truth tables) Apply sound inference rules on facts But in OL, we have concepts of variables, relations, and quantification his complicates things quite a bit! Next time, we ll discuss how inference procedures for first-order logic work 36 6