/*===========================================================================*/
/*   (Type/coercion.scm)                                                     */
/*   Bigloo (2.6b)                                                           */
/*   Inria -- Sophia Antipolis (c)       Mon Dec 15 12:14:36 CET 2003        */
/*===========================================================================*/
/* COMPILATION: (/users/serrano/prgm/project/bigloo/bin/bigloo -q -afile .afile -fsharing -fno-reflection -cc gcc-2.95 -lib-dir /users/serrano/prgm/project/bigloo/lib/2.6b -unsafev -no-hello -O2 -rm -unsafe -s -indent Type/coercion.scm)*/
/* GC selection */
#define THE_GC BOEHM_GC

#include <bigloo.h>


/* Object type definitions */
typedef struct BgL_typez00_bgl {
   header_t header;
   obj_t widening;
   obj_t BgL_idz00;
   obj_t BgL_namez00;
   obj_t BgL_siza7eza7;
   obj_t BgL_classz00;
   obj_t BgL_coercezd2tozd2;
   obj_t BgL_parentsz00;
   bool_t BgL_initzf3zf3;
   bool_t BgL_magiczf3zf3;
   obj_t BgL_z42z42;
   obj_t BgL_aliasz00;
   obj_t BgL_pointedzd2tozd2byz00;
   obj_t BgL_tvectorz00;
   obj_t BgL_locationz00;
   obj_t BgL_importzd2locationzd2;
} *BgL_typez00_bglt;


BGL_EXPORTED_DECL obj_t BGl_modulezd2initializa7ationz75zztype_coercionz00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zztools_tracez00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zztools_errorz00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zztools_shapez00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zztype_typez00(long, char *);
extern obj_t BGl_modulezd2initializa7ationz75zzengine_paramz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__errorz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__readerz00(long, char *);
BGL_IMPORT obj_t BGl_modulezd2initializa7ationz75zz__r4_pairs_and_lists_6_3z00(long, char *);
static obj_t BGl_methodzd2initzd2zztype_coercionz00();
extern obj_t BGl_userzd2errorzd2zztools_errorz00(obj_t, obj_t, obj_t, obj_t);
BGL_IMPORT obj_t open_input_string(obj_t);
BGL_EXPORTED_DECL obj_t BGl_addzd2coercionz12zc0zztype_coercionz00(BgL_typez00_bglt, BgL_typez00_bglt, obj_t, obj_t);
static obj_t BGl__findzd2coercer1383zd2zztype_coercionz00(obj_t, obj_t, obj_t);
BGL_IMPORT obj_t BGl_readz00zz__readerz00(obj_t);
extern obj_t BGl_shapez00zztools_shapez00(obj_t);
BGL_EXPORTED_DECL bool_t BGl_coercerzd2existszf3z21zztype_coercionz00(BgL_typez00_bglt, BgL_typez00_bglt);
extern obj_t BGl_za2libzd2modeza2zd2zzengine_paramz00;
BGL_IMPORT obj_t create_struct(obj_t, int);
extern BgL_typez00_bglt BGl_getzd2aliasedzd2typez00zztype_typez00(BgL_typez00_bglt);
static obj_t BGl_cnstzd2initzd2zztype_coercionz00();
BGL_IMPORT obj_t bgl_append2(obj_t, obj_t);
BGL_EXPORTED_DECL obj_t BGl_findzd2coercerzd2zztype_coercionz00(BgL_typez00_bglt, BgL_typez00_bglt);
static obj_t BGl_importedzd2moduleszd2initz00zztype_coercionz00();
BGL_IMPORT obj_t BGl_warningz00zz__errorz00(obj_t);
static obj_t BGl_requirezd2initializa7ationz75zztype_coercionz00 = BUNSPEC;
static obj_t BGl_libraryzd2moduleszd2initz00zztype_coercionz00();
static obj_t BGl__addzd2coercionz121385zc0zztype_coercionz00(obj_t, obj_t, obj_t, obj_t, obj_t);
static obj_t BGl_toplevelzd2initzd2zztype_coercionz00();
static obj_t BGl__coercerzd2existszf31387z21zztype_coercionz00(obj_t, obj_t, obj_t);
static obj_t __cnst[ 2 ] ;


