Fuzzy Theory Timothy J Ross 204 Fuzzy Logic

  • Slides: 176
Download presentation
模糊理論 Fuzzy Theory 淡江大學 資訊管理系所 侯永昌 教科書:Timothy J. Ross (204), Fuzzy Logic with Engineering

模糊理論 Fuzzy Theory 淡江大學 資訊管理系所 侯永昌 教科書:Timothy J. Ross (204), Fuzzy Logic with Engineering Applications, 2 nd Edition, John Wiley & Sons, Ltd. 新月圖書代理 淡江大學 資訊管理系所 侯永昌

Chapter 5 Fuzzy to Crisp Conversions 淡江大學 資訊管理系所 侯永昌 1

Chapter 5 Fuzzy to Crisp Conversions 淡江大學 資訊管理系所 侯永昌 1

Defuzzification • Despite the fact that the bulk of the information we assimilate every

Defuzzification • Despite the fact that the bulk of the information we assimilate every day is fuzzy, most of the actions or decisions implemented by humans or machines are crisp or binary. • Defuzzification of a fuzzy set is the process of "rounding it off" from its location in the unit hypercube to the nearest (in geometric sense) vertex. • If one thinks of a fuzzy set as a collection of membership values, or a vector of values on the unit interval, defuzzification reduces this vector to a single scalar quantity - presumably to the most typical (prototype) or representative value. 淡江大學 資訊管理系所 侯永昌 2

Lambda-cuts for fuzzy sets • The set Aλ is a crisp set called lambda-cut

Lambda-cuts for fuzzy sets • The set Aλ is a crisp set called lambda-cut (or alpha-cut) set of fuzzy set A , where Aλ={x|μA(x) λ}. • Example 5. 1 – A 1 = {a} A 0. 9 = {a, b} – A 0. 6 = {a, b, c} A 0. 3 = {a, b, c, d} – A 0+ = {a, b, c, d, e} A 0 = {a, b, c, d, e, f} = X • 另外一種表示法為:確定在 set 中的元素,它的 membership 就為 1 淡江大學 資訊管理系所 侯永昌 3

Lambda-cuts for fuzzy sets • Lambda-cut sets obey the following four very special properties:

Lambda-cuts for fuzzy sets • Lambda-cut sets obey the following four very special properties: 1. (A∪B)λ = Aλ∪Bλ 2. (A∩B)λ = Aλ∩Bλ 3. (~A)λ≠(~Aλ) except for a value of λ= 0. 5 4. For anyλ α, where 0 α 1, it is true that Aα Aλ, where A 0 = X A 0. 6 A 0. 3 淡江大學 資訊管理系所 侯永昌 4

Lambda-cuts for fuzzy sets • We can use the concept of lambda-cut to provide

Lambda-cuts for fuzzy sets • We can use the concept of lambda-cut to provide the following definitions for a convex fuzzy set A. 1. The core of A is the λ=1 cut set, A 1. 2. The support of A is the λ-cut set A 0+, where λ=0+, or A 0+={x|μA(x) > 0}. 3. The intervals [A 0+, A 1] form the boundaries of the fuzzy set A, i. e. , those regions that have membership values between 0 and 1. 淡江大學 資訊管理系所 侯永昌 5

Lambda-cuts for fuzzy Relations • A fuzzy relation R can be converted to a

Lambda-cuts for fuzzy Relations • A fuzzy relation R can be converted to a crisp relation in the following manner: Rλ={(x, y)|μR(x, y) λ} as aλ-cut relation of the fuzzy relation, R. • Example 5. 2. • λ = 0 R 0 = E ( whole relation ) 淡江大學 資訊管理系所 侯永昌 6

Lambda-cuts for fuzzy Relations • Lambda-cuts on fuzzy relations obey certain properties, just as

Lambda-cuts for fuzzy Relations • Lambda-cuts on fuzzy relations obey certain properties, just as lambda-cuts on fuzzy sets: 1. (R∪S)λ = Rλ∪Sλ 2. (R∩S)λ = Rλ∩Sλ 3. (~R)λ≠(~Rλ) except for a value of λ= 0. 5 4. For anyλ α, where 0 α 1, then Rα Rλ 淡江大學 資訊管理系所 侯永昌 7

Defuzzification Methods • Defuzzification is the conversion of a fuzzy quantity to a precise

Defuzzification Methods • Defuzzification is the conversion of a fuzzy quantity to a precise quantity, just as fuzzification is the conversion of a precise quantity to a fuzzy quantity. • The output of a fuzzy process can be the logical union of two or more fuzzy membership functions (by max operator) defined on the universe of discourse of the output variable. ===> 淡江大學 資訊管理系所 侯永昌 8

Defuzzification Methods 淡江大學 資訊管理系所 侯永昌 9

Defuzzification Methods 淡江大學 資訊管理系所 侯永昌 9

Defuzzification Methods • 要如何將這個 fuzzy quantity 轉換為 precise quantity ? • Max-membership principle:取最大值作為代表值 –

Defuzzification Methods • 要如何將這個 fuzzy quantity 轉換為 precise quantity ? • Max-membership principle:取最大值作為代表值 – μC(z*) μC(z) for all z Z • Centroid method (center of area, or center of gravity): 重心法 – where∫denotes an algebraic integration 淡江大學 資訊管理系所 侯永昌 10

Defuzzification Methods • Weighted average method: good for symmetrical output – where Σ denotes

Defuzzification Methods • Weighted average method: good for symmetrical output – where Σ denotes an algebraic sum • Mean-max membership (middle-of-maxima): 類似方法 1,但 maximum並非單一值 – z*= (a+b)/2 淡江大學 資訊管理系所 侯永昌 11

Defuzzification Methods • Center of sum: algebraic sum of individual output fuzzy sets instead

Defuzzification Methods • Center of sum: algebraic sum of individual output fuzzy sets instead of their union。交集的部分會被計算到兩 次 • The weights are the areas of the respective membership functions, whereas in the weight average method the weights are individual membership values 淡江大學 資訊管理系所 侯永昌 18

Defuzzification Methods 淡江大學 資訊管理系所 侯永昌 19

Defuzzification Methods 淡江大學 資訊管理系所 侯永昌 19

Defuzzification Methods • Center of largest area: 如果 output 不是 convex ,則 找最大 convex

Defuzzification Methods • Center of largest area: 如果 output 不是 convex ,則 找最大 convex 圖形的重心 – 淡江大學 資訊管理系所 侯永昌 where Cm is the largest convex subregion 20

Defuzzification Methods • First (or last) of maxima: 以第一個或最後一個 maxima 作為代表值 淡江大學 資訊管理系所 侯永昌

Defuzzification Methods • First (or last) of maxima: 以第一個或最後一個 maxima 作為代表值 淡江大學 資訊管理系所 侯永昌 21

衡量的標準 • Continuity: A small change in the input of a fuzzy process should

衡量的標準 • Continuity: A small change in the input of a fuzzy process should not produce a large change in the output. • Disambiguity: It should always result in a unique value for Z*. Max-membership 就可能會不滿足這個條件。 ref: Fig. 5 -13 • Plausibility: Z * should lie approximately in the middle of the support region of Ck and have a high degree of membership in Ck。重心法 就可能會不滿足這個條件。 ref: Fig. 5 -19 • Computational Simplicity: Max-membership, mean-max. first, last maxima are faster. • Weighting method: 不同的 weighting method 會有不 同的結果。It is problem-dependent. 淡江大學 資訊管理系所 侯永昌 27

