KR-IST - Lecture 7a Automated Reasoning
Chris Thornton
Introduction
Assuming we have some facts and rules showing how
implications may be derived from those facts, we can use an
adapted search method to explore potential implications and
determine which conclusions are justifiable.
This is known as automated reasoning.
Rules of partying
drinking partying
dehydration drinking
heat and anxiety dehydration
gym heat
sleep and anxiety dehydration
infStudent anxiety
infStudent gym
(Each line here represents a separate rule with the
operator denoting `implies'.)
Exploring implication sequences
A set of rules forms a rulebase.
Each rule can be used to produce a new fact (i.e., a
conclusion) from one or more established facts.
But the process can work in two different ways.
Forwards reasoning
In forwards reasoning we use a `forwards chaining' search
process to recursively generate conclusions.
Taking whatever facts are initially established, we check to
see which rules may then be used, i.e, which rules have all
their conditions satisfied by the facts.
We then add the relevant conclusion(s) and repeat the operation,
continuing on until no new conclusions can be produced.
Forwards-chaining with the partying rulebase
Assume `infStudent' is the only established fact.
On the basis of this we can add
On the basis of {infStudent, anxiety, gym} we can add
And on the basis of {infStudent, anxiety, gym, heat}
we can add
And so on.
Note that we are expanding a tree of `nodes' in the usual way but in
this case the nodes are sets of facts/conclusions.
Forwards reasoning may generate many irrelevant conclusions
Unfortunately, forwards reasoning has the effect of generating every
justifiable conclusion, including ones that can play no role in
justifying any useful or significant conclusions.
In an alternative approach, we start from the conclusion that we would
like to draw and work `backwards' through the implication sequences to
see whether it can be justified in terms of the known facts.
Backwards reasoning procedure
Assume we would like to know whether `partying' can be concluded on the
basis of `infStudent' and the partying rulebase.
First, we identify a rule which has `partying' as its
conclusion.
We then try to determine whether each of its conditions can be
concluded, using the exact, same procedure to do it.
Backwards-chaining example
- To conclude `partying', use `drinking partying'
- To conclude `drinking', use `dehydration
drinking'.
- To conclude `dehydration' use `heat and anxiety
dehydration'.
- To conclude 'heat' use 'gym heat' and to
conclude `anxiety' use `infStudent
dehydration'
- To conclude 'gym' use `infStudent gym'.
- `infStudent' is an established fact.
The conclusion `partying' is therefore justified by the rules
and the known facts.
Question
Backwards and forwards reasoning are both applications of search.
In forwards reasoning
- What are the states?
- Where do successors come from?
What about in backwards reasoning?
Reasoning as search
- Forwards reasoning is the process of searching for a solution path
connecting initial fact(s) with desired conclusion(s). States are
combinations of facts and each rule is a method for generating a single
successor (i.e., it defines a single transition).
- Backwards reasoning is the process of searching for a solution path
connecting some final conclusion with one or more initial facts. States
are combinations of required conclusions and the transitions are defined
by the rules. Each rule is a method for generating further `required
conclusions' from existing required conclusions.
Backwards reasoning and the AND/OR tree
Normally, each node in a search tree `branches' according to the
alternative transitions which are possible at the given state.
The search tree is an OR-tree because every node is an OR-node.
However, in backwards reasoning, each node branches in two different
ways.
Any rule that satisfies the relevant goal represents an alternative
transition. But since it may embody more than one condition, it may
produce multiple subgoals all of which need to be satisfied.
So the branches from any
node in a backwards-reasoning tree divide up into groups of `AND'
branches.
Each group is an alternative (an `OR').
The tree is therefore an AND/OR tree.
Forwards reasoning search tree
Backwards reasoning search tree
Relative strengths of forwards and backwards reasoning
Choice of reasoning strategy depends on the
properties of the rule set.
If there is a single goal (conclusion), backward chaining will normally
be more efficient, as there is no wasteful generation of irrelevant
conclusions.
But if there are many different ways of demonstrating any
particular fact, backwards chaining may be wasteful.
Forward chaining is likely to be more efficient if there are
many conclusions to be drawn or where we have a small
set of initial facts. It may also be preferable if conclusions
tend to have many rules.
Backward chaining is likely to be more efficient where there
is a single conclusion to be drawn or where the initial set of
facts is large.
Summary
- In a rulebase, each rule shows the conditions which must be satisfied
in order to derive the specified conclusion.
- The conclusion(s) of one rule may satisfy the conditions of another.
- Automated reasoning is the process of searching for a chain of rules
which connect certain facts with given conclusions.
- The search process can work `forwards' from facts to conclusions, or
`backwards' from conclusions to facts.
- The search tree for forwards reasoning is an OR-tree. The search tree
for backwards reasoning is an AND-tree.
Questions
- Would you say that a forwards-chaining reasoner is goal
directed?
Exercises
In this fault-diagnosis rule set, each line is a rule
constructed from a conclusion (the word after `implies') and
one or more conditions (words before `implies').
unexpectedBehaviour and dataCorruption --> diskOverflow
unexpectedBehaviour and networkExposure --> virusInfection
broadband --> networkExposure
broadband --> intenseNetworkUsage
attachmentsOpened --> networkExposure
gamesDownloads --> networkExposure
ADSLConnection --> broadband
cableConnection --> broadband
networkExposure --> firewallNeeded
networkExposure --> emailCapture
crashing --> unexpectedBehaviour
freezing --> unexpectedBehaviour
- Show all the conclusions which can be established using
forwards reasoning from the fact `ADSLConnection'.
Exercises cont.
- Draw out these conclusions in the form of a tree of
deductions with `ADSLConnection' at the root.
- Using backwards reasoning, show whether `virusInfection'
may be concluded on the basis of the facts `ADSLConnection',
`gamesDownloads' and `freezing'.
- Draw out the full AND/OR tree for the conclusion
`virusInfection'. Then use this tree to determine which
fact-sets will justify this conclusion.
- Estimate the branching factor for the search space for
forwards-reasoning with these rules.
- Estimate the branching factor for the search space for
backwards-reasoning with these rules.
- Identify a minimal alteration of the rules which will enable the
conclusion `diskOverflow'.
Resources
- Russel and Norvig, Chaps. 6-10.