Artificial Intelligence

Slides:



Advertisements
Similar presentations
Russell and Norvig Chapter 7
Advertisements

Logic.
Artificial Intelligence Knowledge-based Agents Russell and Norvig, Ch. 6, 7.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
1 Problem Solving CS 331 Dr M M Awais Representational Methods Formal Methods Propositional Logic Predicate Logic.
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.
Logical Agents Chapter 7.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
Rutgers CS440, Fall 2003 Propositional Logic Reading: Ch. 7, AIMA 2 nd Ed. (skip )
Logical Agents Chapter 7 (based on slides from Stuart Russell and Hwee Tou Ng)
Logical Agents. Knowledge bases Knowledge base = set of sentences in a formal language Declarative approach to building an agent (or other system): 
February 20, 2006AI: Chapter 7: Logical Agents1 Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent.
Logical Agents (NUS) Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
‘In which we introduce a logic that is sufficent for building knowledge- based agents!’
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part A Knowledge Representation and Reasoning.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
1 Problems in AI Problem Formulation Uninformed Search Heuristic Search Adversarial Search (Multi-agents) Knowledge RepresentationKnowledge Representation.
An Introduction to Artificial Intelligence – CE Chapter 7- Logical Agents Ramin Halavati
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 17, 2012.
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.
1 Logical Agents Chapter 7. 2 A simple knowledge-based agent The agent must be able to: –Represent states, actions, etc. –Incorporate new percepts –Update.
Knowledge Representation Lecture # 17, 18 & 19. Motivation (1) Up to now, we concentrated on search methods in worlds that can be relatively easily represented.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
Computing & Information Sciences Kansas State University Wednesday, 13 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 10 of 42 Wednesday, 13 September.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
Logical Agents Russell & Norvig Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean)
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
Logical Agents Chapter 7 Part I. 2 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic.
Logical Agents Chapter 7. Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence,
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)
CS666 AI P. T. Chung Logic Logical Agents Chapter 7.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Propositional Logic: Logical Agents (Part I)
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #6
Notes 7: Knowledge Representation, The Propositional Calculus
Knowledge and reasoning – second part
EA C461 – Artificial Intelligence Logical Agent
Notes 7: Knowledge Representation, The Propositional Calculus
Logical Agents Chapter 7.
Artificial Intelligence Logical Agents
Artificial Intelli-gence 1: logic agents
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Logical Agents Chapter 7 Selected and slightly modified slides from
Logical Agents Reading: Russell’s Chapter 7
Logical Agents.
Logical Agents Chapter 7.
Artificial Intelligence: Logic agents
Knowledge and reasoning – second part
Logical Agents Chapter 7.
Logical Agents Chapter 7 How do we reason about reasonable decisions
CS 416 Artificial Intelligence
Knowledge Representation I (Propositional Logic)
Problems in AI Problem Formulation Uninformed Search Heuristic Search
LECTURE 06 Logical Agent Course : T0264 – Artificial Intelligence
Logical Agents Prof. Dr. Widodo Budiharto 2018
Presentation transcript:

Artificial Intelligence Lecture 9 – Knowledge-Based Agents and Logic Dr. Muhammad Adnan Hashmi 26 December 2018

Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem proving Forward chaining Backward chaining Resolution. 26 December 2018

Knowledge Base Knowledge base: Set of sentences in a formal language Declarative approach for building an agent TELL it what it needs to know Then it can ASK itself what to do - answers should follow from the KB Agents can be viewed at the knowledge level What they know, regardless of implementation Or at the implementation level Data structures in KB and algorithms that manipulate them. 26 December 2018

A Knowledge-based Agent The agent must be able to: Represent states, actions, etc. Incorporate new percepts Update internal representations of the world Deduce hidden properties of the world Deduce appropriate actions. 26 December 2018

Wumpus World 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 Actuators: Left turn, Right turn, Forward, Grab, Release, Shoot Sensors: Breeze, Glitter, Smell. 26 December 2018

Wumpus World Characterization Observable? No - only local perception Deterministic? Yes -outcomes exactly specified Episodic? No - sequential at the level of actions Static? Yes -Wumpus and Pits do not move Discrete? Yes Single-agent? Yes 26 December 2018

Exploring the Wumpus World 26 December 2018

Exploring the Wumpus World 26 December 2018

Exploring the Wumpus World 26 December 2018

Exploring the Wumpus World 26 December 2018

Exploring the Wumpus World 26 December 2018

Exploring the Wumpus World 26 December 2018

Exploring the Wumpus World 26 December 2018

Exploring the Wumpus World 26 December 2018

Logic In General 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 E.g., the language of arithmetic x + 2 ≥ y is a sentence; x2 + y > is not a sentence x + 2 ≥ y is true iff the number x + 2 is no less than the number y x + 2 ≥ y is true in a world where x=7; y =1 x + 2 ≥ y is false in a world where x=0; y =6 26 December 2018

