Announcements. Assignment 5 due today Assignment 6 (smaller than others) available sometime today Midterm: 27 February.

Similar documents
Propositions. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 5.1, Page 1

Chapter 5: Propositions and Inference. c D. Poole, A. Mackworth 2010, W. Menzel 2015 Artificial Intelligence, Chapter 5, Page 1

Propositions. c D. Poole and A. Mackworth 2008 Artificial Intelligence, Lecture 5.1, Page 1

Propositional Logic: Semantics and an Example

Individuals and Relations

Propositional Logic: Bottom-Up Proofs

Logic: Bottom-up & Top-down proof procedures

Logic: Resolution Proofs; Datalog

Announcements. Solution to Assignment 3 is posted Assignment 4 is available. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 8 1 / 25

Chapters 2&3: A Representation and Reasoning System

Logic: Intro & Propositional Definite Clause Logic

Logic: Top-down proof procedure and Datalog

Reasoning Under Uncertainty: Belief Network Inference

Contents Chapters 2 & 3

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Artificial Intelligence Chapter 7: Logical Agents

Announcements. Project 1 underway... Second midterm Friday. discuss ideas with TAs check out wiki

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

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

The Foundations: Logic and Proofs. Part I

Propositional Logic 1

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

Logical Agent & Propositional Logic

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Propositional Logic: Semantics

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

MIDTERM: CS 6375 INSTRUCTOR: VIBHAV GOGATE October,

Solutions to Sample Problems for Midterm

Guest Speaker. CS 416 Artificial Intelligence. First-order logic. Diagnostic Rules. Causal Rules. Causal Rules. Page 1

Computer Science CPSC 322. Lecture 23 Planning Under Uncertainty and Decision Networks

Intelligent Agents. Pınar Yolum Utrecht University

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

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

AI Programming CS S-09 Knowledge Representation

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

NP-Completeness Part II

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence

Turing Machines Part III

Propositional Logic: Methods of Proof (Part II)

Logical Agent & Propositional Logic

Proof Methods for Propositional Logic

CSE 20 DISCRETE MATH WINTER

Kecerdasan Buatan M. Ali Fauzi

Propositional Logic: Methods of Proof (Part II)

Logical Agents. Chapter 7

Intelligent Systems (AI-2)

Logical Agents (I) Instructor: Tsung-Che Chiang

Final exam of ECE 457 Applied Artificial Intelligence for the Fall term 2007.

Chapter Finding parse trees

Knowledge Representation. Propositional logic

Intelligent Systems (AI-2)

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Bayesian belief networks

Propositional Resolution Introduction

Deliberative Agents Knowledge Representation I. Deliberative Agents

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Chapter Finding parse trees

16.410: Principles of Autonomy and Decision Making Final Exam

The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

CS 4700: Foundations of Artificial Intelligence

NP-Completeness Part II

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Logical Agents: Propositional Logic. Chapter 7

CS 380: ARTIFICIAL INTELLIGENCE

CS 188: Artificial Intelligence Spring 2007

CS 4700: Artificial Intelligence

Knowledge Representation. Propositional logic.

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Reasoning Under Uncertainty: Bayesian networks intro

Discrete Mathematics Fall 2018 Midterm Exam Prof. Callahan. Section: NetID: Multiple Choice Question (30 questions in total, 4 points each)

Artificial Intelligence

Introduction to Artificial Intelligence. Logical Agents

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

PHYS 1444 Section 004 Lecture #22

Lecture 7: Logic and Planning

CSE 20 DISCRETE MATH WINTER

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

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

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

CS 730/730W/830: Intro AI

Your Comments. I have three midterms this week; specifically, two tomorrow. I am studying for chemistry and calculus tonight.

Introduction to Artificial Intelligence (AI)

CS 771 Artificial Intelligence. Propositional Logic

ENEE 459E/CMSC 498R In-class exercise February 10, 2015

Reasoning Under Uncertainty: Conditioning, Bayes Rule & the Chain Rule

Propositional Reasoning

Knowledge-based systems

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Recap from Last Time

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

1 Primals and Duals: Zero Sum Games

