

#include "BUILTIN.h"
extern OBJ __AOcError_12;
extern OBJ __AOcError_15;
extern OBJ _AOcError_19(OBJ,OBJ,OBJ,OBJ,OBJ);extern OBJ __AOcError_19;
extern OBJ _AOcError_21(OBJ,OBJ);extern OBJ __AOcError_21;
extern OBJ _AOcError_22(OBJ);extern OBJ __AOcError_22;
extern OBJ _APartName_31(OBJ);extern OBJ __APartName_31;
extern OBJ _AImpl_202(OBJ,OBJ);extern OBJ __AImpl_202;
extern OBJ _ARep_119(OBJ);extern OBJ __ARep_119;
extern TUP2 _AAnalyzedGlobSig_58(OBJ,OBJ);extern OBJ __AAnalyzedGlobSig_58;
extern TUP2 _AAnalyzedGlobSig_59(OBJ,OBJ,OBJ,OBJ);extern OBJ __AAnalyzedGlobSig_59;

#include "Array.h"
extern OBJ __AKnowledge_2;
extern TUP2 _ACandidates_23(OBJ,OBJ,OBJ);extern OBJ __ACandidates_23;
extern TUP4 _ATypeIndepFormAnalysis_1(OBJ);extern OBJ __ATypeIndepFormAnalysis_1;
extern TUP3 _ATypeDepFormAnalysis_1(OBJ,OBJ,OBJ,OBJ,OBJ);extern OBJ __ATypeDepFormAnalysis_1;
extern TUP4 _ATypeDepFormAnalysis_2(OBJ,OBJ,OBJ,OBJ);extern OBJ __ATypeDepFormAnalysis_2;

#include "Nat.h"
extern OBJ _AOcPos_34(OBJ);extern OBJ __AOcPos_34;

#include "Denotation.h"

#include "Char.h"

#include "Int.h"

#include "Bitset.h"
extern OBJ _ALawAnalysis_1(OBJ);OBJ __ALawAnalysis_1; /* target */
extern TUP2 _ALawAnalysis_2(OBJ,OBJ);OBJ __ALawAnalysis_2; /* analyzeLaw */
extern TUP3 _ALawAnalysis_5(OBJ);OBJ __ALawAnalysis_5; /* typeIndepAna */
extern OBJ _ALawAnalysis_6(OBJ,OBJ);OBJ __ALawAnalysis_6; /* typeDepAna */
extern TUP4 _ALawAnalysis_7(OBJ,OBJ,OBJ,OBJ);OBJ __ALawAnalysis_7; /* substitute */
extern TUP2 _ALawAnalysis_8(OBJ,OBJ,OBJ,OBJ);OBJ __ALawAnalysis_8; /* include */
OBJ __ALawAnalysis_9; /* duplicateLaw */

extern OBJ _ALawAnalysis_1(OBJ x1) /* target */
{OBJ r;
 {OBJ x13=FLD1(x1,1);
  if(EXPRD(x1,1)){
   r=x13;
   FLD1(x1,1)=NIL;DSPRD(x1);
  }else{
   CPPRD(x13,1);
   r=x13;
   FRPRD(x1,1);}}
 return r;}

extern TUP2 _ALawAnalysis_2(OBJ x1,OBJ x2) /* analyzeLaw */
{TUP2 r;
 CPCLS(__APartName_31,1);
 {OBJ x3;TUP3 x5;OBJ x8;
  x3=_AImpl_202(__APartName_31,x1);
  CPPRD(x3,1);
  x5=_ALawAnalysis_5(x3);
  CPPRD(x5.c3,1);
  x8=_AOcError_22(x5.c3);
  if(ISTGPRM(x8,1)){
   COPY(x2,1);
   CPPRD(x5.c1,1);
   {OBJ x55;
    x55=_ALawAnalysis_6(x5.c1,x2);
    if(ISTGPRD(x55,2)){
     {OBJ x56=FLD(x55,1);
      if(EXPRD(x55,1)){
       DSPRDF(x55);
      }else{
       CPPRD(x56,1);
       FRPRD(x55,1);}
      FRPRD(x3,1);
      FRPRD(x5.c1,1);
      FRPRD(x5.c2,1);
      r.c2=_AOcError_21(x5.c3,x56);
      r.c1=x2;}
    }else{
     {TUP4 x59;OBJ x63;OBJ x64;
      x59=_ALawAnalysis_7(x5.c1,x55,x2,x5.c2);
      CPPRD(x59.c4,1);
      x63=_AOcError_22(x59.c4);
      x64=_AOcError_21(x5.c3,x59.c4);
      if(ISTGPRM(x63,1)){
       {OBJ x65=FLD1(x3,1);
	if(EXPRD(x3,1)){
	 FLD1(x3,1)=NIL;DSPRD(x3);
	}else{
	 CPPRD(x65,1);
	 FRPRD(x3,1);}
	{TUP2 x70;
	 x70=_ALawAnalysis_8(x59.c2,x65,x59.c1,x59.c3);r.c1=x70.c1;
	 r.c2=_AOcError_21(x64,x70.c2);}}
      }else{
       r.c1=x59.c2;r.c2=x64;
       FRPRD(x3,1);
       FRPRD(x59.c1,1);
       FRPRD(x59.c3,1);}}}}
  }else{
   r.c2=x5.c3;
   FRPRD(x3,1);
   FRPRD(x5.c1,1);
   FRPRD(x5.c2,1);
   r.c1=x2;}}
 return r;}
extern OBJ _ALawAnalysis_2_c(OBJ x1,OBJ x2) /* analyzeLaw */
{OBJ r;
 {TUP2 t=_ALawAnalysis_2(x1,x2);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

extern TUP3 _ALawAnalysis_5(OBJ x1) /* typeIndepAna */
{TUP3 r;
 {OBJ x20;OBJ x21=FLD1(x1,2);OBJ x22;
  if(EXPRD(x1,1)){
   {TUP4 x24;
    x24=_ATypeIndepFormAnalysis_1(x21);r.c2=x24.c3;r.c3=x24.c4;
    FRPRD(x24.c2,1);
    RSOME(x1,r.c1);FLD1(r.c1,2)=x24.c1;}
  }else{
   x20=FLD1(x1,1);x22=FLD1(x1,3);CPPRD(x20,1);CPPRD(x21,1);COPY(x22,1);
   {TUP4 x24;
    x24=_ATypeIndepFormAnalysis_1(x21);r.c2=x24.c3;r.c3=x24.c4;
    FRPRD(x24.c2,1);
    FRPRD(x1,1);PRD1(3,r.c1);FLD1(r.c1,1)=x20;FLD1(r.c1,2)=x24.c1;FLD1(r.c1,3)=x22;}}}
 return r;}
extern OBJ _ALawAnalysis_5_c(OBJ x1) /* typeIndepAna */
{OBJ r;
 {TUP3 t=_ALawAnalysis_5(x1);
  PRD1(3,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;
  FLD1(r,3)=t.c3;}
 return r;}

extern OBJ _ALawAnalysis_6(OBJ x1,OBJ x2) /* typeDepAna */
{OBJ r;
 {OBJ x23=FLD1(x1,2);
  if(EXPRD(x1,1)){
   FLD1(x1,2)=NIL;DSPRD(x1);
  }else{
   CPPRD(x23,1);
   FRPRD(x1,1);}
  COPY(x2,1);
  COPY(__AKnowledge_2,1);
  {TUP3 x26;TUP2 x31;
   x26=_ATypeDepFormAnalysis_1(x23,x2,__AKnowledge_2,__ANat_5,__ANat_5);
   x31=_ACandidates_23(x2,x26.c3,x26.c1);r=x31.c1;}}
 return r;}

extern TUP4 _ALawAnalysis_7(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* substitute */
{TUP4 r;
 FRPRD(x4,1);
 {OBJ x23;OBJ x24=FLD1(x1,2);OBJ x25;
  if(EXPRD(x1,1)){
   {
    RSOME(x1,r.c1);
    {TUP4 t=_ATypeDepFormAnalysis_2(x24,x2,x3,__ANat_5);
     FLD1(r.c1,2)=t.c1;
     r.c2=t.c2;
     r.c3=t.c3;
     r.c4=t.c4;}}
  }else{
   x23=FLD1(x1,1);x25=FLD1(x1,3);CPPRD(x23,1);CPPRD(x24,1);COPY(x25,1);
   {
    FRPRD(x1,1);PRD1(3,r.c1);FLD1(r.c1,1)=x23;FLD1(r.c1,3)=x25;
    {TUP4 t=_ATypeDepFormAnalysis_2(x24,x2,x3,__ANat_5);
     FLD1(r.c1,2)=t.c1;
     r.c2=t.c2;
     r.c3=t.c3;
     r.c4=t.c4;}}}}
 return r;}
extern OBJ _ALawAnalysis_7_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* substitute */
{OBJ r;
 {TUP4 t=_ALawAnalysis_7(x1,x2,x3,x4);
  PRD1(4,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;
  FLD1(r,3)=t.c3;
  FLD1(r,4)=t.c4;}
 return r;}

extern TUP2 _ALawAnalysis_8(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* include */
{TUP2 r;
 {OBJ x32=FLD1(x3,3);
  COPY(x32,1);
  COPY(x1,1);
  CPPRD(x2,1);
  {TUP2 x33;
   x33=_AAnalyzedGlobSig_59(x1,x2,x3,x4);
   if(ISTGPRM(x33.c2,1)){
    r.c1=x33.c1;
    FREE(x1,1);
    FRPRD(x2,1);
    FREE(x32,1);
    CPPRD(__AOcError_15,1);
    r.c2=__AOcError_15;
   }else{
    CPPRD(x2,1);
    {OBJ x35;TUP2 x37;
     x35=_ARep_119(x2);
     x37=_AAnalyzedGlobSig_58(x1,x2);
     FRPRD(x37.c2,1);
     {OBJ x41=FLD1(x37.c1,3);
      if(EXPRD(x37.c1,1)){
       r.c1=x33.c1;
       FLD1(x37.c1,3)=NIL;DSPRD(x37.c1);
      }else{
       COPY(x41,1);
       r.c1=x33.c1;
       FRPRD(x37.c1,1);}
      CPPRD(__ALawAnalysis_9,1);
      {OBJ x42;
       x42=_AOcPos_34(x41);
       r.c2=_AOcError_19(__AOcError_12,__ALawAnalysis_9,x35,x42,x32);}}}}}}
 return r;}
extern OBJ _ALawAnalysis_8_c(OBJ x1,OBJ x2,OBJ x3,OBJ x4) /* include */
{OBJ r;
 {TUP2 t=_ALawAnalysis_8(x1,x2,x3,x4);
  PRD1(2,r);
  FLD1(r,1)=t.c1;
  FLD1(r,2)=t.c2;}
 return r;}

init_ALawAnalysis()
{
 static int visited=0; if(visited) return; visited=1;
 init_ASeqReduce();
 init_AUniqueTable();
 init_ADeclEntry();
 init_APartNameEntry();
 init_AImpExpEntry();
 init_AOcError();
 init_APragma();
 init_APartName();
 init_AAttributes();
 init_AImpl();
 init_ADArray();
 init_ARep();
 init_ANatMap();
 init_AAnalyzedGlobSig();
 init_AArray();
 init_AGlobSig();
 init_AKnowledge();
 init_AGlobPragma();
 init_ARepSet();
 init_AName();
 init_ACandidates();
 init_AGlobSigImpl();
 init_ATypeIndepFormAnalysis();
 init_AObjects();
 init_ATypeDepFormAnalysis();
 init_APatterns();
 init_AReason();
 init_APair();
 init_ASubstitution();
 init_AMap();
 init_APrioTab();
 init_ANat();
 init_ATriple();
 init_AFct();
 init_ASetByBST();
 init_AOption();
 init_ABSTree();
 init_AOcPos();
 init_ATree();
 init_ASeq();
 init_ASeqConv();
 init_ACom();
 init_ADenotation();
 init_AVoid();
 init_ALexem();
 init_AChar();
 init_AAbsyFun3();
 init_AString();
 init_AAnalyzedGlobSigH();
 init_AOcOptions();
 init_AGlobSigToText();
 init_AStream();
 init_AImpDecl4SigAna();
 init_AFile();
 init_AMySeqFun1();
 init_AInt();
 init_AName4SigAna();
 init_ASet();
 init_AUnion2();
 init_ABitset();
 init_APartialSignatures();
 init_ATable();
 DEN("duplicate law %s: already defined at %s",__ALawAnalysis_9);
 CLS(4,_ALawAnalysis_8_c,__ALawAnalysis_8);
 CLS(4,_ALawAnalysis_7_c,__ALawAnalysis_7);
 CLS(2,_ALawAnalysis_6,__ALawAnalysis_6);
 CLS(1,_ALawAnalysis_5_c,__ALawAnalysis_5);
 CLS(2,_ALawAnalysis_2_c,__ALawAnalysis_2);
 CLS(1,_ALawAnalysis_1,__ALawAnalysis_1);}

