Kecerdasan Buatan M. Ali Fauzi

Similar documents
Introduction to Artificial Intelligence. Logical Agents

Logical Agents. Outline

Intelligent Agents. Pınar Yolum Utrecht University

Logical Agents. Chapter 7

Logical agents. Chapter 7. Chapter 7 1

TDT4136 Logic and Reasoning Systems

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

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

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

Class Assignment Strategies

Artificial Intelligence

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

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

Logic. proof and truth syntacs and semantics. Peter Antal

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Logical Agents: Propositional Logic. Chapter 7

Artificial Intelligence

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

Logical Agent & Propositional Logic

Logical Agents. Outline

Artificial Intelligence Chapter 7: Logical Agents

Logical Agent & Propositional Logic

Lecture 6: Knowledge 1

Lecture 7: Logical Agents and Propositional Logic

CS 188: Artificial Intelligence Spring 2007

Logical Agents. Chapter 7

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

CS 380: ARTIFICIAL INTELLIGENCE LOGICAL AGENTS. Santiago Ontañón

CS 771 Artificial Intelligence. Propositional Logic

CS 380: ARTIFICIAL INTELLIGENCE

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

Proof Methods for Propositional Logic

Logical agents. Chapter 7. Chapter 7 1

Propositional Logic: Logical Agents (Part I)

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

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

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

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

CS:4420 Artificial Intelligence

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Logical Agents (I) Instructor: Tsung-Che Chiang

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

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

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

Propositional Logic: Logical Agents (Part I)

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

Foundations of Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

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

Adversarial Search & Logic and Reasoning

Logical Agents. Santa Clara University

Introduction to Intelligent Systems

Introduction to Intelligent Systems

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

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

Lecture 7: Logic and Planning

Artificial Intelligence. Propositional logic

Knowledge- Based Agents. Logical Agents. Knowledge Base. Knowledge- Based Agents 10/7/09

Logic & Logic Agents Chapter 7 (& background)

Introduction to Arti Intelligence

Logic: Propositional Logic (Part I)

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

Logical Agents. Course material: Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

Logical Agents. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

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

Logic & Logic Agents Chapter 7 (& Some background)

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Inference in Propositional Logic

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

Propositional Logic: Methods of Proof (Part II)

CS:4420 Artificial Intelligence

Propositional Logic: Methods of Proof (Part II)

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

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

CS 4700: Artificial Intelligence

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

Logical Agents. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 7

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

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

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

Inference Methods In Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Agents that reason logically

Inference Methods In Propositional Logic

Propositional Logic: Methods of Proof (Part II)

CS 7180: Behavioral Modeling and Decision- making in AI

AI Programming CS S-09 Knowledge Representation

20/c/applet/more.html Local Beam Search The best K states are selected.

Part 1: Propositional Logic

Logical Agents. Administrative. Thursday: Midterm 1, 7p-9p. Next Tuesday: DOW1013: Last name A-M DOW1017: Last name N-Z

Logic and Inferences

Propositional inference, propositional agents

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Artificial Intelligence Knowledge Representation I

Overview. Knowledge-Based Agents. Introduction. COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Deliberative Agents Knowledge Representation I. Deliberative Agents

Artificial Intelligence

Transcription:

Kecerdasan Buatan M. Ali Fauzi

Artificial Intelligence M. Ali Fauzi

Logical Agents M. Ali Fauzi

In which we design agents that can form representations of the would, use a process of inference to derive new representations about the world, and use these new representations to deduce what to do.

TODAY

~ Knowledge-based agents

~ Knowledge-based agents ~ Wumpus world

~ Knowledge-based agents ~ Wumpus world ~ Logic in general - models and entailment

~ Knowledge-based agents ~ Wumpus world ~ Logic in general - models and entailment ~ Propositional (Boolean) logic

~ Knowledge-based agents ~ Wumpus world ~ Logic in general - models and entailment ~ Propositional (Boolean) logic ~ Inference rules and theorem proving

Knowledge-based agents

Problem Solving Agent Knowledge-based Agent VS

Problem Solving Agent ~ choose a solution among the available possibilities ~ The knowledge is very specific and inflexible. What he "knew" about the world does not evolve ~ problem solution (initial state, successor function, goal test)

