• Nie Znaleziono Wyników

3. Knowledge Base of a Rule-Based System as a Model for the Logic of Rules

N/A
N/A
Protected

Academic year: 2021

Share "3. Knowledge Base of a Rule-Based System as a Model for the Logic of Rules"

Copied!
12
0
0

Pełen tekst

(1)

HOW TO SECURE A HIGH QUALITY KNOWLEDGE BASE IN A RULE-BASED SYSTEM WITH UNCERTAINTY?

BEATAM. JANKOWSKA

Institute of Control and Information Engineering, Pozna´n University of Technology Pl. M. Skłodowskiej-Curie 5, 60–965 Pozna´n, Poland

e-mail: beata.jankowska@put.poznan.pl

Although the first rule-based systems were created as early as thirty years ago, this methodology of expert systems designing still proves to be useful. It becomes especially important in medical applications, while treating evidence given in an electronic format. Constructing the knowledge base of a rule-based system and, especially, of a system with uncertainty is a difficult task because of the size of this base as well as its heterogeneous character. The base consists of facts, ordinary rules and meta-rules, which differ from each other regarding both the syntax structure and the semantics. Having no tool to aid designing and maintaining the knowledge base of a rule-based system with uncertainty, we propose the algebra of rules with uncertainty which gives us theoretical foundations to build such a tool. Using the tool, it will be possible to indicate the facts and rules of a redundant character, as well as the pairs of facts and the pairs of rules which are contradictory to each other. The above tool is used in designing and maintaining the knowledge base of a system intended to prognosticate the effects of a medical treatment of the bronchial asthma disease.

Keywords: rule-based systems, uncertainty, knowledge base, truth maintenance module

1. Introduction

The amount of knowledge available in different fields of science is increasing systematically. Its assimilation by an individual person is becoming more and more difficult.

Therefore, the obvious result is the increasing importance of expert systems (Giarratano and Riley, 2004); they help us to evaluate different phenomena and situations, to make decisions and prognosticate elements of the future.

On the other hand, the acquired knowledge often has a relative, contextual character. Its particular significance can be conditioned by time and place, as well as other less obvious factors. For this reason, expert systems with uncertainty have nowadays a very special role to play.

Generally speaking, what we mean by the term of uncertainty is the lack of information which is precise enough to make a decision. The uncertainty is the sub- ject of many formal theories, e.g., the following ones:

• Pascal-Fermat’s theory, introduced in the 18th cen- tury and considered to be a classical theory of prob- ability;

• Carnap’s theory (Carnap, 1945), pointed at a new type of probability, also called an epistemic proba- bility;

• Dempster-Shaffer’s theory (Shaffer, 1976), devel- oped in the 1960s and 1970s in accordance with Car- nap’s theory;

• Zadeh’s theory (Zadeh, 1965), the most general the- ory of uncertainty that has been formulated so far;

• belief networks (Pearl, 1988), introduced in the 1980s and being developed intensively up to now, based on using the Bayes theory of conditional prob- abilities.

Let us have a closer look at some of those.

Both the Pascal-Fermat and Bayes theories are dif- ferent from the others. What makes the main difference between them is the way how the notion of ignorance is used. Namely, the classical theories claim that the evi- dence not supporting a hypothesisH is an evidence for the refutation ofH. There is no place for ignorance here (it follows from the axiomP (H) + P (H) = 1). Unlike here, in the Carnap and Dempster-Shaffer theories, while lacking the knowledge aboutH, we do not have to assign any belief toH or to its negation H. Instead, we may as- sign the remaining belief to the environment (the set of all possible hypotheses)θ. In order to deal with the idea of ignorance, Dempster and Shaffer consider the following certainty factors in their theory:

• the certainty factor cf: 2θ→ [0; 1], fulfilling the con- ditions cf(∅) = 0 and Σ(X ∈ 2θ) cf(X) = 1;

• the global certainty factor Bel: 2θ→ [0, 1], such that Bel(H) = Σ(X ⊆ H) cf(X);

(2)

• the plausibility factor Pls: 2θ → [0, 1], such that Pls(H) = 1 − Bel(H) = 1 − Σ(X ⊆ H) cf(X);

• the ignorance factor Igr: 2θ → [0, 1], such that Igr(H) = Pls(H) − Bel(H).

By means of certainty factors, we are also able to estimate how much credit should be granted to the con- clusions obtained as the results of processing the evidence coming from different sources. In such cases, it is suf- ficient to apply the following Dempster rule of combina- tion:

cf1⊕ cf2(Z) = Σ(X ∩ Y = Z) cf1(X) ∗ cf2(Y ),

in which X and Y are any input hypotheses, Z is a re- sult hypothesis, cf1(X), cf2(Y ) and cf1⊕ cf2(Z) stand for the certainty factors ofX, Y and Z, respectively.

Having rigorous mathematical foundations, the Dempster-Shaffer theory has been widely implemented in expert systems, particularly in rule-based systems, where the uncertainty of knowledge is expressed through cer- tainty factors attributed to facts and rules (Duda et al., 1979; Lucas et al., 1989; Shortliffe, 1976). The course and final result of the reasoning process depend on cal- culating the certainty factors of conclusions, and also on the algorithm of conflict resolution in the set of active rules. This algorithm, in many implementations, takes as the most important criterion the one of how detailed a rule is, which is measured by the number and the inter- nal complexity of its premises. Then, it usually considers the rule newness, measured by the moment of introduc- ing its premises into the knowledge base. In other cases, a decisive factor to select the rule is its priority. It is given statically in the process of designing the knowledge base, or determined dynamically on the basis of certainty fac- tors of the rule and its premises.

