Fuzzy Systems of Logical Inference and Their Applications Oleksandr Provotar University of Rzeszow, Rzeszow, 35-310, Poland aprowata1@bigmir.net, Abstract. The approaches to the solution of various problems of artificial intelli- gence methods are proposed. In particular, the problem of knowledge representa- tion by means of fuzzy specifications in expert systems, the problem of recogniz- ing the structures of the proteins of different organization levels and the problem of building linguistic models in fuzzy Boolean variables logic are considered. All methods are based on the ideas of inductive mathematics. To investigate a relia- bility of these methods is possible only with the help of the theory of probability or possibility theory. Key words: fuzzy sets, problem of recognizing, fuzzy Boolean variable 1 Introduction It is known that the fuzzy sets [2], [5], [6], [7], [8] are the convenient tool to present knowledge in information systems. Using the fuzzy sets it is possible to outline, for instance, the picture of symptoms of the patient in expert diagnostics systems. Deter- mination of the diagnosis in such systems requires using the mechanisms of logical inference. In particular, in case of the fuzzy specifications as symptoms as well diag- nostics such mechanisms can be so called the fuzzy systems of logical inference which are built on the basis of ideas and methods of inductive mathematics [1]. The fuzzy specification of problem means ordered set of fuzzy instructions (fuzzy rules, linguistic rulles). The fuzzy specification of the problem with the algorithm dur- ing fulfilling which the approximate (fuzzy) solution of the problem is received will be called as fuzzy system of logical inference. Let x1 , . . . , xn are input linguistic variables and y – output linguistic variable [6]. The ordered set of fuzzy instructions looks like as following if x1 is A11 ∧ · · · ∧ xn ∈ A1n then y is B1 , if x1 is A21 ∧ · · · ∧ xn ∈ A2n then y is B2 , .......................................... if x1 is Am1 ∧ · · · ∧ xn ∈ Amn then y is Bm , where Aij and Bi – fuzzy sets, symbol “∧” is interpreted as t-norm of fuzzy sets. The algorithm of calculating the output of such specification under the inputs ′ ′ A1 , . . . , An consists in performing such steps: 112 1. Calculate the truth level of the rules: h  ′   ′ i αi = min max A1 (x1 ) ∧ Ai1 (x1 ) , . . . , max An (xn ) ∧ Ain (xn ) ; 2. Calculate outputs of each rule: ′ Bi (y) = min(αi , Bi (y)); 3. Calculate aggregated output:  ′ ′  B(y) = max B1 (y), . . . , Bm (y) . 2 Expert Diagnostics Systems Let X1 = {5, 10, 15, 20}, X2 = {5, 10, 15, 20}, X3 = {35, 36, 37, 38, 39, 40} – spaces for determining the values of linguistic variables: x1 = “Coughing“ = {“weak“, “moderate“, “strong“}, x2 = “Runningnose“ = {“weak“, “moderate“, “strong“}, x3 = “T emperature“ = {“normal“, “raised“, “high“, “veryhigh“}, accordingly. Determine the elements of these sets: “Coughing“ : “weak“ = 1/5 + 0.5/10; “moderate“ = 0.5/5 + 0.7/10 + 1/15; “strong“ = 0.5/10 + 0.7/15 + 1/20. “Runningnose“ : “weak“ = 1/5 + 0.5/10; “moderate“ = 0.5/10 + 1/15; “strong“ = 0.7/15 + 1/20. “T emperature“ : “normal“ = 0.5/35 + 0.8/36 + 0.9/37 + 0.5/38; “raised“ = 0.5/37 + 1/38; “high“ = 0.5/38 + 1/39; “veryhigh“ = 0.8/39 + 1/40. Let Y = {inf luenza, sharp respiratory disease, angina, pneumonia} – space for determining the value of linguistic variable y. Then the dependence of the patient’s disease on his symptoms can be described by the following systems of speci- 113 fications: if x1 is “weak“ ∧ x2 is “weak“ ∧ x3 is “raised“ then y is “0.5/inf luenza + 0.5/sharp respiratory disease + 0.4/angina+ +0.8/pneumonia“; if x1 is “weak“ ∧ x2 is “moderate“ ∧ x3 is “high“ then y is “0.8/inf luenza + 0.7/sharp respiratory disease + 0.8/angina+ +0.3/pneumonia“; if x1 is “weak“ ∧ x2 is “moderate“ ∧ x3 is “very high“ then y is “0.9/inf luenza + 0.7/sharp respiratory disease + 0.8/angina+ +0.2/pneumonia“; ′ If to the input x1 of this algorithm to supply value A1 = 1/5 + 0.7/10, to the input ′ ′ x2 – value A2 = 1/5 + 0.5/10, to the input x3 – value A3 = 1/36 + 0.9/37, then in accordance with procedure of fulfilling the algorithm of the fuzzy system of logical inference the fuzzy solution of the problem will be received B = 0.5/inf luenza + 0.5/sharp respiratory disease+ +0.4/angina + 0.5/pneumonia. The problem of searching the symptoms using fuzzy diagnosis can be inverse to this problem. Specifically, let output of the fuzzy system of logical inference with inputs ′ ′ ′ A1 = x1 /5 + x2 /10 + x3 /15 + x4 /20, A2 = 1/5 + 0.5/10, A3 = 1/36 + 0.9/37 is fuzzy set B = 0.5/inf luenza + 0.5/sharp respiratory disease + 0.4/angina + 0.5/pneumonia. Aggregation of the individual outputs leads to the next system of fuzzy relation equations: min [max(x1 ∧ 1, x2 ∧ 0.5), 0.4] = 0.4, min [max(x1 ∧ 1, x2 ∧ 0.5), 0.5] = 0.5. Solving it the value of the symptom “Coughing“ will be received, which is described by the fuzzy set “Coughing“ = 0.5/5 + 1/10. To determine the probability of event A in the space of elementary events X, the notion of probable measure is introduces. It is numerical function P , which puts number P (A) to the elementary event A, besides that ∞ ! ∞ [ X 0 ≤ P (A) ≤ 1, P (X) = 1, P Ai = P (Ai ) i=1 i=1 for any A1 , A2 , . . . such, as Ai ∩ Aj = ∅, with i 6= j. The fuzzy event A in space X will be called the fuzzy set A = {(x, µA (x)), x ∈ X} , 114 where µA : X → [0, 1] – membership function of fuzzy set A. Then probability of event A can be calculated using the formula X P (A) = µA (x)P (x). x∈A Considering this, it is possible to calculate the probabilities of any fuzzy event with provided probability measure. In particular, the probability of symptom “Coughing“ at probabilities distribution P (5) = 0.4, P (10) = 0.4, P (15) = 0.1, P (20) = 0.1 can be calculated in the following way: P (“Coughing“) = 0.5 · 0.4 + 1 · 0.4. 3 Bioinformatics It is known [1], [4] that the problem of recognizing the structures of the proteins of different organization levels is rather complicated. To solve it the different methods and approaches, including experimental (based on physics of chemical relations creation), machine teaching (used the data bases of experimentally found secondary structures as learning samples), probabilistic (on the basis of the Bayes procedures and Markov chains) are used. The method of recognition of the secondary structure of DNA using fuzzy systems of logical inference is proposed. The problem is the following: it is necessary to build the fuzzy system of logical inference which using random amino acid sequence would define (as an fuzzy set) the secondary structure of central remainder (of the amino acid) of the input sequence. To solve this problem at first it is necessary to design the fuzzy specification of the problem according to learning samples. One of the methods to build the system of fuzzy instructions according to numerical data consists of the following. Let’s the rules base with n inputs and one output is created. There are learning dates (samples) as the sets of pairs for that (x1 (i), x2 (i), . . . , xn (i); d(i)), i = 1, 2, . . . , m, where xj (i) – inputs and d(i) – output, at that xj (i) ∈ {a1 , a2 , . . . , ak }, d(i) ∈ {b1 , b2 , . . . , bl }. It is necessary to build the fuzzy system of logical inference which would generate the correct output data according to random input values. The algo- rithm of solving of the provided problem consists in the following sequence of steps: 1. Dividing the space of inputs and outputs for areas (dividing learning data for groups on m1 , . . . , mk lines, which means, each input and output is divided for 2N + 1 cuts where N for each input is selected individually. Separate areas (segments) will be called in the following way: MN (lef t N ), . . . , M1 (lef t 1), S(medium), D1 (right 1), . . . , DN (right N ). Determination membership function for each areas. 115 2. Building fuzzy sets on the basis of learning samples (Each group mi learning data (x1 (1), x2 (1), . . . , xn (1); d(1)) (x1 (2), x2 (2), . . . , xn (2); d(2)) (x1 (mi ), x2 (mi ), . . . , xn (mi ); d(mi )) is compared with the fuzzy sets of the form: (1) (1) a1 ak (m ) A1 i = /a1 + · · · + /ak , mi mi .................................... (n) (n) a1 ak An(mi ) = /a1 + · · · + /ak , mi mi |b1 | |bl | B (mi ) = /b1 + · · · + /bl , mi mi (j) where a1 – number of symbols a1 in column j of the learning data group, |bj | – number of symbols bj in the last column of the learning data group. 3. Building fuzzy rules on the basis of fuzzy sets from the previous step on the fol- lowing scheme: (x1 (1), x2 (1), . . . , xn (1); d(1)) (x1 (2), x2 (2), . . . , xn (2); d(2)) ........................... ⇒ (x1 (m1 ), x2 (m1 ), . . . , xn (m1 ); d(m1 )) (m ) (m ) ⇒ R(1) : if x1 is A1 i and x2 is A2 i and . . . and xn is An(mi ) then y is B (mi ) 4. Elimination of contradictions. This algorithm puts in accordance to each set of learning data the fuzzy rule of the logical inference. It will be shown how to use the suggested algorithm of building the fuzzy sets for recognizing the secondary structure of DNA. It is known [1], [4], that the secondary structure of the pieces of polypeptide se- quence is determined mainly the by the interactions of neighbor amino acids within these pieces. To be more exact, the type of secondary structure of the exact remain is determined by its surrounding. 116 To build the fuzzy rules of logical inference the learning samples from 15 remains of the protein MutS [2] are used which look like the following: KV S EGGL I RE GY DP D e −−− h h h h h h h h h h h V S EGGL I R E GY DP D L −−− h h h h h h h h h h h h S EGGL I REGY DP D LD −− h h h h h h h h h h h h h E GGL I REGYDP D LDA − h h h h h h h h h h h h h h GGL I REGY DP D LDA L h h h h h h h h h h h h h h h The prediction belongs to the central remain, besides the following denotations are used: h – for spiral, e – for cylinder, “–” – other. According to the algorithm, the teaching data is divided, for example, for 3 groups: KV S EGGL I RE GY DP D V S E G G L I R E G Y D P D L; S EGGL I REGY DP D L D E G G L I R E G Y D P D L D A; G G L I R E G Y D P D L D A L; and compared to each group with according fuzzy sets (m1 ) (m2 ) (m3 ) Ai , Ai , Ai , B (m1 ) , B (m2 ) , B (m3 ) . Then fuzzy specification of the recognition problem will look like: (m ) (m ) (m ) R(1) : if x1 isA1 1 and x2 is A2 1 and . . . and x14 is A14 1 then y is B (m1 ) , (m ) (m ) (m ) R(2) : if x1 isA1 2 and x2 is A2 2 and . . . and x14 is A14 2 then y is B (m2 ) , (m ) (m ) (m ) R(3) : if x1 isA1 3 and x2 is A2 3 and . . . and x14 is A14 3 then y is B (m3 ) , Using the algorithm of solving the specification, we will find the output received system of fuzzy instructions, if to the input the following amino acid sequence is sup- plied: L K V S E G G L I R E G Y D P. In accordance with the procedure of executing the algorithm we will get that the sec- ondary structure of the remainder L is h. 4 Fuzzy Boolean Variables The algebra of statement is one of the chapters of classic mathematical logic. The state- ment means the variable which can be of two possible values – 0 or 1. Such variable is 117 called Boolean. In some cases generalizing the notion of Boolean variable to the notion of fuzzy Boolean variable is useful [3]. The fuzzy Boolean variable is called a variable p, which takes a value from the interval [0, 1]. Let p and q – fuzzy Boolean variables. Logical operations with such variables are determined like that: p̄ = 1 − p, p ∧ q = min(p, q), p ∨ q = max(p, q). From determination of the operations we get, that the following laws p ∨ p̄ = 1, p ∧ p̄ = 0 are broken. Let p1 , p2 , . . . , pn – fuzzy Boolean variables. Function f (p1 , . . . , pn ) is called a function of fuzzy Boolean variables if it takes value on the interval [0, 1]. Function f of fuzzy Boolean variables is called analytical, if it can be presented by the formula, which includes operations ¬, ∧, ∨. Since in the fuzzy logic above-mentioned laws are violated, function p → q = p̄ · q̄ ∨ p̄ · q ∨ p · q cannot be simplified. One of the tasks Boolean variables function analysis consists in the following. It is necessary to find out under the which conditions the values of analytical function, for example f (p, q) = p ∧ q, includes in a given interval [α, β) of the segment [0, 1] under the condition, that p ∈ [a1 , a2 ] ⊆ [0, 1] and q ∈ [b1 , b2 ] ⊆ [0, 1]. Solution to this problem gives the possibility to calculate probabilities of varying weather in the following way. It is know, that weather forecasters evaluate their forecasts using probability theory point out their forecasts with expressions: “sunny“ with probability p ∈ [0.7, 0.8); “windy“ with probability q ∈ [0.3, 0.5); “cloudy“ with probability h ∈ [0.8, 0.9). Let us consider Boolean analytical function f (p, q) = p → q = p̄ · q̄ ∨ p̄ · q ∨ p · q. Let us suppose, that p ∈ [0.7, 0.8), q ∈ [0.3, 0.5). It is necessary to find out in which intervals of the segment [0, 1] values of the function includes. In other words, it is nec- essary to find which interval contains the probability that the weather will be “sunny“ and “windy“, or “not sunny“ and “windy“, or “not sunny“ and “not windy“. Considering,that p → q = p̄ · q̄ ∨ p̄ · q ∨ p · q and that p ∈ [0.7, 0.8], q ∈ [0.3, 0.5] 118 we find that p̄ ∈ [0.2, 0.3], q̄ ∈ [0.5, 0.7]. So p̄ · q̄ = min(p̄, q̄) ∈ [0.2, 0.3], p̄ · q = min(p̄, q) ∈ [0.2, 0.3], p · q = min(p, q) ∈ [0.3, 0.5]. Then p̄ · q̄ ∨ p̄ · q ∈ [0.2, 0.3], p̄ · q ∨ p̄ · q̄ ∨ p · q ∈ [0.3, 0.5]. That is why value of the function f (p, q) will includes to the interval [0.3, 0.5]. Let us consider another option of the problem. Let us suppose, that as earlier, p ∈ [0.7, 0.8), q ∈ [0.3, 0.5) analytical Boolean function is unknown, but is known the interval of the segment [0, 1], in which the values of this function are includes. In this case – this is the interval [0.3, 0.5]. It is necessary to find out in which inter- val of the segment [0, 1] the values of this unknown function included, if for example p ∈ [0.5, 0.6], q ∈ [0.3, 0.5]. One of the approaches to solve this problem consists in building and researching it is so called linguistic model [2], [8]. In this model the variables p, q, f will be considered as linguistic variables, and appropriate intervals will be described by the fuzzy sets of the space [0, 1]. So, our fuzzy model will look like the following: R : if p ∈ A1 ∧ q ∈ A2 then f ∈ B where A1 = 1/[0.7, 0.8], A2 = 1/[0.3, 0.5], B = 1/[0.3, 0.5]. It is necessary to find ′ ′ ′ the output B of this fuzzy rule with inputs A1 = 1/[0.6, 0.8], A2 = 1/[0.3, 0.5]. After calculating according to the procedure we will have: ′ B (y) = 1/[0.3, 0.5]. One more position of the task consists in the following. Let p ∈ [0.5, 0.6]. Let us calculate the probability of windy under the condition that p → q ∈ [0.3, 0.5]. Let us suppose, that q ∈ [b1 , b2 ] ⊆ [0, 1]. Then p ∧ q ∈ [min(0.5, b1 ), min(0.6, b2 )], p̄ ∧ q ∈ [min(0.4, b1 ), min(0.5, b2 )], p̄ ∧ q̄ ∈ [min(0.4, 1 − b2 ), min(0.5, 1 − b1 )], p · q ∨ p̄ · q ∈ [max(min(0.5, b1 ), min(0.4, b1 )), max(min(0.6, b2 ), min(0.5, b2 ))], p ∧ q ∨ p̄ · q̄ ∨ p̄ · q̄ ∈ [max(min(0.5, b1 ), min(0.5, b1 ), min(0.5, 1 − b1 )), max(min(0.6, b2 ), min(0.4, b2 ), min(0.4, 1 − b2 ))]. 119 Here we get: max(min(0.5, b1 ), min(0.5, 1 − b1 )) > 0.3, max(min(0.6, b2 ), min(0.4, b2 ), min(0.4, 1 − b2 )) ≤ 0.5. From first correlation we find b1 : 0.5 ≤ b1 ⇒ b1 − arbitrary b1 ≤ 0.5 ⇒ From second correlation we find b2 : 0.4 ≤ 0.6 ≤ b2 ⇒ 0.4 ≤ b2 ≤ 0.6 ⇒ 0 ≤ b2 ≤ 0.5 b2 ≤ 0.4 ≤ 0.6 So, the probability of windy weather q ∈ [0, 0.5]. 5 Conclusions The proposed approach to solving problems (based on fuzzy models) allows to simplify the methods of solving problems. Other approaches may be based on possibility theory. But there is a necessity for additional studies of the reliability issues in the first and in the second case. References 1. Gupal, A.M., Sergienko, I.V.: Optimal Recognition Procedures (in Russian). Naukova Dumka, Kyiv (2008) 2. Katerynych, L., Provotar, A.: Neural Networks Diagnostics in Homeopath System. Interna- tional Journal “Information Theories & Applications”. 15, 89–93 (2008) 3. Konysheva, L.K., Nazarov, D.M.: Foundations of Fuzzy Sets Theory (in Russian). SPB Piter, Moscow (2011) 4. Lesk, A.: Introduction to Bioinformatics (in Russian). Labaratoria Znaniy, Moscow (2009) 5. Leski, J.: Systemy Neuronowo-Rozmyte (in Polish). Naukowo-Techniczne, Warszawa (2008) 6. Provotar, A.I., Lapko, A.V., Provotar, A.A.: Fuzzy Inference Systems and Their Applications. International Scientific Journal “Cybernetics and Systems Analysis”. 49, 517–525 (2013) 7. Rutkowska, D., Piliński, M., Rutkowski, L.: Sieci Neuronowe, Algorytmy Genetyczne i Sys- temy Rozmyte (in Polish). Wydawnictwo Naukove PWN, Warszava (1999) 8. Zadeh, L.A.: Fuzzy Sets as a Basis for a Theory of Possibility. Fuzzy Sets and Systems. 1, 3–28 (1978)