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

Similar documents
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

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:

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. First-order logic. Logics in general. Outline. Syntax of FOL: Basic elements. Pros and cons of propositional logic

First-order logic. Chapter 8. Chapter 8 1

Lecture 8: (Predicate) First Order Logic

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

First order logic (FOL) Chapters 8 & 9

CS:4420 Artificial Intelligence

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

CS 380: ARTIFICIAL INTELLIGENCE INFERENCE IN PROPOSITIONAL LOGIC

First-Order Logic. Peter Antal

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

First Order Logic (FOL)

First Order Logic (FOL)

Knowledge Representation using First-Order Logic (Part III)

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

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

Logic III. Introduction to Artificial Intelligence CSE 150

Reading: AIMA Chapter 9 (Inference in FOL)

First Order Logic. Philipp Koehn. 8 October 2015

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

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

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

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

CS 771 Artificial Intelligence. First order Logic

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

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.

CSCI-495 Artificial Intelligence. Lecture 17

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

From Propositional Logic to First-Order Logic. Peter Antal

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

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

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

Rational Agents. Paolo Turrini. Introduction to Artificial Intelligence 2nd Part. Department of Computing, Imperial College London

Logical Agents. Outline

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

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

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

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

Artificial Intelligence. Propositional logic

Logic: First Order Logic (Part I)

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

Principles of Intelligent Systems: Situation Calculus

ITS336 Lecture 6 First-Order Logic

Intelligent Agents. Pınar Yolum Utrecht University

RN, Chapter 8 Predicate Calculus 1

Syntax of FOL: Basic elements

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

CS:4420 Artificial Intelligence

Introduction to Artificial Intelligence. Logical Agents

Logic: First Order Logic

Logical Agents. Chapter 7

Logic. Stephen G. Ware CSCI 4525 / 5525

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

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

Artificial Intelligence Chapter 7: Logical Agents

Foundations of Artificial Intelligence

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

Logical Agent & Propositional Logic

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Kecerdasan Buatan M. Ali Fauzi

KR: First Order Logic - Intro

Introduc)on to Ar)ficial Intelligence

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

Logical Agent & Propositional Logic

Propositional Logic: Logical Agents (Part I)

Agents that reason logically

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Introduction to Intelligent Systems

7.5.2 Proof by Resolution

Introduction to Intelligent Systems

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

Class Assignment Strategies

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

Logic. proof and truth syntacs and semantics. Peter Antal

TDT4136 Logic and Reasoning Systems

Logical agents. Chapter 7. Chapter 7 1

Logic & Logic Agents Chapter 7 (& background)

Deliberative Agents Knowledge Representation II. First Order Predicate Logic

CS 188: Artificial Intelligence Spring 2007

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

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

Knowledge Based Systems: Logic and Deduction

Artificial Intelligence

Inference in first-order logic

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

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

Logical Agents: Propositional Logic. Chapter 7

Logical Agents (I) Instructor: Tsung-Che Chiang

Lecture 7: Logical Agents and Propositional Logic

CS 4700: Artificial Intelligence

Transcription:

First-Order Logic R&N: 8.1-8.3 Michael Rovatsos University of Edinburgh 4 February 2016

Outline Why FOL? Syntax and semantics of FOL Using FOL Wumpus world in FOL

Pros and cons of propositional logic Propositional logic is declarative Propositional logic allows partial/disjunctive/negated information (unlike most data structures and databases) Propositional logic is compositional: The meaning of B 1,1 P 1,2 is derived from that 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 very limited expressive power (unlike natural language) for example, we cannot say "pits cause breezes in adjacent squares, except by writing one sentence for each square

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, colours, football games, wars, Relations: red, round, prime, brother of, bigger than, part of, comes between, Functions: father of, best friend, one more than, plus,

Syntax of FOL: Basic elements Constants KingJohn, 2, UoE,... Predicates Brother, >,... Functions Sqrt, LeftLegOf,... Variables x, y, a, b,... Connectives,,,, Equality = Quantifiers,

