You are on page 1of 44

Fuzzy Rule Base and

Inferences
Dr. K. Ganesan
Director TIFAC-CORE in
Automotive Infotronics,
VIT University, Vellore 632 014
kganesan@vit.ac.in
Fuzzy Rule Base and Approximate
Reasoning
Fuzzy logic uses linguistic variables.
The values of a linguistic variable are words or sentences in a
natural or artificial language.
For example, height is a linguistic variable if it takes values
such as tall, medium, short and so on.
The linguistic variable provides approximate characterization
of a complex problem.
A linguistic variable is characterized by
name of the variable (x), 2) terms set of the variable t(x), 3)
syntactic rule for generating the values of x 4) semantic rule
for associating each value of x with its meaning.
Apart from the linguistic variables, there exist what are called
as linguistic hedges (linguistic modifiers).
For example, in the fuzzy set very tall, the word very is a
linguistic hedge. A few popular linguistic hedges are : very,
high, slightly, moderately, plus, minus, fairly, rather.
Reasoning
Reasoning has logic as its basis, whereas
propositions are text sentences expressed in
any language and are generally expressed in a
canonical form as z is P where z = symbol of
the subject and P = predicate designing the
characteristics of the subject.
For example, London is in United Kingdom is
a proposition in which London is the subject
and in United Kingdom is the predicate, which
specifies a property of London, its
geographical location in United Kingdom.
Logic operations over propositions
Every proportion has its opposite, called negation.
For assuming opposite truth values, a proposition and its
negation are required.
Truth tables define logic functions of 2 propositions. Let
X and Y be two propositions, either of which can be true
or false.
The basic logic operations performed over the
propositions are the following:
Conjunction (^): X AND Y
Disjunction( V): X OR Y
Implication or conditional (=>) : IF X THEN Y
Bidirectional or equivalence () : X IF AND ONLY IF Y.
Few inference ruels
On the basis of these operations on propositions,
inference rules can be formulated.
Few inference rules are as follows:
[X ^ (X => Y)] => Y
[Y ^ (X => Y)] => X
[(X => Y) ^ (Y => Z)] => (X => Z)
The above rules produce certain propositions that are
always true irrespective of the true values of propositions
X and Y.
Such propositions are called tautologies.
An extension of set-theoretic bivalence logic is the fuzzy
logic where the truth values are terms of the linguistic
variable truth.
Linguistic truth value
The truth values of propositions in fuzzy logic
are allowed to range over the unit interval [0,1].
A truth value in fuzzy logic very true may be
interpreted as a fuzzy set in [0,1].
The truth value of the proposition Z is A, or
simply the truth value of A, denoted by tv(A) is
defined by a point in [0,1] (called the numerical
truth value) or a fuzzy set in [0,1] (called the
linguistic truth value).
Truth value of a proposition
The truth value of a proposition can be obtained
from the logic operations of other propositions
whose truth values are known.
If tv(X) and tv(Y) are numerical truth values of
propositions X and Y, respectively, then
tv(X AND Y) = tv(X) ^ tv(Y) = min[tv(X), tv(Y)]
tv(X OR Y) = tv(X) V tv(Y) = max[tv(X), tv(Y)]
tv(NOT X) = 1 tv(X)
tv(X => Y) = tv(X) => tv(B) = max{1- tv(X),
min[tv(X), tv(Y)]}
Fuzzy propositions
For extending the reasoning capability, fuzzy logic uses
fuzzy predicates, fuzzy predicate modifiers, fuzzy
quantifiers and fuzzy qualifiers in the fuzzy propositions.
The fuzzy propositions make the fuzzy logic differ from
classical logic. The fuzzy propositions are as follows:
Fuzzy predicates: In fuzzy logic the predicates can be
fuzzy, for example, tall, short, quick.
Hence we have propositions like Peter is tall. It is obvious
that most of the predicates in natural language are fuzzy
rather than crisp.
Fuzzy-predicate modifiers: In fuzzy logic, there exists a
wide range of predicate modifiers that act as hedges, for
example, very, fairly, moderately, rather slightly.
These predicate modifiers are necessary for generating the
values of a linguistic variable.
An example can be the proposition Climate is moderately
cool.
Fuzzy quantifiers: The fuzzy quantifiers such as most,
several, many, frequently are used in fuzzy logic.
Employing these, we can have proposition like Many
people are educated.
A fuzzy quantifier can be interpreted as a fuzzy number
or a fuzzy proportion, which provides an imprecise
characterization of the cardinality of one or more fuzzy or
nonfuzzy sets.
Fuzzy quantifiers can be used to represent the meaning
of propositions containing probabilities; as a result, they
can be used to manipulate probabilities within fuzzy logic.
Fuzzy qualifiers: There are 4 modes of qualification in
fuzzy logic, which are as follows:
Fuzzy truth qualification: It is expressed as x is , in
which is a fuzzy truth value.
A fuzzy truth value claims the degree of truth of a fuzzy
proposition.
Consider the example, (Paul is Young) is NOT VERY
True.
Here the qualified proposition is (Paul is Young) and the
qualifying fuzzy truth value is NOT Very True.
Fuzzy probability qualification:
It is denoted as x is , where is fuzzy probability. In
conventional logic, probability is either numerical or an
interval.
In fuzzy logic, fuzzy probability is expressed by terms such
as likely, very likely, unlikely, around and so on.
Consider the example, (Paul is Young) is likely.
Here the qualifying fuzzy probability is Likely.
These probabilities may be interpreted as fuzzy numbers,
which may be manipulated using fuzzy arithmetic.
Fuzzy possibility qualification: It is expressed x is ,
where is a fuzzy possibility and can be of the following
forms: possible, quite possible, almost impossible.
These values can be interpreted as labels of fuzzy subsets
of the real line.
Consider the example, (Paul is Young) is Almost
Impossible.
Here the qualifying fuzzy possibility is Almost Impossible.
Fuzzy usuality qualification:
It is expressed as usually (X) = usually (X is F),
in which the subject X is a variable taking values
in a universe of discourse U and and the
predicate F is a fuzzy subset of U and
interpreted as a usual value of X denoted by
U(X) = F.
The propositions that are usually true or the
events that have high probability of occurrence
are related by the concept of usuality
qualification.
Formation of Rules
The general way of representing human
knowledge is by forming natural language
expressions given by
IF antecedent THEN consequent.
The above expression is called as the IF-THEN
rule based form.
There are 3 general forms that exist for any
linguistic variable. They are:
Assignment statements
Conditional statements
Unconditional statements
Assignment statements: They are of the form:
y = small
Orange color = orange
a = s
Paul is not tall and not very short
Climate = autumn
Outside temperature = normal
Conditional statements: The following are some
examples
IF y is very cool THEN stop.
IF A is high THEN B is low ELSE B is not low.
IF temperature is high THEN climate is hot.
Unconditional statements: They can be of the form
Goto sum
Stop
Divide by a.
Turn the pressure low.
The assignment statements limit the value of a variable
to a specific quantity.
The canonical rule formation for a fuzzy rule-based
system is given below:
The canonical form of fuzzy rule based system
Rule 1: If condition C1, THEN restriction R1
Rule 2: If condition C2, THEN restriction R2

