Winston Ch7
Winston Ch7
Winston Ch7
Winston, Chapter 7
Eisenberg/Fischer
1
AI Course, Fall 97
Overview
rules:
if-then rules
production systems
forward chaining
toy example: identify zoo animals
influential, classic system: R1, Xcon ---> configures
computer systems
backward chaining
toy example: bag groceries
influential, classic system: Mycin ----> diagnoses
diseases
ideas and principles that support many useful
applications of AI (e.g., expert systems)
Eisenberg/Fischer
2
AI Course, Fall 97
Definitions of Concepts
assertion:
a statement that something is true
example: Stretch is a giraffe or Stretch has long
legs
working memory:
collection of assertions
deduction systems:
then patterns specify new assertions to be placed
into working memory
antecedent: if pattern
consequent: then pattern
reaction system:
then patterns specify actions
example: put the item into the bag
Eisenberg/Fischer
3
AI Course, Fall 97
Backward Chaining:
form a hypothesis
use the antecedent-consequent rules to work
backward towards hypothesis-supporting assertions
Eisenberg/Fischer
4
AI Course, Fall 97
?x flies
?x lays eggs
then?x is a bird
Z5 If
?x is a mammal
?x eats meat
then?x is a carnivore
Eisenberg/Fischer
5
AI Course, Fall 97
?x is a mammal
?x has pointed teeth
?x has claws
?x has forward-pointing eyes
then?x is a carnivore
Z7 If
?x is a mammal
?x has hoofs
then?x is an ungulate
Z8 If
?x is a mammal
?x chews cud
then?x is an ungulate
Z9 if
?x is a. carnivore
?x has tawny color
?x has dark spots
then?x is a cheetah
Eisenberg/Fischer
6
AI Course, Fall 97
?x is a carnivore
?x has tawny color
?x has black strips
then?x is a tiger
Z11 If
?x is an ungulate
?x has long legs
?x has long neck
?x has tawny color
?x has dark spots
then?x is a giraffe
Z12 If
?x is an ungulate
?x has white color
?x has black stripes
then?x is a zebra
Eisenberg/Fischer
7
AI Course, Fall 97
?x is a bird
?x does not fly
?x has long legs
?x has long neck
?x is black and white
then?x is an ostrich
Z14 If
?x is a bird
?x does not fly
?x swims
?x is black and white
then?x is a penguin
Z15 If
?x is a bird
?x is a good flyer
then?x is an albatross
Eisenberg/Fischer
8
AI Course, Fall 97
Eisenberg/Fischer
--->
--->
--->
9
AI Course, Fall 97
Working Memory
A working memory is a representation in which
Lexically, there are assertions and applicationspecific symbols. There are also patterns that
contain application-specific symbols mixed with
pattern symbols.
Structurally, the assertions are lists of applicationspecific symbols.
Semantically, the assertions denote facts in some
world.
With constructors that
Add an assertion to working memory
With readers that
Produce a list of the matching assertions in working
memory, given a pattern
Eisenberg/Fischer
10
AI Course, Fall 97
Rule Base
A rule base is a representation in which
there is a working memory.
Lexically, there are rules.
Structurally, the rules consist of patterns. Some of
these patterns constitute the rule's if patterns; the
others constitute the rule's then pattern.
Semantically, rules denote constraints that enable
procedures to seek new assertions or to validate a
hypothesis.
With constructors that
Construct a rule, given an ordered list of if patterns
and a then pattern
With readers that
Produce a list of a given rule's if patterns
Produce a list of a given rule's then patterns
Eisenberg/Fischer
11
AI Course, Fall 97
Eisenberg/Fischer
12
AI Course, Fall 97
Eisenberg/Fischer
13
AI Course, Fall 97
Eisenberg/Fischer
14
AI Course, Fall 97
B1
If
step is check-order
potato chips are to be bagged
there is no Pepsi to be bagged
then
ask the customer whether he would like a
bottle of Pepsi
B2
If
then
step is check-order
step is no longer check-order
step is bag-large-items
B2 (add-delete form)
If
step is check-order
delete
step is check-order
add
step is bag-large-items
Eisenberg/Fischer
15
AI Course, Fall 97
B3
If
step is bag-large-items
a large item is to be bagged
the large item is a bottle
the current bag contains < 6 large items
delete the large item is to be bagged
add
the large item is in the current bag
B4
if
step is bag-large-items
a large item is to be bagged
the current bag contains < 6 large items
delete the large item is to be bagged
add
the large item is in the current bag
Eisenberg/Fischer
16
AI Course, Fall 97
Eisenberg/Fischer
17
AI Course, Fall 97
Eisenberg/Fischer
18
AI Course, Fall 97
Summary
Rule-based systems were developed to take advantage
of the fact that a great deal of useful knowledge can be
expressed in simple if-then rules.
Many rule-based systems are deduction systems. In
these systems, rules consist of antecedents and
consequents. In one example, a toy deduction system
identifies animals.
Deduction systems may chain together rules in forward
direction, from assertions to conclusions, or backward,
from hypotheses to questions. Whether chaining should
be forward or backward depends on the problem.
Many rule-based systems are reaction systems. In these
systems, rules consist of conditions and actions. A toy
reaction system bags groceries.
Reaction systems require conflict-resolution strategies to
determine which of many triggered rules should be allow
to fire.
Depth-first search can supply compatible bindings for
both forward chaining and backward chaining.
Eisenberg/Fischer
19
AI Course, Fall 97