Fuzzy Logic Theory and applications

difference between fuzzy logic and probability theory and fuzzy logic - controls concepts theories and applications and fuzzy logic and its relationship with probability theory
Dr.NaveenBansal Profile Pic
Dr.NaveenBansal,India,Teacher
Published Date:25-10-2017
Your Website URL(Optional)
Comment
CHAPTER 2 Fuzzy Logic Theory Fuzzy logic is a logic. Logic refers to the study of methods and principles of human reasoning. Classical logic, as common practice, deals with propositions (e.g., conclusions or decisions) that are either true or false. Each proposition has an opposite. This classical logic, therefore, deals with combinations of variables that represent propositions. As each variable stands for a hypothetical proposition, any combination of them eventually assumes a truth value (either true or false), but never is in between or both (i.e., is not true and false at the same time). The main content of classical logic is the study of rules that allow new logical variables to be produced as functions of certain existing variables. Suppose that n logical variables, x , ..., x , are given, say 1 n x is true; 1 x is false; 2 M x is false. n Then a new logical variable, y, can be defined by a rule as a function of x , ..., 1 x that has a particular truth value (again, either true or false). One example of n a rule is the following: Rule:IF x is true AND x is false AND ... AND x is false 1 2 n THEN y is false. Because one, and only one truth value (either true or false) is assumed by a logical function of a (finite) number of logical variables (hypothetical propositions), the classical logic is also called a two-valued logic. The fundamental assumption upon which the classical logic is based is that every proposition is either true or false. This principle has been questioned by many philosophers, ever since Aristotle (in his treatise On Interpretation). It is now well understood and well accepted that many propositions are both partially true and partially false. To describe such partial truth values by some new rules, in a way to extend and generalize the two-valued logic, multi- valued logics were proposed and developed. As the first attempt, several three-valued logics have now been well established, with their own rationale. It is common in these logics to introduce a “neither” in between “true” and “false.” It has turned out that three-valued logics are successful both logically and mathematically. Motivated by the useful three-valued logics, n-valued logics were developed in the 1930s. In particular, the n-valued logic of Lukasiewicz even allows n = ∞. It has lately been understood that there exists an isomorphism between the two-valued logic and the crisp set theory, and, similarly, there is an58 Fuzzy Logic Theory •• 2 isomorphism between the Lukasiewicz logic and the fuzzy set theory. In fact, the isomorphism for the former is the standard characteristic function ⎧ 1 if x∈A, y = X (x) = A ⎨ 0 if x∉A, ⎩ which can be interpreted as ⎧ true if x is true, y = ⎨ false if x is false; ⎩ and the latter is a fuzzy membership function, which has been thoroughly studied in Chapter 1. In this chapter, we study in somewhat detail the classical two-valued logic and its operations (the Boolean algebra), a three-valued logic, an n-valued logic (the Zadeh-Lukasiewicz logic with n = ∞), and the fuzzy logic. Since the ultimate goal of developing the fuzzy logic is to provide foundations for approximate reasoning, approximate reasoning using fuzzy logic will also be discussed briefly in this chapter. Finally, two important topics, fuzzy relation and fuzzy logic rule base, are studied. In particular, fuzzy logic rule base is the core for fuzzy systems and fuzzy control – the main subjects to be studied in detail in the rest of the book. I. CLASSICAL LOGIC THEORY A. Fundamental Concepts To introduce the basic concepts in the classical logic theory, we consider a typical example of a process (a system, or a plant) that is operated by a console consisting of a lock (with a key) and an ON-OFF switch as shown in Figure 2.1. For this console, we use L to denote the situation of the lock: 1 if the console is unlocked, ⎧ L = ⎨ 0 if the console is locked. ⎩ switch lock key ON OFF Figure 2.1 A console lock with a switch.2•• Fuzzy Logic Theory 59 Table 2.1 Truth Table for the Console-Controlled Process Inputs Outputs LS P P 0 0 0 0 0 0 1 1 1 0 0 0 1 0 1 0 0 1 0 0 0 1 1 1 1 1 0 1 1 1 1 1 The two digits, 0 and 1, are used here to represent the two states of the logical variables. L, S, and P are logical functions, which only assume one of these two values, 0 or 1. After the logical variables and functions are defined, it is common practice to establish a truth table for their relationships and possible outcomes of the relations. This truth table displays all rules of the two-valued logic for the particular problem in consideration. For this console example, we have the truth table shown as in Table 2.1, which is sometimes called a look-up table. On the other hand, we use S to denote the state of the switch: ⎧ 1 if the switch is ON, S = ⎨ 0 if the switch is OFF. ⎩ Moreover, we use P to denote the status of the process: ⎧ 1 if the process is running, P = ⎨ 0 if the process is shutdown. ⎩ In Table 2.1, it is important to point out that the process P is an input (the current status) as well as an output (the resulting status), where its current status may affect its future status. For example, if L = 0 (the key is not in the lock, or the console is locked), then the process will remain its current status, regardless of the state of the ON-OFF switch. A truth table is interpreted row by row. For instance, the fourth row of Table 2.1 is interpreted as follows: IF the key is in the lock (the console is unlocked) AND the switch is turned to OFF AND the process is currently running THEN the process will be shutdown. This is a rule. In general, a rule may have any number of inputs and outputs like ... IF (input 1) AND (input 2) AND AND (input n) ... THEN (output 1) AND (output 2) AND AND (output m).60 Fuzzy Logic Theory •• 2 ON OFF Figure 2.2 A push-button switch. From this simple example, one can see that a classical logic string consists of several two-valued inputs, several rules, and several two-valued outputs. It will be seen later that fuzzy logic has the same structure except that both the inputs and outputs are n-valued, with n≥ 2 (probably, n = ∞). As a second example, let us consider the push-button switch shown in Figure 2.2. For this push-button switch, we use L to denote the situation of the ON button: ⎧ 1 if the ON button is depressed, L = ⎨ 0 if the ON button is released. ⎩ On the other hand, we use S to denote the state of the OFF button: 1 if the OFF button is depressed, ⎧ S = ⎨ 0 if the OFF button is released. ⎩ Finally, we use P to denote the status of the process under control: ⎧ 1 if the current process is running, P = ⎨ 0 if the current process is shutdown. ⎩ Then, one can easily establish the truth table for this push-button control process, as shown in Table 2.2. It is important and interesting to compare Tables 2.1 and 2.2. The most significant difference can be seen from the last rows of the two tables, in Table 2.2 Truth Table for the Console-Controlled Process Inputs Outputs LS P P 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 02•• Fuzzy Logic Theory 61 Table 2.3 Logic Functions of Two Variables x 1 0 1 0 1 Name of Function Symbol x 1 1 0 0 2 y 0 0 0 0 zero function 0 1 y 0 0 0 1 nor (not-or) function 2 x ∨ x 1 2 y 0 0 1 0 proper inequality x ← x 3 1 2 y 0 0 1 1 negation x 4 2 y 0 1 0 0 proper inequality x → x 5 1 2 y 0 1 0 1 negation x 6 1 y 0 1 1 0 nonequivalence x x 7 1 2 y 0 1 1 1 nand (not-and) function x ∧ x 8 1 2 y 1 0 0 0 and function x ∧ x 9 1 2 y 1 0 0 1 equivalence x ⇔ x 10 1 2 y 1 0 1 0 identity x 11 1 y 1 0 1 1 implication x ⇐ x 12 1 2 y 1 1 0 0 identity x 13 2 y 1 1 0 1 implication x ⇒ x 14 1 2 y 1 1 1 0 or function x ∨ x 15 1 2 y 1 1 1 1 unity 1 16 which the three inputs (1,1,1) produce an output 1 in Table 2.1 but an output 0 in Table 2.2. The reason is that S = 1 means “ON” in Table 2.1 but it means “OFF” in Table 2.2, due to the nature of the two different switches. B. Logical Functions of the Two-Valued Logic Suppose that we are given n logical variables, x , ..., x . These n variables 1 n n can have 2 different combinations of truth values. Hence, there are a total of n 2 2 possible logical functions defining these variables. For example, for n = 2, 2 there are 2 = 4 combinations of logical variables: (1,1), (1,0), (0,1), and (0,0). 2 2 The 2 = 16 logical functions are listed in Table 2.3, where the resulting logical variables are denoted by y , ..., y . Logical functions of one or two 1 16 variables are usually called logical operations. It can be seen from Table 2.3 that the number of logic functions of n variables grows extremely rapidly with increasing values of n. However, it is known that the logical functions listed in Table 2.3, and those created from62 Fuzzy Logic Theory •• 2 them, can be obtained from a set of few primary logical functions. Two sets of primary logical functions are: (i) negation, and function, and or function; (ii) negation and the two implications. Using either set of primary logical functions, we can form any other logical functions via appropriate algebraic expressions, called logical formulas. For example, using the first set of primary logical functions, namely, negation −, and function ∧, and or function ∨, logical formulas can be defined recursively as follows: (a) The truth values 0 and 1 are logical formulas. (b) If x is a logical variable, then both x and x are logical formulas. (c) If x and x are logical formulas, then both x ∧ x and x ∨ x are 1 2 1 2 1 2 logical formulas. (d) The only logical formulas are those defined by (a), (b), and (c). Then, every logical formula of this type defines a logical function by composing it from the three primary logical functions −,∧, and ∨. To define a unique function, the composition order must be specified, say using parentheses. For example, ( x ∨ x ) ∧ ( x ∨ x ) ∧ ( x ∨ x ) 1 2 3 1 2 3 defines a unique logical function of three variables. When two logical formulas a and b are equivalent, we usually write a = b. For instance, one has ( x ∧ x ) ∨ ( x ∧ x ) ∨ ( x ∧ x ) 1 2 3 1 2 3 = ( x ∧ x ) ∨ ( x ∧ x ) ∨ ( x ∧ x ). 3 1 2 2 3 1 This equivalence can be verified by evaluating each of the two formulas for all eight combinations of truth values of the logical variables x , x , and x . The 1 2 3 Boolean algebra to be studied in the next section can help simplify such verifications. II. THE BOOLEAN ALGEBRA A. Basic Operations of the Boolean Algebra An algebra of the two-valued logic is the Boolean algebra, named after the nineteenth-century English mathematician and logician George Boole. In this ¬ algebra, there are only three basic logic operations: negation , and ∧, and or – ⋅⋅ ∨. For ease of algebraic operations, it is common to use symbols , , and +, as summarized in Table 2.4. A Boolean algebraic formula can be completely described by a truth table, where all the variables appearing in the formula are listed as inputs and the value of the entire formula is the output. Conversely, one can write Boolean algebraic formulas for any truth table. For example, returning to the console lock example, the second, sixth, seventh, and eighth rows of Table 2.1 can be written together in Boolean algebra as P = ( L ⋅⋅ S ⋅⋅ P ) + ( L ⋅⋅ S⋅⋅ P ) + ( L⋅⋅ S⋅⋅ P ) + (L⋅⋅ S ⋅⋅ P ), output which is the same as the logic formula P = ( L ∧ S ∧P)∨ ( L ∧ S∧ P)∨ (L∧ S ∧ P )∨ (L∧ S ∧ P), output2•• Fuzzy Logic Theory 63 Table 2.4 Boolean Operations Name Symbol Example Meaning AND . . Both a and b must be true for the entire a b formula to be true. OR + a + b If either a or b, or both, is true then the entire formula is true. a NOT − If a is true then the entire formula is false; if a is false then the entire formula is true. and they both yield the same output P = 1. Indeed, we have output P =( 0⋅⋅ 0⋅⋅ 1) + ( 0⋅⋅ 0⋅⋅ 1) + (0 ⋅⋅ 0⋅⋅ 1 ) + (0 ⋅⋅ 0⋅⋅ 0) output =(1⋅⋅ 1⋅⋅ 1) + (1 ⋅⋅ 0⋅⋅ 1) + (0 ⋅⋅ 0⋅⋅ 0) + (0 ⋅⋅ 0⋅⋅ 0) = 1 + 0 + 0 + 0 =1. We remark that this Boolean algebraic formula can be reduced to a simple, equivalent formula using some useful properties of the Boolean algebra to be discussed in the next subsection. B. Basic Properties of the Boolean Algebra Basic and useful properties of the Boolean algebra are summarized in Table 2.5, in which not all properties are necessary for an axiomatic characterization of the Boolean algebra. It is important to note that some rules of the Boolean algebra are the same as those of the ordinary algebra, such as . . a 0 = 0, a 1 = a, and a + 0 = a, but some are quite different, e.g., a + 1 = 1. Hence, one must be very careful not to fall into the trap of applying ordinary algebraic rules to logical formulas. Now, to show an application of the Boolean algebraic laws to simplifying some complicated logic formulas, we return to the console lock example discussed in the last subsection: S P =( L ⋅ ⋅ P ) + ( L ⋅ S⋅ P ) + ( L⋅ S⋅ P ) + ( L⋅ S⋅ P ) output S = L ⋅ P⋅ ( + S ) + S⋅ L⋅ ( P + P ) Commutative and Distributive Laws = L ⋅ P⋅ 1 + S⋅ L⋅ 1 Inclusion = L ⋅ P + S⋅ L Characteristics. It can be easily seen that this final, simplified formula is equivalent to the original one: for the second row of Table 2.1, say, we have P = 0 ⋅ 1 + 0 ⋅ 0 = 1 ⋅ 1 + 0 ⋅ 0 = 1 + 0 = 1, output and for the sixth row, we have P = 0 ⋅ 1 + 1 ⋅ 0 = 1 ⋅ 1 + 1 ⋅ 0 = 1 + 0 = 1. output64 Fuzzy Logic Theory •• 2 Table 2.5 Properties of the Boolean Algebra Laws Formulas . Characteristics a 0 = 0 . a 1 = a a + 0 = a a + 1 = 1 Commutative Law a + b = b + a . . a b = b a Associative Law a + b + c = a + ( b + c) = ( a + b ) + c . . . . . a b c = a ( b c ) = ( a b ) c . . . Distributive Law a ( b + c ) = a b + a c . Idempotence a a = a a + a = a Negation a = a a Inclusion a⋅ = 0 a a + = 1 Absorptive Law a + a⋅ b = a a⋅ ( a + b ) = a a Reflective Law a + ⋅ b = a + b . a a⋅ ( + b ) = a b a a⋅ b + ⋅ b⋅ c = a⋅ b + b⋅ c b Consistency a⋅ b + a⋅ = a b ( a + b ) ⋅ ( a + ) = a a⋅ b a b DeMorgan’s Laws = + a+b a b ⋅ = Table 2.6 Isomorphisms Among Classical Set Theory, Boolean Algebra, and Classical Logic Classical Set Theory Boolean Algebra Two-Valued Logic + ∪ ∨ . ∩ ∧ − − − S 1 1 0 0 ∅ ⊂ ⇒ = = ⇔2•• Fuzzy Logic Theory 65 Table 2.7 A Three-Valued Logic ab ∧∨ ⇒ ⇔ 0 0 0 0 1 1 0 1/2 0 1/2 1 1/2 0 1 0 1 1 0 1/2 0 0 1/2 1/2 1/2 1/2 1/2 1/2 1/2 1 1 1/2 1 1/2 1 1 1/2 1 0 0 1 0 0 1 1/2 1/2 1 1/2 1/2 1 1 1 1 1 1 We have to point out, however, that although the Boolean algebra is an effective method for reducing a logical formula to its simplest possible form, it can become quite tedious in real applications if many variables are involved in the formulas. Finally, we note that there are interesting isomorphisms among the classical set theory, the Boolean algebra, and the two-valued logic. We list their correspondences in Table 2.6. III. MULTI-VALUED LOGIC A. Three-Valued Logic The classical two-valued logic can be extended to a three-valued logic in various ways, each having its own rationale. In a typical three-valued logic, we denote the truth, falsity, and indeterminacy by values of 1, 0, and 1/2, respectively. The negation a of a proposition a is usually defined to be 1 − a. Thus, in this three-valued logic, we have 1 = 0, 0 = 1, and (1/ 2) = 1/2. Other primary logical operations, such as ∧, ∨, ⇒, and ⇔, will differ from one logic to another. A commonly used three-valued logic is shown in Table 2.7. Comparing the three-valued logic shown in Table 2.7 with the two- valued logic, one can see that the only new operations are those involving the new truth value 1/2. It should also be clear that the three-valued logic does not satisfy many basic operation laws of the two-valued logic, such as a∧ a = 0 and a∨ a = 1. B. n-Valued Logic Once a three-valued logic is accepted as a meaningful and useful tool for applications, it is not difficult to further extend it to an n-valued logic, for 3 n ∞. For a given finite positive integer, n 3, an n-valued logic assumes a 66 Fuzzy Logic Theory •• 2 rational truth value in the range 0,1, defined by the following equally spaced partition: 0 1 2 n− 2 n− 1 0 = , , , ..., , = 1. n− 1 n− 1 n− 1 n−1 n− 1 Each of these truth values describes a degree of truth. The commonly used n-valued logic, particularly in fuzzy set and fuzzy systems theories, is the Lukasiewicz-Zadeh n-valued logic. Lukasiewicz developed an n-valued logic in the 1930s, using only the negation − and the implication⇒ logical operations. Based on that, one can define a∨ b = ( a⇒ b ) ⇒ b, a∧ b = a∨ b , a⇔ b = ( a⇒ b ) ∧ ( b⇒ a ). The fuzzy set theory was developed by Zadeh in 1960s, which has been thoroughly studied in Chapter 1. To develop an n-valued logic, with 2 ≤ n ≤ ∞, such that it is isomorphic to the fuzzy set theory in the same way as the two-valued logic is isomorphic to the classical set theory, Zadeh modified the Lukasiewicz logic and established an infinite-valued logic, by defining the following primary logic operations: a =1− a, a∧ b = min a, b , a∨ b = max a, b , a⇒ b = min 1, 1 + b − a , a⇔ b=1− a− b . It has been shown, in logic theory, that all these logical operations become the same as those for the two-valued logic when n = 2, and the same as those for the three-valued logic shown in Table 2.7 when n = 3. More importantly, when n = ∞, this logic does not restrict the truth values to be rational: they can be any real numbers in 0,1. It has also been shown that this infinite-valued logic is isomorphic to the fuzzy set theory that employs the min, max, and 1−a operation for fuzzy set intersection, union, and complement, respectively, in the same way as the classical two-valued logic is isomorphic to the crisp set theory. These verifications are beyond the scope of this text and, hence, are omitted. IV. FUZZY LOGIC AND APPROXIMATE REASONING Fuzzy logic is a logic; its ultimate goal is to provide foundations for approximate reasoning using imprecise propositions based on fuzzy set theory, in a way similar to the classical reasoning using precise propositions based on the classical set theory. To introduce this notion, we first recall how the classical reasoning works, using only precise propositions and the two-valued logic. The following syllogism is an example of such reasoning in linguistic terms:2•• Fuzzy Logic Theory 67 (i) Everyone who is 40 years old or older is old. (ii) David is 40 years old and Mary is 39 years old. (iii) David is old but Mary is not. This is a very precise deductive inference, correct in the sense of the two- valued logic. In this classical (precise) reasoning using the two-valued logic, when the (output) logical variable represented by a logical formula is always true regardless of the truth values of the (input) logical variables, it is called a tautology. If, on the contrary, it is always false, then it is called a contradiction. Various tautologies can be used for making deductive inferences, which are referred to as inference rules. The four frequently used inference rules in classical reasoning are: modus ponens:( a∧ ( a⇒ b ) ) ⇒ b; modus tollens:( b ∧ ( a⇒ b ) ) ⇒ a ; syllogism:( a⇒ b ) ∧ ( b⇒ c ) ⇒ ( a⇒ c ); contraposition:( a⇒ b ) ⇒ ( b ⇒ a ). These inference rules are very easily understood and, indeed, have been commonly used in one’s daily life. For example, the modus ponens is interpreted as follows: IF “a is true” AND the statement “IF a is true THEN b is true” is true THEN “b is true.” Using this logic, we see that the deductive inference IF “40 years old or older is old” AND “IF 40 years old or older is old THEN David is old” THEN “David is old” is a modus ponens, and the deductive inference IF “Mary is not old” AND “IF Mary is 40 years old or older then Mary is old” THEN “Mary is not 40 years old nor older” is a modus tollens. With the above discussion in mind, we now consider the following example of approximate reasoning in linguistic terms that cannot be handled by the classical (precise) reasoning using two-valued logic: (i) Everyone who is 40 to 70 years old is old but is very old if he (she) is 71 years old or above; everyone who is 20 to 39 years old is young but is very young if he (she) is 19 years old or below. (ii) David is 40 years old and Mary is 39 years old. (iii) David is old but not very old; Mary is young but not very young. This is of course a meaningful deductive inference, which indeed has been frequently used in one’s daily life. This is an example of what is called approximate reasoning. In order to deal with such imprecise inference, fuzzy logic can be employed. Briefly, fuzzy logic allows the imprecise linguistic terms such as: • fuzzy predicates: old, rare, severe, expensive, high, fast • fuzzy quantifiers: many, few, usually, almost, little, much • fuzzy truth values: very true, true, unlikely true, mostly false, false, definitely false68 Fuzzy Logic Theory •• 2 Example 1.1 of Chapter 1 best explains the idea and approach of fuzzy logic for approximate reasoning. To describe fuzzy logic mathematically, we introduce the following concepts and notation. Let S be a universe set and A a fuzzy set associated with a membership function, µ (x), x ∈ S. If y = µ (x ) is a point in 0,1, A A 0 representing the truth value of the proposition “x is a,” or simply “a,” then the 0 truth value of “not a” is given by = µ (x is not a) = 1 −µ (x is a) = 1 −µ (x ) = 1 − y. y A 0 A 0 A 0 Consequently, for n members x , ..., x in S with n corresponding truth values 1 n y = µ (x) in 0,1, i = 1,...,n, by applying the extension principle (Section i A i IV.A of Chapter 1) the truth values of “not a” is defined as y = 1 − y , i=1,...,n. i i Here, we note that, actually, n = ∞ is allowed. With n 3, following logic theory (which is beyond the scope of this book) we define the logical operations and, or, not, implication, and equivalence as follows: for any a, b ∈ S, µ (a∧b) = µ (a)∧µ (b) = minµ (a),µ (b) ; A A A A A µ (a∨b) = µ (a)∨µ (b) = maxµ (a),µ (b) ; A A A A A µ ( a ) = 1 −µ (a); A A µ (a⇒b) = µ (a)⇒µ (b) = min 1, 1 + µ (b) -µ (a) ; A A A A A µ (a⇔b) = µ (a)⇔µ (b) = 1 − µ (a)−µ (b) . A A A A A For multi-point cases, e.g., a , b ∈ S, with µ (a ), µ (b ) ∈ 0,1, i=1,...,n, i j A i A j j=1,...,m, where 1 ≤ n, m≤∞, we can define µ (a ,...,a )∧µ (b ,...,b ) = max minµ (a ),µ (b ) . A 1 n A 1 m A i A j 1≤i≤n,1≤ j≤m This is equivalent to the minimum between two fuzzy numbers a ∧ b (see the fuzzy minimum operation discussed in Section IV.B of Chapter 1). Other operations are defined accordingly. In the classical two-valued logic, for instance in the modus ponens, the inference rule is ( a∧ ( a⇒ b ) ) ⇒ b. In terms of membership values, this is equivalent to the following: IFµ(a) = 1 ANDµ(a⇒b) = min 1, 1 + µ(b)–µ(a) = min 1, µ(b) = 1 THENµ(b) = 1. Otherwise, it will contradict either µ(a) = 1 or µ(a⇒b) = 1. In fuzzy logic, the inference rule reads the same: for the modus ponens, we have ( a∧ ( a⇒ b ) ) ⇒ b. But in terms of membership values, we have IFµ(a) 0 ANDµ(a⇒b) = min 1, 1 + µ(b)–µ(a) 0 THENµ(b) 0. Here, of course, µ 0 is equivalent to µ∈ (0,1 since, as usual, we have normalized all membership values. One can see that this reference is much2•• Fuzzy Logic Theory 69 more flexible. This fuzzy logic inference can be interpreted as follows: IF a is true with a certain degree of confidence AND “IF a is true with a certain degree of confidence THEN b is true with a certain degree of confidence” THEN b is true with a certain degree of confidence. All these “degrees of confidence” can be quantitatively evaluated by using the corresponding membership functions. This example is a generalized modus ponens, called fuzzy modus ponens. It is important to note that in the extremal cases, fuzzy logic is consistent with the classical logic. This can be easily verified by replacing “0” with “=1” in the above fuzzy logic inference. Example 2.1. In the classical two-valued logic, the modus tollens is ( b ∧ ( a⇒ b ) ) ⇒ a . The following is a simple case: Premise David cannot work Implication If David is young then he can work Conclusion David is not young This example does not make much sense, of course, since it implies also that David cannot work at all. So we see a limitation of the two-valued logic in applications. But two-valued logic can only describe “young or old,” “can or cannot,” etc., and this is the best one can do for this example using two-valued logic. In contrast, the fuzzy modus tollens has the same rule: ( b ∧ ( a⇒ b ) ) ⇒ a , but provides a much more meaningful inference as follows, which only implies that David cannot work so hard: Premise David cannot work much Implication If David is much younger then he can work more Conclusion David is not so young In such examples, one only needs to select reasonable membership functions to describe “young, very young, old, very old, much, much more, hard, very hard,” etc., such that they are meaningful and practical for the applications in consideration. V. FUZZY RELATIONS Let S be a universe set, and A and B be subsets of S. Similar to the Cartesian products, A × B denotes a product set in the universe set S × S. A fuzzy relation is a relation between elements of A and elements of B, described by a membership function µ (a,b), a∈ A and b∈ B. A×B70 Fuzzy Logic Theory •• 2 µ 1 1 1 0 b -1 e 1 (1,1) a = b a Figure 2.3 The fuzzy relation “a is slightly larger than b” on 0,1×0,1. A simple example of a fuzzy relation is the following. Let S = R and A = B = 0,1 ⊂ R. Define a membership function µ (a,b) for the relation “a is A×B slightly larger than b” by ⎧ 0 a≤b, µ (a,b) = A×B ⎨ −(a−b) e a b, ⎩ which is shown in Figure 2.3. Then, A, B, and µ together define a fuzzy A×B relation between a∈ A and b∈ B. For discrete supports, fuzzy relations can be defined by tables or matrices. For example, let S = R, A = a , a , a , a = 1, 2, 3, 4 and B = b , b , 1 2 3 4 1 2 b = 0, 0.1, 2 . Then the following table defines a fuzzy relation “a is 3 considerably larger than b.” b b b 1 2 3 a 0.6 0.6 0.0 1 a 0.8 0.7 0.0 2 a 0.9 0.8 0.4 3 a 1.0 0.9 0.5 42•• Fuzzy Logic Theory 71 Example 2.2. Let S = R with subsets A, B ⊆ R. Consider two fuzzy subsets: (i) A with the associate membership function µ (a), a∈ A; A (ii) B with the associate membership function µ (b), b∈ B. B Letµ (a,b) be the membership function defined on A× B by A×B µ (a,b) = minµ (a),µ (b) , (a,b)∈ A× B. A×B A B Then, A, B, and µ together define a fuzzy relation. A×B For notational convenience, we denote by R a fuzzy relation defined ( A,B) on a product set A × B by two subsets A and B of a universe set, S, and an associate membership function, µ . A×B 1 2 For two fuzzy relations R and R , defined on the same product set ( A,B) ( A,B) 1 2 1 2 A × B, their union and intersection, R ∪ R and R ∩ R , ( A,B) ( A,B) ( A,B) ( A,B) are defined by the membership functions µ (a,b) = max µ (a,b) , µ (a,b) , (a,b)∈ A×B; 1 2 1 2 R∪R R R µ (a,b) = min µ (a,b) , µ (a,b) , (a,b)∈ A×B, 1 2 1 2 R∩R R R respectively. Example 2.3. Let S = R, A = a , a , a , a = 1, 2, 3, 4 , and B = b , 1 2 3 4 1 1 b , b = 0, 0.1, 2 . Let R be the fuzzy relation “a is considerably 2 3 ( A,B) larger than b” defined by the following table: b b b 1 2 3 a 0.6 0.6 0.0 1 1 R : a 0.8 0.7 0.0 ( A,B) 2 a 0.9 0.8 0.4 3 a 1.0 0.9 0.5 4 2 Let R be the fuzzy relation “a is considerably close to b” defined by the A B ( , ) following table: b b b 1 2 3 a 0.2 0.2 0.5 1 2 R : a 0.1 0.1 1.0 ( A,B) 2 a 0.0 0.0 0.3 3 a 0.0 0.0 0.5 472 Fuzzy Logic Theory •• 2 1 2 1 2 Then, R ∪ R and R ∩ R are given by the following two ( A,B) ( A,B) ( A,B) ( A,B) tables, respectively: b b b 1 2 3 a 0.6 0.6 0.5 1 1 2 R ∪ R : a 0.8 0.7 1.0 ( A,B) ( A,B) 2 a 0.9 0.8 0.4 3 a 1.0 0.9 0.5 4 b b b 1 2 3 a 0.2 0.2 0.0 1 1 2 R ∩ R : a 0.1 0.1 0.0 ( A,B) ( A,B) 2 a 0.0 0.0 0.3 3 a 0.0 0.0 0.5 4 1 2 Here, in this example, R ∪ R means that “a is either considerably ( A,B) ( A,B) 1 2 larger than or considerably close to b,” and R ∩ R means that “a is ( A,B) ( A,B) considerably larger than, as well as considerably close to, b.” The latter statement is somewhat self-contradictory but is acceptable by fuzzy relations, and, however, has small membership values in general. 1 2 For two fuzzy relations, R and R , we cannot perform their union ( A,B) (B,C) and intersection by the same rule because they are defined on different product sets, A×B and B×C, respectively. However, we can perform their compositions, since they have a common set B in between A and C. Among some other important compositions, the max-min composition is the most useful one in applications. 1 2 Let R and R be two fuzzy relations. Their max-min composition ( A,B) (B,C) is defined to be the new relation 1 2 R = R ° R (A,B,C) ( A,B) (B,C) with the membership function µ (a, c) = max min µ (a,b) , µ (b,c) , (a,c)∈ A×C. 1 2 1 2 R oR R R b∈B Next, we provide some basic properties of the max-min composition of fuzzy relations for the case where A = B = C. A fuzzy relation R is said to be reflexive if (A,A) µ (a, a) = 1 for all a∈ A. R2•• Fuzzy Logic Theory 73 This fuzzy relation R is said to be symmetric if (A,A) µ (a,b) = µ (b, a) for all a , b∈ A. R R But, this fuzzy relation is said to be antisymmetric if ⎧ µ (a,b) ≠ µ (b, a) R R ⎪ a≠ b⇒ or for all a , b∈ A; ⎨ ⎪ µ (a,b) = µ (b, a) = 0 ⎩ R R and perfectly antisymmetric if a≠ b⇒ ( µ (a,b) 0 ⇒µ (b,a) = 0 ) for all a , b∈ A. R R Finally, this fuzzy relation R is said to be transitive if (A,A) µ≤ (a,b) µ (a,b) for all a , b∈ A. RoR R i Example 2.4. Consider the following three fuzzy relations, R (a,a), where a∈ A and i = 1, 2, 3. a a a a 1 2 3 4 a 0.4 0.0 0.1 0.8 1 1 a 0.8 1.0 0.0 0.0 R (a,a): 2 a 0.0 0.6 0.7 0.0 3 a 0.0 0.2 0.0 0.0 4 a a a a 1 2 3 4 a 0.4 0.8 0.7 0.0 1 2 a 0.0 1.0 0.9 0.6 R (a,a): 2 a 0.8 0.4 0.7 0.4 3 a 0.0 0.1 0.0 0.0 4 a a a a 1 2 3 4 a 0.4 0.8 0.1 0.8 1 3 a 0.8 1.0 0.0 0.2 R (a,a): 2 a 1.0 0.6 0.7 0.1 3 a 0.0 0.2 0.0 0.0 4 1 2 It can be verified that R is perfectly antisymmetric while R is only 3 antisymmetric but not perfectly. As to R , it is a nonsymmetric fuzzy relation in the sense that there are a , b∈ A such that74 Fuzzy Logic Theory •• 2 µ (a,b)≠ µ (b,a), 3 3 R R which is not antisymmetric and so is not perfectly antisymmetric either. Now, we can state the following basic properties of the max-min composition of fuzzy relations, which can be verified by some standard procedures discussed in Chapter 1. 1 2 3 Theorem 2.1. Let R , R , R , R , etc. be fuzzy relations defined on the same product set A×A, and let “ “ be the max-min composition operation for ° these fuzzy relations. Then (1) The max-min composition is associative: 1 2 3 1 2 3 ( R R ) R = R ( R R ). ° ° ° ° 1 2 (2) If R is reflexive and R is arbitrary, then µ (a,b) ≤ µ (a,b) , for all a, b∈ A, 2 1 2 R R oR and µ 2 (a,b) ≤ µ 2 1 (a,b) , for all a, b∈ A. R R oR 1 2 1 2 2 1 (3) If R and R are reflexive, then so are R ° R and R ° R . 1 2 1 2 2 1 1 2 (4) If R and R are symmetric and R ° R = R ° R , then R ° R is symmetric. In particular, if is symmetric then so is ° . R R R (5) If R is symmetric and transitive, then µ≤ (a,b) µ (a, a) , for all a, b∈ A. R R (6) If R is reflexive and transitive, then R R = R . ° 1 2 1 2 2 1 1 2 (7) If R and R are transitive and R R = R R , then R R is ° ° ° transitive. Finally in this section, we show by example an application of the fuzzy relations and their max-min compositions in fuzzy logic for approximate reasoning. Example 2.5. Let S = 1, 2, 3, 4 and A = 1, 2, 3, 4 with the following membership function for the fuzzy description “small”: ⎧ 1.0 if a=1, ⎪ 0.7 if a 2, = ⎪ µ (a) = A ⎨ 0.3 if a 3, = ⎪ ⎪ 0.0 if a=4. ⎩ Let R be a fuzzy relation between two members in A, meaning “approximately equal,” and be defined by the following table:2•• Fuzzy Logic Theory 75 1234 1 1.0 0.5 0.0 0.0 2 0.5 1.0 0.5 0.0 R : 3 0.0 0.5 1.0 0.5 4 0.0 0.0 0.5 1.0 Suppose that we want to perform the following fuzzy logic inference (approximate reasoning): Premise a is small Implication a and b are approximately equal Conclusion b is somewhat small Then, we can apply the max-min composition of the fuzzy relations as follows: (i) “a is small”: µ (a) is available; A (ii) “a and b are approximately equal”: µ (a,b) is given by the table; R (iii) let µ (b) be the membership function for the conclusion (a fuzzy B modus ponens for this example): µ (b) = max minµ (a), µ (a,b) , b∈B=A. B A R a∈A The result, for b = 2, say, is µ (2) = max minµ (a), µ (a,2) B A R a∈A = max min1.0,0.5, min0.7,1.0, min0.3,0.5, min0.0,0.0 = max 0.5, 0.7, 0.3, 0.0 = 0.7. Similarly, one can evaluate µ (1),µ (3), and µ (4). The final result is B B B ⎧ 1.0 ifb=1, ⎪ 0.7 ifb=2, ⎪ µ (b) = B ⎨ 0.5 ifb=3, ⎪ ⎪ = 0.3 ifb 4. ⎩ VI. FUZZY LOGIC RULE BASE A. Fuzzy IF-THEN Rules In Section IV, we discussed in somewhat detail the fuzzy logic operations and, or, not, implication, and equivalence: a∧ b, a∨ b, a , a⇒ b, a⇔ b76 Fuzzy Logic Theory •• 2 and their evaluations on a fuzzy set A with the membership function µ (⋅): A µ (a∧b)= µ (a)∧µ (b) = minµ (a),µ (b) ; A A A A A µ (a∨b)= µ (a)∨µ (b) = maxµ (a),µ (b) ; A A A A A µ ( a)= µ (a) = 1 −µ (a); A A A µ (a⇒b)= µ (a)⇒µ (b) = min 1, 1 + µ (b) -µ (a) ; A A A A A µ (a⇔b)= µ (a)⇔µ (b) = 1 − µ (a)–µ (b) . A A A A A In Section V, we also discussed fuzzy relations between elements of two subsets A and B, on which a membership function µ (a,b) is defined, with A×B a ∈ A and b ∈ B. It is clear that one can consider the above fuzzy logic operations as some special fuzzy relations, with A = B and µ = µ . A×A A In this section, we take a closer look at the implication relation a ⇒ b and its application in fuzzy logic rules. The implication relation a ⇒ b can be interpreted, in linguistic terms, as “IF a is true THEN b is true.” Of course, this is valid for both the classical (two-valued) logic and the fuzzy (multi-valued) logic. For fuzzy logic performed on a fuzzy subset A, we have a membership function µ describing A the truth values of a ∈ A and b ∈ A. In this case, a more complete linguistic statement would be “(IF a ∈ A is true with a truth value µ (a) THEN b ∈ A is A true with a truth value µ (b) ) has a truth value A µ (a⇒b) = min 1, 1 + µ (b)–µ (a) .” A A A In the above, both a and b belong to the same fuzzy subset A and share the same membership function µ . If they belong to different fuzzy subsets A and A B with different membership functions µ and µ , then we have a nontrivial A B fuzzy relation, which can be quite complicated. In most cases, however, the implication relation a ⇒ b, performed on fuzzy subsets A and B, where a ∈ A and b∈ B, is simply defined in linguistic terms as “IF a ∈ A is true with a truth value µ (a) THEN b ∈ B is A true with a truth value µ (b).” B Throughout this book, we often consider this kind of implication. Because such statements have a standard format and their meaning is clear, it is common to write them in the following simple form: “IF a is A THEN b is B.” A fuzzy logic implication statement of this form is usually called a fuzzy IF- THEN rule. To be more general, let A ,...,A, and B be fuzzy subsets with 1 n membership functions µ ,...,µ , and µ , respectively. A A B 1 n Definition 2.1. A General Fuzzy IF-THEN Rule has the form “IF a is A AND ... AND a is A THEN b is B.” 1 1 n n Using the fuzzy logic AND operation, this rule is implemented by the following evaluation formula: µ (a )∧ ... ∧µ (a )⇒µ (b), A 1 A n B 1 n where