© 2000-2012 Franz Kurfess Reasoning CSC 480: Artificial Intelligence Dr. Franz J. Kurfess Computer Science Department Cal Poly.

Slides:



Advertisements
Similar presentations
First-Order Logic: Better choice for Wumpus World Propositional logic represents facts First-order logic gives us Objects Relations: how objects relate.
Advertisements

Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
3/30/00 Agents that Reason Logically by Chris Horn Jiansui Yang Xiaojing Wu.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Fall 2005.
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
CS 561, Sessions Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms.
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
CS 460, Sessions Knowledge and reasoning – second part Knowledge representation Logic and representation Propositional (Boolean) logic Normal forms.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 9 Jim Martin.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Computing & Information Sciences Kansas State University Lecture 11 of 42 CIS 530 / 730 Artificial Intelligence Lecture 11 of 42 William H. Hsu Department.
Knowledge Representation & Reasoning (Part 1) Propositional Logic chapter 6 Dr Souham Meshoul CAP492.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge in intelligent systems So far, we’ve used relatively specialized, naïve agents. How can we build agents that incorporate knowledge and a memory?
© Franz Kurfess Lab Exercise Reasoning CSC 480: Artificial Intelligence Wumpus World Lab Dr. Franz J. Kurfess Computer Science Department Cal Poly.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 8 Jim Martin.
LOGICAL AGENTS Yılmaz KILIÇASLAN. Definitions Logical agents are those that can:  form representations of the world,  use a process of inference to.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2005.
Logical Agents Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2008.
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
Agents that Reason Logically Logical agents have knowledge base, from which they draw conclusions TELL: provide new facts to agent ASK: decide on appropriate.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
Logical Agents Chapter 7 (based on slides from Stuart Russell and Hwee Tou Ng)
Artificial Intelligence Lecture No. 9 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
February 20, 2006AI: Chapter 7: Logical Agents1 Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent.
Propositional Logic: Logical Agents (Part I) This lecture topic: Propositional Logic (two lectures) Chapter (this lecture, Part I) Chapter 7.5.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Logic Propositional Logic Summary
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part A Knowledge Representation and Reasoning.
Class Project Due at end of finals week Essentially anything you want, so long as its AI related and I approve Any programming language you want In pairs.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 17, 2012.
1 Knowledge Representation Propositional Logic Vumpus World Knowledge Representation Propositional Logic Vumpus World.
Logical Agents Chapter 7. Knowledge bases Knowledge base (KB): set of sentences in a formal language Inference: deriving new sentences from the KB. E.g.:
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Knowledge Representation Lecture # 17, 18 & 19. Motivation (1) Up to now, we concentrated on search methods in worlds that can be relatively easily represented.
For Friday Read chapter 8 Homework: –Chapter 7, exercise 1.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
Knowledge-based agents: they keep track of the world by means of an internal state which is constantly updated by the agent itself A Knowledge-Based Agent.
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Wumpus World 1 Wumpus and 1 pile of gold in a pit-filled cave Starts in [1,1] facing right - Random cave Percepts: [smell, breeze, gold, bump, scream]
Computing & Information Sciences Kansas State University Wednesday, 13 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 10 of 42 Wednesday, 13 September.
1 UNIT-3 KNOWLEDGE REPRESENTATION. 2 Agents that reason logically(Logical agents) A Knowledge based Agent The Wumpus world environment Representation,
Logical Agents Chapter 7 Part I. 2 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic.
1 Knowledge Representation Logic and Inference Propositional Logic Vumpus World Knowledge Representation Logic and Inference Propositional Logic Vumpus.
Artificial Intelligence Logical Agents Chapter 7.
Prof. Dr. Samy Abu Naser University of Palestine Artificial Intelligence.
Artificial Intelligence Logical Agents Chapter 7.
Logical Agents. Inference : Example 1 How many variables? 3 variables A,B,C How many models? 2 3 = 8 models.
LOGICAL AGENTS CHAPTER 7 AIMA 3. OUTLINE  Knowledge-based agents  Wumpus world  Logic in general - models and entailment  Propositional (Boolean)
Propositional Logic: Logical Agents (Part I)
Hierarchical and K-means Clustering
Knowledge and reasoning – second part
EA C461 – Artificial Intelligence Logical Agent
Learning and Knowledge Acquisition
Logical Agents Chapter 7.
Artificial Intelligence
Artificial Intelligence: Logic agents
Class #9– Thursday, September 29
Knowledge and reasoning – second part
Logical Agents Chapter 7.
CS 416 Artificial Intelligence
Artificial Intelligence Lecture 10: Logical Agents
Knowledge Representation I (Propositional Logic)
CMSC 471 Fall 2011 Class #10 Tuesday, October 4 Knowledge-Based Agents
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