DEFINE_EXPORT_PROCEDURE( BGl_addzd2coercionz12zd2envz12zztype_coercionz00, BgL_bgl__addza7d2coercionza7121385za7c0za7za7type_coercionza7001467z00, BGl__addzd2coercionz121385zc0zztype_coercionz00, 0L, 4 );
DEFINE_STRING( BGl_string1440z00zztype_coercionz00, BgL_bgl_string1440za700za7za7type_coercionza7001468z00, "coercer (()) ", 13 );
DEFINE_STRING( BGl_string1439z00zztype_coercionz00, BgL_bgl_string1439za700za7za7type_coercionza7001469z00, "Can't find coercion", 19 );
DEFINE_STRING( BGl_string1438z00zztype_coercionz00, BgL_bgl_string1438za700za7za7type_coercionza7001470z00, "add-coercion!", 13 );
DEFINE_STRING( BGl_string1437z00zztype_coercionz00, BgL_bgl_string1437za700za7za7type_coercionza7001471z00, "Type coercion redefinition -- ", 30 );
DEFINE_EXPORT_PROCEDURE( BGl_coercerzd2existszf3zd2envzf3zztype_coercionz00, BgL_bgl__coercerza7d2existsza7f31387za721za7za7type_coercionza7001472z00, BGl__coercerzd2existszf31387z21zztype_coercionz00, 0L, 2 );
DEFINE_EXPORT_PROCEDURE( BGl_findzd2coercerzd2envz00zztype_coercionz00, BgL_bgl__findza7d2coercer1383za7d2za7za7type_coercionza7001473za7, BGl__findzd2coercer1383zd2zztype_coercionz00, 0L, 2 );



/* module-initialization */
BGL_EXPORTED_DEF obj_t BGl_modulezd2initializa7ationz75zztype_coercionz00(long BgL_checksumz00_387, char * BgL_fromz00_388)
{ AN_OBJECT;
{ 
if(
CBOOL(BGl_requirezd2initializa7ationz75zztype_coercionz00))
{ 
BGl_requirezd2initializa7ationz75zztype_coercionz00 = 
BBOOL(((bool_t)0)); 
BGl_libraryzd2moduleszd2initz00zztype_coercionz00(); 
BGl_cnstzd2initzd2zztype_coercionz00(); 
BGl_importedzd2moduleszd2initz00zztype_coercionz00(); 
return BUNSPEC;}  else 
{ 
return BUNSPEC;} } 
}



/* library-modules-init */
obj_t BGl_libraryzd2moduleszd2initz00zztype_coercionz00()
{ AN_OBJECT;
{ /* ./Type/coercion.scm 15 */
BGl_modulezd2initializa7ationz75zz__readerz00(((long)0), "type_coercion"); 
BGl_modulezd2initializa7ationz75zz__r4_pairs_and_lists_6_3z00(((long)0), "type_coercion"); 
BGl_modulezd2initializa7ationz75zz__errorz00(((long)0), "type_coercion"); 
return BUNSPEC;} 
}



/* cnst-init */
obj_t BGl_cnstzd2initzd2zztype_coercionz00()
{ AN_OBJECT;
{ /* ./Type/coercion.scm 15 */
{ /* ./Type/coercion.scm 15 */
obj_t BgL_cportz00_380;
BgL_cportz00_380 = 
open_input_string(BGl_string1440z00zztype_coercionz00); 
{ 
long BgL_iz00_381;
BgL_iz00_381 = ((long)1); 
BgL_loopz00_382:
{ /* ./Type/coercion.scm 15 */
bool_t BgL_test1442z00_383;
BgL_test1442z00_383 = 
(BgL_iz00_381==((long)-1)); 
if(BgL_test1442z00_383)
{ /* ./Type/coercion.scm 15 */
return BUNSPEC;}  else 
{ /* ./Type/coercion.scm 15 */
{ /* ./Type/coercion.scm 15 */
obj_t BgL_arg1444z00_384;
{ /* ./Type/coercion.scm 15 */
obj_t BgL_list1447z00_385;
BgL_list1447z00_385 = 
MAKE_PAIR(BgL_cportz00_380, BNIL); 
BgL_arg1444z00_384 = 
BGl_readz00zz__readerz00(BgL_list1447z00_385); } 
{ /* ./Type/coercion.scm 15 */
int BgL_auxz00_403;
BgL_auxz00_403 = 
(int)(BgL_iz00_381); 
CNST_TABLE_SET(BgL_auxz00_403, BgL_arg1444z00_384); } } 
{ /* ./Type/coercion.scm 15 */
int BgL_auxz00_386;
{ /* ./Type/coercion.scm 15 */
long BgL_auxz00_406;
BgL_auxz00_406 = 
(BgL_iz00_381-((long)1)); 
BgL_auxz00_386 = 
(int)(BgL_auxz00_406); } 
{ 
long BgL_iz00_409;
BgL_iz00_409 = 
(long)(BgL_auxz00_386); 
BgL_iz00_381 = BgL_iz00_409; 
goto BgL_loopz00_382;} } } } } } } 
}



/* toplevel-init */
obj_t BGl_toplevelzd2initzd2zztype_coercionz00()
{ AN_OBJECT;
{ /* ./Type/coercion.scm 15 */
return BUNSPEC;} 
}



