CSCI-495 Artificial Intelligence. Lecture 17

Similar documents
First Order Logic (FOL)

First Order Logic (FOL)

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

Chapter 8 First Order Logic

Proof Methods for Propositional Logic

Propositional Logic: Review

Artificial Intelligence. Propositional logic

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

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Intelligent Agents. Pınar Yolum Utrecht University

Logical Agent & Propositional Logic

CSCI 5582 Artificial Intelligence. Today 9/28. Knowledge Representation. Lecture 9

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

7.5.2 Proof by Resolution

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

CS 771 Artificial Intelligence. First order Logic

Artificial Intelligence Chapter 7: Logical Agents

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

CS 771 Artificial Intelligence. Propositional Logic

AI Programming CS S-09 Knowledge Representation

Logical Agents (I) Instructor: Tsung-Che Chiang

Logical Agents. Chapter 7

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

CS 380: ARTIFICIAL INTELLIGENCE

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

Artificial Intelligence Knowledge Representation I

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

Artificial Intelligence

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.

Inference Methods In Propositional Logic

Class Assignment Strategies

First-order logic. Chapter 8. Chapter 8 1

Logical Agent & Propositional Logic

Propositional and First-Order Logic

Inference Methods In Propositional Logic

CS 7180: Behavioral Modeling and Decision- making in AI

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

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

Artificial Intelligence

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

Propositional Logic: Methods of Proof (Part II)

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

Propositional Logic: Logical Agents (Part I)

CS 380: ARTIFICIAL INTELLIGENCE INFERENCE IN PROPOSITIONAL LOGIC

First-order logic. Chapter 8. Chapter 8 1

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

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

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

First-Order Logic. Chapter 8

Introduction to Intelligent Systems

Introduction to Intelligent Systems

TDT4136 Logic and Reasoning Systems

Nathan Sturtevant FOL

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Logical Agents. Outline

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

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

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Logical agents. Chapter 7. Chapter 7 1

First Order Logic Semantics (3A) Young W. Lim 9/17/17

First Order Logic Semantics (3A) Young W. Lim 8/9/17

First-Order Logic. Chapter 8

Knowledge based Agents

Propositional Logic: Logical Agents (Part I)

Propositional and First-Order Logic

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

CS:4420 Artificial Intelligence

Logical Agents: Propositional Logic. Chapter 7

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Agents that reason logically

Propositional Logic: Methods of Proof. Chapter 7, Part II

Logic. (Propositional Logic)

Introduction to Artificial Intelligence. Logical Agents

Propositional Logic: Methods of Proof (Part II)

Logical Agents. Chapter 7

Lecture 8: (Predicate) First Order Logic

Advanced Topics in LP and FP

Lecture 7: Logic and Planning

First-Order Logic. Chapter 8

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

Logical Agents. Santa Clara University

Knowledge Based Systems: Logic and Deduction

Kecerdasan Buatan M. Ali Fauzi

CS 4700: Foundations of Artificial Intelligence

Logic & Logic Agents Chapter 7 (& background)

Propositional Logic: Bottom-Up Proofs

Deliberative Agents Knowledge Representation I. Deliberative Agents

Chương 3 Tri th ức và lập luận

CSC242: Intro to AI. Lecture 13. Thursday, February 28, 13

Propositional Logic: Methods of Proof (Part II)

CS 188: Artificial Intelligence Spring 2007

CS 4700: Artificial Intelligence

Logic III. Introduction to Artificial Intelligence CSE 150

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. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

Artificial Intelligence: Knowledge Representation and Reasoning Week 2 Assessment 1 - Answers

First order logic (FOL) Chapters 8 & 9

Inference in Propositional Logic

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

Transcription:

CSCI-495 Artificial Intelligence Lecture 17

Tractable Inference: Horn Logic Resolution in general can be exponential in space and time For tractable inference we need a smaller logic Real-world KBs often contain only clauses of a restricted kind called Horn clauses A Horn clause is a disjunction of literals of which at most one is positive Equivalent to A B C B C A α β with α β (i.e., premise is a conjunction of positive literals, conclusion is a single positive literal)

Tractable Inference: Horn Logic Inference (via forward checking, backward checking) can be done in time linear in the size of the KB. Both of these algorithms are also very natural, in that the inference steps are obvious and easy to follow for humans Human knowledge has this form, easy and simple to write diagnostic rules expert system People find it easy to read and write sentences in this form for many domains of knowledge

Forward Chaining

Forward Chaining: Graph Representation OR Gate AND gate

Forward Chaining: Example

