Fuzzy Logic The restriction of classical propositional calculus to a two- valued logic has created...

Post on 16-Dec-2015

219 views 1 download

Transcript of Fuzzy Logic The restriction of classical propositional calculus to a two- valued logic has created...

Fuzzy Logic

The restriction of classical propositional calculus to a two-valued logic has created many interesting paradoxes over the ages. For example, the barber of Seville is a classic paradox (also termed as Russell’s barber). In the small Spanish town of Seville, there is a rule that all and only those men who do not shave themselves are shaved by a barber. Who shaves the barber?

Another example comes from ancient Greece. Does the liar from Crete lie when he claims, “All Cretians are liars”? If he is telling the truth, then the statement is false. If the statement is false, he is not telling the truth.

Fuzzy Logic

Let S: the barber shaves himself

S’: he does not

S S’ and S’ S

T(S) = T(S’) = 1 – T(S)

T(S) = 1/2

But for binary logic T(S) = 1 or 0

Fuzzy propositions are assigned for fuzzy sets:

10

~

~~

A

A xPT

Fuzzy Logic

~~

1 PTPT

~~~~

~~~~

,max

:

QTPTQPT

BorAxQP

~~~~

~~~~

,min

:

QTPTQPT

BandAxQP

~~~~~~

~~

,max QTPTQPTQPT

QP

Negation

Disjunction

Conjunction

Implication [Zadeh, 1973]

Fuzzy Logic

xyxyx

YABAR

ABAR~~~~

1,max,~~~~

Example:

= medium uniqueness =

= medium market size =

Then…

4

2.0

3

1

2

6.0

5

3.0

4

8.0

3

1

2

4.0

~A

~B

Fuzzy Logic

Fuzzy Logic

When the logical conditional implication is of the compound form,

IF x is , THEN y is , ELSE y is

Then fuzzy relation is:

whose membership function can be expressed as:

~A

~B

~C

~~~~~CABAR

yxyxyx CABAR

~~~~~

1,max,

Fuzzy Logic

Rule-based format to represent fuzzy information.

Rule 1: IF x is , THEN y is , where and represent fuzzy propositions (sets)

Now suppose we introduce a new antecedent, say, and we consider the following rule

Rule 2: IF x is , THEN y is

~A

~B

~B

~A

'~A '

~B

RAB ''~~

Fuzzy Logic

Fuzzy Logic

Suppose we use A in fuzzy composition, can we get

The answer is: NO

Example:

For the problem in pg 127, let

A’ = AB’ = A’ R = A R = {0.4/1 + 0.4/2 + 1/3 + 0.8/4 + 0.4/5 + 0.4/6} ≠ B

RBB ~~

Fuzzy Tautologies, Contradictions, Equivalence, and Logical Proofs

The extension of truth operations for tautologies, contradictions, equivalence, and logical proofs is no different for fuzzy sets; the results, however, can differ considerably from those in classical logic. If the truth values for the simple propositions of a fuzzy logic compound proposition are strictly true (1) or false (0), the results follow identically those in classical logic. However, the use of partially true (or partially false) simple propositions in compound propositional statements results in new ideas termed quasi tautologies, quasi contradictions, and quasi equivalence. Moreover, the idea of a logical proof is altered because now a proof can be shown only to a “matter of degree”. Some examples of these will be useful.

Fuzzy Tautologies, Contradictions, Equivalence, and Logical Proofs

Truth table (approximate modus ponens)

A B AB (A(AB)) (A(AB))B

.3 .2 .7 .3 .7

.3 .8 .8 .3 .8 Quasi tautology

.7 .2 .3 .3 .7

.7 .8 .8 .7 .8

Truth table (approximate modus ponens)

A B AB (A(AB)) (A(AB))B

.4 .1 .6 .4 .6

.4 .9 .9 .4 .9 Quasi tautology

.6 .1 .4 .4 .6

.6 .9 .9 .6 .9

Fuzzy Tautologies, Contradictions, Equivalence, and Logical Proofs

The following form of the implication operator show different techniques for obtaining the membership function values of fuzzy relation defined on the Cartesian product space X × Y:

~R

Fuzzy Tautologies, Contradictions, Equivalence, and Logical Proofs

The following common methods are among those proposed in the literature for the composition operation , where is the input, or antecedent defined on the universe X, is the output, or consequent defined on the universe Y, and is a fuzzy relation characterizing the relationship between specific inputs (x) and specific outputs (y):

Refer fig on next slide…

~~~RAB

~A

~B

~R

Fuzzy Tautologies, Contradictions, Equivalence, and Logical Proofs

where f(.) is a logistic function (like a sigmoid or step function) that limits the value of the function within the interval [0,1]

Commonly used in Artificial Neural Networks for mapping between parallel layers of a multi-layer network.

Fuzzy Rule-based systems

Using fuzzy sets as a calculus to interpret natural language. It is vague, imprecise, ambiguous and fuzzy.

Fundamental terms atoms