Knowledge-based Agent ~ smarter ~ The knowledge is very flexible. What he "knew" about the world evolve ~ can do reasoning for ; - imperfect/partial information - Choosing better action

Knowledge-based Agent ~ Can represent world, state, action, etc. ~ Can percept new information (and update the representation) ~ Can deduce implicit knowledge (hidden property) ~ Can deduce the best action

Knowledge-based Agent

Knowledge Base ~ The central component of a knowledge-based agent is its knowledge base, or KB

Knowledge-base ~ What agent knew ~ a set of sentences. ~ Each sentence is expressed in a formal language (so it can be processed) called a knowledge representation language ~ Each sentence represents some fact about the world.

Knowledge-base ~ There must be a way to add new sentences to the knowledge base and a way to query what is known. ~ KB (TELL) : add new sentences to the KB ~ KB (ASK) : asking what the best action based on KB

Inference Engine ~ Deduce new facts that can be derived from the knowledge that already exists in KB ~ update the new representation from the new fact (TELL) ~ asking what the best action based on KB (ASK)

Knowledge-based Agent

Knowledge-based Agent ~ Knowledge Level : what he knows? a robot "knows" that the A building is between E building and C building

Knowledge-based Agent ~ Implementation level : how is the representation - Logical sentence: between(gda,gde,gdc) - Natural language: Gedung A ada di antara gedung E dan gedung C - Building coordinate location - Filkom maps (bitmap? vector?) ~ Representation is very influential on what can be done by inference engine

Declarative approach to building an agent ~ Tell it what it needs to know ~ Then it can ask itself what to do - answers follow from the knowledge base

Procedural approach to building an agent ~ Tell it what to do ~ If the program is not correct? (error?)

Knowledge representation ~ Expressive: can represent facts about the world ~ Tractable: can be processed by the inference engine

Knowledge is power Representation + Reasoning = Intelligence!!

Wumpus World

Wumpus World PEAS description Performance measure gold +1000, death -1000-1 per step, -10 for using the arrow Environment Squares adjacent to wumpus are smelly Squares adjacent to pit are breezy Glitter iff gold is in the same square Shooting kills wumpus if you are facing it Shooting uses up the only arrow Grabbing picks up gold if in same square Releasing drops the gold in same square Actuators Left turn, Right turn, Forward, Grab, Release, Shoot Sensors Breeze, Glitter, Smell 4 3 2 1 Stench Breeze Stench Gold Stench Breeze START Breeze PIT Breeze PIT PIT Breeze Breeze 1 2 3 4 B. Beckert: KI für IM p.4

Wumpus World Characterization Observable Deterministic Episodic Static Discrete Single agent B. Beckert: KI für IM p.5

Wumpus World Characterization Observable No only local perception Deterministic Episodic Static Discrete Single agent B. Beckert: KI für IM p.5

Wumpus World Characterization Observable Deterministic No only local perception Yes outcome of action exactly specified Episodic Static Discrete Single agent B. Beckert: KI für IM p.5

Wumpus World Characterization Observable Deterministic Episodic No only local perception Yes outcome of action exactly specified No sequential at the level of actions Static Discrete Single agent B. Beckert: KI für IM p.5

Wumpus World Characterization Observable Deterministic Episodic Static No only local perception Yes outcome of action exactly specified No sequential at the level of actions Yes wumpus and pits do not move Discrete Single agent B. Beckert: KI für IM p.5

Wumpus World Characterization Observable Deterministic Episodic Static Discrete No only local perception Yes outcome of action exactly specified No sequential at the level of actions Yes wumpus and pits do not move Yes Single agent B. Beckert: KI für IM p.5

Wumpus World Characterization Observable Deterministic Episodic Static Discrete Single agent No only local perception Yes outcome of action exactly specified No sequential at the level of actions Yes wumpus and pits do not move Yes Yes wumpus is essentially a natural feature B. Beckert: KI für IM p.5

Exploring a Wumpus World OK OK A OK B. Beckert: KI für IM p.6

Exploring a Wumpus World B OK A OK OK A B. Beckert: KI für IM p.6

Exploring a Wumpus World P? B OK P? A OK OK A B. Beckert: KI für IM p.6

Exploring a Wumpus World P? B OK P? A OK S OK A A B. Beckert: KI für IM p.6

Exploring a Wumpus World P P? B A OK P? OK A OK S A OK W B. Beckert: KI für IM p.6

