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

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

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 (FOL)

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

Lecture 8: (Predicate) First Order Logic

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

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

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

First Order Logic (FOL)

Reading: AIMA Chapter 9 (Inference in FOL)

CS:4420 Artificial Intelligence

First order logic (FOL) Chapters 8 & 9

CS 380: ARTIFICIAL INTELLIGENCE INFERENCE IN PROPOSITIONAL LOGIC

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

First-Order Logic. Peter Antal

First Order Logic. Philipp Koehn. 8 October 2015

Logic III. Introduction to Artificial Intelligence CSE 150

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

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

KR: First Order Logic - Intro

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

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

7.5.2 Proof by Resolution

Knowledge Representation using First-Order Logic (Part III)

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

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.

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

Artificial Intelligence. Propositional logic

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

Logical Agents. Outline

Propositional and First-Order Logic

Principles of Intelligent Systems: Situation Calculus

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

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

ITS336 Lecture 6 First-Order Logic

Propositional Logic: Logical Agents (Part I)

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

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

Knowledge and reasoning 2

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

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

Inference in first-order logic

Propositional Logic Not Enough

Logic. Stephen G. Ware CSCI 4525 / 5525

CS 771 Artificial Intelligence. First order Logic

Logical Agent & Propositional Logic

Propositional Logic: Logical Agents (Part I)

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

Logical Agent & Propositional Logic

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

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

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

Proof Methods for Propositional Logic

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

Intelligent Agents. Pınar Yolum Utrecht University

Logical Agents. Chapter 7

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

CS:4420 Artificial Intelligence

Introduc)on to Ar)ficial Intelligence

Introduction to Intelligent Systems

Logic: First Order Logic (Part I)

CSCI-495 Artificial Intelligence. Lecture 17

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Artificial Intelligence Chapter 7: Logical Agents

Deliberative Agents Knowledge Representation II. First Order Predicate Logic

Class Assignment Strategies

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

Logic & Logic Agents Chapter 7 (& background)

Artificial Intelligence

CS 771 Artificial Intelligence. Propositional Logic

Discrete Mathematics and Its Applications

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

Foundations of Artificial Intelligence

Logical Agents (I) Instructor: Tsung-Che Chiang

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

Introduction to Intelligent Systems

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

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

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

From Propositional Logic to First-Order Logic. Peter Antal

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

CS 380: ARTIFICIAL INTELLIGENCE

Syntax of FOL: Basic elements

Logical Agents. Santa Clara University

Logic. (Propositional Logic)

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

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

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

Lecture Overview [ ] Introduction to Artificial Intelligence COMP 3501 / COMP Lecture 6. Motivation. Logical Agents

Transcription:

Propositional logic First-Order Logic Russell and Norvig Chapter 8 J Propositional logic is declarative J 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 J Meaning in propositional logic is context-independent unlike natural language, where meaning depends on context L 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) CS440 Fall 2015 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, CS440 Fall 2015 3 CS440 Fall 2015 4 1

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) CS440 Fall 2015 5 CS440 Fall 2015 6 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))) CS440 Fall 2015 7 CS440 Fall 2015 8 2

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) CS440 Fall 2015 9 CS440 Fall 2015 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!! CS440 Fall 2015 11 CS440 Fall 2015 12 3

Quantifiers Universal quantification Allow us to express properties of collections of objects instead of enumerating objects by name Universal: for all Existential: there exists <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 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)... CS440 Fall 2015 13 CS440 Fall 2015 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 CS440 Fall 2015 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 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)... CS440 Fall 2015 16 4

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) CS440 Fall 2015 17 CS440 Fall 2015 18 Equality Interacting with FOL KBs 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)] Suppose a wumpus-world agent is using a 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, α). CS440 Fall 2015 19 CS440 Fall 2015 20 5

KB for wumpus world Perception t,s,g,m,c Percept([s,Breeze,g,m,c],t) Breeze(t) Action t Glitter(t) BestAction(Grab, t) The wumpus world Squares are breezy near a pit: First define the concept of adjacency: x,y,a,b Adjacent([x,y],[a,b]) (x = a (y=b-1 y=b+1)) (y=b (x=a-1 x=a+1)) Represent time with additional parameter At(Agent,s,t) means Agent at square s and time t Infer properties s,t At(Agent,s,t) Breeze(t) Breezy(s) How would we say that there is a single wumpus? CS440 Fall 2015 21 CS440 Fall 2015 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 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)) This means? x,y Sibling(x,y) [ (x = y) p Parent(p,x) Parent(p,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) CS440 Fall 2015 23 CS440 Fall 2015 24 6

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)) CS440 Fall 2015 25 7