Skip to main content
GameDev.net gamedev.net
🔒 Locked

Fuzzy logic operators

Started by Steadtler Mar 17, 2005 at 6:24 PM 6 replies 1.5k views
Original Post
Steadtler
Steadtler
Hi! Im thinking about designing about a fuzzy logic decision tree system. I need to decide how to implement the AND and OR operators. All the texts I read suggest either min and max respectively, or some overgrown bayesian solution. I dont like min and max too much, mostly the max. For example, if a and b are both "probable", I would like "a OR b" to be very probable. I've got a couple of ideas, but as Im not an AI guru, there is probably someone here that have better ideas. Suppose a, b between 0 and 1. The requirements are : -a AND b <= min(a,b), >= 0 -a OR b >= max(a,b), <= 1 -if (a,b} = 0.5, then (a AND b) == (a OR b) == 0.5 Desired behavior would be: -if {a,b} > 0.5 and < 1, then (a OR b) > max(a, b) -if {a,b} < 0.5 and > 0, then (a AND b) < min(a,b) -quick Any ideas? [Edited by - Steadtler on March 18, 2005 8:33:51 AM]
xyzzy00
xyzzy00
What about..

(a AND b) = ab
(a OR b) = a + b - ab
(a XOR b) = a + b - 2ab
(NOT a) = 1 - a

xyzzy

[Edited by - xyzzy00 on March 17, 2005 8:36:20 PM]
Steadtler
Steadtler
xyzzy00, thanks, but these doesnt follow the requirements. For example,

0.5 AND 0.5 = 0.5 * 0.5 = 0.25 != 0.5 (third requirement)


fup: I read that in some papers too, but thats still debated in the AI research community, see the huge amount amount of papers solving fuzzy logic with bayesian methods. Anyway, the analogy is so close between *probability* and *possibility*. But thats out of the topic. Do you know other operators than min and max that would be better?
Steadtler
Steadtler
Ok, after doing some thinking, I decided to scrape the '0.5' requirement.
These are the rules Im considering now, if anyone is interested:

a AND b = min(a,b) - (min(a,b) * (1.0 - max(a,b)))

a OR b = max(a,b) + (1-max(a,b))*min(a,b)

I like thier behavior, and they keep everything nicely between 0 and 1.
xyzzy00
xyzzy00
Ok, sorry.. didn't realize you weren't looking for probabilites. I'm not really sure offhand what the difference between a *possibility* and a *probability* is.. sounds like I'll have to go read up on on Fuzzy Logic, thanks for the paper.

If you are trying to avoid probabilities, you might want to reconsider your formulas. They work out to exactly the same thing as the ones I wrote above:

(a AND b) = min(a,b) - (min(a,b) * (1.0 - max(a,b)))

if a > b: (a AND b) = b - b * (1 - a) = b - b + ab = ab
if a < b: (a AND b) = a - a * (1 - b) = a - a + ab = ab


(a OR b) = max(a,b) + (1-max(a,b))*min(a,b)

if a > b: (a OR b) = a + (1 - a) * b = a + b - ab;
if a < b: (a OR b) = b + (1 - b) * a = a + b - ab;

xyzzy
Steadtler
Steadtler
lol!

You are totally right, xyzzy00. I should have give it more tought. ++ for you!
Timkin
Timkin
Warning: heading off-topic... (sort of)

Quote:
Original post by Steadtler
I read that in some papers too, but thats still debated in the AI research community, see the huge amount amount of papers solving fuzzy logic with bayesian methods.


Actually, that debate is pretty much one-sided, consisting of proponents of fuzzy logic attempting to justify their work (which doesn't require justification if you accept it for what it is). Most Bayesians discount FL has having anything to say about beliefs, since FL is a Truth Maintenance system, rather than a Belief Revision system. If you try to use FL to represent beliefs, you're just trying to knock in a nail with a screwdriver; you could probably do it, but it's going to hurt... and anyone holding a hammer is going to laugh at you.


Quote:
Anyway, the analogy is so close between *probability* and *possibility*.


The possibility of set membership has nothing to do with probability, particularly with regards to the use of each in AI. Probabilists, in particular Bayesians, almost exclusively use probabilities to measure the degree of belief held by an agent regarding a fact in the domain. Probabilities are then a measure of uncertainty of knowledge and the probability calculus provides a means of maintaining consistent beliefs.

FL on the other hand provides a means of describing systems that aren't adequately modelled by First Order (Aristotlean) Logic. FL permits the description of domains where items from a set belong to several distinct subsets. The universe of discourse in FL is specifically detailing the domain itself, rather than the beliefs held by an agent observing that domain. To use FL in this manner would be to use the proverbial screwdriver mentioned above.

As for operators... have you considered using the product operator for Fuzzy AND?

Regards,

Timkin

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.