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

Similar documents
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. Michael Rovatsos. University of Edinburgh R&N: February Informatics 2D

First-Order Logic. Chapter 8

First-Order Logic. Chapter 8

First-Order Logic. Chapter 8

Chapter 8 First Order Logic

CS 188: Artificial Intelligence Spring 2007

First-Order Logic. CS367 ARTIFICIAL INTELLIGENCE Chapter 8

Outline. First-order logic. Atomic sentences. Intelligent Systems and HCI D7023E. Syntax of FOL: Basic elements. Pros and cons of propositional logic

First-order logic. Chapter 8. Chapter 8 1

First-order logic. Chapter 8. Chapter 8 1

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

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

First Order Logic (FOL)

First order logic (FOL) Chapters 8 & 9

Lecture 8: (Predicate) First Order Logic

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

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

Reading: AIMA Chapter 9 (Inference in FOL)

CS:4420 Artificial Intelligence

First Order Logic (FOL)

CS 380: ARTIFICIAL INTELLIGENCE INFERENCE IN PROPOSITIONAL LOGIC

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

Logic III. Introduction to Artificial Intelligence CSE 150

First-Order Logic. Peter Antal

Planning and search. FOL and situation calculus. FOL and situation calculus 1

First Order Logic. Philipp Koehn. 8 October 2015

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

First-order logic. AI Slides (5e) c Lin

Knowledge Representation Logic and Inference Propositional Logic First-order logic Vumpus World

7.5.2 Proof by Resolution

Artificial Intelligence. Propositional logic

Knowledge Representation using First-Order Logic (Part III)

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

Logical Agents. Outline

(Part II) Reading: R&N Chapters 8, 9

KR: First Order Logic - Intro

Date Topic Readings Due 11/18 First-order logic Ch. 9 HW 6 11/25 First-order inference, Ch. 10 HW7 (Othello) 12/2 Planning. Chs. 11 & 12 HW8.

Formal Logic. The most widely used formal logic method is FIRST-ORDER PREDICATE LOGIC

Propositional and First-Order Logic

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

ITS336 Lecture 6 First-Order Logic

Logic. Introduction to Artificial Intelligence CS/ECE 348 Lecture 11 September 27, 2001

Propositional Logic: Logical Agents (Part I)

First-Order Logic. Doug Downey Northwestern EECS 348 Intro to AI Based on slides by Stuart Russell

Logical Agents. Propositional Logic [Ch 6] Syntax, Semantics, Entailment, Derivation. Predicate Calculus Representation [Ch 7]

Principles of Intelligent Systems: Situation Calculus

Introduc)on to Ar)ficial Intelligence

Knowledge and reasoning 2

Logical Agent & Propositional Logic

Inf2D 06: Logical Agents: Knowledge Bases and the Wumpus World

Propositional Logic: Logical Agents (Part I)

Inference in first-order logic

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

Propositional Logic Not Enough

Logic. Stephen G. Ware CSCI 4525 / 5525

Logical Agent & Propositional Logic

Guest Speaker. CS 416 Artificial Intelligence. First-order logic. Diagnostic Rules. Causal Rules. Causal Rules. Page 1

Intelligent Agents. Pınar Yolum Utrecht University

Deliberative Agents Knowledge Representation II. First Order Predicate Logic

Logical Agents. Chapter 7

Foundations of Artificial Intelligence

CSCI-495 Artificial Intelligence. Lecture 17

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

Introduction to Intelligent Systems

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Artificial Intelligence Chapter 7: Logical Agents

Outline. Why FOL? Syntax and semantics of FOL Using FOL. Knowledge engineering in FOL

Class Assignment Strategies

CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents

Knowledge-based Agents. CS 331: Artificial Intelligence Propositional Logic I. Knowledge-based Agents. Outline. Knowledge-based Agents

Logic & Logic Agents Chapter 7 (& background)

Proof Methods for Propositional Logic

Logic: First Order Logic (Part I)

CS:4420 Artificial Intelligence

Introduction to Intelligent Systems

Logical Agents. Santa Clara University

7 LOGICAL AGENTS. OHJ-2556 Artificial Intelligence, Spring OHJ-2556 Artificial Intelligence, Spring

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

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

From Propositional Logic to First-Order Logic. Peter Antal

Artificial Intelligence

CS 771 Artificial Intelligence. Propositional Logic

Logical Agents (I) Instructor: Tsung-Che Chiang

