KNOWLEDGE-BASED AGENTS INFERENCE

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

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

Logical Agents. Outline

Intelligent Agents. Pınar Yolum Utrecht University

Logical agents. Chapter 7. Chapter 7 1

TDT4136 Logic and Reasoning Systems

Logical Agents. Chapter 7

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

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

CS 330 Formal Methods and Models

Artificial Intelligence Chapter 7: Logical Agents

Logical Agent & Propositional Logic

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

Boolean algebra.

Introduction to Artificial Intelligence. Logical Agents

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

Class Assignment Strategies

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

Reasoning and programming. Lecture 5: Invariants and Logic. Boolean expressions. Reasoning. Examples

Artificial Intelligence

Logical Agent & Propositional Logic

Kecerdasan Buatan M. Ali Fauzi

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

Logic. proof and truth syntacs and semantics. Peter Antal

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Lecture 7: Logic and Planning

Lecture 6: Knowledge 1

Logical Agents: Propositional Logic. Chapter 7

Logical Agents. Outline

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

Software Engineering using Formal Methods

Equality and Inequality in the Dataflow Algebra. A. J. Cowling

Proof Methods for Propositional Logic

Handout: Natural deduction for first order logic

Artificial Intelligence. Propositional logic

Boolean Algebra. Boolean Algebras

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

Artificial Intelligence

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

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS

CS 771 Artificial Intelligence. Propositional Logic

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Propositional Logic: Logical Agents (Part I)

Lecture 2 : Propositions DRAFT

Chapter 14. Matrix Representations of Linear Transformations

Fachgebiet Rechnersysteme1. 1. Boolean Algebra. 1. Boolean Algebra. Verification Technology. Content. 1.1 Boolean algebra basics (recap)

Hennessy-Milner Logic 1.

Introduction to Intelligent Systems

CS 330 Formal Methods and Models Dana Richards, George Mason University, Spring 2016 Quiz Solutions

CS:4420 Artificial Intelligence

Introduction to Intelligent Systems

Lecture 7: Logical Agents and Propositional Logic

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

CS 380: ARTIFICIAL INTELLIGENCE

Logical Agents. Chapter 7

Temporal logic CTL : syntax. Communication and Concurrency Lecture 6. Φ ::= tt ff Φ 1 Φ 2 Φ 1 Φ 2 [K]Φ K Φ AG Φ EF Φ AF Φ EG Φ A formula can be

Closure Properties of Regular Languages

The Regulated and Riemann Integrals

Revision Sheet. (a) Give a regular expression for each of the following languages:

DATA Search I 魏忠钰. 复旦大学大数据学院 School of Data Science, Fudan University. March 7 th, 2018

Introduction to Group Theory

Logical agents. Chapter 7. Chapter 7 1

Strong Bisimulation. Overview. References. Actions Labeled transition system Transition semantics Simulation Bisimulation

CS 188: Artificial Intelligence Spring 2007

Coalgebra, Lecture 15: Equations for Deterministic Automata

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

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

19 Optimal behavior: Game theory

Logical Agents (I) Instructor: Tsung-Che Chiang

11.1 Finite Automata. CS125 Lecture 11 Fall Motivation: TMs without a tape: maybe we can at least fully understand such a simple model?

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

Genetic Programming. Outline. Evolutionary Strategies. Evolutionary strategies Genetic programming Summary

CS 188: Artificial Intelligence Spring 2007

p-adic Egyptian Fractions

CS 275 Automata and Formal Language Theory

Math 4310 Solutions to homework 1 Due 9/1/16

Logic: Propositional Logic (Part I)

Finite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh

UNIFORM CONVERGENCE. Contents 1. Uniform Convergence 1 2. Properties of uniform convergence 3

Reinforcement learning II

MAA 4212 Improper Integrals

1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.

Lecture 9: LTL and Büchi Automata

CS 4700: Foundations of Artificial Intelligence

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

Lecture 08: Feb. 08, 2019

1 Nondeterministic Finite Automata

Properties of Integrals, Indefinite Integrals. Goals: Definition of the Definite Integral Integral Calculations using Antiderivatives

Regular expressions, Finite Automata, transition graphs are all the same!!

CS 330 Formal Methods and Models

Boolean Algebra. Boolean Algebra

Chapter 0. What is the Lebesgue integral about?

CS 267: Automated Verification. Lecture 8: Automata Theoretic Model Checking. Instructor: Tevfik Bultan

Logical Agents. Santa Clara University

Chapter 4 Contravariance, Covariance, and Spacetime Diagrams

CMSC 330: Organization of Programming Languages

Propositional Logic: Logical Agents (Part I)

How do we solve these things, especially when they get complicated? How do we know when a system has a solution, and when is it unique?

Types of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2

New data structures to reduce data size and search time

Transcription:

AGENTS THAT REASON LOGICALLY KNOWLEDGE-BASED AGENTS Two components: knowledge bse, nd n inference engine. Declrtive pproch to building n gent. We tell it wht it needs to know, nd It cn sk itself wht to do; nswers follow from the knowledge bse. Two views: Knowledge level or wht gents know Implementtion level or how the knowledge is ctully orgnized (dt structures nd lgorithms). A knowledge bsed gent must be ble to Represent sttes, ctions, etc. Incorporte new knowledge (percepts). Updte internl representtion of the world. Deduce unknown properties of the world. Deduce pproprite ctions. Our gents will use for ll of these (forml) logic, i.e., forml lnguges for representing informtion such tht conclusions cn be drwn. Syntx defines the sentences in lnguge Semntics defines the mening of the sentences,i.e., the mening of truth. Lnguge Ontologicl Commitment Epistemologicl Commitment (wht exists) (sttes of knowledge) Propositionl logic fcts true/flse/unknown First-order logic fcts, objects, reltions true/flse/unknown Temporl logic fcts, objects, reltions, time true/flse/unknown Probbility theory fcts degree of belief 0... 1 Fuzzy logic degree of truth degree of belief 0... 1 PROPOSITIONAL LOGIC/1 PROPOSITIONAL LOGIC/2 ENTAILMENT AND MODELS INFERENCE KB α: Knowledge bse KB entils sentence α iff α is true in ll the worlds in which KB is true. KB contining Reds won nd Expos won entils Either Reds or Expos won. m is model of sentence α if α is true in m. M(α) is the set of ll models of α. Then KB α iff M(KB) M(α). KB i α: sentence α cn be derived (inferred) from KB by procedure i. Soundness i is sound if, whenever KB i α it is lso true tht KB α. Completeness i is complete if, whenever KB α it is lso true tht KB i α. We will present eventully logic which is expressive enough (we cn sy lmost nything of interest using it), nd for which there exists complete nd sound inference procedure. KB = Reds won nd Expos won ; α = Expos won PROPOSITIONAL LOGIC/3 PROPOSITIONAL LOGIC/4