Forward Chaining: Example

Forward Chaining: Example

Forward Chaining: Example

Forward Chaining: Example

Forward Chaining: Example

Forward Chaining: Example

Forward Chaining: Example

Forward Chaining The time complexity of the algorithm is linear in the size of the KB It is easy to see that Forward Chaining is sound Every inference is essentially an application of Modus Ponens

Forward Chaining An example of data-driven reasoning In humans, a certain amount of data-driven reasoning as new information arrives I hear rain starting to fall It might occur to me that the picnic will be cancelled It will probably not occur to me that the seventeenth petal on the largest rose in my neighbor s garden will get wet We keep Forward Chaining under careful control

Backward Chaining A form of goal-directed reasoning Where are my keys? Often the cost of Backward Chaining is much less that linear in the size of the KB because the process touches only relevant facts Idea: work backwards from the query q check if q is known already, or prove by BC all premises of some rule concluding q Hence BC maintains a stack of sub-goals that need to be proved to get to q Like FC, is linear and is also sound and complete (for Horn KB)

A Propositional Logic Wumpus Hunter It begins with a KB that states the physics of the wumpus world It knows that [1,1] does not contain a pit or wumpus (2 sentences) P 1,1 and W 1,1 for every square [x, y], how a breeze arises (16 sentences) B x,y (P x,y+1 v P x,y-1 v P x+1,y v P x-1,y ) for every square [x, y], how a stench arises (16 sentences) S x,y (W x,y+1 v W x,y-1 v W x+1,y v W x-1,y ) there is exactly one wumpus W 1,1 v W 1,2 v v W 4,3 v W 4,4 (to say at least one) W 1,1 v W 1,2 for any two squares (to say at most one) (121 sentences) A total of 155 sentences for 4x4 world

Propositional Logic is a weak language Hard to identify individuals (e.g., Mary, 3) Can t directly talk about properties of individuals or relations between individuals (e.g., Bill is tall ) Generalizations, patterns, regularities can t easily be represented (e.g., all triangles have 3 sides )

First-Order Logic Propositional logic assumes the world contains facts First-order logic (like natural language) assumes the world contains Objects: people, houses, numbers, colors, baseball games, wars, Relations: red, round, prime, brother of, bigger than, part of, comes between, Functions: father of, best friend, one more than, plus,

First-Order Logic Almost any assertion can be thought as referring to objects and properties or relations One plus two equals three Squares neighboring the wumpus are smelly Evil King John ruled England in 1200

Models for FOL Remember that the models of a logical language are the formal structures that constitute the possible worlds under consideration (e.g., in PL, sets of truth values of the propositional symbols) Models in FOL have objects in them! The domain of a model is the set of objects it contains (i.e., the domain elements) The domain elements may be related in various ways. A relation is just the set of tuples of objects that are related

Models for FOL: Example Objects? Relations? Functions?

Syntax of FOL: Basic elements Constant Symbols Stand for objects e.g., KingJohn, 2, StFX,... Predicate Symbols Stand for relations E.g., Brother(Richard, John), greater_than(3,2)... Function Symbols Stand for functions E.g., Sqrt(3), LeftLegOf(John),...

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

Relations Some relations are properties: they state some fact about a single object Round(ball), Prime(7) n-ary relations state facts about two or more objects Married(John,Mary), LargerThan(3,2) Some relations are functions: their value is another object Plus(2,3), Father(Dan)

Terms Term = logical expression that refers to an object There are 2 kinds of terms: constant symbols: Table, Computer function symbols: LeftLeg(Pete), Sqrt(3), Plus(2,3) etc

Atomic Sentences An atomic sentence, which has value true or false, states a fact and is an n-place predicate of n terms LargerThan(3,2) Brother_of(Pete,Mary) Married(Father(Richard), Mother(John)) Note: Functions do not state facts and form no sentence: Brother(Pete) refers to John (his brother) and is neither true nor false

Complex Sentences We make complex sentences with connectives (just like in propositional logic) property Brother ( LeftLeg ( Richard ), John ) ( Democrat ( Bush)) binary relation function objects connectives

More Examples Brother(Richard, John) Brother(John, Richard) King(Richard) King(John) King(John) => King(Richard) LessThan(Plus(1,2),4) GreaterThan(2,1) (Semantics are the same as in propositional logic)

Variables Person(John) is true or false because we give it a single argument John We can be much more flexible if we allow variables which can take on values in a domain E.g., all persons x, all integers i, etc. E.g., can state rules like Person(x) => HasHead(x) or Integer(i) => Integer(plus(i,1))