Rule n: If condition Cn, THEN restriction Rn.
Generally, both unconditional as well as conditional
statements place some restrictions on the consequent of
the rule-based process.
Fuzzy sets and relations generally model the restrictions.
The restriction statements, irrespective of conditional or
unconditional statements, are usually connected by
linguistic connectives such as and , or, or else.
The restrictions denoted as R1, R2, .., Rn apply to the
consequent of the rules.
Decomposition of Rules
(Compound Rules)
A compound rule is a collection of many simple rules
combined together.
Any compound rule structure may be decomposed and
reduced to a number of simple canonical rule forms.
The rules are generally based on natural language
representations.
The following are the methods used for decomposition of
compound linguistic rules into simple canonical rules.
1) Multiple conjunctive antecedents
IF x is A1, A2, , An THEN y is Bm.
Assume a new fuzzy set Am defined as
Am = A1 A2 An
And expressed by means of membership function
Am(x) = min[A1(x), A2(x), ..., An(x).
In view of the fuzzy intersection operation, the compound rule
may be rewritten as
IF Am THEN Bm.
2) Multiple disjunctive antecedents
IF x is A1 OR x is A2, OR x is An THEN y is
Bm.
This is can be written as
IF x is An THEN y is Bm,
Where the fuzzy set Am is defined as
Am = A1 U A2 U A3 U U An.
The membership function is given by
Am(x) = max[A1(x), A2(x), ..., An(x)
which is based on the fuzzy union opearation.
3) Conditional statements (with
ELSE and UNLESS)
Statements of the kind
IF A1 THEN (B1 ELSE B2)
Can be decomposed into two simple canonical rule forms,
connected or OR:
IF A1 THEN B1
OR
IF NOT A1 THEN B2
IF A1 (THEN B1) UNLESS A2
Can be decomposed as
IF A1 THEN B1
OR
IF A2 THEN NOT B1
IF A1 THEN(B1) ELSE IF A2 THEN (B2)
Can be decomposed into the form
IF A1 THEN B1
OR
IF NOT A1 AND IF A2 THEN B2.
4) Nested-IF-THEN rules
The rule IF A1 THEN [IF A2 THEN (B1)]
can be of the form
IF A1 AND A2 THEN B1.
Thus based on the above methods,
compound rules can be decomposed into
series of canonical simple rules.
Aggregation of Fuzzy Rules
The rule based system involves more than one rule.
Aggregation of rules is the process of obtaining the overall
consequents from the individual consequents provided by
each rule.
The following 2 methods exists that aid in determining the
aggregation of fuzzy rules:
Conjunctive system of rules: For a system of rules to be
jointly satisfied, the rules are connected by and
connectives.
Here the aggregated output, y is determined by the fuzzy
intersection of all individual rule consequents, yi where i=1
to n, as
y = y1 and y2 and and yn
or
y = y1 y2 y3 yn.
This aggregate output can be defined by the membership
function
y(y) = min[y1(y), y2(y), yn(y).
Disjunctive system of rules:
In this case, the satisfaction of at least one rule is
required.
The rules are connected by or connectives.
Here, the fuzzy union of all individual rule contributions
determines the aggregated output, as
y = y1 or y2 or or yn
or
y = y1 U y2 U U yn
Again it can be defined by the membership function
y(y) = min[y1(y), y2(y), yn(y).
Fuzzy Reasoning (Approxmate
Reasoning)
In fuzzy logic both the antecedents and consequents are
allowed to be fuzzy propositions.
There exist four modes of fuzzy approximate reasoning, which
include:
Categorical reasoning
Qualitative reasoning
Syllogistic reasoning
Dispositional reasoning
Categorical reasoning
In this type of reasoning, the antecedents contain no fuzzy
quantifiers and fuzzy probabilities.
The antecedents are assumed to be in canonical form. Let
us use the notations:
L, M, N , = fuzzy variables taking in the universe U, V, ;
A, B, C , = fuzzy predicates
1) The projection rule of inference is defined by
[L, M is R] / L is [R L]
Where [R L] denotes the projection of fuzzy relation R
on L.
2) The conjunction rule of inference is given by
L is A, L is B L is A B
(L,M) is A, L is B (L, M) is A ( B x V)
(L,M) is A, (M, N) is B (L,M,N) = (A x W) ( U x B)
3) The disjunction rule of inference is given by
L is A OR L is B L is A x B
L is A, M is B (L, M) is A x B
4) The negative rule of inference is given by
NOT (L is A) A.
5) The compositional rule of inference is given
by
L is A, (L,M) is R M is A.R
Where A.R denotes the max-min composition of
a fuzzy set A and a fuzzy relation R given by
A.R(v) = max.min[A(u), R(u,v)].
6) The extensin principle is defined as
L is A f(L) is f(A)
Where f is a mapping from u to v so that L is
mapped into f(L); and based on the extension
principle, the membership function of f(A) is
defined as
f(A)(v) = Sup A(u), where u U, v V.
Qualitative Reasoning
In qualitative reasoning the input-output relationship of a
system is expressed as a collection of fuzzy IF THEN rules
where the antecedents and consequents involve fuzzy
linguistic variables.
Qualitative reasoning is widely used in control system
analysis.
Let A and B be the fuzzy input variables and C be the fuzzy
output variable.
The relation among A, B and C may be expressed as
If A is x1 AND B is y1, THEN C is z1
If A is x2 AND B is y2, THEN C is z2

