Available online at www.sciencedirect.com
Mathematics and Computers in Simulation 82 (2011) 29–43
A new algebraic model for implementing expert systems represented under the ‘Concept-Attribute-Value’ paradigm Antonio Hernando Depto. de Sistemas Inteligentes Aplicados, Escuela Universitaria de Informática, Universidad Politécnica de Madrid, Carretera de Valencia km 7, 28031 Madrid, Spain Received 4 November 2009; received in revised form 27 May 2010; accepted 9 June 2010 Available online 6 July 2010
Abstract This paper is concerned with expounding a new representation paradigm for modeling expert systems based on computing Groebner Bases. Previous research on Groebner Bases expert systems has so far been connected to modeling expert systems based on propositional logics. Our approach instead is based on the well-known Artificial Intelligence ‘Concept-Attribute-Value’ paradigm for representing knowledge. More precisely, our research is based on translating an already existent expert system described in terms of the ‘Concept-Attribute-Value’ paradigm to a new algebraic model which represents knowledge by means of polynomials. In this way, issues about consistence and inference within this expert system will be, through this new model, transformed into algebraic problems involving calculating Groebner Bases. By using this new model of ours, some interesting advantages ensue: on the one hand, knowledge representation may be performed in a more straightforward and intuitive way; on the other, calculating the Groebner Bases associated to our algebraic model is usually faster adopting this new ‘Concept-Attribute-Value’-based paradigm than it was in previous propositional logic-based expert systems. © 2010 IMACS. Published by Elsevier B.V. All rights reserved. Keywords: Groebner Bases; Logic and symbolic computing; Rule based expert systems
1. Introduction Expert systems are computational programs on a certain domain which try to simulate the decisions that human experts on this domain would take. In the last years, much research has been focused on developing both techniques for representing the human knowledge in a computer and techniques for reasoning automatically. An interesting way for representing knowledge in an expert system is based on propositional logic under which, the issue about the knowledge inference is completely related to the concept of Tautological consequence. Besides, by means of a mathematical result [13] based on previous work [1,5–7], this issue can be translated to an algebraic problem involving calculating certain Groebner bases [2,3]. In this way, expert systems based on propositional logic may be very easy implemented by means of a computer algebra system like CoCoA [4,12] or Maple [14]. Making use of this result, different expert systems have been so far developed in the last recent years [8,9,11,15]. The ‘Concept-Attribute-Value’ paradigm [10] provides another way for representing knowledge in Expert Systems which presents some advantages over propositional logic. However, there is so far no direct mathematical result
E-mail addresses:
[email protected],
[email protected]. 0378-4754/$36.00 © 2010 IMACS. Published by Elsevier B.V. All rights reserved. doi:10.1016/j.matcom.2010.06.020
30
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
Table 1 Example of conceptual ground. Concept
Attributes
Values
Car
Engine temperature Level of coolant liquid Must be stopped ...
{low, normal, high} {low, normal, high} {true, false} ...
Environment
Temperature ...
{low, normal, high} ...
which let us implement an expert system based on ‘Concept-Attribute-Value’ paradigm by means of computer algebra systems. In this paper, we will present a mathematical result which let us connect inference problems on a ‘Concept-AttributeValue’-based representation to the computation of Groebner bases. By using this result, some interesting advantages ensue over the approach based on propositional logics: on the one hand, knowledge representation may be performed in a more straightforward and intuitive way; on the other, calculating the Groebner Bases associated to our algebraic model is usually faster adopting this ‘Concept-Attribute-Value’-based paradigm than it was in previous propositional logic-based expert systems. In Section 2 we will give an overview of the ‘Concept-Attribute-Value’ paradigm for representing knowledge in expert systems. In Section 3 we will present an algebraic model for implementing expert systems by means of mathematical software. Our model is illustrated with an example in Section 4. In Section 5, we will study the main advantages of our model as compared to the aforementioned propositional logic-based expert systems. In Section 6 we will give a formal proof of the main theorem stated in this paper. Finally, in Section 7, we will summarize our conclusions. 2. The ‘Concept-Attribute-Value’ paradigm 2.1. Overview of the ‘Concept-Attribute-Value’ paradigm The paradigm ‘Concept-Attribute-Value’ is a very well known and useful model for knowledge representation in Artificial Intelligence. By means of ‘Concept-Attribute-Value’, the human knowledge may be represented in a natural way through concepts, attributes for each concept, and possible values for each attribute. For example, we will consider an expert system supervising the safety operation of a car engine. The knowledge of this expert system is described by means of different concepts like ‘Car’ or the ‘Environment’. The engine temperature and the level of coolant liquid (with three possible values: ‘low’, ‘normal’ and ‘high’) are attributes of the concept ‘Car’. The fact of whether the car must be stopped is also an attribute of the concept ‘Car’ with two possible values: ‘true’ and ‘false’. The outside temperature can be regarded as an attribute of the concept ‘Environment’ with three possible values: ‘low’, ‘normal’ and ‘high’. All of these is illustrated in Table 1. There are different instances for each concept. Each instance of a concept C associates for each attribute A of the concept C, a value in the possible value of A. For each concept C, there is a table. Each column in the table corresponds to each attribute of the concept C. Each row in the table corresponds to each instance of the concept C. The cell of the table associated to the concept C which is placed in the row associated to an instance I and the column associated to the attribute A indicates the possible value that the instances has in the attribute A. By means of these tables, we can represent different situations or states. All of these are illustrated in Table 2 describing a possible state of the car. As may be seen in this example, we only consider one instance of the concept ‘Car’ and ‘Environment’. By means of requirements (mainly rules), we can state different relations between the cells of these tables. In order to define these relations, we need to associate variables to cells. According to the previous example, we could state that when the engine temperature is high, the level of the coolant liquid is low and the environment temperature is high, then the car must be stopped. That is to say: (CT = high) ∧ (L = low) ∧ (ET = high) → (S = true)
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
31
Table 2 Example of a state. Car Engine temperature high (CT)
Level of coolant liquid low (L)
Must be stopped true (S)
... ...
Environment Temperature high (ET)
... ...
where CT, L, ET and S are variables associated respectively to the value of the engine temperature, the level of the coolant liquid, the environment temperature and the value of the proposition “the car must be stopped”. Once we have stated all the requirements, we can focus on two different questions: • the problem of determining if the value of a cell can be deduced from the requirements when some cells of the tables are known. • the problem of determining if there is any possible state which fulfills all the requirements. In the next section, we will study how both questions could be dealt with means of an algebraic method. 2.2. Representation formalism Now we will study formally the representation paradigm described in the previous section. First of all, like in any representation formalism, we need to define a conceptual ground under which knowledge is represented. We will use V to denote the set of possible values of all the attributes. We will define a set of variables associated to the cells of the tables described above. Each variable, x, may take a finite subset (with at least two elements) of V, (x). Definition 1 (Conceptual Ground). A conceptual ground is a triple (X, V, ) where X is a finite set of possible ‘variables’, V is a finite set of possible ‘values’, and is a function X → P(V) where P(V) represents the power set of V and such that ∀x ∈ X|(x)| ≥ 2. Now we can define the possible states which can be described within this conceptual ground. Definition 2 (State). A state S of a conceptual ground (X, V, ) is defined as a function S : X → V such that ∀x ∈ X, we have that S(x) ∈ (x). Remark 3. We make use of S(X,V,) for denoting the set of possible states of the conceptual ground (X, V, ). Now, we define the relations between the variables (that is to say, as it was mentioned above, the possible relations between different cells of the tables). These are represented by means of formulae (see Definition 4). Definition 4 (Formula). A formula of the conceptual ground (X, V, ) is recursively defined as follows: • • • •
x = v where x ∈ X is a variable and v ∈ (x) is a possible value of x x = y where x, y ∈ X are variables ¬A where A is a formula of the conceptual ground (X, V, ) A1 ∨ A2 where A1 , A2 are formulae of the conceptual ground (X, V, )
Remark 5. We make use of C(X,V,) for denoting the set of formulae of the conceptual ground (X, V, ).
32
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
By using ¬ and ∨, we can define the other common binary connectives, ∧, →, ↔: Definition 6. The following connectives are defined as follows: • A ∧ B is defined as ¬(¬A ∨ ¬B) • A → B is defined as ¬A ∨ B • A ↔ B is defined as (A ∧ B) ∨ (¬A ∧ ¬B) Remark 7. We make use of the notation (A1 ∧ . . . ∧ An ) → (B1 ∨ . . . ∨ Bm ) (where A1 , . . . , An , B1 , . . . Bm are formulae) for denoting the formula: ¬A1 ∨ . . . ∨ ¬An ∨ B1 ∨ . . . ∨ Bm
Now, we define the semantics of formulae: Definition 8 (Holds). Let (X, V, ) be a conceptual ground. Let A ∈ C(X,V,) be a formula. Let S ∈ S(X,V,) be a state. The formula A holds in the state S if and only if: CaseA ≡ x = v where x ∈ X and v ∈ (x) A holds in S ⇔ S(x) = v CaseA ≡ x = y where x, y ∈ X A holds in S ⇔ S(x) = S(y) CaseA ≡ ¬B where B is a formula A holds in S ⇔ B does not hold in S CaseA ≡ B ∨ C where B and C are formulae A holds in S ⇔ either B holds in S or C holds in S Once we have defined how to define relations between variables under a conceptual ground, we can define the knowledge base of an expert system under a conceptual ground as a set of formulae in this conceptual ground. Definition 9 (Knowledge Base). The Knowledge Base of an Expert is (X, V, , F) where F ⊂ C(X,V,) is a finite set of formulae. The states which fulfill all formulae in the knowledge base are known as possible states. Definition 10 (Possible State). Let (X, V, , F) be the Knowledge Base of an Expert. A state S ∈ S(X,V,) is a possible state if and only if ∀A ∈ F,
A holds inS.
The formulae that always hold for every possible state are known as derivable formulae. Definition 11 (Derivable Formula). Let KB ≡ (X, V, , F) be the Knowledge Base of an expert. The formula B ∈ C(X,V,) is derivable from KB if and only if B holds for every possible state of KB.
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
33
3. The algebraic model In this section, we will provide an algebraic model for the representation paradigm described in the previous section. By using this model, the following problems will be translated into algebraic terms: • the problem of determining if a formula is derivable from the knowledge base (see Theorem 13). • the problem of determining if there is no possible state in a given knowledge base (see Corollary 14). Let (X, V, ) be a conceptual ground where X = {x1 , . . . , xm }. First of all, we define a bijection φ, between the possible values V and {0, . . . ,a − 1} (where a is the number of possible values in V): φ : V → {0, . . . , a − 1} Next, we will consider a prime integer p such that p ≥ a. Then, we will associate to each xi ∈ X the following polynomial ri ∈ Zp [xi ]: (xi − φ(v)) ri = v ∈ (xi )
Once the polynomials ri are defined, we define the ideal I = r1 , r2 , . . . , rm in the ring Zp [x1 , . . . , xm ]. We will denote the ring A = Zp [x1 , x2 , . . . , xm ]/I on which we define polynomials.1 Each formula will be translated to an element of this ring A as follows: Definition 12 (Polynomial associated to a formula). Let (X, V, ) be a conceptual ground. Let A ∈ C(X,V,) be a formula. The polynomial qA ∈ A associated to the formula A is defined as follows: CaseA ≡ xi = v where xi ∈ X and v ∈ (xi ). qA ≡ xi − φ(v) CaseA ≡ xi = xj where xi , xj ∈ X. qA ≡ xi − xj CaseA ≡ ¬B where B is a formula. qA ≡ qB p−1 − 1 CaseA ≡ B ∨ C where B and C are formulae. qA ≡ qB · qC
By means of Theorem 13, the problem of determining if a formula is derivable from a given knowledge base is expressed in algebraic terms: 1 The underlying idea related to these translation is that for any formula A and its polynomial q , the following holds: A(x , . . . , x ) holds A 1 m ⇔ qA (ϕ(x1 ), . . . , ϕ(xm )) = 0.
34
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
Table 3 Example Concept
Attributes
Values
C1
A1 A2
{LOW, MEDIUM, HIGH} {LOW, MEDIUM, HIGH}
C2
A3
{LOW, MEDIUM, HIGH}
C1 A1 x
A2 y
C2 A3 z t
Theorem 13. LetKB ≡ (X, V, , {A1 , . . . , An }) be the knowledge base of an expert. LetB ∈ C(X,V,) be a formula. We have that 2 : B is derivable from KB ⇔ qB ∈ qA1 , . . . , qAn By means of the following corollary, the problem of determining if there are any possible states within the given knowledge base is translated into algebraic terms as follows: Corollary 14. LetKB ≡ (X, V, , {A1 , . . . , An }) be the knowledge base of an expert. There are no possible states in the KB ⇔ 1 ∈ qA1 , . . . , qAn Proof. Let a, b ∈ (x1 ) such that a = / b. Then we have that: There is no possible states in the KB ⇔ ⇔ the formulae x1 = a and x1 = b are derivable from KB ⇔ ⇔ (x1 − φ(a)) ∈ qA1 , . . . , qAn and (x1 − φ(b)) ∈ qA1 , . . . , qAn ⇔ ⇔ 1 ∈ qA1 , . . . , qAn 4. Example In this section, we will compare the implementation of an abstract expert system according to the algebraic model based on propositional logic and the algebraic model presented in our paper. Both implementations are made under the algebraic software CoCoA 4.5 [4,12]. We will consider two concepts: ‘C1’ with two attributes ‘A1’ ‘A2’ and one instance; and ‘C2’ with one attribute ‘A3’ and two instances, as may be seen in Table 3. We associate the variables x, y respectively to the values of attributes ‘A1’ and ‘A2’ in the instance of the concept ‘C1’. In the same way, we associate the variables z, t to the attribute ‘A3’ in the two instances of the concept ‘C2’. We will consider the following relations between the variables: 2
As may be seen, qB , qA1 , . . . , qAr ∈ A = Zp [x1 , x2 , . . . , xm ]/I and the ideal qA1 , . . . , qAr is also defined on the quotient ring A.
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
35
R1 ≡ (y = LOW) → ((z = HIGH) ∨ (z = MEDIUM)) R2 ≡ (x = LOW) → (z = HIGH) R3 ≡ ((x = HIGH) ∧ (y = HIGH)) → (z = LOW) R4 ≡ ((x = HIGH) ∧ (y = MEDIUM)) → (z = MEDIUM) R5 ≡ ((x = MEDIUM) ∧ (y = HIGH)) → (z = MEDIUM) R6 ≡ ((x = MEDIUM) ∧ (y = MEDIUM)) → (z = HIGH) R7 ≡ (y = LOW) → (t = LOW) R8 ≡ ((x = MEDIUM) ∧ (y = HIGH)) → (t = MEDIUM) R9 ≡ ((t = MEDIUM) ∧ (x = HIGH)) → (y = HIGH) R10 ≡ (t = HIGH) → ((x = MEDIUM) ∨ (y = MEDIUM)) Formally, we have that: X = {x, y, z, t} V = {LOW,MEDIUM,HIGH} (x) = (y) = (z) = (t) = {LOW,MEDIUM,HIGH} Now, we will consider the following facts related to a state: F1 ≡ (y = LOW) ∨ (x = HIGH) F2 ≡ (z = HIGH) F = {R1 , . . . , R10 } ∪ {F1 , F2 } KB = (X, V, , F) 4.1. In the new algebraic model Since the set of possible attributes is V = {LOW,MEDIUM,HIGH}, we have that p = 3. Now, we define the bijection φ : V → {0, 1, 2} as follows: φ(LOW) = 0 φ(MEDIUM) = 1 φ(HIGH) = 2 In Cocoa, all of this along with the definition of the ideal I and the ring A would be implemented as follows: USE Z/(3)[x,y,z,t]; MEMORY.I:=Ideal(x∧ 3-x, y∧ 3-y, z∧ 3-z,t∧ 3-t); HIGH:=2; MEDIUM:=1; LOW:=0; The connectives described in Definition 6 would be implemented in CoCoA as follows: NEG(M):=NF(M∧ 2-1,MEMORY.I); O(M,N):=NF(M*N,MEMORY.I); The rules of the expert system would be defined as follows: R1:=NF(NEG(y-LOW) * (z-HIGH) * (z-MEDIUM),MEMORY.I); R2:=NF(NEG(x-LOW) * (z-HIGH),MEMORY.I); R3:=NF(NEG(x-HIGH) * NEG(y-HIGH) * (z-LOW),MEMORY.I);
36
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
R4:=NF(NEG(x-HIGH) * NEG(y-MEDIUM) * (z-MEDIUM),MEMORY.I); R5:=NF(NEG(x-MEDIUM) * NEG(y-HIGH) * (z-MEDIUM),MEMORY.I); R6:=NF(NEG(x-MEDIUM) * NEG(y-MEDIUM) * (z-HIGH),MEMORY.I); R7:=NF(NEG(y-LOW)*(t-LOW),MEMORY.I); R8:=NF(NEG(x-MEDIUM)*NEG(y-HIGH)*(t-MEDIUM),MEMORY.I); R9:=NF(NEG(t-MEDIUM)*NEG(x-HIGH)*(y-HIGH),MEMORY.I); R10:=NF(NEG(t-HIGH)*(x-MEDIUM)*(y-MEDIUM),MEMORY.I); The facts considered would be defined as follows: F1:=(y-LOW)*(x-HIGH); F2:=(z-HIGH); Now, we define the ideal J related to the knowledge of this expert system: J:=Ideal(R1,R2,R3,R4,R5,R6,R7,R8,R9,R10,F1,F2); Now, we may find out which value of the variable t is inferred by means of the following commands: NF(t-HIGH,MEMORY.I+J); NF(t-MEDIUM,MEMORY.I+J); NF(t-LOW,MEMORY.I+J); CoCoA takes 16 ms for responding this:
That is to say, t =LOW is deduced from KB. 4.2. Propositional model Now, we will consider the algebraic model based on propositional logic for representing knowledge [1,13]. In this 2 + model, each logic formula, A, is translated into a Boolean polynomial in the ring Z2 [x1 , . . . , xm ]/ x12 + x1 , . . . , xm xm . A variable xi stands for an atomic proposition, and the polynomial qA associated to the formula A is defined recursively taking into account that: • • • • •
A ≡ X where X is an atomic proposition. We have that qA = x. A ≡ ¬B where B is a formula. We have that qA = 1 + qB . A ≡ B ∨ C where B, C are formulae. We have that qA = qB + qC + qB · qC . A ≡ B ∧ C where B, C are formulae. We have that qA = qB · qC . A ≡ B → C where B, C are formulae. We have that qA = 1 + qB + qB · qC .
According to this model we would require the following 12 atomic propositions so as to represent the same knowledge in the previous example.
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
x[1]: x is ‘low’ y[1]: y is ‘low’ z[1]: z is ‘low’ t[1]: t is ‘low’
x[2]: x is ‘medium’ y[2]: y is ‘medium’ z[2]: z is ‘medium’ t[2]: t is ‘medium’
37
x[3]: x is ‘high’ y[3]: y is ‘high’ z[3]: z is ‘high’ t[3]: t is ‘high’
In CoCoA, the following sentences define the polynomial ring on which formulae are translated: USE Z/(2)[x[1..3],y[1..3],z[1..3], t[1..3]]; MEMORY.I:=Ideal(x[1]∧ 2-x[1], x[2]∧ 2-x[2], x[3]∧ 2-x[3], y[1]∧ 2-x[1], y[2]∧ 2y[2], y[3]∧ 2-y[3], z[1]∧ 2-z[1], z[2]∧ 2-z[2], z[3]∧ 2-z[3], t[1]∧ 2-t[1], t[2]∧ 2-t[2], t[3]∧ 2-t[3]); NEG(M):= NF(1+M,MEMORY.I); O(M,N):= NF(M+N+M*N,MEMORY.I); Y(M,N):= NF(M*N,MEMORY.I); IMP(M,N):= NF(1+M+M*N,MEMORY.I); The rules of the expert system would be defined as follows: R1:=IMP(y[1],O(z[3],z[2])); R2:=IMP(x[1],z[3]); R3:=IMP(Y(x[3],y[3]),z[1]); R4:=IMP(Y(x[3],y[2]),z[2]); R5:=IMP(Y(x[2],y[3]),z[2]); R6:=IMP(Y(x[2],y[2]),z[3]); R7:=IMP(y[1],t[1]); R8:=IMP(Y(x[2],y[3]),t[2]); R9:=IMP(Y(t[2],x[3]),y[3]); R10:=IMP(t[3],O(x[2],y[2])); In propositional logic, we must consider integrity constraints. For example, the atomic propositions x[3], x[2], x[1] cannot hold at the same time. Indeed, exactly one of these atomic propositions must hold. Something similar happens with the sets of variables {y[3], y[2], y[1]}, {z[3], z[2], z[1]} and {t[3], t[2], t[1]}. Consequently, we have the following integrity constraints3 : I1:=O(O(Y(Y(x[1],NEG(x[2])),NEG(x[3])), Y(Y(NEG(x[1]),NEG(x[2])),x[3])); I2:=O(O(Y(Y(y[1],NEG(y[2])),NEG(y[3])), Y(Y(NEG(y[1]),NEG(y[2])),y[3])); I3:=O(O(Y(Y(z[1],NEG(z[2])),NEG(z[3])), Y(Y(NEG(z[1]),NEG(z[2])),z[3])); I4:=O(O(Y(Y(t[1],NEG(t[2])),NEG(t[3])), Y(Y(NEG(t[1]),NEG(t[2])),t[3]));
Y(Y(NEG(x[1]),x[2]),NEG(x[3]))), Y(Y(NEG(y[1]),y[2]),NEG(y[3]))), Y(Y(NEG(z[1]),z[2]),NEG(z[3]))), Y(Y(NEG(t[1]),t[2]),NEG(t[3]))),
Now we define the ideal related to the knowledge of the expert system:
3 The integrity constrains are: (x[1] ∧ ¬x[2] ∧ ¬x[3]) ∨ (¬x[1] ∧ x[2] ∧ ¬x[3]) ∨ (¬x[1] ∧ ¬x[2] ∧ x[3]); (y[1] ∧ ¬y[2] ∧ ¬y[3]) ∨ (¬y[1] ∧ y[2] ∧ ¬y[3]) ∨ (¬y[1] ∧ ¬y[2] ∧ y[3]); (z[1] ∧ ¬z[2] ∧ ¬z[3]) ∨ (¬z[1] ∧ z[2] ∧ ¬z[3]) ∨ (¬z[1] ∧ ¬z[2] ∧ z[3]); (t[1] ∧ ¬t[2] ∧ ¬t[3]) ∨ (¬t[1] ∧ t[2] ∧ ¬t[3]) ∨ (¬t[1] ∧ ¬t[2] ∧ t[3]).
38
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
J:=Ideal(NEG(R1),NEG(R2),NEG(R3),NEG(R4),NEG(R5), NEG(R6),NEG(R7),NEG(R8), NEG(R9),NEG(R10) NEG(I1),NEG(I2),NEG(I3),NEG(I4)); The facts considered would be defined as follows: F1:=O(y[1],x[3]); F2:=z[3]; K:=Ideal(NEG(F1),NEG(F2)); Now, we may find out which of the following atomic propositions, t[3], t[2], t[1], holds by means of the following commands: NF(t[3],MEMORY.I+J+K); NF(t[2],MEMORY.I+J+K); NF(t[1],MEMORY.I+J+K); CoCoa takes 47 ms for responding this:
That is to say, we have that t[1] holds, or equivalently, t is ‘low’. 5. Advantages of the proposed model Our model for getting a polynomial-based representation of knowledge in expert systems presents some advantages over the one based of propositional logic [13]. A more natural way to represent knowledge The algebraic model presented here for implementing expert systems is based on the ‘Concept-Attribute-Value’ paradigm for representing knowledge. In Artificial Intelligence, the ‘ConceptAttribute-Value’ paradigm is regarded in many cases as much more suitable for representing the knowledge of expert systems than propositional logics. Consequently, expert systems implemented according to our algebraic model would lead to a more natural way to represent the knowledge of human experts. A simpler way to generate algebraic models Our ‘Concept-Attribute-Value’ paradigm approach provides a simpler algebraic model to those based on propositional logics. Indeed, the algebraic model based on propositional logics requires much more variables than the model presented here. In this way, concerning the example in Section 4, while in our model only four variables are need (namely: x, y, z and t) each of which may in turn take the values ‘LOW’, ‘MEDIUM’ and ‘HIGH’, in the propositional logic based model this would require 12 separate variables, one for each different value of the given variables. That is to say, for each variable in our model a, the propositional logic model would need three different variables: a[1] representing ‘a is LOW’; a[2] representing ‘a is MEDIUM’; a[3] representing ‘a is HIGH’. A faster performance The expert systems based on the algebraic model presented here run faster than those based on the algebraic model derivable from the propositional logic, this being a natural consequence of the fact that the former are simpler than the latter. As may be seen in the example in Section 4 the expert system based on our model runs faster than the one based on propositional logic.
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
39
6. Demonstration of Theorem 13 In this section, we will prove the main theorem of this paper introduced in Section 3. As we saw in that section, we defined a bijection ϕ between the possible values V and {0, . . . , a − 1}. Next, we defined polynomials ri = v ∈ (xi ) (xi − φ(v)): these polynomials are used to define the quotient ring {A} = Zp [x1 , . . . , xm ]/I into which the formulae are translated. In order to achieve a full formal proof of all this, we will first show some propositions which will result to be very useful for proving Theorem 13. Proposition 15. Let(X, V, ) be a conceptual ground. Letq ∈ Zp [x1 , . . . , xm ] ∗ ∗ ∈ φ((xm ))q(x1∗ , . . . , xm ) = 0 then q ∈ I. If ∀x1∗ ∈ φ((x1 )), . . . , ∀xm
Proof. We will prove it by induction on the number of variables, m, appearing in X. • Base case. m = 1. ∗ Let q ∈ Zp [x1 ], such that ∀x1∗ ∈ φ((x1 ))q(x 1 ) = 0. ∗ ∗ We have also that, ∀x1 ∈ φ((x1 ))r1 (x1 ) = v ∈ (x1 ) (x1∗ − φ(v)) = 0. Therefore, ∃α ∈ Zp [x1 ] such that q = α · r1 . That is to say, q ∈ r1 . • Induction case: We will suppose that the proposition holds for m, and we will show that the proposition also holds for m + 1. ∗ ∈ φ((x ))q(x∗ , . . . , x∗ , x Let q ∈ Zp [x1 . . . xm , xm+1 ], such that ∀x1∗ ∈ φ((x1 )), . . . , ∀xm m m m+1 ) = 0. 1 Let u be the grade of rm+1 in the indeterminate xm+1 . Then, ∃α ∈ Zp [x1 , . . . , xm , xm+1 ] and ∃β0 , . . . , βu ∈ Zp [x1 , . . . , xm ], such that4 : q = α · rm+1 + βu · (xm+1 )u + . . . + β1 · xm+1 + β0 ∗ , then we get the polynomial: If we fix x1∗ , . . . , xm ∗ , xm+1 ) ∈ Zp [xm+1 ] q(x1∗ , . . . , xm ∗ ,x It follows from the base case that q(x1∗ , . . . , xm m+1 ) ∈ rm+1 . Therefore, using the above formula for q, we can state that: ∗ )=0 ∀i ∈ {0, . . . , u}βi (x1∗ , . . . , xm ∗ was arbitrarily chosen, it follows that: Since x1∗ , . . . , xm ∗ ∗ ∈ φ((xm ))βi (x1∗ , . . . , xm )=0 ∀i ∈ {0 . . . u}∀x1∗ ∈ φ((x1 )), . . . , ∀xm
By induction hypothesis, we have that ∀i ∈ {0, . . . , u}βi ∈ r1 , . . . , rm Therefore, q ∈ r1 , . . . , rm , rm+1 . Proposition 16. Let(X, V, ) be a conceptual ground. 4 This expression can be obtained by dividing q by r (considering them as polynomials with the indeterminate x ). In this way, we have the m quotient, α, and a remainder βu · (xm+1 )u + · · · + β1 · xm+1 + β0 .
40
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
Letq ∈ A. The following holds: ∗ ∗ If ∀x1∗ ∈ φ((x1 )), . . . , ∀xm ∈ φ((xm ))q(x1∗ , . . . , xm ) = 0, then q = 0.
Proof. Trivial by Proposition 15.
Proposition 17. Let(X, V, ) be a conceptual ground. Letf : φ((x1 )) × . . . × φ((xm )) → Zp . The following holds: ∗ ∗ ∗ ∃q ∈ A suchthat ∀x1∗ ∈ φ((x1 )), . . . , ∀xm ∈ φ((xm ))q(x1∗ , . . . , xm ) = f (x1∗ , . . . , xm ).
Proof. Let b1 ∈ φ((x1 )), . . . , bm ∈ φ((xm )), we define the following elements in A: ⎛ ⎞ m xi − v ⎠ ⎝ δb1 ,...,bm = bi − v i=1
Given
v ∈ (xi )−{bi }
∗ ) ∈ ψ(S), (x1∗ . . . xm
the polynomials δb1 ...bm fulfill the following: ∗ =b 1 if x1∗ = b1 , . . . , xm m ∗ δb1 ...bm (x1∗ , . . . , xm )= 0 otherwise
Then, we define the following polynomial in A: ∗ q= f (x1∗ , . . . , xm ) · δx1∗ ,...,xm∗ ∈ A ∗ ∈ (x ) x1∗ ∈ (x1 ),...,xm m
And the following holds: ∗ ∗ ∗ ∀x1∗ ∈ φ((x1 )), . . . , ∀xm ∈ φ((xm ))q(x1∗ , . . . , xm ) = f (x1∗ , . . . , xm ).
Proposition 18. Let(X, V, ) be a conceptual ground. Letq1 , q2 ∈ A. The following holds: ∗ ∗ ∗ If ∀x1∗ ∈ φ((x1 )), . . . , ∀xm ∈ φ((xm ))q1 (x1∗ , . . . , xm ) = q2 (x1∗ , . . . , xm ), then q1 = q2 . ∗ ∈ φ((x ))q (x∗ , . . . , x∗ ) − q (x∗ , . . . , x∗ ) = 0, then, by Proposition 16, Proof. Since ∀x1∗ ∈ φ((x1 )), . . . , ∀xm m 1 1 2 1 m m we have that q1 = q2
Theorem 19. Let(X, V, ) be a conceptual ground. LetA ∈ C(X,V,) and letS ∈ S(X,V,) . We have that: A holds in S ⇔ qA (φ(S(x1 )), . . . , φ(S(xm ))) = 0 Proof. We will prove it by the length, l, of the number of symbols ∨ and ¬ which contain the formula A. Base cases. l = 0 CaseA ≡ xi = v where xi ∈ X and v ∈ (xi ). A holds in S ⇔ S(xi ) = v ⇔ φ(S(xi )) = φ(v) ⇔ φ(S(xi )) − φ(v) = 0 ⇔ qA (φ(S(x1 )), . . . , φ(S(xm ))) = 0. CaseA ≡ xi = xj where xi , xj ∈ X. holds in S ⇔ S(xi ) = S(xj ) ⇔ φ(S(xi )) = φ(S(xj )) ⇔ φ(S(xi )) − φ(S(xj )) = 0 ⇔ A qA (φ(S(x1 )), . . . , φ(S(xm ))) = 0. Induction case. We will suppose that the theorem holds for formulae containing l symbols ∨ and ¬, and we will prove it for l + 1 symbols.
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
41
CaseA ≡ ¬B where B is a formula. A holds in S ⇔ B does not hold in S. By induction hypothesis, we have that: / 0. B does not hold in S ⇔ qB (φ(S(x1 )), . . . , φ(S(xm ))) = Since qA (φ(S(x1 )), . . . , φ(S(xm ))) = (qB (φ(S(x1 )), . . . , φ(S(xm )))p−1 − 1), we have that: / 0. qA (φ(S(x1 )), . . . , φ(S(xm ))) = 0 ⇔ qB (φ(S(x1 )), . . . , φ(S(xm ))) = Consequently, we have that: A holds in S ⇔ qA (φ(S(x1 )), . . . , φ(S(xm ))) = 0 CaseA ≡ B ∨ C where B and C are formulae. We have that qA ≡ qB · qC . A holds in S ⇔ B holds in S or C holds in S. By induction hypothesis: B holds in S or C holds in S ⇔ qB (φ(S(x1 )), . . . , φ(S(xm ))) = 0 or qC (φ(S(x1 )), . . . , φ(S(xm ))) = 0 ⇔ qB (φ(S(x1 )), . . . , φ(S(xm ))) · qC (φ(S(x1 )), . . . , φ(S(xm ))) = 0 ⇔ qA (φ(S(x1 )), . . . , φ(S(xm ))) = 0 Consequently: A holds in S ⇔ qA (φ(S(x1 )), . . . , φ(S(xm ))) = 0
Proof of Theorem 13. ⇒) By Proposition 17, for each i ∈ {1, . . . , n}, we define an element gi ∈ A such that ∗ ∈ φ((x )), the following holds: ∀x1∗ ∈ φ((x1 )), . . . , ∀xm m ⎧ ∗ ∗ ∗ ∗ ⎨ qB (x1 , . . . , xm ) if q (x∗ , . . . , x∗ ) = Ai 1 m / 0 and ∀j < iqAj (x1 , . . . , xm ) = 0 ∗ ∗) gi (x1∗ , . . . , xm ) = qAi (x1∗ , . . . , xm ⎩ 0 otherwise Now, we define the polynomial g ∈ qA1 , . . . , qAn g = g1 · qA1 + . . . + gn · gAn Now, we will check that: ∗ ∗ ∗ ∈ φ((xm ))qB (x1∗ , . . . , xm ) = g(x1∗ , . . . , xm ) ∀x1∗ ∈ φ((x1 )), . . . , ∀xm ∗ ∈ φ((x )). Let x1∗ ∈ φ((x1 )), . . . , xm m ∗ Let S ∈ S(X,V,) such that ∀i ∈ {1 . . . m}S ∗ (xi ) = φ−1 (xi∗ ).
First case. ∀i ∈ {1, . . . , n}Ai holds in S ∗ . ∗ ) = 0. By Theorem 19, ∀i ∈ {1, . . . , n}qAi (x1∗ , . . . , xm ∗ ) = 0. By definition of gi , we have that ∀i ∈ {1, . . . , n} gi (x1∗ , . . . , xm ∗ ∗ Consequently, g(x1 , . . . , xm ) = 0. Since B is derivable from KB, we have that B holds in S ∗ . ∗ ) = 0. By Theorem 19, we have that qB (x1∗ , . . . , xm
42
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
∗ ) = 0 = q (x∗ , . . . , x∗ ) Therefore, g(x1∗ , . . . , xm B 1 m Second case ∃i ∈ {1, . . . , n}Ai does not hold in S ∗ . Let i ∈ {1, . . . , n} such that Ai does not hold in S ∗ and ∀j < iAj holds in S ∗ . ∗)= ∗ ) = 0. By Theorem 19, we have that qAi (x1∗ , . . . , xm / 0 and ∀j < iqAj (x1∗ , . . . , xm Consequently: ∗) qB (x1∗ , . . . , xm ∗ ∗) qAi (x1 ,..,xm ∗ ∗ ∀j = / i, gj (x1 , . . . , xm ) = 0 ∗)= gi (x1∗ , . . . , xm
Therefore, ∗ ∗ g(x1∗ , . . . , xm ) = qB (x1∗ , . . . , xm )
Therefore, ∗ ∗ ∗ ∀x1∗ ∈ φ((x1 )), . . . , ∀xm ∈ φ((xm ))qB (x1∗ , . . . , xm ) − g(x1∗ , . . . , xm ) = 0.
Consequently, by Proposition 16, we have that qB − g = 0. That is to say, qB = g ∈ qA1 , . . . , qAn . ⇐) We will suppose that qB ∈ qA1 , . . . , qAn . Therefore, ∃α1 , . . . , αn ∈ A such that qB = α1 · qA1 + . . . + αn · qAn Let S ∗ ∈ S(X,V,) be a possible state of KB. ∗ = φ(S ∗ (x )). Let x1∗ = φ(S ∗ (x1 )), . . . , xm m ∗ Since S is a possible state of KB, by Theorem 19, we have that: ∗ ∀i ∈ {1, . . . , n}qAi (x1∗ , . . . , xm )=0 ∗ ) = 0. Consequently, by the expression above, qB (x1∗ , . . . , xm ∗ By Theorem 19, B holds in S . Therefore,
B is derivable from KB. 7. Conclusions In this paper, we have described a new representation paradigm for modeling expert systems based on computing Groebner Bases. While the previous algebraic models are based on multi-valued propositional logics, ours is based on the well-known Artificial Intelligence ‘Concept-Attribute-Value’ paradigm for representing knowledge and we have shown that it may have some interesting advantages over the formers. Like in the models based on propositional logic, we have studied how to transform the problem related to consistence and inference within this expert system. Acknowledgment This work was partially supported by the research projects TIN2009-07901 (Ministerio de Educación y Ciencia, Spain) and UCM2008-910563 (UCM - BSCH Gr. 58/08, Spain/Research Group ACEIA). References [1] J.A. Alonso, E. Briales, Lógicas Polivalentes y Bases de Gröbner, in: C. Martin (Ed.), Actas del V Congreso de Lenguajes Naturales y Lenguajes Formales, University of Seville, Seville, 1995, pp. 307–315.
A. Hernando / Mathematics and Computers in Simulation 82 (2011) 29–43
43
[2] B. Buchberger, Bruno Buchberger’s PhD thesis 1965: an algorithm for finding the basis elementals of the residue class ring of a zero dimensional polynomial ideal, Journal of Symbolic Computation 41 (3–4) (2006) 475–511. [3] B. Buchberger, Applications of Gröbner bases in non-linear computational geometry, in: J.R. Rice (Ed.), in: Mathematical Aspects of Scientific Software, IMA: vol. 14, Springer-Verlag, New York, 1988, pp. 60–88. [4] A. Capaini, G. Niesi, CoCoA User’s Manual, Dept. Mathematics, Univ. of Genova, 1996. [5] J. Chazarain, A. Riscos, J.A. Alonso, E. Briales, Multivalued logic and Gröbner bases with applications to modal logic, Journal of Symbolic Computation 11 (1991) 181–194. [6] J. Hsiang, Refutational theorem proving using term-rewriting systems, Artificial Intelligence 25 (1985) 255–300. [7] D. Kapur, P. Narendran, An equational approach to theorem proving in first-order predicate calculus, in: Proceedings of the 9th International Joint Conference on Artificial Intelligence (IJCAI-85), vol. 2, 1985, pp. 1146–1153. [8] L.M. Laita, E. Roanes-Lozano, V. Maojo, L. de Ledesma, L. Laita, An expert system for managing medical appropriateness criteria based on computer algebra techniques, Computers and Mathematics with Applications 51 (5) (2000) 473–481. [9] M. Lourdes Jimenez, J.M. Santamaría, R. Barchino, L. Laita, L.M. Laita, L.A. González, A. Asenjo, Knowledge representation for diagnosis of care problems through an expert system: model of the auto-care deficit situations, Expert System with Applications 34 (2008) 2847–2857. [10] M. Minsky, A framework for representing knowledge, MIT-AI Laboratory Memo 306 (1974). [11] C. Pérez-Carretero, L.M. Laita, E. Roanes-Lozano, L. Lázaro, J. González-Cajal, L. Laita, A logic and computer algebra-based expert system for diagnosis of anorexia, Mathematics and Computers in Simulation 58 (2002) 183–202. [12] D. Perkinson, CoCoA 4.0 online help (electronic file acompanying CoCoA v.4.0), 2000. [13] E. Roanes-Lozano, L.M. Laita, E. Roanes-Macías, A polynomial model for multivalued logics with a touch of algebraic geometry and computer algebra, Mathematics and Computers in Simulation 45 (1) (1998) 83–99. [14] E. Roanes-Lozano, L.M. Laita, E. Roanes-Macías, A Groebner bases based many-valued modal logic implementation in Maple, in: S. Autexier, et al. (Eds.), Determination of Geometric Loci. 3D-Extension of Simson-Steiner. AISC/Calculemus/MKM 2008. Lecture Notes in Artificial Intelligence, Springer, Berlin, 2008, pp. 170–183. [15] C. Rodríguez-Solano, L.M. Laita, E. Roanes Lozano, L. López Corral, L. Laita, A computational system for diagnosis of depressive situations, Expert System with Applications 31 (2006) 47–55.