What is the relationship between number of constraints and number of possible solutions?

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

Logical Agents: Propositional Logic. Chapter 7

Artificial Intelligence. Propositional logic

Artificial Intelligence

TDT4136 Logic and Reasoning Systems

Logical agents. Chapter 7. Chapter 7 1

Artificial Intelligence

CS 380: ARTIFICIAL INTELLIGENCE

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

INF5390 Kunstig intelligens. Logical Agents. Roar Fjellheim

Logical Agents. Outline

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

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

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

Lecture 7: Logical Agents and Propositional Logic

Intelligent Agents. Pınar Yolum Utrecht University

Class Assignment Strategies

Agents that reason logically

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

Logical Agents (I) Instructor: Tsung-Che Chiang

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

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

Logical Agents. Santa Clara University

Lecture 6: Knowledge 1

Logical Agents. Chapter 7

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Introduction to Intelligent Systems

Artificial Intelligence Chapter 7: Logical Agents

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

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

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

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

Logical Agent & Propositional Logic

Logical Agent & Propositional Logic

Introduction to Artificial Intelligence. Logical Agents

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Introduction to Intelligent Systems

Proof Methods for Propositional Logic

Kecerdasan Buatan M. Ali Fauzi

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

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

Logical Agents. Outline

CS 4700: Foundations of Artificial Intelligence

AI Programming CS S-09 Knowledge Representation

CS 4700: Artificial Intelligence

Foundations of Artificial Intelligence

Logical agents. Chapter 7. Chapter 7 1

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

Logic. proof and truth syntacs and semantics. Peter Antal

Logical Agents. September 14, 2004

CS:4420 Artificial Intelligence

Logical Agents. Chapter 7

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

CS:4420 Artificial Intelligence

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

Propositional Logic: Logical Agents (Part I)

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

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

CS 188: Artificial Intelligence Spring 2007

CS 771 Artificial Intelligence. Propositional Logic

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

Propositional Logic: Logical Agents (Part I)

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Logic: Propositional Logic (Part I)

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

Propositional and First-Order Logic

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

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

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

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

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

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

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

Introduction to Arti Intelligence

15414/614 Optional Lecture 1: Propositional Logic

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Logical Agents. Seung-Hoon Na Chonbuk National University. 1 Department of Computer Science

Propositional Logic: Methods of Proof (Part II)

Propositional Logic Part 1

Propositional Logic: Methods of Proof (Part II)

Artificial Intelligence

Lecture 7: Logic and Planning

Inference in Propositional Logic

Logical Structures in Natural Language: Propositional Logic II (Truth Tables and Reasoning

ICS141: Discrete Mathematics for Computer Science I

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

Logic & Logic Agents Chapter 7 (& Some background)

COMP219: Artificial Intelligence. Lecture 19: Logic for KR

Artificial Intelligence Knowledge Representation I

Propositional Logic: Review

22c:145 Artificial Intelligence

Logic & Logic Agents Chapter 7 (& background)

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

CS 7180: Behavioral Modeling and Decision- making in AI

Knowledge based Agents

Artificial Intelligence

Propositional Logic: Semantics and an Example

Transcription:

Warm-up: What is the relationship between number of constraints and number of possible solutions? In other words, as the number of the constraints increases, does the number of possible solutions: A) Increase B) Decrease C) Stay the same

Announcements Assignments: P2: Optimization Due Thu 2/21, 10 pm Midterm 1 Exam Mon 2/18, in class Recitation Fri is a review session See Piazza post for details Alita Class Field Trip! Moved to Saturday, 2/23, afternoon White card feedback

Warm-up: What is the relationship between number of constraints and number of possible solutions? In other words, as the number of the constraints increases, does the number of possible solutions: A) Increase B) Decrease C) Stay the same Where is the knowledge in our CSPs?

AI: Representation and Problem Solving Propositional Logic Instructors: Pat Virtue & Stephanie Rosenthal Slide credits: CMU AI, http://ai.berkeley.edu

Logic Representation and Problem Solving To honk or not to honk

Logical Agents Logical agents and environments Agent Sensors? Knowledge Base Inference Actuators Percepts Actions Environment