The notion of ignorance is widely discussed in Zadeh’s theory, in which all hypotheses from the envi- ronment are characterized not by means of numerical cer- tainty factors, but with the so-called membership func- tions.

Consider the following definitions founded on the proposal of certainty factors:

(fact-A) CF 0.8 fact

(defrule example (fact-A) CF 0.3

rule

(assert (fact-B) CF 1.0) (assert (∼fact-C) CF 0.5)).

In Zadeh’s fuzzy logic, they take the following, equivalent form:

(fact-A, almost-certain) fact (defrule example

(fact-A, rather-uncertain)

rule

(assert (fact-B) certain)

(assert (∼fact-C) medium-certain)).

Here, the notions almost-certain, rather- certain, certain, and medium-certain are all fuzzy notions used to determine the frequency of the events. Without going into details, note that in order to represent the first three notions, we shall use the member- ship S-function and, to represent medium-certain, the membership Π-function.

Clearly, the conclusions deduced in high quality fuzzy systems usually meet our requirements much bet- ter than those deduced with the use of Dempster’s rule of combination. Nevertheless, we shall point out that a fuzzy system will perform well if and only if the numerical evi- dence, obtained as an experiment result, is correctly trans- formed to a set of membership functions. Such a coding (and decoding) is not a trivial task.

Since the late 1980s, the designers started focusing more on the methods of representing uncertain knowl- edge in the form of probabilistic graphical models and, in particular, belief networks. As it has been recently proved, the certainty factors used in rule-based systems are in fact closely related to the uncertainty model used in belief networks (Lucas, 2001). Because of their character, each method is useful in different applications. Therefore, in the cases where knowledge has a character of simple, linear cause-and-effect dependencies, the belief networks prove to be the most convenient. However, in the cases where knowledge has a character of complex implications, which reflect the course of expert thinking and combine a multi-parameter input data with a multi-parameter out- put data, the rule-based systems are better. For example, in medical applications, knowledge representation in the form of belief networks turns out to be useful in diagnos- tic systems, whereas the knowledge in the form of rules is good in systems assigned to plan and prognosticate the ef- fects of pharmacological treatment. All in all, although rule-based systems have often been criticized (Hecker- man, 1990), only a balanced judgement seems to be fair (Oni´sko et al., 2001).

Undoubtedly, the credibility of an expert system in- creases as soon as it is equipped with a truth maintenance module, namely, the module which is able not only to con- struct justifications of conclusions, but also to maintain the knowledge base in the state of internal consistency.

Being inspired to build an expert system which could have an advisory function in both the diagnostics and treatment of the bronchial asthma disease, we agreed to model it in the form of a rule-based expert system with

(3)

uncertainty. An additional argument in favour of the rule- based system is the ease of acquiring knowledge from electronic sources (the Internet), automatically or semi- automatically (Jankowska and Szymkowiak, 2005). To improve the quality of our system, we decided that it will be equipped with a truth maintenance module. Having no tools to aid designing the truth maintenance module for a rule-based system with uncertainty, we set our mind on defining a formal system which might be helpful in build- ing such a tool.

We shall notice that the knowledge base of a rule- based system with the truth maintenance module consists of three types of elements: facts—which play the role of statements with an axiomatic nature, rules—the implica- tions which enable reasoning in the system, and meta- rules—responsible for keeping the knowledge base in the state of internal consistency. Defining this heterogeneous knowledge base often involves the necessity of using var- ious methods and various formal languages.

The heterogeneous character mentioned above is also an ever-present feature of rule-based systems with uncer- tainty. In these systems, all elements of the knowledge base have some additional attributes usually in the form of certainty factors. Their role is to designate the proba- bility of the occurrence of particular facts or dependencies in reality. If particular elements of the knowledge base of the system with uncertainty are similar thanks to their at- tributes, it suggests the idea of perceiving the knowledge base as a certain whole.

2. Syntax of Rules with Uncertainty

At the beginning, let us define the concept of a rule with uncertainty. We intend to make use of this concept for sub- sequent modelling of both ordinary rules and meta-rules kept in the knowledge base of a rule-based system with uncertainty. Since each fact from this knowledge base is actually a particular case of the rule (with a universal fact as a premise and with the analyzed fact as a new conclu- sion), we aim at obtaining a formal system which would provide a basis to model the whole knowledge base in a homogeneous way.

Such a formal system will be defined in an increas- ing manner, applying in each following step the concepts defined in the previous steps.

2.1. Uncertain Facts. Let us consider an infinite setT of facts. This set will be settled axiomatically, together with the relations =0and0. The elements ofT will be denoted byT1, T2, T3, etc. As a result, we obtain

T = {T1, T2, T3, . . . }.

The relation =0: T × T meaning “the same as” is an equivalence relation. Let us assume thatTi, Tj and

Tk are any facts from the setT. Then, the relation ≤0: T × T meaning “subsumed by” must fulfil the following conditions:

• Ti=0Tj⇒ Ti0Tj,

• Ti0Tj∧ Tj 0Ti⇒ Ti=0Tj,

• Ti0Tj∧ Tj 0Tk⇒ Ti0Tk.

Obviously, the relation0is a partial ordering. An exemplary model of T may be a set of facts composing a medical evidence. Here are two such facts, specified by means of the FuzzyCLIPS (Orchard, 1998) notation.

