 |
Deriving facts using rules
The next area of research I'd like to explore is that of deriving facts about the world using rules.
Rules consist of two parts:
1. | A list of conditions that must be met for the rule to apply. |
2. | A conclusion or implication, which says something is true if all of the conditions are true. |
What makes rules useful is that any part of a condition can left undefined and represented by a variable, which is then used in another condition or the conclusion.
For example:
Conditions:
1. | A person's first name is $1 |
2. | A person's last name is $2 |
Conclusion:
The person's full name is '$1 $2'.
This can notated as follows:
rule: $1 is_a person $1.first_name = $2 $1.last_name = $3 -> $1.full_name = '$1 $2' |
|
Some more examples:
rule: $1 on_top_of $2 -> ! $2 on_top_of $1 |
|
rule: $1 is_a person $1 born_in Canada -> $1 is_a Canadian |
|
rule: $1 is_a person $2 is_a person $1.birth_date > $2.birth_date $1 older_than $2 |
|
etc.
Rules come in very handy when trying to answer questions. For instance, consider the following story:
My first name is Daniel My last name is Bigham What is my full name? |
|
The AI wouldn't know the value of speaker.full_name implicitly because it was never told its value. But it can derive that value given what it knows.
There are three primary cases where rules can be applied:
1. | When the AI is told something, it can search for rules for which what it was told matches a condition of the rule. Finding these rules, it can then check whether it has all the necessary information to indicate that the conclusion is true, and if it is, it can update its brain state with the derived information in addition to what it was specifically told. |
 | In the example above, an AI could apply speaker.full_name = 'Daniel Bigham' as soon as the second statement was made, long before the question was even posed. |
2. | When the AI is asked something. In other words, when asked for the speaker's full name, the AI could search for rules whose conclusions match the information it is looking for, and then determine whether all of the conditions are met. |
3. | In a sort of recursive scenario, checking to see whether a rule can be applied may involve using other values that are not explictly known. This can trigger a second rule search to see whether that value can be derived, and so on. What you get is a kind of search tree. Obviously you wouldn't want a scenario where the AI goes off and spends 5 minutes exploring a huge search tree, so the depth to which it explores would need to be set to a reasonable number. | |
|
 |