Wumpus World Logical Reasoning as a CSP B ij = breeze felt S ij = stench smelt P ij = pit here W ij = wumpus here G = gold http://thiagodnf.github.io/wumpus-world-simulator/

A Knowledge-based Agent function KB-AGENT(percept) returns an action persistent: KB, a knowledge base t, an integer, initially 0 TELL(KB, PROCESS-PERCEPT(percept, t)) action ASK(KB, PROCESS-QUERY(t)) TELL(KB, PROCESS-RESULT(action, t)) t t+1 return action

Logical Agents So what do we TELL our knowledge base (KB)? Facts (sentences) The grass is green The sky is blue Rules (sentences) Eating too much candy makes you sick When you re sick you don t go to school Percepts and Actions (sentences) Pat ate too much candy today What happens when we ASK the agent? Inference new sentences created from old Pat is not going to school today

Logical Agents Sherlock Agent Really good knowledge base Evidence Understanding of how the world works (physics, chemistry, sociology) Really good inference Skills of deduction It s elementary my dear Watson Dr. Strange? Alan Turing? Kahn?

Worlds What are we trying to figure out? Who, what, when, where, why Actions, strategy Time: past, present, future Partially observable? Ghosts, Walls Which world are we living in?

Models How do we represent possible worlds with models and knowledge bases? How do we then do inference with these representations?

Wumpus World Possible Models P 1,2 P 2,2 P 3,1

Wumpus World Possible Models P 1,2 P 2,2 P 3,1 Knowledge base Nothing in [1,1] Breeze in [2,1]

Wumpus World Possible Models P 1,2 P 2,2 P 3,1 Knowledge base Nothing in [1,1] Breeze in [2,1] Query αα 1 : No pit in [1,2]

Wumpus World Possible Models P 1,2 P 2,2 P 3,1 Knowledge base Nothing in [1,1] Breeze in [2,1] Query αα 2 : No pit in [2,2]

Logic Language Natural language? Propositional logic Syntax: P ( Q R); X 1 (Raining Sunny) Possible world: {P=true, Q=true, R=false, S=true} or 1101 Semantics: α β is true in a world iff is α true and β is true (etc.) First-order logic Syntax: x y P(x,y) Q(Joe,f(x)) f(x)=f(y) Possible world: Objects o 1, o 2, o 3 ; P holds for <o 1,o 2 >; Q holds for <o 3 >; f(o 1 )=o 1 ; Joe=o 3 ; etc. Semantics: φ(σ) is true in a world if σ=o j and φ holds for o j ; etc.

Propositional Logic

Propositional Logic Symbol: Variable that can be true or false We ll try to use capital letters, e.g. A, B, P 1,2 Often include True and False Operators: A: not A A B: A and B (conjunction) A B: A or B (disjunction) Note: this is not an exclusive or A B: A implies B (implication). If A then B A B: A if and only if B (biconditional) Sentences

Propositional Logic Syntax Given: a set of proposition symbols {X 1, X 2,, X n } (we often add True and False for convenience) X i is a sentence If α is a sentence then α is a sentence If α and β are sentences then α β is a sentence If α and β are sentences then α β is a sentence If α and β are sentences then α β is a sentence If α and β are sentences then α β is a sentence And p.s. there are no other sentences!

Notes on Operators αα ββ is inclusive or, not exclusive

Truth Tables αα ββ is inclusive or, not exclusive αα ββ αα ββ F F F F T F T F F T T T αα ββ αα ββ F F F F T T T F T T T T

Notes on Operators αα ββ is inclusive or, not exclusive αα ββ is equivalent to αα ββ Says who?

Truth Tables αα ββ is equivalent to αα ββ αα ββ αα ββ αα αα ββ F F T T T F T T T T T F F F F T T T F T

Notes on Operators αα ββ is inclusive or, not exclusive αα ββ is equivalent to αα ββ Says who? αα ββ is equivalent to (αα ββ) (ββ αα) Prove it!

Truth Tables αα ββ is equivalent to (αα ββ) (ββ αα) αα ββ αα ββ αα ββ ββ αα (αα ββ) (ββ αα) F F T T T T F T F T F F T F F F T F T T T T T T Equivalence: it s true in all models. Expressed as a logical sentence: (αα ββ) [(αα ββ) (ββ αα)]

