Reference Manual - SourceForge

Transcription

Reference ManualVolume IBasic Programming GuideVersion 6.30March 17th 2015

CLIPS Reference ManualCLIPS Basic Programming GuideVersion 6.30 March 17th 2015CONTENTSLicense Information . iPreface .iiiAcknowledgements . viiSection 1: Introduction. 1Section 2: CLIPS Overview . 32.1 Interacting with CLIPS . 32.1.1 Top Level Commands . 32.1.2 Automated Command Entry and Loading . 42.1.3 Integration with Other Programming Languages . 52.2 Reference Manual Syntax. 52.3 Basic Programming Elements . 62.3.1 Data Types . 62.3.2 Functions . 92.3.3 Constructs . 102.4 Data Abstraction . 112.4.1 Facts . 112.4.2 Objects . 132.4.3 Global Variables . 152.5 Knowledge Representation . 152.5.1 Heuristic Knowledge – Rules . 152.5.2 Procedural Knowledge . 162.6 CLIPS Object-Oriented Language . 182.6.1 COOL Deviations from a Pure OOP Paradigm . 182.6.2 Primary OOP Features . 182.6.3 Instance-set Queries and Distributed Actions . 19Section 3: Deftemplate Construct . 213.1 Slot Default Values. 223.2 Slot Default Constraints for Pattern-Matching . 233.3 Slot Value Constraint Attributes . 233.4 Implied Deftemplates . 23Section 4: Deffacts Construct . 25Section 5: Defrule Construct . 27CLIPS Basic Programming Guidei

CLIPS Reference Manual5.1 Defining Rules . 275.2 Basic Cycle Of Rule Execution . 285.3 Conflict Resolution Strategies . 295.3.1 Depth Strategy . 295.3.2 Breadth Strategy . 295.3.3 Simplicity Strategy . 295.3.4 Complexity Strategy . 305.3.5 LEX Strategy . 305.3.6 MEA Strategy . 315.3.7 Random Strategy . 325.4 LHS Syntax . 335.4.1 Pattern Conditional Element. 345.4.2 Test Conditional Element . 515.4.3 Or Conditional Element . 525.4.4 And Conditional Element . 535.4.5 Not Conditional Element . 545.4.6 Exists Conditional Element . 555.4.7 Forall Conditional Element . 565.4.8 Logical Conditional Element . 585.4.9 Automatic Replacement of LHS CEs . 615.4.10 Declaring Rule Properties. 62Section 6: Defglobal Construct . 65Section 7: Deffunction Construct . 71Section 8: Generic Functions . 758.1 Note on the Use of the Term Method . 758.2 Performance Penalty of Generic Functions . 768.3 Order Dependence of Generic Function Definitions . 768.4 Defining a New Generic Function . 768.4.1 Generic Function Headers . 778.4.2 Method Indices . 778.4.3 Method Parameter Restrictions . 788.4.4 Method Wildcard Parameter. 798.5 Generic Dispatch . 818.5.1 Applicability of Methods Summary . 828.5.2 Method Precedence . 848.5.3 Shadowed Methods . 868.5.4 Method Execution Errors . 868.5.5 Generic Function Return Value . 87Section 9: CLIPS Object Oriented Language . 899.1 Background. 89iiTable of Contents

CLIPS Reference Manual9.2 Predefined System Classes . 899.3 Defclass Construct . 919.3.1 Multiple Inheritance . 929.3.2 Class Specifiers . 959.3.3 Slots . 959.3.4 Message-handler Documentation . 1059.4 Defmessage-handler Construct . 1069.4.1 Message-handler Parameters . 1089.4.2 Message-handler Actions . 1099.4.3 Daemons . 1119.4.4 Predefined System Message-handlers . 1129.5 Message Dispatch . 1169.5.1 Applicability of Message-handlers . 1189.5.2 Message-handler Precedence. 1189.5.3 Shadowed Message-handlers. 1189.5.4 Message Execution Errors . 1199.5.5 Message Return Value . 1209.6 Manipulating Instances . 1209.6.1 Creating Instances . 1209.6.2 Reinitializing Existing Instances . 1249.6.3 Reading Slots . 1259.6.4 Setting Slots . 1259.6.5 Deleting Instances . 1269.6.6 Delayed Pattern-Matching When Manipulating Instances . 1269.6.7 Modifying Instances . 1279.6.8 Duplicating Instances . 1299.7 Instance-set Queries and Distributed Actions . 1329.7.1 Instance-set Definition. 1359.7.2 Instance-set Determination . 1359.7.3 Query Definition . 1379.7.4 Distributed Action Definition . 1379.7.5 Scope in Instance-set Query Functions . 1389.7.6 Errors during Instance-set Query Functions . 1399.7.7 Halting and Returning Values from Query Functions . 1399.7.8 Instance-set Query Functions . 139Section 10: Defmodule Construct. 14510.1 Defining Modules . 14510.2 Specifying a Construct’s Module .

Reference Manual Volume I Basic Programming Guide Version 6.30 March 17th 2015