context-name is the name of the context being defined. refractoriness may be t
or nil
and indicates whether a given rule instantiation may fire more than once. auto-return may be t
or nil
and indicates whether to signal an error if no more rules are eligible to fire in the context. meta is a list of actions.
Defines a context of the given name and parameters. If a context of the given name already exists then it, and all the rules in it, are first removed. If refractoriness is set to nil
then a rule instantiation remains eligible to fire again after firing once. 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. strategy is the conflict resolution strategy for the context. meta is a list of actions which make up the optional meta-interpreter for the context.
(defcontext my-context :strategy (priority recency))
(defcontext another-context :strategy (order)
:meta ((start-cycle)
(instantiation ?inst)
(fire-rule)
(cut)
(another-context)))