Collection of atomic terms composite or set of terms

An atomic term (a linguistic variable) can be interpreted using fuzzy sets.

An atomic term in the universe of natural language, X.

Define a fuzzy set in the universe of interpretations or meanings, Y as a specific meaning of .

~A

Fuzzy Rule-based systems

~A

X Y ~~AM

Mapping of a linguistic atom to a cognitive interpretation ~A

251

2525

251

,

12

~

~~

y

yy

yyoug

yy

M

AM

Fuzzy Rule-based systems

Composite

yyNot

yyy

and

yyy

or

and

or

1:

,min

:

,max

:

Linguistic Hedges

15.0121

5.002

2

2

75.0

5

21

21

25.1

4

2

2

yy

yy

Intensify

Minus

y

y

Slightly

plus

veryVery

y

y

Very

y

y

It increases contrast.

Precedence of the Operations

1 Hedge, not

2 and

3 or

Example:

Suppose we have a universe of integers, Y = {1,2,3,4,5}. We define the following linguistic terms as a mapping onto Y:

“small” =

“large” =

5

1.

4

8.

3

6.

2

4.

1

2.

5

2.

4

4.

3

6.

2

8.

1

1

Example (contd)

Then we construct a phrase, or a composite term:

= “not very small and not very, very large”

which involves the following set-theoretic operations:

4

6.

3

64.

2

36.

4

6.

3

9.

2

1

1

1

5

96.

4

84.

3

64.

2

36.

Suppose we want to construct a linguistic variable “intensely small” (extremely small); we will make use of the equation defined before to modify “small” as follows:

Example (contd)

“Intensely small” =

5

08.0

4

32.0

3

68.0

2

92.0

1

1

5

2.02

4

4.02

3

6.0121

2

8.0121

1

1121

22

222

Rule-based Systems

IF-THEN rule based form

Canonical Rule Forms

1. Assignment statementsx = large, x y

2. Conditional statementsIf A then B,If A then B, else C

3. Unconditional statementsstopgo to 5

unconditional can beIf any conditions, then stopIf condition Ci, then restrict Ri

Decomposition of Compound Rule

Any compound rule structure can be decomposed and reduced to a number of simple canonical rules.

The most commonly used techniques

Multiple Conjunctive Antecedents

If x is and , then y is

Define

~A LAA

~

2

~ SB

~LS AAAA

~

2

~

1

~~

xxx LS AAA

~

1

~~

,,min

The rule can be rewritten.

IF THENSA

~

SB~

Multiple Disjunctive Antecedents

If x is or or … or

then y is

1

~A 2

~A LA

~

SB~

xxx

AAAA

LS AAA

LS

,,max 1

~

2

~

1

~~

IF THENSA

~

SB~

Condition Statements

1. IF THEN ( ELSE ) decomposed into:

IF THEN or IF NOT THEN

1

~A

~

1B2

~B

1

~A 1

~B 1

~A 2

~B

2. IF (THEN ) unless decomposed into:IF THEN or IF NOT THEN NOT

1

~A

~

1B 2

~A

1

~A 1

~B 2

~A 1

~B

3. IF THEN ( ELSE IF THEN ( )) decomposed into:

IF THEN or IF NOT and THEN NOT

1

~A

~

1B2

~A

1

~A 1

~B 1

~A 2

~B

~

2B2

~A

4. Nested IF-THEN rules IF THEN (IF , THEN ( )) becomes IF and THEN

Each canonical form is an implication, and we can reduce the rules to a series of relations.

1

~A 2

~A

1

~B

1

~A 2

~A 1

~B

Condition Statements

“likely” “very likely” “highly likely” “true” “fairly true” “very true” “false” “fairly false” “very false”

1

x

Xx

anything

Let be a fuzzy truth value “very true” “true” “fairly true” “fairly false” “false”

A truth qualification proposition can be expressed as:“x is is ”

orx is is =

~A

~A

5.0~

~

x

x

A

A

Aggregation of fuzzy rule

The process of obtaining the overall consequent (conclusion) from the individual consequent contributed by each rule in the rule-base is known as aggregation of rules.

Conjunctive System of Rules:

Yyyyy

yyyy

ryyy

r

,,min 1

21

Disjunctive System of Rules:

Yyyyy

yyyy

ryyy

r

,,max 1

21

Graphical Technique of Inference

If x1 is and x2 is then y is , k = 1,2,..., r

Graphical methods that emulate the inference process and make manual computations involving a few simple rules.

Case 1: inputs x1, and x2 are crisp.

Memberships1 x1 = input(i)

(x1) = (x1 – input(i)) = 0 otherwise

1 x2 = input(i)(x2) = (x2 – input(i)) = 0 otherwise

Graphical Technique of Inference

For r disjunctive rules:

A11 refers to the first fuzzy antecedent of the first rule.

A12 refers to the second fuzzy antecedent of the first rule.

rk

jinputiinputy kkk AAkB

,,2,1

,minmax2~1~~