© Franz Kurfess Reasoning CSC 480: Artificial Intelligence Dr. Franz J. Kurfess Computer Science Department Cal Poly

2 © Franz J. Kurfess Logistics - Nov. 1, 2012 ❖ AI Nugget presentations scheduled  Section 1:  Erik Sandberg: Traffic Ground Truth Estimation Using Multisensor Consensus Filter  Section 3:  Bryan Stoll: Virtual Composer (delayed from Oct. 25)  Spencer Lines: What IBM's Watson has been up to since it won in 2011 (delayed from Oct. 30)  Mathew Cabutage: Evolution of Robots by Darwinian Selection (delayed from Oct. 30)  Rudy Alfaro: League of Legends Bot AI  DJ Mitchell: Simulated Therapists and SIM Sensei  Alex Waas: Mining Patterns in Search Data ❖ A2 Wumpus World  Part 1: Knowledge Representation and Reasoning  Web form, no programming required  Due: Nov. 8  Part 2: Implementation  Due: Nov. 15 ❖ A3 Competitions cancelled  weight of remaining assignments adjusted accordingly

© Franz Kurfess Reasoning Course Overview  Introduction  Intelligent Agents  Search  problem solving through search  informed search  Games  games as search problems  Knowledge and Reasoning  reasoning agents  propositional logic  predicate logic  knowledge-based systems  Learning  learning from observation  neural networks  Conclusions

© Franz Kurfess Reasoning Chapter Overview Reasoning Agents  Motivation  Objectives  Agents and Knowledge  Wumpus World  environment  agents  Representation, Reasoning and Logic  representation  inference  logics  Propositional Logic  syntax  semantics  validity and inference  models  inference rules  complexity  Wumpus Agents  Important Concepts and Terms  Chapter Summary

© Franz Kurfess Reasoning Bridge-In  achieving a goal frequently requires more than searching  planning  looking ahead for outcomes of actions  reasoning  combining evidence to obtain new knowledge  acting  translation of knowledge into actions

© Franz Kurfess Reasoning Dog vs. Wumpus  Is a dog smart enough to solve the Wumpus World challenge?  avoid pits  avoid Wumpus  eliminate the Wumpus  find gold  pick up gold  return

© Franz Kurfess Reasoning Pre-Test  conceptual limitations of search

© Franz Kurfess Reasoning Motivation  many tasks are too complex to be solved by search alone  “logical thinking” is often necessary  existing knowledge about the environment and the agent itself can be combined and transformed into new knowledge  more applicable to the task  solution to a specific problem  possible ways to solve a problem  properties of the environment, task, agent  formal methods to perform reasoning are required

© Franz Kurfess Reasoning Objectives  understand the need to apply knowledge-based reasoning for some tasks  know the elementary concepts of representation, inference and logics  know the important aspects of propositional logic  syntax, semantics, models, inference rules, complexity  understand the limitations of propositional logic  apply simple reasoning techniques to specific tasks

© Franz Kurfess Reasoning Evaluation Criteria

© Franz Kurfess Reasoning Agents and Knowledge  knowledge helps agents to form representations of the world  sometimes called “world model”  new knowledge is obtained by applying reasoning methods to existing knowledge  results in new or refined representational aspects of the world  decisions about actions are based on the new knowledge

