3 Representation of knowledge in SDML
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:
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.
Generated with CERN WebMaker