Chapter 6 Fuzzy Arithmetic, Numbers, Vectors, and the Extension Principle 淡江大學 資訊管理系所 侯永昌 28

Chapter 6 Fuzzy Arithmetic, Numbers, Vectors, and the Extension Principle 淡江大學 資訊管理系所 侯永昌 28

Crisp Functions, Mapping, and Relations • Functions are mappings from one universe, X, to

Crisp Functions, Mapping, and Relations • Functions are mappings from one universe, X, to another universe, Y, which are denoted as f: X Y • A mapping can also be expressed by a relation R described as R = {(x, y) | y = f(x)}, with the characteristic function describing membership of specific x, y pairs to the relation R as 淡江大學 資訊管理系所 侯永昌 29

Crisp Functions, Mapping, and Relations • Collections of elements in X mapped to collections

Crisp Functions, Mapping, and Relations • Collections of elements in X mapped to collections of elements in Y B = f (A) = {y | for all x A, y = f (x)}, where B will be defined by its characteristic value 淡江大學 資訊管理系所 侯永昌 30

Functions of Fuzzy Sets • Extension Principle: extending fuzziness in an input set to

Functions of Fuzzy Sets • Extension Principle: extending fuzziness in an input set to an output set B = f (A) • 以 function 的形式表示兩個 fuzzy set 之間的 關係。The input, output are fuzzy, but the transform is crisp • The image of a fuzzy set A on X under the mapping f is also fuzzy, B • 也可以用 relation 的形式表示兩個 fuzzy set 之 間的關係。B = A。R 淡江大學 資訊管理系所 侯永昌 33

Functions of Fuzzy Sets • 當擴展到多變量時, f : P(X 1 X 2. . .

Functions of Fuzzy Sets • 當擴展到多變量時, f : P(X 1 X 2. . . Xn) P(Y) • Let fuzzy sets A 1, A 2, . . . , An be defined on the universe X 1, X 2, . . . , Xn. The mapping on this input can be defined as B = f (A 1, A 2, . . . , An), where the membership function of the image B is given by • This equation is generally called Zadeh's extension principle. 淡江大學 資訊管理系所 侯永昌 34

Fuzzy Transform (Mapping) • Input, output, and mapping are both fuzzy B = f

Fuzzy Transform (Mapping) • Input, output, and mapping are both fuzzy B = f (A) or B = A 。 R • For a single element of the input universe, xi, its fuzzy image, Bi = f (xi), is given by the elements in the ith row of the fuzzy relation R. • 淡江大學 資訊管理系所 侯永昌 35

Practical Consideration • If f is a one-to-one mapping, and then • Example 6.

Practical Consideration • If f is a one-to-one mapping, and then • Example 6. 3 v = f (u) = 2 u - 1, where U = {1, 2, 3}, and V = {1, 3, 5} If a fuzzy set then the fuzzy membership function for 淡江大學 資訊管理系所 侯永昌 37

Fuzzy Transform • If A is a fuzzy set defined on the Cartesian space

Fuzzy Transform • If A is a fuzzy set defined on the Cartesian space U 1 U 2, then 淡江大學 資訊管理系所 侯永昌 38

Fuzzy Transform • Example 6. 4. U 1 = U 2 = {1, 2,

Fuzzy Transform • Example 6. 4. U 1 = U 2 = {1, 2, 3, 4, 5, 6} • Define A = 2 = “approximate 2” = • Define B = 6 = “ approximate 6 ” = • Approximate 12 = 2 6 = = = • 不是 convex,因為它不是由一個 fuzzy 現象所構成 淡江大學 資訊管理系所 侯永昌 39

Fuzzy Transform • Example 6. 5 • Example 6. 6 淡江大學 資訊管理系所 侯永昌 40

Fuzzy Transform • Example 6. 5 • Example 6. 6 淡江大學 資訊管理系所 侯永昌 40

Example 6. 7 A nonlinear system 淡江大學 資訊管理系所 侯永昌 41

Example 6. 7 A nonlinear system 淡江大學 資訊管理系所 侯永昌 41

Example 6. 7 A nonlinear system 淡江大學 資訊管理系所 侯永昌 42

Example 6. 7 A nonlinear system 淡江大學 資訊管理系所 侯永昌 42

Example 6. 7 A nonlinear system 淡江大學 資訊管理系所 侯永昌 43

Example 6. 7 A nonlinear system 淡江大學 資訊管理系所 侯永昌 43

Fuzzy Numbers • Let I and J be two fuzzy numbers, and let the

Fuzzy Numbers • Let I and J be two fuzzy numbers, and let the symbol * denote a general arithmetic operation, i. e. , * { +, -, , }. An arithmetic operation (mapping) between these two fuzzy numbers, denoted I * J, will be • μI*J (z) = x*y=Z (μI (x) μJ (y)) • 淡江大學 資訊管理系所 侯永昌 45

Fuzzy Numbers • The support for a fuzzy number, I , is given by

Fuzzy Numbers • The support for a fuzzy number, I , is given by I = supp I = {x | μI (x)>0} which is an interval on the real line. The support of the fuzzy number resulting from the arithmetic operation, I * J, i. e. , • supp. I*J (z) = supp. I (x) * supp. J (y), and • ( I * J ) = I * J = I * J 淡江大學 資訊管理系所 侯永昌 46

Interval Analysis in Arithmetic • A fuzzy set can be thought of as a

Interval Analysis in Arithmetic • A fuzzy set can be thought of as a crisp set with moving boundaries • A convex membership function defining a fuzzy set can be described by the intervals associated with different levels of lambda-cuts • Let I 1 and I 2 be two interval numbers, I 1 = [a, b] and I 2 = [c, d], where a b and c d * { +, -, , } The operation I 1 * I 2 = [a, b] * [c, d] represents another interval 淡江大學 資訊管理系所 侯永昌 47

Interval Analysis in Arithmetic • Four arithmetic interval operations: – [a, b] + [c,

Interval Analysis in Arithmetic • Four arithmetic interval operations: – [a, b] + [c, d] = [a+c, b+d], – [a, b] - [c, d] = [a-d, b-c], – [a, b] [c, d] = [min(ac, ad, bc, bd), max(ac, ad, bc, bd)], = [ac, bd] if a, b, c, d are all positive numbers, – [a, b] ÷[c, d] = [a, b].[1/d, 1/c] provided that 0 [c, d], – α[a, b] = [αa, αb] for α>0 = [αb, αa] for α<0 淡江大學 資訊管理系所 侯永昌 48

Interval Analysis in Arithmetic • Interval arithmetic follows properties of associativity and commutativity for

Interval Analysis in Arithmetic • Interval arithmetic follows properties of associativity and commutativity for both summations and products. • But it does not follow the property of distributivity. Rather, intervals do follow a special subclass of distributivity known as subdistributivity. • I (J + K) I J + I K 淡江大學 資訊管理系所 侯永昌 49

Vertex Method • The method is based on a combination of the λ-cut concept

Vertex Method • The method is based on a combination of the λ-cut concept and standard interval analysis, but it deals only with the endpoints of the interval. • The algorithm works as follows: 1. Any continuous membership function can be represented by a continuous sweep of λ-cut intervals from λ= 0+ to λ= 1. We decompose A into a series of λ-cut intervals, say Iλ 2. When the function f(x) is continuous and monotonic on Iλ = [a, b], the interval representing B at a particular value of λ, say Bλ, can be obtained by Bλ = f(Iλ) = [min(f(a), f(b)), max(f(a), f(b))] 淡江大學 資訊管理系所 侯永昌 52

Vertex Method 3. 如果A代表的是多變量之模糊量,則 j = 1, 2, . . . , 2 n

Vertex Method 3. 如果A代表的是多變量之模糊量,則 j = 1, 2, . . . , 2 n , where cj is the coordinate of the jth vertex representing the n-dimensional Cartesian region 4. 如果在I iλ = [ a i , b i ]中,包含極值(extreme point), 則上式應修正為 where j = 1, 2, . . . , N and k = 1, 2, . . . , m, for m extreme points in the region 淡江大學 資訊管理系所 侯永昌 53

DSW Algorithm • It also uses the λ-cut representation of fuzzy sets, but it

DSW Algorithm • It also uses the λ-cut representation of fuzzy sets, but it uses the full λ-cut intervals in a standard interval analysis. • The DSW algorithm consists of the following steps: 1. Select a λvalue where 0 λ 1 2. Find the input interval I 3. 利用 interval operations,計算 output 函 數之 interval 4. 針對不同的 λ,重覆steps 1 -3 淡江大學 資訊管理系所 侯永昌 56

Example 6. 14 Comparisons 1、Extension principle using discretized fuzzy sets: 淡江大學 資訊管理系所 侯永昌 64

Example 6. 14 Comparisons 1、Extension principle using discretized fuzzy sets: 淡江大學 資訊管理系所 侯永昌 64

Example 6. 14 Comparisons 淡江大學 資訊管理系所 侯永昌 65

Example 6. 14 Comparisons 淡江大學 資訊管理系所 侯永昌 65

Example 6. 14 Comparisons 2、Vertex Method(圖 6. 15) • I 0+:support for X is

Example 6. 14 Comparisons 2、Vertex Method(圖 6. 15) • I 0+:support for X is [1, 7] and support for Y is [2, 8] (a) x = 1, y = 2, f(a) = 2 (b) x = 1, y = 8, f(b) = 8 (c) x = 7, y = 2, f(c) = 14 (d) x = 7, y = 8, f(d) = 56 Therefore, min = 2, max = 56, and B 0+ = [ 2, 56 ] • I 0. 33:X = [ 2, 6 ] and Y = [ 3, 7 ] B 0. 33 = [ min(6, 14, 18, 42), max(6, 14, 18, 42) ] = [ 6, 42 ] • I 0. 66:X = [ 3, 5 ] and Y = [ 4, 6 ]. B 0. 66 = [min(12, 18, 20, 30), max(12, 18, 20, 30)] = [12, 30] • I 1:X = [ 4, 4 ] and Y = [ 5, 5 ] 淡江大學 資訊管理系所 侯永昌 66 Therefore, B = [ 20, 20 ] 1

Example 6. 14 Comparisons 3、DSW Method(圖 6. 16 ) • I 0+:[ 1, 7

Example 6. 14 Comparisons 3、DSW Method(圖 6. 16 ) • I 0+:[ 1, 7 ] [ 2, 8 ] = [min(2, 8, 14, 56), max(2, 8, 14, 56)] = [ 2, 56 ]. • I 0. 33:[ 2, 6 ] [ 3, 7 ] = [min(6, 14, 18, 42), max(6, 14, 18, 42)] = [ 6, 42 ]. • I 0. 66:[ 3, 5 ] [ 4, 6 ] = [min(12, 18, 20, 30), max(12, 18, 20, 30)] = [12, 30]. • I 1:[ 4, 4 ] [ 5, 5 ] = [min(20, 20, 20), max(20, 20)] = [20, 20]. 淡江大學 資訊管理系所 侯永昌 67

Example 6. 14 Comparisons 淡江大學 資訊管理系所 侯永昌 68

Example 6. 14 Comparisons 淡江大學 資訊管理系所 侯永昌 68

Example 6. 14 Comparisons • 圖 6. 14(a)-(c) 中為什麼有很多 0 ,因為分的 不夠細 (discretization) 。但是它們的包絡線

Example 6. 14 Comparisons • 圖 6. 14(a)-(c) 中為什麼有很多 0 ,因為分的 不夠細 (discretization) 。但是它們的包絡線 與圖 6. 15、圖 6. 16 非常類似。如果能夠將 資料分的更細一些,如圖 6. 14(d),就更像 圖 6. 15、圖 6. 16 • The results are the same for three methods • It should be intuitively obvious that as the discretization is increased, the resulting curve approaches the true values of membership functions 淡江大學 資訊管理系所 侯永昌 69

Fuzzy Vectors • Let a and b as fuzzy vector of length n, and

Fuzzy Vectors • Let a and b as fuzzy vector of length n, and define a‧b. T = as the fuzzy inner product of a and b, and a⊕b. T = as the fuzzy outer product of a and b. • 當 a = b 時,a ‧ b 會達到最大值,而 a ⊕ b 會達到 最小值,因此,一般我們以內積來代表兩個 fuzzy vector 的相似程度,而外積代表它們不相似的程度 淡江大學 資訊管理系所 侯永昌 70

Fuzzy Vectors • Let a = (a 1, a 2, . . . ,

Fuzzy Vectors • Let a = (a 1, a 2, . . . , an), the complement of the fuzzy vector ~a = ( 1 -a 1, 1 -a 2, . . . , 1 -an) = ( ~a 1, ~a 2, . . . , ~an) • It should be obvious that since ~a is subject to the constraint, 0 ~ai 1, the fuzzy complement vector is also another fuzzy vector. • 淡江大學 資訊管理系所 侯永昌 72

Chapter 7 Classical Logic and Fuzzy Logic 淡江大學 資訊管理系所 侯永昌 75

Chapter 7 Classical Logic and Fuzzy Logic 淡江大學 資訊管理系所 侯永昌 75

Fuzzy Logic • Logic is a way quantitatively to develop a reasoning process that

Fuzzy Logic • Logic is a way quantitatively to develop a reasoning process that can be replicated and manipulated with mathematical precepts. • The interest in logic is the study of truth in logical propositions; in classical predicate logic this truth is binary, either true or false. • Fuzzy logic is a method to formalize the human capacity of imprecise reasoning, or approximate reasoning. Such reasoning represents the human ability to reason approximately and judge under uncertainty. • In fuzzy logic all truths are partial or approximate. 淡江大學 資訊管理系所 侯永昌 76

Classical Predicate Logic • A simple proposition P is a linguistic, or declarative, statement

Classical Predicate Logic • A simple proposition P is a linguistic, or declarative, statement that are strictly true or strictly false. • If U is the universe of all propositions, then T is a mapping of the elements, u, in these propositions (sets) to the binary quantities (0, 1), or T : u U [0, 1] • All elements u in the universe U that are true for proposition P are called the truth set of P, denoted T(P). Those elements u in the universe U that are false for proposition P are called the falsity set of P. • For a universe Y and the null set , we define T(Y) = 1 and T( ) = 0. 淡江大學 資訊管理系所 侯永昌 77

Logic Connectives • logical connectives: can be used to form new propositions from simple

Logic Connectives • logical connectives: can be used to form new propositions from simple propositions. • Disjunction ( ) : logic or, inclusive or, P Q : x A or x B, Hence T(P Q) = max(T(P), T(Q)) • Conjunction ( ) : P Q : x A and x B Hence T(P Q) = min(T(P), T(Q)) • Negation (~) : ~P : If T(P) = 1 then T(~P) = 0; If T(P) = 0 then T(~P) = 1 淡江大學 資訊管理系所 侯永昌 78

Logic Connectives • Implication ( ) : P Q : x A or x

Logic Connectives • Implication ( ) : P Q : x A or x B Hence, T(P Q) = T(~P Q) = max(T(~P), T(Q)) P is referred as the hypothesis or the antecedent, and Q is called the conclusion or the consequent. • Equivalence ( ) : If P Q and Q P, then P Q. T(P Q) = 1 for T(P) = T(Q) 0 for T(P) T(Q) 淡江大學 資訊管理系所 侯永昌 79

Example 7. 2 Proposition • P 1: If 1 + 1 = 2, then

Example 7. 2 Proposition • P 1: If 1 + 1 = 2, then 4 > 0. 2: If 1 + 1 = 3, then 4 > 0. 3: If 1 + 1 = 3, then 4 < 0. 4: If 1 + 1 = 2, then 4 < 0. True true ! ! False • 淡江大學 資訊管理系所 侯永昌 80

Implication • Suppose the implication operation involves two different universes of discourse; P is

Implication • Suppose the implication operation involves two different universes of discourse; P is a proposition described by set A, which is defined on universes X, and Q is a proposition described by sets B, which is defined on universes Y, then the implication P Q can be represented as: • R = (A B)∪(~A Y)≡IF A THEN B ≡~A∪B IF x A where x X and A X; THEN y B where y Y and B Y 淡江大學 資訊管理系所 侯永昌 81

Implication X X A A B Y Fig. 7. 2 The Cartesian space showing

Implication X X A A B Y Fig. 7. 2 The Cartesian space showing the implication IF A, Then B B C Y Fig. 7. 3 True domain for IF A, THEN B, ELSE C. • R = IF A THEN B ELSE C • => IF A THEN B or IF ~A THEN C ; • => R = (A B)∪(~A C) 淡江大學 資訊管理系所 侯永昌 82

Logic Connectives P Q ~P P Q P Q T(1) F(0) T(1) T(1) F(0)

Logic Connectives P Q ~P P Q P Q T(1) F(0) T(1) T(1) F(0) F(0) F(0) T(1) T(1) 淡江大學 資訊管理系所 侯永昌 83

Tautologies • Compound propositions that are always true, irrespective of the truth values of

Tautologies • Compound propositions that are always true, irrespective of the truth values of the individual simple propositions, are called tautologies. • Tautologies are useful for deductive reasoning, for proving theorems, and for making deductive inferences. 淡江大學 資訊管理系所 侯永昌 84

Modus ponens • Modus ponens : common inference scheme used in forward-chaining rule-based expert

Modus ponens • Modus ponens : common inference scheme used in forward-chaining rule-based expert systems. It is an operation whose task is to find the truth of a consequent in a production rule, given the truth value of the antecedent in the rule. • Modus ponens deduction concludes that, given two propositions, P and P Q, both of which are true, then the truth of the simple proposition Q is automatically inferred. 淡江大學 資訊管理系所 侯永昌 85

Modus ponens • • • Proof: ( A B ) ) B ( A

Modus ponens • • • Proof: ( A B ) ) B ( A ∪ B ) ) B Implication ( A A) ∪ ( A B ) ) B Distributivity ( ∪ ( A B ) ) B Excluded middle laws ( A B ) B Identity (A B ) ∪ B Implication (A B ) ∪ B De Morgan‘s laws A (B ∪ B ) Associativity A X Excluded middle laws X ===>T(X) = 1 Identity; QED 淡江大學 資訊管理系所 侯永昌 86

Modus ponens A A (A (A B) ) A B B B) B 0

Modus ponens A A (A (A B) ) A B B B) B 0 0 1 0 1 Tautology 1 0 0 0 1 1 1 淡江大學 資訊管理系所 侯永昌 87

