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

Similar documents
Lecture 4. Predicate logic

Inference in first-order logic

ITS336 Lecture 6 First-Order Logic

First order logic (FOL) Chapters 8 & 9

CS560 Knowledge Discovery and Management. CS560 - Lecture 3 1

Inference in first-order logic

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

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

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

Section Summary. Section 1.5 9/9/2014

Logic III. Introduction to Artificial Intelligence CSE 150

Reading: AIMA Chapter 9 (Inference in FOL)

Chapter 8 First Order Logic

First-Order Logic Chap8 1. Pros and Cons of Prop. Logic

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

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

Discrete Structures for Computer Science

First-Order Logic. Michael Rovatsos. University of Edinburgh R&N: February Informatics 2D

Mat 243 Exam 1 Review

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

Introduction to first-order logic:

Thinking of Nested Quantification

Predicate Logic & Quantification

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

Review: Potential stumbling blocks

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

First-order logic. Chapter 8. Chapter 8 1

Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof

Propositional and First-Order Logic

Logic: First Order Logic (Part I)

First-Order Logic. Chapter 8

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

CS:4420 Artificial Intelligence

First Order Logic (FOL)

Inference in first-order logic

LIN1032 Formal Foundations for Linguistics

Announcements. CS311H: Discrete Mathematics. Introduction to First-Order Logic. A Motivating Example. Why First-Order Logic?

Formal (Natural) Deduction for Predicate Calculus

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

First-Order Logic. Chapter 8

Knowledge Representation. Propositional logic

CS 380: ARTIFICIAL INTELLIGENCE INFERENCE IN PROPOSITIONAL LOGIC

First Order Logic (FOL)

MATH 501: Discrete Mathematics

15414/614 Optional Lecture 3: Predicate Logic

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

Discrete Mathematics and Its Applications

Logic Overview, I. and T T T T F F F T F F F F

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

Predicate Logic: Sematics Part 1

First-Order Logic. Chapter 8

Introduction to Sets and Logic (MATH 1190)

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

First-order logic. Chapter 8. Chapter 8 1

Math.3336: Discrete Mathematics. Nested Quantifiers

Discrete Structures Lecture 5

Knowledge Representation. Propositional logic.

First-order logic. First-order logic. Logics in general. Outline. Syntax of FOL: Basic elements. Pros and cons of propositional logic

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

Outline First-order logic. First-order Logic. Introduction. Recall: 4-Queens problem. First-order Logic. First-order Logic Syntax.

Propositional Logic Not Enough

First order Logic ( Predicate Logic) and Methods of Proof

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Lecture 3 : Predicates and Sets DRAFT

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

Lecture 8: (Predicate) First Order Logic

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

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

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

CS 380: ARTIFICIAL INTELLIGENCE FIRST ORDER LOGIC. Santiago Ontañón

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

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

Logic and Proof. Aiichiro Nakano

Nested Quantifiers. Predicates and. Quantifiers. Agenda. Limitation of Propositional Logic. Try to represent them using propositional.

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

Nathan Sturtevant FOL

ICS141: Discrete Mathematics for Computer Science I

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

Predicate Calculus lecture 1

Ling 130 Notes: Predicate Logic and Natural Deduction

Recall that the expression x > 3 is not a proposition. Why?

Predicate Calculus - Semantics 1/4

Logic: First Order Logic

ICS141: Discrete Mathematics for Computer Science I

06 From Propositional to Predicate Logic

Topic #3 Predicate Logic. Predicate Logic

Introduction. Predicates and Quantifiers. Discrete Mathematics Andrei Bulatov

VO Grundzüge der Artificial Intelligence SS Hans Tompits Institut für Informationssysteme Arbeitsbereich Wissensbasierte Systeme

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

CS 188: Artificial Intelligence Spring 2007

First Order Logic (FOL) 1 znj/dm2017

Nathan Sturtevant FOL

First-Order Logic. Language of FOL: Grammar. 22c:145 Artificial Intelligence. Norvig. Universal quantification. A common mistake to avoid

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

Section 2.1: Introduction to the Logic of Quantified Statements

CS 730/730W/830: Intro AI

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

Logic. Stephen G. Ware CSCI 4525 / 5525

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

First Order Logic. Philipp Koehn. 8 October 2015

