XSI provides support for the modular development and execution of knowledge bases with the defmodule construct. XSI modules allow a set of constructs to be grouped together such that explicit control can be maintained over restricting the access of the constructs by other modules. This type of control is similar to global and local scoping used in languages such as C or Ada. By restricting access to deftemplate and defclass constructs, modules can function as blackboards, permitting only certain facts and instances to be seen by other modules. Modules are also used by rules to provide execution control.
The syntax of the defmodule construct is:
<defmodule-construct> ::= (defmodule <module-name> [<comment>]
<port-spec>*)
<port-specification> ::= (export <port-item>) |
(import <module-name> <port-item>)
<port-item> ::= ?ALL |
?NONE |
<port-construct> ?ALL |
<port-construct> ?NONE |
<port-construct> <construct-name>+
<port-construct> ::= deftemplate | defclass |
defglobal | deffunction | defgeneric