

#include "BUILTIN.h"

#include "Nat.h"
extern OBJ _APair_5(OBJ);extern OBJ __APair_5;
extern OBJ __ASeq_6;
extern OBJ _ARep_27(OBJ,OBJ);extern OBJ __ARep_27;

#include "Char.h"
extern OBJ _ASeqMap_3(OBJ,OBJ);extern OBJ __ASeqMap_3;
extern OBJ _AMap_16(OBJ,OBJ,OBJ);extern OBJ __AMap_16;
extern OBJ _AMap_20(OBJ,OBJ,OBJ);extern OBJ __AMap_20;
extern OBJ _AMap_31(OBJ,OBJ,OBJ,OBJ);extern OBJ __AMap_31;
extern OBJ _AMap_33(OBJ,OBJ,OBJ);extern OBJ __AMap_33;
extern OBJ _AMapConv_4(OBJ,OBJ);extern OBJ __AMapConv_4;

#include "Array.h"
extern OBJ __ATree_7;
OBJ __AKnowledge_2; /* empty */
extern OBJ _AKnowledge_3(OBJ,OBJ,OBJ);OBJ __AKnowledge_3; /* defAsLocal */
extern OBJ _AKnowledge_4(OBJ,OBJ,OBJ);OBJ __AKnowledge_4; /* defAsLocalOrConstr */
extern OBJ _AKnowledge_5(OBJ,OBJ);OBJ __AKnowledge_5; /* isLocal? */
extern OBJ _AKnowledge_6(OBJ,OBJ);OBJ __AKnowledge_6; /* isLocalOrConstr? */
extern OBJ _AKnowledge_7(OBJ,OBJ);OBJ __AKnowledge_7; /* isGlobal? */
extern OBJ _AKnowledge_8(OBJ,OBJ);OBJ __AKnowledge_8; /* canBeLocal? */
extern OBJ _AKnowledge_9(OBJ,OBJ);OBJ __AKnowledge_9; /* canBeGlobal? */
extern OBJ _AKnowledge_10(OBJ,OBJ);OBJ __AKnowledge_10; /* no */
extern OBJ _AKnowledge_11(OBJ);OBJ __AKnowledge_11; /* locals */
extern OBJ _AKnowledge_12(OBJ,OBJ,OBJ);OBJ __AKnowledge_12; /* setFcts */
extern OBJ _AKnowledge_13(OBJ,OBJ);OBJ __AKnowledge_13; /* knownFcts */
extern OBJ _AKnowledge_14(OBJ);OBJ __AKnowledge_14; /* knowl */
extern OBJ _AKnowledge_15(OBJ);OBJ __AKnowledge_15; /* knowl? */
extern OBJ _AKnowledge_16(OBJ);OBJ __AKnowledge_16; /* map */

extern OBJ _AKnowledge_3(OBJ x1,OBJ x2,OBJ x3) /* defAsLocal */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x4;
  PRD1F(3,x4);FLD1(x4,1)=__ABUILTIN_5;FLD1(x4,2)=x2;FLD1(x4,3)=__ASeq_6;
  r=_AMap_31(__ARep_27,x1,x4,x3);}
 return r;}

extern OBJ _AKnowledge_4(OBJ x1,OBJ x2,OBJ x3) /* defAsLocalOrConstr */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x4;
  PRD1F(3,x4);FLD1(x4,1)=__ABUILTIN_3;FLD1(x4,2)=x2;FLD1(x4,3)=__ASeq_6;
  r=_AMap_31(__ARep_27,x1,x4,x3);}
 return r;}

extern OBJ _AKnowledge_5(OBJ x1,OBJ x2) /* isLocal? */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x3;
  x3=_AMap_33(__ARep_27,x2,x1);
  if(ISPRM(x3)){
   r=__ABUILTIN_3;
  }else{
   {OBJ x13=FLD1(x3,1);
    if(EXPRD(x3,1)){
     DSPRDF(x3);
    }else{
     CPPRD(x13,1);
     FRPRD(x3,1);}
    {OBJ x14=FLD1(x13,1);
     if(EXPRD(x13,1)){
      r=x14;
      FREE(FLD1(x13,3),1);DSPRDF(x13);
     }else{
      r=x14;
      FRPRD(x13,1);}}}}}
 return r;}

extern OBJ _AKnowledge_6(OBJ x1,OBJ x2) /* isLocalOrConstr? */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x3;
  x3=_AMap_33(__ARep_27,x2,x1);
  if(ISPRM(x3)){
   r=__ABUILTIN_3;
  }else{
   {OBJ x17=FLD1(x3,1);
    if(EXPRD(x3,1)){
     DSPRDF(x3);
    }else{
     CPPRD(x17,1);
     FRPRD(x3,1);}
    {OBJ x18=FLD1(x17,1);
     if(EXPRD(x17,1)){
      FREE(FLD1(x17,3),1);DSPRDF(x17);
     }else{
      FRPRD(x17,1);}
     if(ISTGPRM(x18,1)){
      r=__ABUILTIN_3;
     }else{
      r=__ABUILTIN_5;}}}}}
 return r;}

extern OBJ _AKnowledge_7(OBJ x1,OBJ x2) /* isGlobal? */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x3;
  x3=_AMap_20(__ARep_27,x1,x2);
  if(ISTGPRM(x3,1)){
   r=__ABUILTIN_3;
  }else{
   r=__ABUILTIN_5;}}
 return r;}