/* find-coercer */
BGL_EXPORTED_DEF obj_t BGl_findzd2coercerzd2zztype_coercionz00(BgL_typez00_bglt BgL_fromz00_19, BgL_typez00_bglt BgL_toz00_20)
{ AN_OBJECT;
{ /* ./Type/coercion.scm 31 */
{ /* ./Type/coercion.scm 32 */
BgL_typez00_bglt BgL_fromz00_95;BgL_typez00_bglt BgL_toz00_96;
BgL_fromz00_95 = 
BGl_getzd2aliasedzd2typez00zztype_typez00(BgL_fromz00_19); 
BgL_toz00_96 = 
BGl_getzd2aliasedzd2typez00zztype_typez00(BgL_toz00_20); 
{ 
obj_t BgL_coercerz00_97;
BgL_coercerz00_97 = 
(((BgL_typez00_bglt)CREF(BgL_fromz00_95))->BgL_coercezd2tozd2); 
BgL_loopz00_98:
if(
NULLP(BgL_coercerz00_97))
{ /* ./Type/coercion.scm 36 */
return BFALSE;}  else 
{ /* ./Type/coercion.scm 38 */
bool_t BgL_testz00_415;
{ /* ./Type/coercion.scm 38 */
obj_t BgL_auxz00_422;obj_t BgL_auxz00_416;
BgL_auxz00_422 = 
(obj_t)(BgL_toz00_96); 
{ /* ./Type/coercion.scm 38 */
int BgL_auxz00_419;obj_t BgL_auxz00_417;
BgL_auxz00_419 = 
(int)(((long)1)); 
BgL_auxz00_417 = 
CAR(BgL_coercerz00_97); 
BgL_auxz00_416 = 
STRUCT_REF(BgL_auxz00_417, BgL_auxz00_419); } 
BgL_testz00_415 = 
(BgL_auxz00_416==BgL_auxz00_422); } 
if(BgL_testz00_415)
{ /* ./Type/coercion.scm 38 */
return 
CAR(BgL_coercerz00_97);}  else 
{ /* ./Type/coercion.scm 38 */
{ 
obj_t BgL_coercerz00_426;
BgL_coercerz00_426 = 
CDR(BgL_coercerz00_97); 
BgL_coercerz00_97 = BgL_coercerz00_426; 
goto BgL_loopz00_98;} } } } } } 
}



/* _find-coercer1383 */
obj_t BGl__findzd2coercer1383zd2zztype_coercionz00(obj_t BgL_envz00_368, obj_t BgL_fromz00_369, obj_t BgL_toz00_370)
{ AN_OBJECT;
{ /* ./Type/coercion.scm 31 */
return 
BGl_findzd2coercerzd2zztype_coercionz00(
(BgL_typez00_bglt)(BgL_fromz00_369), 
(BgL_typez00_bglt)(BgL_toz00_370));} 
}



/* add-coercion! */
BGL_EXPORTED_DEF obj_t BGl_addzd2coercionz12zc0zztype_coercionz00(BgL_typez00_bglt BgL_fromz00_21, BgL_typez00_bglt BgL_toz00_22, obj_t BgL_checkz00_23, obj_t BgL_coercez00_24)
{ AN_OBJECT;
{ /* ./Type/coercion.scm 77 */
{ /* ./Type/coercion.scm 81 */
bool_t BgL_test1153z00_105;
{ /* ./Type/coercion.scm 81 */
obj_t BgL_objz00_273;
BgL_objz00_273 = BgL_checkz00_23; 
BgL_test1153z00_105 = 
NULLP(BgL_objz00_273); } 
if(BgL_test1153z00_105)
{ /* ./Type/coercion.scm 81 */
BgL_checkz00_23 = 
CNST_TABLE_REF(((long)0)); }  else 
{ /* ./Type/coercion.scm 81 */BFALSE; } } 
{ /* ./Type/coercion.scm 82 */
bool_t BgL_test1155z00_106;
{ /* ./Type/coercion.scm 82 */
obj_t BgL_objz00_274;
BgL_objz00_274 = BgL_coercez00_24; 
BgL_test1155z00_106 = 
NULLP(BgL_objz00_274); } 
if(BgL_test1155z00_106)
{ /* ./Type/coercion.scm 82 */
BgL_coercez00_24 = 
CNST_TABLE_REF(((long)0)); }  else 
{ /* ./Type/coercion.scm 82 */BFALSE; } } 
{ /* ./Type/coercion.scm 83 */
BgL_typez00_bglt BgL_fromz00_107;BgL_typez00_bglt BgL_toz00_108;
BgL_fromz00_107 = 
BGl_getzd2aliasedzd2typez00zztype_typez00(BgL_fromz00_21); 
BgL_toz00_108 = 
BGl_getzd2aliasedzd2typez00zztype_typez00(BgL_toz00_22); 
{ /* ./Type/coercion.scm 85 */
bool_t BgL_test1157z00_109;
{ /* ./Type/coercion.scm 85 */
obj_t BgL_arg1287z00_166;
BgL_arg1287z00_166 = 
BGl_findzd2coercerzd2zztype_coercionz00(BgL_fromz00_107, BgL_toz00_108); 
if(
STRUCTP(BgL_arg1287z00_166))
{ /* ./Type/coercion.scm 85 */
obj_t BgL_auxz00_445;obj_t BgL_auxz00_443;
BgL_auxz00_445 = 
CNST_TABLE_REF(((long)1)); 
BgL_auxz00_443 = 
STRUCT_KEY(BgL_arg1287z00_166); 
BgL_test1157z00_109 = 
(BgL_auxz00_443==BgL_auxz00_445); }  else 
{ /* ./Type/coercion.scm 85 */
BgL_test1157z00_109 = ((bool_t)0); } } 
if(BgL_test1157z00_109)
{ /* ./Type/coercion.scm 85 */
if(
CBOOL(BGl_za2libzd2modeza2zd2zzengine_paramz00))
{ /* ./Type/coercion.scm 86 */
return BFALSE;}  else 
{ /* ./Type/coercion.scm 87 */
obj_t BgL_arg1163z00_112;
{ /* ./Type/coercion.scm 89 */
obj_t BgL_arg1177z00_116;
{ /* ./Type/coercion.scm 89 */
obj_t BgL_list1180z00_117;
{ /* ./Type/coercion.scm 89 */
obj_t BgL_arg1182z00_118;
{ /* ./Type/coercion.scm 89 */
obj_t BgL_arg1187z00_119;
{ /* ./Type/coercion.scm 89 */
obj_t BgL_arg1191z00_120;
BgL_arg1191z00_120 = 
MAKE_PAIR(BgL_coercez00_24, BNIL); 
BgL_arg1187z00_119 = 
MAKE_PAIR(BgL_checkz00_23, BgL_arg1191z00_120); } 
{ /* ./Type/coercion.scm 89 */
obj_t BgL_auxz00_453;
BgL_auxz00_453 = 
(obj_t)(BgL_toz00_108); 
BgL_arg1182z00_118 = 
MAKE_PAIR(BgL_auxz00_453, BgL_arg1187z00_119); } } 
{ /* ./Type/coercion.scm 89 */
obj_t BgL_auxz00_456;
BgL_auxz00_456 = 
(obj_t)(BgL_fromz00_107); 
BgL_list1180z00_117 = 
MAKE_PAIR(BgL_auxz00_456, BgL_arg1182z00_118); } } 
BgL_arg1177z00_116 = BgL_list1180z00_117; } 
BgL_arg1163z00_112 = 
BGl_shapez00zztools_shapez00(BgL_arg1177z00_116); } 
{ /* ./Type/coercion.scm 87 */
obj_t BgL_list1165z00_113;
{ /* ./Type/coercion.scm 87 */
obj_t BgL_arg1169z00_114;
{ /* ./Type/coercion.scm 87 */
obj_t BgL_arg1172z00_115;
BgL_arg1172z00_115 = 
MAKE_PAIR(BgL_arg1163z00_112, BNIL); 
BgL_arg1169z00_114 = 
MAKE_PAIR(BGl_string1437z00zztype_coercionz00, BgL_arg1172z00_115); } 
BgL_list1165z00_113 = 
MAKE_PAIR(BGl_string1438z00zztype_coercionz00, BgL_arg1169z00_114); } 
return 
BGl_warningz00zz__errorz00(BgL_list1165z00_113);} } }  else 
{ /* ./Type/coercion.scm 85 */
{ /* ./Type/coercion.scm 92 */
obj_t BgL_newz00_121;
{ /* ./Type/coercion.scm 92 */
obj_t BgL_checkzd2opzd2_286;obj_t BgL_coercezd2opzd2_287;
BgL_checkzd2opzd2_286 = BgL_checkz00_23; 
BgL_coercezd2opzd2_287 = BgL_coercez00_24; 
{ /* ./Type/coercion.scm 92 */
obj_t BgL_newz00_288;
{ /* ./Type/coercion.scm 92 */
int BgL_auxz00_466;obj_t BgL_auxz00_464;
BgL_auxz00_466 = 
(int)(((long)4)); 
BgL_auxz00_464 = 
CNST_TABLE_REF(((long)1)); 
BgL_newz00_288 = 
create_struct(BgL_auxz00_464, BgL_auxz00_466); } 
{ /* ./Type/coercion.scm 92 */
int BgL_kz00_292;
BgL_kz00_292 = 
(int)(((long)3)); 
STRUCT_SET(BgL_newz00_288, BgL_kz00_292, BgL_coercezd2opzd2_287); } 
{ /* ./Type/coercion.scm 92 */
int BgL_kz00_297;
BgL_kz00_297 = 
(int)(((long)2)); 
STRUCT_SET(BgL_newz00_288, BgL_kz00_297, BgL_checkzd2opzd2_286); } 
{ /* ./Type/coercion.scm 92 */
int BgL_kz00_302;obj_t BgL_oz00_303;
BgL_kz00_302 = 
(int)(((long)1)); 
BgL_oz00_303 = 
(obj_t)(BgL_toz00_108); 
STRUCT_SET(BgL_newz00_288, BgL_kz00_302, BgL_oz00_303); } 
{ /* ./Type/coercion.scm 92 */
int BgL_kz00_307;obj_t BgL_oz00_308;
BgL_kz00_307 = 
(int)(((long)0)); 
BgL_oz00_308 = 
(obj_t)(BgL_fromz00_107); 
STRUCT_SET(BgL_newz00_288, BgL_kz00_307, BgL_oz00_308); } 
BgL_newz00_121 = BgL_newz00_288; } } 
{ /* ./Type/coercion.scm 93 */
obj_t BgL_arg1195z00_122;
{ /* ./Type/coercion.scm 93 */
obj_t BgL_arg1198z00_123;
BgL_arg1198z00_123 = 
(((BgL_typez00_bglt)CREF(BgL_fromz00_107))->BgL_coercezd2tozd2); 
BgL_arg1195z00_122 = 
MAKE_PAIR(BgL_newz00_121, BgL_arg1198z00_123); } 
{ /* ./Type/coercion.scm 93 */
BgL_typez00_bglt BgL_obj1015z00_310;obj_t BgL_val1014z00_311;
BgL_obj1015z00_310 = BgL_fromz00_107; 
BgL_val1014z00_311 = BgL_arg1195z00_122; 
((((BgL_typez00_bglt)CREF(BgL_obj1015z00_310))->BgL_coercezd2tozd2) = ((obj_t)BgL_val1014z00_311), BUNSPEC); } } } 
{ 
obj_t BgL_l1089z00_124;
{ /* ./Type/coercion.scm 111 */
obj_t BgL_arg1203z00_126;
BgL_arg1203z00_126 = 
(((BgL_typez00_bglt)CREF(BgL_toz00_108))->BgL_parentsz00); 
BgL_l1089z00_124 = BgL_arg1203z00_126; 
BgL_forzd2each1090zd2_125:
{ /* ./Type/coercion.scm 95 */
bool_t BgL_test1206z00_127;
BgL_test1206z00_127 = 
PAIRP(BgL_l1089z00_124); 
if(BgL_test1206z00_127)
{ /* ./Type/coercion.scm 95 */
{ /* ./Type/coercion.scm 97 */
obj_t BgL_parentz00_128;
BgL_parentz00_128 = 
CAR(BgL_l1089z00_124); 
{ /* ./Type/coercion.scm 97 */
bool_t BgL_test1207z00_129;
{ /* ./Type/coercion.scm 97 */
bool_t BgL_test1227z00_140;
{ /* ./Type/coercion.scm 97 */
obj_t BgL_auxz00_486;
BgL_auxz00_486 = 
(obj_t)(BgL_fromz00_107); 
BgL_test1227z00_140 = 
(BgL_auxz00_486==BgL_parentz00_128); } 
if(BgL_test1227z00_140)
{ /* ./Type/coercion.scm 97 */
BgL_test1207z00_129 = ((bool_t)0); }  else 
{ /* ./Type/coercion.scm 98 */
bool_t BgL_test1228z00_141;
{ /* ./Type/coercion.scm 98 */
obj_t BgL_auxz00_490;
BgL_auxz00_490 = 
(obj_t)(BgL_toz00_108); 
BgL_test1228z00_141 = 
(BgL_auxz00_490==BgL_parentz00_128); } 
if(BgL_test1228z00_141)
{ /* ./Type/coercion.scm 98 */
BgL_test1207z00_129 = ((bool_t)0); }  else 
{ /* ./Type/coercion.scm 99 */
bool_t BgL_test1229z00_142;
{ /* ./Type/coercion.scm 99 */
obj_t BgL_arg1231z00_143;
BgL_arg1231z00_143 = 
BGl_findzd2coercerzd2zztype_coercionz00(BgL_fromz00_107, 
(BgL_typez00_bglt)(BgL_parentz00_128)); 
if(
STRUCTP(BgL_arg1231z00_143))
{ /* ./Type/coercion.scm 99 */
obj_t BgL_auxz00_500;obj_t BgL_auxz00_498;
BgL_auxz00_500 = 
CNST_TABLE_REF(((long)1)); 
BgL_auxz00_498 = 
STRUCT_KEY(BgL_arg1231z00_143); 
BgL_test1229z00_142 = 
(BgL_auxz00_498==BgL_auxz00_500); }  else 
{ /* ./Type/coercion.scm 99 */
BgL_test1229z00_142 = ((bool_t)0); } } 
if(BgL_test1229z00_142)
{ /* ./Type/coercion.scm 99 */
BgL_test1207z00_129 = ((bool_t)0); }  else 
{ /* ./Type/coercion.scm 99 */
BgL_test1207z00_129 = ((bool_t)1); } } } } 
if(BgL_test1207z00_129)
{ /* ./Type/coercion.scm 100 */
obj_t BgL_coercerzd2pzd2_130;
BgL_coercerzd2pzd2_130 = 
BGl_findzd2coercerzd2zztype_coercionz00(BgL_toz00_108, 
(BgL_typez00_bglt)(BgL_parentz00_128)); 
{ /* ./Type/coercion.scm 101 */
bool_t BgL_test1208z00_131;
if(
STRUCTP(BgL_coercerzd2pzd2_130))
{ /* ./Type/coercion.scm 101 */
obj_t BgL_auxz00_511;obj_t BgL_auxz00_509;
BgL_auxz00_511 = 
CNST_TABLE_REF(((long)1)); 
BgL_auxz00_509 = 
STRUCT_KEY(BgL_coercerzd2pzd2_130); 
BgL_test1208z00_131 = 
(BgL_auxz00_509==BgL_auxz00_511); }  else 
{ /* ./Type/coercion.scm 101 */
BgL_test1208z00_131 = ((bool_t)0); } 
if(BgL_test1208z00_131)
{ /* ./Type/coercion.scm 105 */
obj_t BgL_checkzd2pzd2_132;obj_t BgL_coercezd2pzd2_133;
{ /* ./Type/coercion.scm 105 */
int BgL_auxz00_515;
BgL_auxz00_515 = 
(int)(((long)2)); 
BgL_checkzd2pzd2_132 = 
STRUCT_REF(BgL_coercerzd2pzd2_130, BgL_auxz00_515); } 
{ /* ./Type/coercion.scm 106 */
int BgL_auxz00_518;
BgL_auxz00_518 = 
(int)(((long)3)); 
BgL_coercezd2pzd2_133 = 
STRUCT_REF(BgL_coercerzd2pzd2_130, BgL_auxz00_518); } 
{ /* ./Type/coercion.scm 109 */
obj_t BgL_arg1210z00_134;obj_t BgL_arg1211z00_135;
BgL_arg1210z00_134 = 
bgl_append2(BgL_checkz00_23, BgL_checkzd2pzd2_132); 
BgL_arg1211z00_135 = 
bgl_append2(BgL_coercez00_24, BgL_coercezd2pzd2_133); 
BGl_addzd2coercionz12zc0zztype_coercionz00(BgL_fromz00_107, 
(BgL_typez00_bglt)(BgL_parentz00_128), BgL_arg1210z00_134, BgL_arg1211z00_135); } }  else 
{ /* ./Type/coercion.scm 102 */
obj_t BgL_arg1219z00_137;obj_t BgL_arg1220z00_138;
BgL_arg1219z00_137 = 
BGl_shapez00zztools_shapez00(
(obj_t)(BgL_toz00_108)); 
BgL_arg1220z00_138 = 
BGl_shapez00zztools_shapez00(BgL_parentz00_128); 
BGl_userzd2errorzd2zztools_errorz00(BGl_string1439z00zztype_coercionz00, BgL_arg1219z00_137, BgL_arg1220z00_138, BNIL); } } }  else 
{ /* ./Type/coercion.scm 97 */BFALSE; } } } 
{ /* ./Type/coercion.scm 95 */
obj_t BgL_arg1238z00_144;
BgL_arg1238z00_144 = 
CDR(BgL_l1089z00_124); 
{ 
obj_t BgL_l1089z00_530;
BgL_l1089z00_530 = BgL_arg1238z00_144; 
BgL_l1089z00_124 = BgL_l1089z00_530; 
goto BgL_forzd2each1090zd2_125;} } }  else 
{ /* ./Type/coercion.scm 95 */((bool_t)1); } } } } 
{ 
obj_t BgL_l1091z00_145;
{ /* ./Type/coercion.scm 129 */
obj_t BgL_arg1243z00_147;
BgL_arg1243z00_147 = 
(((BgL_typez00_bglt)CREF(BgL_fromz00_107))->BgL_parentsz00); 
{ /* ./Type/coercion.scm 113 */
bool_t BgL_auxz00_532;
BgL_l1091z00_145 = BgL_arg1243z00_147; 
BgL_forzd2each1092zd2_146:
{ /* ./Type/coercion.scm 113 */
bool_t BgL_test1246z00_148;
BgL_test1246z00_148 = 
PAIRP(BgL_l1091z00_145); 
if(BgL_test1246z00_148)
{ /* ./Type/coercion.scm 113 */
{ /* ./Type/coercion.scm 115 */
obj_t BgL_parentz00_149;
BgL_parentz00_149 = 
CAR(BgL_l1091z00_145); 
{ /* ./Type/coercion.scm 115 */
bool_t BgL_test1247z00_150;
{ /* ./Type/coercion.scm 115 */
bool_t BgL_test1267z00_161;
{ /* ./Type/coercion.scm 115 */
obj_t BgL_auxz00_536;
BgL_auxz00_536 = 
(obj_t)(BgL_fromz00_107); 
BgL_test1267z00_161 = 
(BgL_auxz00_536==BgL_parentz00_149); } 
if(BgL_test1267z00_161)
{ /* ./Type/coercion.scm 115 */
BgL_test1247z00_150 = ((bool_t)0); }  else 
{ /* ./Type/coercion.scm 116 */
bool_t BgL_test1268z00_162;
{ /* ./Type/coercion.scm 116 */
obj_t BgL_auxz00_540;
BgL_auxz00_540 = 
(obj_t)(BgL_toz00_108); 
BgL_test1268z00_162 = 
(BgL_auxz00_540==BgL_parentz00_149); } 
if(BgL_test1268z00_162)
{ /* ./Type/coercion.scm 116 */
BgL_test1247z00_150 = ((bool_t)0); }  else 
{ /* ./Type/coercion.scm 117 */
bool_t BgL_test1269z00_163;
{ /* ./Type/coercion.scm 117 */
obj_t BgL_arg1273z00_164;
BgL_arg1273z00_164 = 
BGl_findzd2coercerzd2zztype_coercionz00(
(BgL_typez00_bglt)(BgL_parentz00_149), BgL_toz00_108); 
if(
STRUCTP(BgL_arg1273z00_164))
{ /* ./Type/coercion.scm 117 */
obj_t BgL_auxz00_550;obj_t BgL_auxz00_548;
BgL_auxz00_550 = 
CNST_TABLE_REF(((long)1)); 
BgL_auxz00_548 = 
STRUCT_KEY(BgL_arg1273z00_164); 
BgL_test1269z00_163 = 
(BgL_auxz00_548==BgL_auxz00_550); }  else 
{ /* ./Type/coercion.scm 117 */
BgL_test1269z00_163 = ((bool_t)0); } } 
if(BgL_test1269z00_163)
{ /* ./Type/coercion.scm 117 */
BgL_test1247z00_150 = ((bool_t)0); }  else 
{ /* ./Type/coercion.scm 117 */
BgL_test1247z00_150 = ((bool_t)1); } } } } 
if(BgL_test1247z00_150)
{ /* ./Type/coercion.scm 118 */
obj_t BgL_coercerzd2pzd2_151;
BgL_coercerzd2pzd2_151 = 
BGl_findzd2coercerzd2zztype_coercionz00(
(BgL_typez00_bglt)(BgL_parentz00_149), BgL_fromz00_107); 
{ /* ./Type/coercion.scm 119 */
bool_t BgL_test1248z00_152;
if(
STRUCTP(BgL_coercerzd2pzd2_151))
{ /* ./Type/coercion.scm 119 */
obj_t BgL_auxz00_561;obj_t BgL_auxz00_559;
BgL_auxz00_561 = 
CNST_TABLE_REF(((long)1)); 
BgL_auxz00_559 = 
STRUCT_KEY(BgL_coercerzd2pzd2_151); 
BgL_test1248z00_152 = 
(BgL_auxz00_559==BgL_auxz00_561); }  else 
{ /* ./Type/coercion.scm 119 */
BgL_test1248z00_152 = ((bool_t)0); } 
if(BgL_test1248z00_152)
{ /* ./Type/coercion.scm 123 */
obj_t BgL_checkzd2pzd2_153;obj_t BgL_coercezd2pzd2_154;
{ /* ./Type/coercion.scm 123 */
int BgL_auxz00_565;
BgL_auxz00_565 = 
(int)(((long)2)); 
BgL_checkzd2pzd2_153 = 
STRUCT_REF(BgL_coercerzd2pzd2_151, BgL_auxz00_565); } 
{ /* ./Type/coercion.scm 124 */
int BgL_auxz00_568;
BgL_auxz00_568 = 
(int)(((long)3)); 
BgL_coercezd2pzd2_154 = 
STRUCT_REF(BgL_coercerzd2pzd2_151, BgL_auxz00_568); } 
{ /* ./Type/coercion.scm 127 */
obj_t BgL_arg1250z00_155;obj_t BgL_arg1251z00_156;
BgL_arg1250z00_155 = 
bgl_append2(BgL_checkzd2pzd2_153, BgL_checkz00_23); 
BgL_arg1251z00_156 = 
bgl_append2(BgL_coercezd2pzd2_154, BgL_coercez00_24); 
BGl_addzd2coercionz12zc0zztype_coercionz00(
(BgL_typez00_bglt)(BgL_parentz00_149), BgL_toz00_108, BgL_arg1250z00_155, BgL_arg1251z00_156); } }  else 
{ /* ./Type/coercion.scm 120 */
obj_t BgL_arg1259z00_158;obj_t BgL_arg1260z00_159;
BgL_arg1259z00_158 = 
BGl_shapez00zztools_shapez00(BgL_parentz00_149); 
BgL_arg1260z00_159 = 
BGl_shapez00zztools_shapez00(
(obj_t)(BgL_fromz00_107)); 
BGl_userzd2errorzd2zztools_errorz00(BGl_string1439z00zztype_coercionz00, BgL_arg1259z00_158, BgL_arg1260z00_159, BNIL); } } }  else 
{ /* ./Type/coercion.scm 115 */BFALSE; } } } 
{ /* ./Type/coercion.scm 113 */
obj_t BgL_arg1282z00_165;
BgL_arg1282z00_165 = 
CDR(BgL_l1091z00_145); 
{ 
obj_t BgL_l1091z00_580;
BgL_l1091z00_580 = BgL_arg1282z00_165; 
BgL_l1091z00_145 = BgL_l1091z00_580; 
goto BgL_forzd2each1092zd2_146;} } }  else 
{ /* ./Type/coercion.scm 113 */
BgL_auxz00_532 = ((bool_t)1); } } 
return 
BBOOL(BgL_auxz00_532);} } } } } } } 
}