If A is xn AND B is yn, THEN C is zn
Where xi, yi and zi, i = 1 to n, are fuzzy subsets of their
respective universe of discourse.
Syllogistic Reasoning
In syllogistic reasoning, antecedents with fuzzy
quantifiers are related to inference rules.
A fuzzy syllogism can be expressed as follows:
x = k1 As are Bs
y = k2 Cs are Ds
z = k3 Es are Fs
In the above A,B,C,D, E and F are fuzzy predicates; k1
and k2 are the given fuzzy quantifiers and k3 is the fuzzy
quantifier which has to be decided.
All the fuzzy predicates provide a collection of fuzzy
syllogisms.
These syllogisms create a set of inference rules, which
combines evidence through conjunction and disjunction.
Given below are some important
fuzzy syllogisms.
Produce syllogism: C.A ^ B, F = C ^ D.
Chaining syllogism: C = B, F = D, E = A
Consequent conjunction syllogism: F = B ^ D, A
= C = E
Consequent disjunction syllogism: F = B v D, A =
C = E
Precondition conjunction syllogism: E = A ^ C, B
= D = F
Precondition dijunction syllogism : E = A v C, B =
D = F.
Dispositional Reasoning
In this kind of reasoning, the antecedents are dispositions that
may contain, implicitly or explicitly, the fuzzy quantifier
usually.
Usuality plays a major role in dispositional reasoning and it
links together the dispositional syllogistic modes of reasoning.
The important inference rules of dispositional reasoning are
the following:
1) Dispositional projection rule of inference:
Usually ((L,M) is R) usually ( L is [ R L]).
Where [ R L] is the projection of fuzzy relation R on L.
2) Dispositional chaining hypersyllogism:
k1 As are Bs , k2 Bs are Cs, usually ( B C A)
usually ( (Q1(,)Q(2)) As are Cs).
The fuzzy quantifier usually is applied to the containment
relation B C A.
3) Dispositional consequence conjunction syllogism:
usually (As are Bs), usually (As or Cs)
(2 usually (-)1 (As are (B and C)s)
Is a specific case of dispositional reasoning.
4) Dispositional entailment rule of inference:
usually (x is A), A C B usually(x is B)
x is A, usually (A C B) usually (x is B)
usually (x is A), usually (A C B) usually2 (x is B)
is the dispositional entailment rule of inference.
Here usually2 is less specific than usually
Fuzzy Inference System (FIS)
Fuzzy rule-based systems, fuzzy models, and fuzzy
expert systems are also known as fuzzy inference
systems.
The key unit of a fuzzy logic system is FIS.
The primary work of this system is decision making.
FIS uses IF THEN rules along with connectors OR
or AND for making necessary decision rules.
The input to FIS may be fuzzy or crisp, but the output
from FIS is always a fuzzy set.
When FIS is used as a controller, it is necessary to have
crisp output.
Hence, there should be a defuzzification unit for
converting fuzzy variables into crisp variables along FIS.
Construction and working Principle
of FIS
A FIS is constructed of 5 functional blocks as shown in
Figure below. They are:
1) A rule base that contains numerous fuzzy IF-THEN
rules.
2) A database that defines the membership functions of
fuzzy sets used in fuzzy rules.
3) Decision making unit that performs operation on the
rules.
4) Fuzzification interface that converts the crisp
quantities into fuzzy quantities.
5) Defuzzification interface that converts the fuzzy
quantities into crisp quantities.
The working methodology of FIS is
as follows:
Initially, in the fuzzification unit, the crisp input is
converted into fuzzy input.
Various fuzzification methods are employed for
this.
After this process, rule base is formed.
Database and rule base are collectively called
the knowledge base.
Finally, defuzzification process is carried out to
produce crisp output.
Mainly, the fuzzy rules are formed in the rule
base and suitable decisions are made in the
decision making unit.
Methods of FIS
There are 2 important types of FIS. They are:
Mamdani FIS
Sugeno FIS
The difference between the 2 methods lies in the
consequence of fuzzy rules.
Fuzzy sets are used as rule consequents in
Mamdani FIS and linear function of input
variables are used as rule consequents in
Sugenos method.
Mamdanis rule finds a greater acceptance in all
universal approximators than Sugenos method.
Mamdani FIS
Ebsahim Mamdani proposed this system in 1975
to control a stream engine and boiler
combination by synthesizing a set of fuzzy rules
obtained from people working on the system.
In this case, the output membership functions
are expected to be fuzzy sets.
After aggregation process, each output variable
contains a fuzzy set, hence defuzzification is
important at the output stage.
The following steps have to be followed to
compute the output from this FIS.
Step 1: Determine a set of fuzzy rules.
Step 2: Make the inputs fuzzy using input membership
functions.
Step 3: Combine the fuzzified inputs according to the
fuzzy rules for establishing a rule strength.
Step 4: Determine the consequent of the rule by
combining the rule strength and the output membership
function.
Step 5: Combine all the consequents to get an output
distribution.
Step 6: Finally, a defuzzified output distribution is
obtained.
The fuzzy rules are formed using IFTHEN
statements and AND/OR connectives.
The consequence of the rule can be obtained in 2 steps:
By computing the rule strength completely using the
fuzzified inputs from the fuzzy combination;
By clipping the output membership function at the rule
strength.
The outputs of all the fuzzy rules are combined to obtain
one fuzzy output distribution.
From FIS, it is desired to get only one crisp output.
This crisp output may be obtained from defuzzification
process.
The common technique of defuzzification used are
centre of mass and mean of maximum.
Consider a two input Mamdani FIS with 2 rules.
The model fuzzifies the two inputs by finding the
intersection of two crisp input values with the input
membership function.
The minimum operation is used to compute the fuzzy
input and for combining the two fuzzified inputs to
obtain a rule strength.
The output membership function is clipped a the rule
strength.
Finally, the maximum operator is used to compute the
fuzzy output or for combining the output of the two
rules.
Takagi- Sugeno Fuzzy Model (TS
Method)
Sugeno fuzzy method was proposed by Takagi, Sugeno
and Kang in 1985.
The format of the fuzzy rule of a Sugeno fuzzy model is
given by:
IF x is A and y is B THEN z = f(x,y)
Where A,B are fuzzy sets in the antecedents and z=f(x,y)
is a crisp function in the consequent.
Generally, f(x,y) is a polynomial in the input variables x
and y.
If f(x,y) is a first-order polynomial, we get first order
Sugeno fuzzy model.
If f is a constant, we get zero-order Sugeno fuzzy model.
A zero order Sugeno fuzzy model is functionally
equivalent to a radial basis function network under
certain minor constraints.
The main steps of the fuzzy inference process namely,
fuzzifying the inputs
applying the fuzzy operator
are exactly the same.
The main difference between Mamdanis and Sugenos
methods is that Sugeno output membership functions
are either linear or constant.
The rule format of Sugeno form is given by:
If 3=x and 5=y then output is z = ax+by+c.
For a Sugeno model of zero order, the output level z is a
constant.
The operation of a Sugeno rule is shown in Figure
below:
Sugenos method can act as an interpolating supervisor
for multiple linear controllers, which are to be applied,
because of the linear dependence of each rule on the
input variables of a system.
A Sugeno model is suited for smooth interpolation of
linear gains that would be applied across the input
space and for modeling nonlinear systems by
interpolating between multiple linear models.
The Sugeno System uses adaptive techniques for
constructing fuzzy models.
The adaptive techniques are used to customize the
membership fuctions.
Comparison between Mamdani and
Sugeno Method
The main difference between Mamdani and
Sugeno methods lies in the output membership
fuctions.
The Sugeno output membership functions are
either linear or constant.
The difference also lies in the consequents of
their fuzzy rules and as a result their
aggregation and defuzzification procedures
differ suitably.
A large number of fuzzy rules must be employed
in Sugeno method for approximating periodic or
highly oscillatory functions.
The configuration of Sugeno fuzzy systems can be
reduced and it becomes smaller than that of Mamdani
fuzzy systems if nontriangular or nontrapezoidal fuzzy
input sets are used.
Sugeno controllers have more adjustable parameters in
the rule consequent and the number of parameters
grows exponentially with the increase of the number of
input variables.
There exist several mathematical results for Sugeno
fuzzy controllers than for Mamdani controllers.
Formation of Mamdani FIS is more easier than Sugeno
FIS.
The Main advantages of Mamdani
method are:
It has widespread acceptance
It is well-suitable for human input
It is intuitive
On the other hand, the advantages of Sugeno
method include:
It is computationally efficient.
It is compact and works well with linear
technique, optimization technique and adaptive
technique.
It is best suited for mathematical analysis.
It has a guaranteed continuity of the output
surface.

You might also like