Exploring a Wumpus World P P? B A OK P? OK A A OK S A OK W B. Beckert: KI für IM p.6

Exploring a Wumpus World P P? OK B A OK P? OK A OK OK S OK A A W B. Beckert: KI für IM p.6

Exploring a Wumpus World P P? OK B A OK P? OK A BGS A OK OK S OK A A W B. Beckert: KI für IM p.6

Problematic Situations P? Problem B A OK P? P? Breeze in (1,2) and (2,1) no safe actions A OK B A OK P? B. Beckert: KI für IM p.7

Problematic Situations P? Problem B A OK P? P? Breeze in (1,2) and (2,1) no safe actions Possible solution A OK B A OK P? Assuming pits uniformly distributed: (2,2) has pit with probability 0.86 (1,3) and (3,1) have pit with probab. 0.31 B. Beckert: KI für IM p.7

Problematic Situations Problem Smell in (1,1) no safe actions S A B. Beckert: KI für IM p.8

Problematic Situations Problem Smell in (1,1) no safe actions Possible solution S A Strategy of coercion: shoot straight ahead wumpus was there dead safe wumpus wasn t there safe B. Beckert: KI für IM p.8

Logic in General

Logic in General Logics Formal languages for representing information, such that conclusions can be drawn Syntax Defines the sentences in the language Semantics Defines the meaning of sentences; i.e., defines truth of a sentence in a world B. Beckert: KI für IM p.9

Example: Language of Arithmetic Syntax x + 2 y x2 + y > is a sentence is not a sentence B. Beckert: KI für IM p.10

Example: Language of Arithmetic Syntax x + 2 y x2 + y > is a sentence is not a sentence Semantics x + 2 y is true iff the number x + 2 is no less than the number y x + 2 y is true in a world where x = 7, y = 1 x + 2 y is false in a world where x = 0, y = 6 B. Beckert: KI für IM p.10

Entailment Definition Knowledge base KB entails sentence α if and only if α is true in all worlds where KB is true Notation KB = α B. Beckert: KI für IM p.11

Entailment Definition Knowledge base KB entails sentence α if and only if α is true in all worlds where KB is true Notation KB = α Note Entailment is a relationship between sentences (i.e., syntax) that is based on semantics B. Beckert: KI für IM p.11

Entailment Example The KB containing the shirt is green and the shirt is striped entails the shirt is green or the shirt is striped Example x + y = 4 entails 4 = x + y B. Beckert: KI für IM p.12

Models Intuition Models are formally structured worlds, with respect to which truth can be evaluated B. Beckert: KI für IM p.13

Models Intuition Models are formally structured worlds, with respect to which truth can be evaluated Definition m is a model of a sentence α if α is true in m M(α) is the set of all models of α Note KB = α if and only if M(KB) M(α) B. Beckert: KI für IM p.13

Models: Example KB = The shirt is green and striped α = The shirt is green M( ) M(KB) x x x x x x x x x x x x x x x x x x x x x x x x x xx x x x x x x x x x x x x x x x x x x x x B. Beckert: KI für IM p.14

Entailment in the Wumpus World Situation after detecting nothing in [1,1], moving right, breeze in [2,1]?? Consider possible models for? s (considering only pits) 3 Boolean choices A B A? 8 possible models B. Beckert: KI für IM p.15

Wumpus Models 2 2 PIT 1 Breeze PIT 1 Breeze 1 2 3 1 2 3 2 PIT 2 2 PIT 1 Breeze 1 2 3 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 2 PIT 2 PIT PIT 1 Breeze PIT 1 2 3 2 PIT PIT 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 B. Beckert: KI für IM p.16

Wumpus Models 2 2 PIT 1 Breeze PIT 1 Breeze KB 1 2 3 1 2 3 2 PIT 2 2 PIT 1 Breeze 1 2 3 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 2 PIT 2 PIT PIT 1 Breeze PIT 1 2 3 2 PIT PIT 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 KB = wumpus-world rules + observations B. Beckert: KI für IM p.16

Wumpus Models KB = α 1 2 2 PIT 1 Breeze PIT 1 Breeze KB 1 2 3 1 1 2 3 2 PIT 2 2 PIT 1 Breeze 1 2 3 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 2 PIT 2 PIT PIT 1 Breeze PIT 1 2 3 2 PIT PIT 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 KB = wumpus-world rules + observations α 1 = [1,2] is safe B. Beckert: KI für IM p.16

