CM3112 Artificial Intelligence
Fuzzy logic: Relations
Steven Schockaert
SchockaertS1@cardiff.ac.uk
School of Computer Science & Informatics Cardiff University
Relations
The Cartesian product of sets A and B is defined as: A ⇥ B = {(a, b) | a 2 A, b 2 B}
A relation R from A to B is defined as a subset of A × B Example:
Films = {the Dark Knight, the Fellowship of the Ring, . . . } Characters = {Batman, Joker, Frodo, . . . }
FeaturesIn = {(Batman, the Dark Knight), (Joker, the Dark Knight), . . . } FeaturesIn ⊆ Characters × Films
o
{}
c
gramme ={cs, cs-sf, cs-hpc, cs-vc, se, cse, maths}
Core ={(cm3101, bis), (cm3102, cs-vc), (cm3103, cs-hpc), (cm3102, cs-v
Direct product
Optional ={(cm3101, se), (cm3102, cs), (cm3102, maths), …} We call A a set in the universe X if A⊆X
Core ✓ Module ⇥ Programme Optional ✓ Module ⇥ Programme Let A be a set in the universe X and R a relation from X to Y. The direct
product of A and R, written A∘R is defined as: A R={b|there exists an a2A such that (a,b)2R}
Example:
Films = {the Dark Knight, the Fellowship of the Ring, . . . } Characters = {Batman, Joker, Frodo, . . . }
FeaturesIn = {(Batman, the Dark Knight), (Joker, the Dark Knight), . . . } Superheroes = {Batman, . . . }
Superheroes ∘ FeaturesIn = {the Dark Knight, . . . }
Direct product
Y
R
A
X
Direct product
Y
A∘R
R
A
X
Module = {cm3101, cm3102, …, cm3301} Fuzzy sets and fuzzy relations
Lecturer = {ne, pr, xs, dw, aj, cj, …}
Taught-by = {(cm3101, ne), (cm3102, pr), (cm3102, xs), .
A fuzzy set A in a universe X is a mapping from X to [0,1]
Aut-CS-mods = {cm3102, cm3103, cm3104, cm3105, cm3106
A fuzzy relation R from X to Y is a fuzzy set in X × Y cm3107, cm3108}
t-CS-mods Taught-by = {pr, xs, dw, aj, cj, js, tb, md, am, ks, ap, cm, ss The direct product of A and R w.r.t. a t-norm T is defined for b in Y as:
(A T R)(b)=maxT(A(x),R(x,b)) x2X
where we assume that eit8>her the universes X and Y are finite or that
< x 2
A and R are defined by contin2uous mappings
6 x 2
if 2 x 4
A(x) =
0 otherwise
if 4 x 6
.
u}
>:
8y x 5
Direct product Y
R
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
0.5
1
0
0.75
0
0
0
A
X
Direct product w.r.t. TM Y
R
0
0.5
0.25
0
0.75
0
0
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
A∘R
0.5
1
0
0.75
0
0
0
A
X
Direct product w.r.t. TP Y
R
0
0.375
0.125
0
0.75
0
0
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
A∘R
0.5
1
0
0.75
0
0
0
A
X
Direct product w.r.t. TW Y
R
0
0.25
0
0
0.75
0
0
0
0
0
0
0
0
0.25
0.75
0
0.25
0
0
0.5
1
0.25
0
0.75
0
0
0.5
0.5
0
0
1
0
0
0.25
0
0
0.25
1
1
0
0.25
0
0
0
0
0
0
1
0.5
0
0
0
0
0
0
0.25
A∘R
0.5
1
0
0.75
0
0
0
A
X
Example: finite universes
Let the fuzzy set of friends be defined as:
Friends = {frodo/1, sam/1, aragorn/0.75, elrond/0.5, gollum/0.1}
Let the fuzzy relation Likes be defined as
Likes = {(frodo,rabbit)/0.8, (frodo,fish)/0.6, (frodo,lembas)/0.2, (sam,rabbit)/1, (sam,fish)/0.4, (sam,lembas)/0.1, (aragorn,rabbit)/0.9, (aragorn,fish)/0.8, (aragorn,lembas)/0.7, (elrond,rabbit)/0.2, (elrond,fish)/0.6, (elrond,lembas)/1, (gollum,rabbit)/0.3, (gollum,fish)/1, (gollum,lembas)/0}
We use the notation A= {a1/λ1,…,an/λn} to denote the fuzzy set defined by A(ai)=λi (where entries of the form ai/0 are usually omitted)
Example: finite universes
Friends∘Likes is the fuzzy set of food types which my friends like
(Friends∘Likes)(rabbit) = max(T(1,0.8), T(1,1), T(0.75,0.9), T(0.5,0.2), T(0.1,0.3)) (Friends∘Likes)(fish) = max(T(1,0.6), T(1,0.4), T(0.75,0.8), T(0.5,0.6), T(0.1,1)) (Friends∘Likes)(lembas) = max(T(1,0.2), T(1,0.1), T(0.75,0.7), T(0.5,1), T(0.1,0))
Friends = {frodo/1, sam/1, aragorn/0.75, elrond/0.5, gollum/0.1}
Likes = {(frodo,rabbit)/0.8, (frodo,fish)/0.6, (frodo,lembas)/0.2, (sam,rabbit)/1, (sam,fish)/0.4, (sam,lembas)/0.1, (aragorn,rabbit)/0.9, (aragorn,fish)/0.8, (aragorn,lembas)/0.7, (elrond,rabbit)/0.2, (elrond,fish)/0.6, (elrond,lembas)/1, (gollum,rabbit)/0.3, (gollum,fish)/1, (gollum,lembas)/0}