Modus tollens • Modus tollens : inference scheme used in backward-chaining expert systems. •

Modus tollens • Modus tollens : inference scheme used in backward-chaining expert systems. • Modus tollens deduction concludes that, given two propositions, ~Q and P Q, both of which are true, then the truth of the simple proposition ~P is automatically inferred. 淡江大學 資訊管理系所 侯永昌 88

Modus tollens • • • Proof: ( B ( A B ) ) A

Modus tollens • • • Proof: ( B ( A B ) ) A ( B ( A ∪ B ) ) A Implication ( B A) ∪ ( B B ) ) A Distributivity ( ( B A ) ∪ ) A Excluded middle laws ( B A ) A Identity (B A) ∪ A Implication (A B ) ∪ A De Morgan‘s laws B (A ∪ A ) Associativity B X Excluded middle laws X ===>T(X) = 1 Identity; QED 淡江大學 資訊管理系所 侯永昌 89

Modus tollens A B A B B ( A B) (B (A B) )

Modus tollens A B A B B ( A B) (B (A B) ) A 0 0 1 1 1 0 1 0 1 Tautology 1 0 0 1 1 1 0 0 1 淡江大學 資訊管理系所 侯永昌 90

Contradictions • Compound propositions that are always false, regardless of the truth values of

Contradictions • Compound propositions that are always false, regardless of the truth values of the individual simple propositions constituting the compound proposition, are called contradictions. • For examples: ~B∩B; A∩ ; ~A∩ 淡江大學 資訊管理系所 侯永昌 91

Equivalence • Propositions P and Q are equivalent, i. e. , P Q. •

Equivalence • Propositions P and Q are equivalent, i. e. , P Q. • It can be proved that the statement P Q is a tautology if P is identical to Q, when both P and Q are true or when both P and Q are false, i. e. , if and only if T(P) = T(Q). T(P) T(Q) 淡江大學 資訊管理系所 侯永昌 Fig. 7. 4 Venn diagram for equivalence (darkened areas), i. e. , for T( P Q ). 92

Equivalence • Example 7. 3. X = { 1 n 8 }, P =

Equivalence • Example 7. 3. X = { 1 n 8 }, P = ‘ n is an even number ’ and Q = (3 n 7) (n 6) T( P) = { 2, 4, 6, 8 }, T(Q) = { 3, 4, 5, 7 } The equivalence P Q has the truth set T( P Q ) = ( T( P ) ∩ T( Q ) ) ∪ ( T( P ) ∩ T( Q ) ) = { 4 } ∪ { 1 } = { 1, 4 } • Example 7. 4. P = ‘ n 2 - 6 n + 8 = 0 ’ Q = ‘ N is a positive integer power of 2 less than 7 and greater than zero ’ 淡江大學 資訊管理系所 侯永昌 93 Since T( P ) = { 2, 4 }, T( Q ) = { 2, 4 } ==> P Q

Propositions • • • Proposition : P Q Contrapositive : ~Q ~P Converse :

Propositions • • • Proposition : P Q Contrapositive : ~Q ~P Converse : Q P Inverse : ~P ~Q Dual of a compound proposition: replacing: false ( 0 ) true ( 1 ), conjunction ( ) disjunction ( ). • If a proposition is true, then its dual is also true. 淡江大學 資訊管理系所 侯永昌 94

Exclusive Or and Exclusive Nor • The exclusive nor , P “ ” Q,

Exclusive Or and Exclusive Nor • The exclusive nor , P “ ” Q, is the complement of the exclusive or, P “ ” Q • We also have P “ ” Q ( P Q ) P Q P “ ” Q T(P) T(Q) 1 1 0 1 0 0 1 Fig. 7. 5 Exclusive or 0 0 shown in gray areas. 淡江大學 資訊管理系所 侯永昌 95

Logical Proofs • The process works as follows: – The linguistic statement (compound proposition)