/* _add-coercion!1385 */
obj_t BGl__addzd2coercionz121385zc0zztype_coercionz00(obj_t BgL_envz00_371, obj_t BgL_fromz00_372, obj_t BgL_toz00_373, obj_t BgL_checkz00_374, obj_t BgL_coercez00_375)
{ AN_OBJECT;
{ /* ./Type/coercion.scm 77 */
return 
BGl_addzd2coercionz12zc0zztype_coercionz00(
(BgL_typez00_bglt)(BgL_fromz00_372), 
(BgL_typez00_bglt)(BgL_toz00_373), BgL_checkz00_374, BgL_coercez00_375);} 
}



/* coercer-exists? */
BGL_EXPORTED_DEF bool_t BGl_coercerzd2existszf3z21zztype_coercionz00(BgL_typez00_bglt BgL_toz00_27, BgL_typez00_bglt BgL_fromz00_28)
{ AN_OBJECT;
{ /* ./Type/coercion.scm 162 */
{ /* ./Type/coercion.scm 163 */
BgL_typez00_bglt BgL_toz00_198;BgL_typez00_bglt BgL_fromz00_199;
BgL_toz00_198 = 
BGl_getzd2aliasedzd2typez00zztype_typez00(BgL_toz00_27); 
BgL_fromz00_199 = 
BGl_getzd2aliasedzd2typez00zztype_typez00(BgL_fromz00_28); 
{ /* ./Type/coercion.scm 165 */
bool_t BgL_test1352z00_200;
{ /* ./Type/coercion.scm 165 */
bool_t BgL_testz00_587;
{ /* ./Type/coercion.scm 165 */
obj_t BgL_auxz00_590;obj_t BgL_auxz00_588;
BgL_auxz00_590 = 
(obj_t)(BgL_toz00_198); 
BgL_auxz00_588 = 
(obj_t)(BgL_fromz00_199); 
BgL_testz00_587 = 
(BgL_auxz00_588==BgL_auxz00_590); } 
if(BgL_testz00_587)
{ /* ./Type/coercion.scm 165 */
BgL_test1352z00_200 = ((bool_t)1); }  else 
{ /* ./Type/coercion.scm 165 */
BgL_test1352z00_200 = 
(((BgL_typez00_bglt)CREF(BgL_fromz00_199))->BgL_magiczf3zf3); } } 
if(BgL_test1352z00_200)
{ /* ./Type/coercion.scm 165 */
return ((bool_t)1);}  else 
{ /* ./Type/coercion.scm 167 */
obj_t BgL_arg1354z00_201;
BgL_arg1354z00_201 = 
BGl_findzd2coercerzd2zztype_coercionz00(BgL_fromz00_199, BgL_toz00_198); 
if(
STRUCTP(BgL_arg1354z00_201))
{ /* ./Type/coercion.scm 167 */
obj_t BgL_auxz00_600;obj_t BgL_auxz00_598;
BgL_auxz00_600 = 
CNST_TABLE_REF(((long)1)); 
BgL_auxz00_598 = 
STRUCT_KEY(BgL_arg1354z00_201); 
return 
(BgL_auxz00_598==BgL_auxz00_600);}  else 
{ /* ./Type/coercion.scm 167 */
return ((bool_t)0);} } } } } 
}