7. Logical Agents. COMP9414/ 9814/ 3411: Artificial Intelligence. Outline. Knowledge base. Models and Planning. Russell & Norvig, Chapter 7.

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Revised by Hankui Zhuo, March 21, Logical agents. Chapter 7. Chapter 7 1

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

Logic & Logic Agents Chapter 7 (& Some background)

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

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

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

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

Logic. (Propositional Logic)

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

Logical Agents. CITS3001 Algorithms, Agents and Artificial Intelligence. 2018, Semester 2

Introduction to Artificial Intelligence. Logical Agents

Transcription:

Propositional logic First-Order Logic Russell and Norvig Chapter 8 Propositional logic is declarative Propositional logic is compositional: meaning of B 1,1 P 1,2 is derived from meaning of B 1,1 and of P 1,2 Meaning in propositional logic is context-independent unlike natural language, where meaning depends on context Propositional logic has limited expressive power Unlike natural language E.g., cannot say "pits cause breezes in adjacent squares (except by writing one sentence for each square) October 12, 2009 2 First Order Logic Examples of things we can say: All men are mortal: x Man(x) Mortal(x) Everybody loves somebody x y Loves(x, y) The meaning of the word above x y above(x,y) (on(x,y) z (on(x,z) above(z,y)) First Order logic Whereas propositional logic assumes the world contains facts, first-order logic (like natural language) assumes the world contains Objects: people, houses, numbers, colors, Relations: red, round, prime, brother of, bigger than, part of, Functions: father-of, plus, October 12, 2009 3 October 12, 2009 4 Logics in General Ontological Commitment: What exists in the world TRUTH PL : facts hold or do not hold. FOL : objects with relations between them that hold or do not hold Epistemoligical Commitment: state of knowledge allowed with respect to a fact Syntax of FOL User defines these primitives: Constant symbols (i.e., the "individuals" in the world) E.g., Mary, 3 Function symbols (mapping individuals to individuals) E.g., father-of(mary) = John, color-of(sky) = Blue Predicate/relation symbols (mapping from individuals to truth values) E.g., greater(5,3), green(grass), color(grass, Green) October 12, 2009 5 October 12, 2009 6 1

Syntax (cont.) FOL supplies these primitives: Variable symbols. E.g., x,y Connectives. Same as in PL:,,,, Equality = Quantifiers: Universal ( ) and Existential ( ) Atomic sentences Atomic sentence = predicate (term 1,...,term n ) or term 1 = term 2 Term = function (term 1,...,term n ) or constant or variable Examples: Brother(KingJohn,RichardTheLionheart) Greater(Length(LeftLegOf(Richard)), Length(LeftLegOf(KingJohn))) October 12, 2009 7 October 12, 2009 8 Complex sentences Complex sentences are made from atomic sentences using connectives S, S 1 S 2, S 1 S 2, S 1 S 2, S 1 S 2 and by applying quantifiers. Examples: Sibling(KingJohn,Richard) Sibling(Richard,KingJohn) greater(1,2) less-or-equal(1,2) Truth in first-order logic Need to specify constant symbols objects predicate symbols relations function symbols functional relations An atomic sentence predicate(term 1,...,term n ) is true iff the objects referred to by term 1,...,term n are in the relation referred to by predicate. x,y Sibling(x,y) Sibling(y,x) October 12, 2009 9 October 12, 2009 10 Models for FOL: Example Models for FOL We can enumerate the models for a given KB vocabulary: Computing entailment by enumerating the models will not be easy!! October 12, 2009 11 October 12, 2009 12 2

Quantifiers Allow us to express properties of collections of objects instead of enumerating objects by name Universal: for all Existential: there exists Universal quantification <variables> <sentence> Everyone at CSU is smart: x At(x, CSU) Smart(x) x P is true in a model m iff P is true with x being each possible object in the model Roughly speaking, equivalent to the conjunction of instantiations of P At(KingJohn,CSU) Smart(KingJohn) At(Richard,CSU) Smart(Richard) At(CSU,CSU) Smart(CSU)... October 12, 2009 13 October 12, 2009 14 Using universal quantifiers Typically is the main connective with Do not make the following mistake: x At(x, CSU) Smart(x) means Everyone is at CSU and everyone is smart October 12, 2009 15 Existential quantification <variables> <sentence> Someone at CSU is smart: x At(x, CSU) Smart(x) x P is true in a model m iff P is true with x being some possible object in the model Roughly speaking, equivalent to the disjunction of instantiations of P At(KingJohn,CSU) Smart(KingJohn) At(Richard, CSU) Smart(Richard) At(CSU, CSU) Smart(CSU)... October 12, 2009 16 Existential quantification (cont.) Typically, is the main connective with Common mistake: using with : x At(x, CSU) Smart(x) When is this true? Properties of quantifiers x y is the same as y x x y is the same as y x x y is not the same as y x: x y Loves(x,y) There is a person who loves everyone in the world y x Loves(x,y) Everyone in the world is loved by at least one person Quantifier duality: each can be expressed using the other x Likes(x,IceCream) x Likes(x,IceCream) x Likes(x,Broccoli) x Likes(x,Broccoli) October 12, 2009 17 October 12, 2009 18 3

Equality term 1 = term 2 is true if and only if term 1 and term 2 refer to the same object E.g., definition of Sibling in terms of Parent: x,y Sibling(x,y) [ (x = y) m,f (m = f) Parent(m,x) Parent(f,x) Parent(m,y) Parent(f,y)] Interacting with FOL KBs Suppose a wumpus-world agent is using an FOL KB and perceives a smell and a breeze (but no glitter) at position [i,j]: Tell(KB,Percept([Smell,Breeze,NoGlitter],[i,j])) (= assertion) Ask(KB, a BestAction(a,[i,j])) (=query) I.e., does the KB entail some best action? Answering yes without the best action is not very helpful so: Answer: Yes, {a/shoot} : substitution (binding list) Ask(KB, α) returns some/all s such that KB entails SUBST(s, α). To determine good course of action: Ask(KB, Safe([1,3])) October 12, 2009 19 October 12, 2009 20 KB for wumpus world Perception [j,j] Percept(Breeze, [i,j]) Breezy([j,j]) Action [i,j] At([i,j]) Glitter([i,j]) BestAction(Grab, [i,j]) The wumpus world Squares are breezy near a pit: First define the concept of adjacency: x,y,a,b Adjacent([x,y],[a,b]) [a,b] {[x+1,y], [x-1,y],[x,y+1],[x,y-1]} Diagnostic rule: infer cause from effect i,j Breezy([i,j]) x,y Adjacent([i,j], [x,y]) Pit(x,y) Causal rule: infer effect from cause j,j Pit([i,j]) [ x,y Adjacent([i,j],[x,y]) Breezy([x,y])] How would we say that there is a single wumpus? October 12, 2009 21 October 12, 2009 22 Creating a KB using FOL 1. Identify the task (what will the KB be used for) 2. Assemble the relevant knowledge Knowledge acquisition. 3. Decide on a vocabulary of predicates, functions, and constants Translate domain-level knowledge into logic-level names. 4. Encode general knowledge about the domain 5. Encode a description of the specific problem instance 6. Pose queries to the inference procedure and get answers 7. Debug the knowledge base October 12, 2009 23 Examples The kinship domain Basic predicates: Female, Parent. Other predicates in this domain: One's mother is one's female parent m,c (Mother(c) = m) (Female(m) Parent(m,c)) x,y Sibling(x,y) [ (x = y) m,f (m = f) Parent(m,x) Parent(f,x) Parent(m,y) Parent(f,y)] A first cousin is a child of a parent s sibling x,y FirstCousin(x,y) p,ps Parent(p,x) Sibling(ps,p) Parent(ps,y) These are the axioms of the domain (they are also definitions since they use biconditionals). Some sentences are theorems -- they can be derived from the axioms: Sibling is symmetric x,y Sibling(x,y) Sibling(y,x) October 12, 2009 24 4

Examples (cont) The set domain Notation: {x s} is the set resulting from adding x to the set s. s Set(s) (s = {} ) ( x,s 2 Set(s 2 ) s = {x s 2 }) x,s {x s} = {} x,s x s [ y,s 2 } (s = {y s 2 } (x = y x s 2 ))] x,s x s s = {x s} s 1,s 2 s 1 s 2 ( x x s 1 x s 2 ) s 1,s 2 (s 1 = s 2 ) (s 1 s 2 s 2 s 1 ) x,s 1,s 2 x (s 1 s 2 ) (x s 1 x s 2 ) x,s 1,s 2 x (s 1 s 2 ) (x s 1 x s 2 ) Examples (cont) The natural numbers domain 0 is a natural number: NatNum(0) The successor of a natural number is a natural number: n NatNum(n) NatNum(S(n)) Constraints on the successor function: n (0 = S(n)) m,n m (m = n) (S(m) = S(n)) Defining addition: n NatNum(n) +(0, n) = n m,n NatNum(m) NatNum(n) +(S(m), n) = S(+(m,n)) October 12, 2009 25 October 12, 2009 26 5