24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3. Forward Chaining 29<br />

3. Forward Chaining and Rules<br />

In this chapter we shall describe the rules and inference engine of the<br />

forward chaining system and contrast it with backward chaining. Rules are<br />

really the life-blood of expert systems technology, and provide elegant,<br />

expressive and intuitive means of expressing knowledge.<br />

A simple rule may be, 'if it is raining then carry an umbrella'. Then given<br />

the fact that 'it is raining', we can infer or derive that we should 'carry an<br />

umbrella'. Facts can be thought of as degenerate cases of rules, i.e. rules<br />

without any pre-conditions, or rules whose pre-condition part is always true.<br />

Facts may be stored in a local database, retrieved from some external<br />

database, obtained through user question and answer interaction, stored as<br />

global variables, or derived from other rules.<br />

Another rule may be 'if it is raining then the ground is wet'. Now, given<br />

the same fact that 'it is raining', we can also infer or derive that 'the ground<br />

is wet', and store this as a fact, or, if ground is an attribute of some frame,<br />

set its value to wet.<br />

The collection of all facts is often referred to as the fact base. In rule-based<br />

programming we use an inference engine to match rules against facts to<br />

produce new facts which means we can then use new rules, until we reach<br />

some final state.<br />

Trying to prove the pre-conditions of forward chaining rules may well<br />

involve some backward chaining evaluation of sub-goals, i.e. there may be a<br />

backward chaining program for determining the current state of the<br />

weather. The integration of the two inference mechanisms can be as simple<br />

or as complicated as required. Notice, in the absence of information,<br />

execution fails and conditions in effect are deemed false. This is known as<br />

the closed world assumption.<br />

We shall use the following propositional example to show the difference<br />

between backward chaining inferences and forward chaining inferences.<br />

A if B and C .<br />

B if D .<br />

C .<br />

D .<br />

The first two statements are rules, and the second two statements are<br />

axioms (or facts).<br />

Forward Chaining<br />

Forward chaining inference is very much akin to the way in which<br />

mathematical proofs are presented (but not necessarily arrived at). Using<br />

<strong>flex</strong> toolkit

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!