⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 factprt.c

📁 clips源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
   /*******************************************************/   /*      "C" Language Integrated Production System      */   /*                                                     */   /*             CLIPS Version 6.22  06/15/04            */   /*                                                     */   /*           FACT RETE PRINT FUNCTIONS MODULE          */   /*******************************************************//*************************************************************//* Purpose: Print routines for the fact rete primitives.     *//*                                                           *//* Principal Programmer(s):                                  *//*      Gary D. Riley                                        *//*                                                           *//* Contributing Programmer(s):                               *//*                                                           *//* Revision History:                                         *//*                                                           *//*************************************************************/#define _FACTPRT_SOURCE_#include <stdio.h>#define _STDIO_INCLUDED_#include "setup.h"#if DEFTEMPLATE_CONSTRUCT && DEFRULE_CONSTRUCT#include "envrnmnt.h"#include "symbol.h"#include "router.h"#include "factgen.h"#include "factprt.h"/***************************************//* PrintFactJNCompVars1: Print routine *//*   for the FactJNCompVars1 function. *//***************************************/#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifgloble void PrintFactJNCompVars1(  void *theEnv,  char *logicalName,  void *theValue)  {#if DEVELOPER   struct factCompVarsJN1Call *hack;   hack = (struct factCompVarsJN1Call *) ValueToBitMap(theValue);   EnvPrintRouter(theEnv,logicalName,"(fact-jn-cmp-vars1 ");   if (hack->pass) EnvPrintRouter(theEnv,logicalName,"= ");   else EnvPrintRouter(theEnv,logicalName,"<> ");      EnvPrintRouter(theEnv,logicalName,"p");   PrintLongInteger(theEnv,logicalName,(long long) hack->pattern1);   if (hack->p1lhs)     { EnvPrintRouter(theEnv,logicalName," L"); }   else if (hack->p1rhs)     { EnvPrintRouter(theEnv,logicalName," R"); }      EnvPrintRouter(theEnv,logicalName," s");   PrintLongInteger(theEnv,logicalName,(long long) hack->slot1);   EnvPrintRouter(theEnv,logicalName," p");   PrintLongInteger(theEnv,logicalName,(long long) hack->pattern2);   if (hack->p2lhs)     { EnvPrintRouter(theEnv,logicalName," L"); }   else if (hack->p2rhs)     { EnvPrintRouter(theEnv,logicalName," R"); }   EnvPrintRouter(theEnv,logicalName," s");   PrintLongInteger(theEnv,logicalName,(long long) hack->slot2);   EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }/***************************************//* PrintFactJNCompVars2: Print routine *//*   for the FactJNCompVars2 function. *//***************************************/#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifgloble void PrintFactJNCompVars2(  void *theEnv,  char *logicalName,  void *theValue)  {#if DEVELOPER   struct factCompVarsJN2Call *hack;   hack = (struct factCompVarsJN2Call *) ValueToBitMap(theValue);   EnvPrintRouter(theEnv,logicalName,"(fact-jn-cmp-vars2 ");   if (hack->pass) EnvPrintRouter(theEnv,logicalName,"= ");   else EnvPrintRouter(theEnv,logicalName,"<> ");   EnvPrintRouter(theEnv,logicalName,"p");   PrintLongInteger(theEnv,logicalName,(long long) hack->pattern1);   if (hack->p1lhs)     { EnvPrintRouter(theEnv,logicalName," L"); }   else if (hack->p1rhs)     { EnvPrintRouter(theEnv,logicalName," R"); }   EnvPrintRouter(theEnv,logicalName," s");   PrintLongInteger(theEnv,logicalName,(long long) hack->slot1);   if (hack->fromBeginning1) EnvPrintRouter(theEnv,logicalName, " b");   else EnvPrintRouter(theEnv,logicalName," e");   EnvPrintRouter(theEnv,logicalName," f");   PrintLongInteger(theEnv,logicalName,(long long) hack->offset1);   EnvPrintRouter(theEnv,logicalName," p");   PrintLongInteger(theEnv,logicalName,(long long) hack->pattern2);   if (hack->p2lhs)     { EnvPrintRouter(theEnv,logicalName," L"); }   else if (hack->p2rhs)     { EnvPrintRouter(theEnv,logicalName," R"); }   EnvPrintRouter(theEnv,logicalName," s");   PrintLongInteger(theEnv,logicalName,(long long) hack->slot2);   if (hack->fromBeginning2) EnvPrintRouter(theEnv,logicalName," b");   else EnvPrintRouter(theEnv,logicalName," e");   EnvPrintRouter(theEnv,logicalName," f");   PrintLongInteger(theEnv,logicalName,(long long) hack->offset2);   EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }/***************************************//* PrintFactPNCompVars1: Print routine *//*   for the FactPNCompVars1 function. *//***************************************/#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifgloble void PrintFactPNCompVars1(  void *theEnv,  char *logicalName,  void *theValue)  {#if DEVELOPER   struct factCompVarsPN1Call *hack;   hack = (struct factCompVarsPN1Call *) ValueToBitMap(theValue);   EnvPrintRouter(theEnv,logicalName,"(fact-pn-cmp-vars ");   if (hack->pass) EnvPrintRouter(theEnv,logicalName,"p ");   else EnvPrintRouter(theEnv,logicalName,"n ");   PrintLongInteger(theEnv,logicalName,(long long) hack->field1);   EnvPrintRouter(theEnv,logicalName," ");   PrintLongInteger(theEnv,logicalName,(long long) hack->field2);   EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }/**************************************//* PrintFactSlotLength: Print routine *//*   for the FactSlotLength function. *//**************************************/#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifgloble void PrintFactSlotLength(  void *theEnv,  char *logicalName,  void *theValue)  {#if DEVELOPER   struct factCheckLengthPNCall *hack;   hack = (struct factCheckLengthPNCall *) ValueToBitMap(theValue);   EnvPrintRouter(theEnv,logicalName,"(slot-length ");   PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);   EnvPrintRouter(theEnv,logicalName," ");   if (hack->exactly) EnvPrintRouter(theEnv,logicalName,"= ");   else EnvPrintRouter(theEnv,logicalName,">= ");   PrintLongInteger(theEnv,logicalName,(long long) hack->minLength);   EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }/*************************************//* PrintFactJNGetVar1: Print routine *//*   for the FactJNGetvar1 function. *//*************************************/#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifgloble void PrintFactJNGetVar1(  void *theEnv,  char *logicalName,  void *theValue)  {#if DEVELOPER   struct factGetVarJN1Call *hack;   hack = (struct factGetVarJN1Call *) ValueToBitMap(theValue);   EnvPrintRouter(theEnv,logicalName,"(fact-jn-getvar-1 ");   if (hack->factAddress) EnvPrintRouter(theEnv,logicalName,"t ");   else EnvPrintRouter(theEnv,logicalName,"f ");   if (hack->allFields) EnvPrintRouter(theEnv,logicalName,"t ");   else EnvPrintRouter(theEnv,logicalName,"f ");   EnvPrintRouter(theEnv,logicalName,"p");   PrintLongInteger(theEnv,logicalName,(long long) hack->whichPattern + 1);   EnvPrintRouter(theEnv,logicalName," ");   PrintLongInteger(theEnv,logicalName,(long long) hack->whichField);   EnvPrintRouter(theEnv,logicalName," s");   PrintLongInteger(theEnv,logicalName,(long long) hack->whichSlot);      if (hack->lhs)     { EnvPrintRouter(theEnv,logicalName," L"); }   else if (hack->rhs)     { EnvPrintRouter(theEnv,logicalName," R"); }   EnvPrintRouter(theEnv,logicalName,")");#else#if MAC_MCW || IBM_MCW || MAC_XCD#pragma unused(theEnv)#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }/*************************************//* PrintFactJNGetVar2: Print routine */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -