[Next] [Previous] [Up] [Top] [Contents]

3 Representation of knowledge in SDML

3.3 Rulebases


A rulebase in SDML is a collection of rules, each of which has a name, a number of antecedents and a number of consequents. The antecedents of a rule are represented by a single clause, with subclauses if there is more than one antecedent. Another clause represents the consequents of the rule. Every rule states that if its antecedents are true for any bindings of the variables used in them, then its consequents are also true for the same bindings of variables. Rules are strictly declarative; they declare relationships between clauses representing logical predicates about the world.

Section 4 describes how rules are fired, in order to deduce further items of knowledge from existing knowledge represented on databases. Firing rules cannot retract any knowledge that has already been deduced.

Clauses in rules often correspond to clauses on databases, but some primitive keywords have also been provided. Definitions of primitives are contained in a clause definition group, which is also used to specify the syntax of clauses that can be placed on databases. For example, the primitive sum can be used for addition; a clause with this keyword is true if the first argument (a number or matrix) is the sum of the remaining arguments. This primitive behaves as if there is an infinite database containing clauses corresponding to all correct additions, such as sum 4 2 2. Similar clauses, containing variables, can be used as antecedents of rules to represent mathematical relationships. Such clauses are not permitted as consequents; strange behaviour could result if it was possible to deduce that sum 5 2 2 is true!

Other primitives are provided to enable relationships to be specified between knowledge on different databases. For example, the primitive last refers to the subdatabase corresponding to the previous time period. A clause with keyword last is true if its subclause was true just before the current time. If such clauses were permitted in the consequents of rules, firing them could cause antecedents of rules at previous times could become true, and firing these rules could cause rules at even earlier times to be fired. Since SDML is used for simulation, and past events should not be affected by things happening in the future, primitives such as last are not permitted in consequents. Once a time period has been simulated, rules at that period cannot be fired again. It should be noted that this restriction does not prevent deductions from being made about previous times, but only affects where such knowledge is represented. This restriction also benefits efficiency, since it is only necessary to check whether rules can fire at the current time.

Logical primitives can be used to construct more complex antecedents and consequents from simpler ones. These primitives are described below:

Two primitives are provided for negation to avoid making the closed world assumption [13] that anything that cannot be proven is false. The not primitive can be used for knowledge that is deduced to be false, whereas notKnown can be used to explicitly state any assumptions that have to be made.

Ordinary clauses corresponding to logical predicates are combined using such logical primitives ensuring a sound logical basis is provided for SDML. It is, of course, important to ensure that all primitives are logically consistent. Many primitives, like sum, behave as if they retrieve from a database. Some of them, particularly those which manipulate lists, were originally written as rules but later reimplemented as primitives for improved efficiency.


Efficient Forward Chaining for Declarative Rules in a Multi-Agent Modelling Language - 16 FEB 95
[Next] [Previous] [Up] [Top] [Contents]

Generated with CERN WebMaker