Logical Proofs • The process works as follows: – The linguistic statement (compound proposition) is made. – The statement is decomposed into its respective single propositions. – The statement is expressed algebraically with all pertinent logical connectives in place. – A truth table is used to establish the veracity of the statement. 淡江大學 資訊管理系所 侯永昌 96

Example 7. 5 • Hypotheses: Engineers are mathematicians. Logical thinkers do not believe in

Example 7. 5 • Hypotheses: Engineers are mathematicians. Logical thinkers do not believe in magic. Mathematicians are logical thinkers. • Conclusion: Engineers do not believe in magic. • Let us decompose this information into individual propositions. R: a person is a logical thinker, P: a person is an engineer, S: a person believes in magic Q: a person is a Mathematician • The statement can now be expressed as algebraic propositions as ( ( P Q ) ( R S ) ( Q R ) ) ( P S ) • This compound proposition is a tautology. 淡江大學 資訊管理系所 侯永昌 97

Logical Proofs • 證明一個 proposition 的方式有: – direct proof: verify it is true –

Logical Proofs • 證明一個 proposition 的方式有: – direct proof: verify it is true – indirect proof: proof by contradiction,要證 明 P Q is true,可以證明 P Q is false 淡江大學 資訊管理系所 侯永昌 98

Example 7. 6 • Hypotheses: If an arch-dam fails, the failure is due to

Example 7. 6 • Hypotheses: If an arch-dam fails, the failure is due to a poor subgrade. An arch-dam fails. • Conclusion: The arch-dam failed because of a poor subgrade. • Let us decompose this information into individual propositions. P: an arch-dam fails, Q: the failure is due to a poor subgrade • The statement can now be expressed as algebraic propositions as ( ( P Q ) P ) Q ) • To prove this by contradiction, ((P Q) P) Q) 淡江大學 資訊管理系所 侯永昌 99

Example 7. 6 • This compound proposition is a contradiction. P Q P Q

Example 7. 6 • This compound proposition is a contradiction. P Q P Q (P Q) P Q 0 0 1 1 1 0 0 1 1 0 0 1 0 淡江大學 資訊管理系所 侯永昌 100

Deductive Inferences • A rule, IF A THEN B, can be translated into a

Deductive Inferences • A rule, IF A THEN B, can be translated into a relation between sets A and B. • R = ( A B ) ∪ ( ~A Y ). • χR( x, y ) = max[(χA( x ) χB( y )), ((1 -χA( x )) 1)] • If a new antecedent, say A', is known, can we use modus ponens deduction to infer a new consequent, say B'? • The answer is yes, through the use of the composition operation. • B' = A'。R = A'。( ( A B ) ∪ ( ~A Y ) ) 淡江大學 資訊管理系所 侯永昌 101

Example 7. 7 • A heating exchanger problem with rule : If temperature is

Example 7. 7 • A heating exchanger problem with rule : If temperature is A, THEN pressure is B. 淡江大學 資訊管理系所 侯永昌 102

Deductive Inferences • The compound rule, IF A THEN B ELSE C, can also

Deductive Inferences • The compound rule, IF A THEN B ELSE C, can also be defined in terms of a matrix relation, R = (A B)∪(~A C). • The result can be shown as follows: χR(x, y) = max[(χA(x) χB(y)), ((1 -χA(x)) χC(y))] 淡江大學 資訊管理系所 侯永昌 103

Example 7. 8 • Continuity with example 7. 7 with rule : If temperature

Example 7. 8 • Continuity with example 7. 7 with rule : If temperature is A, THEN pressure is B ELSE pressure is C. 淡江大學 資訊管理系所 侯永昌 104

Classical Paradox • Liar from Crete: 當他說“All Cretians are liars”時, 是否說的是實話? • 其實,我們搞不清楚這句話是不是實話: –

Classical Paradox • Liar from Crete: 當他說“All Cretians are liars”時, 是否說的是實話? • 其實,我們搞不清楚這句話是不是實話: – 如果他說的是實話(All Cretians are liars ),那這 句話就不成立(至少他沒有說謊,NOT All Cretians are liars) – 如果這句話不成立(NOT All Cretians are liars), 他這麼說就在說謊話,自然落實了這句話(All Cretians are liars ) • If he is telling the truth, his statement is false. But if his statement is false, he is not telling the truth 淡江大學 資訊管理系所 侯永昌 105

Classical Paradox • I lie: 當我說“我說謊了”時,我到底有沒有說謊? • Let S: “I tell lies” and ~S:

Classical Paradox • I lie: 當我說“我說謊了”時,我到底有沒有說謊? • Let S: “I tell lies” and ~S: “I don't tell lies” • 如果這句話是實話(I lie),但是他告訴你“我說謊”, 那表示他沒有撒謊(I don't lie)。 S ~S • 如果這句話是謊話(I don‘t lie),表示他都說實話,不 會說謊,因此當他告訴你“我在說謊”,就是在撒謊, 因此這句話是實話(I lie) 。 ~S S • the two propositions are logically equivalent: S ~S. • Equivalent propositions have the same truth value, hence, T(S) = T(~S) = 1 - T(S) which yields the expression, T(S) = 1/2. this statement is both true and false simultaneously. 淡江大學 資訊管理系所 侯永昌 106

Classical Paradox • Russell’s barber: The barber will shave everybody who does not shave

Classical Paradox • Russell’s barber: The barber will shave everybody who does not shave himself. • Who shave the barber? • S : The barber shaves himself. ===> S ~S, ~S S ===> T(S) = 0. 5 • In classical binary logic, such conditions not allowed, only T(S) = 1 or T(S) = 0 is valid. 淡江大學 資訊管理系所 侯永昌 107

Fuzzy Logic • A fuzzy logic proposition, P, is a statement involving some concept

Fuzzy Logic • A fuzzy logic proposition, P, is a statement involving some concept without clearly defined boundaries. The truth value assigned to P can be any value on the interval [0, 1]. T(P) = μA(x) where 0 μA(x) 1 The degree of truth for the proposition P: x A is equal to the membership grade of x in the fuzzy set A 淡江大學 資訊管理系所 侯永昌 109

Logic Connectives • Negation • Disjunction T(~P) = 1 - T(P) P Q :

Logic Connectives • Negation • Disjunction T(~P) = 1 - T(P) P Q : x is A or B T(P Q) = max(T(P), T(Q)) • Conjunction P Q : x is A and B T(P Q) = min(T(P), T(Q)) • Implication P Q : x is A then x is B T(P Q) = T(~P Q) = max(T(~P), T(Q)) (Proposition P defined on set A and proposition Q on set B) 淡江大學 資訊管理系所 侯永昌 110

Example 7. 9 • Evaluate a new invention to determine its commercial potential. •

Example 7. 9 • Evaluate a new invention to determine its commercial potential. • rule : If medium uniqueness, THEN medium market size. • A = medium uniqueness = • B = medium market size = 淡江大學 資訊管理系所 侯永昌 112

Approximate Reasoning • Given a rule, IF x is A, THEN y is B,

Approximate Reasoning • Given a rule, IF x is A, THEN y is B, and a new antecedent, say A', what is the consequent B'? ===> fuzzy composition, B' = A'。R 淡江大學 資訊管理系所 侯永昌 114

Example 7. 10 (Continuing with example 7. 9) • • The consequent is fairly

Example 7. 10 (Continuing with example 7. 9) • • The consequent is fairly diffuse, there is no strong (or weak) membership value for any of the market size scores。表示這一個 rule (medium uniqueness) 所建 的 relation 並不合適,因為他本來就不是為這一個 class 的資料 (almost high uniqueness) 來建的。應該 還要將別的 rule 的 relation 併進系統中來考慮 淡江大學 資訊管理系所 侯永昌 115

