next up previous
Next: Knowledge Bases Up: NeoClassic User's GuideVersion 1.0 Previous: Roles

Rules

 

NEOCLASSIC provides three different types of forward-chaining rules: simple rules, which will be referred to as rules; computed description rules; and computed filler rules.

A (simple) rule consists of an antecedent, which must be a concept, and a consequent, which is a description. Suppose there is a rule with concept C1 as the antecedent and concept C2 as the consequent (i.e., C1 is the left-hand side of the rule, and C2 is the right-hand side of the rule). Then as soon as an individual I1 is known to belong under concept C1, the rule is ``fired'', and I1 is deduced to belong under C2. A concept or individual does not need to be described by the consequent C2 in order to be classified under (described by) the antecedent C1. However, once the rule is fired, the individual may be further classified based on the new information provided by the rule.

For example, suppose there is a rule with Person as the antecedent and

as the consequent. If Mary is created as a Person, then this rule ``fires'', and she is known to have a social-security-number that is of type SSNUM. If there happened to be a concept ThingWith-SocialSecurityNumber, defined asthen Mary would ultimately get classified under this concept.

As a second example, suppose that in order to determine that someone is a Vegetarian, it is enough to know that the only kind of food she eats is of type Plant. Suppose also that there is a rule stating that anyone who is a Vegetarian is known to be a HealthyThing. Thus, in order to determine that someone is a Vegetarian, NEOCLASSIC is only required to know the kind of food she eats, but once she is known to be a Vegetarian, NEOCLASSIC can immediately ``fire'' the rule and infer that she is a HealthyThing.

The function createRule  creates a simple rule.[*] Its syntax is


A computed description rule is similar to the simple rule described above, except that instead of the rule being defined with a consequent that is specified at rule creation time, the rule is defined with a function and parameters, which, when the rule is fired, are used to generate the consequent of the rule. Thus, the consequent is not specified in advance, but can be based on information that is known about the individual at the time the rule is fired.

A computed description rule is defined with the function createRule . The syntax is

It takes a name (a symbol), a CLASSIC concept for the antecedent, a C++ object representing the function to run for the rule, and, optionally, a list of parameters for the function.


A computed filler rule is like a computed description rule, except that in addition to the function and parameters, it takes a role, and the function generates a list of fillers for the role when the rule is fired.

A filler rule is defined with the function createRule . The syntax is

It takes a name (a symbol), a CLASSIC concept for the antecedent, a C++ object representing the function to run for the rule, and, optionally, a list of parameters for the function.


next up previous
Next: Knowledge Bases Up: NeoClassic User's GuideVersion 1.0 Previous: Roles
Peter F. Patel-Schneider
7/15/1998