Atomic formulae Atomic formula = predicate (term 1,...,term n ) or term 1 = term 2 Term = function (term 1,...,term n ) or constant or variable Examples: Brother(KingJohn,RichardTheLionheart) >(Length(LeftLegOf(Richard)), Length(LeftLegOf(KingJohn))) predicate functions constants

Complex formulae Complex formulae are made from atomic formulae using connectives Examples: S, S 1 S 2, S 1 S 2, S 1 S 2, S 1 S 2 Sibling(KingJohn,Richard) Sibling(Richard,KingJohn) >(1,2) (1,2) >(1,2) >(1,2)

Semantics of first-order logic Formulae are mapped to an interpretation An interpretation is called a model of a set of formulae when all the formulae are true in the interpretation. Interpretation contains objects (domain elements) and relations between them Mapping specifies referents for constant symbols objects predicate symbols relations function symbols functions An atomic formula 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.

Interpretations for FOL: Example

Universal quantification <variables>. <formula> But will often write x,y. P for x. y. Example: Everyone at UoE is smart: x. At(x,UoE) Smart(x) x. P is true in an interpretation m iff P is true with x being each possible object in the interpretation. Roughly speaking, equivalent to the conjunction of instantiations of P At(KingJohn,UoE) Smart(KingJohn) At(Richard,UoE) Smart(Richard) At(UoE,UoE) Smart(UoE)...

A common mistake to avoid Typically, is the main connective with Common mistake: using as the main connective with : x. At(x,UoE) Smart(x) means Everyone is at UoE and everyone is smart

Existential quantification <variables>. <formula> But will often write x,y. P for x. y. P Example: Someone at UoE is smart: x. At(x,UoE) Smart(x) x. P is true in an interpretation 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,UoE) Smart(KingJohn) At(Richard,UoE) Smart(Richard) At(UoE,UoE) Smart(UoE)

Another common mistake to avoid Typically, is the main connective with Common mistake: using as the main connective with : x. At(x,UoE) Smart(x) is true if there is anyone who is not at UoE!

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)

Equality term 1 = term 2 is true under a given interpretation if and only if term 1 and term 2 refer to the same object. Example. 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))

Using FOL Example: The kinship domain: Brothers are siblings x,y. Brother(x,y) Sibling(x,y) One's mother is one's female parent m,c. Mother(c) = m (Female(m) Parent(m,c)) Sibling is symmetric x,y. Sibling(x,y) Sibling(y,x)

Using FOL The set domain: s. Set(s) (s = {}) ( x,s 2. Set(s 2 ) s = {x s 2 }) x,s. {x s} = {} x,s. x s s = {x s} x,s. x s [ y,s 2. (s = {y s 2 } (x = y x s 2 ))] 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 )

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 t=5: Tell(KB, Percept([Smell,Breeze,None], 5)) Ask(KB, a. BestAction(a, 5)) i.e., does the KB entail some best action at t=5? Answer: Yes, {a/shoot} substitution (binding list) Given a sentence S and a substitution σ, Sσ denotes the result of plugging σ into S; e.g., S = Smarter(x, y) σ = {x/obama, y/palin} Sσ = Smarter(Obama, Palin) Ask(KB,S) returns some/all σ such that KB Sσ

Knowledge base for the wumpus world Perception t,s,b. Percept([s,b,Glitter],t) Glitter(t) Reflex t. Glitter(t) BestAction(Grab,t)

Deducing hidden properties x,y,a,b. Adjacent([x,y],[a,b]) [a,b] {[x+1,y], [x-1,y],[x,y+1],[x,y-1]} s,t. At(Agent,s,t) Breeze(t) Breezy(s) Squares are breezy near a pit: Diagnostic rule: infer cause from effect s. Breezy(s) r. Adjacent(r,s) Pit(r) Causal rule: infer effect from cause r. Pit(r) [ s. Adjacent(r,s) Breezy(s) ]

Summary First-order logic: objects and relations are semantic primitives syntax: constants, functions, predicates, equality, quantifiers Increased expressive power: sufficient to define wumpus world