defcontext context-name &key (refractoriness t) (auto-return t) strategy meta documentation
The name of the context being defined.
A boolean.
A boolean.
A list of symbols.
A list of actions.
A string.
Defines a context named context-name. If a context of that name already exists then it, and all the rules in it, are first removed.
If refractoriness is nil
then a rule instantiation remains eligible to fire again after firing once. If refractoriness is t
(the default) then each rule instantiation will only fire once.
The auto-return indicates, when there are no more rules to be fired in the context, whether to signal an error or simply to pass control to the next context on the agenda. The default value t
passes control on without an error.
The strategy is the conflict resolution strategy for the context, consisting of a list of tactic names.
The meta is a list of actions which make up the optional meta-interpreter for the context.
If documentation is given, then it should be a string. The value can be retrieved by calling the function documentation
with doc-type context
.
(defcontext my-context :strategy (priority recency))
(defcontext another-context :strategy (order)
:meta ((start-cycle)
(instantiation ?inst)
(fire-rule)
(cut)
(another-context)))
standard-context
-lex
lex
-mea
mea
-order
order
-priority
priority
-recency
recency
-specificity
specificity
KnowledgeWorks and Prolog User Guide (Unix version) - 24 Mar 2017