Wumpus Models 2 2 PIT 1 Breeze PIT 1 Breeze KB 1 2 3 1 2 3 2 PIT 2 2 PIT 1 Breeze 1 2 3 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 2 PIT 2 PIT PIT 1 Breeze PIT 1 2 3 2 PIT PIT 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 KB = wumpus-world rules + observations B. Beckert: KI für IM p.16

Wumpus Models KB = α 2 2 2 PIT KB 1 Breeze PIT 1 2 3 1 Breeze 1 2 3 2 2 PIT 2 2 PIT 1 Breeze 1 2 3 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 2 PIT 2 PIT PIT 1 Breeze PIT 1 2 3 2 PIT PIT 1 Breeze 1 2 3 1 Breeze PIT 1 2 3 KB = wumpus-world rules + observations α 2 = [2,2] is safe B. Beckert: KI für IM p.16

Inference Definition KB i α means sentence α can be derived from KB by inference procedure i B. Beckert: KI für IM p.17

Inference Definition KB i α means sentence α can be derived from KB by inference procedure i Soundness (of i) Whenever KB i α, it is also true that KB = α Completeness (of i) Whenever KB = α, it is also true that KB i α B. Beckert: KI für IM p.17

Preview First-order Logic We will define a logic (first-order logic) that is expressive enough to say almost anything of interest, and for which there exists a sound and complete inference procedure. That is, the procedure will answer any question whose answer follows from what is known by the KB. B. Beckert: KI für IM p.18

Propositional (Boolean) Logic

Propositional Logic: Syntax Definition Propositional symbols A, B, P 1, P 2, ShirtIsGreen, etc. are (atomic) sentences If S,S 1,S 2 are sentences, then S (negation) S 1 S 2 (con junction) S 1 S 2 (dis junction) S 1 S 2 (implication) S 1 S 2 (equivalence) are sentences B. Beckert: KI für IM p.19

Propositional logic: Semantics Propositional Models Each model specifies true/false for each proposition symbol B. Beckert: KI für IM p.20

Propositional logic: Semantics Propositional Models Each model specifies true/false for each proposition symbol Example A B C true true false (For three symbols, there are 8 possible models) B. Beckert: KI für IM p.20

Propositional logic: Semantics Propositional Models Each model specifies true/false for each proposition symbol Example A B C true true false (For three symbols, there are 8 possible models) Rules for evaluating truth with respect to a model S is true iff S is false S 1 S 2 is true iff S 1 is true and S 2 is true S 1 S 2 is true iff S 1 is true or S 2 is true S 1 S 2 is true iff S 1 is false or S 2 is true S 1 S 2 is true iff S 1 and S 2 have the same truth value B. Beckert: KI für IM p.20

Truth Tables for Connectives A B A A B A B A B A B false false true false false true true false true true false true true false true false false false true false false true true false true true true true B. Beckert: KI für IM p.21

Wumpus World Sentences Propositional symbols P i, j means: B i, j means: there is a pit in [i, j] there is a breeze in [i, j] P 1,1 B 1,1 B 2,1 B. Beckert: KI für IM p.22

Wumpus World Sentences Propositional symbols P i, j means: B i, j means: there is a pit in [i, j] there is a breeze in [i, j] P 1,1 B 1,1 B 2,1 Sentences Pits cause breezes in adjacent squares P 1,2 (B 1,1 B 1,3 B 2,2 ) A square is breezy if and only if there is an adjacent pit B 1,1 (P 1,2 P 2,1 ) B 2,1 (P 1,1 P 2,2 P 3,1 ) B. Beckert: KI für IM p.22

Propositional Inference: Enumeration Method Example α = A B KB = (A C) (B C) Checking that KB = α A B C A C B C KB α false false false false false true false true false false true true true false false true false true true true false true true true B. Beckert: KI für IM p.23

Propositional Inference: Enumeration Method Example α = A B KB = (A C) (B C) Checking that KB = α A B C A C B C KB α false false false false false false true true false true false false false true true true true false false true true false true true true true false true true true true true B. Beckert: KI für IM p.23

