1. ## Fuzzy Logic

Fuzzy logic is the logic of partial set membership, and it has gotten a lot of use in control systems. Here is the most accessible introduction that I've found for it: Fuzzy Logic course notes (PDF)

I'll describe a very simple example: a thermostat. It turns on a room heater if its room is too cold, and turns it off if the room is too hot. That is crisp-logic operation. If the heater can be throttled, then one can do fuzzy-logic operation, throttling it down with greater temperature. One can define two categories: "too hot" and "too cold". For instance, "too hot" can have membership 1 above 25 C, membership 0 below 15 C, and linear in between. "Too cold" can be a mirror image of that, 0 for above 25 C, 1 for below 15 C and linear in between. Both categories have membership 0.5 at 20 C.

So to decide how much to run one's heater, one does (full)*(too-cold membership) + (off)*(too-hot membership), and one has a nice linear decline from 15 C to 25 C.

But fuzzy logic has interesting mathematical properties, and I will be discussing them.  Reply With Quote

2. Crisp logic, as it may be called, is defined by these axioms.

Variable values: true (1), false (0), possibly others
Operators: not (negation), and (conjunction), or (disjunction)

Commutativity: a and b = b and a ... a or b = b or a
Associativity: (a and b) and c = a and (b and c) ... (a or b) or c = a or (b or c)
Idempotence: a and a = a ... a or a = a
Identity: a and true = a ... a or false = a
Zero (annihilation): a and false = false ... a or true = a

Distributivity: a and (b or c) = (a and b) or (a and c) ... a or (b and c) = (a or b) and (a or c)
Absorption: a and (a or b) = a ... a or (a and b) = a

Complementation: a and (not a) = false ... a or (not a) = true
Double Negation: not (not a) = a
Inversion (De Morgan): not (a and b) = (not a) or (not b) ... not (a or b) = (not a) and (not b)

Operation tables:
not ... false: true ... true: false
and ... false false, false true, true false: false ... true true: true
or ... false false: false ... false true, true false, true true: true

These axioms are all true only for 2-valued logic and for powers of 2-valued logic: elements a = (a1, a2, a3, ..., an) where each of the a's is either true or false. Overall true is (all true), and overall false (all false).

So other sorts of logics will violate some of the axioms, though one usually tries to keep those violations to a minimum.

Let us consider a three-valued logic, with maybe added to true and false. Its operation tables are:

false, maybe, true
not:
true, maybe, false
and:
false, false, false
false, maybe, maybe
false, maybe, true
or:
false, maybe, true
maybe, maybe, true
true, true, true

The only axioms violated are the complementation ones, because not maybe = maybe, and
maybe and maybe = maybe, violating non-contradiction
maybe or maybe = maybe, violating excluded middle

Violations of these axioms is typical of fuzzy logic.  Reply With Quote

3. Now we go beyond "maybe" to a continuous value, from 0 (false) to 1 (true).

Let us see what happens for various values of "and" and "or".

and = min
or = max

This set violates the complementation axioms, but no others. The true-maybe-false logic is a subset of this logic with maybe = 1/2.

Jan Łukasiewicz proposed
a and b = max(a+b-1,0)
a or b = min(a+b,1)

This set satisfies the complementation axioms, but violates idempotence, absorption, and distributivity.

There is a multiplicative set
a and b = a*b
a or b = a + b - a*b

It violates complementation, idempotence, absorption, and distributivity, thus sharing the axiom violations of the Zadeh and Łukasiewicz versions.

Horst Hamacher proposed
a and b = (a*b)/(a + b - a*b)
a or b = (a + b - 2*a*b)/(1 - a*b)
with
0 and 0 = 0
1 or 1 = 1

It also violates these four.

I've found
a or b = (a + b)/(1 + a*b)
with (a and b) found using De Morgan inversion. It also violates those four.  Reply With Quote

4. More generally, I've found T-norm, Construction of t-norms: construction of fuzzy "and" operators that satisfy commutativity, associativity, identity, zero, and monotonicity. T-norm is short for "triangular norm".

Being monotonic (uniformly increasing with increasing parameter values):
For (c >= a) and (d >= b), (c and d) >= (a and b)

Commutativity and associativity lead to this construction:
(a and b) = finv(f(a) + f(b)) -- additive
or else
(a and b) = finv(f(a)*f(b)) -- multiplicative
for some function f and its inverse finv. Using De Morgan inversion: a or b = not ( (not a) and (not b) ) gives the "or" functions parallel definitions.