© Franz Kurfess Reasoning Knowledge and Tasks  knowledge helps to describe tasks and goals for agents more explicitly  specification in accordance with their world model  in search-based problems, the goal is to a large degree determined by the context of search  find a state with specific properties  agents obtain new knowledge about their task and the environment  from the environment or designer  by reasoning  by observing changes  agents can adapt their behavior

© Franz Kurfess Reasoning Knowledge-Based Agent  maintains a repository for representations of facts about the world  often referred to as knowledge base  usually described through a knowledge representation language  one item in the knowledge base is usually called a sentence  also: formula, proposition, statement  frequently, but not necessarily a sentence in a natural language  operations to add and retrieve sentences  Tell, Ask  inference mechanism  new sentences may be added through reasoning about existing sentences

© Franz Kurfess Reasoning KB-Agent Program function KB-Agent(percept) returns action static KB// knowledge base t// counter indicating time; initially 0 Tell(KB, Make-Percept-Sequence(percept, t)) action := Ask (KB, Make-Action-Query(t)) Tell(KB, Make-Action-Sequence(action, t)) t := t + 1 return action

© Franz Kurfess Reasoning Description Levels for Agents  knowledge level or epistemological level  describes what the agent knows at an abstract level  Tell, Ask are used for interaction  should be easy to understand for human interaction  logical level  knowledge is encoded into sentences  visible representation of the knowledge base  often based on logic as a formal representation language  implementation level  physical representation on the agent architecture  symbols, strings, table entries, etc.

© Franz Kurfess Reasoning Are you Mr. Wumpus? [Illiad: User Friendly]

© Franz Kurfess Reasoning User Friendly and Wumpus [Illiad: User Friendly]

© Franz Kurfess Reasoning Wumpus World  early computer game  invented by Gregory Yob, 1975  originally in a dodecahedron topology  simplified to a two-dimensional grid for didactic purposes  agents explores a cave  rooms with properties  passageways connect rooms  test bed for intelligent agents

© Franz Kurfess Reasoning Wumpus Environment  grid of squares  limited by walls  a square may contain agents and objects  a square has properties that the agent may perceive  configuration is chosen randomly  pit  square that represents a bottomless hole  agent dies if it enters a pit  a pit causes a breeze in surrounding squares  gold  causes glitter in the square it is on

© Franz Kurfess Reasoning Wumpus  awful creature that eats agents  emanates a stench on adjacent squares  can be killed with an arrow  gives out a scream when it is killed  can be heard all over the cave

© Franz Kurfess Reasoning Wumpus Agents  task  find the gold, return it to the start square, leave the cave  capabilities  move around  perceive properties of squares  shoot once at a wumpus with a single arrow  grab the gold  limitations  the agent cannot perceive its own location

© Franz Kurfess Reasoning Wumpus World Diagram

© Franz Kurfess Reasoning Wumpus World PEAS Description movement (forward, turn right/left, exit) grab object in the same square shoot arrow (straight ahead) grid of rooms starting position, goal position (gold) pits, breeze in adjacent rooms wumpus position, stench in adjacent rooms +1000picking up the gold falling into a pit, get eaten by wumpus - 1 each action (step) - 10 shooting the arrow stench (wumpus), breeze(pit), glitter (gold) bump (wall), scream (wumpus dies) Performance Measures Environment Actuators Sensors [Stench, Breeze, Glitter, Bump, Scream] [Forward, Right, Left, Grab, Shoot, Exit]

© Franz Kurfess Reasoning PAGE description  percepts  Boolean vector [Stench, Breeze, Glitter, Bump, Scream]  actions  Forward, Turn-Right, Turn-Left, Grab, Shoot, Exit  goal  get the gold and get out as fast as possible  1000 points for climbing out of the cave with the gold  -1 point for each action  -10,000 points for getting killed  environment as described earlier

© Franz Kurfess Reasoning Life in the Wumpus World  before performing an action, it is advisable for the agent to “think” about it  perceive current state  avoid danger  wumpus, pits  seek rewards  gold  keep track of the environment  internal map, properties of squares  escape route

