Class Assignment Strategies

Similar documents
Intelligent Agents. Pınar Yolum Utrecht University

Logical Agents. Chapter 7

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Logical Agents. Outline

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

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

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

CS 771 Artificial Intelligence. Propositional Logic

Introduction to Artificial Intelligence. Logical Agents

Kecerdasan Buatan M. Ali Fauzi

Logical agents. Chapter 7. Chapter 7 1

CS 188: Artificial Intelligence Spring 2007

Proof Methods for Propositional Logic

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

TDT4136 Logic and Reasoning Systems

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

Artificial Intelligence Chapter 7: Logical Agents

Logic. proof and truth syntacs and semantics. Peter Antal

Logical Agents. Chapter 7

Propositional Logic: Logical Agents (Part I)

Logical Agent & Propositional Logic

Artificial Intelligence

Logical Agent & Propositional Logic

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

Artificial Intelligence

Logical Agents: Propositional Logic. Chapter 7

Logical Agents. Outline

Propositional Logic: Logical Agents (Part I)

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

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

CS 380: ARTIFICIAL INTELLIGENCE

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

Logical Agents (I) Instructor: Tsung-Che Chiang

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

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

Lecture 6: Knowledge 1

Lecture 7: Logical Agents and Propositional Logic

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

Propositional Logic: Methods of Proof (Part II)

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

Introduction to Intelligent Systems

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

Logical agents. Chapter 7. Chapter 7 1

Logical Agents. Santa Clara University

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

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

Introduction to Intelligent Systems

Propositional Logic: Methods of Proof (Part II)

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

CS 4700: Foundations of Artificial Intelligence

Adversarial Search & Logic and Reasoning

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 & Logic Agents Chapter 7 (& background)

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

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

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

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

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

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

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

Inference Methods In Propositional Logic

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

CS:4420 Artificial Intelligence

Lecture 7: Logic and Planning

Logic & Logic Agents Chapter 7 (& Some background)

Artificial Intelligence. Propositional logic

Inference Methods In Propositional Logic

Propositional Logic: Methods of Proof (Part II)

Foundations of Artificial Intelligence

CS:4420 Artificial Intelligence

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

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

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

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

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

CS 7180: Behavioral Modeling and Decision- making in AI

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

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

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

AI Programming CS S-09 Knowledge Representation

Deliberative Agents Knowledge Representation I. Deliberative Agents

Logic: Propositional Logic (Part I)

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

Propositional inference, propositional agents

CS 4700: Artificial Intelligence

Introduction to Arti Intelligence

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

Inference in Propositional Logic

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Agents that reason logically

Advanced Topics in LP and FP

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Artificial Intelligence

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logic. Stephen G. Ware CSCI 4525 / 5525

Logic and Inferences

Knowledge based Agents

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Transcription:

Class Assignment Strategies ì Team- A'ack: Team a'ack ì Individualis2c: Search for possible ì Poli2cal: look at others and make decision based on who is winning, who is loosing, and conversa;on ì Emo2on and reasoning: use aggression, honesty, and ruthelessness to vary agents behavior

Can you do this with just search? ì

Short-comings of just using search ì Inflexibility: You need to hard code every state ì Performance: exponential in the number of states ì Observability: No inference based on information seen ì No inference and reasoning

Knowledge & Reasoning To address these issues we will introduce ì A knowledge base (KB): a list of facts that are known to the agent. ì A mechanism (Inference) to infer new facts from old facts ì Logic provides the natural language for this

Logic ì Chapter 7 (some of the materials are from Welling at UCI)

Knowledge Bases ì Knowledge base: ì set of sentences in a formal language. ì Declarative approach to building an agent: ì ì Tell the KB it what it needs to know. Ask the KB it what to do

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 Sensors: Stench, Breeze, Glitter, Bump, Scream Actuators: Left turn, Right turn, Forward, Grab, Release, Shoot

Wumpus world characterization ì Fully Observable No only local perception ì Deterministic Yes outcomes exactly specified ì Episodic No things we do have an impact. ì Static Yes Wumpus and Pits do not move ì Discrete Yes ì Single-agent? Yes Wumpus is essentially a natural feature

Exploring a wumpus world

Exploring a wumpus world

Exploring a wumpus world

Exploring a wumpus world

Exploring a Wumpus world Why is W in 3,1 and P in 1, 3?

Logic ì We used logical reasoning to find the gold. ì Logics are formal languages for representing information such that conclusions can be drawn ì Syntax defines the sentences in the language ì Semantics define the "meaning" of sentences; ì i.e., define truth of a sentence in a world