extern OBJ _AKnowledge_8(OBJ x1,OBJ x2) /* canBeLocal? */
{OBJ r;
 CPCLS(__ARep_27,1);
 r=_AMap_20(__ARep_27,x1,x2);
 return r;}

extern OBJ _AKnowledge_9(OBJ x1,OBJ x2) /* canBeGlobal? */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x3;
  x3=_AMap_33(__ARep_27,x2,x1);
  if(ISPRM(x3)){
   r=__ABUILTIN_5;
  }else{
   {OBJ x17=FLD1(x3,1);
    if(EXPRD(x3,1)){
     DSPRDF(x3);
    }else{
     CPPRD(x17,1);
     FRPRD(x3,1);}
    {OBJ x18=FLD1(x17,1);
     if(EXPRD(x17,1)){
      FREE(FLD1(x17,3),1);DSPRDF(x17);
     }else{
      FRPRD(x17,1);}
     if(ISTGPRM(x18,1)){
      r=__ABUILTIN_3;
     }else{
      r=__ABUILTIN_5;}}}}}
 return r;}

extern OBJ _AKnowledge_10(OBJ x1,OBJ x2) /* no */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x3;
  x3=_AMap_16(__ARep_27,x2,x1);
  {OBJ x5=FLD1(x3,2);
   if(EXPRD(x3,1)){
    r=x5;
    FREE(FLD1(x3,3),1);DSPRDF(x3);
   }else{
    r=x5;
    FRPRD(x3,1);}}}
 return r;}

extern OBJ _AKnowledge_11(OBJ x1) /* locals */
{OBJ r;
 CPCLS(__APair_5,1);
 CPCLS(__ARep_27,1);
 {OBJ x2;
  x2=_AMapConv_4(__ARep_27,x1);
  r=_ASeqMap_3(__APair_5,x2);}
 return r;}

extern OBJ _AKnowledge_12(OBJ x1,OBJ x2,OBJ x3) /* setFcts */
{OBJ r;
 CPCLS(__ARep_27,1);
 CPPRD(x1,1);
 COPY(x3,1);
 {OBJ x4;
  x4=_AMap_16(__ARep_27,x3,x1);
  {OBJ x14;OBJ x15;FLAG x_x4=EXPRD(x4,1);
   if(x_x4){
   }else{
    x14=FLD1(x4,1);x15=FLD1(x4,2);}
   CPCLS(__ARep_27,1);
   {OBJ x17;
    if(x_x4){
     RSOME(x4,x17);FREE(FLD1(x17,3),1);FLD1(x17,3)=x2;
    }else{
     FRPRD(x4,1);PRD1(3,x17);FLD1(x17,1)=x14;FLD1(x17,2)=x15;FLD1(x17,3)=x2;}
    r=_AMap_31(__ARep_27,x1,x17,x3);}}}
 return r;}

extern OBJ _AKnowledge_13(OBJ x1,OBJ x2) /* knownFcts */
{OBJ r;
 CPCLS(__ARep_27,1);
 {OBJ x3;
  x3=_AMap_16(__ARep_27,x2,x1);
  {OBJ x6=FLD1(x3,3);
   if(EXPRD(x3,1)){
    r=x6;
    DSPRDF(x3);
   }else{
    COPY(x6,1);
    r=x6;
    FRPRD(x3,1);}}}
 return r;}

extern OBJ _AKnowledge_14(OBJ x1) /* knowl */
{OBJ r;
 r=x1;
 return r;}

extern OBJ _AKnowledge_15(OBJ x1) /* knowl? */
{OBJ r;
 FREE(x1,1);
 r=__ABUILTIN_5;
 return r;}

extern OBJ _AKnowledge_16(OBJ x1) /* map */
{OBJ r;
 r=x1;
 return r;}


init_AKnowledge()
{
 static int visited=0; if(visited) return; visited=1;
 init_ANat();
 init_APair();
 init_ASeq();
 init_ARep();
 init_AFct();
 init_AName();
 init_AObjects();
 init_AOption();
 init_AOcPos();
 init_AChar();
 init_ASeqReduce();
 init_ASeqMap();
 init_ATriple();
 init_AMap();
 init_AMapConv();
 init_AString();
 init_ASet();
 init_AArray();
 init_ALexem();
 init_ASetByBST();
 init_ABSTree();
 init_ATree();
 init_ASeqConv();
 CLS(1,_AKnowledge_16,__AKnowledge_16);
 CLS(1,_AKnowledge_15,__AKnowledge_15);
 CLS(1,_AKnowledge_14,__AKnowledge_14);
 CLS(2,_AKnowledge_13,__AKnowledge_13);
 CLS(3,_AKnowledge_12,__AKnowledge_12);
 CLS(1,_AKnowledge_11,__AKnowledge_11);
 CLS(2,_AKnowledge_10,__AKnowledge_10);
 CLS(2,_AKnowledge_9,__AKnowledge_9);
 CLS(2,_AKnowledge_8,__AKnowledge_8);
 CLS(2,_AKnowledge_7,__AKnowledge_7);
 CLS(2,_AKnowledge_6,__AKnowledge_6);
 CLS(2,_AKnowledge_5,__AKnowledge_5);
 CLS(3,_AKnowledge_4,__AKnowledge_4);
 CLS(3,_AKnowledge_3,__AKnowledge_3);
 __AKnowledge_2=__ATree_7;}

