Docsity

Artificial Intelligence Lecture 10: Logical Agents and Knowledge-Based Systems - Prof. Dav, Study notes of Computer Science

Toggle sidebar
bg1
Page 1
CS 416
Artificial Intelligence
Lecture 10
Logical Agents
Chapter 7
Midterm Exam
• Midterm will be on Thursday, March 13th
• It will cover material up until Feb 27th
Chess Article
•Garry Kasparov reflects on computerized chess
– IBM should have released the contents of Deep Blue to chess
community to advance research of computation as it relates to
chess
– Kudos to Deep Junior for putting information in public domain
so state of the art can advance
– Deep Blue made one good move the surprised Kasparov
(though he thinks a person was in the loop)
– Deep Junior made a fantastic sacrifice that reflects a new
accomplishment for computerized chess
•http://www.opinionjourn al.com/extra/?id=110003081
Logical Agents
• What are we talking about, “logical?”
– Aren’t search-based chess programs logical
• Yes, but knowledge is used in a very specific way
– Win the game
– Not useful for extracting strategies or understanding other aspects
of chess
– We want to develop more general-purpose
knowledge systems that support a variety of logical
analyses
Why study knowledge-based agents
• Partially observable environments
– combine available information (percepts) with general
knowledge to select actions
• Natural Language
– Language is too complex and ambiguous. Problem-solving
agents are impeded by high branching factor.
• Flexibility
– Knowledge can be reused for novel tasks. New knowledge
can be added to improve future performance.
Components of knowledge-based agent
•Knowledge Base
– Store information
• knowledge representation language
– Add information (Tell)
– Retrieve information (Ask)
– Perform inference
• derive new sentences (knowledge) from existing sentences
pf3
pf4
pf5

Partial preview of the text

Download Artificial Intelligence Lecture 10: Logical Agents and Knowledge-Based Systems - Prof. Dav and more Study notes Computer Science in PDF only on Docsity!

CS 416

Artificial Intelligence

Lecture 10 Logical Agents Chapter 7

Midterm Exam

  • Midterm will be on Thursday, March 13 th
  • It will cover material up until Feb 27 th

Chess Article

•Garry Kasparov reflects on computerized chess

  • IBM should have released the contents of Deep Blue to chess community to advance research of computation as it relates to chess
  • Kudos to Deep Junior for putting information in public domain so state of the art can advance
  • Deep Blue made one good move the surprised Kasparov (though he thinks a person was in the loop)
  • Deep Junior made a fantastic sacrifice that reflects a new accomplishment for computerized chess •http://www.opinionjournal.com/extra/?id=

Logical Agents

  • What are we talking about, “logical?”
    • Aren’t search-based chess programs logical
      • Yes, but knowledge is used in a very specific way
        • Win the game
        • Not useful for extracting strategies or understanding other aspects of chess
    • We want to develop more general-purpose knowledge systems that support a variety of logical analyses

Why study knowledge-based agents

  • Partially observable environments
    • combine available information (percepts) with general knowledge to select actions
  • Natural Language
    • Language is too complex and ambiguous. Problem-solving agents are impeded by high branching factor.
  • Flexibility
    • Knowledge can be reused for novel tasks. New knowledge can be added to improve future performance.

Components of knowledge-based agent

•Knowledge Base

  • Store information
    • knowledge representation language
  • Add information (Tell)
  • Retrieve information (Ask)
  • Perform inference
    • derive new sentences (knowledge) from existing sentences

The wumpus world

  • A scary world, indeed
    • A maze in a cave
    • A wumpus who will eat you
    • One arrow that can kill the wumpus
    • Pits that can entrap you (but not the wumpus for it is too large to fall in)
    • A heap of gold somewhere

But you have sensing and action

  • Sensing (each is either on or off – a single bit)
    • wumpus emits a stench in adjacent squares
    • pits cause a breeze in adjacent squares
    • gold causes glitter you see when in the square
    • walking into wall causes a bump
    • death of wumpus can be heard everywhere in world

But you have sensing and action

  • Action
    • You can turn left or right 90 degrees
    • You can move forward
    • You can shoot an arrow in your facing direction

An example

An example Our agent played well

  • Used inference to relate two different percepts observed from different locations
  • Agent is guaranteed to draw correct conclusions if percepts are correct

Logical inference

  • Entailment permitted logic
    • we inferred new knowledge from entailments
  • Model Checking
    • We enumerated all possibilities to ensure inference was complete

Inference Algorithms

  • Sound
    • only entailed sentences are inferred
    • always true
  • Complete
    • inference algorithm can derive any sentence that is entailed
    • can inference algorithm become caught in infinite loop?

Propositional (Boolean) Logic

  • Syntax of allowable sentences
    • atomic sentences
      • indivisible syntactic elements
      • one propositional symbol
      • Use uppercase letters as representation
      • True and False are predefined proposition symbols

Complex sentences

  • Formed from symbols using connectives
    • ~ (not): the negation
    • ^ (and): the conjunction
    • V (or): the disjunction
    • => (implies): the implication
    • Ù (if and only if): the biconditional

Backus-Naur Form (BNF) Propositional (Boolean) Logic

  • Semantics
    • given a particular model (situation), what are the rules that determine the truth of a sentence?
    • use a truth table to compute the value of any sentence with respect to a model by recursive evaluation

Truth table Example from wumpus

•A square is breezy only if a neighboring square has a pit

  • B1,1 Ù (P1,2 V P2,1)

•A square is breezy if a neighboring square has a pit

  • (P1,2 V P2,1) => B1,

•Former is more powerful and true to wumpus rules

A wumpus knowledge base

  • Initial conditions
    • R 1 : ~P (^) 1,1 no pit in [1,1]
  • Rules of Breezes (for a few example squares) - R 2 : B (^) 1,1 Ù (P (^) 1,2 V P (^) 2,1) - R 3 : B (^) 2,1 Ù (P (^) 1,1 V P (^) 2,1 V P (^) 3,1)
  • Percepts
    • R 4 : ~B (^) 1,
    • R 5 : B (^) 2, •We know: R 1 ^ R 2 ^ R 3 ^ R 4 ^ R 5

Inference

  • Does KB entail α (KB -> α?)
    • Is there a pit in [1,2]: P (^) 1,2?
    • Consider only what we need
      • B1,1 B2,1 P1,1 P1,2 P2,1 P2,2 P3,
      • 2^7 permutations of models to check
    • For each model, see if KB is true
    • For all KB = True, see if α is true

Inference

  • Truth table

Concepts related to entailment

•logical equivalence

  • a and b are logically equivalent if they are true in the same set of models… aÙ b •validity (or tautology)
  • a sentence that is valid in all models
  • P V ~P
  • deduction theorem: a entails b if and only if a implies b •satisfiability
  • a sentence that is true in some model
  • a entails b Ù (a ^ ~b) is unsatisfiable