Seminar Introduction to Fuzzy Logic I Itziar García-Honrado European Centre for Soft-Computing Mieres (Asturias) Spain 05/04/2011 Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 1 / 50
Figure: Crisp Figure: Fuzzy Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 2 / 50
Control Systems I Figure: Washing machine Figure: Rice cooker Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 3 / 50
Control Systems II Figure: Unmanned helicopter Figure: Tensiometer Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 4 / 50
Control Systems III Figure: Inverted pendulum Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 5 / 50
Control Systems IV Example A system with two continuous variables x, y [0, 1], described by 2 rules, r 1 : If x is big, then y is small r 2 : If x is very small, then y is very big What is the output for the input x=0.4? Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 6 / 50
Control Systems V Esquema Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 7 / 50
How to represent predicates? I P is perceptive relation L-degrees µ Pi : X L (i = 1, 2, 3), where L is an ordered structure. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 8 / 50
How to represent predicates? II Types of predicates: Rigid: consists in two classes. For instance, To be even Semirigid: consists in a finite number of classes Imprecise: consists in infinite classes. For instance, tall. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 9 / 50
How to represent predicates? III Rigid Crisp P = To be 8 Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 10 / 50
How to represent predicates? IV Semirigid Finite number of classes Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 11 / 50
How to represent predicates? V Each predicate P, could be represented by many fuzzy sets depending on its use) Philosophical investigations, Wittgenstein (1953): The meaning of a predicate is its use in Language Different models of P=small in X = [0, 10], with L = [0, 1] depending on the use of P. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 12 / 50
How to represent predicates? VI Each use of the predicate is represented by a curve (by a fuzzy set). µ : X [0, 1] A [0, 1]-degree µ P is any function X [0, 1], such that If x P y, then µ P (x) µ P (y), It the inverse order introduce by the predicate 1 P x 1 P y y P x. is defined as So, x = P y iff x P and x 1 P. If µ P (x) = r, it is said that x r P. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 13 / 50
How to represent predicates? VII Design the representation of the predicate: Context, purpose, use,... Example Predicate tall in two different contexts, in a school or in a basketball team. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 14 / 50
How to represent predicates? VIII Family resemblance in [0, 1] X, fr F (X ) F (X ) (read (µ, σ) fr: µ and σ show family resemblance) 1) Z(µ) Z(σ), S(µ) S(σ) 2) µ is non-decreasing in A X (µ, σ) fr σ is non-decreasing in A 3) µ is decreasing in A X σ is decreasing in A S(µ) = {x X ; µ(x) = 1} and Z(µ) = {x X ; µ(x) = 0}. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 15 / 50
How to represent predicates? IX example 1 Z(µ) Z(σ) = [0, 2] S(µ) S(σ) = {10} (µ, σ) fr example 2 S(µ) S(σ) = (µ, σ) / fr Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 16 / 50
Opposite and negate I Opposite or antonym P even tall small ap odd short big Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 17 / 50
Opposite and negate II Concerning the opposite ap of P, this opposition is translated by ap = 1 P Hence, a(ap) = 1 ap = ( 1 P ) 1 = P, that forces a(ap) = P. For example, with P =tall, it is ap = short and a(ap) = tall. This property of ap shows a way for obtaining µ ap once µ P is known. Let it A : X X be a symmetry on X, that is a function such that If x P y, then A(y) P A(x) A A = id X, Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 18 / 50
Opposite and negate III Once µ P : X L is known, take µ ap (x) = µ P (A(x)), for all x in X, that is, µ ap = µ P A. Function µ ap = µ P A is a degree for ap, since: x ap y y P x A(x) P A(y) µ P (A(x)) µ P (A(y)), and verifies, µ a(ap) = µ (ap) A = (µ P A) A = µ P (A A) = µ P id X = µ P. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 19 / 50
Opposite and negate IV Example Opposite of small A? Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 20 / 50
Opposite and negate V Example 2 Opposite of around 4 A(x) = 10 x Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 21 / 50
Opposite and negate VI Example 2 Opposite of around 4 A(x) = { 4 x, if x 4 14 x, if otherwise Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 22 / 50
Opposite and negate VII Let it P be a predicate in X, and P =notp its negate. Concerning the negation P of P, this negation is translated by Since, P 1 P If x is less P than y, then y is less not P than x, or, equivalently, P 1 P. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 23 / 50
Opposite and negate VIII Let it N : L L be a function such that 1. If a b, then N(b) N(a), for all a, b in L 2. N(α) = ω, and N(ω) = α, being α the infimum and ω the supremum of L. with such a function N, it is an L-degree for P, since µ P = N µ P x P y y P x µ P (y) µ P (x) N(µ P (x)) N(µ P (y)) µ P (x) µ P (y). Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 24 / 50
Opposite and negate IX Provided the negation function does verify 3. N N =id L, then µ (P ) (x) = N(µ P (x)) = N(N(µ P(x))) = (N N)(µ P (x)) = id L (µ P (x)) = µ P ( for all x in X, or µ (P ) = µ P. Functions N verifying (1), (2), and (3) are called strong negations Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 25 / 50
Opposite and negate X If L = [0, 1], there is a family of strong negations widely used in fuzzy set theory, the so-called Sugeno s negations: N λ (a) = 1 a, with λ > 1, for all a [0, 1]. 1 + λa For example, N(a) = 1 a, N 1 (a) = 1 a 1+a, N 0.5 = 1 a 1 0.5a, N 2(a) = 1 a etc. Since obviously, N λ1 N λ2 λ 2 λ 1, it results: If λ ( 1, 0], then N 0 N λ If λ (0, + ], then N λ < N 0. 1+2a, Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 26 / 50
Opposite and negate XI Graphically, Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 27 / 50
Opposite and negate XII With N 0 (a) = 1 a, and A(x) = 10 x in X = [0, 10], if results whose graphics 0, if x [0, 4] x 4 µ big (x) = 4, if [4, 8] 1, if x [8, 10], 0, if x [6, 10] 6 x µ small (x) = µ big (10 x) = 4, if [2, 6] 1, if x [0, 2], 1, if x [0, 4] 8 x µ not big (x) = 1 µ big (x) = 4, if [4, 8] 0, if x [8, 10], Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 28 / 50
Opposite and negate XIII show that the pair (big, small) is coherent, since µ small µ not big. Notice that µ ap µ P Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 29 / 50
Opposite and negate XIV Remarks Notice that µ ap µ P a(ap) = P, but not always (P ) = P. (empty/full) Notice the main difference of a symmetry and a negation A : X X and N : L L Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 30 / 50
Union and intersection I Let P, Q be two predicates in X. Consider the new predicates P and Q, and P or Q, used by means of: x is P and Q x is P and x is Q x is P or Q Not (Not x is P and Not x is Q ). (Duality) Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 31 / 50
Union and intersection II Intersection Take L-degrees µ P, µ Q. Given (L, ), let : L L L be an operation, verifying the properties a b, c d a c b d a c a, a c c, Then, µ P (x) µ Q (x) is an L-degree for P and Q in X, since: x P and Q y x P y and x Q y µ P (x) µ P (y) and µ Q (x) µ Q (y) µ P (x) µ Q (x) µ P (y) µ Q (y). Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 32 / 50
Union and intersection III Hence, µ P (x) µ Q (x) = µ P and Q (x), is an L-degree for P and Q in X, and the operation can be called an and-operation. Notice that it is, µ P and Q (x) µ P (x), and µ P and Q (x) µ Q (x). Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 33 / 50
Union and intersection IV If is an and-operation, and N : L L is a strong negation, define a b = N(N(a) N(b)), for all a, b L. Since a b, c d N(b) N(a), N(d) N(c) N(b) N(d) N(a) N(c) N(N(a) N(c)) N(N(b) N(d)), it results a c b d. Analogously, from N(a) N(b) N(a), it follows a N(N(a) N(b)) = a b, and b a b, for all a, b. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 34 / 50
Union and intersection V Then, µ P (x) µ Q (x) is an L-degree for P or Q. x P or Q y x (P and Q ) y y P and Q x µ P and Q (y) µ P and Q (x) µ P (y) µ Q (y) µ P (x) µ Q (x) N(µ P (y)) N(µ Q (y)) N(µ P (x)) N(µ Q (x)) N(N(µ P (x)) N(µ Q (x)) N(N(µ P (y)) N(µ Q (y)) µ P (x) µ Q (x) µ P (y) µ Q (y). Hence, µ P (x) µ Q (x) can be taken as an L-degree for P or Q in X, and the operation can be called an or-operation. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 35 / 50
Union and intersection VI Remark The existence of operations and in L, warrants the existence of L-degrees for and, or, respectively. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 36 / 50
Union and intersection VII In fact, other basic properties of and are collected in the definition of A Basic Flexible Algebra (BFA). A BFA is a seven-tuple L = (L,, 0, 1;,, ), where L is a non-empty set, and 1 (L, ) is a poset with minimum 0, and maximum 1. 2 and are mappings (binary operations) L L L, such that: 1 a 1 = 1 a = a, a 0 = 0 a = 0, for all a L 2 a 1 = 1 a = 1, a 0 = 0 a = a, for all a L 3 If a b, then a c b c, c a c b, for all a, b, c L 4 If a b, then a c b c, c a c b, for all a, b, c L 3 : L L verifies 1 0 = 1, 1 = 0 2 If a b, then b a 4 It exists L0, {0, 1} L 0 L, such that with the restriction of the order and the three operations,, and of L, L 0 = (L 0,, 0, 1;,, ) is a boolean algebra Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 37 / 50
Union and intersection VIII for fuzzy sets (T-norms) A continuous t-norm is with mappings T : [0, 1] [0, 1] [0, 1] verifying the following properties, Continuity in both variables Associativity T (T (x, y), z) = T (x, T (y, z)), x, y, z [0, 1] Commutativity T (x, y) = T (y, x) x [0, 1] Monotonicity T (x, y) T (z, t) if x z, y t T (x, 1) = x, x [0, 1] T (x, 0) = 0, x [0, 1] Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 38 / 50
Union and intersection IX for fuzzy sets (T-conorms) A continuous t-conorm is with mappings S : [0, 1] [0, 1] [0, 1] verifying the following properties, Continuity in both variables Associativity S(S(x, y), z) = S(x, S(y, z)), x, y, z [0, 1] Commutativity S(x, y) = S(y, x) x [0, 1] Monotonicity S(x, y) S(z, t) if x z, y t S(x, 0) = x, x [0, 1] S(x, 1) = 1, x [0, 1] Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 39 / 50
Union and intersection X Medium Given P, if MP = Not P and Not ap, with N for not, A for the opposite, and for and, results µ MP (x) = µ P and (ap) (x) = µ P (x) µ (ap) (x) = N(µ P(x)) N(µ P (A(x))), for all x in X. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 40 / 50
Modifiers I Linguistic modifiers or linguistic hedges, m, are adverbs acting on P just in the concatenated form mp. For example, with m =very and P= tall, it is mp = very tall. Among linguistic modifiers there are two specially interesting types: Expansive modifiers, verifying id µp (x) µ m, Contractive modifiers, verifying µ m id µp (x). Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 41 / 50
Modifiers II With the expansive, it results id µp (x)(µ P (x)) = µ P (x) µ m (µ P (x)) = µ mp (x) : µ P (x) µ mp (x), for all x in X. With the contractive, it results µ mp (x) = µ m (µ P (x)) id µp (x)(µ P (x)) = µ P (x) : µ mp (x) µ P (x),for all x in X. In L = [0, 1] with the Zadeh s old definitions, µ more or less (a) = a, µ very (a) = a 2. Which one is contractive? Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 42 / 50
Linguistic Variable I A linguistic variable LV is formed after considering 1 Its principal predicate, P 2 One of the opposites of P, ap 3 Some linguistic modifiers m1,..., m n, and by adding: 4 Its negate (not P), or the middle-predicate (MP), or P and Q, or not m 1 P, or P and m 2 ap,... Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 43 / 50
Linguistic Variable II Then LV, is called the linguistic variable generated by P, and reflects the linguistic granulation perceived for the concept. For example, LV=Age, is Age= { young, old, middle-aged, not old, not very young,..} LV=Temperature, is Temp= { cold, hot, warm, not cold, not very hot,..} LV=Size, is Size= {large, small, medium, very large,..} Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 44 / 50
Linguistic Variable III Usually in fuzzy control are used only three labels, for instance: Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 45 / 50
Extension Principle I Extension Principle : R R R, can be extended to : [0, 1] R [0, 1] R [0, 1] R, by means of Extension Principle (µ σ)(t) = Sup min(µ(x), σ(y)). t=x y Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 46 / 50
Extension Principle II Example extending the operation of + Let s calculate the sum for the following fuzzy sets: Since, µ = 0/0 + 1/1 + 0/3 + 0/4 σ = 0/0 + 0/1 + 0.5/2 + 1/3 + 0/4 µ σ = 0/0 + 0/1 + 0/2 + 0.5/3 + 1/4 + 0.5/5 + 0/6 (µ σ)(0) = Sup min(µ(x), σ(y)) = Sup(min(µ(0), σ(0))). 0=x y (µ σ)(1) = Sup min(µ(x), σ(y)) = 1=x y Sup(min(µ(1), σ(0)), min(µ(0), σ(1))) = Sup(0, 0) = 0. (µ σ)(2) = Sup min(µ(x), σ(y)) = 2=x y Sup(min(µ(2), σ(0)), min(µ(0), σ(2)), min(µ(1), σ(1))) = Sup(0, 0, 0) = 0. Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 47 / 50
Extension Principle III (µ σ)(3) = Sup min(µ(x), σ(y)) = 3=x y Sup(min(µ(3), σ(0)), min(µ(0), σ(3)), min(µ(1), σ(2)), min(µ(2), σ(1))) = Sup(0, 0, 0.5, 0) = 0.5. (µ σ)(4) = Sup min(µ(x), σ(y)) = 3=x y Sup(min(µ(4), σ(0)), min(µ(0), σ(4)), min(µ(1), σ(3)), min(µ(3), σ(1)), min(µ(2), σ(2))) = Sup(0, 0, 1, 0.5, 0) = 1.... Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 48 / 50
Extension Principle IV Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 49 / 50
Thanks for your atention! Itziar García-Honrado (ECSC) Fuzzy Logic 05/04/2011 50 / 50