Entailment Entailment means that one thing follows from another Knowledge base KB entails sentence B iff B is true in all worlds where KB is true E.g., the KB containing “the Giants won" and “the Reds won” entails “Either the Giants won or the Reds won“ E.g., x + y =4 entails 4=x + y Entailment is a relationship between sentences (i.e., syntax) that is based on semantics. 26 December 2018

Models Logicians typically think in terms of models, which are formally structured worlds with respect to which truth can be evaluated We say m is a model of a sentence B if B is true in m M(B) is the set of all models of B Then KB |= B if and only if M(KB) M(B) E.g. KB = Giants won and Reds won B = Giants won M(B) could be also true for worlds that are different than the worlds of KB 26 December 2018

Models M(B) 26 December 2018

Entailment in the Wumpus World Situation after detecting nothing in [1,1], moving right, breeze in [2,1] Consider possible models for ?s, assuming only pits 3 Boolean choices, i.e., 8 possible models 26 December 2018

Wumpus Models 26 December 2018

Wumpus Models KB = Wumpus World Rules + Observations 26 December 2018

Wumpus Models KB = Wumpus World Rules + Observations Alpha_1 = “(1,2) is safe, KB |= Alpha_1 26 December 2018

Wumpus Models KB = Wumpus World Rules + Observations 26 December 2018

Wumpus Models KB = Wumpus World Rules + Observations Alpha_2 = “(2,2) is safe, KB |= Alpha_2 is false 26 December 2018

Inference First Order Logic (FOL): Allows complete and sound inference procedures Will answer any question whose answer follows from what is known by the KB. 26 December 2018 25

Propositional Logic Order of Precedence If S1 then S2 If and Only If 26 December 2018 If and Only If 26

Propositional Logic: Semantics If S1 is true, then I am claiming that S2 is true 26 December 2018 27

Truth Table for Connectives 26 December 2018 28

Wumpus World Sentences 26 December 2018 29

Wumpus World Sentences 26 December 2018 30

Wumpus World Truth Table 128 possible rows, only 3 make the KB true P1,2 is false for all 3; hence, no pit in P1,2 Evaluate the entailed sentences in these rows P2,2 is both false and true; hence, no conclusion can be drawn about the pit being in P2,2 26 December 2018 31

Inference by Enumeration 26 December 2018 32

Logical Equivalence 26 December 2018 33

Validity and Satisfiability If KB is true, alpha is always true. Hence, I can say that alpha follows from KB Suppose that KB=true. Then, this will become unsatisfiable only when alpha is true. Hence, I can say that alpha follows from KB 26 December 2018 34

Proof (A Sequence of Application of Inference Rules) 26 December 2018 35

Two Famous Inference Rules Modus Ponens And Rule Given that P implies Q, and I know that P is true, then I can infer Q Given that P AND Q is true, I can infer that P is true, and I can also infer that Q is true. 26 December 2018 36

Resolution 26 December 2018 37

Conversion to CNF 26 December 2018 38

Resolution Algorithm 26 December 2018 39

Example 26 December 2018 40

Resolution Example Add P1,2 P2,1 already added Del P2,1 Del P1,2 This returns an empty clause. So, alpha is true. 26 December 2018 41

Forward and Backward Chaining If this is true, and we know that the set of alphas is true, then we can infer beta. 26 December 2018 42

A and B are facts (leaves) Forward Chaining What you want to check whether it can be entailed (or not) A and B are facts (leaves) of the AND-OR graph) AND-OR Graph – Multiple links with Arcs indicate Conjunction, and without Arcs indicate Disjunction 26 December 2018 43

Forward Chaining Algorithm 26 December 2018 44

Forward Chaining Example 26 December 2018 45

Forward Chaining Example 26 December 2018 46

Forward Chaining Example 26 December 2018 47 47

Forward Chaining Example 26 December 2018 48

Forward Chaining Example 26 December 2018 49

Forward Chaining Example 26 December 2018 50

Forward Chaining Example 26 December 2018 51

Forward Chaining Example 26 December 2018 52

Soundness and Completeness It is sound: every inference is an application of Modus Ponens 26 December 2018 53

Backward Chaining 26 December 2018 54

Backward Chaining Example 26 December 2018 55

Backward Chaining Example 26 December 2018 56

Backward Chaining Example 26 December 2018 57

Backward Chaining Example 26 December 2018 58

Backward Chaining Example 26 December 2018 59

Backward Chaining Example 26 December 2018 60

Backward Chaining Example 26 December 2018 61

Backward Chaining Example 26 December 2018 62

Backward Chaining Example 26 December 2018 63

Backward Chaining Example 26 December 2018 64

Backward Chaining Example 26 December 2018 65

FC vs. BC 26 December 2018 66

Questions 26 December 2018