CS 2710 Foundations of AI Lecture 12. Propositional logic. Logical inference problem

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

Inference in first-order logic

Logical agents. Chapter 7. Chapter 7 1

CS 380: ARTIFICIAL INTELLIGENCE

Logical Agents. Outline

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

Inference Methods In Propositional Logic

Knowledge Representation. Propositional logic

Propositional inference, propositional agents

A simple knowledge-based agent. Logical agents. Outline. Wumpus World PEAS description. Wumpus world characterization. Knowledge bases.

Inference Methods In Propositional Logic

Knowledge Representation. Propositional logic.

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

Intelligent Agents. Pınar Yolum Utrecht University

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

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

Logical Agents. Chapter 7

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

Proof Methods for Propositional Logic

Propositional Logic: Methods of Proof (Part II)

Logical agents. Chapter 7. Chapter 7 1

Propositional Logic: Methods of Proof (Part II)

Artificial Intelligence Chapter 7: Logical Agents

TDT4136 Logic and Reasoning Systems

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Last update: March 4, Logical agents. CMSC 421: Chapter 7. CMSC 421: Chapter 7 1

Artificial Intelligence

Artificial Intelligence

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

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

Inference in first-order logic. Production systems.

CS 771 Artificial Intelligence. Propositional Logic

CS:4420 Artificial Intelligence

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Propositional Resolution

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

Logical Agent & Propositional Logic

Lecture 6: Knowledge 1

CS 7180: Behavioral Modeling and Decision- making in AI

Deliberative Agents Knowledge Representation I. Deliberative Agents

Logical Agents: Propositional Logic. Chapter 7

Logical Agent & Propositional Logic

Advanced Topics in LP and FP

Propositional Logic: Methods of Proof (Part II)

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

Inference in Propositional Logic

Propositional logic II.

Logical Inference 2 rule based reasoning

Logical Agents. Chapter 7

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

Inference in first-order logic

Class Assignment Strategies

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

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

Inf2D 13: Resolution-Based Inference

Knowledge based Agents

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

Planning: situation calculus

Deductive Systems. Lecture - 3

Propositional Logic: Review

Knowledge-based systems

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

Logical Agents (I) Instructor: Tsung-Che Chiang

Propositional Logic: Bottom-Up Proofs

Introduction to Intelligent Systems

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Subbarao Kambhampati, Dieter Fox, Henry Kautz )

Introduction to Intelligent Systems

AI Programming CS S-09 Knowledge Representation

Lecture 7: Logical Agents and Propositional Logic

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Outline. Logic. Knowledge bases. Wumpus world characteriza/on. Wumpus World PEAS descrip/on. A simple knowledge- based agent

6. Logical Inference

Artificial Intelligence. Propositional logic

Part 1: Propositional Logic

Inference in first-order logic

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

Logical Agents. Santa Clara University

Adversarial Search & Logic and Reasoning

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Propositional Reasoning

Agents that reason logically

02 Propositional Logic

Learning Goals of CS245 Logic and Computation

Propositional Logic Part 1

Logical Agents. September 14, 2004

Lecture 7: Logic and Planning

Propositional Logic: Models and Proofs

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

Propositional Resolution

Part 1: Propositional Logic

7.5.2 Proof by Resolution

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope)

Propositional and First-Order Logic

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

Logic in AI Chapter 7. Mausam (Based on slides of Dan Weld, Stuart Russell, Dieter Fox, Henry Kautz )

CSCI-495 Artificial Intelligence. Lecture 17

Logical Agents. Outline

Language of Propositional Logic

Knowledge-based and Expert Systems - 1. Knowledge-based and Expert Systems - 2. Knowledge-based and Expert Systems - 4

Transcription:

CS 2710 Foundations of I ecture 12 ropositional logic ilos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square ogical inference problem ogical inference problem: Given: a knowledge base K (a set of sentences) and a sentence (called a theorem), oes a K semantically entail? K? In other words: In all interpretations in which sentences in the K are true, is also true? 1

ogical inference problem ogical inference problem: Given: a knowledge base K (a set of sentences) and a sentence (called a theorem), oes a K semantically entail? K pproaches to solve the logical inference problem: Truth-table approach Inference rules Conversion to ST Resolution refutation roperties of inference solutions Truth-table approach lind xponential in the number of variables Inference rules ore efficient any inference rules to cover logic Conversion to ST - Resolution refutation ore efficient Sentences must be converted into CNF One rule the resolution rule - is sufficient to perform all inferences 2

