You are on page 1of 35

Adama Science and Technology

University

PCE6202 Intelligent systems


and Applications
(Approximate reasoning)

ASTU
Dept. of EPCE

Adama Science and Technology


University

EPCE6202 Intelligent Control


and Its Applicatons
(Approximate reasoning)

ASTU
School of EEC

1
1. Approximate Reasoning
• The ultimate goal of fuzzy theory is to
approximate incomplete fuzzy propositions and
obtain new results.
• To achieve this goal, Generalized Modus Ponens
(GMP), Generalized Modus Tollens (GMT), and
Generalized Hypothetical Syllogism (GHS) that
extend classical rules of inference are used.

Contd
(Definition) Generalized MP(GMP)
If A and A' are the fuzzy sets in U, and B and B' in V,
GMP derives a new fuzzy proposition as follows:

fact : if x is A'
rule : if x is A, then y is B
result : y= B'
• If A'= A, then B'= B as classical MP.
• In general, the smaller the difference between A'
and A, the smaller the difference between B' and B
should be.

2
Contd
fact : if x is A'
rule : if x is A, then y is B
result : y is B'

Premise Approximate
(fact) A' reasoning or Result(new fact)
Implication compound rule of
B'= A'(AB)
(rule)AB inference

Contd
fact : if an apple is redish
rule: if the apple is red, then it is ripe
result: The apple is a little ripe
This one is a
Mommy! little ripe.
This apple is Give me
redish. delicious one.

3
Contd
GMP is inferred as follows:
B'=A'(AB)= {(v,B'(v))|vV}
where  is an operator that denotes fuzzy composition

B'(v)= A'(u)AB(u,v)= sup t[  A ' (u ),  A B (u, v)]


uU

= sup[  A ' (u ) *  A B (u, v)]


uU

This is called the compositional rule of inference (sup-*


inference) and t means one of t-norm operators.

Contd
When the sup-min or sup-product operator is used in the
compositional rule of inference, B'(v) is calculated as

• sup-min (Zadeh)
B'(v)= sup[  A ' (u )   A B (u, v)]
uU
• sup-product (Kaufmann)

B'(v)= sup[  A ' (u )   A B (u, v)]


uU

4
Contd
For example, consider a fuuzy system
fact : service is a little good(A')
rule: if service is good(A), then tip is average(B)
result: your tip is below average(B')
U= 'service'={1,2,3,4,5},V= 'tip'= {0$,2$,5$}
A= 'good'= 0.3/3+1.0/4+0.3/5
B= 'average'= 0.1/0$+ 1.0/2$+0.1/5$
A B
u v
1 2 3 4 5 0 2 5

Contd
A'= 'a little good' A
= 0.3/2+1.0/3+0.3/4
u
1 2 3 4 5
Applying the min operator as fuzzy implication()
results in 1  0 
  0$ 2$ 5$
2 0 
M A  3 0.3 1 0 0 0
   
4 1.0  2 0 0 0
  M A B  M A  M B  3 0.1 0.3 0.1
5 0.3  
4 0.1 1.0 0.1
0$ 2$ 5$  
5 0.1 0.3 0.1
M B   0.1 1.0 0.1

5
Contd
sup-min for approximate reasoning
1 2 3 4 5
M A '  0 0.3 1.0 0.3 0 
0$ 2$ 5$

 M B '  M A '  M A B 1 0 0 0
 
2 0 0 0
 0 0.3 1.0 0.3 0   3 0.1 0.3 0.1
 
4 0.1 1.0 0.1
0$ 2$ 5$  
5 0.1 0.3 0.1
  0.1 0.3 0.1

Contd
sup-product for approximate reasoning
1 2 3 4 5
M A '  0 0.3 1.0 0.3 0 
0$ 2$ 5$

 M B '  M A '  M A B 1 0 0 0
 
2 0 0 0
 0 0.3 1.0 0.3 0   3 0.1 0.3 0.1
 
4 0.1 1.0 0.1
0$ 2$ 5$  
5 0.1 0.3 0.1
  0.1 0.3 0.1

6
Contd
A if service is good(A),
B
then tip is average(B)
u v
1 2 3 4 5 0 2 5
A' Approximate
A' B'
AB reasoning
A'(AB) B'

u v
1 2 3 4 5 0 2 5
B'= 0.1/0+0.3/2+0.1/5
Service is a little Your tip is below
good(A') average(B')

Contd
(Definition) Generalized MT(GMT)
If A and A' are the fuzzy sets in U, and B and B' in V,
GMT derives a new fuzzy proposition as follows:

fact : if y is B'
rule : if x is A, then y is B
result : x is A'

In general, the smaller the difference between B' and


B, the smaller the difference between A' and A should
be.

7
Contd
fact : if y is B'
rule : if x is A, then y is B
result : x is A'

Premise (fact)
B' Approximate Result(new fact)
Implication(rule) reasoning
A'= B'(AB)
AB

Contd
fact : if an apple is not delicious
rule: if an apple is ripe, then it is delicious
result: The apple is not ripe

Ripe apples Mommy!


must be This one is not
delicious but ripe. Give me
this is not another.

8
Contd
GMT infers as follows:
A'= B'(AB)= {(u,A'(u))|uU}
where
A'(u)= B'(v)AB(u,v)= sup t[  B ' (v),  A B (u, v)]
vV

= sup[  B ' (v) *  A B (u , v)]


vV

Useful operators for approximate reasoning are


• A'(u)= sup[  B ' (v)   A B (u , v)] :sup-min(Zadeh)
vV

• A'(u)= sup[  B ' (v)   A B (u , v)] :sup-product(Kaufmann)


vV

Contd
For example, consider a fuzzy system
y is B'
if x is A, then y is B
x is A'
where
U= {a,b,c,d,e}, V= {f,g,h}, AU, BV, B'V
B'= 0.1/f+0.5/g+1.0/h
A= 0.3/a+1.0/b+0.3/c+0.1/d
B= 0.2/f+ 1.0/g+0.2/h

9
Contd
From A and B, using the min operator as AB gives
a 0.3
  f g h
b 1.0 
M B   0.2 1.0 0.2
M A  c 0.3
 
d  0.1
  f g h
e 0 
a 0.2 0.3 0.2 
 
b 0.2 1.0 0.2 
M A B  M A  M B  c 0.2 0.3 0.2 
 
d  0.1 0.1 0.1
 
e 0 0 0 

Contd
Sup-min for approximate reasoning
f g h
M B '   0.1 0.5 1.0 f g h
a 0.2 0.3 0.2 
 M A '  M B '  M A B  
b 0.2 1.0 0.2 
  0.1 0.5 1.0  c 0.2 0.3 0.2 
 
d  0.1 0.1 0.1
 
e 0 0 0 
a b c d e
 0.3 0.5 0.3 0.1 0 

10
Contd
Sup-product for approximate reasoning

f g h
 M A '  M B '  M A B a 0.2 0.3 0.2 
 
b 0.2 1.0 0.2 
  0.1 0.5 1.0  c 0.2 0.3 0.2 
 
d  0.1 0.1 0.1
 
e 0 0 0 
a b c d e
 0.2 0.5 0.2 0.1 0 

Contd
A B

u v
a b c d e f g h
B' Approximate
A'
AB reasoning
B'(AB)
A'
B'
u
v a b c d e
f g h

 A'= 0.3/a+0.5/b+0.3/c+0.1/d : sup-min


 A'= 0.2/a+0.5/b+0.2/c+0.1/d : sup-product

11
2. KB and inference Engine
Fuzzy rule base
• A data base stored in the form of a knowledge base,
and is generally composed of fuzzy if-then rules
• A key to fuzzy systems along with fuzzy inference
engine
• Fuzzy rules can be described as MIMO and complex
forms, but simple Mamdani and Sugeno types are
mainly used
• MIMO systems can be represented as a combination
of multi-input single-output (MISO) systems, so
they only deal with MISO fuzzy rules

Contd
Mamdani-type MISO fuzzy rule
R1 : if x1 is A11 and  and x n is An1 , then z is C 1 also
R2 : if x1 is A12 and  and x n is An2 , then z is C 2 also

Ri : if x1 is A1i and  and x n is Ani , then z is C i also

R : if x1 is A1 an d  and x n is An , then z is C 

Antecedent part Consequent part


where x1, x2, ..., xn, z: linguistic variables,
Aij : words in a natural language or fuzzy sets
 : number of fuzzy rues

12
Contd
Characteristics of Mamdani-type fuzzy rules
• Consequent part is described by a fuzzy set
• Inferred results become fuzzy sets
• In order to apply a Mamdani-type fuzzy rule to
control applications, a defuzzification process is
required to convert the fuzzy set to its
corresponding crisp value.

Contd
2-input 1-output Mamdani-type system

input : x1 is A ' and x 2 is B '


rule R1: if x1 is A1 and x 2 is B1 , then z is C1 also

rule Ri: if x1 is Ai and x 2 is Bi , then z is C i also

rule R : if x1 is A and x 2 is B  , then z is C 
result: z is C '

where AiU, BiV, CiW, uU, vV, wW

13
Contd
The ith rule Ri can be described as

Ri= (Ai and Bi)→Ci

If the connective 'also' is denoted by , the result of


the overall rules is as follows:

R   Ri
i 1

  [( Ai and Bi )  C i ]  U  V  W
i 1

Contd
Given inputs A and B, the output yields

C '  ( A ', B ')  R



 ( A ', B ')   [( Ai and Bi )  C i ]
i 1

  ( A ', B ')  [( Ai and Bi )  C i ]
i 1

  t [ A ' ( Ai  C i ), B ' ( Bi  C i )]
i 1

where t is one of t-norm operators

14
Contd
 
Lemma 1: ( A ', B ')   Ri   ( A ', B ')  Ri
i 1 i 1

Lemma 2: ( A ', B ')  ( Ai and Bi  C i )


 [ A ' ( Ai  C i )] and [ B ' ( Bi  C i )]
 t [ A ' ( Ai  C i ), B ' ( Bi  C i )]

Proof: Refer to C.C. Lee, “Fuzzy Logic in Control


Systems: Fuzzy Logic Controller, Part II”

Contd
(1) When inputs A' and B' are fuzzy singletons
A' 1 B' 1

u v
u0 v0
The inferred result is computed according to the
implication and 'and' operators. C '   t[ A ' ( A  C ), B ' ( B  C )]

i i i i
i 1
C '  {( w ,  C ' ( w )) | w  W }
 
  i   Ci ( w )
   Ai ( u 0 )   Bi ( v 0 )
 C ' ( w )   i 1 , i  
  Ai ( u 0 )   Bi ( v 0 )

     (w)
 i 1 i C i

15
Contd
Inference procedure
Step 1: Calculate the truth value of each rule for A'=
u0 and B'= v0.
• If min operator is used for 'and'
 1   A1 ( u 0 )   B 1 ( v 0 )
...
    A ( u 0 )   B ( v 0 )
• If product operator is used for 'and'
 1   A1 ( u 0 )   B 1 ( v 0 )
...
    A ( u 0 )   B ( v 0 )

Contd
Step 2: Apply 1,,  to the consequent part to
infer each rule.
• If min is used for implication
 ( w )   1   C1 ( w )
C1'
...
 ( w )      C ( w )
C '
• if product is used for implication
 ( w )   1   C1 ( w )
C1'
...
 ( w )      C ( w )
C '

16
Contd
Step 3: Apply the max operator for 'also' to obtain
the final result C'.

C '  {( w ,  C ' ( w )) | w  W }
w here  (w)   (w)   ( w )  ...   (w)
C' C1' C 2' C '

Contd
Case1: Mamdani-type inference for fuzzy singleton inputs
input : x1 is A' (u0 ) and x2 is B ' (v0 )
rule R1: if x1 is A1 and x2 is B1, then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '

where AiU, BiV, CiW, uU, vV, wW


A' and B' : fuzzy singletons
implication and 'and': min operators
'also' : max operator

17
Contd
input : x1 is u0 and x2 is v0
rule R1: if x1 is A1 and x 2 is B1 , then z is C1

 1   A1 ( u 0 )   B 1 ( v 0 ) : truth value
 ( w )   1   C1 ( w ) : infered value
C1'

Contd
input : x1 is u0 and x2 is v0
rule R2: if x1 is A2 and x2 is B2 , then z is C2

 2   A2 ( u 0 )   B 2 ( v 0 )
 ( w)   2  C2 ( w)
C 2'

18
Contd

 (w)   (w)   (w)


C' C1' C 2'

Contd
Case2: Mamdani-type inference for fuzzy singleton inputs
input : x1 is A' (u0 ) and x2 is B ' (v0 )
rule R1: if x1 is A1 and x2 is B1 , then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '

where AiU, BiV, CiW, uU, vV, wW


A' and B' : fuzzy singletons
implication : product operator
'and': min operator
'also' : max operator

19
Contd
input : x1 is u0 and x2 is v0
rule R1: if x1 is A1 and x2 is B1 , then z is C1

 1   A1 ( u 0 )   B1 ( v 0 )
 ( w )   1   C1 ( w )
C1'

Contd
input : x1 is u0 and x2 is v0
rule R2: if x1 is A2 and x2 is B2 , then z is C2

 2   A2 ( u 0 )   B 2 ( v 0 )
 ( w)   2  C2 ( w)
C 2'

20
Contd

 (w)   (w)   (w)


C' C1' C 2'

Contd
Example 1: Given a fuzzy system
input : Service is a little good(A') and food is
delicious(B')
rule1: if service is good(A1) and food is good (B1),
then tip is average(C1)
rule2: if service is excellent(A2) and food is
delicious(B2), then tip is generous(C2)

result : Your tip is C'

where A1, A2, A'U, B1, B2, B'V, C1,C2,C'W

21
Contd
Universes and fuzzy sets
U='service'={1,2,3,4,5},V= 'food'={1,2,3,4,5}
W='tip'= {0$,5$,10$}
A'= 1.0/2 B'= 1.0/5 : fuzzy singletons
A1= 'good'= 0.2/2+1.0/3+0.2/4
A2= 'excellent'= 0.1/3+0.3/4+1.0/5
B1= 'good'= 0.1/2+0.3/3+1.0/4+0.3/5
B2= 'delicious'= 0.1/3+0.3/4+1.0/5
C1= 'average'= 0.1/0$+ 1.0/5$+0.1/10$
C2= 'generous'= 0.1/5$+1.0/10$
 implication() and 'and': min operators
 'also' : max operator

Contd
Given A'= u0= 2, B'= v0= 5, C'1 yields
A1 B1 C1

u v w
12345 123 4 5 0 5 10
u0 v0
C'1
 1   A1 (2)   B 1 (5)
 0.2  0.3  0.2 w
0 5 10
 ( w )   1   C1 ( w )
C1'
= 0.1/0$+ 0.2/5$+0.1/10$

22
Contd
Given A'= u0= 2 and B'= v0= 5, C'2 yields
A2 B2 C2

u v w
12345 12 345 0 5 10
u0 v0
C'2
 2   A2 (2)   B 2 (5)  0  1  0
 (w)   2  C2 (w)
w
C 2'
0 5 10
=

Contd
C'1 C'2 yields

C'1

w C'
0 5 10

C'2 w
0 5 10

w
0 5 10  C ' ( w ) = 0.1/0$+ 0.2/5$+0.1/10$

23
Contd
(2) When inputs A' and B' are fuzzy sets
1
A' B' 1

u v
The inferred result depends on the use of operators.


C '   t [ A ' ( Ai  C i ), B ' ( Bi  C i )]
i 1

Contd
Applying sup-min operator for
composition gives

C '  {( w ,  C ' ( w )) | w  W }
 
 i  i   Ci ( w )
1
C ' (w)   ,

     (w)
 i  1 i C i
[  (  Ai ( u )   ' ( u ))]  [(   Bi ( v )   ' ( v ))]
 A v B
i   u
[  (  Ai ( u )   A ' ( u ))]  [( v  Bi ( v )   B ' ( v ))]
 u

24
Contd
Inference procedure
Step 1: Calculate A'Ai and B'Bi of each rule.
• If sup-min is used for composition
 (  A1 ( u )   ( u )), ...,  (  A ( u )   ( u ))
u A' u A'

(   B1 ( v )   ( v )), ..., (   B  ( v )   ( v ))
v B' v B'

• If sup-product is used for composition


 (  A1 ( u )   ( u )), ...,  (  A ( u )   ( u ))
u A' u A'

(   B1 ( v )   ( v )), ..., (   B  ( v )   ( v ))
v B' v B'

Contd
Step 2: Calculate the truth value of each rule for A',
B'.
• If min operator is used for 'and'
 1  [  (  A1 ( u )   ' ( u ))]  [(   B1 ( v )   ' ( v ))], ...,
u A v B

   [  (  A ( u )   ' ( u ))]  [(   B  ( v )   ( v ))]


u A v B'

• If product operator is used for 'and'


 1  [  (  A1 ( u )   ' ( u ))]  [(   B1 ( v )   ' ( v ))], ...,
u A v B

   [  (  A ( u )   ' ( u ))]  [(   B  ( v )   ( v ))]


u A v B'

25
Contd
Step 3: Apply 1,,  to the consequent part to
infer each rule.
• if min is used for implication
 ( w )   1   C1 ( w ), ...
C1'
 ( w )      C ( w )
C '

• if product is used for implication


 ( w )   1   C1 ( w ), ...
C1'
 ( w )      C ( w )
C '

Contd
Step 4: Apply the max operator for 'also' to obtain
the final result C'.
C '  {( w ,  C ' ( w )) | w  W }
 (w)   (w)   ( w )  ...   (w)
C' C1' C 2' C '

26
Contd
Case 3: Mamdani-type inference for fuzzy set inputs
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1, then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '
where AiU, BiV, CiW, uU, vV, wW
A' and B' : fuzzy sets
composition: sup-min
implication and 'and': min operators
'also' : max operator

Contd
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1 , then z is C1

 1  [  (  A1 ( u )   ' ( u ))]  [(   B1 ( v )   ' ( v ))]


u A v B

 ( w )   1   C1 ( w )
C1'

27
Contd
input : x1 is A' and x2 is B '
rule R2: if x1 is A2 and x2 is B2 , then z is C2

 2  [  (  A2 ( u )   ' ( u ))]  [(   B 2 ( v )   ' ( v ))]


u A v B

 (w)   2  C2 ( w)
C 2'

Contd

 (w)   (w)   (w)


C' C1' C 2'

28
Contd
Case 4: Mamdani-type inference for fuzzy set inputs
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1, then z is C1 also
rule R2: if x1 is A2 and x2 is B2 , then z is C2
result : z is C '
where AiU, BiV, CiW, uU, vV, wW
A' and B' : fuzzy sets
composition: sup-min
implication: product operator
'and': min operator
'also': max operator

Contd
input : x1 is A' and x2 is B '
rule R1: if x1 is A1 and x2 is B1, then z is C1

 1  [  (  A1 ( u )   ( u ))]  [(   B1 ( v )   ( v ))]
u A' v B'

 ( w )   1   C1 ( w )
C1'

29
Contd
input : x1 is u0 and x2 is v0
rule R2: if x1 is A2 and x2 is B2 , then z is C2

 2  [  (  A2 ( u )   ' ( u ))]  [(   B 2 ( v )   ' ( v ))]


u A v B

 (w)   2  C2 (w)


C 2'

Contd

 (w)   (w)   (w)


C' C1' C 2'

30
Contd
Sugeno-type MISO fuzzy rule
R1 : if x1 is A11 and  and x n is An1 , then z  f1 ( x1 , ..., x n )
R2 : if x1 is A12 and  and x n is An2 , then z  f 2 ( x1 ,..., x n )

Ri : if x1 is A1i and  and x n is Ani , then z = f i ( x1 , ..., x n )

R : if x1 is A1 and  and x n is An , then z  f  ( x1 ,..., x n )

Antecedent part Consequent part


where x1, x2, ..., xn, z: linguistic variables,
Aij : words in a natural language or fuzzy sets
 : number of fuzzy rues

Contd
Characteristics of Sugeno-type fuzzy rules

• Input is assumed to be a fuzzy singleton


• The consequent part is described by a function of
input variables.
• Inferred results becomes a crisp rather than a
fuzzy set
• Defuzzification process for control applications is
not required.

31
Contd
2-input 1-output Sugeno-type
input : x1 is u0 and x2 is v0
rule R1: if x1 is A1 and x2 is B1, then z  f1 ( x1 , x2 )

rule Ri: if x1 is Ai and x2 is Bi , then z  f 2 ( x1 , x2 )

rule R: if x1 is A and x2 is A , then z  f ( x1, x2 )
result : z = w0
where AiU, BiV, CiW, uU, vV, wW

Contd
Inference procedure
Step 1: Calculate the truth value of each rule for A'=
u0 and B'= v0.
• If min operator is used for 'and'
 1   A1 ( u 0 )   B1 ( v 0 ), ...,
    A ( u 0 )   B ( v 0 )
• If product operator is used for 'and'
 1   A1 ( u 0 )   B1 ( v 0 ), ...,
    A ( u 0 )   B ( v 0 )

32
Contd
Step 2: Calculate fi(x1,x2) of each rule with the inputs
x1= u0 and x2= v0.

Step 3: Calculate the final result z with 1,,  and


fi(u0,v0).

 1 f1 ( u 0 , v 0 )   2 f 2 ( u 0 , v 0 )  ...    f  ( u 0 , v 0 )
z
 1   2  ...   

Contd
Given x1= u0 and x2= v0, the final result for two rules
can be calculated by
 1 f1 ( u 0 , v 0 )   2 f 2 ( u 0 , v 0 )
z
1   2

33
Contd
Example 2: 2-input, 1-output Sugeno-type fuzzy
system
Inputs: x= 1, y= -0.5
R1: if x is A1 and y is B1, then z= -x+2y+1
R2: if x is A2 and y is B1, then z= -y+2
R3: if x is A1 and y is B2, then z= -x+2
R4: if x is A2 and y is B2, then z= x+2y+1

Contd
From the input and the MFs
1= 0.10.7= 0.1, 2= 0.80.7= 0.7,
3= 0.10.3= 0.1, 4= 0.80.3= 0.3
z1= -x+2y+1= -1
z2= -y+2= 2.5
z3= -x+2= 1
z4= x+2y+1= 1

 1 z1   2 z 2   3 z 3   4 z 4 2.05
z   1.708
1   2   3   4 1.2

34
Q&A

35

You might also like