CLIPS Advanced Programming Guide

download CLIPS Advanced Programming Guide

of 251

  • date post

    27-Oct-2014
  • Category

    Documents

  • view

    165
  • download

    4

Embed Size (px)

Transcript of CLIPS Advanced Programming Guide

Reference ManualVolume II Advanced Programming GuideVersion 6.24 June 15th 2006

CLIPS Reference Manual

CLIPS Advanced Programming Guide Version 6.24 June 15th 2006 CONTENTS License Information....................................................................................................................... i Preface........................................................................................................................................... iii Acknowledgements ..................................................................................................................... vii Section 1 - Introduction .................................................................................................................1 1.1 Warning About Interfacing With CLIPS .............................................................................1 1.2 C++ Compatibility ...............................................................................................................2 1.3 Threads and Concurrency ....................................................................................................2 1.4 Garbage Collection ..............................................................................................................3 Section 2 - Installing and Tailoring CLIPS .................................................................................9 2.1 Installing CLIPS...................................................................................................................9 2.1.1 Additional Considerations ........................................................................................12 2.2 Tailoring CLIPS.................................................................................................................13 Section 3 - Integrating CLIPS with External Functions ..........................................................19 3.1 Declaring User-Defined External Functions......................................................................19 3.2 Passing Arguments from CLIPS to External Functions ....................................................23 3.2.1 Determining the Number of Passed Arguments .......................................................23 3.2.2 Passing Symbols, Strings, Instance Names, Floats, and Integers .............................23 3.2.3 Passing Unknown Data Types ..................................................................................25 3.2.4 Passing Multifield Values.........................................................................................28 3.3 Returning Values To CLIPS From External Functions .....................................................30 3.3.1 Returning Symbols, Strings, and Instance Names....................................................31 3.3.2 Returning Boolean Values ........................................................................................32 3.3.3 Returning External Addresses and Instance Addresses ............................................34 3.3.4 Returning Unknown Data Types ..............................................................................34 3.3.5 Returning Multifield Values .....................................................................................37 3.4 User-Defined Function Example .......................................................................................40 Section 4 - Embedding CLIPS ....................................................................................................43 4.1 Environment Functions......................................................................................................43 4.1.1 AddClearFunction.....................................................................................................43 4.1.2 AddPeriodicFunction ................................................................................................44 4.1.3 AddResetFunction.....................................................................................................44 4.1.4 BatchStar...................................................................................................................45 4.1.5 Bload.........................................................................................................................45CLIPS Basic Programming Guide i

CLIPS Reference Manual

4.1.6 Bsave.........................................................................................................................46 4.1.7 Build..........................................................................................................................46 4.1.8 Clear..........................................................................................................................46 4.1.9 Eval ...........................................................................................................................47 4.1.10 FunctionCall............................................................................................................47 4.1.11 GetAutoFloatDividend............................................................................................48 4.1.12 GetDynamicConstraintChecking ............................................................................48 4.1.13 GetSequenceOperatorRecognition..........................................................................48 4.1.14 GetStaticConstraintChecking..................................................................................49 4.1.15 InitializeEnvironment .............................................................................................49 4.1.16 Load ........................................................................................................................49 4.1.17 RemoveClearFunction ............................................................................................50 4.1.18 RemovePeriodicFunction........................................................................................50 4.1.19 RemoveResetFunction ............................................................................................50 4.1.20 Reset........................................................................................................................51 4.1.21 Save.........................................................................................................................51 4.1.22 SetAutoFloatDividend ............................................................................................51 4.1.23 SetDynamicConstraintChecking.............................................................................52 4.1.24 SetSequenceOperator Recognition .........................................................................52 4.1.25 SetStaticConstraintChecking ..................................................................................53 4.2 Debugging Functions.........................................................................................................53 4.2.1 DribbleActive............................................................................................................53 4.2.2 DribbleOff.................................................................................................................53 4.2.3 DribbleOn .................................................................................................................54 4.2.4 GetWatchItem ...........................................................................................................54 4.2.5 Unwatch ....................................................................................................................54 4.2.6 Watch ........................................................................................................................55 4.3 Deftemplate Functions.......................................................................................................55 4.3.1 DeftemplateModule ..................................................................................................55 4.3.2 DeftemplateSlotAllowedValues ...............................................................................55 4.3.3 DeftemplateSlotCardinality ......................................................................................56 4.3.4 DeftemplateSlotDefaultP ..........................................................................................56 4.3.5 DeftemplateSlotDefaultValue...................................................................................57 4.3.6 DeftemplateSlotExistP..............................................................................................57 4.3.7 DeftemplateSlotMultiP .............................................................................................57 4.3.8 DeftemplateSlotNames .............................................................................................58 4.3.9 DeftemplateSlotRange ..............................................................................................58 4.3.10 DeftemplateSlotSingleP..........................................................................................58 4.3.11 DeftemplateSlotTypes.............................................................................................59 4.3.12 FindDeftemplate .....................................................................................................59 4.3.13 GetDeftemplateList.................................................................................................60 4.3.14 GetDeftemplateName .............................................................................................60 4.3.15 GetDeftemplatePPForm..........................................................................................60ii Table of Contents

CLIPS Reference Manual

4.3.16 GetDeftemplateWatch.............................................................................................61 4.3.17 GetNextDeftemplate ...........