34
Fall 2002 Fall 2002 Lecture Lecture 06 06 ﺻﻔﺤﻪ1 Fuzzy Expert Systems Fuzzy Expert Systems Lecture 6 Lecture 6 (Fuzzy Logic ) (Fuzzy Logic ) “Unlike Classical Logic, Fuzzy Logic is concerned, in the main, with modes of reasoning which are approximate rather than exact” L. A. Zadeh

Fuzzy Expert Systems - mshdiau.ac.irmeghdadi.mshdiau.ac.ir/expert/lectures/lecture_006... ·  · 2009-12-19A fuzzy if then rule is a conditional statement expressed as IF

  • Upload
    vucong

  • View
    225

  • Download
    1

Embed Size (px)

Citation preview

Fall 2002Fall 2002 Lecture Lecture 0606 1صفحه

Fuzzy Expert Systems Fuzzy Expert Systems Lecture 6Lecture 6

(Fuzzy Logic )(Fuzzy Logic )

“Unlike Classical Logic, Fuzzy Logic is concerned, in the main, with modes of reasoning which are approximate rather than exact”

L. A. Zadeh

Fall 2002Fall 2002 Lecture Lecture 0606 2صفحه

Summary of the previous lectureSummary of the previous lecture

Fuzzy propositionsFuzzy propositions are the building blocks of the are the building blocks of the statements in fuzzy logic while statements in fuzzy logic while atomic fuzzy atomic fuzzy propositionspropositions are the building blocks of the are the building blocks of the compound fuzzy propositionscompound fuzzy propositions

Connectives Connectives are used to build are used to build compound fuzzy compound fuzzy propositionspropositions using the atomic fuzzy using the atomic fuzzy propositions. while propositions. while ““andand”” is regarded as is regarded as intersection intersection , , ““oror”” is regarded as is regarded as union union and and ““notnot”” is regarded as is regarded as fuzzy complement.fuzzy complement.

Fall 2002Fall 2002 Lecture Lecture 0606 3صفحه

Fuzzy IfFuzzy If--Then RulesThen RulesHuman knowledge is represented in terms Human knowledge is represented in terms of fuzzy ifof fuzzy if--then rules. then rules. A fuzzy if then rule is a conditional A fuzzy if then rule is a conditional statement expressed as statement expressed as

IF IF <Fuzzy Proposition><Fuzzy Proposition> THEN THEN <Fuzzy <Fuzzy Proposition>Proposition>

Antecedent مقدم Consequent تالی

Lecture 06Lecture 06

Fall 2002Fall 2002 Lecture Lecture 0606 4صفحه

Interpretation of fuzzy ifInterpretation of fuzzy if--then rulesthen rulesIfIf--then rules are named then rules are named implicationimplication

If If p p THEN THEN q q ≡≡ P P q q

TTTTTT

TTFFFFTTTTFFFFFFTT

p_p_ qqqqppIn classical logic, implications In classical logic, implications are are general general ininthe sense that their truth the sense that their truth value for each combination of value for each combination of the truth values of the the truth values of the propositions can be defined propositions can be defined as in the following Tableas in the following Table

Fall 2002Fall 2002 Lecture Lecture 0606 5صفحه

The truth value of the implication The truth value of the implication pp qqcan be obtained using the following can be obtained using the following formula in classical logicformula in classical logic

PP qq ≡≡ (~(~p)Vqp)Vq ≡≡ ((pp∧∧q)V(~pq)V(~p))If we also accept that fuzzy implications are If we also accept that fuzzy implications are

also global, we can extend the above formula also global, we can extend the above formula in fuzzy logic as well. Consequently, we in fuzzy logic as well. Consequently, we should use any tshould use any t--norm instead of the norm instead of the connective connective ∧∧ and any sand any s--norm instead of V norm instead of V and any of the fuzzy complements instead of and any of the fuzzy complements instead of ~~

Fall 2002Fall 2002 Lecture Lecture 0606 6صفحه

((x,yx,y) ) ∈∈ UxVUxVQ: Q: UxVUxV [0,1][0,1]

µµQQ(x,y)=?(x,y)=?

IF x is A THEN y is BIF x is A THEN y is B