PROPOSITIONAL LOGIC The simplest logic illustrtes bsic ides Syntx: An elementry proposition is symbol (bstrct sense) If S is sentence, S (\+S) is sentence If S 1 nd S 2 re sentences, S 1 S 2 (S1, S2) is sentence If S 1 nd S 2 re sentences, S 1 S 2 (S1; S2) is sentence If S 1 nd S 2 re sentences, S 1 S 2 (S2 :- S1) is sentence If S 1 nd S 2 re sentences, S 1 S 2 is sentence Nothing else is sentence. Semntics: A model specifies the true/flse vlue for ech propositionl symbol. There re rules to specify truth vlues of compound propositions with respect to model m: S is true iff S is flse S 1 S 2 is true iff both S 1 nd S 2 re 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 flse or S 2 is true i.e., is flse iff S 1 is true nd S 2 is flse S 1 S 2 is true iff S 1 S 2 is true nd S 2 S 1 is true INFERENCE BY ENUMERATION Let α = A B nd KB = (A C) (B C) Is it the cse tht KB = α? Check ll possible models α must be true wherever KB is true: A B C A C B C KB α Flse Flse Flse Flse True Flse Flse Flse Flse True True Flse Flse Flse Flse True Flse Flse True Flse True Flse True True True True True True True Flse Flse True True True True True Flse True True Flse Flse True True True Flse True True True True True True True True True True True Other inference procedures use syntctic opertions on sentences, expressed in stndrdized forms. PROPOSITIONAL LOGIC/5 PROPOSITIONAL LOGIC/6 INFERENCE BY ENUMERATION NORMAL FORMS Let α = A B nd KB = (A C) (B C) Is it the cse tht KB = α? Check ll possible models α must be true wherever KB is true: A B C A C B C KB α Flse Flse Flse Flse True Flse Flse Flse Flse True True Flse Flse Flse Flse True Flse Flse True Flse True Flse True True True True True True True Flse Flse True True True True True Flse True True Flse Flse True True True Flse True True True True True True True True True True True Other inference procedures use syntctic opertions on sentences, expressed in stndrdized forms. Literl : propositionl symbol, or propositionl symbol negted. De Morgn rules : For ny propositions S 1 nd S 2, (S 1 S 2 ) is logiclly equivlent to S 1 S 2, nd (S 1 S 2 ) is equivlent to S 1 S 2. In ddition, ( S 1 ) is equivlent to S 1, nd both nd re ssocitive nd distributive with respect to ech other. Disjunctive norml form (DNF) (universl): Disjunction of conjunctions of literls. E.g., (A B) (A C) (A D) ( B C) ( B D) Conjunctive norml form (CNF), or clusl form (universl): conjunction of disjunctions of literls }{{} cluses E.g., (A B) (B C D) (E D) Horn Form (restricted): conjunction of Horn cluses, i.e., cluses with t most one positive (non-negted) literl. Also written s conjunction of implictions: A :- B. [nd] B :- C, D. [nd] E :- D. PROPOSITIONAL LOGIC/6 PROPOSITIONAL LOGIC/7

CLAUSAL FORM Any sentence (or KB) cn be trnsformed into set of cluses (clusl form). (( b) (c (d (f e)))) 1. Eliminte nd : α β is chnged to α β, nd α β is equivlent to (α β) (β α). ((( b) ( b )) ( c ( (d ( f e))))) 2. Apply De Morgn rules to move ll the negtions in, nd remove double negtions. (( b) ( b )) ( c ( (d ( f e)))) ( ( b) ( b )) ( c ( (d ( f e)))) (( b) (b )) (c (d ( f e))) 3. Use the distributedness, ssocitivity nd commuttivity to move the s out: α (β γ) becomes (α β) (α γ). (( (b )) ( b (b ))) c d ( f e) ( b) ( ) ( b b) ( b ) c d ( f e) ( b) ( b ) c d ( f e) 4. Clusl form is more conveniently represented s set of cluses: { ( b), ( b ), c, d, ( f e)} VALIDITY AND SATISFIABILITY A sentence is vlid (or tutology) if it is true in ll models, e.g., A A A A (A (A B)) B Vlidity is connected to inference vi the Deduction Theorem: KB α iff (KB α) is vlid. A sentence is stisfible if it is true in some model A B A sentence is unstisfible if it is true in no models A A Stisfibility is connected to inference vi the following: KB = α if nd only if (KB α) is unstisfible. I.e., prove α by reductio d bsurdum. C PROPOSITIONAL LOGIC/8 PROPOSITIONAL LOGIC/9 PROOF METHODS THE WUMPUS WORLD Model checking truth tble enumertion (sound nd complete for propositionl), or heuristic serch in model spce (sound but incomplete). Appliction of inference rules sound (legitimte) genertion of new sentences from old Proof = sequence of inference rule pplictions Cn use inference rules s opertors in stndrd serch lgorithm. Inference rules Resolution (complete for propositionl logic) Modus ponens (For Horn cluses, complete for Horn KBs) α 1,...,α n, Cn be used with forwrd chining or bckwrd chining. α 1 α n β β Percepts Breeze, Glitter, Smell Actions Left turn, Right turn, Forwrd, Grb, Relese, Shoot Gols Get gold bck to strt without entering pit or wumpus squre Environment Squres djcent to wumpus re smelly Squres djcent to pit re breezy Glitter iff gold is in the sme squre Shooting kills the wumpus if you re fcing it Shooting uses up the only rrow Grbbing picks up the gold if in the sme squre Relesing drops the gold in the sme squre PROPOSITIONAL LOGIC/10 PROPOSITIONAL LOGIC/11

THE WUMPUS WORLD (CONT D) THE WUMPUS WORLD (CONT D) Knowledge bse: Knowledge bse: Fcts: () S 1,1 (b) S 2,1 (c) S 1,2 Fcts: () S 1,1 (b) S 2,1 (c) S 1,2 Resolution: Resolution: THE WUMPUS WORLD (CONT D) CONTROL STRATEGIES FOR RESOLUTION W 1,3 12 Resolution itself is sound nd complete (in fct, refuttion-complete). Knowledge bse: Fcts: () S 1,1 (b) S 2,1 (c) S 1,2 S 1,2 W 1,2 W 2,2 W 1,1 S 1,2 S 1,1 W 2,2 W 1,1 S 1,2 W 2,2 W 1,1 6 S 1,2 S 2,1 W 1,1 S 1,2 W 1,1 S 1,2 S 1,1 S 1,2 2 b 1 c Typiclly t ech step there re mny pirs of prent cluses tht could be resolved. A control strtegy is policy for prioritizing which resolutions to perform next. A control strtegy is complete if its use preserves (refuttion-)completeness, i.e. if contrdiction exists, it cn be found while respecting the strtegy. Input resolution: t lest one prent of ech resolution step must be in the originl KB, or prt of the negted gol. Very efficient, but lso incomplete (but complete for Horn cluses). Unit resolution: t lest one prent of ech resolution step must be unit cluse, i.e., single literl. The conclusion is lwys shorter thn its prent, hence it is gurnteed to finish in bounded time. It is however incomplete (e.g., on { P Q, P Q, P Q, P Q }). Heuristic: For exmple, unit preference, the heuristic of prioritizing resolutions where one prent is unit cluse. PROPOSITIONAL LOGIC/13

INFERENCE WITH HORN CLAUSES AND/OR GRAPHS In prctice the full power of resolution is not needed q Rel-world knowledge bses usully contins only Horn cluses Convenient becuse Horn cluse hs the form p A 1 A 2 A n C which illustrtes logicl impliction (if ll the body is true then the hed C becomes true) m Modus ponens ( mode tht ffirms by ffirming ) is then used s inference rule Cn be used with vrious control lgorithms: forwrd chining or dt driven bckwrd chining or gol driven. b. l :-, b. l :-, p. m :- b, l. p :- l, m. q :- p. l b PROPOSITIONAL LOGIC/14 PROPOSITIONAL LOGIC/15