Lecture 10: Introduction to reasoning under uncertainty. Uncertainty

CSE 20 DISCRETE MATH. Fall

Midterm: CS 6375 Spring 2015 Solutions

Probability and Time: Hidden Markov Models (HMMs)

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Mathematical Logic Part One

Transcription:

Announcements Assignment 5 due today Assignment 6 (smaller than others) available sometime today Midterm: 27 February. You can bring in a letter sized sheet of paper with anything written in it. Exam will cover material up to Wednesday of this week It assumes what is covered in class as well as the content of the assignments. Practice midterm available this week We have been promised more reliable lecture recording. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 1 / 37

Review: Propositions and Inference KB = g (g is a logical consequence of KB) if and only if g is true in every model of KB. The bottom-up proof procedure computs all consequences of a knowledge base. Top-down proof procedure searches from the goal to find a proof for a query. Assumables are used in a proof by contradiction. A conflict is a set of assumables that, together with the knowledge base, implies false. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 2 / 37

Search Space for SLD Resolution The search space for a query?q given KB is defined by: nodes: answer clauses yes body neighbors of a node: select an atom in body there is a neighbor for every clause with that atom in the head neighbors are defined by SLD resolution start node: yes q. goal node: yes. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 3 / 37

Clicker Question Suppose the knowledge base includes: w y z p s t p w answer clause: yes w r atom w is selected which of the following is a possible next answer clause A yes w r B yes y z r C yes y z p D yes w r y z E none of the above c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 4 / 37

Clicker Question Suppose the knowledge base includes: w y z p s t p w answer clause: yes p r atom p is selected which of the following is the next answer clause A either yes w r or yes s t r B yes s t w r C either yes y z r or yes s t r D yes y z s t E none of the above c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 5 / 37

Learning Objectives assumption-based reasoning (continued) knowledge-based debugging representing actions c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 6 / 37

Questions and Answers in Horn KBs An assumable is an atom whose negation you are prepared to accept as part of a (disjunctive) answer. A conflict of KB is a set of assumables that, given KB imply false. A minimal conflict is a conflict such that no strict subset is also a conflict. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 7 / 37

Clicker Question {c, d, e, f, g, h} are the assumables false a b. a c. KB = a e. b d. b e. A {e} is a minimal conflict B {e} is a conflict but not a minimal conflict C {e} is a set of assumables that is not a conflict D {e} is not a set of assumables c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 8 / 37

Clicker Question {c, d, e, f, g, h} are the assumables false a b. a c. KB = a e. b d. b e. A {c, d, e} is a minimal conflict B {c, d, e} is a conflict but not a minimal conflict C {c, d, e} is a set of assumables that is not a conflict D {c, d, e} is not a set of assumables c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 9 / 37

Clicker Question {c, d, e, f, g, h} are the assumables false a b. a c. KB = a e. b d. b e. A {c, d} is a minimal conflict B {c, d} is a conflict but not a minimal conflict C {c, d} is a set of assumables that is not a conflict D {c, d} is not a set of assumables c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 10 / 37

Clicker Question {c, d, e, f, g, h} are the assumables false a b. a c. KB = a e. b d. b e. A {c, d, e, h} is a minimal conflict B {c, d, e, h} is a conflict but not a minimal conflict C {c, d, e, h} is a set of assumables that is not a conflict D {c, d, e, h} is not a set of assumables c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 11 / 37

Clicker Question {c, d, e, f, g, h} are the assumables false a b. a c. KB = a e. b d. b e. A {a, d} is a minimal conflict B {a, d} is a conflict but not a minimal conflict C {a, d} is a set of assumables that is not a conflict D {a, d} is not a set of assumables c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 12 / 37

Clicker Question {c, d, e, f, g, h} are the assumables false a b. a c. KB = a e. b d. b e. The set of all minimal conflicts is A {{e}} B {{e}, {c, d}} C {{e}, {c, d}, {e, d}, {c, e}} D {} E None of the above c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 13 / 37

