A Generic ATMS
Juan Luis Castro and Jose Manuel Zurita
Departamento de Ciencias de la Computacion e Inteligencia Arti cial E.T.S.I. Informatica. Universidad de Granada Avenida de Andaluca, 38, 18071 Granada (Spain)
[email protected] [email protected] Abstract The main aim of this paper is to create a general Truth Maintenance System based on the De Kleer [5] algorithm. This kind of system is to be designed so that it can be used in dierent propositional monotonic logic models of reasoning systems. The knowledge base system that will interact with it is described. Furthermore, we study the eciency that transferring ATMS to a logic with several truth values presupposes. De nitions and properties of the generic ATMS are particularized to interact both with a reasoning system based on multivalued logic speci cally to the case of [0,1]-valued logic and with a reasoning system based on fuzzy logic. The latter will be designed to reason with fuzzy truth values although a parallel essay might be followed using linguistic labels directly.
Keywords: Truth Maintenance System, Knowledge Base System, Problem Solver, Multivalued Logic, Fuzzy Logic.
1 Introduction Within the reasoning systems which use monotonic logic, one of the most studied systems which makes non-monotonic reasoning possible is the so-called Truth Maintenance System. It was Doyle in 1979 [4] who rst introduced a formal view of a TMS. The main functions of a TMS can be summed up in three parts, though obviously each of them has important consequences. 1. Maintenance of the non-monotonic inferences, it allows non-monotonic reasoning as well as a saving in computing time. 2. Resolution of contradictions, the TMS is able to show the assumptions underlying a contradiction and update the new truth of all the theorems deduced previously by making contradiction disappear through the procedure of removing erroneous assumptions. 3. Explanation module, at any time, it can provide the attainment of inferences and assumptions that have caused the deduction of a certain proposition. Nevertheless some of this system's limitations were solved to great extent by De Kleer [5] with the design of a new Truth Maintenance System, in this case based on Assumptions to work also with classical logic f0,1g. Limitations such as the need of the knowledge base to be kept This work has been supported by Research Project TIC94-1347 CICYT.
1
consistent or the diculty implied by the change of context which prevented us from proving two possible solutions to the problem as well as the non-existence of a direct connection with the results obtained in non-monotonic logic. The ATMS helps reasoning and after every inference made by the problem solver, the ATMS justi es it and processes it in an internal structure called Node. A node is the minimum piece of information the ATMS can manage. It is represented by the triplet (N; L; J ). Where N is the name of the datum used by the problem solver. L is the label of the node, and J is the set of justi cations whose consequent is N . The label has a set of environments, each one of them showing the set of assumptions underlying the deduction of the node. An ATMS context is the set formed by the assumptions of a consistent environment combined with all nodes derivable from those assumptions. Any environment which allows the derivation of ? is nogood. When a contradiction is detected the ATMS supplies the assumptions which produce it. At the same time the ATMS eliminates or retracts the truth value from any of the assumptions. With this aim, the ATMS should maintain its label consistent, solid, complete and minimal. ConsistentIt is consistent if any environment in the label does not deduce the false value. Sound- Every environment in the label must deduce the datum N . Complete- Every environment deducing the node N is a super set of other environments in the label. Minimal- An environment in the label cannot be a subset of any other environment. This tasks are more comprehensible by the representation of a structure called lattice which gathers the dierent environments together. Let us see an example from [5]. Example 1. Let us assume the following nodes updated so far by the AMTS, see Figure 1. The label of a node is the set of greatest lower bounds of the circled nodes:
x+1=1 : (x + 1 = 1; ffA; Bg; fB; C; Dgg; f: : :g), the square nodes of Figure 1 correspond the contexts of x=1:
x=1 : (x = 1; ffA; C g; fD; Egg; f: : :g). The nogoods of the lattice are the result of the single nogoodfA; B; C g. Suppose nothing is known about y :
y=0 : (y = 0; fg; fg), and the problem solver infers y = 0 from x + y = 1 and x = 1:
x+1=1 ; x=1 ) y=0 . As a result of adding this justi cation, the ATMS updates y=0 `s label to be sound, complete, consistent, and in minimal form:
y=0 : (y = 0; ffA; B; C g; fB; C; D; Egg; f( x+y=1; x=1)g). One sound and complete label for the consequent is the set whose elements are the union of all possible combinations of picking one environment from each antecedent node label. Thus one sound and complete label for y=0 is:
ffA; B; C g; fA; B; C; C g; fA; B; D; Eg; fB; C; D; Egg
Any sound and complete label can be made consistent and minimal by removing subsumed and inconsistent environments. The environment fA; B; C; Dg is removed because it is subsumed by fA,B,Cg. The environment fA; B; D; E g is not included because it contains the inconsistent 2
fA; B; E g. In Figure 1 we can see the result of the label of the new datum deduced by means of removing inconsistent and subsumed environments (nogoods). {A,B,C,D,E}
{A,B,C,D}
{A,B,C,E}
{A,B,D,E}
{A,C,D,E}
{B,C,D,E}
{A,B,C} {A,C,D} {A,B,D} {A,B,E} {B,C,D} {B,D,E} {B,C,E} {A,C,E} {C,D,E} {A,D,E}
{A,B}
{A}
{A,C}
{A,D} {A,E}
{B}
{B,C}
{B,D}
{C}
{B,E}
{C,D}
{D}
{C,E}
{D,E}
{E}
{}
Figure 1: Environment lattice. This ATMS works only with reasoning systems which use logic f0,1g. Other TMS have been developed subsequently although most of them follow Doyle and De Kleer's philosophy. McAllester [12] designed a TMS based on justi cations for propositional logic. Falkenhainer [8] applied Dempster-Shafer's theory of evidence in Doyles's TMS. D'Ambrosio [3] used an ATMS to compute beliefs in Dempster-Shafer's theory, but restricting it to a very particular case: Support Logic Programming by Baldwin. De Kleer and Williams [7] assigned probabilities to assumptions and used an ATMS to nd multiple faults in a system simultaneously. Laskey and Lehner [11] showed a formal equivalence between Dempster-Shafer's theory of evidence and an assumption based truth maintenance system (ATMS) with likelihood on the assumptions. Fringuelli et al. [9] designed an ATMS to work with certainty factors. The inference method which is used for the problem-solver is based on the fuzzy logic resolution principle proposed by Lee. Meseguer et al. [13] also use a ATMS with certainty factors to verify a multi-level rule-based expert system, speci cally the PNEUMON-IA expert system. Inoue [10] presented an alternative algorithm of ATMS as an application of this work. What Inoue did was to calculate the logic consequences of a knowledge base in propositional logic. In order to achieve it he split the knowledge base into clauses. In his application of the ATMS the problem of the consequence nding is transferred to the implicant nding which would be equivalent to the concept of environment. The TMS we are going to consider will be based on assumptions (also known as ATMS) due to the advantages it provides as comparied to the TMS originally designed by Doyle. We shall carry out research into the problems of the ATMS caused by the use by the reasoning system of a logic which uses both dierent truth values in the assumptions and uncertainty in the deduction of information. At the same time, a general purpose ATMS shall be de ned for 3
working with any kind of propositional monotonic logic [15]. When the reasoning system works with dierent truth values from those used in classical logic the inference path used to infer the data becomes more important. Since dierent paths can infer the same datum with dierent truth values. That is to say, one single set of assumptions can result in dierent truth values for the same datum because it has been obtained through dierent inference paths. Now, the problem involves not only the deduction or non-deduction of the data in the strict sense, but also deduction with dierent truth values. This makes the problem much more complex.
2 Model of knowledge base system The minimum information unit we are going to represent shall be called fact. A fact represents a simple proposition and shall be de ned by a triple as follows (object, atribute, value). With F being a nite set and notempty of facts. The knowledge (KBS ) will consist of:
Fact Base (FB). It is a subset of the set of facts, FB F . Knowledge Base (KB). It consists of complex formulae built from the FB set. We shall denote it as KB = fc1; : : :; ctg. Therefore, KBS = KB [ FB . Depending on their functions within the system, we shall
distinguish the following propositions:
Output data (H). Those propositions about which we are interested in obtaining information. They shall be denoted by H = fh1 ; : : :; hng. Input data (I ). They shall be provided to the system in order to deduce the elements of H. They shall be supplied by the set I = fe1; : : :; emg. Depending on the truth of the information, they are provided with, we shall distinguish between propositions:
Premises (P ) Propositions whose credibility is beyond any doubt. They shall be represented by P = fP1 ; : : :; Pr g.
Assumptions (A) Propositions occasionally introduced as a help for deduction and which are not very reliable. They shall be denoted by A = fA1 ; : : :; As g.
Let V be the set of all the valuations about F :
V = fv : KBS ?! T g: Each function of valuation makes the value v 2 V correspond to any f 2 KBS at a certain moment. In a special case k, 8f 2 KBS , vk (f ) will contain the truth value to f at that moment. Therefore, KBS in the case k will be:
KBSk = KB [ FBk , when FBk = f(f; vk (f ))g: 4
We can obtain dierent truth values for the same h 2 H, since it is possible through the knowledge base to infer through dierent paths and consequently to calculate several values for the truth value of the datum. That is:
FBk = f: : :; (hi; vk1(hi )); : : :; (hi; vkp(hi )); : : :g; with vk1(hi ) 6= vk2 (hi ) 6= : : : 6= vkp(hi ) , hi 2 H , p 2 N ; whereas if: If (ei ; vkr (ei )) and (ei ; vks (ei )) 2 FBk then vkr (ei ) = vks (ei ) = vk (ei ) , 8ei 2 I ; i.e., because of its own nature, the imput data at a certain moment can only have one truth value which is that used in the reasoning process. It would be incoherent semantically to associate more than one meaning to an input fact. Henceforth, we shall use the expression vk (f ) to denote the truth value associated to f , bearing in mind that this value will be unique if f 2 I or rather we shall be representing any of those found for f if f 2 H. In fact, the k state in the system is provided by the elements of I and we obtain the rest of them from these elements.
2.1 Inference Thanks to the knowledge and the information stored in the KBS , the inference system deduces with the aim of obtaining new data from existing data. This takes place in the case of classical logic f0,1g. However, if we use any other kind of logic (other than classical logic) which permits a greater range of truth values, the result of the inference process is not only the appearance of new facts (truth value 1), but those facts can be deduced with a speci c truth value (which we denote by the function v which assigns every proposition with its corresponding truth value). Let S KBS and h 2 H. A formal proof or a formal deduction of h from S will be represented by the expression: S ` h with v(h); where ` is the symbol of logic deducibility. The set of deducible theorems of S , that we shall denote by Th(S ) shall be the set:
Th(S ) = fh 2 H with v(h)=S ` h with v(h)g: The symbol ` should be de ned in every logic in a dierent way depending on the set of inference schemes used in the deduction process. One of the most common inference strategies is the modus ponens. The modus ponens simply states that if the antecedent part of a rule is true, then its conclusion is true as well. More generically:
if A then B A'
B' 5
If the rule if A then B exists, and A0 is veri ed, then B0 is obtained with A and B being two facts corresponding to two dierent items. Whereas A0 and B 0 are two new similar facts or even equal to the former ones, although they may have dierent values in their atributes, i.e.,
A = (Object1; Atributei; V aluep) B = (Object2; Atributej ; V aluer) A0 = (Object1; Atributei; V alueq ) B 0 = (Object2; Atributej ; V alues )
3 Environment Lattice One of the main features of the ATMS is the possibility to establish a lattice among the groups of assumptions. The creation of the lattice favours the removing or not taking into account of a great number of environments since the information which is provided by them is collected by the set of environments which constitutes the node label. The internal aim of the ATMS is to achieve a minimal, sound, consistent and complete label for each node. To do so, the ATMS algorithms select from the lattice those environments which satisfy the properties above. If we want to keep in the reasoning system all the resulting information from the inferences, it may turn out that the search space which appears is almost unmanageable. For example, if we have ve assumptions and a logic that uses ten truth values, the number of environments to consider would be 161,050 (see eciency in section 3.1) as compared to the thirty-two in the lattice in classical logic f0,1g. Nevertheless, if we reduce the number of truth values of the logic to two for the same set of assumptions the search space is reduced to two hundred and forty-two environments. In Figure 1, we can see the resultant lattice for the case of two assumptions fA,Bg and three dierent logic truth values fv1; v2; v3g. Later, we shall analyse the origin of these data and the in uence of each one of the parameters involved. Nevertheless, the ATMS never considers such a wide space as a whole. Since only the minimum set of environments which is calculated by means of the ATMS algorithms has to be computed. Therefore, we should assess the features of the reasoning system and its working needs as well as the speci c knowledge base which is going to be used. Once this is achieved, we have two alternatives:
If the analysis performed is considered viable, we may have the overall set of environments
where the assumptions appear together with their truth values. For instance, we may have nodes such as:
Nh : ((: : :), (fAv1 , Bv2 g,: : : ,fAv2 , Bv2 , Dv3 g), (: : :)),
Or rather, if the problem assumes serious dimensions that make the previous solution
unadvisable from a computing point of view, we would always work from the current state of the system. Consequently, the truth value for every assumption is the one that has been assigned at that moment in the base. For example, we would consider nodes such as:
Nh : ((: : :); (fA; Bg; : : :; fA; B; Dg); (: : :)), 6
h
Av1B v1 Av1B v2 Av1B v3 Av2B v1 Av2B v2 Av2B v3 Av3B v1 Av3B v2 Av3B v3
Av1
A v2
A v3
B v1
B v2
B v3
{}
Figure 2: Environment lattice for fA,Bg and fv1 ; v2; v3g. where the logic values vi assigned to each assumption are implied by the current state of the knowledge base. Both approaches have advantages and disadvantages. The main trouble of the rst one is the amount of information it produces with the eects that this implies as regards the eciency of the process. Therefore, it may even wipe out some of the advantages that the ATMS provides to the system. On the contrary, it is useful to provide within its label the minimum and the whole set of assumptions which have produced a corresponding value of an output fact, regardless of the current state of the logic values assigned to each data currently in the knowledge base. Let us look at an example.
Example 3.1
If the ATMS at a certain moment obtains fA,Bg and fA,B,Cg as assumptions that are involved in the deduction of the node h that we denote:
fA, Bg ) h and fA, B, Cg ) h, the state of such a node at that moment may be as follows:
Nh : ((v1; v2; : : :); (fAv1 ; Bv2 g; fAv2 ; Bv2 ; Dv3 g; : : :); (: : :)), with v1 and v2 being the logic states of h calculated from of the inference system through fAv1 ; Bv2 g and fAv2 ; Bv2 ; Dv3 g, respectively. Being able to have the previous information available allows us to move the other points of the search space with relative ease. In other words, if there are assumptions that modify their logic truth state either because they are a new set of data or as a result of some of the backtracking processes produced by the ATMS algorithms, then a number of the solutions already calculated may be kept. In Table 1 we can see that if we modify the certainty value for 7
assumption A, thanks to the information supplied by the ATMS, we automatically restore the value v2 to the node h with no need to deduce it again from Base .
h Base v1 v2 v3 v1 Base v2 v2 v3 v2 A B D
Table 1: Inference retrieval. The second approach, in which we use only the current state of knowledge without taking into account the results already obtained with dierent input data (i.e., we have no "performance memory"), favours and speeds up the computing of the dierent ATMS algorithms. However, when we move to another point in the search space in order to achieve the deduction of new information, the interaction of the reasoning process shall be necessary using the inference engine in addition to the available information in the ATMS.
3.1 Eciency In the last section, we raised the possibility of working with two types of lattices. Those in which element was identi ed by two parameters (name of the assumption and truth value of each of them), and those in which we did not use the truth value of the assumption; with this truth value we mean the value that it had currently assigned in the knowledge base. Next we calculate the eciency regarding the number of components in each lattice, that we shall call Complete and Current.
Complete lattice
Given n assumptions and an m-valued logic, the number of components per level is shown in Table 2. Considering Cab as the number of permutations of a elements taken from sets of b. We Niveles Tamano Nivel n Cnn mn Nivel n-1 Cnn?1 mn?1 Nivel 3 Nivel 2 Nivel 1
:::
Cn3 m3 Cn2 m2 Cn1 m1
Table 2: Lattice size with n assumptions in an m-valued logic. go on to describe the way in which such a general expression has been reached, by calculating the number of environments which appear in each one of the levels of the lattice starting from the bottom. Nevertheless, before that, we should point out that it will have to omit, for obvious 8
reasons, all those permutations of dierent logic values that correspond to the same assumption. For instance, the environment fAv1 ; Av2 ; Bv1 g cannot be included in the lattice. Since, it is nonsense to deduce a fact based on the values v1 and v2 of assumption A simoultaneously.
Level 1. n assumptions and m truth values are contained, hence the number of dierent assumed facts is n m. Level 2. Where the environments that have two assumptions are formed, we must know
how many possible forms there are to combine two by two the n assumptions that exist, regardless of the truth values. That is to say, there would be Cn2 environments with two assumptions. However, as every assumption may have m dierent logic values, every precedent group forms m m, i.e., m2 dierent environments, any of which has one single assumption with two truth values.
Level 3. The reasoning would be exactly the same as in the previous case but the permutations will consist of three assumptions Cn3 . With m m m = m3 being the total of environments with three dierent assumptions that result from every permutacion.
Level n. When we have environments with all the assumptions, the number Cnn equals 1 and the amount of environments that can be generated is mn .
Thus, the size is of the order that the following expression describes:
O( .
n X i=1
Cni mi)
Current lattice
In this case, the two logic alternatives we have for an assumption are presence and absence with the truth value of the current state. Therefore, the lattice is limited to that of the classical logic with respect to its size. Thus, this is described by the expression O(P (A)), with P and A being the function parts of a set and the set of assumptions respectively. Expression which becomes O(2n ) when jAj = n. In accordance with the afore mentioned, we shall make the following distinction and call:
Qualitative Environment: the set fA1; : : :; Ang A, such that the truth value v(Ai) is vk (Ai ), i.e., it shall be given by its current state in the KBS .
Quantitative Environment: the set fA1=v(A1); : : :; An=v(An)g, with fA1; : : :; Ang A,
i.e., v (Ai) need not be equal to vk (Ai ). Therefore, the truth value of Ai is independent of its current value in the KBS .
In logic f0; 1g, the environments used by De Kleer are quantitative, only the presence or absence of the attribute Ai within the environment it belongs to decides its associated truth value as 1 or 0, respectively. This allows all the inferences made to be recorded, so in the future the problem solver need not make them again. 9
If we wish to keep all the inferences in logics with multiple truth values, we have to use quantitative environments as well. Although this only allows the inferences not to be triggered again by the problem solver. Nevertheless, the information stored may be immense and almost unmanageable. It has to be borne in mind that for some logics the computing time is not exactly one of the main problems we have to deal with in the reasoning since the inferences are very fast. On the contrary we have other important problems such as: the ease of working without any loss of information in the following inferences, the possibility of detecting an inconsistent KBS, knowing which data have been assumed erroneously, etc. The research will be carried out by means of the use of qualitative environments, although a parallel development can be conducted using quantitative environments.
4 De nitions and properties De nition 4.1 An Environment, we denote as E, is a set of primitive data from which other data are
deduced. A set of assumptions fA1; : : :; An g A, that take part nally in the logic deduction of a set of facts.
De nition 4.2
Given an item of information q 2 KBS , the ATMS Node is de ned associated to q , that we denote as Nq , triple as:
Nq : ((Values)(Label)(Justi cations)); Nq : ((V )(E )(J )); where V alues are the dierent logic values calculated from the dierent environments which comprise the label by means of the justi cations. More speci cally, we can represent a node as the expression:
Nq : ((vi ; : : :; vn)(E1; : : :; En)(J1; : : :; Jp)); or what is the same:
(1)
Nq : ((vi; : : :; vn)(P1; : : :; Pp)(J1; : : :; Jp));
where the dierent P will be subsets of environments which satisfy:
Js [ Ei `k q with vi(q) ; 8Ei 2 Ps ; that express the deduction of q with a certainty vi for a state k of KBS , de ning in this way the underlying environments in every justi cation Ji by means of Pi . Therefore, an ATMS node codi es the inference processes that have lead to the deduction of such a node, i.e.:
q with vi (q) 2 Th(Js [ Ei) ; 8Ei 2 Ps: 10
De nition 4.3
We shall de ne the context associated with the environment E , as the set of theorems deducible from E [ P , that we denote as:
Cont(E ) = Th(E [ P ):
De nition 4.4 An environment E is said to be inconsistent, if the contradiction (?) is deduced from the
assumptions that the environment consists of throughout the whole knowledge system, E [P `?, or what is the same, if ?2 Th(E [ P ). The term 'inconsistency' should be speci ed throughout the development of the particular cases according to the kind of logic used. An ATMS node in logic f0,1g is believes or does not believes. Provided that at least one environment in its label has all the assuptions present in the current fact base, the node is believes. Here, in logics with multiple truth values a node shall be said to be justi ed provided that its label is not empty, i.e., it has at least one environment which generates the context the datum belongs to. The concept of belief can be substituted here by that of justi cation, a believed node is a justi ed node. Naturally, the dierent justi cations can provide dierent truth values for a node in KBSk . However, the premises are the only data that need not be justi ed.
4.1 Properties of a node label The label E of a node Nq is desired to be consistent, sound, complete and minimal. With these properties being de ned as follows:
Consistency A label E is said to be consistent if: All its environments are consistent, i.e.: 8Ei 2 E ; Ei [ P 6`k ? : There is no inconsistency between the dierent truth values obtained by the environments that appear in the label. i.e.:
6 9vi; : : :; vk 2 V t.q. vi ^ : : : ^ vk =? : As the node is deduced with dierent logic truth values, there may be incompatibility between them. Because of this, the union of the environments Ei [ : : : [ Ek which generate such values becomes inconsistent and so does the node label. This second point is necessary because, depending on the kind of logic, all its environments may be consistent and however the conjunction of all the values calculated by some of them may be contradictory or inconsistent.
Soundness This property is veri ed if each one of the environments Ei, through the justi catios described in the label, shows an inference path to the node q with the truth values appearing in V : 8Ps 8Ei 2 Ps , Js [ Ei `k q with vi(q) ; vi (q) 2 V : 11
Completeness It means that all the proofs of the data are present in the node: 8E such that E [ P ` q with vi(q) ) 9Ej 2 E t.q. Subsume(E; Ej); where Subsume is a binary relation which is applied between sets of environments.
De nition 4.5
We shall say that the environment Ei subsume in the environment Ej , that we denote Subsume(Ei; Ej ), when:
8 < Subsume(Ei; Ej ) , : Ej Ei more restrictive(vj ; vi)
more restrictive will be a binary relation between the set of truth values, more restrictive : T T ; i.e., by means of completeness we shall ensure that in any deduction of datum from an environment there will be another environment in the node label which is a subset of the former. This subset will provide certainty about the datum deduced which is more precise (restrictive) than the one provided by the other environment. Or, in other words, with this property we are ensuring that there is no loss of information or information not considered regarding the process of deduction of the node, since the whole proof is recorded in the label.
Minimality It establishes that the inference paths used in each of the formal proofs are minimal with respect to the logic deduction of the data:
8Ei; Ej 2 E , Not Subsume(Ei; Ej ); i 6= j The minimality property of the label presupposes the minimality of each environment. In as far as, if any component is removed from the environment, it is not possible to deduce the datum this environment represents. These two properties presuppose the presence of a monotonic inference engine for the problem solver. If the property of monotony is not satis ed, these two properties would not be satis ed [6]. The eciency of TMS depends on the maintainance of consistency, soundness, completeness and minimality in the label of each node, after each inference made by the problem solver.
5 ATMS algorithms The aim of these algorithms is the maintenance of the above properties in the label of each node that the ATMS has active. This allows the minimum set of assumptions that underlie in the deduction of a fact and the truth values which are obtained from them to be available. The main algorithm of the ATMS when an inference is made by the problem solver will be similar to the one described by De Kleer in [5]. Although the node structure described in (1) has two basic instances that should be shown: 12
1. The dependence of the problem solver on the combination of environments. Since each environment in the label deduces the same datum, with a dierent truth value, we should use one of these values each time according to the environment combined. Therefore, each inference selected by the problem solver to be triggered will be based on making the same inference with each one of the dierent combinations in the environments of the labels for the antecedent nodes of the justi cation. It has to be pointed out that in the classical case, simply the union of the combined environments was enough to state that a new datum has been inferred, it was not necessary to know the truth value it has been inferred with. Since there were only two logic values f0,1g.
Example 5.1
We are going to suppose that at a certain moment the problem solver provides the ATMS with the following justi cation Ni; Nj ; Nk ) Nh , with the nodes being:
Ni : ((vi 1; vi2)(fA1; A2gfA3 g)(: : :)); Nj : ((vj 1 )(fA3; A4g)(: : :)); Nk : ((vk 1 )(fA1; A5g)(: : :)): The node which corresponds to the fact h will be created or updated as:
Nh : ((vh 1 ; vh 2)(fA1; A2; A3; A4; A5gfA1; A3; A4; A5 g)(fNi; Nj ; Nk g)); to:
vh 1 = I (vi1 ; vj 1 ; vk 1 ); vh 2 = I (vi2 ; vj 1 ; vk 1 ): Where I is the result achieved by the problem solver when it makes the inference which describes the original justi cation but with the certainty values which appear in brackets. This combination of environments adds an important feature to the expert system that in many cases is dicult to achieve with a great number of reasoning systems. That is, it permits no loss of information to take place during the deduction process since all the possibilities in the inference are taken into account and stored in the node structure. 2. The possible gradual character that the contradiction may have. The de nition of contradiction or inconsistency is probably not strict as it was in the classic case. Thus, bearing in mind the possible of this situation we should be able to allow its handling in the ATMS. Therefore, we shall de ne the function Incon : T T ! T , where Incon(vi ; vj ) gives a measure of the degree of inconsistency between those two truth values. Let the knowledge base system described by Table 3 be; in a certain instant k the ATMS will make the following nodes out of this base: 13
For each premise P 2 P ; NP : ((v(P ))(fg)(fNP g)): For each assumption A 2 A; NA : ((v(A))(fAg)(fNAg)): KB V alue FBk c1 v(c1) f1 c2 v(c2) f2 ::: KBSk
V alue vk (f1 ) vk (f2 ) :::
Table 3: General knowledge base system for the state k. This means that any premise is believed because of itself and it does not need any assumption which supports this belief. The veracity of the assumption also depends on itself, but due to its nature of assumed proposition at any moment the truth value it represents may be rectracted based on any later evidence or contradiction. Once the ATMS makes the initial justi cations the general process which is repeated with each inference of the problem solver is shown in Figure 3. We shall denote the node label Nui by the set Label(Nui ) = fEi1 ; : : :; Eip g:
For each justi cation Nu ; : : :; Nun ) Nh 1
E = UNION (E1r ; : : :; Ent ); r; t 2 f1 : : :pg vE (h) = I (vE1r (u1); : : :; vEnt (un )) if E 62 C then Add E to Label(Nh) if Degree(CONTRADICTION)
then
Contradiction resolution algorithm
else
Make Label(Nh) MINIMAL
Update all the nodes that contain Nh in their justi cations (Recursive call) Figure 3: Main algorithm in the generic ATMS. The set C contains the input which has been considered as inconsistent due to a contradiction degree greater than . When the degree of inconsistency of a set is the contradiction resolution algorithm has two options: 14
1. Retract the truth value of some of the assumptions. This process shall be developed by examining the justi cations of the deductible facts. Whin A being the assumption retracted we shall make the main algorithm again with each one of the justi cations that contain NA . The user can be provided with the possibility of choosing the truth value he wishes to give to the assumption retracted. Although, the ATMS may choose its automatic retraction depending on some criteria established. 2. To Eliminate the inconsistency of the node labels, by removing from them any environment which is subsumed without modifying the truth values of the assumptions. This submission has nothing to do with that described above. Here, it only contains the sets of assumptions. It has to be taken into account that inconsistency aects the whole knowledge system. Therefore if a set of assumptions is inconsistent, any of its supersets will be inconsistent as well. Although a non contradictory value can be obtained out of this superset. Both possibilities are applicable, the use of one or the other will depend on what is intended, when using the system. It may be aimed at the validation of the information supplied in the knowledge base or at the knowledge of the input facts that would meet certain requirements, or simply at a reasoning process.
6 Particular Cases: [0,1]-valued logic and Fuzzy logic In this section we intend to particularize the generic ATMS to be able to reason with [0,1]-valued logics and fuzzy logics. Here we only oer an outline, although more detailed research will be presented in future papers.
6.1 Reasoning with [0,1]-valued logic This has also been studied in [2],[9]. The original functions of the connectives ^, _ are now carried out by the so called t-norm (T) and t-conorm (S) which are binary operations extended to the [0,1] interval with a set of required properties. In the literature there are many studies about the helpfulness of each one of them; as an example we should mention the ones that appear in Table 4. The relationship between t-norms and t-conorms is expressed as in the case T-Conorm T-Norm Minimum: Min(x; y ) = minfx; y g Maximum: Max(x; y ) = maxfx; y g Times: (x; y ) = fx + y ? xy g Times: (x; y ) = xy Lukasiewicz: W (x; y ) = maxfx + y ? 1; 0g Lukasiewicz: W (x; y ) = Minfx + y; 1g Table 4: Main t-norms and t-conorms. of classical logic by the negation connective. The implication connective is together with the inference rule of the Modus Ponens the main issue of logical reasoning. Trillas and Valverde 15
[14] oer an axiomatic of the implication connectives for a multivalued logic in [0,1]. Among the main groups of implication functions we shall highlight two of them, the strong implications or S-implications, which satisfy I (x; y ) = S (n(x); y ), and the implications by residuation or R-implications, which satisfy I (x; y ) = Supfc 2 [0; 1]=T (x; c) y g. The modus ponens generated function, m, (with respect to I), provides a lower bound for the truth value of the consequent, m(x; I (x; y )) y . The knowledge base KB will consist of a set of rules such as f1 ^ : : : ^ fp ?! h with cf =
; fi 2 F , h 2 H, and the fact base FB will consist of, f1 with cf = 1 ; : : :; fq with cf = q , with cf being the certainty factor which belongs to the interval [0,1]. With these certainty factors, the rules and facts are belived. Let V be the set of all the valuations about F , V = fv : F ?! [0; 1]g, it may be seen that, jVj = 1, unlike the value 2jFj calculated in the logic f0,1g. Each evaluation function v 2 V makes the value cf (f ) correspond to any f 2 F at a certain moment. This value shows us that the belief we have about the fact f is included in the interval [cf (f ); 1]. We can express, therefore, more generally, that v : F ?! [0; 1] [0; 1], where v (f ) = fa; bg means that v (f ) belongs to the interval [a; b] [0; 1]. The total ignorance for f will be shown by v (f ) = f0; 1g. Initially:
v(h) = f0; 1g; 8h 2 H; v(e) = fcf (e); 1g; 8e 2 I : We recall that cf (f ) = a i cf (:f ) 1 ? a. An inconsistency will be generated when an h 2 H is deduced such that vk (h) = fa; bg and a > b: The operation union applied to several environments is de ned as, E = Union (E1; : : :; En) , E = E1 [ : : : [ En; such an operation is therefore reduced to the union de ned by the theory of the classic sets. The minimality in the label is achieved from the operation of submission. We shall say that the environment Ei subsume in the environment Ej to the node label Nh , when:
8 < E Ei Subsume (Ei; Ej ) , : j more restrictive (cfEj ; cfEi )
more restrictive will be a binary operation in the set T = [0; 1]. more restrictive : [0; 1] [0; 1], and will be de ned as more restrictive (cfEj ; cfEi ) , cfEi cfEj :
6.2 Reasoning with Fuzzy Logic In fuzzy logic there are two big alternatives of reasoning - the use of linguistic labels and the use of logic truth values [Lopez de Mantaras 90]. In the rst case, the generalized modus ponens or compositional rule of inference (CRI) allows us to obtain a conclusion regarding the possibility distribution of Y given that "if X is A then Y is B " and knowing that X is A0 where A and A0 are dierent linguistinc label. That is, 16
if A then B A0
B0
where B 0 is obtained as follows:
8y; B0 (y) = supxT (A0 (x); IT [A (x); B(y)]); which will be equivalently written for simplicity:
B0 = A0 IT (A; B); where 0 0 means the 'sup T composition operation' for any triangular norm T . The propatation of fuzzy truth values through inference allows us to compute the fuzzy truth value associated with the proposition "Y is B " given the rule "if Y is A then Y is B " and the fuzzy truth value corresponding to "X is A", as follows: if X is A
X is A is
then Y is B
Y is B is
where (y ) = MI ( )(y ), the latter being
MI ( )(y) = supx mI [ (x); I (x; y)];
(2)
I being the implication function associated with the rule and mI the modus ponens generating function of I . In the rst case, the ATMS would generate nodes such as: (Nz is H 0 ; (fv g); (: : :)); (Nz is H 00 ; (fu; v g); (: : :)), and consequently an environment lattice would be needed for each dierent label of an output variable. However, given the equivalence z is H 0 z is H is , [1], we may consider the alternative of keeping a single lattice per variable. To achieve that aim we should represent the truth fuzzy values independently for each one of the environments which generate each variable. In Figure 5 we can see this feature. Baldwin [1] de nes a set of nine fuzzy truth values such as they appear in Figure 4. At this moment, the concept of inconsistency will be de ned according to the truth values which dierent environments identify for the same variable. We will have to provide an inconsistency function which determines the degree of inconsistency that we denote as: Incon(i; j ). The subsume operation applied to the environments of a label is no longer reduced to just the inclusion of sets. On the contrary, it is also going to depend on the truth values calculated by the sets for the node. We will say that an environment Ei with an associated truth value i 17
τ 1
Undecided fairly true true
very true absol. true
absol. false
fairly false false very false 0
1
x
Figure 4: Fuzzy truth functions. subsume in Ej with j provided that Ej is a subset of Ei and the truth linguistic value j is more restrictive than i . The idea of more restrictive must be de ned for two dierent logic values. Intuitively, we can think that, for example, "very true" is more restrictive than "fairly true". We have to bear in mind that our aim is to store the minimum quantity of information -in the label- with the highest degree of certainty for that deduced from it. In Figure 5, we can see the label of the node which consists of: (fug,fu,wg,fu,v,wg), which implies that the environment fu,v,wg does not subsume either in fu,wg or in fug, and that fu,wg at the same time does not subsume in fug. This label already shows the restriction about its respective truth values:
c is more restrictive than b which is more restrictive than a: The truth value i shows that we cannot know anything about the output datum from the assumptions provided by those environments. It is an inde nite value about the certainty of the deduction of the fact. Therefore the node will be such as follows:
Nz is H : ((a; b; c)(fug; fu; wg; fu; v; wg)(: : :)): Given i and j 2 T , we shall de ne the inconsistency between them that we shall denote by Incon(i; j ) as 1 ? supx fi (x) ^ j (x)g: This de nition nds the points of intersection of the functions i and j . In Figure 6 these points are shown and they are numbered from 1 to 7. These seven values denote a granularity in the de nition of inconsistency. The intersections labelled with the number 7 establish a total inconsistency among the pairs that meet there. The intersections labelled with the number 1, quite to the contrary, show that the truth values that intersect are totally compatible and consistent among them. The union operation applied to some environments is de ned as E = Union (E1r ; : : :; Ent ) , E = E1r [ : : : [ Ent , such an operation is also reduced to the union operacion de ned in the theory of classic sets. The minimality in the label is obtained from the operation of submision. 18
z is H
τi
τc
τa
τa
τi
{u, v}
{u}
{u, v, w}
τb
τi
{u, w}
{v, w}
{v}
{w}
{}
Figure 5: Lattice with fuzzy truth values. We shall say that the environment Ei subsume in the environment Ej for the node label Nh , when: 8 < E Ei Subsume (Ei; Ej ) , : j more restrictive (Ej ; Ei ) more restrictive will be a binary relation between the set of truth linguistic labels T and it will be de ned as more restrictive (n ; m) , n (x) m (x); x 2 [0; 1]; or what is the same
8 < n 5; m 5; n m more restrictive (n ; m ) , : n 5; m 5; n m
with n and m being two integer values that identify the 9 fuzzy truth values denoted. In Table 5 this binary relation is shown graphically, for the nine values. Two groups are distinguished:
The values labelled from 1 to 4. It consists of: absolutely false, very false, false, fairly false. These are values which denote a certain falsness.
The group labelled from 6 to 9. It consists of: fairly true, true, very true, absolutely true.
These values denote belief. In each group some values are likely to be more restrictive than others. Nevertheless, there is no possible constraint between both groups, i.e., there is no possible relation between their truth values. This reinforces the de nition above of being more restrictive. Since, it would make no sense to remove an environment because it satis es this relation when it is applied to two values so contradictory as those which appear in both situations.
7 Conclusions In this paper a Generic ATMS has been designed. Thus, a development frame for the ATMS has been made possible which is capable of interacting with systems that use any sort of propositional 19
τ
(5) Undecided (6) fairly true
1 (7) true
2 3
(8) very true absol. false
4 5 6
(4) fairly false
(1)
false (3)
very false (2)
7
absol. true (9)
x
Figure 6: Graphically Incon(i ; j ). monotonic logic in their reasoning. Due to this fact, throughout the design process for the ATMS, exhaustive research was carried out on the eciency required for approaching other kinds of logic other than that using f0,1g. The Generic ATMS has been particularized to the case of Multivalued logic with certainty factors, more especi cally to the [0,1]-valued logic. A criterion has been provided for establishing when we can remove an environment which involves the deduction of a datum without losing information about it. Likewise, the ATMS has been particularized to the case of Fuzzy logic with fuzzy truth values. The notion of partially inconsistent environment, inconsistency and submission has been introduced and de ned regarding a set of 9 fuzzy truth values.
References [1] Baldwin, J.F., A new approach to approximate reasoning using a fuzzy logic, Fuzzy Sets and Systems 2, 309-325, 1979. [2] Castro, J.L., and Zurita, J.M., A multivalued logic ATMS. To appear in International Journal of Intelligent Systems. [3] D'Ambrosio, B., A hybrid approach to reasoning under uncertainty, International Journal of Approximate Reasoning, 2(1), 29-47, 1988. [4] Doyle, J., A truth maintenance system, Arti cial Intelligence, 12, 231-272, 1979. [5] De Kleer, J., An assumption-based TMS, Arti cial Intelligence, 28, 127-162, 1986. [6] De Kleer, J., Problem solving with the ATMS, Arti cial Intelligence, 28, 197-224, 1986. 20
1 2 3 4 5 6 7 8 9
n
1 2 3 4 5 6 7 8 9 m 1 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0
1 1 1 0 0 0 0 0 0
1 1 1 1 0 0 0 0 0
1 1 1 1 1 1 1 1 1
0 0 0 0 0 1 1 1 1
0 0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 1 1
0 0 0 0 0 0 0 0 1
Table 5: more restrictive(n; m ). [7] De Kleer, J., and Williams, B.C., Diagnosing multiple faults, Arti cial Intelligence, 32, 97130, 1986. [8] Falkenhainer, B., Towards a general-purpose belief maintenance system, in: Uncertainty in Arti cial Inteligence, No. 2, (J.F. Lemmer and L.N. Kanal, Eds.), North-Holland, Amsterdam, 1988. [9] Fringuelli, B., and Marcugini, S., and Milani, A., and Rivoira, S., A reason maintenance system dealing with vague data., in: Proceedings of the 7th Conference on Uncertainty in Arti cial Intelligence (D. D'Ambrosio and Ph. Smets and P. Bonissone, eds.), Los Angeles, 111-117, 1991. [10] Inoue, K., Linear resolution for consequence nding, Arti cial Intelligence, 56, 301-353, 1992. [11] Laskey, K.B., and Lehner, P.E., Assumptions, beliefs and probabilities, Arti cial Intelligence, 35, 25-79, 1988. [Lopez de Mantaras 90] Lopez de Mantaras, R. Approximate reasoning models. Ellis Horwood Limited, 1990. [12] McAllester, D.A., An outlook on truth maintenance, Tech. Report No. 551, Massachusetts Institute of Technology. Arti cial Intelligence Laboratory, 1980. [13] Meseguer, P., Verdaguer, A. Veri cation of multi-level rule-based expert systems: Theory and practice. International Journal of Expert Systems, 6, (2), 1993, 163-192. [14] Trillas, E., and Valverde, L., On implication and indistinguishability in the setting of fuzzy logic., in: Management decision support using fuzzy sets and possibility theory, (J. Kacprzyk and R.R. Yager, eds.), Verlag TUV, 198-212, 1985. 21
[15] Zurita, J.M., Dise~no de un ATMS generico. Aplicaciones al aprendizaje y a la validacion de bases de conocimiento. PhD. Thesis, Universidad de Granada, Spain, 1994.
22