K in restricted forms If the sentences in the K are restricted to some special forms some of the sound inference rules may become complete xample: Horn form (Horn normal form) a clause with at most one positive literal ( ) ( C ) Can be written also as: ( ) (( C) ) Two inference rules that are sound and complete for Ks in the Horn normal form: Resolution odus ponens K in Horn form Horn form: a clause with at most one positive literal ( ) ( C ) Not all sentences in propositional logic can be converted into the Horn form K in Horn normal form: Two types of propositional statements: Rules ) ( 1 2 k ( 2 ( 1 k ) ) ( 1 2 k ) ropositional symbols: facts 3

Why K in Horn form is useful? K in Horn normal form: Rules (in implicative form): If then statements known to be true ) If Then ( 1 2 k 1. The stain of the organism is gram-positive, and 2. The morphology of the organism is coccus, and 3. The growth conformation of the organism is chains the identity of the organism is streptococcus Facts = propositions known to be true xamples: 1 or The stain of the organism is gram-positive Inferences: let us infer new true propositions, such as, or the identity of the organism is streptococcus in the rule conclusion These are referred as inferences on propositional symbols K in Horn form pplication of the resolution rule: Infers new facts from previous facts ( ), ( ), ( C) ( C) Resolution is sound and complete for inferences on propositional symbols for K in the Horn normal form (clausal form) Similarly, modus ponens is sound and complete when the HNF is written in the implicative form 4

Complexity of inferences for Ks in HNF uestion: How efficient the inferences in the HNF can be? nswer: Inference on propositional symbols rocedures linear in the size of the K in the Horn form exist. Size of a clause: the number of literals it contains. Size of the K in the HNF: the sum of the sizes of its elements. xample:,,( C),( C ),( C ),( F G) or,,( C),( C ),( C ),( F G) The size is: 12 Complexity of inferences for Ks in HNF How to do the inference on propositional symbols? If the HNF (is in the clausal form) we can apply resolution.,,( C),( C ),( C ),( F G) C C 5

Complexity of inferences for Ks in HNF How to do the inference on propositional symbols? If the HNF (is in the clausal form) we can apply resolution.,,( C),( C ),( C ),( F G) C C Inferred facts Complexity of inferences for Ks in HNF Features: very resolution is a positive unit resolution; that is, a resolution in which one clause is a positive unit clause (i.e., a proposition symbol).,,( C),( C ),( C ),( F G) C C 6

Complexity of inferences for Ks in HNF Features: t each resolution, the input clause which is not a unit clause is a logical consequence of the result of the resolution. (Thus, the input clause may be deleted upon completion of the resolution operation.),,( C),( C ),( C ),( F G) C C Complexity of inferences for Ks in HNF Features: t each resolution, the input clause which is not a unit clause is a logical consequence of the result of the resolution. (Thus, the input clause may be deleted upon completion of the resolution operation.),,( C),( C ),( C ),( F G) C C 7

Complexity of inferences for Ks in HNF Features: Following this deletion, the size of the K (the sum of the lengths of the remaining clauses) is one less than it was before the operation.),,( C),( C ),( C ),( F G) C C Complexity of inferences for Ks in HNF Features: Following the deletion, the size of the K (the sum of the lengths of the remaining clauses) is one less than it was before the operation.). Now let us see one more step,,( C),( C ),( C ),( F G) C C 8

Complexity of inferences for Ks in HNF Features: Following the deletion, the size of the K (the sum of the lengths of the remaining clauses) is one less than it was before the operation.) Now let us see one more step,,( C),( C ),( C ),( F G) C C Complexity of inferences for Ks in HNF Features: If n is the size of the K, then at most n positive unit resolutions may be performed on it.,,( C),( C ),( C ),( F G) C C 9

Complexity of inferences for Ks in HNF linear time resolution algorithm: The number of positive unit resolutions is limited to the size of the formula (n) ut to assure overall linear time we need to access each proposition in a constant time: ata structures indexed by proposition names may be accessed in constant time. (This is possible if the proposition names are number in a range (e.g., 1..n), so that array lookup is the access operation. If propositions are accessed by name, then a symbol table is necessary, and the algorithm will run in time O(n log(n)). Forward and backward chaining Two inference procedures based on modus ponens for Horn Ks: Forward chaining Idea: Whenever the premises of a rule are satisfied, infer the conclusion. Continue with rules that became satisfied. ackward chaining (goal reduction) Idea: To prove the fact that appears in the conclusion of a rule prove the premises of the rule. Continue recursively. oth procedures are complete for Ks in the Horn form!!! 10

Forward chaining example Forward chaining Idea: Whenever the premises of a rule are satisfied, infer the conclusion. Continue with rules that became satisfied. ssume the K with the following rules and facts: K: R1: C R2: R3: F1: F2: F3: C C F G Theorem:? Theorem: K: R1: R2: Forward chaining example C C R3: C F G F1: F2: F3: 11

Theorem: K: R1: R2: Forward chaining example C C R3: C F G F1: F2: F3: Rule R1 is satisfied. F4: C Theorem: K: R1: R2: Forward chaining example C C R3: C F G F1: F2: F3: Rule R1 is satisfied. F4: C Rule R2 is satisfied. F5: 12

13 CS 2740 Knowledge Representation Forward chaining fficient implementation: linear in the size of the K xample: Forward chaining Count the number of facts in the antecedent of the rule genda (facts)

14 Forward chaining Inferred facts decrease the count inferred Forward chaining New facts can be inferred when the count associated with a rule becomes 0 inferred add to agenda

15 Forward chaining Forward chaining

16 Forward chaining Forward chaining

ackward chaining example? C R2 K: R1: R2: C C R3: C F G F1: F2: F3: ackward chaining is more focused: tries to prove the theorem only ackward chaining example K: R1: C R2 R2: C R1 C R3: C F G F1: F2: F3: ackward chaining is more focused: tries to prove the theorem only 17

18 ackward chaining fficient implementation ackward chaining fficient implementation

19 ackward chaining fficient implementation ackward chaining fficient implementation

20 ackward chaining fficient implementation ackward chaining fficient implementation

21 ackward chaining fficient implementation ackward chaining fficient implementation

22 ackward chaining fficient implementation ackward chaining fficient implementation

Forward vs ackward chaining FC is data-driven, automatic, unconscious processing, e.g., object recognition, routine decisions ay do lots of work that is irrelevant to the goal C is goal-driven, appropriate for problem-solving, e.g., Where are my keys? How do I get into a h program? Complexity of C can be much less than linear in size of K K agents based on propositional logic ropositional logic allows us to build knowledge-based agents capable of answering queries about the world by inferring new facts from the known ones xample: an agent for diagnosis of a bacterial disease Facts: Rules: The stain of the organism is gram-positive The growth conformation of the organism is chains (If) (Then) The stain of the organism is gram-positive The morphology of the organism is coccus The growth conformation of the organism is chains The identity of the organism is streptococcus 23