Example 7. 11 A fuzzy logic-based train • desired operation speed and direction Urban

Example 7. 11 A fuzzy logic-based train • desired operation speed and direction Urban Train Motor Controller Motor torque Clockwise or anticlockwise • Fuzzy inference rules may be developed as follows: (1) If desired operation is slow speed, THEN motor speed is mostly counterclockwise. • A = slow speed = • B = mostly counterclockwise = 淡江大學 資訊管理系所 侯永昌 116

Example 7. 11 (2) If desired operation is slow speed, THEN motor speed is

Example 7. 11 (2) If desired operation is slow speed, THEN motor speed is mostly counterclockwise, ELSE motor speed is around neutral direction. • C = around neutral direction = 淡江大學 資訊管理系所 侯永昌 119

Example 7. 12 Human visual system • rule : If weak stimulus THEN not

Example 7. 12 Human visual system • rule : If weak stimulus THEN not severe response. W = weak stimulus = S = severe response = 淡江大學 資訊管理系所 侯永昌 120

Example 7. 12 Human visual system • IF M = medium stimulus = •

Example 7. 12 Human visual system • IF M = medium stimulus = • The result might be labeled linguistically as “no measurable response. ” 淡江大學 資訊管理系所 侯永昌 121

Approximate Reasoning • Suppose we use the original antecedent A in the fuzzy composition.

Approximate Reasoning • Suppose we use the original antecedent A in the fuzzy composition. Do we get the original fuzzy consequent, B, as a result of the operation? ===> The answer is NO! • In classical binary logic, this inverse do exist. • In the case of approximate reasoning, the fuzzy inference is not precise but rather is approximate. That is, the composition operation does not have a unique inverse. 淡江大學 資訊管理系所 侯永昌 122

Example 7. 13 (Continuing with example 7. 9) • If A’ = A =

Example 7. 13 (Continuing with example 7. 9) • If A’ = A = medium uniqueness = 淡江大學 資訊管理系所 侯永昌 123

Example 7. 14 • The occlusion can occur when a tracked particle is behind

Example 7. 14 • The occlusion can occur when a tracked particle is behind another particle, or behind a mark on the camera‘s lens. • rule : If occlusion due to particle occlusion is moderate, THEN image quality will be similar to moderate lens obstruction. • A = tracked particle moderately occluded behind another particle = • B = len mark associated with moderate image quality = 淡江大學 資訊管理系所 侯永昌 124

Example 7. 14 • IF A’ = a slight bit more occlusion = •

Example 7. 14 • IF A’ = a slight bit more occlusion = • This image quality, B’ , is more fuzzy than B, as indicated by the former‘s membership function. 淡江大學 資訊管理系所 侯永昌 125

Fuzzy Tautologies A B A (A B) 0. 3 0. 2 0. 7 0.

Fuzzy Tautologies A B A (A B) 0. 3 0. 2 0. 7 0. 3 0. 8 0. 3 0. 7 0. 2 0. 7 0. 8 0. 3 0. 7 (A (A B)) B 0. 7 0. 8 Quasi tautology 0. 7 0. 8 • How can these numbers be interpreted? 以 lower bound 和 upper bound 的值來表示 quasi tautology 的範圍 淡江大學 資訊管理系所 侯永昌 126

Fuzzy Contradictions & Equivalence • The truth value of a contradiction is no longer

Fuzzy Contradictions & Equivalence • The truth value of a contradiction is no longer zero. 例:T(B) = 0. 6,T(~B) = 0. 4,~B∩B = min(0. 4, 0. 6) = 0. 4 • Equivalence : if the truth values of the two propositions are identical. • Equivalence in the fuzzy realm can only be thought of in an approximate sense. So, if the truth values of two propositions are equal is 0. 3, then they are equivalent (quasi equivalent) at that degree of membership. 淡江大學 資訊管理系所 侯永昌 127

Fuzzy Theorem Proof? • Theorem proving takes on a whole new context in the

Fuzzy Theorem Proof? • Theorem proving takes on a whole new context in the fuzzy domain. What does it mean to prove a theorem approximate? • Theorems, by definition, have to be tautologies. • Hence, the proof that a theorem is a quasi tautology would not produce a result that is true under any circumstance. It seems that fuzzy theorem proving might not be useful in developing irrefutable corollaries, lemmas, and so forth. 淡江大學 資訊管理系所 侯永昌 128

Other Forms of the Implication Operation • IF A THEN B, or R =

Other Forms of the Implication Operation • IF A THEN B, or R = A B (1) μR(x, y) = max {min [μA(x) , μB(y)], 1 -μA(x)} – classical implication by Zadeh (2) μR(x, y) = max {μB(y), 1 -μA(x)} – equivalent to (1) if μB(y) μA(x) (3) μR(x, y) = min [μA(x) , μB(y)] – correlation-minimum or Mamdani's implication in system control – alternative of (1) for μB(y) 0. 5 and μA(x) 0. 5 (4) μR(x, y) = min {1, [1 -μA(x) +μB(y)]} – Lukasiewicz' implication 淡江大學 資訊管理系所 侯永昌 129

Other Forms of the Implication Operation (5) μR(x, y) = min {1, [μA(x) +μB(y)]}

Other Forms of the Implication Operation (5) μR(x, y) = min {1, [μA(x) +μB(y)]} – bounded sum implication (6) μR(x, y) = min {1, [μB(y)/μA(x)]}, μA(x) > 0 – by Goguen 1969 (7) μR(x, y) = max {μA(x) μB(y), [1 -μA(x)]} – correlation-product implication (8) μR(x, y) =μA(x) μB(y) – correlation-product implication (7 - 8) trend to dilute the influence of joint membership value that are small. 不會因為一個太小的值而影響 到整個運算 淡江大學 資訊管理系所 侯永昌 130

Other Forms of the Implication Operation (9) μR(x, y) = 1, for μA(x) μB(y)

Other Forms of the Implication Operation (9) μR(x, y) = 1, for μA(x) μB(y) =μB(y), otherwise – Brouwerian implication [by Sanitize 1976] (10) μR(x, y) = 1, for μA(x) μB(y) = 0, otherwise – R-SEQ (standard sequence logic) implication • The appropriate choice of an implication operation is a matter left to the analyst, since it is typically context-dependent. 淡江大學 資訊管理系所 侯永昌 131

Other Forms of the Composition Operation • B = A。R • max-min μB(y) =

Other Forms of the Composition Operation • B = A。R • max-min μB(y) = {min [μA(x), μR(x, y)]} • max-product μB(y) = [μA(x).μR(x, y)] • min-max μB(y) = {max [μA(x), μR(x, y)]} • max-max μB(y) = {max [μA(x), μR(x, y)]} • min-min μB(y) = {min [μA(x), μR(x, y)]} • max-average μB(y) = [μA(x) +μR(x, y)] • sum-product μB(y) = f {[μA(x).μR(x, y)]} 淡江大學 資訊管理系所 侯永昌 132

Other Forms of the Composition Operation • sum-product μB(y) = f {[μA(x).μR(x, y)]} where

Other Forms of the Composition Operation • sum-product μB(y) = f {[μA(x).μR(x, y)]} where f(.) is a logistic function (like a sigmoid or a step function) that limits the value of the function within the interval [0, 1]. This composition method is commonly used in applications of artificial neural networks for mapping between parallel layers in a multi-layer network. 淡江大學 資訊管理系所 侯永昌 133

