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

📄 objrtfnx.c

📁 NASA 开发使用的一个专家系统
💻 C
📖 第 1 页 / 共 3 页
字号:
  }  #if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintObjectGetVarPN1(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectMatchVar1 *hack;   hack = (struct ObjectMatchVar1 *) ValueToBitMap(theValue);      if (hack->objectAddress)     PrintCLIPS(logicalName,"(ptn-obj-ptr ");   else if (hack->allFields)     {      PrintCLIPS(logicalName,"(ptn-obj-slot-contents ");      PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->whichSlot)));     }   else     {      PrintCLIPS(logicalName,"(ptn-obj-slot-var ");      PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->whichSlot)));      PrintCLIPS(logicalName," ");      PrintLongInteger(logicalName,(long) hack->whichField);     }   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN ObjectGetVarPNFunction1(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   struct ObjectMatchVar1 *hack;      hack = (struct ObjectMatchVar1 *) ValueToBitMap(theValue);   GetObjectValueGeneral(theResult,CurrentPatternObject,CurrentPatternObjectMarks,hack);   return(CLIPS_TRUE);  }  #if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintObjectGetVarPN2(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectMatchVar2 *hack;      hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue);   PrintCLIPS(logicalName,"(ptn-obj-slot-quick-var ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->whichSlot)));   if (hack->fromBeginning)     {      PrintCLIPS(logicalName," B");      PrintLongInteger(logicalName,(long) (hack->beginningOffset + 1));     }   if (hack->fromEnd)     {      PrintCLIPS(logicalName," E");      PrintLongInteger(logicalName,(long) (hack->endOffset + 1));     }   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN ObjectGetVarPNFunction2(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   struct ObjectMatchVar2 *hack;      hack = (struct ObjectMatchVar2 *) ValueToBitMap(theValue);   GetObjectValueSimple(theResult,CurrentPatternObject,hack);   return(CLIPS_TRUE);  }  #if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintObjectCmpConstant(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectCmpPNConstant *hack;      hack = (struct ObjectCmpPNConstant *) ValueToBitMap(theValue);   PrintCLIPS(logicalName,"(obj-const ");   PrintCLIPS(logicalName,hack->pass ? "p " : "n ");   if (hack->general)     PrintExpression(logicalName,GetFirstArgument());   else     {      PrintCLIPS(logicalName,hack->fromBeginning ? "B" : "E");      PrintLongInteger(logicalName,(long) hack->offset);      PrintCLIPS(logicalName," ");      PrintExpression(logicalName,GetFirstArgument());     }   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintSlotLengthTest(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectMatchLength *hack;   hack = (struct ObjectMatchLength *) ValueToBitMap(theValue);      PrintCLIPS(logicalName,"(obj-slot-len ");   if (hack->exactly)     PrintCLIPS(logicalName,"= ");   else     PrintCLIPS(logicalName,">= ");   PrintLongInteger(logicalName,(long) hack->minLength);   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN SlotLengthTestFunction(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   struct ObjectMatchLength *hack;      theResult->type = SYMBOL;   theResult->value = CLIPSFalseSymbol;   hack = (struct ObjectMatchLength *) ValueToBitMap(theValue);   if (CurrentObjectSlotLength < hack->minLength)     return(CLIPS_FALSE);   if (hack->exactly && (CurrentObjectSlotLength > hack->minLength))     return(CLIPS_FALSE);   theResult->value = CLIPSTrueSymbol;   return(CLIPS_TRUE);  }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintPNSimpleCompareFunction1(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectCmpPNSingleSlotVars1 *hack;   hack = (struct ObjectCmpPNSingleSlotVars1 *) ValueToBitMap(theValue);      PrintCLIPS(logicalName,"(pslot-cmp1 ");   PrintCLIPS(logicalName,hack->pass ? "p " : "n ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->firstSlot)));   PrintCLIPS(logicalName," ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->secondSlot)));   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN PNSimpleCompareFunction1(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   struct ObjectCmpPNSingleSlotVars1 *hack;   INSTANCE_SLOT *is1,*is2;   int rv;      hack = (struct ObjectCmpPNSingleSlotVars1 *) ValueToBitMap(theValue);   is1 = GetInsSlot(CurrentPatternObject,hack->firstSlot);   is2 = GetInsSlot(CurrentPatternObject,hack->secondSlot);   if (is1->type != is2->type)     rv = hack->fail;   else if (is1->value != is2->value)     rv = hack->fail;   else     rv = hack->pass;   theResult->type = SYMBOL;   theResult->value = rv ? CLIPSTrueSymbol : CLIPSFalseSymbol;   return(rv);  }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintPNSimpleCompareFunction2(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectCmpPNSingleSlotVars2 *hack;   hack = (struct ObjectCmpPNSingleSlotVars2 *) ValueToBitMap(theValue);      PrintCLIPS(logicalName,"(pslot-cmp2 ");   PrintCLIPS(logicalName,hack->pass ? "p " : "n ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->firstSlot)));   PrintCLIPS(logicalName,hack->fromBeginning ? " B" : " E");   PrintLongInteger(logicalName,(long) hack->offset);   PrintCLIPS(logicalName," ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->secondSlot)));   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN PNSimpleCompareFunction2(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   struct ObjectCmpPNSingleSlotVars2 *hack;   int rv;   FIELD f1;   INSTANCE_SLOT *is2;      hack = (struct ObjectCmpPNSingleSlotVars2 *) ValueToBitMap(theValue);   GetInsMultiSlotField(&f1,CurrentPatternObject,(unsigned) hack->firstSlot,                             (unsigned) hack->fromBeginning,(unsigned) hack->offset);   is2 = GetInsSlot(CurrentPatternObject,hack->secondSlot);   if (f1.type != is2->type)     rv = hack->fail;   else if (f1.value != is2->value)     rv = hack->fail;   else     rv = hack->pass;   theResult->type = SYMBOL;   theResult->value = rv ? CLIPSTrueSymbol : CLIPSFalseSymbol;   return(rv);  }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintPNSimpleCompareFunction3(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectCmpPNSingleSlotVars3 *hack;   hack = (struct ObjectCmpPNSingleSlotVars3 *) ValueToBitMap(theValue);      PrintCLIPS(logicalName,"(pslot-cmp3 ");   PrintCLIPS(logicalName,hack->pass ? "p " : "n ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->firstSlot)));   PrintCLIPS(logicalName,hack->firstFromBeginning ? " B" : " E");   PrintLongInteger(logicalName,(long) hack->firstOffset);   PrintCLIPS(logicalName," ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->secondSlot)));   PrintCLIPS(logicalName,hack->secondFromBeginning ? " B" : " E");   PrintLongInteger(logicalName,(long) hack->secondOffset);   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN PNSimpleCompareFunction3(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   struct ObjectCmpPNSingleSlotVars3 *hack;   int rv;   FIELD f1,f2;      hack = (struct ObjectCmpPNSingleSlotVars3 *) ValueToBitMap(theValue);   GetInsMultiSlotField(&f1,CurrentPatternObject,(unsigned) hack->firstSlot,                        (unsigned) hack->firstFromBeginning,(unsigned) hack->firstOffset);   GetInsMultiSlotField(&f2,CurrentPatternObject,(unsigned) hack->secondSlot,                        (unsigned) hack->secondFromBeginning,(unsigned) hack->secondOffset);   if (f1.type != f2.type)     rv = hack->fail;   else if (f1.value != f2.value)     rv = hack->fail;   else     rv = hack->pass;   theResult->type = SYMBOL;   theResult->value = rv ? CLIPSTrueSymbol : CLIPSFalseSymbol;   return(rv);  }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintJNSimpleCompareFunction1(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectCmpJoinSingleSlotVars1 *hack;   hack = (struct ObjectCmpJoinSingleSlotVars1 *) ValueToBitMap(theValue);      PrintCLIPS(logicalName,"(jslot-cmp1 ");   PrintCLIPS(logicalName,hack->pass ? "p " : "n ");   PrintLongInteger(logicalName,(long) hack->firstPattern);   PrintCLIPS(logicalName," ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->firstSlot)));   PrintCLIPS(logicalName," ");   PrintLongInteger(logicalName,(long) hack->secondPattern);   PrintCLIPS(logicalName," ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->secondSlot)));   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN JNSimpleCompareFunction1(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   INSTANCE_TYPE *ins1,*ins2;   struct multifieldMarker *theMarks;   struct ObjectCmpJoinSingleSlotVars1 *hack;   int rv;   INSTANCE_SLOT *is1,*is2;      hack = (struct ObjectCmpJoinSingleSlotVars1 *) ValueToBitMap(theValue);   GetPatternObjectAndMarks(((int) hack->firstPattern) - 1,&ins1,&theMarks);   is1 = GetInsSlot(ins1,hack->firstSlot);   GetPatternObjectAndMarks(((int) hack->secondPattern) - 1,&ins2,&theMarks);   is2 = GetInsSlot(ins2,hack->secondSlot);   if (is1->type != is2->type)     rv = hack->fail;   else if (is1->value != is2->value)     rv = hack->fail;   else     rv = hack->pass;   theResult->type = SYMBOL;   theResult->value = rv ? CLIPSTrueSymbol : CLIPSFalseSymbol;   return(rv);  }#if IBM_TBC && (! DEVELOPER)#pragma argsused#endifstatic VOID PrintJNSimpleCompareFunction2(logicalName,theValue)  char *logicalName;  VOID *theValue;  {#if DEVELOPER   struct ObjectCmpJoinSingleSlotVars2 *hack;   hack = (struct ObjectCmpJoinSingleSlotVars2 *) ValueToBitMap(theValue);      PrintCLIPS(logicalName,"(jslot-cmp2 ");   PrintCLIPS(logicalName,hack->pass ? "p " : "n ");   PrintLongInteger(logicalName,(long) hack->firstPattern);   PrintCLIPS(logicalName," ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->firstSlot)));   PrintCLIPS(logicalName,hack->fromBeginning ? " B" : " E");   PrintLongInteger(logicalName,(long) hack->offset);   PrintCLIPS(logicalName," ");   PrintLongInteger(logicalName,(long) hack->secondPattern);   PrintCLIPS(logicalName," ");   PrintCLIPS(logicalName,ValueToString(FindIDSlotName((unsigned) hack->secondSlot)));   PrintCLIPS(logicalName,")");#else#if MAC_MPW || MAC_MCW#pragma unused(logicalName)#pragma unused(theValue)#endif#endif  }  static BOOLEAN JNSimpleCompareFunction2(theValue,theResult)  VOID *theValue;  DATA_OBJECT *theResult;  {   INSTANCE_TYPE *ins1,*ins2;   struct multifieldMarker *theMarks;   struct ObjectCmpJoinSingleSlotVars2 *hack;   int rv;   FIELD f1;   INSTANCE_SLOT *is2;   

⌨️ 快捷键说明

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