Literals A literal is an atomic sentence: True False Symbol Symbol

Monty Python Inference There are ways of telling whether she is a witch

Sentences as Constraints Adding a sentence to our knowledge base constrains the number of possible models: Possible Models KB: Nothing P Q R false false false false false true false true false false true true true false false true false true true true false true true true

Sentences as Constraints Adding a sentence to our knowledge base constrains the number of possible models: Possible Models KB: Nothing KB: [(P Q) (Q P)] R P Q R false false false false false true false true false false true true true false false true false true true true false true true true

Sentences as Constraints Adding a sentence to our knowledge base constrains the number of possible models: Possible Models KB: Nothing KB: [(P Q) (Q P)] R KB: R, [(P Q) (Q P)] R P Q R false false false false false true false true false false true true true false false true false true true true false true true true

Sherlock Entailment When you have eliminated the impossible, whatever remains, however improbable, must be the truth Sherlock Holmes via Sir Arthur Conan Doyle Knowledge base and inference allow us to remove impossible models, helping us to see what is true in all of the remaining models

Entailment Entailment: α = β ( α entails β or β follows from α ) iff in every world where α is true, β is also true I.e., the α-worlds are a subset of the β-worlds [models(α) models(β)] Usually we want to know if KB = query models(kb) models(query) In other words KB removes all impossible models (any model where KB is false) If β is true in all of these remaining models, we conclude that β must be true Entailment and implication are very much related However, entailment relates two sentences, while an implication is itself a sentence (usually derived via inference to show entailment)

Wumpus World Possible Models P 1,2 P 2,2 P 3,1 Knowledge base Nothing in [1,1] Breeze in [2,1]

Wumpus World Possible Models P 1,2 P 2,2 P 3,1 Knowledge base Nothing in [1,1] Breeze in [2,1] Query αα 1 : No pit in [1,2]

Wumpus World Possible Models P 1,2 P 2,2 P 3,1 Knowledge base Nothing in [1,1] Breeze in [2,1] Query αα 2 : No pit in [2,2]

Propositional Logic Models Model Symbols All Possible Models A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1

Piazza Poll 1 Does the KB entail query C? Entailment: α = β α entails β iff in every world where α is true, β is also true All Possible Models Model Symbols A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 Knowledge Base A 0 0 0 0 1 1 1 1 B C 1 1 0 1 1 1 0 1 A B C 1 1 1 1 0 1 1 1 Query C 0 1 0 1 0 1 0 1

Piazza Poll 1 Does the KB entail query C? Entailment: α = β α entails β iff in every world where α is true, β is also true All Possible Models Model Symbols A 0 0 0 0 1 1 1 1 B 0 0 1 1 0 0 1 1 C 0 1 0 1 0 1 0 1 Knowledge Base A 0 0 0 0 1 1 1 1 B C 1 1 0 1 1 1 0 1 A B C 1 1 1 1 0 1 1 1 Query C 0 1 0 1 0 1 0 1

Entailment How do we implement a logical agent that proves entailment? Logic language Propositional logic First order logic Inference algorithms Theorem proving Model checking

Propositional Logic Check if sentence is true in given model In other words, does the model satisfy the sentence? function PL-TRUE?(α,model) returns true or false if α is a symbol then return Lookup(α, model) if Op(α) = then return not(pl-true?(arg1(α),model)) if Op(α) = then return and(pl-true?(arg1(α),model), PL-TRUE?(Arg2(α),model)) etc. (Sometimes called recursion over syntax )

Simple Model Checking function TT-ENTAILS?(KB, α) returns true or false return TT-CHECK-ALL(KB, α, symbols(kb) U symbols(α),{}) function TT-CHECK-ALL(KB, α, symbols,model) returns true or false if empty?(symbols) then if PL-TRUE?(KB, model) then return PL-TRUE?(α, model) else return true else P first(symbols) rest rest(symbols) return and (TT-CHECK-ALL(KB, α, rest, model {P = true}) TT-CHECK-ALL(KB, α, rest, model {P = false }))

Simple Model Checking, contd. Same recursion as backtracking O(2 n ) time, linear space We can do much better! P 2 =true P 1 =true P 1 =false P 2 =false P n =true P n =false KB? α? 11111 1 0000 0