These facts characterize Mr Smith’s state of health, who is suffering from the bronchial asthma disease (BAD, 2002):

(assert (SMITH cough-before lev-c(3))), (1) (assert (SMITH cough-before lev-c(2 3))). (2) They show that the frequency of Mr Smith’s morning cough is no less than a few episodes a week for (1), and a few episodes a month or a few episodes a week for (2).

The above facts are related to each other in the following way: if-then0((2),(1)), where if-then0 is the two-argument relation, corresponding to0in the model under discussion.

The determination of the relations if-then0 and if-and-only-if0 (equivalent to =0 in the model) may not be an easy task. In the above example, we refer to the dependencies which hold between the ranges of fre- quency. However, it does not imply that using numerical ranges is indispensable to determine these relations. If we consider any field of knowledge which has a well-defined ontology, then if-and-only-if0 and if-then0 are obtained by adapting the relations of equality and sub- sumption which hold between the concepts of this field.

For example, in the field of genealogy there are some obvious dependencies, which might be expressed by means of an extended FuzzyCLIPS notation (the assertmfconstruct) as follows:

(assertmf if-and-only-if0((WIFE X Y), (HUSBAND Y X))), (3) (assertmf if-then0((PARENT X Y),

(FATHER X Y))). (4) All the comments concerning the semantics of the subsequently defined concepts will be included in Sec- tion 3.

The uncertain fact will be each fact which has the form:

• ⊥ (an empty fact—always false),

•  (a universal fact—always true),

(4)

• Ti, pi, where Ti ∈ T, and pi ∈ [0, 1] denotes the probability of the occurrence ofTi.

The infinite set of uncertain facts will be denoted by F and its elements by F1, F2, F3, etc. The result is

F = {F1, F2, F3, . . . }.

In the next stage, let us define the relations =1and

1 on the set of uncertain factsF which are extensions of the previously introduced relations =0and0, respec- tively. We shall assume that the uncertain factsF1andF2

have the formsF1 = T1, p1 and F2 = T2, p2, respec- tively. Such assumptions lead to

F1=1F2⇔ (T1=0T2) ∧ (p1= p2), F11F2⇔ (T10T2) ∧ (p1≤ p2).

2.2. Conjunction of Uncertain Facts. Having intro- duced the concept of uncertain facts, we can formulate a recursive definition of the setFC of conjunctions of un- certain facts:

• if Fi∈ F, then Fi∈ FC,

• if F Ci, F Cj ∈ FC, then F Ci2F Cj∈ FC (the ∧2 symbol is the connective of the conjunction of uncer- tain facts),

• no other element belongs to the set FC.

Denoting particular elements of the infinite set FC by F C1, F C2, F C3, etc., we obtain

FC = {F C1, F C2, F C3, . . . }.

Let us extend the relations =1and1to the setFC.

To this end, we shall assume thatF Ci = Fi12Fi22

· · · ∧2FikandF Cm= Fm12Fm22· · · ∧2Fmp. Then the relation 2: FC × FC will be given the following meaning:

F Ci2F Cm



∀(1 ≤ j ≤ k)∃(1 ≤ n ≤ p)(Fij 1Fmn) . In turn, the relation =2: FC × FC will be defined in two succeeding steps. First, we will set a priori a number of pairsF Ci, F Cm such that the dependency F Ci =2 F Cmholds. Finally, we will define =2as the least equivalence relation comprising all the pairs men- tioned above and fulfilling the condition

F Ci2F Cm∧ F Cm2F Ci⇒ F Ci=2F Cm. The last definition enables us to put the constraint on the uncertain factsFi1, Fi2, . . . , Fik so as they cannot hold simultaneously. It is sufficient to include Fi1 2

Fi22· · · ∧2Fik, ⊥ in the axiomatically formulated set of pairs.

We will say that a conjunction of uncertain facts F Ci = Fi1 2Fi22· · · ∧2Fik has a normal form if and only if

∀(1 ≤ j1 ≤ k)

∃(1 ≤ j2 ≤ k)(Fij2 1Fij1)

⇒ (j1 = j2) . Obviously, every conjunction of uncertain factsF Ci can be assigned a conjunction of uncertain facts F Cm in a normal form, which complies with the dependency F Ci =2 F Cm. The set of all conjunctions of uncer- tain facts in normal form will be denoted by FCnorm, and the appropriate normalization function by fnorm2: FC → FCnorm.

2.3. Disjunction of Uncertain Facts. In the following step, we will perform the extension of the set of conjunc- tions of uncertain facts FC to the set of disjunctions of uncertain factsFD. This new set is defined recurrently as follows:

• if F Ci∈ FCnorm, thenF Ci ∈ FD,

• if F Di, F Dj ∈ FD, then F Di3F Dj ∈ FD (the symbol3is the connective of the disjunction of un- certain facts),

• no other element belongs to the set FD.

LetF D1,F D2,F D3, etc. denote the particular elements of the infinite setFD. We obtain

FD = {F D1, F D2, F D3, . . . }.

Consistently, let us define “the same as” relation

=3 and the “subsumed by” relation 3 on the set FD.

Let us make the assumption that the uncertain facts dis- junctions F Di, F Dm have, respectively, the following forms: F Di = F Ci1 3 F Ci2 3 · · · ∨3 F Cik and F Dm = F Cm13F Cm23 · · · ∨3F Cmp. The rela- tion3:FD × FD will be given the following meaning:

F Di3F Dm



∀(1 ≤ n ≤ p)∃(1 ≤ j ≤ k)(F Cij 2F Cmn) . In order to define the relation =3:FD × FD, first we will arbitrarily set a number of pairsF Di, F Dm such that F Di =3 F Dm holds. Next, we will appoint =3 as the least equivalence relation comprising all the pairs mentioned above and fulfilling the condition

F Di3F Dm∧ F Dm3F Di⇒ F Di=3F Dm. In the light of this definition, we can easily impose the constraint on the uncertain facts conjunctionsF Ci1, F Ci2, . . . , F Cik so as they exhaust the “space of solu- tions”. It is sufficient to includeF Ci13F Ci23· · · ∨3

F Cik,  in the axiomatically formulated set of pairs.

(5)

We can say that the disjunction of uncertain facts F Di = F Ci1 3F Ci23 · · · ∨3 F Cik has a normal form if and only if

∀(1 ≤ j1 ≤ k)

∃(1 ≤ j2 ≤ k)(F Cij1 2F Cij2)

⇒ (j1 = j2) . Just as in the case of any conjunction of uncertain facts F Ci, each disjunction of uncertain factsF Dican be as- signed a disjunction of uncertain facts F Dm in a nor- mal form which complies with the dependenceF Di =3 F Dm. The set of all uncertain facts disjunctions will be denoted byFDnorm, and the appropriate normalization function by fnorm3:FD → FDnorm.

Since “the same as” relations =0, =1, =2 and =3 are equivalence relations, it can be easily proved that the

“subsumed by” relations1,2and3are partial order relations like the axiomatically given relation0.

At last, let us define the auxiliary functions of the sum3and the intersection3on the setFDnorm. Meet- ing the former assumptions about the form of the disjunc- tions of uncertain factsF DiandF Dm, the sum function

3:FDnorm× FDnorm→ FDnormis defined as follows:

F Di3F Dm= fnorm3(F Ci13F Ci2

3· · ·∨3F Cik3F Cm13F Cm23· · ·∨3F Cmp), and the intersection function3: FDnorm × FDnorm FDnormis defined as

F Di3F Dm

= fnorm3

fnorm2(F Ci12F Cm1)

3· · · ∨3fnorm2(F Ci12F Cmp)

3fnorm2(F Ci22F Cm1)

3· · · ∨3fnorm2(F Ci22F Cmp)

3. . . fnorm2(F Cik2F Cm1)

3· · · ∨3fnorm2(F Cik2F Cmp) .

2.4. Rules with Uncertainty. Finally, we shall intro- duce the main concept of the set R of rules with uncer- tainty. To this end, we will use the following recursive definition:

• , ⊥ ∈ R,

• if F Di1, F Di2, F Di3 ∈ FDnorm, then (F Di1) ⇒4

(•F Di2, F Di3) ∈ R,

• if Ri1, Ri2, . . . , Rik, Ri(k+1), Ri(k+2) ∈ R, then (Ri1, Ri2, . . . , Rik) ⇒4 (•Ri(k+1), Ri(k+2)) ∈ R (symbol the4 stands for the connective of the im- plication which means the relationship between a set of premises and a pair of conclusions),

• no other element belongs to the set R.

Applying the symbolsR1,R2,R3, etc. to denote the uncertain rules, we will obtain the following form of the infinite setR of rules with uncertainty:

R = {R1, R2, R3, . . . }.

What is the semantics of the rules (F Di1) ⇒4 (•F Di2, F Di3) and (Ri1, Ri2, . . . , Rik) ⇒4 (•Ri(k+1), Ri(k+2))? They tell us, respectively, that

• if the premise F Di1 is in the knowledge base, then the old conclusionF Di2 should be removed from it (ifF Di2exists), and the new conclusionF Di3should be added to this knowledge base,

• if all of the rules Ri1, Ri2, . . . , Rik are in the knowl- edge base, then the ruleRi(k+1) should be removed from it (ifRi(k+1)exists), and the ruleRi(k+2)should be added to this knowledge base.

Let us notice that in the hierarchical process of defin- ing rules we did not use a negation operator. As a con- sequence, we refer here to the special type of the closed world assumption, called “negation by absence”. Such an approach clearly decreases the expressive power of the rules being proposed. On the other hand, however, it en- ables us to easily express incomplete information. If we assume that a rule’s premise has the following form:

Ti1, p1 ∧ Ti2, p2 ∧ · · · ∧ Tin, pn,

then, except for the knowledge about the truth of the factsTi1, Ti2, . . . , Tin, it expresses the lack of our knowl- edge about the truthfulness of the facts from the set T − {Ti1, Ti2, . . . , Tin}. Such a situation occurs in many experimental fields, where knowledge is acquired step by step through collecting positive evidence. If necessary, we are able to express the falseness of the factTi0by complet- ing the premise into the form:

Ti1, p1 ∧ Ti2, p2 ∧ · · · ∧ Tin, pn ∧ Ti0, 0.

Now, on the setR of rules with uncertainty, we will determine the “the same as” relation =4 and the “sub- sumed by” relation 4. First, the relation4: R × R can be defined recurrently as follows:

• for any rule Ri ∈ R there holds  ≤4 RiandRi 4

⊥,

• if Ri= (F Di1) ⇒4(•F Di2, F Di3) and Rm= (F Dm1) ⇒4(•F Dm2, F Dm3),

