NextPrevUpTopContentsIndex

defcontext

Macro
Syntax

defcontext context-name &key ( refractoriness t) ( auto-return t) strategy meta

Arguments

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.

Description

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.

Values

Returns the list (CONTEXT context-name ) .

Examples
(defcontext my-context :strategy (priority recency))
(defcontext another-context :strategy (order)
  :meta ((start-cycle)
         (instantiation ?inst)
         (fire-rule)
         (cut)
         (another-context)))
See also

standard-context

-lex

lex

-mea

mea

-order

order

-priority

priority

-recency

recency

-specificity

specificity


KnowledgeWorks and Prolog User Guide (Macintosh version) - 4 Apr 2005

NextPrevUpTopContentsIndex