Propositional Inference: Enumeration Method Example α = A B KB = (A C) (B C) Checking that KB = α A B C A C B C KB α false false false false true false false true true false false true false false true false true true true true true false false true true true false true true false true true false true true true true true true true B. Beckert: KI für IM p.23

Propositional Inference: Enumeration Method Example α = A B KB = (A C) (B C) Checking that KB = α A B C A C B C KB α false false false false true false false false true true false false false true false false true false false true true true true true true false false true true true true false true true false false true true false true true true true true true true true true B. Beckert: KI für IM p.23

Propositional Inference: Enumeration Method Example α = A B KB = (A C) (B C) Checking that KB = α A B C A C B C KB α false false false false true false false false false true true false false false false true false false true false true false true true true true true true true false false true true true true true false true true false false true true true false true true true true true true true true true true true B. Beckert: KI für IM p.23

Propositional Inference: Enumeration Method Example α = A B KB = (A C) (B C) Checking that KB = α A B C A C B C KB α false false false false true false false false false true true false false false false true false false true false true false true true true true true true true false false true true true true true false true true false false true true true false true true true true true true true true true true true B. Beckert: KI für IM p.23

Propositional Inference: Enumeration Method Example α = A B KB = (A C) (B C) Checking that KB = α Note A B C A C B C KB α false false false false true false false false false true true false false false false true false false true false true false true true true true true true true false false true true true true true false true true false false true true true false true true true true true true true true true true true Table has 2 n rows for n symbols B. Beckert: KI für IM p.23

Logical Equivalence Definition Two sentences are logically equivalent, denoted by α β iff they are true in the same models, i.e., iff: α = β and β = α B. Beckert: KI für IM p.24

Logical Equivalence Definition Two sentences are logically equivalent, denoted by α β iff they are true in the same models, i.e., iff: α = β and β = α Example (A B) ( B A) (contraposition) B. Beckert: KI für IM p.24

Logical Equivalence Theorem If α β γ is the result of replacing a subformula α of δ by β, then γ δ B. Beckert: KI für IM p.25

Logical Equivalence Theorem If α β γ is the result of replacing a subformula α of δ by β, then γ δ Example A B B A implies (C (A B)) D (C (B A)) D B. Beckert: KI für IM p.25

Important Equivalences (α β) (β α) commutativity of (α β) (β α) commutativity of ((α β) γ) (α (β γ)) associativity of ((α β) γ) (α (β γ)) associativity of (α α) α idempotence for (α α) α idempotence for α α double-negation elimination (α β) ( β α) contraposition (α β) ( α β) implication elimination (α β) ((α β) (β α)) equivalence elimination (α β) ( α β) de Morgan s rules (α β) ( α β) de Morgan s rules (α (β γ)) ((α β) (α γ)) distributivity of over (α (β γ)) ((α β) (α γ)) distributivity of over B. Beckert: KI für IM p.26

The Logical Constants true and false Semantics true evaluates to true in all models false evaluates to false in all models B. Beckert: KI für IM p.27

The Logical Constants true and false Semantics true evaluates to true in all models false evaluates to false in all models Important equivalences with true and false (α α) false (α α) true tertium non datur (α true) α (α false) false (α true) true (α false) α B. Beckert: KI für IM p.27

Validity Definition A sentence is valid if it is true in all models Examples A A, A A, (A (A B)) B B. Beckert: KI für IM p.28

Validity Definition A sentence is valid if it is true in all models Examples A A, A A, (A (A B)) B Deduction Theorem (connects inference and validity) KB = α if and only if KB α is valid B. Beckert: KI für IM p.28

Satisfiability Definition A sentence is satisfiable if it is true in some model Examples A B, A, A (A B) B. Beckert: KI für IM p.29

Satisfiability Definition A sentence is satisfiable if it is true in some model Examples A B, A, A (A B) Definition A sentence is unsatisfiable if it is true in no models, i.e., if it is not satisfiable Example A A B. Beckert: KI für IM p.29

Satisfiability Theorem (connects validity and unsatisfiability) α is valid if and only if α is unsatisfiable B. Beckert: KI für IM p.30

Satisfiability Theorem (connects validity and unsatisfiability) α is valid if and only if α is unsatisfiable Theorem (connects inference and unsatisfiability) KB = α if and only if (KB α) is unsatisfiable B. Beckert: KI für IM p.30