Other Forms of the Composition Operation • Max-min and max-product methods of composition of

Other Forms of the Composition Operation • Max-min and max-product methods of composition of fuzzy relations are the two most commonly used techniques. • Many have claimed that max-min method of composition effectively expresses the approximate and interpolative reasoning used by humans when they employ linguistic propositions for deductive reasoning. • Each method reflects a special inference machine and has its own significance and applications. 淡江大學 資訊管理系所 侯永昌 134

Chapter 8 Fuzzy Rule-Based Systems 淡江大學 資訊管理系所 侯永昌 135

Chapter 8 Fuzzy Rule-Based Systems 淡江大學 資訊管理系所 侯永昌 135

Natural language • Natural language, despite its vagueness and ambiguity, is the vehicle for

Natural language • Natural language, despite its vagueness and ambiguity, is the vehicle for human communication, and a mathematical theory that deals with fuzziness and ambiguity seems appropriate to express and interpret the linguistic character of our language. 淡江大學 資訊管理系所 侯永昌 136

Natural language • The use of natural language in the expression of a knowledge

Natural language • The use of natural language in the expression of a knowledge form known as rule-based systems. Several issues are considered: – the decomposition of compound rules into canonical forms and the treatment of canonical rule forms as logical propositions is addressed. – the characterization of the confidence in a particular rule is addressed using truth qualifications. – the expression of rules as a collection of logic implications being manipulated by some inferring scheme is also introduced. 淡江大學 資訊管理系所 侯永昌 137

Natural language • Cognitive scientists tell us that humans base their thinking primarily on

Natural language • Cognitive scientists tell us that humans base their thinking primarily on conceptual patterns and mental images, known as frames in expert system paradigm, rather than on any numerical quantities. • Furthermore, humans communicate with their own natural language by referring to previous mental images with rather vague but simple terms. • The natural language can be broken down into fundamental terms and certain linguistic connectors of those terms. our language sentences a set of terms (very old and fat horse) atomic terms (fat, old) 淡江大學 資訊管理系所 侯永昌 138

Natural language • We can give each atomic terms an interpretation which can be

Natural language • We can give each atomic terms an interpretation which can be represented as a fuzzy set. • Example: Suppose we have the atomic term "young" and we want to interpret this linguistic atom in terms of age, y, by a membership function that expresses the term "young". One interpretation of the term young expressed as a function of age, 淡江大學 資訊管理系所 侯永昌 139

Natural language • The interpretation of the composite of two atomic terms, and ,

Natural language • The interpretation of the composite of two atomic terms, and , defined on the universe X, can be expressed by the following settheoretic operations: • or or (y) = max( (y), (y)) • and (y) = min( (y), (y)) • Not = ~ ~ (y) = 1 - (y) 淡江大學 資訊管理系所 侯永昌 140

Linguistic Hedges • In linguistics, fundamental atomic terms are often modified or hedged with

Linguistic Hedges • In linguistics, fundamental atomic terms are often modified or hedged with adjectives or adverbs like very, low, fairly, . . . These modifiers are called "linguistic hedges" which have the effect of modifying the membership function for a basic atomic term. 淡江大學 資訊管理系所 侯永昌 141

Linguistic Hedges • Composite terms can be formed from one or more combinations of

Linguistic Hedges • Composite terms can be formed from one or more combinations of atomic terms, logical connectives, and linguistic hedges. • Precedence Operation First Hedge, Not Second And Third Or • Parentheses may be used to change the precedence order and ambiguities may be resolved by the use of association-to-the-right. 淡江大學 資訊管理系所 侯永昌 145

Linguistic Hedges • “Small” = • “Large” = • “Very small” = “small” 2

Linguistic Hedges • “Small” = • “Large” = • “Very small” = “small” 2 = • “Not very small” = 1 - “very small” = • “Not very, very large” = 1 - “large” 4 = 淡江大學 資訊管理系所 侯永昌 146

Linguistic Hedges • = “Not very small and not very, very large” • “Intensely

Linguistic Hedges • = “Not very small and not very, very large” • “Intensely small” 淡江大學 資訊管理系所 侯永昌 147

Example 8. 2 • “likely” = • “highly” = “minus very” = (very) 0.

Example 8. 2 • “likely” = • “highly” = “minus very” = (very) 0. 75 • “unlikely” = “not likely” = “ 1 - likely” • “very likely” = “likely” 4 = • “highly unlikely” = “minus very unlikely” 淡江大學 資訊管理系所 侯永昌 148

Rule-Based Systems • The most common way to represent human knowledge is to form

Rule-Based Systems • The most common way to represent human knowledge is to form it into natural language expressions of the type, IF premise (antecedent), THEN conclusion (consequent) • The IF-THEN rule-based form is quite appropriate in the context of linguistics because it expresses human empirical and heuristic knowledge - shallow knowledge. 淡江大學 資訊管理系所 侯永昌 149

Canonical Rule Forms • 與語言變數有關的 statement 有下列三類: (1) Assignment statements, x = large, Banana‘s

Canonical Rule Forms • 與語言變數有關的 statement 有下列三類: (1) Assignment statements, x = large, Banana‘s color = yellow, x s, x is not large and not very small, Season = winter, Outside temperature = hot (2) Conditional statements IF the tomato is red THEN the tomato is ripe IF x is very hot THEN stop IF x is large THEN y is small ELSE y is not small (3) Unconditional statements Go to 9, Stop, Divide by x, Turn the pressure higher 淡江大學 資訊管理系所 侯永昌 150

Canonical Rule Forms • Assignment statement 只是給定變數一個值的 statement,也可以視為是一種 Unconditional statement。而 Unconditional statement 則可以視為是 前提一定是

Canonical Rule Forms • Assignment statement 只是給定變數一個值的 statement,也可以視為是一種 Unconditional statement。而 Unconditional statement 則可以視為是 前提一定是 True 的 Conditional statement • output is low IF any condition THEN output is low • go to 9 IF any condition THEN go to 9 • 因此所有 statements 的形態都可以轉變成 conditional statements 的標準形式: Canonical Form IF condition C 1 THEN restriction R 1. IF condition C 2 THEN restriction R 2. 淡江大學 資訊管理系所 侯永昌 151

Decomposition of Compound Rules (1) Multiple conjunctive antecedents IF x is A 1 and

Decomposition of Compound Rules (1) Multiple conjunctive antecedents IF x is A 1 and A 2 . . . and AL THEN y is Bs Let As = A 1 ∩ A 2 ∩. . . ∩ AL, μAs(x) = min [μA 1(x), μA 2(x), . . . , μAL(x)) ===> IF As THEN Bs (2) Multiple disjunctive antecedents IF x is A 1 OR x is A 2 . . . OR x is AL THEN y is Bs could be written as IF As THEN Bs where As = A 1 ∪ A 2 ∪. . . ∪ AL and μAs(x) = max [μA 1(x), μA 2(x), . . . , μAL(x)) 淡江大學 資訊管理系所 侯永昌 152

Decomposition of Compound Rules (3) Conditional statements with ELSE and UNLESS (a) IF A

Decomposition of Compound Rules (3) Conditional statements with ELSE and UNLESS (a) IF A 1 THEN B 1 ELSE B 2 IF A 1 THEN B 1 OR IF NOT A 1 THEN B 2 (b) IF A 1 THEN B 1 UNLESS A 2 IF A 1 THEN B 1 OR IF A 2 THEN NOT B 1 (c) IF A 1 THEN B 1 ELSE (IF A 2 THEN B 2 ) IF A 1 THEN B 1 OR IF NOT A 1 AND A 2 THEN B 2 (4) Nested IF-THEN rules IF A 1 THEN ( IF A 2 THEN B 1 )) ==> IF A 1 AND A 2 THEN B 1 淡江大學 資訊管理系所 侯永昌 153