© Franz Kurfess Reasoning Wumpus World Exploration 1 World State Agent’s View Position: [1,1] Percept: [None, None, None, None, None] Action : Turn right, forward A OK 1,1 1,2 2,1 OK Inferences : current position is safe adjacent positions are safe [-----]

© Franz Kurfess Reasoning Wumpus World Exploration 2 World State Agent’s View Position: [2,1] Percept: [None, Breeze, None, None, None] Action : Turn right, turn right, forward, turn right,forward A OK 1,1 1,2 2,1 OK Inferences : current position is safe adjacent positions may be pits because of a perceived breeze [-B---] V P? 3,1 2,2

© Franz Kurfess Reasoning Wumpus World Exploration 3 World State Agent’s View Position: [1,2] Percept: [Stench, None, None, None, None] Action : Turn right, forward A OK 1,1 1,2 2,1 OK Inferences : current position is safe [2,2] not a pit, no breeze; hence [3,1] must be a pit [1,3] wumpus because of stench [S----] V P! P? V OK W! 3,1 2,2 1,3

© Franz Kurfess Reasoning Wumpus World Exploration 4 World State Agent’s View Position: [2,2] Percept: [None, None, None, None, None] Action : Turn right, forward A OK 1,1 1,2 2,1 OK Inferences : current position is safe [2,2] not a pit, no breeze; hence [3,1] must be a pit [1,3] wumpus because of stench [-----] V P! V OK W! 3,1 2,2 1,3 VOK 2,3 3,2

© Franz Kurfess Reasoning Wumpus World Exploration 5 World State Agent’s View Position: [3,2] Percept: [None, Breeze, None, None, None] Action : Turn left, turn left, forward, turn right, forward A OK 1,1 1,2 2,1 OK Inferences : current position is safe [3,3], [4,2] may be pits because of breeze; [-B---] V P! V OK W! 3,1 2,2 1,3 VOK 2,3 3,2 P? 3,3 4,2 V

© Franz Kurfess Reasoning Wumpus World Exploration 6 World State Agent’s View Position: [3,2] Percept: [Stench, Breeze, Glitter, None, None] Action : Grab gold, left, left, forward, right, forward, left, forward, climb out A OK 1,1 1,2 2,1 OK Inferences : current position is safe [2,4], [3,3] may be pits because of breeze; [1,3] wumpus [SBG--] V P! V OK W! 3,1 2,2 1,3 VOK 2,3 3,2 P? 3,3 4,2 VV P? 2,4

© Franz Kurfess Reasoning Wumpus Example World State Agent’s View Position: [1,1] Percept: [None, None, None, None, None] Action : Turn right, forward A OK 1,1 1,2 2,1 OK Inferences :current position is safe adjacent positions are safe [-----]

© Franz Kurfess Reasoning Hexagonal Wumpus World ABCDE FGHIJ KLMNO PQRST UVWXY

© Franz Kurfess Reasoning Reasoning in the Hexagonal Wumpus World ABCDE KLMNO UVWXY FGHIJ PQRST

© Franz Kurfess Reasoning Wumpus World Observations  many of the reasoning steps seem trivial to humans, but are not so trivial for computers  knowledge gained in different places at different times must be combined  absence of percepts is used to draw conclusions  sometimes the “closed-world assumption” is used: everything that is not explicitly stated is assumed to be false  not always realistic  reasoning methods should be generalized  ad hoc representation and methods may be sufficient for one situation, but may have to be augmented for others  e.g grid-based world vs. graph-based world

© Franz Kurfess Reasoning Why Logic in the Wumpus World  survival in the wumpus world requires advanced skills  explore the environment  remember information about the environment  connect different pieces of information  make decisions  evaluate risks  most animals are not “smart” enough to do well in the wumpus world  computers can perform the above activities  but some are difficult (the last three above)  an algorithmic solution may be possible, but not very flexible  logic provides a framework for knowledge representation and reasoning