Using Conflicts for Diagnosis Assume that the user is able to observe whether a light is lit or dark and whether a power outlet is dead or live. A light can t be both lit and dark. An outlet can t be both live and dead: false dark l 1 lit l 1. false dark l 2 lit l 2. false dead p 1 live p 2. Assume the individual components are working correctly: assumable ok l 1. assumable ok s 2.... Suppose switches s 1, s 2, and s 3 are all up: up s 1. up s 2. up s 3. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 14 / 37

Electrical Environment s 1 w 1 s 2 w 2 s 3 w 0 cb 1 w 3 w w 6 4 l 1 w 5 cb 2 outside power off circuit breaker switch on two-way switch l 2 p 2 light p 1 power outlet c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 15 / 37

Representing the Electrical Environment light l 1. light l 2. up s 1. up s 2. up s 3. live outside. lit l 1 live w 0 ok l 1. live w 0 live w 1 up s 2 ok s 2. live w 0 live w 2 down s 2 ok s 2. live w 1 live w 3 up s 1 ok s 1. live w 2 live w 3 down s 1 ok s 1. lit l 2 live w 4 ok l 2. live w 4 live w 3 up s 3 ok s 3. live p 1 live w 3. live w 3 live w 5 ok cb 1. live p 2 live w 6. live w 6 live w 5 ok cb 2. live w 5 live outside. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 16 / 37

If the user has observed l 1 and l 2 are both dark: dark l 1. dark l 2. There are two minimal conflicts: {ok cb 1, ok s 1, ok s 2, ok l 1 } and {ok cb 1, ok s 3, ok l 2 }. You can derive: ( ok cb 1 ok s 1 ok s 2 ok l 1 ) ( ok cb 1 ok s 3 ok l 2 ). Either cb 1 is broken or there is one of six double faults. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 17 / 37

Conflicts in AILog http://artint.info/code/ailog/ailog_code/ch05/ elect_cbd.ail Load into AILog and ask queries commented out at bottom. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 18 / 37

Diagnoses A consistency-based diagnosis is a set of assumables that has one element in each conflict. A minimal diagnosis is a diagnosis such that no subset is also a diagnosis. Intuitively, one of the minimal diagnoses must hold. A diagnosis holds if all of its elements are false. Example: For the proceeding example the conflicts imply ( ok cb 1 ok s 1 ok s 2 ok l 1 ) ( ok cb 1 ok s 3 ok l 2 ). This can be distributed into: ok cb 1 ( ok s 1 ok s 3 ) ( ok s 1 ok l 2 ) ( ok s 2 ok s 3 ) ( ok s 2 ok l 2 ) ( ok l 1 ok s 3 ) ( ok l 1 ok l 2 ) c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 19 / 37

Recall: top-down consequence finding To solve the query?q 1... q k : ac := yes q 1... q k repeat select atom a 1 from the body of ac choose clause C from KB with a 1 as head replace a 1 in the body of ac by the body of C until ac is an answer. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 20 / 37

Implementing conflict finding: top down Query is false. Don t select an atom that is assumable. Stop when all of the atoms in the body of the generalised query are assumable: This set of assumables is a conflict You may need to search to find minimal conflicts c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 21 / 37

Example false a. a b c. b d. b e. c f. c g. e h w. e g. w f. assumable d, f, g, h. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 22 / 37

Knowledge-Level Debugging There are four types of non-syntactic errors that can arise in rule-based systems: An incorrect answer is produced: an atom that is false in the intended interpretation was derived. Some answer wasn t produced: the proof failed when it should have succeeded. Some particular true atom wasn t derived. The program gets into an infinite loop. The system asks irrelevant questions. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 23 / 37

Debugging incorrect answers Suppose atom g was proved but is false in the intended interpretation. There must be a clause g a 1... a k in the knowledge base that was used to prove g. Either: one of the ai is false in the intended interpretation or all of the ai are true in the intended interpretation. Incorrect answers can be debugged by only answering yes/no questions. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 24 / 37

Electrical Environment cb1 outside power s1 w5 w0 l1 s2 w1 w2 w4 s3 w3 cb2 w6 p2 off circuit breaker switch on two-way switch l2 p1 light power outlet http://artint.info/code/ailog/ailog_code/ch05/ elect_bug.ail (no assumables or askables) c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 25 / 37

