Models for Inexact Reasoning
Fuzzy Logic – Lesson 1
Crisp and Fuzzy Sets
Master in Computational Logic
Department of Artificial Intelligence
Origins and Evolution of Fuzzy Logic
• Origin: Fuzzy Sets Theory (Zadeh, 1965)
• Aim: Represent vagueness and impre-cission of statements in natural language
• Fuzzy sets: Generalization of classical (crisp) sets
• In the 70s: From FST to Fuzzy Logic
• Nowadays: Applications to control systems
– Industrial applications
– Domotic applications, etc.
Fuzzy Logic
Fuzzy Logic - Lotfi A. Zadeh, Berkeley
• Superset of conventional (Boolean) logic that has been extended to handle the concept of partial truth
• Truth values (in fuzzy logic) or membership values (in fuzzy sets) belong to the range [0,
1], with 0 being absolute Falseness and 1 being absolute Truth.
• Deals with real world vagueness
Real-World Applications
• ABS Brakes
• Expert Systems
• Control Units
• Bullet train between Tokyo and Osaka
• Video Cameras
• Automatic Transmissions
Crisp (Classic) Sets
• Classic subsets are defined by crisp predicates
– Crisp predicates classify all individuals into two groups or categories
• Group 1: Individuals that make true the predicate
• Group 2: Individuals that make false the predicate
– Example:
E
= Z
A
{ ∈
Z
}
Crisp Characteristic Functions
• The classification of individuals can be done using a indicator or characteristic function:
µ
A
µ
A
: E
→
=
1,
0, x
∈
A x
∉
A
• Note that:
µ
µ
A
−
1
(1)
A
−
1
(0)
= {
K
, 3, 1,1, 3,
K
}
= {
K
, 4, 2, 0, 2, 4,
K
}
Fuzzy Sets
• Human reasoning often uses vague predicates
– Individuals cannot be classified into two groups!
(either true or false)
• Example: The set of tall men
– But… what is tall?
– Height is all relative
– As a descriptive term, tall is very subjective and relies on the context in which it is used
• Even a 5ft7 man can be considered "tall" when he is surrounded by people shorter than he is
Fuzzy Membership Functions
• It is impossible to give a classic definition for the subset of tall men
• However, we could establish to which degree a man can be considered tall
• This can be done using membership functions:
A
: E
[0,1]
Fuzzy Membership Functions
• μ
A
(x) = y
– Individual x belongs to some extent (“y”) to subset
A
– y is the degree to which the individual x is tall
• μ
A
(x) = 0
– Individual x does not belong to subset A
• μ
A
(x) = 1
– Individual x definitelly belongs to subset A
Types of Membership Functions
• Gaussian
Types of Membership Functions
• Triangular
Types of Membership Functions
• Trapezoidal
Example
• E = {0, …, 100} (Age)
• Fuzzy sets: Young, Mature, Old
Membership Functions
• Membership functions represent distributions of possibility rather than probability
• For instance, the fuzzy set Young expresses the possibility that a given individual be young
• Membership functions often overlap with each others
– A given individual may belong to different fuzzy sets
(with different degrees)
Membership Functions
• For practical reasons, in many cases the universe of discourse (E) is assumed to be discrete
E
= {
,
1 2
,
K
, x n
}
• The pair (μ
A
(x), x), denoted by μ
A
(x)/x is called fuzzy singleton
• Fuzzy sets can be described in terms of fuzzy singletons
A
= {
(
µ
A x x
} = i n
U
=
1
µ
A
( ) / x i
Basic Definitions over Fuzzy Sets
• Empty set : A fuzzy subset A
⊆
E is empty
(denoted A = ø) iff
A
( )
0,
E
• Equality : two fuzzy subsets A and B defined over E are equivalent iff
A x
=
B x x E
Basic Definitions over Fuzzy Sets
• A fuzzy subset A
⊆
E is contained in B
⊆
E iff
µ
A
≤ µ
B x E
• Normality: A fuzzy subset A
⊆
E is said to be normal iff max
µ
A x
=
1
• Support: The support of a fuzzy subset A
⊆
E is a crisp set defined as follows
S
A
{
E |
µ
A x
>
0
} φ ⊆
S
A
⊆
E
Operations over Fuzzy Sets
• The basic operations over crisp sets can be extended to suit fuzzy sets
• Standard operations:
– Intersection:
µ x
= min(
µ
A x
µ
B x
– Union:
µ x
= max(
µ
A x
µ
B x
– Complement:
µ
A x
= − µ
A x
Operations over Fuzzy Sets
• Intersection
Operations over Fuzzy Sets
• Union
Operations over Fuzzy Sets
• Complement
Operations over Fuzzy Sets
• Conversely to classic set theory, min (
∩
), max
(
∪
), and 1-id (
¬
) are not the only possibilities to define logical connectives
• Different functions can be used to represent logical connectives in different situations
• Not only membership functions depend on the context, but also logical connectives!!
Fuzzy Complement (c-norms)
• Given a fuzzy set A
⊆
E, its complement can be defined as follows:
µ
A
=
C
µ
A
, x E
• The function C (∙) must satisfy the following conditions:
C (0)
=
1, C (1)
=
0
∀
,
∈
[0,1], a
≤ →
( )
≥
( )
Fuzzy Complement (c-norms)
• In some cases, two more properties are desirable
– C(x) is continuous
– C(x) is involutive:
( ( ))
= a ,
∀ ∈
E
• Examples: x
=
1
−
1
− λ x x
C x
= − x w
)
1 w
λ ∈
(0, ) w
∈
(0, )
Sugeno
Yager
Fuzzy Intersection (t-norms)
• Given two fuzzy sets A, B
⊆
E, their intersection can be defined as follows:
µ
( )
=
T
[ µ
A x
µ
B y
] ∀
,
∈
E
• Required properties:
( , )
=
( , )
∀
,
∈
E commutativity
( ( , ), )
=
( , ( , ))
∀
, ,
∈
E associativity
( x
≤ y ), ( w z ) ( , )
≤
( , )
∀
, , ,
∈
E monotony
( , 0)
=
0 x E absorption
( ,1)
= x
∀ ∈
E neutrality
Fuzzy Intersection (t-norms)
• Examples:
( , )
= x y
( , )
= max(0, x y 1)
( , )
= ⋅ min( , ) x y
=
0 otherwise min
Lukasiewicz product mod product
Fuzzy Union (t-conorms)
• Given two fuzzy sets A, B
⊆
E, their union can be defined as follows:
µ
( )
=
S
[ µ
A
( ),
µ
B y
] ∀
,
∈
E
• Required properties:
( , )
=
( , )
∀
,
∈
E commutativity
( ( , ), )
=
( , ( , ))
∀
, ,
∈
E associativity
( x
≤ y ), ( w z ) ( , )
≤
( , )
∀
, , ,
∈
E monotony
= x E absorption
= x x E neutrality
Fuzzy Union (t-conorms)
• Examples:
( , )
= x y
( , )
= + − ⋅ max
( , )
= min(1, x
+ y ) Lukasiewicz sum max( , ) x y
=
0 mod sum
1 otherwise
Properties of Fuzzy Operations
• The t-norms and t-conorms are bounded operators:
( , )
≤ x y
( , )
≥ x y
∀
,
∈
[0,1]
∀
,
∈
[0,1]
• The minimum is the biggest t-norm
• The maximum is the smallest t-conorm
Properties of Fuzzy Operations
• Duality (Generalized De Morgan Laws):
( ( , ))
=
( ( ), ( ))
( ( , ))
=
( ( ), ( ))
• Only some tuples (T, S, C) meet this property
• In such cases the t-norm and the t-conorm are said to be dual w.r.t. the fuzzy complement
– Examples:
• (max, min, 1-id)
• (prod, sum, 1-id)
Properties of Fuzzy Operations
• Distributive Properties:
( , ( , ))
=
( ( , ), ( , ))
( , ( , ))
=
( ( , ), ( , ))
• The only tuple satisfying this property is (max, min, 1-id)
Properties of Fuzzy Operations
• In general, given t-norm T, and involutive complement C, we can define operator:
( , )
=
( ( ( ), ( )))
• It can be proved that S is a t-conorm s.t. tuple
(T, S, C) is dual w.r.t. c-norm C
• Similarly, given S and an involutive C, we can define a dual T for S w.r.t. C as:
( , )
=
( ( ( ), ( )))
Properties of Fuzzy Operations
• Some dual tuples (T, S, C) satisfy the following properties (excluded-middle and noncontradiction):
( , ( ))
E
• It can be proved that distributive laws do not hold in such cases
Properties of Fuzzy Operations
• Some dual tuples (T, S, C) satisfy the following properties:
S(x,C(x ))=1 excluded-middle
T(x,C(x ))=0 non-contradiction
• It can be proved that distributive laws do not hold in such cases
– Except for crisp logic: (max, min, 1-id) are dual (De
Morgan), distributive, and “consistent”
Choice of T, S, and C
• The selection of T, S, and C always depend on the concrete case or application
– We need to determine which properties are required for our application
• The most common choice:
– T = min, S = max, C = 1-id
– Properties:
• Comm., assoc., neutrality, absorption, involution, inv. 0-
1, inv. 1-0, duality, idempotence, distributive
Example
• Let us suppose that we are thirsty and we are thinking about going to a bar to have a drink
• However, we are reluctant to go to whatever bar
• We want to go to a bar satisfying the following requirements:
– We want the bar to be traditional
– We want to go to a bar close to our home
– We want the drinks to be cheap
Example
• To decide to which bar to go, we will make the following assumptions:
– We consider that a bar is traditional if it started working 5 years or more ago
– A bar is close to our home if it is not farther than ten blocks
– A drink is cheap if it costs 1 Euro or less
Example
• We know four different bars to which we can go:
Bar 1
Bar 2
Bar 3
Bar 4
Price
1.40
0.80
1.00
1.25
Years
3
7
4
5
Blocks
3
12
9
10
Example
• Using the classical set theory to solve this problem, we have that the chosen bar must satisfy the following logical formula:
( years
) ( blocks
≤
10
) ( price
≤
1
)
• This yields the following solution:
Bar 1
Bar 2
Bar 3
Bar 4
Price
0
1
1
0
Years
0
1
0
1
Blocks
1
0
1
1
Classical
Solution
0
0
0
0
Example
• Using the classic set theory we are bounded to stay at home L
– None of the bars satisfy our requirements!
• This is not consistent with the fact “we are thirsty”
• We need a more flexible approach
• Let us now try the fuzzy set based approach
Example
• We distinguish three fuzzy sets described by the following predicates:
– “The bar is traditional”
– “The bar is close to home”
– “The drink is cheap”
• Thus, first of all we need to model the abovementioned fuzzy sets
– i.e. we need to provide the fuzzy membership functions associated to such fuzzy sets
Example
• MF for the predicate “the bar is traditional”
Example
• MF for the predicate “the bar is close to home”
Example
• Membership function for the predicate “the drink is cheap”
Example
• Now, the second step involves the selection of the fuzzy operators needed for this application
• In this case, we will use the following operators:
– T = min, S = max, C = 1-id
• In other cases we will have to carefully choose the fuzzy operators depending on the required properties for the concrete application
Example
• Results obtained using fuzzy sets theory:
Bar 1
Bar 2
Bar 3
Bar 4
Price
0,2
1
1
0,5
Years
0,5
1
0,875
1
Blocks
1
0,6667
1
1
Solution
0,2
0,6667
0,875
0,5