thenRi 4Rm⇔ (F Dm13F Di1) ∧ (F Dm23

F Di2) ∧ (F Di33F Dm3),

• if Ri = (Ri1, Ri2, . . . , Rik) ⇒4(•Ri(k+1), Ri(k+2)) and Rm = (Rm1, Rm2, . . . , Rmp) ⇒4 (•Rm(p+1), Rm(p+2)), then Ri 4 Rm ⇔ (∀(1 ≤ n ≤ p)∃(1 ≤ j ≤ k)(Rmn 4 Rij)) ∧(Rm(p+1) 4 Ri(k+1))

∧(Ri(k+2) 4Rm(p+2)),

(6)

• no other pair of rules Ri, Rm ∈ R can be in rela- tion4.

It can be easily proved that4is a partial ordering.

Assume that the former notation remains valid. The relation =4: R × R is defined as the least equivalence re- lation, which fulfils the following conditions:

• if Ri = (F Di1) ⇒4 (•F Di2, F Di3) and F Di1 =3

⊥, then Ri=4,

• if Ri = (Ri1, Ri2, . . . , Rik) ⇒4 (•Ri(k+1), Ri(k+2)) and∃(1 ≤ j ≤ k)(Rij =4⊥), then Ri=4,

• if Ri= (F Di1) ⇒4(•F Di2, F Di3) and F Di1=3 andF Di3=3⊥, then Ri=4⊥,

• if Ri = (Ri1, Ri2, . . . , Rik) ⇒4 (•Ri(k+1), Ri(k+2)) and∀(1 ≤ j ≤ k)(Rij =4 ) and Ri(k+2) =4 ⊥, thenRi=4⊥,

• if Ri= (F Di1) ⇒4(•F Di2, F Di3) and ¬(F Di1=3

⊥)

and (F Di13F Di2) and (F Di33F Di1), thenRi=4⊥,

• if Ri= (Ri1, Ri2, . . . , Rik) ⇒4(•Ri(k+1), Ri(k+2)) and¬∃(1 ≤ j ≤ k)(Rij =3⊥)

and∀(1 ≤ j ≤ k)(Rij 4Ri(k+1)),

and∃(1 ≤ j ≤ k)(Ri(k+2) 4Rij), then Ri=4⊥,

• if Ri4Rj andRj 4Ri, thenRi=4Rj.

We say that a ruleRi ∈ R has a normal form if and only if:

• Ri=  or

• Ri= ⊥ or

• Ri = (F Di1) ⇒4 (•F Di2, F Di3), where F Di1, F Di2, F Di3∈ FD, and the following condition is ful- filled:

¬

(Ri= ) ∨ (Ri= ⊥)

¬

(F Di13F Di2) ∧ (F Di3 3F Di1) , or

• Ri = (Ri1, Ri2, . . . , Rik) ⇒4 (•Ri(k+1), Ri(k+2)), and the following condition is fulfilled:

¬

(Ri= ) ∨ (Ri= ⊥)

∀(1 ≤ j1 ≤ k)

∃(1 ≤ j2 ≤ k)(Rij24Rij1)

⇒ (j1 = j2)

∃(1 ≤ j ≤ k)¬(Rij 4Ri(k+1))

∀(1 ≤ j ≤ k)¬(Ri(k+2) 4Rij)

.

LetRnormdenote the appropriate subsetR contain- ing all the rules which have a normal form. We shall notice that each ruleRi∈ R can be assigned a rule Rm∈ Rnorm

which fulfilsRi=4Rm.

To sum up, the recursive method of forming rules with uncertainty reminds us the method of forming for- mulae used in First Order Logic (FOL). However, let us notice that only four out of the five FOL connectives have their equivalents in the logic of rules with uncertainty, namely, the connective∧ has its equivalent in the form of the conjunction connective2, ∨ in the form of the dis- junction connective3, ⊆ in the form of the subsumption operator4, and≡ in the form of the equality operator

=4. Furthermore, the proposed connectives2and3are not global, but partial functions only.

Instead of the FOL negation connective¬, in the logic of rules with uncertainty we propose a special, three- argument connective4. If, by means of the negation

¬f, one can express the truthfulness of the formula oppo- site tof, then by means of the rule (f1) ⇒4 (•f2, f3), with the premisef1 being true, one can express (except for the truthfulness off3) the lack of knowledge about the value off2. That is why, in the logic of rules with un- certainty, we can model “negation by absence” only. As a result, this logic is deductively incomplete and its expres- sive power is smaller than the expressive power of FOL.

On the other hand, it offers us a possibility to make use of the notion of ignorance. The rules with uncertainty will be evaluated in the set {true, unknown}, rather than in the set {true, false}.

3. Knowledge Base of a Rule-Based System as a Model for the Logic of Rules

with Uncertainty

Using the elements ofRnorm, we will represent both facts and ordinary rules, as well as meta-rules from the knowl- edge base of a rule-based system with uncertainty. To il- lustrate this claim, let us have a look at the rule-based sys- tem RiAD, which can aid prognosticating the effects of a bronchial asthma treatment (Jankowska, 2001; 2004). In the knowledge base of this system, one can find the fol- lowing elements:

• facts, of temporary nature, informing about the inten- sity of disease symptoms in a patient with a bronchial asthma,

• ordinary rules, of persistent nature, defining dependen- cies between disease symptoms plus pharmacother- apy and effects expected after a one-year treatment (Deutsch et al., 2001),