Missing Answers If atom g is true in the intended interpretation, but could not be proved, either: There is no appropriate clause for g. There is a rule g a 1... a k that should have succeeded. One of the ai is true in the interpretation and could not be proved. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 26 / 37

State-space Search deterministic or stochastic dynamics fully observable or partially observable explicit states or features or individuals and relations static or finite stage or indefinite stage or infinite stage goals or complex preferences perfect rationality or bounded rationality flat or modular or hierarchical single agent or multiple agents knowledge is given or knowledge is learned reason offline or reason while interacting with environment c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 27 / 37

Classical Planning deterministic or stochastic dynamics fully observable or partially observable explicit states or features or individuals and relations static or finite stage or indefinite stage or infinite stage goals or complex preferences perfect rationality or bounded rationality flat or modular or hierarchical single agent or multiple agents knowledge is given or knowledge is learned reason offline or reason while interacting with environment c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 28 / 37

Planning Planning is deciding what to do based on an agent s ability, its goals. and the state of the world. Planning is finding a sequence of actions to solve a goal. Initial assumptions: The world is deterministic. There are no exogenous events outside of the control of the robot that change the state of the world. The agent knows what state it is in. Time progresses discretely from one state to the next. Goals are predicates of states that need to be achieved. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 29 / 37

Actions A deterministic action is a partial function from states to states. The preconditions of an action specify when the action can be carried out. The effect of an action specifies the resulting state. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 30 / 37

Delivery Robot Example Coffee Shop (cs) Sam's Office (off ) Mail Room (mr ) Lab (lab) Features: RLoc Rob s location RHC Rob has coffee SWC Sam wants coffee MW Mail is waiting RHM Rob has mail Actions: mc move clockwise mcc move counterclockwise puc pickup coffee dc deliver coffee pum pickup mail dm deliver mail c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 31 / 37

Explicit State-space Representation State Action Resulting State lab, rhc, swc, mw, rhm mc mr, rhc, swc, mw, rhm lab, rhc, swc, mw, rhm mcc off, rhc, swc, mw, rhm off, rhc, swc, mw, rhm dm off, rhc, swc, mw, rhm off, rhc, swc, mw, rhm mcc cs, rhc, swc, mw, rhm off, rhc, swc, mw, rhm mc lab, rhc, swc, mw, rhm......... What happens when we also want to model its battery charge? c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 32 / 37

STRIPS Representation For each action specify: precondition: when the action can be carried out. effect: a set of assignments of values to features that are made true by this action. STRIPS assumption: every feature not mentioned in the effects is unaffected by the action. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 33 / 37

Example STRIPS representation Pick-up coffee (puc): precondition: [cs, rhc] effect: [rhc] Deliver coffee (dc): precondition: [off, rhc] effect: [ rhc, swc] c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 34 / 37

Planning Given: A description of the effects and preconditions of the actions A description of the initial state A goal to achieve find a sequence of actions that is possible and will result in a state satisfying the goal. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 35 / 37

Forward Planning Idea: search in the state-space graph. The nodes represent the states The arcs correspond to the actions: The arcs from a state s represent all of the actions that are legal in state s. A plan is a path from the state representing the initial state to a state that satisfies the goal. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 36 / 37

Example state-space graph Actions mc: move clockwise mac: move anticlockwise cs,rhc,swc,mw,rhm nm: no move puc puc: pick up coffee mc mac dc: deliver coffee pum: pick up mail dm: deliver mail cs,rhc,swc,mw,rhm mc off,rhc,swc,mw,rhm mc mr,rhc,swc,mw,rhm mac off,rhc,swc,mw,rhm mac lab,rhc,swc,mw,rhm cs,rhc,swc,mw,rhm dc off,rhc,swc,mw,rhm mc mac mac lab,rhc,swc,mw,rhm mr,rhc,swc,mw,rhm Locations: cs: coffee shop off: office lab: laboratory mr: mail room mr,rhc,swc,mw,rhm Feature values rhc: robot has coffee swc: Sam wants coffee mw: mail waiting rhm: robot has mail c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 12 37 / 37