Satisfiability Theorem (connects validity and unsatisfiability) α is valid if and only if α is unsatisfiable Theorem (connects inference and unsatisfiability) KB = α if and only if (KB α) is unsatisfiable Note Validity and inference can be proved by reductio ad absurdum B. Beckert: KI für IM p.30

Inference Rules and Theorem Proving

Two Kinds of Proof Methods 1. Application of inference rules Legitimate (sound) generation of new sentences from old Construction of / search for a proof (proof = sequence of inference rule applications) B. Beckert: KI für IM p.31

Two Kinds of Proof Methods 1. Application of inference rules Legitimate (sound) generation of new sentences from old Construction of / search for a proof (proof = sequence of inference rule applications) Properties Typically requires translation of sentences into a normal form B. Beckert: KI für IM p.31

Two Kinds of Proof Methods 1. Application of inference rules Legitimate (sound) generation of new sentences from old Construction of / search for a proof (proof = sequence of inference rule applications) Properties Typically requires translation of sentences into a normal form Different kinds Tableau calculus, resolution, forward/backward chaining,... B. Beckert: KI für IM p.31

Two Kinds of Proof Methods 2. Model checking Construction of / search for a satisfying model B. Beckert: KI für IM p.32

Two Kinds of Proof Methods 2. Model checking Construction of / search for a satisfying model Different kinds Truth table enumeration (always exponential number of symbols) Improved backtracking search for models e.g.: Davis-Putnam-Logemann-Loveland Heuristic search in model space e.g.: hill-climbing algorithms (sound but incomplete) B. Beckert: KI für IM p.32

Two Kinds of Proof Methods 2. Model checking Construction of / search for a satisfying model Different kinds Truth table enumeration (always exponential number of symbols) Improved backtracking search for models e.g.: Davis-Putnam-Logemann-Loveland Heuristic search in model space e.g.: hill-climbing algorithms (sound but incomplete) B. Beckert: KI für IM p.32

Normal Forms Literal A literal is an atomic sentence (propositional symbol), or the negation of an atomic sentence B. Beckert: KI für IM p.33

Normal Forms Literal A literal is an atomic sentence (propositional symbol), or the negation of an atomic sentence Clause A disjunction of literals B. Beckert: KI für IM p.33

Normal Forms Literal A literal is an atomic sentence (propositional symbol), or the negation of an atomic sentence Clause A disjunction of literals Conjunctive Normal Form (CNF) A conjunction of disjunctions of literals, i.e., a conjunction of clauses Example (A B) (B C D) B. Beckert: KI für IM p.33

Resolution Inference rule P 1 P i 1 Q P i+1... P k R 1 R j 1 Q R j+1... R n P 1 P i 1 P i+1... P k R 1 R j 1 R j+1... R n B. Beckert: KI für IM p.34

Resolution Inference rule P 1 P i 1 Q P i+1... P k R 1 R j 1 Q R j+1... R n P 1 P i 1 P i+1... P k R 1 R j 1 R j+1... R n Example P 1,3 P 2,2 P 2,2 P 1,3 P P? B OK A P? OK A A OK S A OK W B. Beckert: KI für IM p.34

Resolution Correctness theorem Resolution is sound and complete for propositional logic, i.e., given a formula α in CNF (conjunction of clauses): α is unsatisfiable iff the empty clause can be derived from α with resolution B. Beckert: KI für IM p.35

Conversion to CNF 0. Given B 1,1 (P 1,2 P 2,1 ) B. Beckert: KI für IM p.36

Conversion to CNF 0. Given B 1,1 (P 1,2 P 2,1 ) 1. Eliminate, replacing α β with (α β) (β α) (B 1,1 (P 1,2 P 2,1 )) ((P 1,2 P 2,1 ) B 1,1 ) B. Beckert: KI für IM p.36

Conversion to CNF 0. Given B 1,1 (P 1,2 P 2,1 ) 1. Eliminate, replacing α β with (α β) (β α) (B 1,1 (P 1,2 P 2,1 )) ((P 1,2 P 2,1 ) B 1,1 ) 2. Eliminate, replacing α β with α β ( B 1,1 P 1,2 P 2,1 ) ( (P 1,2 P 2,1 ) B 1,1 ) B. Beckert: KI für IM p.36

