Related
In first place i have to apologize for my very, very poor english.
I've been studying the representation of knowledge in the context of design of experts systems trough ontologies. In particular, i've been using protégé as an OWL ontology editor.
After a large number of fails, finally i've started to realize the huge impact of the OWA on the process of inference and reasoning, mainly when i try to performance some automatic classification task.
I've solve many of the basic problems about that but, going deeper on the idea of making more and more specific classifications, i ran into the need for use cardinality restrictions. (which, at first, i tought that i cleary understand, but in the end, i realize that i'm nowhere close it)
Well, so far i've made a mess. Only a very few classification has been working as i spected. I guess that, as usual, i've been losing sight of the OWA.
Mi concrete doubt is this: What's the point on creating a restriction over an object property with a 'max' and, specially, 'exactly' cardinality in a context where we assume that the world is open?
I bring to you this simple example, based on the Pizza Tutorial, since many concepts can be extrapolated from there: Suppose that i want to define the class of pizzas named "FourChessePizza" and i want that, in principle, any individual that has four "ChesseTopping", i.e., four relationships along the "hasTopping" property with individuals of class "CheeseTopping", are inferred as belonging that class.
So i create an individual and, in "types", i assert this:
hasTopping some MozzarellaToping
hasTopping some ParmesanTopping
hasTopping some FontinaTopping
hasTopping some BlueChesseTopping
All the fillers are disjoints.
(The names of each chesse are merely demostrative; i don't know which cheeses are used)
So far, the reasoner have no way to say that that individual belongs to "FourChessePizza" since, although it has four relationships, the OWA considers the possibility that it can have more relations that might not have been "said". No 'max' or 'exactly' cardinality restriction can be applied since the uncertainty about "how much relations" really have the individual.
So, with only this information i can't found any restriction to my "FourCheesePizza" that clasify this simple individual as own.
Beyond this particular example, my question is more general about the generic process of "counting" asserted relationships with the less possible information.
¿Is there any solution to this kind of problems?¿What is what i'm not thinking in the rigth way to solve this and similar problems?
Thank you very much in advance for your time and your good will.
Cheers!
This is a surprisingly intricate problem! At first sight, it looks like what you need is simply a "closure axiom", something that is describe in the Protégé tutorial with the Pizza ontology. There, the concept of a Margherita pizza is at first described as a pizza that has some mozzarella topping and some tomato topping. But even if you know a pizza has mozzarella and tomato, it is not sufficient to classify it as a Margherita pizza, because other kinds of pizzas have mozzarella and tomato. So the solution is to say that a Margherita pizza only has mozarella and tomato toppings.
Similarly, it would be possible to say that your example pizza only has Mozzarella, Parmesan, Fontina, and Blue Cheese toppings. But would this be sufficient to qualify as a FourCheesePizza? Well, it depends how you define 4 cheese pizzas. If a FourCheesePizza is one that has at least 4 cheese toppings, then yes. But we don't want to have 5-cheese pizzas classified as 4-cheese pizzas, right?
A simple conceptualisation of 4-cheese pizzas would be that it has exactly 4 cheese toppings:
FourCheesePizza subClassOf hasTopping exactly 4 CheeseToppings
So, it means that for any instance of FourCheesePizza, there exists x1, x2, x3, x4 four distinct instances of CheeseTopping. The problem is, the four instances could be all distinct instances of MozzarellaTopping.
In the case of Hector Coscia's example, if we have:
FourCheesePizza subClassOf (
hasTopping some MozzarellaTopping and
hasTopping some ParmesanTopping and
hasTopping some FontinaTopping and
hasTopping some BlueChesseTopping and
hasTopping only (MozzarellaToping or ParmesanTopping or FontinaTopping or BlueChesseTopping)
then it is possible that there are 2 mozzarella toppings, 5 parmesan toppings, 16 fontina toppings, and 42 blue cheese toppings. And yet, this woud arguably be fine as a 4-cheese pizza because what matters is that it uses exactly 4 types of cheeses. But how to express that a pizza only has 4 types of toppings?
In OWL, it is not possible to restrict the number of classes used in a definition. For instance, it is not possible to say: the instances that are member of only 2 classes. Even if it was possible, it would be useless, because every instance X belongs to infinitely many classes: it belongs to the singleton class {X}, it belongs to every superclass of this singleton, and it belongs to the union of {X} with all the classes that are disjoint from {X}.
So the only option is to change the modelling pattern: to make TypeOfCheese a class, and to make Mozzarella, Parmesan, Fontina, Blue Cheese instances of this class. Then it is possible to restrict how many types of cheeses are used. To do so, you may proceed as follows:
create a property typeOfCheese that connects instances of CheeseTopping to instances of TypeOfCheese
create another propery usesTypeOfCheese that connects pizzas to types of cheeses
define a property chain axiom that says: hasTopping o typeOfCheese subPropertyOf usesTypeOfCheese
define FourCheesePizza as the subclass of usesTypeOfCheese exactly 4 TypeOfCheese
define the instances of TypeOfCheese: mozzarella, parmesan, fontina, blueCheese, cancoillotte, etc.
define MozzarellaTopping subClassOf typeOfCheese value mozzarella, ParmesanTopping subClassOf typeOfCheese value parmesan, etc.
The context:
I'm experimenting with using a feed-forward artificial neural network to create AI for a video game, and I've run into the problem that some of my input features are dependent upon the existence or value of other input features.
The most basic, simplified example I can think of is this:
feature 1 is the number of players (range 2...5)
feature 2 to ? is the score of each player (range >=0)
The number of features needed to inform the ANN of the scores is dependent on the number of players.
The question: How can I represent this dynamic knowledge input to an ANN?
Things I've already considered:
Simply not using such features, or consolidating them into static input.
I.E using the sum of the players scores instead. I seriously doubt this is applicable to my problem, it would result in the loss of too much information and the ANN would fail to perform well.
Passing in an error value (eg -1) or default value (eg 0) for non-existant input
I'm not sure how well this would work, in theory the ANN could easily learn from this input and model the function appropriately. In practise I'm worried about the sheer number of non-existant input causing problems for the ANN. For example if the range of players was 2-10, if there were only 2 players, 80% of the input data would be non-existant and would introduce weird bias into the ANN resulting in a poor performance.
Passing in the mean value over the training set in place on non-existant input
Again, the amount of non-existant input would be a problem, and I'm worried this would introduce weird problems for discrete-valued inputs.
So, I'm asking this, does anybody have any other solutions I could think about? And is there a standard or commonly used method for handling this problem?
I know it's a rather niche and complicated question for SO, but I was getting bored of the "how do I fix this code?" and "how do I do this in PHP/Javascript?" questions :P, thanks guys.
It sounds like you have multiple data sets (for each number of players) that aren't really compatible with each other. Would lessons learned from a 5-player game really apply to a 2-player game? Try simplifying the problem, such as #1, and see how the program performs. In AI, absurd simplifications can sometimes give you a lot of traction, like bag of words in spam filters.
Try thinking about some model like the following:
Say xi (e.g. x1) is one of the inputs that a variable number of can exist. You can have n of these (x1 to xn). Let y be the rest of the inputs.
On your first hidden layer, pass x1 and y to the first c nodes, x1,x2 and y to the next c nodes, x1,x2,x3 and y to the next c nodes, and so on. This assumes x1 and x3 can't both be active without x2. The model will have to change appropriately if this needs to be possible.
The rest of the network is a standard feed-forward network with all nodes connected to all nodes of the next layer, or however you choose.
Whenever you have w active inputs, disable all but the wth set of c nodes (completely exclude them from training for that input set, don't include them when calculating the value for the nodes they output to, don't update the weights for their inputs or outputs). This will allow most of the network to train, but for the first hidden layer, only parts applicable to that number of inputs.
I suggest c is chosen such that c*n (the number of nodes in the first hidden layer) is greater than (or equal to) the number of nodes in the 2nd hidden layer (and have c be at the very least 10 for a moderately sized network (into the 100s is also fine)) and I also suggest the network have at least 2 other hidden layers (so 3 in total excluding input and output). This is not from experience, but just what my intuition tells me.
This working is dependent on a certain (possibly undefinable) similarity between the different numbers of inputs, and might not work well, if at all, if this similarity doesn't exist. This also probably requires quite a bit of training data for each number of inputs.
If you try it, let me / us know if it works.
If you're interested in Artificial Intelligence discussions, I suggest joining some Linked-In group dedicated to it, there are some that are quite active and have interesting discussions. There doesn't seem to be much happening on stackoverflow when it comes to Artificial Intelligence, or maybe we should just work to change that, or both.
UPDATE:
Here is a list of the names of a few decent Artificial Intelligence LinkedIn groups (unless they changed their policies recently, it should be easy enough to join):
'Artificial Intelligence Researchers, Faculty + Professionals'
'Artificial Intelligence Applications'
'Artificial Neural Networks'
'AGI — Artificial General Intelligence'
'Applied Artificial Intelligence' (not too much going on at the moment, and still dealing with some spam, but it is getting better)
'Text Analytics' (if you're interested in that)
I am half way reading the OWL2 primer and is having problem understanding the universal quantification
The example given is
EquivalentClasses(
:HappyPerson
ObjectAllValuesFrom( :hasChild :HappyPerson )
)
It says somebody is a happy person exactly if all their children are happy persons. But what if John Doe has no children can he be an instance of HappyPerson? What about his parent?
I also find this part very confusing, it says:
Hence, by our above statement, every childless person would be qualified as happy.
but wouldn't it violate the ObjectAllValuesFrom() constructor?
I think the primer actually does quite a good job at explaining this, particularly the following:
Natural
language indicators for the usage of
universal quantification are words
like “only,” “exclusively,” or
“nothing but.”
To simplify this a bit further, consider the expression you've given:
HappyPerson ≡ ∀ hasChild . HappyPerson
This says that a HappyPerson is someone who only has children who are also HappyPerson (are also happy). Logically, this actually says nothing about the existence of instances of happy children. It simply serves as a universal constraint on any children that may exist (note that this includes any instances of HappyPerson that don't have any children).
Compare this to the existential quantifier, exists (∃):
HappyPerson ≡ ∃ hasChild . HappyPerson
This says that a HappyPerson is someone who has at least one child that is also a HappyPerson. In constrast to (∀), this expression actually implies the existence of a happy child for every instance of a HappyPerson.
The answer, albeit initially unintuitive, lies in the interpretation/semantics of the ObjectAllValuesFrom OWL construct in first-order logic (actually, Description Logic). Fundamentally, the ObjectAllValuesFrom construct relates to the logical universal quantifier (∀), and the ObjectSomeValuesFrom construct relates to the logical existential quantifier (∃).
I am facing the same kind of issue while reading the "OWL 2 Web Ontology Language Primer (Second Edition - 2012)" and I am not convinced that the answer by Sharky clarifies the issue.
At page 15, when introducing the universal quantifier ∀, the book states:
"Another property restriction, called universal quantification is used to describe a class of individuals for which all related individuals must be instances of a given class. We can use the following statement to indicate that somebody is a happy person exactly if all their children are happy persons."
[I omit the OWL statements in the different sintaxes, they can be found in the book.]
I think that a more formal and may be less ambiguos representation of what the author states is
(1) HappyPerson = {x | ∀y (x HasChild y → y ∈ HappyPerson)}
I hope every reader understands this notation, because I find the notation used in the answer less clear (or may be I am just not accustomed to it).
The book proceeds:
"... There is one particular misconception concerning the universal role restriction. As an example, consider the above happiness axiom. The intuitive reading suggests that in order to be happy, a person must have at least one happy child [my note: actually the definition states that every children should be happy, not just at least one, in order for his/her parents to be happy. This appears to be a lapsus of the author]. Yet, this is not the case: any individual that is not a “starting point” of the property hasChild is a class member of any class defined by universal quantification over hasChild. Hence, by our above statement, every childless person would be qualified as happy . ..."
That is, the author states that (assume '~' for logical NOT), given
(2) ChildessPerson = { x | ~∃y( x HasChild y)}
then (1) and the meaning of ∀ imply
(3) ChildessPerson ⊂ HappyPerson
This does not seem true to me.
If it were true then every child, as far as s/he is a childless person, is happy and so only some parents can be unhappy persons.
Consider this model:
Persons = {a,b,c}, HasChild = {(a,b)}, HappyPerson={a,b}
and c is unhappy (independently from the close world or open world assumption). It is a possible model, which falsifies the thesis of the author.
How would you assign objective certainties to statements asserted by different users in an ontology?
For example, consider User A asserts "Bob's hat is blue" while User B asserts "Bob's hat is red". How would you determine if:
User A and User B are referring to different people named Bob, and may or may not be correct.
Both users are referring to the same person, but User A is right and User B is mistaken (or vice versa).
Both users are referring to the same person, but User A is right and User B is lying (or vice versa).
Both users are referring to the same person, and both uses are either mistaken or lying.
The main difficulty I see is the ontology doesn't have any way to obtain first-hand data (e.g. it can't ask Bob what color his hat is).
I realize there's probably no entirely objective way to resolve this. Are there any heuristics that could be employed? Does this problem have a formal name?
I'm not an expert in this field, but I've worked a bit with uncertainties in ontologies and the Semantic Web. There are, of course, approaches to this problem that have nothing to do with the semantic web, but my knowledge ends there.
Two problems that I feel are connected with your question are the Identity Crisis and the URI crisis. Formal representations of the statements above can be issued in RDF (Resource Description Framework).
If I convert the statementss "Bob's hat is blue/red" into triples, this would be:
Fact 1:
X isA Person
X hasName "Bob"
X possesses H1
H1 isA Hat
H1 hasColor Blue
Fact 2:
Y isA Person
Y hasName "Bob"
Y possesses H2
H2 isA Hat
H2 hasColor Red
The problem here is that X, Y, H1 and H2 are resources, which may or may not be the same. So in your example it is unknown if X and Y are the same person or distinct and you can't know without further information. (Same holds for the hats.)
However, the problem is more complex, because User A and B just stated those things, so they are no "real" facts. RDF offer the method of Reification for this, but I won't write this down here completely, it would be too long. What you basically would do is add an "UserA statesThat (...)" to every above mentioned statement.
If you have all this, you can start reasoning. At the university we once used RACER for this kind of stuff, but that was an old version and I'm not familiar with the current one.
Of Course, you can do that stuff without RDF as well, e.g., in LISP.
Hope it helped.
I have heard this kind of thing being referred to as information fusion, mirroring the idea of data fusion. I don't know much about it but it seems there are conferences on the subject.
I'd also add another difficulty here, that of distinguishing between objective and subjective information. If user A says 'Bob is a nice guy' and user B says 'Bob is not a nice guy' then they can both be right while asserting seemingly opposing statements.
Step 1: Make some assumptions. Otherwise, you have nothing to base anything on. A possible assumption would be, "If bob's hat is red, there is a 90% that User A will say his hat is red."
Step 2: Apply relevant math. To relate a conditional probability to its inverse (i.e. to ask the probability that bob's hat is red knowing what A said based on the assumption I proposed), use Bayes Theorem.
I'm working with a couple of AI algorithms at school and I find people use the words Fuzzy Logic to explain any situation that they can solve with a couple of cases. When I go back to the books I just read about how instead of a state going from On to Off it's a diagonal line and something can be in both states but in different "levels".
I've read the wikipedia entry and a couple of tutorials and even programmed stuff that "uses fuzzy logic" (an edge detector and a 1-wheel self-controlled robot) and still I find it very confusing going from Theory to Code... for you, in the less complicated definition, what is fuzzy logic?
Fuzzy logic is logic where state membership is, essentially, a float with range 0..1 instead of an int 0 or 1. The mileage you get out of it is that things like, for example, the changes you make in a control system are somewhat naturally more fine-tuned than what you'd get with naive binary logic.
An example might be logic that throttles back system activity based on active TCP connections. Say you define "a little bit too many" TCP connections on your machine as 1000 and "a lot too many" as 2000. At any given time, your system has a "too many TCP connections" state from 0 (<= 1000) to 1 (>= 2000), which you can use as a coefficient in applying whatever throttling mechanisms you have available. This is much more forgiving and responsive to system behavior than naive binary logic that only knows how to determine "too many", and throttle completely, or "not too many", and not throttle at all.
I'd like to add to the answers (that have been modded up) that, a good way to visualize fuzzy logic is follows:
Traditionally, with binary logic you would have a graph whose membership function is true or false whereas in a fuzzy logic system, the membership function is not.
1|
| /\
| / \
| / \
0|/ \
------------
a b c d
Assume for a second that the function is "likes peanuts"
a. kinda likes peanuts
b. really likes peanuts
c. kinda likes peanuts
d. doesn't like peanuts
The function itself doesn't have to be triangular and often isn't (it's just easier with ascii art).
A fuzzy system will likely have many of these, some even overlapping (even opposites) like so:
1| A B
| /\ /\ A = Likes Peanuts
| / \/ \ B = Doesn't Like Peanuts
| / /\ \
0|/ / \ \
------------
a b c d
so now c is "kind likes peanuts, kinda doesn't like peanuts" and d is "really doesn't like peanuts"
And you can program accordingly based on that info.
Hope this helps for the visual learners out there.
The best definition of fuzzy logic is given by its inventor Lotfi Zadeh:
“Fuzzy logic means of representing problems to computers in a way akin to the way human solve them and the essence of fuzzy logic is that everything is a matter of degree.”
The meaning of solving problems with computers akin to the way human solve can easily be explained with a simple example from a basketball game; if a player wants to guard another player firstly he should consider how tall he is and how his playing skills are. Simply if the player that he wants to guard is tall and plays very slow relative to him then he will use his instinct to determine to consider if he should guard that player as there is an uncertainty for him. In this example the important point is the properties are relative to the player and there is a degree for the height and playing skill for the rival player. Fuzzy logic provides a deterministic way for this uncertain situation.
There are some steps to process the fuzzy logic (Figure-1). These steps are; firstly fuzzification where crisp inputs get converted to fuzzy inputs secondly these inputs get processed with fuzzy rules to create fuzzy output and lastly defuzzification which results with degree of result as in fuzzy logic there can be more than one result with different degrees.
Figure 1 – Fuzzy Process Steps (David M. Bourg P.192)
To exemplify the fuzzy process steps, the previous basketball game situation could be used. As mentioned in the example the rival player is tall with 1.87 meters which is quite tall relative to our player and can dribble with 3 m/s which is slow relative to our player. Addition to these data some rules are needed to consider which are called fuzzy rules such as;
if player is short but not fast then guard,
if player is fast but not short then don’t guard
If player is tall then don’t guard
If player is average tall and average fast guard
Figure 2 – how tall
Figure 3- how fast
According to the rules and the input data an output will be created by fuzzy system such as; the degree for guard is 0.7, degree for sometimes guard is 0.4 and never guard is 0.2.
Figure 4-output fuzzy sets
On the last step, defuzzication, is using for creating a crisp output which is a number which may determine the energy that we should use to guard the player during game. The centre of mass is a common method to create the output. On this phase the weights to calculate the mean point is totally depends on the implementation. On this application it is considered to give high weight to guard or not guard but low weight given to sometimes guard. (David M. Bourg, 2004)
Figure 5- fuzzy output (David M. Bourg P.204)
Output = [0.7 * (-10) + 0.4 * 1 + 0.2 * 10] / (0.7 + 0.4 + 0.2) ≈ -3.5
As a result fuzzy logic is using under uncertainty to make a decision and to find out the degree of decision. The problem of fuzzy logic is as the number of inputs increase the number of rules increase exponential.
For more information and its possible application in a game I wrote a little article check this out
To build off of chaos' answer, a formal logic is nothing but an inductively defined set that maps sentences to a valuation. At least, that's how a model theorist thinks of logic. In the case of a sentential boolean logic:
(basis clause) For all A, v(A) in {0,1}
(iterative) For the following connectives,
v(!A) = 1 - v(A)
v(A & B) = min{v(A), v(B)}
v(A | B) = max{v(A), v(B)}
(closure) All sentences in a boolean sentential logic are evaluated per above.
A fuzzy logic changes would be inductively defined:
(basis clause) For all A, v(A) between [0,1]
(iterative) For the following connectives,
v(!A) = 1 - v(A)
v(A & B) = min{v(A), v(B)}
v(A | B) = max{v(A), v(B)}
(closure) All sentences in a fuzzy sentential logic are evaluated per above.
Notice the only difference in the underlying logic is the permission to evaluate a sentence as having the "truth value" of 0.5. An important question for a fuzzy logic model is the threshold that counts for truth satisfaction. This is to ask: for a valuation v(A), for what value D it is the case the v(A) > D means that A is satisfied.
If you really want to found out more about non-classical logics like fuzzy logic, I would recommend either An Introduction to Non-Classical Logic: From If to Is or Possibilities and Paradox
Putting my coder hat back on, I would be careful with the use of fuzzy logic in real world programming, because of the tendency for a fuzzy logic to be undecidable. Maybe it's too much complexity for little gain. For instance a supervaluational logic may do just fine to help a program model vagueness. Or maybe probability would be good enough. In short, I need to be convinced that the domain model dovetails with a fuzzy logic.
Maybe an example clears up what the benefits can be:
Let's say you want to make a thermostat and you want it to be 24 degrees.
This is how you'd implement it using boolean logic:
Rule1: heat up at full power when
it's colder than 21 degrees.
Rule2:
cool down at full power when it's
warmer than 27 degrees.
Such a system will only once and a while be 24 degrees, and it will be very inefficient.
Now, using fuzzy logic, it would be like something like this:
Rule1: For each degree that it's colder than 24 degrees, turn up the heater one notch (0 at 24).
Rule2: For each degree that it's warmer than 24 degress, turn up the cooler one notch (0 at 24).
This system will always be somewhere around 24 degrees, and it only once and will only once and a while make a tiny adjustment. It will also be more energy-efficient.
Well, you could read the works of Bart Kosko, one of the 'founding fathers'. 'Fuzzy Thinking: The New Science of Fuzzy Logic' from 1994 is readable (and available quite cheaply secondhand via Amazon). Apparently, he has a newer book 'Noise' from 2006 which is also quite approachable.
Basically though (in my paraphrase - not having read the first of those books for several years now), fuzzy logic is about how to deal with the world where something is perhaps 10% cool, 50% warm, and 10% hot, where different decisions may be made on the degree to which the different states are true (and no, it wasn't entirely an accident that those percentages don't add up to 100% - though I'd accept correction if needed).
A very good explanation, with a help of Fuzzy Logic Washing Machines.
I know what you mean about it being difficult to go from concept to code. I'm writing a scoring system that looks at the values of sysinfo and /proc on Linux systems and comes up with a number between 0 and 10, 10 being the absolute worst. A simple example:
You have 3 load averages (1, 5, 15 minute) with (at least) three possible states, good, getting bad, bad. Expanding that, you could have six possible states per average, adding 'about to' to the three that I just noted. Yet, the result of all 18 possibilities can only deduct 1 from the score. Repeat that with swap consumed, actual VM allocated (committed) memory and other stuff .. and you have one big bowl of conditional spaghetti :)
Its as much a definition as it is an art, how you implement the decision making process is always more interesting than the paradigm itself .. whereas in a boolean world, its rather cut and dry.
It would be very easy for me to say if load1 < 2 deduct 1, but not very accurate at all.
If you can teach a program to do what you would do when evaluating some set of circumstances and keep the code readable, you have implemented a good example of fuzzy logic.
Fuzzy Logic is a problem-solving methodology that lends itself to implementation in systems ranging from simple, small, embedded micro-controllers to large, networked, multi-channel PC or workstation-based data acquisition and control systems. It can be implemented in hardware, software, or a combination of both. Fuzzy Logic provides a simple way to arrive at a definite conclusion based upon vague, ambiguous, imprecise, noisy, or missing input information. Fuzzy Logic approach to control problems mimics how a person would make decisions, only much faster.
Fuzzy logic has proved to be particularly useful in expert system and other artificial intelligence applications. It is also used in some spell checkers to suggest a list of probable words to replace a misspelled one.
To learn more, just check out: http://en.wikipedia.org/wiki/Fuzzy_logic.
The following is sort of an empirical answer.
A simple (possibly simplistic answer) is that "fuzzy logic" is any logic that returns values other than straight true / false, or 1 / 0. There are a lot of variations on this and they tend to be highly domain specific.
For example, in my previous life I did search engines that used "content similarity searching" as opposed to then common "boolean search". Our similarity system used the Cosine Coefficient of weighted-attribute vectors representing the query and the documents and produced values in the range 0..1. Users would supply "relevance feedback" which was used to shift the query vector in the direction of desirable documents. This is somewhat related to the training done in certain AI systems where the logic gets "rewarded" or "punished" for results of trial runs.
Right now Netflix is running a competition to find a better suggestion algorithm for their company. See http://www.netflixprize.com/. Effectively all of the algorithms could be characterized as "fuzzy logic"
Fuzzy logic is calculating algorithm based on human like way of thinking. It is particularly useful when there is a large number of input variables. One online fuzzy logic calculator for two variables input is given:
http://www.cirvirlab.com/simulation/fuzzy_logic_calculator.php