Categories
Deduce lives and breathes on the information it's provided. Deduce calls these individual bits of data facts. To explain how Deduce is able to reason, we'll start with some simple examples and work our way up from there. Suppose we enter the fact, "Spot is a dog." Deduce begins by breaking down the sentence into its components. In this case, we have a subject, a verb, and an object:Verb: is
Object: a dog
More categories
Let's try an example that has more data in it. Suppose we have the following set of facts:A dalmatian is a dog.
A dog is an animal.
A dog is a canine.
A canine is a dog.
Felix is a cat.
A cat is an animal.
FELIX | CAT | |||||
SPOT | DALMATIAN | DOG | ANIMAL | |||
CANINE |
One thing worth noting is that there's a loop in this graph between dog and canine. What this means is Deduce has to be careful when tracking through the graph not to end up in an infinite loop. It accomplishes this by leaving a trail as it searches, and removing the trail as it backtracks.
Looking at the graph, there are a number of questions that can be answered by following the arrows. Here are some examples:
Is a canine an animal?
Is Felix an animal?
Is Felix a dog?
Is an animal a cat?
Negatives
In order to express a relationship that's not true, we must make a fact negative. This is accomplished with the word "not" (or similar words, like "no" and "never"). So, we might say something like:An animal is not a plant.
What's interesting to note here is that negatives work both ways: if a cat is not a dog, it can be inferred that a dog is not a cat. The reason for this will be explained later.
To represent a negative statement in a graph, we'll draw a line through the arrow like this:
A dog is an animal.
A dog is not a cat.
A cat is a mammal.
A cat is a feline.
SPOT | DOG | ANIMAL | ||
CAT | MAMMAL | |||
FELINE |
Actions
When interacting with Deduce, we often want to describe things based on what they do rather than just what they are. Examples include:A bird can fly.
Water will evaporate.
A bird can fly south.
A flower will grow petals.
A flower will grow petals.
DOG
FLOWER PETALS
A dog will drink water.
Evian is water.
SPOT DOG WATER EVIAN
Will Spot drink Evian?
To answer the question, we start at spot, and follow the non-labeled arrows until we come across the verb "drink". In this case, we pass through "dog" to "drink". If the question were simply, "will Spot drink," we would be done, since if Spot drinks water, it means that he drinks. Of course, if he didn't drink water, it wouldn't necessarily mean he doesn't drink.
Anyway, we now know that Spot will drink water, but the question asks if Spot will drink Evian. To answer this, we pose the question, "Is Evian water?" Since the answer to this is "yes", we can conclude that Spot will drink Evian. Had the answer been "no" or "I don't know", we would've had to continue our search.
Contradictions
Sometimes it's possible to know something based on a subject's properties and classifications. Take the following two facts:A dog can not fly.
bird |   | |
dog |   |
Since a dog can't fly, it obviously can't be a bird. Likewise, a bird can't be a dog for the same reason. However, using the techniques we've seen so far, there's no way for Deduce to pick up on this. To make it work, we can compare all the attributes of each subject and see if any of them contradict. Since one can fly and the other can't, they can't be directly related.
In the section on negatives, we learned that if a negative is true, the opposite can be assumed to be true as well. So:
Therefore, a dog is not a cat.
A cat is not a dog.
Future
This is where Deduce stands now. I have plans to add more distinction than just black and white. As a result, you may ask a question and get back a reply of "Maybe". Doing this will force me to revisit how everything else is handled, and will take a considerable amount of work. I have the basic idea of how it should work in my head, but I don't want to spend a lot of time writing up the theory here since it may change as I work out the details. I'm also working on adding synonyms, which will allow different forms of the same word to be recognized as the same word.
Further ahead, I may try to tackle prepositional phrases and infinitives, but English tends to be rather ambiguous with regards to these, so I'm not sure how they will be handled.