For the min-max "and" and "or", (a or b) has additive generator f(x) = xp, where p -> +infinity.

For the multiplicative "and" and "or", (a and b) has multiplicative generator f(x) = x.

I've tested all the continuous ones in those Wikipedia articles on the Boolean axioms, and they all violate those four sets of axioms violated earlier: complementation, idempotence, absorption, and distributivity.

There are two non-continuous ones listed there:
Drastic: a and b = b if a = 1, a if b = 1, 0 otherwise
Nilpotent Minimum: a and b = min(a,b) if a+b>1, 0 otherwise

I've also found some super-absorption axioms:
a and ((not a) or b) = a and b
a or ((not a) and b) = a or b

These are also violated by the true-maybe-false logic and also by all the continuous-valued logics that I've discussed here.  Reply With Quote

5. Let's consider possible "and" and "or" functions that are commutative and associative, and that have identities and zeros.

First, consider a function f with commutative, associative, and identity properties. I will set its identity to 0 for convenience.

By the first two properties,
f(f(x,y),z) = f(x,f(y,z)) = f(x,f(z,y))

Take d/dy:
f(2)(x,y) * f(1)(f(x,y),z) = f(2)(z,y) * f(2)(x,f(z,y))

Set y = 0:
f(2)(x,0) * f(1)(x,z) = f(2)(z,0) * f(2)(x,z)

Let X = integral of 1/f(2)(x,0) over x and Z for z. With these results, change variables from x to X and z to Z. This gives us
f(1)(X,Z) = f(2)(X,Z)

Change variables in f to give f(X+Z,X-Z). Then
f(1) + f(2) = f(1) - f(2)

This means that f is only a function of X + Z. Setting X = h(x) for some function h, we get
f(x,y) = f(h(x) + h(y))

We can set h(0) = 0 without loss of generality, and we get
f(x,y) = hinv(h(x) + h(y))
where hinv is the inverse function for h. Now consider a zero of the function, 1: f(x,1) = 1. Then,
1 = hinv(h(x) + h(1))
giving us
h(1) = h(x) + h(1)

This means that h(1) must be infinite.

So, (a and b) = hainv(ha(a) + ha(b)) and (a or b) = hoinv(ho(a) + ho(b))
where ha(a) = ho(1-a) and vice versa.  Reply With Quote

6. Let's consider how various Boolean axioms / identities work out. I will assume that ha(a) is finite for a > 0 and that ho(a) is finite for a < 1.

Idempotence ... a and a = a ... a or a = a
For h = ha or ho, 2h(a) = h(a)
For finite h, not possible.

Complementation ... a and (not a) = 0 ... a or (not a) = 1
ha(a) + ha(1-a) = ha(0)
ho(a) + ho(1-a) = ho(1)
The left side is finite and the right side is infinite. Not possible.

Absorption ... a and (a or b) = a ... a or (a and b) = a
ha(a) + ha(a or b) = ha(a) .... ho(a) + ho(a and b) = ho(a)
a or b = 1 ... a and b = 0
ha(a) + ha(b) is infinite ... ho(a) + ho(b) is infinite
For a and b between 0 and 1, not possible.

Super absorption ... a and ((not a) or b) = a and b ... a or ((not a) and b) = a or b
ha(a) + ha((not a) or b) = ha(a) + ha(b) ... ho(a) + ho((not a) and b) = ho(a) + ho(b)
(not a) or b = b ... (not a) and b = b
ho(not a) = 0 ... ha(not a) = 0
a = 1 ... a = 0
Not possible.

I'm stumped on distributivity.

The Zadeh and Lukasiewicz definitions of "and" and "or" both violate the finiteness condition for functions ha and ho. Thus, these arguments do not apply to them.  Reply With Quote

7. Fuzzy set operations has some interesting details. Here are the axioms that it lists:

Fuzzy complement, negation: "not"
1. Boundary condition: not 0 = 1, not 1 = 0
2. Monotonicity: if a < b, then (not a) > (not b)
3. Continuity
4. Being an involution: done twice gives the original value: not (not a) = a

Fuzzy intersection, conjunction (t-norm): "and"
1. Boundary condition: a and 1 = a
2. Monotonicity: if a <= b, then (a and c) <= (b and c)
3. Commutativity
4. Associativity
5. Continuity
6. Sub-idempotency: (a and a) <= a
7. Strict monotonicity: if a1 <= a2 and b1 <= b2, then (a1 and b1) <= (a2 and b2)