Transcription:

CS 1571 Introduction to AI Lecture 14 First-order logic Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Midterm The midterm for the course will be held on October 28, 2014 In class exam Closed book Material covered by October 23, 2014 1

Simulated annealing competition Tournament winner: Adam Schwab (66.87) Second Michael Minella (68.09) Third Chris Iwaszko (68.90) Congratulations! Limitations of propositional logic World we want to represent and reason about consists of a number of objects with variety of properties and relations among them Propositional logic: Represents statements about the world without reflecting this structure and without modeling these entities explicitly Example: Peter likes ice-cream treated as an atomic entity Consequence: some knowledge is hard or impossible to encode in the propositional logic. Two cases that are hard to represent: Statements about similar objects, or relations Statements referring to groups of objects. 2

Limitations of propositional logic Statements about similar objects and relations needs to be enumerated Example: Seniority of people domain knowledge that would support inferences we need: John is older than Mary Mary is older than Paul John is older than Paul Jane is older than Mary Mary is older than Paul Jane is older than Paul Problem: if we have many people and their age relations we need to represent many rules to support the inferences Solution:?? Limitations of propositional logic Statements about similar objects and relations needs to be enumerated Example: Seniority of people domain For inferences we need: John is older than Mary Mary is older than Paul John is older than Paul Jane is older than Mary Mary is older than Paul Jane is older than Paul Problem: if we have many people and their age relations we need to represent many rules to support the inferences Solution: introduce variables PersA is older than PersB PersB is older than PersC PersA is older than PersC 3

Limitations of propositional logic Statements referring to groups of objects require exhaustive enumeration of objects Example: Assume we want to express Every student likes vacation Doing this in propositional logic would require to include statements about every student John likes vacation Mary likes vacation Ann likes vacation Solution: Allow quantified statements First-order logic (FOL) More expressive than propositional logic Eliminates deficiencies of PL by: Representing objects, their properties, relations and statements about them; Introducing variables that refer to an arbitrary objects and can be substituted by a specific object Introducing quantifiers allowing us to make statements over groups objects without the need to represent each of them separately 4

Logic Logic is defined by: A set of sentences A sentence is constructed from a set of primitives according to syntax rules. A set of interpretations An interpretation gives a semantic to primitives. It associates primitives with objects, values in the real world. The valuation (meaning) function V Assigns a truth value to a given sentence under some interpretation V : sentence interpretation { True, False } First-order logic: Syntax Term a syntactic entity for representing objects Terms in FOL: Constant symbols: represent specific objects E.g. John, France, car89 Variables: represent objects of a certain type (type = domain of discourse) E.g. x,y,z Functions applied to one or more terms E.g. father-of (John) father-of(father-of(john)) 5

First order logic: Syntax Sentences in FOL: Atomic sentences: A predicate symbol applied to 0 or more terms Examples: Red(car12), Sister(Amy, Jane); Manager(father-of(John)); t1 = t2 equivalence of terms Example: John = father-of(peter) First order logic: Syntax Sentences in FOL: Complex sentences: Assume, are sentences in FOL. Then: ( ) ( ) ( ) ( ) and x y are sentences Symbols, - stand for the existential and the universal quantifier 6

Semantics: Interpretation An interpretation I is defined by mapping constants, functions and predicates to the domain of discourse D or relations on D domain of discourse: a set of objects in the world we represent and refer to; An interpretation I maps: Constant symbols to objects in D I(John) = Predicate symbols to relations, properties on D I(brother) = ; ;. Function symbols to functional relations on D I(father-of) = ; ;. Semantics of sentences Meaning (evaluation) function: V : sentence interpretation { True, False } A predicate predicate(term-1, term-2,, term-n) is true for the interpretation I, iff the objects referred to by term-1, term-2,, term-n are in the relation referred to by predicate I(John) = I(Paul) = I(brother) = ; ;. I brother(john, Paul) = in I(brother) V(brother(John, Paul), I) = True 7