• meta-rules, of persistent nature, defining simple de- pendencies between ordinary rules.

Consequently, among the facts, the following uncer- tain fact might be found:

(assert (SMITH cough-before lev-c(3)) CF 0.8). (5)

(7)

It informs us, with confidence 0.8, that for a patient SMITH, before starting the treatment, the frequency of his or her night-time cough was at the level of several times a week (marked with the number 3). The above fact is a model of the following rule with uncertainty:

() ⇒4(•⊥, (SMITH cough-before

lev-c(3)), 0.8). (6) Now, as the example of an ordinary rule, we can use the following definition:

(defrule prognosis-1 (X group 3)

(X cough-before lev-c(3)) (X wheezing-before lev-w(2)) (X drugs 3-14)

(assert (X cough-after lev-c(2 3)) CF 0.8) (assert (X pef-after lev-p(1 2))

CF 0.9)). (7) It tells us that in a patient initially classified into the group of chronic asthma of medium progress (X group 3)—with a night-time cough frequency of several times a week (X cough-before lev-c(3)) and with an over wheezing frequency of several times a month (X wheezing-before lev-w(2))—after a prolonged (over one year) taking of the combination of drugs identi- fied as 3-14 (X drugs 3-14), the frequency of his or her night-time cough, with confidence 0.8, will decrease to several episodes a month or will stay at the same level ((X cough-after lev-c(2 3)) CF 0.8), and the patient’s peak expiratory flow PEF will be placed, with confidence 0.9, within the range marked with the sym- bolic number 1 or within the range marked with the sym- bolic number 2 ((X pef-after lev-p(1 2)) CF 0.9).

The above definition is a model of the following rule with uncertainty:

((X group 3), 1.0 ∧2

(X cough-before lev-c(3)), 1.0 ∧2

(X wheezing-before lev-w(2)), 1.0 ∧2

(X drugs 3-14), 1.0)

4 (•⊥,

(X cough-after lev-c(2 3)), 0.8 ∧2

(X pef-after lev-p(1 2)), 0.9). (8) Examples of meta-rules will be considered later, after defining the sum and intersection operations on theRnorm

set.

4. Algebra of Rules with Uncertainty

An essential component of most professional expert sys- tems is a truth maintenance module. We consider a wider notion of the truth maintenance module. We assume that it not only keeps the track of dependencies among the ele- ments of knowledge base, but it is also responsible for the knowledge base correctness and for the credibility of rea- soning performed in the system. Such a truth maintenance module can detect the redundancy or inconsistency of in- formation stored in the knowledge base. Optionally, it can also test the knowledge base regarding its completeness.

The contents of the knowledge base change in the course of expert system performance. Therefore, the truth maintenance module should strictly cooperate with the in- ference engine (Kahney et al., 1989). It would be a smart solution to implement the knowledge base and the truth maintenance module together.

The logic of rules with uncertainty presented above allows modelling all the facts, all the ordinary rules and also some meta-rules from the knowledge base of a rule- based system with uncertainty. To obtain an additional possibility of modelling a high quality truth maintenance module, let us extend our formal system to the algebra. To this end, let us define the functions of the sum4and the intersection4of the rules in a normal form.

Accordingly, the sum4: Rnorm× Rnorm→ Rnorm

of the rules R1 andRm ∈ Rnormwill be defined recur- rently as follows:

• Ri4 =  ∪4Ri= Ri,

• Ri4⊥ = ⊥ ∪4Ri= ⊥,

• if Ri= (F Di1) ⇒4(•F Di2, F Di3) andRm= (F Dm1) ⇒4(•F Dm2, F Dm3),

thenRi4Rm= fnorm4(fnorm3(F Di13F Dm1))

4 (• fnorm3(F Di2 3 F Dm2), fnorm3(F Di3 3 F Dm3))),

• if Ri = (F Di1) ⇒4 (•F Di2, F Di3) and Rm = (Rm1, Rm2, . . . , Rmp) ⇒4(•Rm(p+1), Rm(p+2)), thenRi4Rm= Rm4Ri= fnorm4(()

4(•Rm(p+1), ((F Di1) ⇒4(•F Di2, F Di3))

4Rm(p+2))),

• if Ri = (Ri1, Ri2, . . . , Rik) ⇒4(•Ri(k+1), Ri(k+2)) andRm= (Rm1, Rm2, . . . , Rmp)

4(•Rm(p+1), Rm(p+2)),

thenRi4Rm = fnorm4((Ri14Rm1, . . . , Ri14 Rmp, . . . , Rik4Rm1, . . . , Rik4Rmp)

4(•(Ri(k+1)4Rm(p+1)), Ri(k+2)4Rm(p+2))).

Likewise, the intersection4 : Rnorm× Rnorm Rnormof the rulesRiandRm∈ Rnormis defined as fol- lows:

• Ri4 =  ∩4Ri= ,

• Ri4⊥ = ⊥ ∩4Ri= Ri,

(8)

• if Ri= (F Di1) ⇒4(•F Di2, F Di3) andRm= (F Dm1) ⇒4(•F Dm2, F Dm3),

thenRi4Rm= fnorm4((fnorm3(F Di13F Dm1))

4 (• fnorm3(F Di2 3 F Dm2), fnorm3(F Di3 3

F Dm3))),

• if Ri= (F Di1) ⇒4(•F Di2, F Di3)

andRm = (Rm1, Rm2, . . . , Rmp) ⇒4 (•Rm(p+1), Rm(p+2)),