Fuzzy union, disjunction (t-conorm): "or"
1. Boundary condition: a or 0 = a
2. Monotonicity: if a <= b, then (a or c) <= (b or c)
3. Commutativity
4. Associativity
5. Continuity
6. Super-idempotency: (a or a) >= a
7. Strict monotonicity: if a1 <= a2 and b1 <= b2, then (a1 or b1) <= (a2 or b2)

It's t-norm and t-conorm, because "and" and "or" are related by DeMorgan's laws: a or b = not( (not a) and (not b) ) and vice versa.

That article states that the only forms of fuzzy "and" and "or" that are idempotent are the Zadeh minmax forms:
a and b = min(a,b)
a or b = max(a,b)

Likewise, the only ones that satisfy complementation -- non-contradiction and excluded middle -- are the Lukasiewicz clamped-sum forms:
a and b = max(a+b-1,0)
a or b = min(a+b,1)  Reply With Quote

8. I've found Theory of T-Norms and fuzzy inference methods by M.M. Gupta and J. Qi

It has a table of what properties are satisfied by different sets of fuzzy operators (Table 2 in it). The fuzzy operators are "T-norms", and they satisfy the commutative, associative, identity, zero, double-negative, and De-Morgan properties.

The Goedel-Zadeh minmax one is the one with and = min, or = max, and it is the only one with distributivity, absorption, and idempotence. Some of the other ones satisfy non-contradiction/excluded-middle, though none of the three that the minmax one satisfies.

Complementation = non-contradiction and excluded middle

Double-negative property = involution

All of them use the standard "not" operator: not a = 1 - a

a and b = min(a,b)
a or b = max(a,b)
(Distributive, absorption, idempotence)

Multiplicative:
a and b = a*b
a or b = a + b - a*b

Lukasiewicz:
a and b = max(a+b-1,0)
a or b = min(a+b,1)

Drastic:
a and b = b if a = 1, a if b = 1, 0 otherwise
a or b = b if a = 0, a if b = 0, 1 otherwise  Reply With Quote

9. FYI fuzzy microcomputers exist. Thery can learn a process without quantified input and output bounds. The best articles are behind an IEEE pay wall.

http://what-when-how.com/microcontro...rocontrollers/  Reply With Quote

10. Here is a big collection of T-norm functions, functions for getting the value of "and" in fuzzy-logic systems. For "or", the function is called a T-conorm.

Hamacher family (parameter p):
a and b = (x*y)/(p + (1-p)*(x+y-x*y))
a or b = (x+y -(2-p)*x*y)/(1 - (1-p)*x*y))
Generator: gadd(a) = log((p + (1-p)*x)/x)

Schweizer-Sklar family (parameter p):
a and b = ( max(0, a^p + b^p - 1) )^(1/p)
a or b = (De Morgan of above)
Generator: gadd(a) = (1 - a^p)/p

Frank family (parameter p):
a and b = log(p, 1 + (p^a - 1)*(p^b - 1)/(p - 1) )
a or b = (De Morgan of above)
Generator: gadd(a) = log( (p-1)/(p^a-1) )

Yager family (parameter p):
a and b = max(0, 1 - ( (1-a)^p + (1-b)^p )^(1/p) )
a or b = min(1, ( a^p + b^p )^(1/p) )
Generator: gadd(a) = (1 - a)^p

Aczel-Alsina family (parameter p):
a and b = exp( - ( (-log a)^p + (-log b)^p )^(1/p) ) )
a or b = (De Morgan of above)
Generator: gadd(a) = (- log a)^p

Dombi family (parameter p):
a and b = 1 / (1 + ((1-a)/a)^p + ((1-b)/b)^p )^(1/p) )
a or b = 1 / (1 + ((1-a)/a)^(-p) + ((1-b)/b)^(-p) )^(-1/p) )

Sugeno-Weber family (parameter p):
a and b = max(0, (a + b - 1 + p*a*b)/(1 + p) )
a or b = min(1, (a + b + p*(a + b - a*b))/(1 + p) )
Generator: gadd(a) = 1 - log(1+p, 1+p*a)

a and b = a*b/max(a,b,p)
a or b = (De Morgan of above)

Yandong family (parameter p):
a and b = max( (1+p)*(a+b-1) - p*a*b, 0)
a or b = min( a + b + p*a*b, 1)

Weber family with asymmetric negation (parameter p):
not a = (1 - a)/(1 + p*a) -- still a double-negative involution
a and b = max( (a + b - 1 + p*a*b)/(1 + p), 0)  Reply With Quote