Semantics of sentences Equality V(term-1= term-2, I) = True Iff I(term-1) =I(term-2) Boolean expressions: standard E.g. V(sentence-1 sentence-2, I) = True Iff V(sentence-1,I)= True or V(sentence-2,I)= True Quantifications V(, I) = True substitution of x with d x Iff for all d D V(,I[x/d])= True V( x, I) = True Iff there is a d D, s.t. V(,I[x/d])= True Sentences with quantifiers Universal quantification All Upitt students are smart Assume the universe of discourse of x are Upitt students x smart(x) Assume the universe of discourse of x are students x at(x,upitt ) smart(x) Assume the universe of discourse of x are people x student(x) at(x,upitt ) smart(x) 8

Sentences with quantifiers Universal quantification All Upitt students are smart Assume the universe of discourse of x are Upitt students x smart(x) Assume the universe of discourse of x are students x at(x,upitt ) smart(x) Assume the universe of discourse of x are people x student(x) at(x,upitt ) smart(x) Typically the universal quantifier connects with an implication Sentences with quantifiers Existential quantification Someone at CMU is smart Assume the universe of discourse of x are CMU affiliates x smart(x) Assume the universe of discourse of x are people x at(x,cmu) smart(x) 9

Sentences with quantifiers Existential quantification Someone at CMU is smart Assume the universe of discourse of x are CMU affiliates x smart(x) Assume the universe of discourse of x are people x at(x,cmu) smart(x) Typically the existential quantifier connects with a conjunction Translation with quantifiers Assume two predicates S(x) and P(x) Universal statements typically tie with implications All S(x) is P(x) x ( S(x) P(x) ) No S(x) is P(x) x( S(x) P(x) ) Existential statements typically tie with conjunction Some S(x) is P(x) x (S(x) P(x) ) Some S(x) is not P(x) x (S(x) P(x) ) 10

Nested quantifiers More than one quantifier may be necessary to capture the meaning of a statement in the predicate logic. Example: There is a person who loves everybody. Translation: Assume: Variables x and y denote people A predicate L(x,y) denotes: x loves y Then we can write in the predicate logic:? Nested quantifiers More than one quantifier may be necessary to capture the meaning of a statement in the predicate logic. Example: There is a person who loves everybody. Translation: Assume: Variables x and y denote people A predicate L(x,y) denotes: x loves y Then we can write in the predicate logic: x y L(x,y) 11

Translation exercise Suppose: Variables x,y denote people L(x,y) denotes x loves y. Translate: Everybody loves Raymond. x L(x,Raymond) Everybody loves somebody. x y L(x,y) There is somebody whom everybody loves. y x L(x,y) There is somebody who Raymond doesn't love. y L(Raymond,y) There is somebody whom no one loves. y x L(x,y) Order of quantifiers Order of quantifiers of the same type does not matter For all x and y, if x is a parent of y then y is a child of x x, y parent ( x, y ) child ( y, x ) y, x parent ( x, y ) child ( y, x ) Order of different quantifiers changes the meaning x y loves ( x, y ) Everybody loves somebody y x loves ( x, y ) There is someone who is loved by everyone 12

Connections between quantifiers Everyone likes ice cream? Connections between quantifiers Everyone likes ice cream x likes ( x, IceCream ) Is it possible to convey the same meaning using an existential quantifier? There is no one who does not like ice cream x likes ( x, IceCream ) A universal quantifier in the sentence can be expressed using an existential quantifier!!! 13

Connections between quantifiers Someone likes ice cream x likes ( x, IceCream Is it possible to convey the same meaning using a universal quantifier? Not everyone does not like ice cream x likes ) ( x, IceCream ) An existential quantifier in the sentence can be expressed using a universal quantifier!!! Representing knowledge in FOL Example: Kinship domain Objects: people John, Mary, Jane, Properties: gender Male ( x), Female ( x) Relations: parenthood, brotherhood, marriage Parent ( x, y), Brother ( x, y), Spouse ( x, y) Functions: mother-of (one for each person x) MotherOf ( x) 14

Kinship domain in FOL Relations between predicates and functions: write down what we know about them; how relate to each other. Male and female are disjoint categories x Male ( x) Female ( x) Parent and child relations are inverse x, y Parent ( x, y) Child ( y, x) A grandparent is a parent of parent g, c Grandparent( g, c) p Parent( g, p) Parent( p, c) A sibling is another child of one s parents x, y Sibling ( x, y) ( x y) p Parent ( p, x) Parent ( p, y) And so on. 15