thenRi4Rm= Rm4Ri

= fnorm4((Rm1, Rm2, . . . , Rmp)

4(•⊥, ((F Di1)⇒4(•F Di2, F Di3))∩4Rm(p+2))),

• if Ri= (Ri1, Ri2, . . . , Rik) ⇒4(•Ri(k+1), Ri(k+2)) andRm= (Rm1, Rm2, . . . , Rmp)

4(•Rm(p+1), Rm(p+2)),

thenRi4Rm = fnorm4((Ri14Rm1, . . . , Ri14

Rmp, . . . , Rik4Rm1, . . . , Rik4Rmp)

4(•(Ri(k+1)4Rm(p+1)), Ri(k+2)4Rm(p+2))).

For the above functions of the sum4and the inter- section 4 of the rules in a normal form, the following principles are satisfied:

∀(Ri, Rm∈ Rnorm)

(Ri4Ri4Rm)

∧ (Rm4Ri4Rm) ,

∀(Ri, Rm∈ Rnorm)

(Ri4Rm4Ri)

∧ (Ri4Rm4Rm) . Moreover, it can be proved that

∀(Ri, Rm∈ Rnorm)

∃(Rk ∈ Rnorm)

(Ri4Rk

4Ri4Rm) ∧ (Rm4Rk4Ri4Rm)



Rk =4(Ri4Rm)

and

∀(Ri, Rm∈ Rnorm)

∃(Rk ∈ Rnorm)

(Ri4Rm4Rk

4Ri) ∧ (Ri4Rm4Rk 4Rm)



Rk =4(Ri4Rm)

. From these principles we can draw some further auxiliary conclusions:

∀(Ri, Rm∈ Rnorm)((Ri4Rm) =4sup{Ri, Rm}) and

∀(Ri, Rm∈ Rnorm)((Ri4Rm) =4inf{Ri, Rm}), and the final conclusion: the algebraR= (Rnorm, ∪4, ∩4) is a lattice.

The importance of the above conclusion is not di- minished by the fact that the lattice Ris determined on the setRnorm, and not on the full setR. Consider the rule R = (r-p) ⇒4 (•r-c1, r-c2). If the r-c2conclusion (be- ing inserted) is “subsumed by” ther-p premise and this

premise is “subsumed by” ther-c2 conclusion (being re- moved), then the ruleR does not represent any value at all and it should be disregarded in the process of reasoning.

5. Truth Maintenance Module as a Model for the Algebra of Rules with Uncertainty

On the basis of the algebraR= (Rnorm, ∪4, ∩4), we can model a truth maintenance module of the rule-based sys- tem with uncertainty. Using the elements of the setRnorm

and the functions of the sum4and the intersection4, we will represent both facts and ordinary rules, as well as various meta-rules. The last ones, which specify the se- mantic constraints to be fulfilled by the facts and ordinary rules, form the truth maintenance module.

Therefore, any factf-kb, after bringing it to the form of the disjunction of uncertain facts F Dkb, can be pre- sented as the simple rule () ⇒4 (•⊥, F Dkb). Then the ordinary ruler-kb = (p-kb) ⇒ (c1-kb, ¬c2-kb) will be given the form (F Dpkb) ⇒4 (•F Dc1kb, F Dc2kb), in which F Dpkb is a formal representation of the p-kb premises, whereasF Dc1kb andF Dc2kb are formal rep- resentations of the c1-kb and the c2-kb conclusions, respectively. The meta-rule mr-kb = (mp-kb) ⇒ (mc1-kb, ¬mc2-kb) will be presented as the complex rule of the form (Rmp1kb, Rmp2kb, . . . , Rmpkkb) ⇒4

(•Rmc1kb, Rmc2kb) where Rmp1kb, Rmp2kb, . . . , Rmpkkb

are formal representations of the rule’s premisesmp-kb, whileRmc1kbandRmc2kbare formal representations of the rule conclusionsmc1-kb and mc2-kb, respectively.

Any proper subsetKB of the set Rnormcan represent a knowledge base of the expert system with uncertainty.

Examining the =4and4relations between elements of the set KB, we can significantly improve the quality of this knowledge base.

For instance, finding any rulesRi andRmwith un- certainty which fulfil the relationRi 4 Rm in theKB constitutes a pretext to delete the rule Ri from this set (and its equivalent from the knowledge base) because the knowledge represented by the ruleRi is also “included”

in the ruleRm.

Next, the relation =4can be used to examine the con- sistency of the set of rules which create theKB knowledge base. If for any ordinary rulesRkb1, Rkb2 ∈ KB there holdsRkb14Rkb2 =4 (F Dkb12) ⇒4 (•⊥, ) =4 ⊥, then these rules are contradictory to each other and they must not occur simultaneously in theKB set. Also, two any meta-rules Rmkb1, Rmkb2 ∈ KB, for which there holdsRmkb14Rmkb2 =4 (Rkb1, Rkb2, . . . , Rkbk) ⇒4 (•⊥, ) =4 ⊥, are contradictory to each other. In case theKB does not have the feature of internal consistency, it should undergo a modification which would cause the recovery of this feature.

(9)

Using the algebraR= (Rnorm, ∪4, ∩4), we can also examine other features of theKB knowledge base, for ex- ample, its completeness.