/* _coercer-exists?1387 */
obj_t BGl__coercerzd2existszf31387z21zztype_coercionz00(obj_t BgL_envz00_376, obj_t BgL_toz00_377, obj_t BgL_fromz00_378)
{ AN_OBJECT;
{ /* ./Type/coercion.scm 162 */
{ /* ./Type/coercion.scm 163 */
bool_t BgL_auxz00_603;
BgL_auxz00_603 = 
BGl_coercerzd2existszf3z21zztype_coercionz00(
(BgL_typez00_bglt)(BgL_toz00_377), 
(BgL_typez00_bglt)(BgL_fromz00_378)); 
return 
BBOOL(BgL_auxz00_603);} } 
}



/* method-init */
obj_t BGl_methodzd2initzd2zztype_coercionz00()
{ AN_OBJECT;
{ /* ./Type/coercion.scm 15 */
return BUNSPEC;} 
}



/* imported-modules-init */
obj_t BGl_importedzd2moduleszd2initz00zztype_coercionz00()
{ AN_OBJECT;
{ /* ./Type/coercion.scm 15 */
BGl_modulezd2initializa7ationz75zztools_tracez00(((long)59211), "type_coercion"); 
BGl_modulezd2initializa7ationz75zztools_errorz00(((long)25566), "type_coercion"); 
BGl_modulezd2initializa7ationz75zztools_shapez00(((long)30833), "type_coercion"); 
BGl_modulezd2initializa7ationz75zztype_typez00(((long)19090), "type_coercion"); 
return 
BGl_modulezd2initializa7ationz75zzengine_paramz00(((long)14260), "type_coercion");} 
}