Entailment ì Entailment means that one thing follows from another: KB α ì Knowledge base KB entails sentence α if and only if α is true in all worlds where KB is true ì E.g., the KB containing the Giants won and the Reds won entails The Giants won.

Entailment in the wumpus world ì Consider possible models for KB assuming only pits and a reduced Wumpus world ì Situation after detecting nothing in [1,1], moving right, breeze in [2,1]

All possible ways to fill in the? s. Wumpus models

Wumpus models ì KB = all possible wumpus-worlds consistent with the observations and the physics of the Wumpus world.

Wumpus models α 1 = "[1,2] is safe", KB α 1, proved by model checking

α 2 = "[2,2] is safe", KB α 2 Wumpus models

Inference Procedures ì KB i α = sentence α can be derived from KB by procedure i ì Soundness: i is sound if whenever KB i α, it is also true that KB α (i.e., no wrong inferences, but maybe not all inferences) ì Completeness: i is complete if whenever KB α, it is also true that KB i α (i.e., all inferences can be made, but maybe some wrong extra ones as well)

Propositional logic ì Propositional logic is the simplest logic ì The proposition symbols are sentences, S ì S ì S 1 S 2 ì S 1 S 2 ì S 1 S 2 ì S 1 S 2 (negation) (conjunction) (disjunction) (implication) (biconditional)

Propositional logic Each model/world specifies true or false for each proposition symbol E.g. P 1,2 P 2,2 P 3,1 false true false Rules for evaluating truth with respect to a model m: 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 S 2 is true and S 2 S 1 is true

Propositional logic Simple recursive process evaluates an arbitrary sentence, e.g., P 1,2 (P 2,2 P 3,1 ) = true (true false) = true true = true

Truth tables for connectives OR: P or Q is true or both are true. XOR: P or Q is true but not both. Implication is always true when the premises are False!

Wumpus world sentences Let P i,j be true if there is a pit in [i, j]. Let B i,j be true if there is a breeze in [i, j]. start: P 1,1 B 1,1 B 2,1 ì "Pits cause breezes in adjacent squares" B 1,1 (P 1,2 P 2,1 ) B 2,1 (P 1,1 P 2,2 P 3,1 )

Inference by enumeration ì Enumeration of all models is sound and complete. ì For n symbols, time complexity is O(2 n ) ì We need a smarter way to do inference! ì In particular, we are going to infer new logical sentences from the data-base and see if they match a query.

Logical equivalence ì Two sentences are logically equivalent iff they are true in same models: α ß iff α β and β α

Validity and satisfiability A sentence is valid if it is true in all models, e.g., True, A A, A A, (A (A B)) B Validity is connected to inference via the Deduction Theorem: KB α if and only if (KB α) is valid A sentence is satisfiable if it is true in some model e.g., A B, C A sentence is unsatisfiable if it is false in all models e.g., A A Satisfiability is connected to inference via the following: KB α if and only if (KB α) is unsatisfiable (there is no model for which KB=true and is false) α

Proof methods ì Proof methods divide into (roughly) two kinds: Application of inference rules: Legitimate (sound) generation of new sentences from old. ì Resolution ì Forward & Backward chaining Model checking Searching through truth assignments. ì Improved backtracking: Davis--Putnam-Logemann-Loveland (DPLL) ì Heuristic search in model space: Walksat.

Normal Form We like to prove: We first rewrite KB = α equivalent to : KB α unsatifiable KB α into conjunctive normal form (CNF). A conjunction of disjunctions literals (A B) (B C D) Clause Clause Any KB can be converted into CNF. In fact, any KB can be converted into CNF-3 using clauses with at most 3 literals.

Example: Conversion to CNF 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 distributive 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 )

Resolution Algorithm The resolution algorithm tries to prove: KB = α equivalent to KB α unsatisfiable Generate all new sentences from KB and the query. One of two things can happen: P P 1. We find which is unsatisfiable. I.e. we can entail the query. 2. We find no contradiction: there is a model that satisfies the sentence KB α (non-trivial) and hence we cannot entail the query.

Proof by Resolution 1. P v Q 2. P v R 3. Q v R Prove R.

Proof by Resolution 1. P v Q 2. P v R 3. Q v R Knowledge Base 1. P v Q 2. P v R 3. Q v R 1, 2 Resolu;on 4. Q v R 3. Q v R Prove R. (P v Q) and ( P v R) = true means either Q or R have to be true P has to be True to False, then If P is false then Q has to be true If P is true then R has to be true Therefore, if P has to be T or F, then Q is T or R is T, thus you can cancel literals