To illustrate the above deliberations, let us analyze the possibility of using the algebra R in designing and maintaining the truth maintenance module for the knowl- edge base of the system RiAD. Let us assume that in this knowledge base, apart from the fact (5) and the rule (7) defined above, there are the fact and the rule presented below:

(assert (SMITH cough-before lev-c(2 3)) CF 0.7), (9) (defrule prognosis-2

(X group 3)

(X cough-before lev-c(3)) (X drugs 3-14)

(assert (X cough-after lev-c(2)) CF 0.8) (assert (X pef-after lev-p(1 2))

CF 0.95)). (10) Let us further assume that also the meta-fact (11) be- longs to the RiAD knowledge base:

(assertmf if-then0

((X cough-before lev-c(Y Z)), (X cough-before lev-c(Y)))). (11) This meta-fact, which is a model of the following de- pendency from the logic of rules with uncertainty:

() ⇒4(•⊥, (X cough-before (Y Z)), 1.0)

4

() ⇒4(•⊥, (X cough-before (Y)), 1.0) , (12)

forms an if-then0 relation between the fact stating that a cough frequency of a person X before starting the treat- ment is set on the Y or Z level, and the fact stating that a cough frequency of this person is set right on the Y level.

As a result of the simultaneous occurrence of (5), (9) and (11) in the knowledge base, we can come to the con- clusion that the fact (9) has a redundant character.

A similar situation will be observed in the case of the ordinary rules (7) and (10). If we assume that the meta-facts analogous to (11) are also in force for other measurable symptoms of the bronchial asthma disease (wheezing-before, cough-after, pef-after), we can easily deduce that the rule (7) is in the if-then4 relation with the rule (10) (with weaker premises and a stronger conclusion).

What shall we do with the fact (9) and the rule (7), which are obviously redundant ones in the knowledge base? They must be removed from it!

In order to cope with their removal, it is sufficient to activate the meta-rule subsumption-1, defined by means of the extending construct defrulem:

(defrulem subsumption-1 (rule R2)

(if-then4(R1,R2))

(not(if-and-only-if4(R1,R2)))

(undefrule R1)), (13)

where if-then4 and if-and-only-if4 are predi- cate functions implementing the relations4and =4, re- spectively. The performance of this meta-rule will result in removing from the knowledge base each rule R1 for which we can find any rule R2 that is different from it and fulfils the dependency ‘R1 is “subsumed by” R2’.

The meta-rule subsumption-1 is a model for the following complex rule from the logic of rules with uncer- tainty:

((((R2) ⇒4(•⊥, R1)) ⇒4(•⊥, )), R2, (R1) ⇒4(•⊥, R2)) ⇒4(•R1, ). (14)

Let us analyse its contents. Assuming that the relation R1 4 R2 holds, we obtain ((R2) ⇒4 (•⊥, R1)) =4

⊥. In consequence, the first premise (((R2) ⇒4 (•⊥, R1)) ⇒4 (•⊥, )) is “the same as” . And, if the rule R2 is in the knowledge base and the relation R1 =4 R2 does not hold (which is guaranteed by fulfill- ing the third premise (R1) ⇒4 (•⊥, R2)), then the rule R1(if it exists) will be removed from it.

In the opposite case, when the relation R1 4 R2 does not hold, the first premise (((R2) ⇒4(•⊥, R1)) ⇒4 (•⊥, )) is “the same as” ⊥. Similarly, fulfilling simul- taneously bothR1 4 R2 andR2 4 R1(equivalent to R1 =4 R2) makes the third premise (R1) ⇒4 (•⊥, R2)

“the same as”⊥. If so, the complex rule considered will not become active.

Now let us investigate a new situation in which the meta-fact (15) co-occurs with the rules (16) and (17) in the RiAD knowledge base. The meta-fact asserts the presence of four separate levels of respiratory efficiency (marked with natural numbers 1, 2, 3, 4):

(assertmf if-and-only-if0 ((X pef-after lev-p(1 2 3 4)), true)). (15)

Traditionally, the rules define the dependencies between

Cytaty

Powiązane dokumenty

Otrzymałem dziś Twoje pismo z załączonemi dokumentami — wyprawiam je dziś jeszcze. Napisałem do moich kolegów, że zu­ pełnie zgadzam się z Tobą, że „z

Palisandr nie tylko przechodzi do wieczno- ści (z tego powodu stojący niżej na społecznej drabinie zwracają się do niego per „ваша Вечность”), ale może dzięki

Stolik z podstawą obracamy do pozycji, przy której jedna ściana kąta łamiącego pryzmatu odbija wiązkę promieni wychodzących z kolimatora tak, aby obraz szczeliny w

była i aby radość wasza była pełna» (J 15, 11) – źródła prawdziwej radości ucznia Jezusa, dr Dorota Muszytowska (UKSW Warszawa), Apostolska ra- dość pojednania w 2

[r]

Autor stwierdza jednoznacznie, ¿e reforma samorz¹du jest oczywistym sukce- sem, ale dodaje jednoczeœnie, ¿e samorz¹d terytorialny znalaz³ siê na historycz- nym zakrêcie.. Jest

Podczas ostatniej sesji referatowej przedstawiono wyniki inwentaryzacji jaskiñ w Karpatach zewnêtrznych (P. Mleczek) oraz internetow¹ bazê danych jaskiñ Polski (J.. Ziñko,

R ok 1939 jest dla Republiki Litew- skiej datą szczególną i, chociaż nie jest symbolem upadku, – jak w sytuacji Pol- ski – budowanej przez całe dwudziestolecie