A fuzzy if then rule such as the above rule can be regarded as a fuzzy relation which relates each pairs of (x,y) to each other to some extent. The relation nature of such implication is obvious however, the remaining question is how to define the membership function of the relation : µµQQ(x,y(x,y))

Implications can be regarded as relationsImplications can be regarded as relations

Fall 2002Fall 2002 Lecture Lecture 0606 7صفحه

Types of ImplicationsTypes of ImplicationsIF <FPIF <FP11> THEN <FP> THEN <FP22>>

DienesDienes--RescherRescher Implication: Implication: using using (~(~p)Vqp)Vqcomplement:complement: Basic Fuzzy ComplementBasic Fuzzy ComplementSS--norm:norm: maximum maximum

LukasiewiczLukasiewicz Implication: Implication: using using (~(~p)Vqp)Vqcomplement:complement: Basic Fuzzy ComplementBasic Fuzzy ComplementSS--norm:norm: YagerYager SS--normnorm

)](,)(1max[),(21yxyx FPFPQD

µµµ −=

)]()(1,1min[),(21yxyx FPFPQL

µµµ +−=

Fall 2002Fall 2002 Lecture Lecture 0606 8صفحه

Zadeh Implication: Zadeh Implication: using using ((pp∧∧q)V(~pq)V(~p))complement:complement: Basic Fuzzy ComplementBasic Fuzzy ComplementSS--norm:norm: maximum ( Basic Fuzzy Union)maximum ( Basic Fuzzy Union)TT--norm:norm: min ( Basic Fuzzy Intersection)min ( Basic Fuzzy Intersection)

GodelGodel Implication:Implication:

)](1,))(,)(max[min(),(121xyxyx FPFPFPQD

µµµµ −=

=otherwisey

yxifyx

FP

FPFPQG )(

)()(1),(

2

21

µµµ

µ

qqpqp ∨≤≡⇒ )(

Fall 2002Fall 2002 Lecture Lecture 0606 9صفحه

Mamdani Implication Mamdani Implication (most widely used (most widely used in fuzzy systems and control}in fuzzy systems and control}

Some people believe that fuzzy ifSome people believe that fuzzy if--then rules (in then rules (in spite of classical ones which are spite of classical ones which are global global ) are ) are local local implications In the sense that implications In the sense that pp qq has has large truth value when both p and q have large large truth value when both p and q have large truth values. In other words it is assumed that :truth values. In other words it is assumed that :IF <FPIF <FP11> then <FP> then <FP22> > ≡≡ IF <FPIF <FP11> then <FP> then <FP22> >

ELSE <nothing>ELSE <nothing>Comparing with classical logic it is written as:Comparing with classical logic it is written as:

PP qq ≡≡ p p ∧∧ qq

Fall 2002Fall 2002 Lecture Lecture 0606 10صفحه

Types of Mamdani ImplicationsTypes of Mamdani Implications

MamdaniMamdani--Min QMin QMMMM

MamdaniMamdani--Product QProduct QMPMP

)](,)(min[),(2121 yxFPFPyx FPFPQMM

µµµ >=<∧>=<

)(.)(),(2121 yxFPFPyx FPFPQMP

µµµ >=<∧>=<

Fall 2002Fall 2002 Lecture Lecture 0606 11صفحه

GodelGodel Implication in 3 Implication in 3 Valued LogicValued Logic

0000110.50.50.50.511111111

110.50.50011110000000.50.5110.50.50.50.511110.50.5

110000

PP qqqqppExample:Example:

Fall 2002Fall 2002 Lecture Lecture 0606 12صفحه

Fuzzy Logic Fuzzy Logic What is Logic:What is Logic: Study of methods and Study of methods and principles of reasoning where reasoning principles of reasoning where reasoning means obtaining new propositions from means obtaining new propositions from existing propositions existing propositions Generalization of the 2 valued classical logic Generalization of the 2 valued classical logic to a multi valued fuzzy logic allows us to to a multi valued fuzzy logic allows us to perform perform approximate reasoningapproximate reasoning that is that is deducing imprecise conclusions (fuzzy deducing imprecise conclusions (fuzzy propositions) from a collection of imprecise propositions) from a collection of imprecise premises (fuzzy propositions)premises (fuzzy propositions)

Fall 2002Fall 2002 Lecture Lecture 0606 13صفحه

Existing Propositions

NewPropositions

Premises ConclusionsReasoning

Fuzzy Propositions

Fuzzy Propositions

Fuzzy Propositions

Fuzzy Propositions

ApproximateReasoning

The ultimate goal of the fuzzy logic is to provide foundations for approximate reasoning with imprecise propositions using fuzzy set theory as the principle tool

Fall 2002Fall 2002 Lecture Lecture 0606 14صفحه

Classical Inference Rules Classical Inference Rules Modus PonensModus Ponens:: Given two propositions Given two propositions p p and and pp qq , the truth of the propositions , the truth of the propositions q q should be should be inferredinferred

(( p p ∧∧ ( ( pp qq) ) ) ) qq

Premise 1: Premise 1: x is A x is A Premise 2: Premise 2: IF x is A THEN y is BIF x is A THEN y is B

Conclusion: Conclusion: y is By is B

Non – Fuzzy

Fall 2002Fall 2002 Lecture Lecture 0606 15صفحه

Modus Modus TollensTollens:: Given two propositions ~Given two propositions ~q q and and pp qq , the truth of the propositions , the truth of the propositions ~p ~p should be inferredshould be inferred

Premise 1: Premise 1: y is not B y is not B Premise 2: Premise 2: IF x is A THEN y is BIF x is A THEN y is B

Conclusion: Conclusion: x is not Ax is not A

pqpq →→∧ ))((

Fall 2002Fall 2002 Lecture Lecture 0606 16صفحه

Hypothetical SyllogismHypothetical Syllogism:: Given two Given two propositions propositions pp q q and and qq r r the truth of the the truth of the proposition proposition pp rr should be inferred.should be inferred.

( (( ( p p q) q) ∧∧ ( ( qq r) ) r) ) ( p( p r)r)

Premise 1: Premise 1: IF x is A THEN y is BIF x is A THEN y is BPremise 2: Premise 2: IF y is B THEN z is CIF y is B THEN z is C

Conclusion: Conclusion: IF x is A THEN z is CIF x is A THEN z is C

Fall 2002Fall 2002 Lecture Lecture 0606 17صفحه

Verification of Modus Verification of Modus PonensPonens in 3 valued logicin 3 valued logic

1111111111110.50.50.50.50.50.5111100000011110.50.511110.50.5110.50.5110.50.50.50.5110000000.50.511001111001100110.50.5001100110000

[p [p ∧∧ ((pp q)]q)] qqp p ∧∧ ((pp qq))PP qqqqpp

Fall 2002Fall 2002 Lecture Lecture 0606 18صفحه

Fundamental Principles in Fundamental Principles in Fuzzy LogicFuzzy Logic

To achieve the ultimate goal of fuzzy logic To achieve the ultimate goal of fuzzy logic in providing foundations for approximate in providing foundations for approximate reasoning, the generalizations of the reasoning, the generalizations of the above inference rules are proposed and above inference rules are proposed and are called, are called, generalized modus generalized modus ponensponens, , generalized modus generalized modus tollenstollens and generalized and generalized hypothetical syllogism.hypothetical syllogism.

Fall 2002Fall 2002 Lecture Lecture 0606 19صفحه

•• Generalized Modus PonensGeneralized Modus PonensGiven two fuzzy propositions Given two fuzzy propositions ““x is Ax is A’’ ““ and and ““IF x is A IF x is A THEN y is BTHEN y is B ““ The new fuzzy proposition The new fuzzy proposition ““y is By is B’’ ““could be inferred. It is obvious that this rule has not could be inferred. It is obvious that this rule has not any meaning unless we specify the membership any meaning unless we specify the membership function of Bfunction of B’’. It is desired to define B. It is desired to define B’’ such that the such that the closer closer AA’’ to to A A , the closer , the closer BB’’ to to BB

Premise 1: Premise 1: x is Ax is A’’Premise 2: Premise 2: IF x is A THEN y is BIF x is A THEN y is B

Conclusion: Conclusion: y is By is B’’

Fall 2002Fall 2002 Lecture Lecture 0606 20صفحه

Graphical InterpretationGraphical Interpretation of GMPof GMP

A’ A B’ B

B’BA B

A’ ?

Fall 2002Fall 2002 Lecture Lecture 0606 21صفحه

P7P7**

P6P6

P5P5

P4P4

P3P3

P2P2

P1

y is not By is not BIF x is A IF x is A y is By is BX is not AX is not AUnknownUnknownIF x is A IF x is A y is By is BX is not AX is not A

y is By is BIF x is A IF x is A y is By is BX is X is morlmorl AAy is y is morlmorl BBIF x is A IF x is A y is By is BX is X is morlmorl AA

y is By is BIF x is A IF x is A y is By is BX is very AX is very Ay is very By is very BIF x is A IF x is A y is By is BX is very AX is very A

y is By is BIF x is A IF x is A y is By is BX is A X is A ConclusionConclusionPremise 2Premise 2Premise 1Premise 1

Note: morl = more or less

Intuitive criteria relating premises and conclusion in Generalized Modus Ponens

Fall 2002Fall 2002 Lecture Lecture 0606 22صفحه

•• Generalized Modus Generalized Modus TollensTollens

Premise 1: Premise 1: y is By is B’’Premise 2: Premise 2: IF x is A THEN y is BIF x is A THEN y is B

Conclusion: Conclusion: x is Ax is A’’

Given two fuzzy propositions Given two fuzzy propositions ““y is By is B’’ ““ and and ““IF x is A THEN y is BIF x is A THEN y is B““ The new fuzzy proposition The new fuzzy proposition ““x is Ax is A’’ ““ could be inferred. It is could be inferred. It is obvious that this rule does not have any meaning unless we obvious that this rule does not have any meaning unless we specify the membership function of specify the membership function of AA’’. It is desired to define . It is desired to define AA’’such that the more difference between such that the more difference between BB’’ and and B B results more results more difference between difference between AA’’ and and A .A .

Fall 2002Fall 2002 Lecture Lecture 0606 23صفحه

t5t5

t4t4

t3t3

t2t2

t1

x is Ax is AIF x is A IF x is A y is By is By is By is Bx is Unknownx is UnknownIF x is A IF x is A y is By is By is By is Bx is not x is not morlmorl AAIF x is A IF x is A y is By is By is not y is not morlmorl BBx is not very Ax is not very AIF x is A IF x is A y is By is By is not very By is not very B

x is not Ax is not AIF x is A IF x is A y is By is By is not B y is not B ConclusionConclusionPremise 2Premise 2Premise 1Premise 1

Intuitive criteria relating premises and conclusion in Generalized Modus Tollens

Fall 2002Fall 2002 Lecture Lecture 0606 24صفحه

•• Generalized Hypothetical SyllogismGeneralized Hypothetical SyllogismGiven two fuzzy propositions Given two fuzzy propositions IF x is A THEN y is BIF x is A THEN y is B andand IF y is BIF y is B’’ THEN z is CTHEN z is CThe following fuzzy proposition could be inferred: The following fuzzy proposition could be inferred: IF x is A THEN z is CIF x is A THEN z is C’’ such that: such that: the closer B to Bthe closer B to B’’ , the closer C, the closer C’’ to Cto C

Premise 1: Premise 1: IF x is A THEN y is BIF x is A THEN y is BPremise 2: Premise 2: IF y is BIF y is B’’ THEN z is CTHEN z is C

Conclusion: Conclusion: IF x is A THEN z is CIF x is A THEN z is C’’

Fall 2002Fall 2002 Lecture Lecture 0606 25صفحه

Graphical InterpretationGraphical Interpretation of GHSof GHS

A B

B’ C

A ? C’

Fall 2002Fall 2002 Lecture Lecture 0606 26صفحه z is not Cz is not CIF y is not B IF y is not B z is Cz is CIF x is A IF x is A y is By is Bs7s7

z is Unknownz is UnknownIF y is not B IF y is not B z is Cz is CIF x is A IF x is A y is By is Bs6s6

s5s5

s4s4

s3s3

s2s2

s1

z is Cz is CIF y is IF y is morlmorl B B z is Cz is CIF x is A IF x is A y is By is Bz is very Cz is very CIF y is IF y is morlmorl B B z is Cz is CIF x is A IF x is A y is By is B

z is Cz is CIF y is very B IF y is very B z is Cz is CIF x is A IF x is A y is By is Bz is z is morlmorl CCIF y is very B IF y is very B z is Cz is CIF x is A IF x is A y is By is B

z is Cz is CIF y is B IF y is B z is Cz is CIF x is A IF x is A y is By is B

ConclusionConclusionIF x is A IF x is A

Premise 2Premise 2IF y is BIF y is B’’ z is Cz is C

Premise 1Premise 1

Intuitive criteria relating premises and conclusion in Generalized hypothetical syllogism

Fall 2002Fall 2002 Lecture Lecture 0606 27صفحه

The above The above intuitiveintuitive criteria are not criteria are not necessarily true for a particular choice necessarily true for a particular choice of fuzzy sets of fuzzy sets

Fuzzy Propositions

Fuzzy Propositions

Fuzzy Propositions

Fuzzy Propositions

MF of the premises

MF of the conclusion

?

Inference Rules

Fall 2002Fall 2002 Lecture Lecture 0606 28صفحه

Compositional Rule of InferenceCompositional Rule of Inferencesupsup--star compositionstar composition

Assume that AAssume that A’’ is a fuzzy set in U having is a fuzzy set in U having µµAA’’ (x)(x) and Q is a fuzzy relation in and Q is a fuzzy relation in UxVUxVhaving having µµQQ(x,y) , (x,y) ,

µµBB’’ (y)= (y)= supsupxxεεUU {{ t[ t[ µµAA’’ (x),(x), µµQQ(x,y) ] (x,y) ] }}

)],(*)([)( 'sup yxxy QAUx

B µµµ∈

′ =

Finding membership function of the conclusion

Fall 2002Fall 2002 Lecture Lecture 0606 29صفحه

Elements of U are related to elements of V through a relation Q.

So how this relation relates the fuzzy sets in U to fuzzy sets in V ?

U

V

x

y µQ(x,y)

A’

B’

• How much y is B’ ?

• How much a desired x is related to this y AND how much that x is A’

Fall 2002Fall 2002 Lecture Lecture 0606 30صفحه

t [ µA’ (x) µQ(x,y) ]

(x is A’) and (x is related to y)

Since different values of x may be related to a particular value of y, it is reasonable to look for the strongest relation when x is changed.

µµBB’’ (y)= (y)= sup sup xxεεUU {{t[ t[ µµAA’’ (x),(x), µµQQ(x,y) ] (x,y) ] }}

How much y is B’ ( µµBB’’ (y)=(y)=? )? )

Fall 2002Fall 2002 Lecture Lecture 0606 31صفحه

Generalized Modus PonensGeneralized Modus Ponens

)],(),([sup)( ' yxxty BAAUx

B →∈

′ = µµµ

Premise 1: Premise 1: x is Ax is A’’Premise 2: Premise 2: IF x is A THEN y is BIF x is A THEN y is B

Conclusion: Conclusion: y is By is B’’

Fall 2002Fall 2002 Lecture Lecture 0606 32صفحه

•• Generalized Modus Generalized Modus TollensTollens

)],(),([sup)( ' yxxtx BABVy

A →∈

′ = µµµ

Premise 1: Premise 1: y is By is B’’Premise 2: Premise 2: IF x is A THEN y is BIF x is A THEN y is B

Conclusion: Conclusion: x is Ax is A’’

Fall 2002Fall 2002 Lecture Lecture 0606 33صفحه

•• Generalized Hypothetical SyllogismGeneralized Hypothetical Syllogism

)],(),,([sup),( zyyxtzx CBBAVy

CA →′→∈

′→ = µµµ

Premise 1: Premise 1: IF x is A THEN y is BIF x is A THEN y is BPremise 2: Premise 2: IF y is BIF y is B’’ THEN z is CTHEN z is C

Conclusion: Conclusion: IF x is A THEN z is CIF x is A THEN z is C’’

Fall 2002Fall 2002 Lecture Lecture 0606 34صفحه

ReferencesReferences1. A course in fuzzy systems and control, 1. A course in fuzzy systems and control, LL--X. Wang, X. Wang, 3. 3. Tutorial on Fuzzy LogicTutorial on Fuzzy Logic, Jan Jantzen, , Jan Jantzen, Technical University of Denmark, Technical University of Denmark, Technical report no 98Technical report no 98--E 868, 1999E 868, 1999