Proof by Resolution 1. P v Q Knowledge Base 1, 2 Resolu;on 4, 3 Resolu;on 2. P v R 3. Q v R 1. P v Q 2. P v R 3. Q v R 4. Q v R 3. Q v R 4. Q v R 3. Q v R Prove R. (Q v R) and ( Q v R) = true means either R or R has to be true Q has to be True to False, then If Q is false then R has to be true If Q is true then R has to be true Therefore, if Q has to be T or F, then R is T, thus you can cancel literals

Horn Clauses: A Special Case ì Resolu;on can be exponen;al in space and ;me. ì If we can reduce all clauses to Horn clauses resolu;on is linear in space and ;me ì Horn clause: a clause with at most one posi;ve literal ì A v B v C v D ì Definite clause: a Horn clause with exactly one posi;ve literal ì A v B v C v D

Chaining ì Horn clauses are closed under resolu2on ( A v B v C) ( B v D v E v F) A v C v D v E v F

Forward Chaining ì Start with known facts and derive new knowledge to add to the knowledge base ì Agent can derive conclusions from incoming percepts ì Data- driven approach

Forward Chaining ì Horn clauses: ì C1: P 1 v P 2 v P 4 (P 1 ^ P 2 - > P 4 ) ì C2: P 4 v P 5 (P 4 - > P 5 ) ì Facts: ì P 1, P 2

Forward Chaining ì Horn clauses: ì C1: P 1 v P 2 v P 4 (P 1 ^ P 2 - > P 4 ) ì C2: P 4 v P 5 (P 4 - > P 5 ) ì Facts: ì P 1, P 2 ì Percepts P 1 and P 2 resolve with C1 to get P 4

Forward Chaining ì Horn clauses: ì C1: P 1 v P 2 v P 4 (P 1 ^ P 2 - > P 4 ) ì C2: P 4 v P 5 (P 4 - > P 5 ) ì Facts: ì P 1, P 2 ì Percepts P 1 and P 2 resolve with C1 to get P 4 ì Resolve P 4 with C2 to get P 5

Forward Chaining ì Horn clauses: ì C1: P 1 v P 2 v P 4 ì C2: P 4 v P 5 Knowledge Base 1. P 1 ^ P 2 - > P 4 2. P 4 - > P 5

Forward Chaining ì Horn clauses: Knowledge Base ì C1: P 1 v P 2 v P 4 ì C2: P 4 v P 5 1. P 1 ^ P 2 - > P 4 2. P 4 - > P 5 Knowledge Base Fact: P 1 is seen 1. P 1 ^ P 2 - > P 4 2. P 4 - > P 5 3. P 1

Forward Chaining ì Horn clauses: ì C1: P 1 v P 2 v P 4 ì C2: P 4 v P 5 Knowledge Base 1. P 1 ^ P 2 - > P 4 2. P 4 - > P 5 Knowledge Base Fact: P 1 is seen 1. P 1 ^ P 2 - > P 4 2. P 4 - > P 5 3. P 1 Knowledge Base Fact: P 2 is seen 1. P 1 ^ P 2 - > P 4 2. P 4 - > P 5 3. P 1 4. P 2 5. P 4 6. P 5 Using 1, 3, 4 deduce P 4 Using 2, 5 deduce P 5

Backward Chaining ì Goal- driven reasoning ì Work backwards to see if query is true ì If inconclusive, query is false ì Efficient: only touches relevant facts or rules

Backward Chaining ì Horn clauses: ì C1: P 1 v P 2 v P 4 (P 1 ^ P 2 - > P 4 ) ì C2: P 4 v P 5 (P 4 - > P 5 ) ì Facts: ì P 1, P 2 ì Goal: P 5 ì Subgoal: prove P 4

Backward Chaining ì Horn clauses: ì C1: P 1 v P 2 v P 4 (P 1 ^ P 2 - > P 4 ) ì C2: P 4 v P 5 (P 4 - > P 5 ) ì Facts: ì P 1, P 2 ì Goal: P 5 ì Subgoal: prove P 4 ì Sub- sub goal: prove P 2 ì Sub- sub goal: prove P 1

Class Exercise Write this problem in terms of proposi;onal logic Use resolu;on to show inference that W is in 3, 1 P is in 1, 3 (give the facts shown at different ;me steps) Show your work