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 30<br />

the axioms as a starting point, further conclusions (lemmas in a<br />

mathematical proof) can be added to what is known by the bottom-up<br />

application of the rules. For example, since we already know D (it is an<br />

axiom), we can use the second rule (B if D) to conclude B. From the lemma<br />

B and the axiom C we can then use the first rule to conclude A. This is often<br />

referred to as data-driven reasoning, because we are using the data to drive<br />

forward the chain of inferences.<br />

Within a forward chaining system, the rules above can be interpreted as:<br />

given D, B may be inferred<br />

<strong>flex</strong> toolkit<br />

given B and C, A may be inferred<br />

What this style of reasoning suffers from is a lack of a sense of direction, or<br />

purpose. When deciding which rule to apply next, it is very difficult to decide<br />

which conclusion will get us closer to the desired goal. In this mode, you are<br />

likely to generate some valid configuration, with which you may or may not<br />

be happy.<br />

Forward chaining has proved itself very suitable to configuration problems,<br />

where you do not know what the final configuration will be, but you know<br />

how to combine bits of data together according to some combining rules,<br />

and know that if you just keep applying rules, then eventually you will have<br />

combined everything accordingly.<br />

A production rule system, as implemented in <strong>flex</strong>, can be viewed as a kind<br />

of bottom-up reasoning system where you push the data up through the<br />

rules to get more inferred data. Although the propositional rules here only<br />

have one action per rule (i.e. add the conclusion to what is known), a<br />

production rule may contain multiple actions and conclusions for updating<br />

the state of the system.<br />

Backward Chaining<br />

Backward chaining inference begins with a conclusion that needs to be<br />

established, say A. At each point during the inference, the rules are used to<br />

reduce the current goal or goals to a collection of sub-goals. For example,<br />

the first rule suggests that the goal of showing A can be reduced to the subgoals<br />

of showing B and C. This process continues until all of the remaining<br />

sub-goals correspond to axioms, such as C and D. This is often referred to<br />

as goal-driven reasoning, because we are constantly trying to prove goals<br />

by proving their sub-goals.<br />

This style of reasoning is very effective when we wish to determine whether<br />

or not a certain condition holds. As in Prolog, goals are replaced by sub-

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

Saved successfully!

Ooh no, something went wrong!