• Aucun résultat trouvé

HANDLING UNCERTAINTIES IN AN EXPERT SYSTEM

Dans le document FUZZY EXPERT SYSTEMS AND FUZZY REASONING (Page 42-46)

2 Rule-Based Systems: Overview

2.7 HANDLING UNCERTAINTIES IN AN EXPERT SYSTEM

There are many sources of uncertainty in data. There is, of course, imprecision in numerical measurements (we might report a speed as 60 miles/h when it is actually 62.345. . .. There is also uncertainty as to facts (I think her name is Joan, but I’m not sure), and ambiguous terms (He was going fast). There are several ways of handling uncertainties in an expert system, and of combining uncertainties (He is heavy, short, and middleaged). In FLOPS, we represent uncertainties as truth values, how sure we are that a datum or a rule is valid. Ways of expressing and combining uncertainties include probability; fuzzy logic; Bayes’ theorem; and Dempster – Shafer theory, each with their own advantages, disadvantages and problems.

There are two simple ways of representing uncertainties. In the first, a single number (usually, but not always, between 0 and 1), called variously certainty factor, confidence, or truth value represents how sure we are that the data to which the factor is attached is indeed valid. In the second, two numbers are attached to a value, one representing a lower limit of certainty (calledbeliefin Dempster – Shafer theory andnecessityin fuzzy mathematics) and the second representing an upper limit (calledplausibilityin Dempster – Shafer theory andpossibilityin fuzzy

2.7 HANDLING UNCERTAINTIES IN AN EXPERT SYSTEM 25

mathematics). The lower limit can represent the extent to which the data support a value, and the upper limit can represent the extent to which the data refute a value.

When a single number is used to represent uncertainty it represents the extent to which the data support a value; if we believe the value to be invalid, its truth value would be 0; if we believe a value to be true, its truth value would be one. It is not immediately clear how complete ignorance should be represented. FLOPS is pessi-mistic; if it does not know anything about a value, FLOPS assumes it to be false.

When two numbers are used to represent uncertainty, we have a clear way of unambiguously representing complete ignorance. If we do not know anything about the truth of a value, its lower limit (say belief) is 0, since at this point no data have supported the value; its upper limit (say plausibility) is 1, since no data have refuted the value. As we continue to reason, we would expect that the two values would move closer together.

Clearly, the two-value mode of representing uncertainties has an intellectual appeal, and a substantial body of theory calledinterval logichas grown up around it. However, most of us do not usually reason in this complicated a fashion, and FLOPS is content to represent uncertainty as a single number (which we sometimes call a truth value), sometimes a truth value and sometimes (when dealing with fuzzy sets) a grade of membership. All these terms represent pretty much the same thing;

our truth value that a datum is valid. FLOPS also prefers to use fuzzy logic for com-bining uncertainties; we cannot present a totally convincing argument for this, but fuzzy systems theory seems to supply the tools that we need. Especially important is the ability of fuzzy systems theory to deal with ambiguities and contradictions, where fuzzy sets provide the only clean mathematical framework.

In its present incarnation, FLOPS represents truth values as integers between 0 and 1000, rather than as decimal fractions between 0 and 1.

2.8 SUMMARY

Knowledge may be viewed as factual, information that we have stored in memory, or procedural, skills in using the data at hand. In an expert system, factual knowledge is stored as data held in the computer’s memory, and procedural knowledge is stored as rules. Production rules are written as “IF (the data satisfy the specified conditions) THEN (perform the specified actions)”. The IF part is the rule antecedent; the THEN part is the rule consequent. The antecedent is a fuzzy logical proposition, that is, a statement regarding data whose truth value may be determined. If a rule’s antece-dent is sufficiently true, and the rule is activated, the rule is said to be fireable.

We are particularly interested in data-driven systems. In such systems, the fire-ability of a rule is determined by whether the data satisfy the antecedent and by whether the rule has been activated, but does not depend on the position of the rule in the program. Systems in which whether or not a statement will be executed depends on the position of the rule in a program are called procedural; nearly all common computer languages (Cþþ, Fortran, Basic, etc.) are procedural. Data-driven systems are non-procedural.

The interaction between rules and data that occurs when running a fuzzy expert system is considerably more complex than the interaction between statements and data in a procedural language such as C or Fortran. In a rule-based systems, there is a sequence of events: data make rules fireable, and rules are fired creating new or modified data; these data make other rules fireable, and so on. Some of the rules to be fired may serve to control the fireability of individual rules, blocks of rules, or even entire programs; these are calledmetarules.The precise nature of the data-rules-data- sequence depends on whether sequential or parallel rule-firing is in effect.

Parallel rule-firing is simpler in concept than sequential rule-firing. In sequential rule firing, a single rule is picked for firing from all concurrently fireable rules; the rest are stacked for firing if no rules are newly fireable, the backtracking process. In parallel rule firing, all fireable rules are effectively fired concurrently; there are no fireable but unfired rules for backtracking. If information is to be elicited from the user in a context-dependent fashion, so that the next question to be asked depends on the answer to the previous question, sequential rule-firing is appropriate; other-wise, parallel rule-firing is usually to be preferred.

A FLOPS program is made up of a series of commands drawn from a list of about 80. FLOPS programs have two operational modes:command modeandrun mode.In command mode, FLOPS executes commands procedurally, one after another, but rules are not fired. In run mode, FLOPS fires rules, that is, executes the commands in the consequents of fireable rules. If no more rules are fireable, FLOPS reverts to command mode. In command mode, FLOPS operates procedurally, executing com-mands in the sequence in which they appear in the program; but in run mode, FLOPS is data-driven and non-procedural.

FLOPS begins in command mode, reading a FLOPS program and executing its commands in sequence. When a “rule” command is encountered, the rule antecedent is compiled and the rule entered into FLOPS memory, but the rule is not fired. When a “run” command is encountered, FLOPS switches from command mode to run mode, and begins firing rules. If no more rules are fireable, FLOPS reverts to command mode. (There are also other ways to switch from run to command mode.) Data-driven production systems can involve much systems overhead in determi-ning which rules are newly fireable. By keeping track of partial matches between rule antecedents and data, the Rete algorithm by Charles Forgy reduces this over-head dramatically. Nevertheless, this systems overover-head can still constitute a real problem. Parallel rule firing reduces systems overhead still further.

Expert systems may be forward or backward chaining. In forward chaining systems, we reason from antecedent truth to consequent truth; that is, we reason from facts in the rule antecedent that we know to be true to establish new facts whose truth is implied by the antecedent. Backward chaining reverses this; we attempt to find facts to establish the truth of some goal state. It is quite possible to emulate backward chaining with a forward chaining system.

Modularization of expert system programs is essential for both their construction and their debugging, but is even more important conceptually. At the lowest level, modularization is accomplished by assigning rules to blocks, so that we can view the program organization in terms of the organization of the rule blocks. Metarules are

2.8 SUMMARY 27

used to activate and deactivate rule blocks. At a higher level, modularization can occur as complete programs, which may be other FLOPS programs or may be procedural language programs. Communication among these programs can be accomplished by a blackboard. Blackboard systems may be quite complex, but the essential feature is a common area where the different programs involved can exchange information in a common format.

All fuzzy expert systems and some expert systems not based in fuzzy logic have the problem of representing uncertainties. Most often, a single number between 0 and 1 called truth value, certainty factor, or truth value represents how sure we are that a datum is valid. Sometimes two numbers are used; a lower number representing the extent to which other data support the validity of a datum, and the upper representing the extent to which other data fail to refute the value of a datum. The lower number is callednecessityin fuzzy systems theory andbeliefin Dempster – Shafer theory; the lower is called possibility in fuzzy theory and plausibility in Dempster – Shafer theory. The two-valued uncertainty theory is sometimes calledinterval logic.

2.9 QUESTIONS

2.1 We have said that a knowledge base consists of data and rules. Does this give a complete representation of knowledge?

2.2 How should we handle a problem that requires a lot of numerical processing?

2.3 What is the difference between a rule antecedent and a rule consequent?

2.4 What data types should be available in a fuzzy expert system?

2.5 Can the consequent of a rule contain an instruction to create a rule?

2.6 Are there any restrictions on what type of instruction can be included in a rule consequent?

2.7 What is a metarule?

2.8 How do procedural and data-driven programs differ?

2.9 What is the difference between run and command operational modes?

2.10 Under what circumstance is serial rule-firing mode desirable?

2.11 In an expert system, we have goals we wish to reach and data from which to work.

How are goals and data related in forward chaining? In backward chaining?

2.12 What purpose does a blackboard system serve?

2.13 How are uncertainties represented in FLOPS?

3 Fuzzy Logic, Fuzzy Sets, and

Dans le document FUZZY EXPERT SYSTEMS AND FUZZY REASONING (Page 42-46)