340 likes | 718 Views
Logic is based on set theory, and when we switch to fuzzy sets it will have an effect on logic. Fuzzy Logic. Jan Jantzen jj@inference.dk www.inference.dk 2013. Summary. Fuzzy logic is computing with words ( Zadeh ) Approximate reasoning Consistency. Intelligent computers.
E N D
Logic is based on set theory, and when we switch to fuzzy sets it will have an effect on logic. Fuzzy Logic Jan Jantzen jj@inference.dk www.inference.dk 2013
Summary • Fuzzy logic is computing with words (Zadeh) • Approximate reasoning • Consistency Intelligent computers Computers can make decisions even with statements that are true to a degree between 0 and 1 If we build a logic on fuzzy sets, will the usual laws still hold?
Inference by Computer Fuzzy controller • If room is warm then set cooling power to 500 watts • Temperature is 21 deg C • Cooling = 250 watts Classical controller • If T > 21 C then Cooling = on • If T ≤ 21 C then Cooling = off
Key Concepts • And, or, not, nor, xor, etc. • implication*, equivalence* • rules of inference*, tautologies* • *) difficult
Fuzzy reasoning: True Love Wife: Do you love me? Husband (Boolean logician): Yes. Wife: How much?
FAQ: Why fuzzy logic? A: • It is tolerant • Mathematically consistent (almost) • Operational (= executable by computers) • A way to communicate with computers
Example: Betting On Baseball If either the Pirates or the Cubs loose and the Giants win, then the Dodgers will be out of first place, and I will loose a bet. ((p c) g) (d b) This expression can be programmed on a computer.
25 = 32 possible combinations 23 legal combinations, 9 illegal 10 possible cases where I will win the bet(b=1) Exhaustive Search Solution The validity is guaranteed !
Define disjunction (OR) Truth table
Boolean OR as a Cayley Table It contains the same information, only reorganised into a two-dimensional array.
Define negation (NOT) p = 1 - p p = p If p is 0 then 'not p' = 1, and if p is 1 then 'not p' = 0. The law of involution is valid
Assume DeMorgan's Laws These two laws provide a connection between AND and OR by means of negation.
Derive NAND The left hand side is clearly 'not AND', which is NAND. The right hand side contains only OR and NOT, which we have already defined previously. We have thus derived a new operation based on existing definitions.
NAND table Example. Suppose p = 0 and q = 0, corresponding to the upper left cell. Then NOT p = 1 and NOT q = 1. Use the previously defined OR table to find the result 1, which is the truth value in the upper left cell.
Derive conjunction (AND) The left hand side is obviously AND. The right hand side is the negation of NAND, which is also AND. It contains only OR and NOT, which we have already defined previously. We have again derived a new operation based on existing definitions.
AND table We get this from the NAND table by negating the content of all cells.
Short recap • Starting from OR, NOT, and DeMorgan'slaws, • wederived NAND and AND • (and also NOR, not shown but easy; even XOR couldbederived in a similarmanner)
Fuzzy OR We work with only three truth values 0, 0.5 and 1 to preserve space. Actually, these three are sufficient representatives of all truth values, as long as we only work with AND, OR, and NOT.
Fuzzy OR as a Cayley Table It contains the same information, only reorganised into a two-dimensional array.
Derive fuzzy NAND We do exactly as before in order to find the contents of the cells.
Derive fuzzy AND Again, we get this from the NAND table by negating the content of each cell.
Short recap • Whenfuzzy OR is defined as MAX, • then the derivedfuzzy AND is consistentwith MIN • (wecould go on and derivefuzzy NOR and fuzzy XOR)
Fuzzy Baseball Example If either the Pirates or the Cubs loose and the Giants win, then the Dodgers will be out of first place, and I will loose a bet. ((p c) g) (d b)
35 = 243 (was 32) possible combinations 33 (was 10) possible cases where I will win the bet(b = 1) Exhaustive Search Solution One example of a winning outcome: Could be interpreted as 'maybe'
Triangular Norms Candidates for AND. OR candidates are called triangular conorms. If we define AND as product (×), instead of min, then OR must be 'probabilistic sum' in order to keep the DeMorgan laws satisfied. In that case, we go through the previously developed scheme again in order to derive the remaining operations.
Summary • Fuzzy and, or, not, nor, etc. can be defined in a consistent manner (DeMorgans laws hold).
Applications • Automatic control, robots • Expert systems • Medical diagnosis • Financial decision support • Image processing • Intelligent computers