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

  1. To conclude `partying', use `drinking partying'

  2. To conclude `drinking', use `dehydration drinking'.

  3. To conclude `dehydration' use `heat and anxiety dehydration'.

  4. To conclude 'heat' use 'gym heat' and to conclude `anxiety' use `infStudent dehydration'

  5. To conclude 'gym' use `infStudent gym'.

  6. `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 about in backwards reasoning?

Reasoning as search

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

Questions

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

Exercises cont.

Resources