© Franz Kurfess Reasoning Logic and the World  create a model  an abstract representation of the real-world problem  must capture essential aspects we’re interested in  reasoning  manipulate the model according to well-established reasoning methods (inference methods)  update the model whenever we perceive changes in the real world  decisions  make decisions based on the conclusions we derived  actions  perform the actions suggested in the decision made  observe the outcome, and update the model

© Franz Kurfess Reasoning Consistency Model - World  grounding is the connection between the real world and the model/reasoning process  ideally, all true statements in the model are true in the real world, and vice versa  ideally, all aspects of the real world are reflected in the models  appropriate representation  captures essential aspects  sound reasoning method  generates only correct results (truth-preserving)  complete reasoning method  is guaranteed to find all possible solutions

© Franz Kurfess Reasoning Diagram: Models and the Real World Real World Model Problem Solutions Problem: What is the best transportation method to get from SLO to Fresno? Experimental Approach: Try all the options out, and then decide. Analytical Approach: Assemble essential information about the different methods, determine an evaluation method, evaluate them, and decide.

© Franz Kurfess Reasoning Representation, Reasoning and Logic  Representation  storage of knowledge and information in a form suitable for treatment by computers  Inference  reasoning steps  drawing of conclusions on the basis of existing knowledge and percepts  Logics  formal inference methods  must have syntax and semantics

© Franz Kurfess Reasoning Knowledge Representation Languages  syntax  sentences of the language that are built according to the syntactic rules  some sentences may be nonsensical, but syntactically correct  semantics  refers to the facts about the world for a specific sentence  interprets the sentence in the context of the world  provides meaning for sentences  languages with precisely defined syntax and semantics can be called logics

© Franz Kurfess Reasoning Semantics  describes the meaning of a sentence  correspondence between sentences and facts in the world  must be defined by the author of the sentence in the form of an interpretation  frequent problem: “parasitic” interpretation  meaning is implied, e.g. by the strings that represent words  compositionality  the meaning of a sentence can be constructed from the meanings of its parts  truth of a sentence  the state of the real world corresponds to the meaning of a sentence

© Franz Kurfess Reasoning SentencesSentence Sentences and the Real World  syntax  describes the principles for constructing and combining sentences  e.g. BNF grammar for admissible sentences (“syntactically correct”)  inference rules to derive new sentences from existing ones through manipulations of the symbols representing the sentences  semantics  establishes the relationship between a sentence and the aspects of the real world it describes  can be checked directly by comparing sentences with the corresponding objects in the real world  not always feasible or practical  complex sentences can be checked by examining their individual parts

© Franz Kurfess Reasoning Diagram: Sentences and the Real World Model Sentences Sentence FollowsEntailsDerives Real World Syntax Semantics Symbols Symbol Strings Symbol String Semantics Syntax

© Franz Kurfess Reasoning Candidate Languages  programming languages  good for algorithms, data structures  limited expressiveness  problematic for many knowledge-based aspects  “There is a wumpus in some square”  natural language  very high expressiveness  very difficult to capture formally  imprecise syntax  ambiguous, context-dependent  mathematical logic  good expressiveness  reasonably suitable for computers

© Franz Kurfess Reasoning Post-Test

© Franz Kurfess Reasoning Evaluation  Criteria

© Franz Kurfess Reasoning Important Concepts and Terms  and  atomic sentence  automated reasoning  completeness  conjunction  constant  disjunction  domain  fact  false  implication  inference mechanism  inference rule  interpretation  knowledge representation  logic  model  or  proposition  propositional logic  propositional symbol  semantics  sentence  soundness  syntax  true  variable

© Franz Kurfess Reasoning Chapter Summary  some problems require more sophisticated techniques than searching for a solution  reasoning utilizes existing knowledge to generate new knowledge  requires appropriate representation and reasoning methods  logic provides a flexible and powerful framework for representation and reasoning  used for the formulation of abstract models that reflect essential aspects of the problem and environment  propositional logic is relatively simple, but also limited

© Franz Kurfess Reasoning