VerbsSeptember 21, 2008
Something that I've been inconclusive about is how to represent verbs using an entity-relationship model, but I've realized that it's perhaps not as awkward as I thought. For example:
"I like running" -> speaker likes running
"I'm going to the store" -> speaker going_to store
"I'm driving on the 401" -> speaker driving_on highway401
The verb and preposition get fused together to represent the relation -- the thing that relates the two entities.
Milestone: Working implementation of rulesSeptember 16, 2008
As of today I now having a working implementation of rules. There are still some details to be fleshed out, but the value derivation engine works.
http://www.platoai.com/plato1.18/This represents a major milestone for a fledgling AI project: The ability to use rules to derive facts about the world using what it has already been told.
The two working examples are:
"My first name is Daniel"
"My last name is Bigham"
"What is my full name?"
And:
"I was born in Canada"
"What is my nationality?"
The next thing on my agenda is to be able to use math in rules. For example:
"I have two sisters"
"I don't have a brother"
"How many siblings do I have?"
rule: $1 is_a person $1 has(count:$2) sister $1 has(count:$3) brother $count = # $2 + $3 -> $1 has(count:$count) sibling |
|
Exercise 18: Completed rule implementationSeptember 12, 2008
Implement
SolveRule and
Derive:
SolveRuleSolveRule Input:
  | A rule. |
  | The derivation target: An ITransOutput that represents what is trying to be derived. |
SolveRule Output:
A list of entities. For relationship rules, this will be either null to represent failure or the
true entity to represent success. For assignment rules, this will be a list of entities that satisfy the value of the assignment.
SolveRule Algorithm:
  | Run SolveConditions. |
  | If the resultant list is empty, return an empty list. |
  | If the resultant list isn't empty and the conclusion type is a relation, then return the true entity. |
  | If the resultant list isn't empty and the conclusion type is a property value, then process each result iteratively. Use the conclusion's value specifier to create the result. This can be accomplished by implementing an Eval function for IValueToken which takes a dictionary of variable values, substitutes them, and returns the resultant entity. |
For each result:
  | Add the resultant token to the output list. |
DeriveDerive is called with a
PropertyToken or
RelationshipToken.
Algorithm:
  | Look up rules that might be able to derive the value/relationship. |
  | For each potential rule, determine whether it is really a match. In the process, determine the value of any variables in the conclusion by doing a token-by-token comparison of the conclusion with the derivation target. Implement this functionality as RuleSolver.Match. |
  | Attempt to solve any rules that match. |
  | If any rules can be solved, return the resulting value, which will be an IEntity for derived property values or a bool for derived relationships. |
Test Cases...
Web UI  | Add a new text area to the web UI that allows rules to be specified. |
  | If the answer to a user's question is a property whose value is not known, try to derive it. If it can be derived, return the result. Always indicate whether a value was derived. |
older >>