Decomposition of Compound Rules • When rules are decomposed into a series of canonical

Decomposition of Compound Rules • When rules are decomposed into a series of canonical forms, each of these forms is an implication, and we can then reduce the rules to a series of relations. 淡江大學 資訊管理系所 侯永昌 154

Aggregation of Fuzzy Rules • 通常 rule-based system 都有很多的 rules,因此最後的 結果是所有 rules 組合而成的結果。組合的方式有: (a)

Aggregation of Fuzzy Rules • 通常 rule-based system 都有很多的 rules,因此最後的 結果是所有 rules 組合而成的結果。組合的方式有: (a) Conjunctive system of rules : rules must be jointly satisfied y = y 1 and y 2 and … and y r = y 1 y 2 … y r (b) Disjunctive system of rules : the satisfaction of at least one rule is required y = y 1 or y 2 or … or y r = y 1 y 2 … y r 淡江大學 資訊管理系所 侯永昌 155

Likelihood and Truth Qualification • 針對一個 rule:If x is A THEN y is B,如果

Likelihood and Truth Qualification • 針對一個 rule:If x is A THEN y is B,如果 x 真的是 A,那 y 當然是 B。但是,如果 x 不 真的是 A,只是有點像 A,那 y 也就不見得 真的是 B 了。x 到底有多像 A,是由 membership value 來決定,它有多像 A ,y 就 應該有多像 B • The fuzzy conditional statement: IF A THEN B are transformed to a fuzzy relation R = ~A ∪ B 淡江大學 資訊管理系所 侯永昌 156

Graphical Techniques of Inference • 假設:A fuzzy system with two noninteractive inputs x 1

Graphical Techniques of Inference • 假設:A fuzzy system with two noninteractive inputs x 1 and x 2 (antecedents) and a single output y (consequent) is described by a collection of r linguistic IF-THEN propositions: • IF x 1 is A 1 k and x 2 is A 2 k THEN y is Bk, for k = 1, 2, . . . , r • where A 1 k and A 2 k are the fuzzy sets representing the kth antecedent pairs, and Bk are the fuzzy sets representing the kth consequent. 淡江大學 資訊管理系所 侯永昌 158

General Steps for Graphical Inference 1. Based on the inputs, to calculate the membership

General Steps for Graphical Inference 1. Based on the inputs, to calculate the membership value of each antecedent 2. Applying the proper implication method, to derive the membership value of the consequent by propagating the result of antecedents through to the consequent and truncating (or scaling) the membership function for the consequent of each rule. 3. Based on the conjunction or disjunction of rules, to aggregate (min or max) the consequents of all rules 4. If a crisp value for the aggregated output is desired, an appropriate defuzzification technique could be employed. 淡江大學 資訊管理系所 侯永昌 159

General Steps for Graphical Inference • Case 1: inputs: crisp values, inference method: max-min

General Steps for Graphical Inference • Case 1: inputs: crisp values, inference method: max-min 1. 計算每一個 rule 的 antecedent 的隸屬度,找出它的 最小值 2. 每一個 rule 的 consequent 的隸屬度最多也只能等 於 antecedent 的隸屬度,多餘的部分就會被截掉 3. 利用 disjunction of rules,組合每一個 rule 的 consequents 的部分 4. 利用 defuzzification technique 求出一個代表性的值 淡江大學 資訊管理系所 侯永昌 160

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 161

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 161

General Steps for Graphical Inference • Case 2: inputs: crisp values, inference method: max-product

General Steps for Graphical Inference • Case 2: inputs: crisp values, inference method: max-product 1. 計算每一個 rule 的 antecedent 的隸屬度,找出它的 最小值 2. 每一個 rule 的 consequent 的隸屬度等比例於 antecedent 的隸屬度 3. 利用 disjunction of rules,組合每一個 rule 的 consequents 的部分 4. 利用 defuzzification technique 求出一個代表性的值 淡江大學 資訊管理系所 侯永昌 162

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 163

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 163

General Steps for Graphical Inference • Case 3: inputs: fuzzy variables, inference method: max-min

General Steps for Graphical Inference • Case 3: inputs: fuzzy variables, inference method: max-min 1. 因為輸入是 fuzzy value,因此利用 max-min 的方 式計算每一個 rule 的 antecedent 的隸屬度,找出它 的最小值 2. 每一個 rule 的 consequent 的隸屬度最多也只能等 於 antecedent 的隸屬度,多餘的部分就會被截掉 3. 利用 disjunction of rules,組合每一個 rule 的 consequents 的部分 4. 利用 defuzzification technique 求出一個代表性的值 淡江大學 資訊管理系所 侯永昌 k = 1, 2, …, r 164

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 165

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 165

General Steps for Graphical Inference • Case 4: inputs: fuzzy variables, inference method: max-product

General Steps for Graphical Inference • Case 4: inputs: fuzzy variables, inference method: max-product 1. 因為輸入是 fuzzy value,因此利用 max-min 的方 式計算每一個 rule 的 antecedent 的隸屬度,找出它 的最小值 2. 每一個 rule 的 consequent 的隸屬度等比例於 antecedent 的隸屬度 3. 利用 disjunction of rules,組合每一個 rule 的 consequents 的部分 4. 利用 defuzzification technique 求出一個代表性的值 淡江大學 資訊管理系所 侯永昌 k = 1, 2, …, r 166

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 167

General Steps for Graphical Inference 淡江大學 資訊管理系所 侯永昌 167

Example 8. 4 • In mechanics, the kinetic energy k is given by the

Example 8. 4 • In mechanics, the kinetic energy k is given by the equation. • Rule 1: IF x 1 is (small mass) and x 2 is (high velocity), THEN y is (medium energy). • Rule 2: IF x 1 is (large mass) or x 2 is (medium velocity), THEN y is (high energy). • The minimum or maximum of the two membership values is propagated to the consequent depending on whether the and or or connective, respectively, is used between the two antecedents in the rule. 淡江大學 資訊管理系所 侯永昌 168

Example 8. 4 • Let input(i) = 0. 35 kg (mass) and input(j) =

Example 8. 4 • Let input(i) = 0. 35 kg (mass) and input(j) = 55 m/s (velocity) in Fig. 8. 11 -12. • Let input(i) = mass is approximately equal to 0. 35 kg and input(j) = velocity is approximately equal to 55 m/s in Fig. 8. 13 -14. 淡江大學 資訊管理系所 侯永昌 169

Summary • The vagueness present in the definition of terms is consistent with the

Summary • The vagueness present in the definition of terms is consistent with the information contained in the conditional rules developed by engineer when observing some complex process. • Fuzzy mathematical tools and the calculus of fuzzy IF-THEN rules provide a most useful paradigm for the automation and implementation. They provide a means of sharing, communicating, and transferring this human subjective knowledge of systems and processes. 淡江大學 資訊管理系所 侯永昌 174

Summary • The subjectivity that exists in fuzzy modeling is a blessing rather than

Summary • The subjectivity that exists in fuzzy modeling is a blessing rather than curse. • The power of fuzzy rule-based systems is their ability to yield good results with reasonably simply mathematical operations. 淡江大學 資訊管理系所 侯永昌 175