Conversion to CNF 0. Given B 1,1 (P 1,2 P 2,1 ) 1. Eliminate, replacing α β with (α β) (β α) (B 1,1 (P 1,2 P 2,1 )) ((P 1,2 P 2,1 ) B 1,1 ) 2. Eliminate, replacing α β with α β ( B 1,1 P 1,2 P 2,1 ) ( (P 1,2 P 2,1 ) B 1,1 ) 3. Move inwards using de Morgan s rules (and double-negation) ( B 1,1 P 1,2 P 2,1 ) (( P 1,2 P 2,1 ) B 1,1 ) B. Beckert: KI für IM p.36

Conversion to CNF 0. Given B 1,1 (P 1,2 P 2,1 ) 1. Eliminate, replacing α β with (α β) (β α) (B 1,1 (P 1,2 P 2,1 )) ((P 1,2 P 2,1 ) B 1,1 ) 2. Eliminate, replacing α β with α β ( B 1,1 P 1,2 P 2,1 ) ( (P 1,2 P 2,1 ) B 1,1 ) 3. Move inwards using de Morgan s rules (and double-negation) ( B 1,1 P 1,2 P 2,1 ) (( P 1,2 P 2,1 ) B 1,1 ) 4. Apply distributivity law ( over ) and flatten ( B 1,1 P 1,2 P 2,1 ) ( P 1,2 B 1,1 ) ( P 2,1 B 1,1 ) B. Beckert: KI für IM p.36

Resolution Example Given KB = (B 1,1 (P 1,2 P 2,1 )) B 1,1 α = P 1,2 B. Beckert: KI für IM p.37

Resolution Example Given KB = (B 1,1 (P 1,2 P 2,1 )) B 1,1 α = P 1,2 Resolution proof for KB = α Derive empty clause from KB α in CNF B. Beckert: KI für IM p.37

Resolution Example Given KB = (B 1,1 (P 1,2 P 2,1 )) B 1,1 α = P 1,2 Resolution proof for KB = α Derive empty clause from KB α in CNF P 2,1 B 1,1 B 1,1 P 1,2 P 2,1 P 1,2 B 1,1 B 1,1 P 1,2 B 1,1 P 1,2 B 1,1 P 1,2 P 2,1 P 1,2 B 1,1 P 2,1 B 1,1 P1,2 P 2,1 P 2,1 P 2,1 P 1,2 B. Beckert: KI für IM p.37

Summary Logical agents apply inference to a knowledge base to derive new information and make decisions B. Beckert: KI für IM p.38

Summary Logical agents apply inference to a knowledge base to derive new information and make decisions Basic concepts of logic syntax: formal structure of sentences semantics: truth of sentences w.r.t. models entailment: necessary truth of one sentence given another inference: deriving sentences from other sentences soundess: derivations produce only entailed sentences completeness: derivations can produce all entailed sentences B. Beckert: KI für IM p.38

Summary Logical agents apply inference to a knowledge base to derive new information and make decisions Basic concepts of logic syntax: formal structure of sentences semantics: truth of sentences w.r.t. models entailment: necessary truth of one sentence given another inference: deriving sentences from other sentences soundess: derivations produce only entailed sentences completeness: derivations can produce all entailed sentences Wumpus world requires the ability to represent partial and negated information, reason by cases, etc. B. Beckert: KI für IM p.38

Summary Logical agents apply inference to a knowledge base to derive new information and make decisions Basic concepts of logic syntax: formal structure of sentences semantics: truth of sentences w.r.t. models entailment: necessary truth of one sentence given another inference: deriving sentences from other sentences soundess: derivations produce only entailed sentences completeness: derivations can produce all entailed sentences Wumpus world requires the ability to represent partial and negated information, reason by cases, etc. Resolution is sound and complete for propositional logic B. Beckert: KI für IM p.38

Summary Logical agents apply inference to a knowledge base to derive new information and make decisions Basic concepts of logic syntax: formal structure of sentences semantics: truth of sentences w.r.t. models entailment: necessary truth of one sentence given another inference: deriving sentences from other sentences soundess: derivations produce only entailed sentences completeness: derivations can produce all entailed sentences Wumpus world requires the ability to represent partial and negated information, reason by cases, etc. Resolution is sound and complete for propositional logic Propositional logic lacks expressive power B. Beckert: KI für IM p.38