Table of ContentsXSI/CLIPS Short ReferenceHELP USAGEUsing the Help Facility from within the CLIPS dialog window. The help facility displays menus of topics and prompts the user for a choice. It then references the help file for that information. The help facility can be called with or without a command-line topic. Syntax: (help [<path>]) where <path> is the full path leading to a topic in the help tree. For example, for information on defrule syntax, the user would type: (help construct_summary defrule). The help function has no return value. Each element or field in the path is delimited by white space, and the help facility is not case sensitive. In addition, the entire name of a field does not need to be specified. Only enough characters to distinguish the field from other choices in the menu are necessary (if there is a conflict, the help facility will pick the first one in the list). For instance, (help con def) would be sufficient for the above example. A few special fields can be used while in the help facility. ^ Branch up one level. ? When specified at the end of a path, this forces a display of the current menu, even on branch-ups. <nil> Giving no topic field will branch up one level. A branch-up from the MAIN topic root node implies an exit from help. By default, the help facility comes up in the MAIN topic root menu and the user may make a choice as described above. The prompt line always displays the name of the current menu. The help facility will branch through the help-tree until instructed to exit by a branch-up from the top level. The level always is reset to the MAIN topic upon exit from the help facility. The first call to the help facility will take longer than successive calls while the system loads help information into an internal lookup table. All other calls to the help facility are very fast. The help facility reads help information from a file during execution. Users may wish to change the location of the help file to meet the configuration of their system. The help-path function was provided to allow this. Syntax: (help-path [<help-file-name>]) If no argument is specified, the function displays the name of the current help file. If an argument is specified, the help facility will use the new file name for future help references during this CLIPS session. To change the location of the help file permanently, a change must be made in the setup.h file, then CLIPS must be recompiled. The help-path function has no return value. RELEASE NOTESThe release notes help section contains information about new features and where to get technical support. Subtopics: NEW FEATURESVersion 6.2 of CLIPS contains two major enhancements. First, CLIPS now provides a mechanism which allows an embedded application to create multiple environments into which programs can be loaded. Second, an improved Windows 95/98/NT CLIPS interface is now available and the Macintosh CLIPS interface has been enhanced to support MacOS X. For a detailed listing of differences between the 6.x releases, refer to appendix B of the Basic Programming Guide and appendix C of the Advanced Programming Guide. SUPPORT INFORMATIONCLIPS executables, documentation, and source code are available for download from http://www.ghg.net/clips/download/. Questions regarding CLIPS can be sent via electronic mail to clips@ghg.net. An electronic conferencing facility, sponsored by Distributed Computing Systems (http://www.discomsys.com), is also available to CLIPS users. Subscribers to this facility may send questions, observations, answers, editorials, etc., in the form of electronic mail to the conference. All subscribers will have a copy of these messages reflected back to them at their respective electronic mail addresses. To subscribe, send a single line message to clips-request@discomsys.com containing the word “subscribe”. The subject field is ignored but the address found in the Reply:, Reply to:, or From: field will be entered in the distribution list. Upon subscription you will receive a mail message instructing you how to participate in the conference from that point forward. Save this mail message. You may need the instructions later if you wish to unsubscribe from the list server. To send your own messages to members of the conference you need simply address your mail to clips@discomsys.com. Your message will be reflected to all other members of the conference. If you wish to remove yourself from the conference and discontinue receiving mail simply send a message to clips-request@discomsys.com with “unsubscribe” as the message text. If you want to unsubscribe using another email account than the one you subscribed with, then append the original subscribing email account to the text of the message. For example: “unsubscribe john.doe@account.net”. Do not send unsubscribe messages to clips@discomsys.com! This sends a mail message to every member of the list. If you need to get in contact with the list administrator (for trouble unsubscribing or other questions about the list), send email to clips-owner @discomsys.com. Intelligent Software Professionals has made available the CLIPS-LIST archive, a WWW-based full text searchable archive containing over two years of question and answers directed to the CLIPS List Server. It can be accessed at the URL http://www.isphouston.com/swish-web.html. A CLIPS World Wide Web page can be accessed using the URL http://www.ghg.net/clips/CLIPS.html. Usenet users can also find information and post questions about CLIPS to the comp.ai.shells news group. The CLIPS Developers' Forum, a thread-based message board, is available at http://www.cpbinc.com/clips. This board exists to provide a site for discussion of research, development, and implementation of the CLIPS expert systems and related technologies. The hosting services for this web page are provided by CPB, Inc. Questions pertaining to this forum can be sent to jerry.gamble@cpbinc.com. CONSTRUCT SUMMARYThis section gives a general overview of the available CLIPS constructs. Subtopics: DEFRULEOne of the primary methods of representing knowledge in CLIPS is a rule. A rule is a collection of conditions and the actions to be taken if the conditions are met. The developer of an expert system defines the rules which describe how to solve a problem. Rules execute (or fire) based on the existence or non-existence of facts. CLIPS provides the mechanism (the inference engine) which attempts to match the rules to the current state of the system (as represented by the fact-list) and applies the actions. (defrule <rule-name> [<comment>] [<declaration>] <conditional-element>* => <action>*) DECLARATIONS <declaration> ::= (declare <rule-property>+) <rule-property> ::= (salience <integer-expression>) | (auto-focus <boolean-symbol>) CONDITIONAL ELEMENTS <conditional-element> ::= <pattern-CE> | <assigned-pattern-CE> | <not-CE> | <and-CE> | <or-CE> | <logical-CE> | <test-CE> | <exists-CE> | <forall-CE> <test-CE> ::= (test <function-call>) <not-CE> ::= (not <conditional-element>) <and-CE> ::= (and <conditional-element>+) <or-CE> ::= (or <conditional-element>+) <exists-CE> ::= (exists <conditional-element>+) <forall-CE> ::= (forall <conditional-element> <conditional-element>+) <logical-CE> ::= (logical <conditional-element>+) PATTERN CONDITIONAL ELEMENT <assigned-pattern-CE>::= ?<variable-symbol> <- <pattern-CE> <pattern-CE> ::= <ordered-pattern-CE> | <template-pattern-CE> | <object-pattern-CE> <ordered-pattern-CE> ::= (<symbol> <constraint>*) <template-pattern-CE>::= (<deftemplate-name <LHS-slot>*) <object-pattern-CE> ::= (object <attribute-constraint>*) <attribute-constraint> ::= (is-a <constraint>) | (name <constraint>) | (<slot-name> <constraint>*) <LHS-slot> ::= <single-field-LHS-slot> | <multifield-LHS-slot> <LHS-slot> ::= <single-field-LHS-slot> | <multifield-LHS-slot> <single-field-LHS-slot> ::= (<slot-name> <constraint>) <multifield-LHS-slot> ::= (<slot-name> <constraint>*) PATTERN CONSTRAINTS <constraint> ::= ? | $? | <connected-constraint> <connected-constraint> ::= <single-constraint> | <single-constraint> & <connected-constraint> | <single-constraint> | <connected-constraint> <single-constraint> ::= <term> | ~<term> <term> ::= <constant> | <single-field-variable> | <multifield-variable> | :<function-call> | =<function-call> DEFFACTSWith the deffacts construct, a list of facts can be defined which are automatically asserted whenever the reset command is performed. Facts asserted through deffacts may be retracted or pattern matched like any other fact. The initial fact-list, including any defined deffacts, is always reconstructed after a reset command. The syntax of the deffacts construct is: (deffacts <deffacts-name> [<comment>] <RHS-pattern>*) DEFTEMPLATEOrdered facts encode information positionally. To access that information, a user must know not only what data is stored in a fact but which field contains the data. Non-ordered (or deftemplate) facts provide the user with the ability to abstract the structure of a fact by assigning names to each field found within the fact. The deftemplate construct is used to create a template which can then be used by non-ordered facts to access fields of the fact by name. The deftemplate construct is analogous to a record or structure definition in programming languages such as Pascal and C. The syntax of the deftemplate construct is: (deftemplate <deftemplate-name> [<comment>] <slot-definition>*) <slot-definition> ::= <single-slot-definition> | <multislot-definition> <single-slot-definition> ::= (slot <slot-name> <template-attribute>*) <multislot-definition> ::= (multislot <slot-name> <template-attribute>*) <template-attribute> ::= <default-attribute> | <constraint-attribute> <default-attribute> ::= (default ?DERIVE | ?NONE | <expression>*) | (default-dynamic <expression>*) DEFGLOBALWith the defglobal construct, global variables can be defined, set, and accessed within the CLIPS environment. Global variables can be accessed as part of the pattern matching process, but changing them does not invoke the pattern matching process. The bind function is used to set the value of global variables. The syntax of the defglobal construct is: <defglobal-construct> ::= (defglobal [<defmodule-name>] <global-assignment>*) <global-assignment> ::= <global-variable> = <expression> <global-variable> ::= ?*<symbol>* DEFFUNCTIONWith the deffunction construct, new functions may be defined directly in CLIPS. Deffunctions are equivalent in use to other functions in CLIPS. The only differences between user-defined external functions and deffunctions are that deffunctions are written in CLIPS and executed by CLIPS interpretively and user-defined external functions are written in an external language, such as C, and executed by CLIPS directly. Also, deffunctions allow the addition of new functions without having to recompile and relink CLIPS. The syntax of the deffunction construct is: (deffunction <name> [<comment>] (<regular-parameter>* [<wildcard-parameter>]) <action>*) <regular-parameter> ::= <single-field-variable> <wildcard-parameter> ::= <multifield-variable> DEFGENERIC / DEFMETHODWith the defgeneric/defmethod constructs, new generic functions may be written directly in CLIPS. Generic functions are similar to deffunctions because they can be used to define new procedural code directly in CLIPS, and they can be called like any other function. However, generic functions are much more powerful because they can do different things depending on the types (or classes) and number of their arguments. For example, a '+' operator could be defined which performs concatenation for strings but still performs arithmetic addition for numbers. Generic functions are comprised of multiple components called methods, where each method handles different cases of arguments for the generic function. A generic function which has more than one method is said to be overloaded. A generic function is comprised of a header (similar to a forward declaration) and zero or more methods. A generic function header can either be explicitly declared by the user or implicitly declared by the definition of at least one method. The defgeneric construct is used to specify the generic function header, and the defmethod construct is used for each of the generic function's methods. The syntax of the defgeneric/defmethod constructs is: (defgeneric <name> [<comment>]) (defmethod <name> [<index>] [<comment>] (<parameter-restriction>* [<wildcard-parameter>]) <action>*) <parameter-restriction> ::= <single-field-variable> | (<single-field-variable> <type>* [<query>]) <wildcard-parameter> ::= <multifield-variable> <type> ::= <class-name> <query> ::= <global-variable> | <function-call> DEFCLASSA defclass is a construct for specifying the properties (slots) of a class of objects. A defclass consists of four elements: 1) a name, 2) a list of superclasses from which the new class inherits slots and message-handlers, 3) a specifier saying whether or not the creation of direct instances of the new class is allowed and 4) a list of slots specific to the new class. All user-defined classes must inherit from at least one class, and to this end COOL provides predefined system classes for use as a base in the derivation of new classes. Any slots explicitly given in the defclass override those gotten from inheritance. COOL applies rules to the list of superclasses to generate a class precedence list for the new class. Facets further describe slots. Some examples of facets include: default value, cardinality, and types of access allowed. The syntax of the defclass construct is: (defclass <name> [<comment>] (is-a <superclass-name>+) [<role>] [<pattern-match-role>] <slot>* <handler-documentation>*) <role> ::= (role concrete | abstract) <pattern-match-role> ::= (pattern-match reactive | non-reactive) <slot> ::= (slot <name> <facet>*) | (single-slot <name> <facet>*) | (multislot <name> <facet>*) <facet> ::= <default-facet> | <storage-facet> | <access-facet> | <propagation-facet> | <source-facet> | <pattern-match-facet> | <visibility-facet> | <create-accessor-facet> <override-message-facet> | <constraint-attributes> <default-facet> ::= (default ?DERIVE | ?NONE | <expression>*) | (default-dynamic <expression>*) <storage-facet> ::= (storage local | shared) <access-facet> ::= (access read-write | read-only | initialize-only) <propagation-facet> ::= (propagation inherit | no-inherit) <source-facet> ::= (source exclusive | composite) <pattern-match-facet> ::= (pattern-match reactive | non-reactive) <visibility-facet> ::= (visibility private | public) <create-accessor-facet> ::= (create-accessor ?NONE | read | write | read-write) <override-message-facet> ::= (override-message ?DEFAULT | <message-name>) <handler-documentation> ::= (message-handler <name> [<handler-type>]) <handler-type> ::= primary | around | before | after DEFINSTANCESSimilar to deffacts, the definstances construct allows the specification of instances which will be created every time the reset command is executed. On every reset all current instances receive a delete message, and the equivalent of a make-instance function call is made for every instance specified in definstances constructs. The syntax of the definstances construct is: <definstances-construct> ::= (definstances <definstances-name> [<comment>] <instance-template>*) <instance-template> ::= (<instance-definition>) <instance-definition> ::= <instance-name-expression> of <class-name-expression> <slot-override>* <slot-override> ::= (<slot-name-expression> <expression>*) DEFMESSAGE HANDLERObjects are manipulated by sending them messages via the function send. The result of a message is a useful return-value or side-effect. A defmessage-handler is a construct for specifying the behavior of a class of objects in response to a particular message. The implementation of a message is made up of pieces of procedural code called message-handlers (or handlers for short). Each class in the class precedence list of an object's class can have handlers for a message. In this way, the object's class and all its superclasses share the labor of handling the message. Each class's handlers handle the part of the message which is appropriate to that class. Within a class, the handlers for a particular message can be further subdivided into four types or categories: primary, before, after and around. A defmessage-handler is comprised of seven elements: 1) a class name to which to attach the handler (the class must have been previously defined), 2) a message name to which the handler will respond, 3) an optional type (the default is primary), 4) an optional comment, 5) a list of parameters that will be passed to the handler during execution, 6) an optional wildcard parameter and 7) a series of expressions which are executed in order when the handler is called. The return-value of a message-handler is the evaluation of the last expression in the body. The syntax of the defmessage-handler construct is: (defmessage-handler <class-name> <message-name> [<handlertype>] [<comment>] (<parameter>* [<wildcard-parameter>]) <action>*) <handler-type> ::= around | before | primary | after <parameter> ::= <single-field-variable> <wildcard-parameter> ::= <multifield-variable> DEFMODULECLIPS provides support for the modular development and execution of knowledge bases with the defmodule construct. CLIPS 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 CONSTRAINT ATTRIBUTESConstraint attributes can be associated with deftemplate and defclass slots so that type checking can be performed on slot values when template facts and instances are created. The constraint information is also analyzed for the patterns on the LHS of a rule to determine if the specified constraints prevent the rule from ever firing. The syntax for constraint attributes is: <constraint-attribute> ::= <type-attribute> | <allowed-constant-attribute> | <range-attribute> | <cardinality-attribute> <default-attribute> <type-attribute> ::= (type <type-specification>) <type-specification> ::= <allowed-type>+ | ?VARIABLE <allowed-type> ::= SYMBOL | STRING | LEXEME | INTEGER | FLOAT | NUMBER | INSTANCE-NAME | INSTANCE-ADDRESS | INSTANCE | EXTERNAL-ADDRESS | FACT-ADDRESS <allowed-constant-attribute> ::= (allowedsymbols <symbol-list>) | (allowedstrings <string-list>) | (allowed-lexemes <lexeme-list> | (allowedintegers <integer-list>) | (allowedfloats <float-list>) | (allowednumbers <number-list>) | (allowed-instance-names <instance-list>) | (allowedvalues <value-list>) | <symbol-list> ::= <symbol>+ | ?VARIABLE <string-list> ::= <string>+ | ?VARIABLE <lexeme-list> ::= <lexeme>+ | ?VARIABLE <integer-list> ::= <integer>+ | ?VARIABLE <float-list> ::= <float>+ | ?VARIABLE <number-list> ::= <number>+ | ?VARIABLE <instance-name-list> ::= <instance-name>+ | ?VARIABLE <value-list> ::= <constant>+ | ?VARIABLE <range-attribute> ::= (range <range-specification> <range-specification>) <range-specification> ::= <number> | ?VARIABLE <cardinality-attribute> ::= (cardinality <cardinality-specification> <cardinality-specification>) <cardinality-specification> ::= <integer> | ?VARIABLE FUNCTION SUMMARYThis section gives a general overview of the available CLIPS functions. Subtopics: PREDICATE FUNCTIONSThe following functions perform predicate tests and return either TRUE or FALSE. FLOATPFLOATP NUMBERPReturns TRUE for integers and floats. (numberp <expression>) FLOATPReturns TRUE for floats. (floatp <expression>) INTEGERPReturns TRUE for integers. (integerp <expression>) LEXEMEPReturns TRUE for symbols and strings. (numberp <expression>) STRINGPReturns TRUE for strings. (stringp <expression>) SYMBOLPReturns TRUE for symbols. (symbolp <expression>) EVENPReturns TRUE for even numbers. (evenp <expression>) ODDPReturns TRUE for odd numbers. (oddp <expression>) MULTIFIELDPReturns TRUE for multifield values. (multifieldp <expression>) POINTERPReturns TRUE for external addresses. (pointerp <expression>) EQReturns TRUE if the 1st argument is equal in type and value to all subsequent arguments. (eq <expression> <expression>+) NEQReturns TRUE if the 1st argument is not equal in type and value to all subsequent arguments. (neq <expression> <expression>+) =Returns TRUE if the 1st argument is equal in value to all subsequent arguments. (= <numeric-expression> <numeric-expression>+) <>Returns TRUE if the 1st argument is not equal in value to all subsequent arguments. (<> <numeric-expression> <numeric-expression>+) >Returns TRUE if each argument is greater in value than the argument following it. (> <numeric-expression> <numeric-expression>+) >=Returns TRUE if each argument is greater than or equal to in value than the argument following it. (>= <numeric-expression> <numeric-expression>+) <Returns TRUE if each argument is less in value than the argument following it. (> <numeric-expression> <numeric-expression>+) <=Returns TRUE if each argument is less than or equal to in value than the argument following it. (<= <numeric-expression> <numeric-expression>+) ANDReturns TRUE if all arguments evaluate to a non-FALSE value. (and <expression>+) ORReturns TRUE if any argument evaluates to a non-FALSE value. (or <expression>+) NOTReturns TRUE if its only argument evaluates to FALSE. (not <expression>) MULTIFIELD FUNCTIONSThe following functions operate on multifield values. CREATE$Appends its arguments together to create a multifield value. (create$ <expression>*) NTH$Returns the specified field of a multifield value. (nth$ <integer-expression> <multifield-expression>) MEMBER$Returns the position of a single-field value within a multifield value. (member$ <single-field-expression> <multifield-expression>) SUBSETPReturns TRUE if the first argument is a subset of the second argument. (subsetp <multifield-expression> <multifield-expression>) DELETE$Deletes the specified range from a multifield value. (delete$ <multifield-expression> <begin-integer-expression> <end-integer-expression>) DELETE-MEMBER$Deletes specific values contained within a multifield value and returns the modified multifield value. (delete-member$ <multifield-expression> <expression>+) EXPLODE$Creates a multifield value from a string. (explode$ <string-expression>) IMPLODE$Creates a string from a multifield value. (implode$ <multifield-expression>) SUBSEQ$Extracts the specified range from a multifield value. (subseq$ <multifield-expression> <begin-integer-expression> <end-integer-expression>) REPLACE$Replaces the specified range of a multifield value with a set of values. (replace$ <multifield-expression> <begin-integer-expression> <end-integer-expression> <single-or-multifield-expression>+) REPLACE-MEMBER$Replaces specific values contained within a multifield value and returns the modified multifield value. (replace-member$ <multifield-expression> <substitute-expression> <search-expression>+) INSERT$Inserts one or more values in a multifield. (insert$ <multifield-expression> <integer-expression> <single-or-multifield-expression>+) FIRST$Returns the first field of a multifield. (first$ <multifield-expression>) REST$Returns all but the first field of a multifield. (rest$ <multifield-expression>) LENGTH$Returns the number of fields in a multifield value. (length$ <multifield-expression>) STRING FUNCTIONSThe following functions perform operations that are related to strings. STR-CATConcatenates its arguments to form a single string. (str-cat <expression>*) SYM-CATConcatenates its arguments to form a single symbol. (sym-cat <expression>*) SUB-STRINGRetrieves a subportion from a string. (sub-string <integer-expression> <integer-expression> <string-expression>) STR-INDEXReturns the position of the first argument within the second argument. (str-index <lexeme-expression> <lexeme-expression>) EVALEvaluates a string as though it were entered at the command prompt. Only allows functions to be evaluated. (eval <lexeme-expression>) BUILDEvaluates a string as though it were entered at the command prompt. Only allows constructs to be evaluated. (build <lexeme-expression>) UPCASEConverts lowercase characters in a string or symbol to uppercase. (upcase <lexeme-expression>) LOWCASEConverts uppercase characters in a string or symbol to lowercase. (lowcase <lexeme-expression>) STR-COMPARELexigraphically compares two strings. (str-compare <lexeme-expression> <lexeme-expression>) STR-LENGTHReturns the length of a string. (str-length <lexeme-expression>) CHECK-SYNTAXAllows the text representation of a construct or function call to be checked for syntax and semantic errors. (check-syntax <construct-or-function-string>) STRING-TO-FIELDParses a string and converts its contents to a primitive data type. (string-to-field <string-or-symbol-expression>) IO FUNCTIONSThe following functions perform I/O operations. OPENOpens a file. (open <file-name> <logical-name> [<mode>]) <mode> ::= "r" | "w" | "r+" | "a" | "wb" CLOSECloses a file. (close [<logical-name>]) PRINTOUTSends unformated output to the specified logical name. (printout <logical-name> <expresion>*) READReads a single-field value from the specified logical name. (read [<logical-name>]) READLINEReads an entire line as a string from the specified logical name. (readline [<logical-name>]) FORMATSends formated output to the specified logical name. (format <logical-name> <string-expression> <expression>*) RENAMEChanges the name of a file. (rename <old-file-name> <new-file-name>) REMOVEDeletes a file. (remove <file-name>) MATH FUNCTIONSThe math functions have been divided into three broad categories. The basic math functions are always provided with CLIPS. The trigonometric and extended math functions are included as part of the extended math package. Subtopics: BASIC MATH FUNCTIONSThe following functions perform basic mathematical operations. +Returns the sum of its arguments. (+ <numeric-expression> <numeric-expression>+) -Returns the first argument minus all subsequent arguments. (- <numeric-expression> <numeric-expression>+) *Returns the product of its arguments. (* <numeric-expression> <numeric-expression>+) /Returns the first argument divided by all subsequent arguments. (/ <numeric-expression> <numeric-expression>+) DIVReturns the first argument divided by all subsequent arguments using integer division. (div <numeric-expression> <numeric-expression>+) MAXReturns the value of its largest numeric argument. (max <numeric-expression>+) MINReturns the value of its smallest numeric argument. (min <numeric-expression>+) ABSReturns the absolute value of its only argument. (abs <numeric-expression>) FLOATConverts its only argument to a float. (float <numeric-expression>) INTEGERConverts its only argument to an integer. (integer <numeric-expression>) TRIGONOMETRIC FUNCTIONSThe following trigonometric functions take one numeric argument and return a float. The argument is expected to be in radians. These functions are part of the extended math package. FUNCTIONRETURNS acos arccosine acosh hyperbolic arccosine acot arccotangent acoth hyperbolic arccotangent acsc arccosecant acsch hyperbolic arccosecant asec arcsecant asech hyperbolic arcsecant asin arcsine asinh hyperbolic arcsine atan arctangent atanh hyperbolic arctangent cos cosine cosh hyperbolic cosine cot cotangent coth hyperbolic tangent csc cosecant csch hyperbolic cosecant sec secant sech hyperbolic secant sin sine sinh hyperbolic sine tan tangent tanh hyperbolic tangent EXTENDED MATH FUNCTIONSThe following functions perform extended mathematical operations and are included as part of the extended math package. DEG-GRADConverts its only argument from degrees to gradients. (deg-grad <numeric-expression>) DEG-RADConverts its only argument from degrees to radians. (deg-rad <numeric-expression>) GRAD-DEGConverts its only argument from gradients to degrees. (grad-deg <numeric-expression>) RAD-DEGConverts its only argument from radians to degrees. (rad-deg <numeric-expression>) PIReturns the value of pi. (pi) SQRTReturns the square root of its only argument. (sqrt <numeric-expression>) %%**%%Raises its first argument to the power of its second argument. (** <numeric-expression> <numeric-expression>) EXPRaises the value e to the power of its only argument. (exp <numeric-expression>) LOGReturns the logarithm base e of its only argument. (log <numeric-expression>) LOG10Returns the logarithm base 10 of its only argument. (log10 <numeric-expression>) ROUNDRounds its argument toward the closest integer or negative infinity if exactly between two integers. (round <numeric-expression>) MODReturns the remainder of the result of dividing its first argument by its second argument (assuming that the result of division must be an integer). (mod <numeric-expression> <numeric-expression>) PROCEDURAL FUNCTIONSThe following are functions which provide procedural programming capabilities as found in languages such as Pascal, C, and Ada. BINDBinds a variable to a new value. (bind <variable> <expression>*) IFAllows conditional execution of a group of actions. (if <expression> then <action>* [else <action>*]) WHILEAllows conditional looping. (while <expression> [do] <action>*) LOOP-FOR-COUNTAllows simple iterative looping. (loop-for-count <range-spec> [do] <action>*) <range-spec> ::= <end-index> | (<loop-variable> [<start-index> <end-index>]) <start-index> ::= <integer-expression> <end-index> ::= <integer-expression> PROGNEvaluates all arguments and returns the value of the last argument evaluated. (progn <expression>*) PROGN$Performs a set of actions for each field of a multifield value. (progn$ <list-spec> <expression>*) <list-spec> ::= <multifield-expression> | (<list-variable> <multifield-expression>) RETURNImmediately terminates the currently executing deffunction, generic function method, message-handler, defrule RHS, or certain instance set query functions and if a value is specified, returns this value as the result of the executing construct. (return [<expression>]) BREAKImmediately terminates the currently iterating while loop, progn execution, or certain instance set query functions. (break) SWITCHAllows a particular group of actions to be performed based on a specified value. (switch <test-expression> <case-statement>* [<default-statement>]) <case-statement> ::= (case <comparison-expression> then <action>*) <default-statement> ::= (default <action>*) MISCELLANEOUS FUNCTIONSThe following are additional functions for use within CLIPS. GENSYMReturns a special sequenced symbol. (gensym) GENSYM*Returns a special unique sequenced symbol. (gensym*) SETGENSets the starting number used by gensym and gensym*. (setgen <integer-expression>) RANDOMReturns a “random” integer value. (random [<start-integer-expression> <end-integer-expression>]) SEEDSeeds the random number generator used by random. (seed <integer-expression>) TIMEReturns a float representing the elapsed seconds since the system reference time. (time) LENGTHReturns an integer for the number of fields in a multifield value or the length in characters of a string or symbol. (length <lexeme-or-multifield-expression>) GET-FUNCTION -RESTRICTIONSReturns the restriction string associated with a CLIPS or user defined function. (get-function-restrictions <function-name>) SORTAllows a list of values to be sorted based on a user specified comparison function. (sort <comparison-function-name> <expression>*) FUNCALLConstructs a function call from its arguments and then evaluates the function call. (funcall (function-name> <expression>*) TIMERReturns the number of seconds elapsed evaluating a series of expressions. (timer <expression>*) DEFTEMPLATE FUNCTIONSThe following functions provide ancillary capabilities for the deftemplate construct. GET-DEFTEMPLATE-LISTReturns the list of all deftemplates in the specified module (or the current module if unspecified). (get-deftemplate-list [<module-name>]) DEFTEMPLATE-MODULEReturns the module in which the specified deftemplate is defined. (deftemplate-module <deftemplate-name>) FACT FUNCTIONSThe following actions are used for assert, retracting, and modifying facts. ASSERTAdds a fact to the fact-list. (assert <RHS pattern>+) RETRACTRemoves a fact from the fact-list. (retract <retract-specifier>+ | *) <retract-specifier> ::= <fact-specifier> | <integer-expression> MODIFYModifies a deftemplate fact in the fact-list. (modify <fact-specifier> <RHS-slot>*) DUPLICATEDuplicates a deftemplate fact in the fact-list. (duplicate <fact-specifier> <RHS-slot>*) ASSERT-STRINGConverts a string into a fact and asserts it. (assert-string <string-expression>) FACT-INDEXReturns the fact index of a fact address. (fact-index <fact-address>) FACT-EXISTPReturns TRUE if the fact specified by its fact-index or fact-address argument exists, otherwise FALSE. (fact-existp <fact-address-or-index>) FACT-RELATIONReturns the deftemplate (relation) name associated the fact. (fact-relation <fact-address-or-index>) FACT-SLOT-NAMESReturns the slot names associated with the fact. (fact-slot-names <fact-address-or-index>) FACT-SLOT-VALUEReturns the value of the specified slot from the specified fact. (fact-slot-value <fact-address-or-index> <slot-name>) GET-FACT-LISTReturns a multifield containing the list of visible facts. (get-fact-list [<module-name>]) DEFFACTS FUNCTIONSThe following functions provide ancillary capabilities for the deffacts construct. GET-DEFFACTS-LISTReturns the list of all deffacts in the specified module (or the current module if unspecified). (get-deffacts-list [<module-name>]) DEFFACTS-MODULEReturns the module in which the specified deffacts is defined. (deffacts-module <deffacts-name>) DEFRULE FUNCTIONSThe following functions provide ancillary capabilities for the defrule construct. GET-DEFRULE-LISTReturns the list of all defrules in the specified module (or the current module if unspecified). (get-defrule-list [<module-name>]) DEFRULE-MODULEReturns the module in which the specified defrule is defined. (defrule-module <defrule-name>) AGENDA FUNCTIONSThe following functions provide ancillary capabilities for manipulating the agenda. GET-FOCUSReturns the module name of the current focus. (get-focus) GET-FOCUS-STACKReturns all of the module names in the focus stack as a multifield value. (get-focus-stack) POP-FOCUSRemoves the current focus from the focus stack and returns the module name of the current focus. (pop-focus) DEFGLOBAL FUNCTIONSThe following functions provide ancillary capabilities for the defglobal construct. GET-DEFGLOBAL-LISTReturns the list of all defglobals in the specified module (or the current module if unspecified). (get-defglobal-list [<module-name>]) DEFGLOBAL-MODULEReturns the module in which the specified defglobal is defined. (defglobal-module <defglobal-name>) DEFFUNCTION FUNCTIONSThe following functions provide ancillary capabilities for the deffunction construct. GET-DEFFUNCTION-LISTReturns the list of all deffunctions in the specified module (or the current module if unspecified). (get-deffunction-list [<module-name>]) DEFFUNCTION-MODULEReturns the module in which the specified deffunction is defined. (deffunction-module <deffunction-name>) GENERIC FUNCTIONSThe following functions provide ancillary capabilities for generic function methods. GET-DEFGENERIC-LISTReturns the list of all defgenerics in the specified module (or the current module if unspecified). (get-defgeneric-list [<module-name>]) DEFGENERIC-MODULEReturns the module in which the specified defgeneric is defined. (defgeneric-module <defgeneric-name>) GET-DEFMETHOD-LISTReturns the list of all defmethods in the current module (or just the methods associated with the specified defgeneric). (get-defmethod-list [<defgeneric-name>]) TYPEReturns a symbol which is the name of the type (or class) of its of argument. (type <expression>) NEXT-METHODPIf called from a method for a generic function, the function next-methodp will return the symbol TRUE if there is another method shadowed by the current one. Otherwise, the function will return the symbol FALSE. (next-methodp) CALL-NEXT-METHODCalls the next shadowed method. (call-next-method) OVERRIDE-NEXT-METHODCalls the next shadowed method allowing new arguments to be provided. (override-next-method <expression>*) CALL-SPECIFIC-METHODCalls a particular method of a generic function without regards to method precedence. (call-specific-method <generic-function> <method-index> <expression>*) GET-METHOD-RESTRICTIONSReturns a multifield value containing information about the restrictions for the specified method. (get-method-restrictions <generic-function-name> <method-index>) COOL FUNCTIONSThe functions manipulating the CLIPS Object-Oriented Language (COOL) are divided into five categories. Subtopics: CLASS FUNCTIONSThe following functions are used with classes. GET-DEFCLASS-LISTReturns the list of all defclasses in the specified module (or the current module if unspecified). (get-defclass-list [<module-name>]) DEFCLASS-MODULEReturns the module in which the specified defclass is defined. (defclass-module <defclass-name>) CLASS-EXISTPReturns TRUE if the specified class is defined, FALSE otherwise. (class-existp <class-name>) SUPERCLASSPReturns TRUE if the first class is a superclass of the second class, FALSE otherwise. (superclassp <class1-name> <class2-name>) SUBCLASSPReturns TRUE if the first class is a subclass of the second class, FALSE otherwise. (subclassp <class1-name> <class2-name>) SLOT-EXISTPReturns TRUE if the specified slot is present in the class, FALSE otherwise. If the inherit keyword is specified, then the slot may be inherited. (slot-existp <class-name> <slot-name> [inherit]) SLOT-WRITABLEPReturns TRUE if the specified slot is writable, otherwise FALSE. (slot-writablep <class-name> <slot-name>) SLOT-INITABLEPReturns TRUE if the specified slot is initializable, otherwise FALSE. (slot-initablep <class-name> <slot-name>) SLOT-PUBLICPReturns TRUE if the specified slot is public, otherwise FALSE. (slot-initablep <class-name> <slot-name>) SLOT-DIRECT-ACCESSPReturns TRUE if the specified slot can be accessed directly, otherwise FALSE. (slot-direct-accessp <class-name> <slot-name>) MESSAGE-HANDLER-EXISTPReturns TRUE if the specified message-handler is defined (directly, not by inheritance) for the class, FALSE otherwise. (message-handler-existp <class-name> <handler-name> [<handler-type>]) <handler-type> ::= around | before | primary | after CLASS-ABSTRACTPReturns TRUE if the specified class is abstract, FALSE otherwise. (class-abstractp <class-name>) CLASS-REACTIVEPReturns TRUE if the specified class is reactive, FALSE otherwise. (class-reactivep <class-name>) CLASS-SUPERCLASSESReturns the names of the direct superclasses of a class in a multifield variable. If the optional “inherit” argument is given, indirect superclasses are also included. (class-superclasses <class-name> [inherit]) CLASS-SUBCLASSESReturns the names of the direct subclasses of a class in a multifield variable. If the optional “inherit” argument is given, indirect subclasses are also included. (class-subclasses <class-name> [inherit]) CLASS-SLOTSReturns the names of the explicitly defined slots of a class in a multifield variable. If the optional inherit keyword is given, inherited slots are also included. (class-slots <class-name> [inherit]) GET-DEFMESSAGE-HANDLER-LISTReturns the class names, message names, and message types of the message-handlers directly attached to a class in a multifield variable. If the optional inherit keyword is given, inherited message-handlers are also included. (get-defmessage-handler-list <class-name> [inherit]) SLOT-FACETSReturns the facet values for the specified slot of a class in a multifield value. (slot-facets <class-name> <slot-name>) SLOT-SOURCESReturns the names of the classes which provide facets for a slot of a class in a multifield variable. (slot-sources <class-name> <slot-name>) SLOT-TYPESReturns the names of the primitive types allowed for a slot in a multifield variable. (slot-types <class-name> <slot-name>) SLOT-CARDINALITYReturns the minimum and maximum number of fields allowed for a multislot in a multifield variable. (slot-cardinality <class-name> <slot-name>) SLOT-ALLOWED-VALUESReturns the allowed values for a slot in a multifield value. (slot-allowed-values <class-name> <slot-name>) SLOT-RANGEReturns the minimum and maximum numeric values allowed for a slot. (slot-range <class-name> <slot-name>) SLOT-DEFAULT-VALUEReturns the default value associated with a slot. (slot-default-value <class-name> <slot-name>) GET-CLASS-DEFAULTS-MODEReturns the current defaults mode used when classes are defined. (get-class-defaults-mode) SET-CLASS-DEFAULTS-MODESets the defaults mode used when classes are defined. (set-class-defaults-mode <mode>) <mode> ::= convenience | conservation MESSAGE-HANDLER FUNCTIONSThe following functions are used with message-handlers. NEXT-HANDLERPReturns TRUE if there is another message-handler available for execution, FALSE otherwise. (next-handlerp) CALL-NEXT-HANDLERCalls the next shadowed handler. (call-next-handler) OVERRIDE-NEXT-HANDLERCalls the next shadowed handler and allows the arguments to be changed. (override-next-handler <expression>*) DEFINSTANCES FUNCTIONSGET-DEFINSTANCES-LISTReturns the list of all definstances in the specified module (or the current module if unspecified). (get-definstances-list [<module-name>]) DEFINSTANCES-MODULEReturns the module in which the specified definstance is defined. (definstances-module <definstances-name>) INSTANCE MANIPULATION FUNCTIONSThe following manipulation functions are used with instances. INIT-SLOTSImplements the init message-handler attached to the class USER. This function should never be called directly unless an init message-handler is being defined such that the one attached to USER will never be called. (init-slots) UNMAKE-INSTANCEDeletes the specified instance by sending it the delete message. (unmake-instance <instance-expression> | *) DELETE-INSTANCEDeletes the active instance when called from within the body of a message-handler. (delete-instance) CLASSReturns a symbol which is the name of the class of its argument. (class <object-expression>) INSTANCE-NAMEReturns a symbol which is the name of its instance argument. (instance-name <instance-expression>) INSTANCE-ADDRESSReturns the address of its instance argument. (instance-address <instance-expression>) SYMBOL-TO-INSTANCE-NAMEConverts a symbol to an instance name. (symbol-to-instance-name <symbol-expression>) INSTANCE-NAME-TO-SYMBOLConverts an instance name to a symbol. (instance-name-to-symbol <instance-name-expression>) INSTANCE PREDICATE FUNCTIONSThe following predicate functions are used with instances. INSTANCEPReturns TRUE if its argument is an instance name or instance address, FALSE otherwise. (instancep <expression>) INSTANCE-ADDRESSPReturns TRUE if its argument is an instance address, FALSE otherwise. (instance-addressp <expression>) INSTANCE-NAMEPReturns TRUE if its argument is an instance name, FALSE otherwise. (instance-namep <expression>) INSTANCE-EXISTPReturns TRUE if the specified instance exists, FALSE otherwise. (instance-existp <instance-expression>) INSTANCE SLOT FUNCTIONSThe following functions are used to manipulate instance slots. DYNAMIC-GETReturns the value of the specified slot of the active instance. (dynamic-get <slot-name-expression>) DYNAMIC-PUTSets the value of the specified slot of the active instance. (put <slot-name-expression> <expression>*) SLOT-REPLACE$Allows the replacement of a range of fields in a multifield slot value. (slot-replaceR <instance-expression> <mv-slot-name> <range-begin> <range-end> <expression>+) DIRECT-SLOT-REPLACE$Allows the replacement of a range of fields in a multifield slot value of the active instance from within a message-handler. (direct-slot-replace$ <mv-slot-name> <range-begin> <range-end> <expression>+) SLOT-INSERT$Allows the insertion of one or more values in a multifield slot value. (slot-insert$ <instance-expression> <mv-slot-name> <index> <expression>+) DIRECT-SLOT-INSERT$Allows the insertion of one or more values in a multifield slot value of the active instance from within a message-handler. (direct-slot-insert$ <mv-slot-name> <index> <expression>+) SLOT-DELETE$Allows the deletion of a range of fields in a multifield slot value. (slot-delete$ <instance-expression> <mv-slot-name> <range-begin> <range-end>) DIRECT-SLOT-DELETE$Allows the deletion of a range of fields in a multifield slot value of the active instance from within a message-handler. (direct-slot-delete$ <mv-slot-name> <range-begin> <range-end>) DEFMODULE FUNCTIONSThe following functions provide ancillary capabilities for the defmodule construct. GET-DEFMODULE-LISTReturns the list of all defmodules. (get-defmodule-list) SEQUENCE EXPANSION FUNCTIONSThe following functions provide ancillary capabilities for the sequence expansion operator. EXPAND$When used inside of a function call, expands its arguments as separate arguements to the function. The $ operator is merely a shorthand notation for the expand$ function call. (expand$ <multifield-expression>) SET-SEQUENCE-OPERATOR-RECOGNITIONSets the sequence operator recognition behavior. (setsequence-operator-recognition <boolean-expression>) GET-SEQUENCE-OPERATOR-RECOGNITIONReturns the current value of the sequence operator recognition behavior. (getsequence-operator-recognition) COMMAND SUMMARYThis section gives a general overview of the available CLIPS commands. Subtopics: ENVIRONMENT COMMANDSThe following commands control the CLIPS environment. BATCH* GET-DYNAMIC-CONSTRAINT-CHECKING GET-STATIC-CONSTRAINT-CHECKING LOAD* SET-DYNAMIC-CONSTRAINT-CHECKING LOADLoads constructs from a file. (load <file-name>) LOAD*Loads constructs from a file without displaying messages. (load* <file-name>) SAVESaves constructs to a file. (save <file-name>) BLOADLoads a binary image from a file. (bload <file-name>) BSAVESaves a binary image to a file. (bsave <file-name>) CLEARClears the CLIPS environment. (clear) EXITExits the CLIPS environment. (exit) RESETResets the CLIPS environment. (reset) BATCHExecutes commands from a file. (batch <file-name>) BATCH*Executes commands from a file. Unlike the batch command, evaluates all of the commands in the specified file before returning rather than replacing standard input. (batch* <file-name>) OPTIONSLists the settings of CLIPS compiler flags. (options) SYSTEMAppends its arguments together to form a command which is then sent to the operating system. (system <lexeme-expression>*) SET-AUTO-FLOAT-DIVIDENDSets the auto-float dividend behaviour. (set-auto-float-dividend <boolean-expression>) GET-AUTO-FLOAT-DIVIDENDReturns the current value of the auto-float dividend behaviour. (get-auto-float-dividend) SET-DYNAMIC-CONSTRAINT-CHECKINGSets the dynamic constraint checking behaviour. (set-dynamic-constraint-checking <boolean-expression>) GET-DYNAMIC-CONSTRAINT-CHECKINGReturns the current value of the dynamic constraint checking behaviour. (get-dynamic-constraint-checking) SET-STATIC-CONSTRAINT-CHECKINGSets the static constraint checking behaviour. (set-static-constraint-checking <boolean-expression>) GET-STATIC-CONSTRAINT-CHECKINGReturns the current value of the static constraint checking behaviour. (get-static-constraint-checking) APROPOSDisplays all symbols currently defined in CLIPS which contain a specified substring. (apropos <lexeme>) DEBUGGING COMMANDSThe following commands control the CLIPS debugging features. DRIBBLE-ONSends trace information to the specified file. (dribble-on <file-name>) DRIBBLE-OFFCloses the trace file. (dribble-off) WATCHEnables trace information for the specified item. (watch <watch-item>) <watch-item> ::= all | compilations | statistics | focus | messages | deffunctions <deffunction-name>* | globals <global-name>* | rules <rule-name>* | activations <rule-name>* | facts <deftemplate-name>* | instances <class-name>* | slots <class-name>* | message-handlers <handler-spec-1>* [<handler-spec-2>]) | generic-functions <generic-name>* | methods <method-spec-1>* [<method-spec-2>] <handler-spec-1> ::= <class-name> <handler-name> <handler-type> <handler-spec-2> ::= <class-name> [<handler-name> [<handler-type>]] <method-spec-1> ::= <generic-name> <method-index> <method-spec-2> ::= <generic-name> [<method-index>] UNWATCHDisables trace information for the specified item. (unwatch <watch-item>) LIST-WATCH-ITEMSDisplays the current state of watch items. (list-watch-items [<watch-item>]) DEFTEMPLATE COMMANDSPPDEFTEMPLATEDisplays the text of a given deftemplate. (ppdeftemplate <deftemplate-name>) LIST-DEFTEMPLATESDisplays the list of all deftemplates in the specified module (or the current module if none specified). (list-deftemplates [<module-name>]) UNDEFTEMPLATEDeletes a deftemplate. (undeftemplate <deftemplate-name>) FACT COMMANDSThe following commands display information about facts. FACTSDisplay the facts in the fact-list. (facts [<module-name>] [<start-integer-expression> [<end-integer-expression> [<max-integer-expression>]]]) LOAD-FACTSAsserts facts loaded from a file. (load-facts <file-name>) SAVE-FACTSSaves facts to a file. (save-facts <file-name> [<save-scope> <deftemplate-names>*]) <save-scope> ::= visible | local DEPENDENCIESLists the partial matches from which a fact or instance receives logical support. (dependencies <fact-or-instance-specifier>) DEPENDENTSLists all facts or instances which receive logical support from a fact or instance. (dependents <fact-or-instance-specifier>) SET-FACT-DUPLICATIONSets the fact duplication behavior. (set-fact-duplication <boolean-expression>) GET-FACT-DUPLICATIONReturns the fact duplication behavior. (get-fact-duplication) DEFFACTS COMMANDSPPDEFFACTSDisplays the text of a given deffacts. (ppdeffacts <deffacts-name>) LIST-DEFFACTSDisplays the list of all deffacts in the specified module (or the current module if none specified). (list-deffacts [<module-name>]) UNDEFFACTSDeletes a deffacts. (undeffacts <deffacts-name>) DEFRULE COMMANDSThe following commands manipulate defrules. PPDEFRULEDisplays the text of a given rule. (ppdefrule <rule-name>) LIST-DEFRULESDisplays the list of all defrules in the specified module (or the current module if none specified). (list-defrules [<module-name>]) UNDEFRULEDeletes a defrule. (undefrule <rule-name>) MATCHESDisplays the facts which match the patterns of a rule. (matches <rule-name>) SET-BREAKSets a breakpoint on a rule. (set-break <rule-name>) REMOVE-BREAKRemoves a breakpoint on a rule. (remove-break [<rule-name>]) SHOW-BREAKSDisplays all rules having breakpoints. (show-breaks [<module-name>]) REFRESHPlaces all current activations of a rule on the agenda. (refresh <rule-name>) SET-INCREMENTAL-RESETSets the incremental reset behavior. (set-incremental-reset <boolean-expression>) GET-INCREMENTAL-RESETReturns the incremental reset behavior. (get-incremental-reset) AGENDA COMMANDSThe following commands manipulate the agenda. AGENDADisplays all activations on the agenda of the specified module. (agenda [<module-name>]) RUNStarts execution of rules. Rules fire until agenda is empty or the number of rule firings limit specified by the first argument is reached (infinity if unspecified). (run [<integer-expression>]) FOCUSPushes one or more modules onto the focus stack. (focus <module-name>+) HALTStops rule execution. (halt) SET-STRATEGYSets the current conflict resolution strategy. (set-strategy <strategy>) <strategy> ::= depth | breadth | simplicity | complexity | lex | mea | random GET-STRATEGYReturns the current conflict resolution strategy. (get-strategy) LIST-FOCUS-STACKLists all module names on the focus stack. (list-focus-stack) CLEAR-FOCUS-STACKRemoves all modules from the focus stack. (clear-focus-stack) SET-SALIENCE-EVALUATIONSets the salience evaluation behavior. (set-salience-evaluation <behavior>) <behavior> ::= when-defined | when-activated | every-cycle GET-SALIENCE-EVALUATIONReturns the salience evaluation behavior. (get-salience-evaluation) REFRESH-AGENDAForces reevaluation of salience of rules on the agenda of the specified module. (refresh-agenda [<module-name>]) DEFGLOBAL COMMANDSThe following commands manipulate defglobals. PPDEFGLOBALDisplays the text required to define a given global variable. (ppdefglobal <global-variable-name>) LIST-DEFGLOBALSDisplays the list of all defglobals in the specified module (or the current module if none specified). (list-defglobals [<module-name>]) UNDEFGLOBALDeletes a global variable. (undefglobal <global-variable-name>) SHOWS-DEFGLOBALSDisplays the name and current value of all defglobals n the specified module (or the current module if none specified). (show-defglobals [<module-name>]) SET-RESET-GLOBALSSets the reset global variables behavior. (set-reset-globals <boolean-expression>) GET-RESET-GLOBALSReturns the reset global variables behavior. (get-reset-globals) DEFFUNCTION COMMANDSPPDEFFUNCTIONDisplays the text of a given deffunction. (ppdeffunction <deffunction-name>) LIST-DEFFUNCTIONSDisplays the list of all deffunctions in the specified module (or the current module if none specified). (list-deffunctions [<deffunction-name>]) UNDEFFUNCTIONDeletes a deffunction. (undeffunction <deffunction-name>) GENERIC FUNCTION COMMANDSThe following commands manipulate generic functions. PPDEFGENERICDisplays the text of a given generic function header. (ppdefgeneric <generic-function-name>) PPDEFMETHODDisplays the text of a given method. (ppdefmethod <generic-function-name> <index>) LIST-DEFGENERICSDisplays the names of all generic functions in the specified module (or the current module if none specified). (list-defgenerics [<module-name>]) LIST-DEFMETHODSDisplays a list of generic function methods. (list-defmethods [<generic-function-name>]) UNDEFGENERICDeletes a generic function. (undefgeneric <generic-function-name>) UNDEFMETHODDeletes a generic function method. (undefmethod <generic-function-name> <index>) PREVIEW-GENERICLists all applicable methods for a particular generic function call in order of decreasing precedence. (preview-generic <generic-function-name> <expression>*) COOL COMMANDSThe commands manipulating the CLIPS Object-Oriented Language (COOL) are divided into four categories. Subtopics: CLASS COMMANDSThe following commands manipulate defclasses. PPDEFCLASSDisplays the text of a given defclass. (ppdefclass <class-name>) LIST-DEFCLASSESDisplays the list of all defclasses in the specified module (or the current module if none specified). (list-defclasses [<module-name>]) UNDEFCLASSDeletes a defclass, all its subclasses, and all associated instances. (undefclass <class-name>) DESCRIBE-CLASSProvides a verbose description of a class. (describe-class <class-name>) BROWSE-CLASSESProvides a rudimentary display of the inheritance relationships between a class and all its subclasses. (browse-classes [<class-name>]) MESSAGE-HANDLER COMMANDSThe following commands manipulate defmessage-handlers. PPDEFMESSAGE-HANDLERDisplays the text of a given defmessage-handler. (ppdefmessage-handler <class-name> <handler-name> [<handler-type>]) LIST-DEFMESSAGE-HANDLERSDisplays a list of all (or some) defmessage-handlers. (list-defmessage-handlers [<class-name> [<handler-name> [<handler-type>]]]) UNDEFMESSAGE-HANDLERDeletes a defmessage-handler. (undefmessage-handler <class-name> <handler-name> [<handler-type>]) PREVIEW-SENDDisplays a list of all the applicable message-handlers for a message sent to an instance of a particular class. (preview-send <class-name> <message-name>) <handler-type> ::= around | before | primary | after DEFINSTANCES COMMANDSPPDEFINSTANCESDisplays the text of a given definstances. (ppdefinstances <definstances-name>) LIST-DEFINSTANCESDisplays the list of all definstances in the specified module (or the current module if none specified). (list-definstances [<module-name>]) UNDEFINSTANCESDeletes a definstances (undefinstances <definstances-name>) INSTANCES COMMANDSThe following commands manipulate instances of user-defined classes. INSTANCESDisplays a list of instances. (instances [<module-name> [<class-name> [inherit]]]) PPINSTANCEPrints the slots of the active instance when called from within the body of a message-handler. (ppinstance) SAVE-INSTANCESSaves all instances to the specified file. (save-instances <file-name>) LOAD-INSTANCESLoads instances from the specified file. (load-instances <file-name>) RESTORE-INSTANCESLoads instances from the specified file. (restore-instances <file-name>) DEFMODULE COMMANDSThe following commands manipulate defmodules. PPDEFMODULEDisplays the text of a given defmodule. (ppdefmodule <defmodule-name>) LIST-DEFMODULESDisplays the list of all defmodules. (list-defmodules) SET-CURRENT-MODULESets the current module. (set-current-module <module-name>) GET-CURRENT-MODULEReturns the current module. (get-current-module) MEMORY COMMANDSThe following commands display CLIPS memory status information. MEM-USEDReturns number of bytes of memory CLIPS is using. (mem-used) MEM-REQUESTSReturns the number of times CLIPS has requested memory from the operating system. (mem-requests) RELEASE-MEMReleases all free memory held internally by CLIPS to the operating system. Returns the amount of memory freed. (release-mem) CONSERVE-MEMTurns on or off the storage of information used for the save and pretty-print commands. (conserve-mem <status>) <status> ::= on | off TEXT PROCESSING COMMANDSThe following commands can be used by users to maintain their own information system similar to the help facility. FETCHLoads the named file into the internal lookup table. (fetch <file-name>) PRINT-REGIONLooks up the specified entry in a particular file which has been previously loaded into the lookup table and prints the contents of that entry to the specified logical name. (print-region <logical-name> <lookup-file> <topic-field>*) TOSSUnloads the named file from the internal lookup table. (toss <file-name>) PROFILING COMMANDSThe following commands provide the ability to profile CLIPS programs for performance.. GET-PROFILE-PERCENT-THRESHOLDReturns the current value of the profile percent threshold. (get-profile-percent-threshold) PROFILEEnables/disables profiling of constructs and user functions. (profile constructs | user-functions | off) PROFILE-INFODisplays profiling information currently collected for constructs or user functions. (profile-info) PROFILE-RESETResets all profiling information currently collected for constructs and user functions. (profile-reset) SET-PROFILE-PERCENT-THRESHOLDSets the minimum percentage of time that must be spent executing a construct or user function for it to be displayed by the profile-info command. (set-profile-percent-threshold <number in the range 0 to 100>) |