chore: update stage0

This commit is contained in:
Leonardo de Moura 2019-10-23 15:19:52 -07:00
parent 93c6ab8eee
commit c232e9e1c8
8 changed files with 874 additions and 386 deletions

View file

@ -34,7 +34,6 @@ extern lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed_
lean_object* l_Lean_ParametricAttribute_getParam___at_Lean_getExternAttrData___spec__1(lean_object*, lean_object*, lean_object*);
lean_object* l___private_Init_Lean_Compiler_ExternAttr_1__syntaxToExternEntries___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_List_intersperse___main___rarg(lean_object*, lean_object*);
lean_object* l_Lean_expandExternEntry(lean_object*, lean_object*);
extern lean_object* l_Lean_AttributeImpl_inhabited___closed__5;
lean_object* l___private_Init_Lean_Compiler_ExternAttr_2__syntaxToExternAttrData___closed__4;
lean_object* l___private_Init_Lean_Compiler_ExternAttr_2__syntaxToExternAttrData___closed__10;
@ -43,10 +42,8 @@ lean_object* l___private_Init_Lean_Compiler_ExternAttr_2__syntaxToExternAttrData
lean_object* l_List_foldl___main___at_Lean_mkSimpleFnCall___spec__1___boxed(lean_object*, lean_object*);
lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkExternAttr___spec__7(lean_object*, lean_object*);
lean_object* l_Lean_registerAttribute(lean_object*, lean_object*);
lean_object* l_Lean_mkExternCall___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkExternAttr___closed__2;
extern lean_object* l___private_Init_Lean_Environment_5__envExtensionsRef;
lean_object* l_Lean_mkExternCall(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___closed__1;
lean_object* l_Lean_mkExternAttr___closed__3;
lean_object* l_Lean_Syntax_isNatLitAux___rarg(lean_object*, lean_object*);
@ -2566,44 +2563,6 @@ lean_dec(x_2);
return x_3;
}
}
lean_object* l_Lean_expandExternEntry(lean_object* x_1, lean_object* x_2) {
_start:
{
switch (lean_obj_tag(x_1)) {
case 0:
{
lean_object* x_3;
lean_dec(x_2);
lean_dec(x_1);
x_3 = lean_box(0);
return x_3;
}
case 1:
{
lean_object* x_4; lean_object* x_5; lean_object* x_6;
x_4 = lean_ctor_get(x_1, 1);
lean_inc(x_4);
lean_dec(x_1);
x_5 = l_Lean_expandExternPattern(x_4, x_2);
lean_dec(x_2);
x_6 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_6, 0, x_5);
return x_6;
}
default:
{
lean_object* x_7; lean_object* x_8; lean_object* x_9;
x_7 = lean_ctor_get(x_1, 1);
lean_inc(x_7);
lean_dec(x_1);
x_8 = l_Lean_mkSimpleFnCall(x_7, x_2);
x_9 = lean_alloc_ctor(1, 1, 0);
lean_ctor_set(x_9, 0, x_8);
return x_9;
}
}
}
}
lean_object* l_Lean_ExternEntry_backend(lean_object* x_1) {
_start:
{
@ -2717,39 +2676,6 @@ lean_dec(x_1);
return x_3;
}
}
lean_object* l_Lean_mkExternCall(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = l_Lean_getExternEntryFor(x_1, x_2);
if (lean_obj_tag(x_4) == 0)
{
lean_object* x_5;
lean_dec(x_3);
x_5 = lean_box(0);
return x_5;
}
else
{
lean_object* x_6; lean_object* x_7;
x_6 = lean_ctor_get(x_4, 0);
lean_inc(x_6);
lean_dec(x_4);
x_7 = l_Lean_expandExternEntry(x_6, x_3);
return x_7;
}
}
}
lean_object* l_Lean_mkExternCall___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4;
x_4 = l_Lean_mkExternCall(x_1, x_2, x_3);
lean_dec(x_2);
lean_dec(x_1);
return x_4;
}
}
uint8_t l_Lean_isExtern(lean_object* x_1, lean_object* x_2) {
_start:
{

View file

@ -97,7 +97,9 @@ lean_object* l_Nat_repr(lean_object*);
lean_object* l_Lean_IR_FnBody_alphaEqv___main___boxed(lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_IR_FnBody_alphaEqv___main(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_IRType_isScalar___boxed(lean_object*);
uint8_t l_Lean_IR_Decl_isExtern(lean_object*);
lean_object* l_Lean_IR_paramInh___closed__1;
lean_object* l_Lean_IR_Decl_isExtern___boxed(lean_object*);
lean_object* l_Lean_IR_Arg_alphaEqv___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_RBNode_ins___main___at_Lean_IR_LocalContext_addLocal___spec__2(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_LocalContext_addJP(lean_object*, lean_object*, lean_object*, lean_object*);
@ -2752,6 +2754,33 @@ lean_dec(x_1);
return x_2;
}
}
uint8_t l_Lean_IR_Decl_isExtern(lean_object* x_1) {
_start:
{
if (lean_obj_tag(x_1) == 0)
{
uint8_t x_2;
x_2 = 0;
return x_2;
}
else
{
uint8_t x_3;
x_3 = 1;
return x_3;
}
}
}
lean_object* l_Lean_IR_Decl_isExtern___boxed(lean_object* x_1) {
_start:
{
uint8_t x_2; lean_object* x_3;
x_2 = l_Lean_IR_Decl_isExtern(x_1);
lean_dec(x_1);
x_3 = lean_box(x_2);
return x_3;
}
}
lean_object* lean_ir_mk_decl(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{

View file

@ -23,6 +23,7 @@ lean_object* lean_name_mangle(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_isIf___boxed(lean_object*);
lean_object* l_Lean_IR_EmitC_emitMainFn___closed__27;
lean_object* l_Lean_IR_EmitC_toCInitName___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Nat_mfoldAux___main___at_Lean_IR_EmitC_emitSimpleExternalCall___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitFnBody(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_toCName___closed__3;
lean_object* l_List_mfor___main___at_Lean_IR_EmitC_emitLns___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
@ -37,6 +38,7 @@ uint8_t lean_name_dec_eq(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitReset___closed__3;
lean_object* l_Lean_IR_EmitC_toCType___closed__5;
lean_object* l_Lean_IR_EmitC_emitDeclAux___closed__1;
lean_object* l_Lean_IR_EmitC_emitSimpleExternalCall(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitReset___spec__1___closed__1;
lean_object* l_Lean_IR_EmitC_throwUnknownVar___rarg(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitMainFn___closed__18;
@ -82,11 +84,13 @@ lean_object* l_Lean_IR_EmitC_emitFileHeader___closed__23;
extern lean_object* l_Char_quoteCore___closed__3;
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitTailCall___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_declareVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Array_filterAux___main___at_Lean_IR_EmitC_emitFnDeclAux___spec__3(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_declareParams___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_List_mfor___main___at_Lean_IR_EmitC_emitMainFn___spec__2___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitCase___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitMainFn___closed__14;
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitDeclAux___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_IR_IRType_isIrrelevant(lean_object*);
lean_object* l_Array_mforAux___main___at_Lean_IR_EmitC_emitInitFn___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitFileHeader___closed__17;
lean_object* l_Lean_IR_EmitC_emitSet___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -117,7 +121,6 @@ lean_object* l_Lean_IR_EmitC_emitMainFn___closed__33;
lean_object* l_Lean_IR_EmitC_emitApp___closed__1;
uint8_t l_Lean_isIOUnitInitFn(lean_object*, lean_object*);
lean_object* l_List_reverse___rarg(lean_object*);
lean_object* l_Lean_mkExternCall(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitMainFn___closed__30;
lean_object* l_Lean_IR_EmitC_emitSProj(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_declareVar(lean_object*, lean_object*, lean_object*, lean_object*);
@ -181,6 +184,7 @@ lean_object* l_Lean_IR_EmitC_emitReset___closed__1;
lean_object* l_Lean_IR_EmitC_emitOffset___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitInitFn___closed__8;
lean_object* l_Lean_IR_EmitC_emitFnDecl(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Array_swap(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_declareVars___main(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitFnDecls(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitIsTaggedPtr(lean_object*, lean_object*, lean_object*, lean_object*);
@ -224,6 +228,7 @@ lean_object* l_Lean_IR_EmitC_emitUnbox(lean_object*, lean_object*, lean_object*,
lean_object* l_Lean_IR_EmitC_emitTailCall(lean_object*, lean_object*, lean_object*);
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitJmp___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitIsTaggedPtr___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_expandExternPattern(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitVDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitInitFn___closed__7;
lean_object* l_Lean_IR_EmitC_emitSSet(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
@ -249,6 +254,7 @@ lean_object* l_Lean_IR_EmitC_toCType(lean_object*);
lean_object* l_Lean_IR_EmitC_emitReset___closed__4;
lean_object* l_List_foldl___main___at_Lean_IR_EmitC_emitFnDecls___spec__1(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitApp___closed__3;
lean_object* l_Lean_IR_EmitC_emitExternCall(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_Option_HasRepr___rarg___closed__3;
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_declareVar___closed__1;
@ -260,6 +266,7 @@ lean_object* l_Lean_IR_EmitC_main(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitMainFnIfNeeded(lean_object*, lean_object*);
lean_object* lean_nat_mod(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitFileHeader___closed__3;
lean_object* l_Lean_IR_EmitC_emitExternCall___closed__1;
lean_object* l_Lean_IR_EmitC_emitSSet___closed__3;
lean_object* l_Lean_IR_EmitC_emitFileHeader___closed__11;
extern lean_object* l_Char_HasRepr___closed__1;
@ -350,6 +357,7 @@ lean_object* l_Lean_IR_EmitC_emitFileHeader___closed__14;
lean_object* l_Lean_IR_EmitC_emitAllocCtor___closed__1;
lean_object* l_Lean_IR_EmitC_emitInc___closed__2;
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitTailCall___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitExternCall___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitBlock___main___closed__2;
lean_object* l_Lean_IR_EmitC_emitApp___closed__5;
uint8_t l_Lean_IR_FnBody_isTerminal(lean_object*);
@ -371,6 +379,7 @@ lean_object* l_Lean_IR_EmitC_emitFileFooter(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitReset___closed__2;
lean_object* l_List_mfor___main___at_Lean_IR_EmitC_emitLns___spec__1(lean_object*);
extern lean_object* l_System_FilePath_dirName___closed__1;
lean_object* l_Array_shrink___main___rarg(lean_object*, lean_object*);
lean_object* l_panic(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_toCInitName(lean_object*, lean_object*, lean_object*);
extern lean_object* l_Lean_closureMaxArgs;
@ -397,6 +406,7 @@ lean_object* l_Lean_IR_EmitC_emitMainFn___closed__28;
lean_object* l_Lean_IR_EmitC_emitInitFn___closed__5;
lean_object* l_Lean_IR_EmitC_emitMainFn___closed__45;
lean_object* l_List_mfor___main___at_Lean_IR_EmitC_emitFnDecls___spec__5___closed__2;
lean_object* l_Lean_IR_EmitC_emitSimpleExternalCall___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
extern lean_object* l_HashMap_Inhabited___closed__1;
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitTailCall___spec__2___closed__1;
lean_object* l_Lean_IR_EmitC_emitUnbox___closed__3;
@ -431,7 +441,6 @@ lean_object* l_Lean_IR_EmitC_emitInc___boxed(lean_object*, lean_object*, lean_ob
lean_object* l_Lean_IR_EmitC_emitMainFn___closed__7;
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitPartialApp___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitPartialApp___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitFullApp___closed__1;
lean_object* l_Lean_IR_EmitC_emitIf___closed__1;
lean_object* l_Lean_Environment_imports(lean_object*);
lean_object* l_Lean_IR_EmitC_getJPParams(lean_object*, lean_object*, lean_object*);
@ -472,6 +481,7 @@ lean_object* l_Lean_IR_EmitC_emitMainFn___closed__37;
extern lean_object* l_panicWithPos___rarg___closed__2;
lean_object* l_Nat_mforAux___main___at_Lean_IR_EmitC_emitJmp___spec__1___closed__1;
lean_object* l_Lean_IR_EmitC_getJPParams___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_getExternEntryFor(lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitIf(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_uint32_to_nat(uint32_t);
lean_object* l_Lean_IR_EmitC_argToCString___closed__1;
@ -491,6 +501,7 @@ lean_object* l_Nat_anyAux___main___at_Lean_IR_EmitC_overwriteParam___spec__1___b
lean_object* l_List_mfor___main___at_Lean_IR_EmitC_emitFnDecls___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitFileHeader___closed__9;
lean_object* l_Lean_IR_EmitC_paramEqArg___boxed(lean_object*, lean_object*);
lean_object* l_Nat_mfoldAux___main___at_Lean_IR_EmitC_emitSimpleExternalCall___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_declareVars(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_IR_EmitC_emitDec___closed__2;
lean_object* l_Lean_IR_EmitC_emitCtorSetArgs(lean_object*, lean_object*, lean_object*, lean_object*);
@ -1731,6 +1742,73 @@ return x_28;
}
}
}
lean_object* l_Array_filterAux___main___at_Lean_IR_EmitC_emitFnDeclAux___spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
lean_object* x_4; uint8_t x_5;
x_4 = lean_array_get_size(x_1);
x_5 = lean_nat_dec_lt(x_2, x_4);
lean_dec(x_4);
if (x_5 == 0)
{
lean_object* x_6;
lean_dec(x_2);
x_6 = l_Array_shrink___main___rarg(x_1, x_3);
lean_dec(x_3);
return x_6;
}
else
{
lean_object* x_7; lean_object* x_8; uint8_t x_9;
x_7 = lean_array_fget(x_1, x_2);
x_8 = lean_ctor_get(x_7, 1);
lean_inc(x_8);
lean_dec(x_7);
x_9 = l_Lean_IR_IRType_isIrrelevant(x_8);
lean_dec(x_8);
if (x_9 == 0)
{
uint8_t x_10;
x_10 = lean_nat_dec_lt(x_3, x_2);
if (x_10 == 0)
{
lean_object* x_11; lean_object* x_12; lean_object* x_13;
x_11 = lean_unsigned_to_nat(1u);
x_12 = lean_nat_add(x_2, x_11);
lean_dec(x_2);
x_13 = lean_nat_add(x_3, x_11);
lean_dec(x_3);
x_2 = x_12;
x_3 = x_13;
goto _start;
}
else
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18;
x_15 = lean_array_fswap(x_1, x_2, x_3);
x_16 = lean_unsigned_to_nat(1u);
x_17 = lean_nat_add(x_2, x_16);
lean_dec(x_2);
x_18 = lean_nat_add(x_3, x_16);
lean_dec(x_3);
x_1 = x_15;
x_2 = x_17;
x_3 = x_18;
goto _start;
}
}
else
{
lean_object* x_20; lean_object* x_21;
x_20 = lean_unsigned_to_nat(1u);
x_21 = lean_nat_add(x_2, x_20);
lean_dec(x_2);
x_2 = x_21;
goto _start;
}
}
}
}
lean_object* _init_l_Lean_IR_EmitC_emitFnDeclAux___closed__1() {
_start:
{
@ -1742,177 +1820,222 @@ return x_1;
lean_object* l_Lean_IR_EmitC_emitFnDeclAux(lean_object* x_1, lean_object* x_2, uint8_t x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; uint8_t x_7; lean_object* x_8;
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; uint8_t x_11; lean_object* x_12;
x_6 = l_Lean_IR_Decl_params(x_1);
x_7 = l_Array_isEmpty___rarg(x_6);
if (x_7 == 0)
x_7 = l_Lean_IR_EmitC_getEnv(x_4, x_5);
x_8 = lean_ctor_get(x_7, 0);
lean_inc(x_8);
x_9 = lean_ctor_get(x_7, 1);
lean_inc(x_9);
if (lean_is_exclusive(x_7)) {
lean_ctor_release(x_7, 0);
lean_ctor_release(x_7, 1);
x_10 = x_7;
} else {
lean_dec_ref(x_7);
x_10 = lean_box(0);
}
x_11 = l_Array_isEmpty___rarg(x_6);
if (x_11 == 0)
{
x_8 = x_5;
goto block_78;
x_12 = x_9;
goto block_87;
}
else
{
if (x_3 == 0)
{
x_8 = x_5;
goto block_78;
x_12 = x_9;
goto block_87;
}
else
{
lean_object* x_88; lean_object* x_89;
x_88 = l_Lean_IR_formatDecl___closed__3;
x_89 = lean_string_append(x_9, x_88);
x_12 = x_89;
goto block_87;
}
}
block_87:
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18;
x_13 = l_Lean_IR_Decl_resultType(x_1);
x_14 = l_Lean_IR_EmitC_toCType(x_13);
lean_dec(x_13);
x_15 = l_String_Iterator_HasRepr___closed__2;
x_16 = lean_string_append(x_14, x_15);
x_17 = lean_string_append(x_16, x_2);
x_18 = lean_string_append(x_12, x_17);
lean_dec(x_17);
if (x_11 == 0)
{
lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; uint8_t x_78;
x_19 = l_Prod_HasRepr___rarg___closed__1;
x_20 = lean_string_append(x_18, x_19);
x_21 = l_Lean_IR_Decl_name(x_1);
lean_inc(x_21);
x_78 = l_Lean_isExternC(x_8, x_21);
lean_dec(x_8);
if (x_78 == 0)
{
x_22 = x_6;
goto block_77;
}
else
{
lean_object* x_79; lean_object* x_80;
x_79 = l_Lean_IR_formatDecl___closed__3;
x_80 = lean_string_append(x_5, x_79);
x_8 = x_80;
goto block_78;
x_79 = lean_unsigned_to_nat(0u);
x_80 = l_Array_filterAux___main___at_Lean_IR_EmitC_emitFnDeclAux___spec__3(x_6, x_79, x_79);
x_22 = x_80;
goto block_77;
}
}
block_78:
block_77:
{
lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
x_9 = l_Lean_IR_Decl_resultType(x_1);
x_10 = l_Lean_IR_EmitC_toCType(x_9);
lean_dec(x_9);
x_11 = l_String_Iterator_HasRepr___closed__2;
x_12 = lean_string_append(x_10, x_11);
x_13 = lean_string_append(x_12, x_2);
x_14 = lean_string_append(x_8, x_13);
lean_dec(x_13);
if (x_7 == 0)
lean_object* x_23; lean_object* x_24; uint8_t x_25;
x_23 = lean_array_get_size(x_22);
x_24 = l_Lean_closureMaxArgs;
x_25 = lean_nat_dec_lt(x_24, x_23);
if (x_25 == 0)
{
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19;
x_15 = l_Prod_HasRepr___rarg___closed__1;
x_16 = lean_string_append(x_14, x_15);
x_17 = lean_array_get_size(x_6);
x_18 = l_Lean_closureMaxArgs;
x_19 = lean_nat_dec_lt(x_18, x_17);
if (x_19 == 0)
{
lean_object* x_20; uint8_t x_21;
lean_inc(x_17);
x_20 = l_Nat_mforAux___main___at_Lean_IR_EmitC_emitFnDeclAux___spec__1(x_6, x_17, x_17, x_4, x_16);
lean_dec(x_17);
lean_dec(x_6);
x_21 = !lean_is_exclusive(x_20);
if (x_21 == 0)
{
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30;
x_22 = lean_ctor_get(x_20, 1);
x_23 = lean_ctor_get(x_20, 0);
lean_object* x_26; uint8_t x_27;
lean_dec(x_21);
lean_dec(x_10);
lean_inc(x_23);
x_26 = l_Nat_mforAux___main___at_Lean_IR_EmitC_emitFnDeclAux___spec__1(x_22, x_23, x_23, x_4, x_20);
lean_dec(x_23);
x_24 = l_Option_HasRepr___rarg___closed__3;
x_25 = lean_string_append(x_22, x_24);
x_26 = l_Lean_IR_formatFnBody___main___closed__1;
x_27 = lean_string_append(x_25, x_26);
x_28 = l_IO_println___rarg___closed__1;
x_29 = lean_string_append(x_27, x_28);
x_30 = lean_box(0);
lean_ctor_set(x_20, 1, x_29);
lean_ctor_set(x_20, 0, x_30);
return x_20;
}
else
lean_dec(x_22);
x_27 = !lean_is_exclusive(x_26);
if (x_27 == 0)
{
lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39;
x_31 = lean_ctor_get(x_20, 1);
lean_inc(x_31);
lean_dec(x_20);
x_32 = l_Option_HasRepr___rarg___closed__3;
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36;
x_28 = lean_ctor_get(x_26, 1);
x_29 = lean_ctor_get(x_26, 0);
lean_dec(x_29);
x_30 = l_Option_HasRepr___rarg___closed__3;
x_31 = lean_string_append(x_28, x_30);
x_32 = l_Lean_IR_formatFnBody___main___closed__1;
x_33 = lean_string_append(x_31, x_32);
x_34 = l_Lean_IR_formatFnBody___main___closed__1;
x_34 = l_IO_println___rarg___closed__1;
x_35 = lean_string_append(x_33, x_34);
x_36 = l_IO_println___rarg___closed__1;
x_37 = lean_string_append(x_35, x_36);
x_38 = lean_box(0);
x_39 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_39, 0, x_38);
lean_ctor_set(x_39, 1, x_37);
return x_39;
x_36 = lean_box(0);
lean_ctor_set(x_26, 1, x_35);
lean_ctor_set(x_26, 0, x_36);
return x_26;
}
else
{
lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45;
x_37 = lean_ctor_get(x_26, 1);
lean_inc(x_37);
lean_dec(x_26);
x_38 = l_Option_HasRepr___rarg___closed__3;
x_39 = lean_string_append(x_37, x_38);
x_40 = l_Lean_IR_formatFnBody___main___closed__1;
x_41 = lean_string_append(x_39, x_40);
x_42 = l_IO_println___rarg___closed__1;
x_43 = lean_string_append(x_41, x_42);
x_44 = lean_box(0);
x_45 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_45, 0, x_44);
lean_ctor_set(x_45, 1, x_43);
return x_45;
}
}
else
{
lean_object* x_40; uint8_t x_41;
x_40 = l_Lean_IR_Decl_name(x_1);
x_41 = l_Lean_IR_ExplicitBoxing_isBoxedName(x_40);
lean_dec(x_40);
if (x_41 == 0)
uint8_t x_46;
x_46 = l_Lean_IR_ExplicitBoxing_isBoxedName(x_21);
lean_dec(x_21);
if (x_46 == 0)
{
lean_object* x_42; uint8_t x_43;
lean_inc(x_17);
x_42 = l_Nat_mforAux___main___at_Lean_IR_EmitC_emitFnDeclAux___spec__2(x_6, x_17, x_17, x_4, x_16);
lean_dec(x_17);
lean_object* x_47; uint8_t x_48;
lean_dec(x_10);
lean_inc(x_23);
x_47 = l_Nat_mforAux___main___at_Lean_IR_EmitC_emitFnDeclAux___spec__2(x_22, x_23, x_23, x_4, x_20);
lean_dec(x_23);
lean_dec(x_22);
x_48 = !lean_is_exclusive(x_47);
if (x_48 == 0)
{
lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57;
x_49 = lean_ctor_get(x_47, 1);
x_50 = lean_ctor_get(x_47, 0);
lean_dec(x_50);
x_51 = l_Option_HasRepr___rarg___closed__3;
x_52 = lean_string_append(x_49, x_51);
x_53 = l_Lean_IR_formatFnBody___main___closed__1;
x_54 = lean_string_append(x_52, x_53);
x_55 = l_IO_println___rarg___closed__1;
x_56 = lean_string_append(x_54, x_55);
x_57 = lean_box(0);
lean_ctor_set(x_47, 1, x_56);
lean_ctor_set(x_47, 0, x_57);
return x_47;
}
else
{
lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66;
x_58 = lean_ctor_get(x_47, 1);
lean_inc(x_58);
lean_dec(x_47);
x_59 = l_Option_HasRepr___rarg___closed__3;
x_60 = lean_string_append(x_58, x_59);
x_61 = l_Lean_IR_formatFnBody___main___closed__1;
x_62 = lean_string_append(x_60, x_61);
x_63 = l_IO_println___rarg___closed__1;
x_64 = lean_string_append(x_62, x_63);
x_65 = lean_box(0);
x_66 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_66, 0, x_65);
lean_ctor_set(x_66, 1, x_64);
return x_66;
}
}
else
{
lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76;
lean_dec(x_23);
lean_dec(x_22);
x_67 = l_Lean_IR_EmitC_emitFnDeclAux___closed__1;
x_68 = lean_string_append(x_20, x_67);
x_69 = l_Option_HasRepr___rarg___closed__3;
x_70 = lean_string_append(x_68, x_69);
x_71 = l_Lean_IR_formatFnBody___main___closed__1;
x_72 = lean_string_append(x_70, x_71);
x_73 = l_IO_println___rarg___closed__1;
x_74 = lean_string_append(x_72, x_73);
x_75 = lean_box(0);
if (lean_is_scalar(x_10)) {
x_76 = lean_alloc_ctor(0, 2, 0);
} else {
x_76 = x_10;
}
lean_ctor_set(x_76, 0, x_75);
lean_ctor_set(x_76, 1, x_74);
return x_76;
}
}
}
}
else
{
lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86;
lean_dec(x_8);
lean_dec(x_6);
x_43 = !lean_is_exclusive(x_42);
if (x_43 == 0)
{
lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52;
x_44 = lean_ctor_get(x_42, 1);
x_45 = lean_ctor_get(x_42, 0);
lean_dec(x_45);
x_46 = l_Option_HasRepr___rarg___closed__3;
x_47 = lean_string_append(x_44, x_46);
x_48 = l_Lean_IR_formatFnBody___main___closed__1;
x_49 = lean_string_append(x_47, x_48);
x_50 = l_IO_println___rarg___closed__1;
x_51 = lean_string_append(x_49, x_50);
x_52 = lean_box(0);
lean_ctor_set(x_42, 1, x_51);
lean_ctor_set(x_42, 0, x_52);
return x_42;
x_81 = l_Lean_IR_formatFnBody___main___closed__1;
x_82 = lean_string_append(x_18, x_81);
x_83 = l_IO_println___rarg___closed__1;
x_84 = lean_string_append(x_82, x_83);
x_85 = lean_box(0);
if (lean_is_scalar(x_10)) {
x_86 = lean_alloc_ctor(0, 2, 0);
} else {
x_86 = x_10;
}
else
{
lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61;
x_53 = lean_ctor_get(x_42, 1);
lean_inc(x_53);
lean_dec(x_42);
x_54 = l_Option_HasRepr___rarg___closed__3;
x_55 = lean_string_append(x_53, x_54);
x_56 = l_Lean_IR_formatFnBody___main___closed__1;
x_57 = lean_string_append(x_55, x_56);
x_58 = l_IO_println___rarg___closed__1;
x_59 = lean_string_append(x_57, x_58);
x_60 = lean_box(0);
x_61 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_61, 0, x_60);
lean_ctor_set(x_61, 1, x_59);
return x_61;
}
}
else
{
lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71;
lean_dec(x_17);
lean_dec(x_6);
x_62 = l_Lean_IR_EmitC_emitFnDeclAux___closed__1;
x_63 = lean_string_append(x_16, x_62);
x_64 = l_Option_HasRepr___rarg___closed__3;
x_65 = lean_string_append(x_63, x_64);
x_66 = l_Lean_IR_formatFnBody___main___closed__1;
x_67 = lean_string_append(x_65, x_66);
x_68 = l_IO_println___rarg___closed__1;
x_69 = lean_string_append(x_67, x_68);
x_70 = lean_box(0);
x_71 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_71, 0, x_70);
lean_ctor_set(x_71, 1, x_69);
return x_71;
}
}
}
else
{
lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77;
lean_dec(x_6);
x_72 = l_Lean_IR_formatFnBody___main___closed__1;
x_73 = lean_string_append(x_14, x_72);
x_74 = l_IO_println___rarg___closed__1;
x_75 = lean_string_append(x_73, x_74);
x_76 = lean_box(0);
x_77 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_77, 0, x_76);
lean_ctor_set(x_77, 1, x_75);
return x_77;
lean_ctor_set(x_86, 0, x_85);
lean_ctor_set(x_86, 1, x_84);
return x_86;
}
}
}
@ -7269,7 +7392,157 @@ lean_dec(x_1);
return x_2;
}
}
lean_object* _init_l_Lean_IR_EmitC_emitFullApp___closed__1() {
lean_object* l_Nat_mfoldAux___main___at_Lean_IR_EmitC_emitSimpleExternalCall___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, uint8_t x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
lean_object* x_8; uint8_t x_9;
x_8 = lean_unsigned_to_nat(0u);
x_9 = lean_nat_dec_eq(x_4, x_8);
if (x_9 == 0)
{
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17;
x_10 = lean_unsigned_to_nat(1u);
x_11 = lean_nat_sub(x_4, x_10);
lean_dec(x_4);
x_12 = lean_nat_sub(x_3, x_11);
x_13 = lean_nat_sub(x_12, x_10);
lean_dec(x_12);
x_14 = l_Lean_IR_paramInh;
x_15 = lean_array_get(x_14, x_1, x_13);
x_16 = lean_ctor_get(x_15, 1);
lean_inc(x_16);
lean_dec(x_15);
x_17 = l_Lean_IR_IRType_isIrrelevant(x_16);
lean_dec(x_16);
if (x_17 == 0)
{
if (x_5 == 0)
{
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; uint8_t x_24;
x_18 = l_List_reprAux___main___rarg___closed__1;
x_19 = lean_string_append(x_7, x_18);
x_20 = l_Lean_IR_Arg_Inhabited;
x_21 = lean_array_get(x_20, x_2, x_13);
lean_dec(x_13);
x_22 = l_Lean_IR_EmitC_emitArg(x_21, x_6, x_19);
x_23 = lean_ctor_get(x_22, 1);
lean_inc(x_23);
lean_dec(x_22);
x_24 = 0;
x_4 = x_11;
x_5 = x_24;
x_7 = x_23;
goto _start;
}
else
{
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; uint8_t x_30;
x_26 = l_Lean_IR_Arg_Inhabited;
x_27 = lean_array_get(x_26, x_2, x_13);
lean_dec(x_13);
x_28 = l_Lean_IR_EmitC_emitArg(x_27, x_6, x_7);
x_29 = lean_ctor_get(x_28, 1);
lean_inc(x_29);
lean_dec(x_28);
x_30 = 0;
x_4 = x_11;
x_5 = x_30;
x_7 = x_29;
goto _start;
}
}
else
{
lean_dec(x_13);
x_4 = x_11;
goto _start;
}
}
else
{
lean_object* x_33; lean_object* x_34;
lean_dec(x_4);
x_33 = lean_box(x_5);
x_34 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_34, 0, x_33);
lean_ctor_set(x_34, 1, x_7);
return x_34;
}
}
}
lean_object* l_Lean_IR_EmitC_emitSimpleExternalCall(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10; lean_object* x_11; uint8_t x_12;
x_6 = lean_string_append(x_5, x_1);
x_7 = l_Prod_HasRepr___rarg___closed__1;
x_8 = lean_string_append(x_6, x_7);
x_9 = lean_array_get_size(x_3);
x_10 = 1;
lean_inc(x_9);
x_11 = l_Nat_mfoldAux___main___at_Lean_IR_EmitC_emitSimpleExternalCall___spec__1(x_2, x_3, x_9, x_9, x_10, x_4, x_8);
lean_dec(x_9);
x_12 = !lean_is_exclusive(x_11);
if (x_12 == 0)
{
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_13 = lean_ctor_get(x_11, 1);
x_14 = lean_ctor_get(x_11, 0);
lean_dec(x_14);
x_15 = l_Lean_IR_EmitC_emitInc___closed__1;
x_16 = lean_string_append(x_13, x_15);
x_17 = l_IO_println___rarg___closed__1;
x_18 = lean_string_append(x_16, x_17);
x_19 = lean_box(0);
lean_ctor_set(x_11, 1, x_18);
lean_ctor_set(x_11, 0, x_19);
return x_11;
}
else
{
lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
x_20 = lean_ctor_get(x_11, 1);
lean_inc(x_20);
lean_dec(x_11);
x_21 = l_Lean_IR_EmitC_emitInc___closed__1;
x_22 = lean_string_append(x_20, x_21);
x_23 = l_IO_println___rarg___closed__1;
x_24 = lean_string_append(x_22, x_23);
x_25 = lean_box(0);
x_26 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_26, 0, x_25);
lean_ctor_set(x_26, 1, x_24);
return x_26;
}
}
}
lean_object* l_Nat_mfoldAux___main___at_Lean_IR_EmitC_emitSimpleExternalCall___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
_start:
{
uint8_t x_8; lean_object* x_9;
x_8 = lean_unbox(x_5);
lean_dec(x_5);
x_9 = l_Nat_mfoldAux___main___at_Lean_IR_EmitC_emitSimpleExternalCall___spec__1(x_1, x_2, x_3, x_4, x_8, x_6, x_7);
lean_dec(x_6);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
return x_9;
}
}
lean_object* l_Lean_IR_EmitC_emitSimpleExternalCall___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
lean_object* x_6;
x_6 = l_Lean_IR_EmitC_emitSimpleExternalCall(x_1, x_2, x_3, x_4, x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
return x_6;
}
}
lean_object* _init_l_Lean_IR_EmitC_emitExternCall___closed__1() {
_start:
{
lean_object* x_1;
@ -7277,6 +7550,99 @@ x_1 = lean_mk_string("failed to emit extern application '");
return x_1;
}
}
lean_object* l_Lean_IR_EmitC_emitExternCall(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7; lean_object* x_16; lean_object* x_17;
x_16 = l_List_mfor___main___at_Lean_IR_EmitC_emitFnDecls___spec__5___closed__2;
x_17 = l_Lean_getExternEntryFor(x_3, x_16);
if (lean_obj_tag(x_17) == 0)
{
lean_object* x_18;
x_18 = lean_box(0);
x_7 = x_18;
goto block_15;
}
else
{
lean_object* x_19;
x_19 = lean_ctor_get(x_17, 0);
lean_inc(x_19);
lean_dec(x_17);
switch (lean_obj_tag(x_19)) {
case 0:
{
lean_object* x_20;
lean_dec(x_19);
x_20 = lean_box(0);
x_7 = x_20;
goto block_15;
}
case 1:
{
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30;
lean_dec(x_1);
x_21 = lean_ctor_get(x_19, 1);
lean_inc(x_21);
lean_dec(x_19);
x_22 = l_Lean_IR_EmitC_toStringArgs(x_4);
x_23 = l_Lean_expandExternPattern(x_21, x_22);
lean_dec(x_22);
x_24 = lean_string_append(x_6, x_23);
lean_dec(x_23);
x_25 = l_Lean_IR_formatFnBody___main___closed__1;
x_26 = lean_string_append(x_24, x_25);
x_27 = l_IO_println___rarg___closed__1;
x_28 = lean_string_append(x_26, x_27);
x_29 = lean_box(0);
x_30 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_30, 0, x_29);
lean_ctor_set(x_30, 1, x_28);
return x_30;
}
default:
{
lean_object* x_31; lean_object* x_32;
lean_dec(x_1);
x_31 = lean_ctor_get(x_19, 1);
lean_inc(x_31);
lean_dec(x_19);
x_32 = l_Lean_IR_EmitC_emitSimpleExternalCall(x_31, x_2, x_4, x_5, x_6);
lean_dec(x_31);
return x_32;
}
}
}
block_15:
{
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
lean_dec(x_7);
x_8 = l_System_FilePath_dirName___closed__1;
x_9 = l_Lean_Name_toStringWithSep___main(x_8, x_1);
x_10 = l_Lean_IR_EmitC_emitExternCall___closed__1;
x_11 = lean_string_append(x_10, x_9);
lean_dec(x_9);
x_12 = l_Char_HasRepr___closed__1;
x_13 = lean_string_append(x_11, x_12);
x_14 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_14, 0, x_13);
lean_ctor_set(x_14, 1, x_6);
return x_14;
}
}
}
lean_object* l_Lean_IR_EmitC_emitExternCall___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
_start:
{
lean_object* x_7;
x_7 = l_Lean_IR_EmitC_emitExternCall(x_1, x_2, x_3, x_4, x_5, x_6);
lean_dec(x_5);
lean_dec(x_4);
lean_dec(x_3);
lean_dec(x_2);
return x_7;
}
}
lean_object* l_Lean_IR_EmitC_emitFullApp(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
_start:
{
@ -7453,125 +7819,42 @@ return x_71;
}
else
{
uint8_t x_72;
x_72 = !lean_is_exclusive(x_8);
if (x_72 == 0)
{
lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78;
x_73 = lean_ctor_get(x_8, 1);
x_74 = lean_ctor_get(x_8, 0);
lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75;
x_72 = lean_ctor_get(x_8, 1);
lean_inc(x_72);
lean_dec(x_8);
x_73 = lean_ctor_get(x_9, 1);
lean_inc(x_73);
x_74 = lean_ctor_get(x_9, 3);
lean_inc(x_74);
lean_dec(x_9);
x_75 = l_Lean_IR_EmitC_emitExternCall(x_2, x_73, x_74, x_3, x_4, x_72);
lean_dec(x_74);
x_75 = lean_ctor_get(x_9, 3);
lean_inc(x_75);
lean_dec(x_9);
x_76 = l_Lean_IR_EmitC_toStringArgs(x_3);
x_77 = l_List_mfor___main___at_Lean_IR_EmitC_emitFnDecls___spec__5___closed__2;
x_78 = l_Lean_mkExternCall(x_75, x_77, x_76);
lean_dec(x_75);
if (lean_obj_tag(x_78) == 0)
{
lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84;
x_79 = l_System_FilePath_dirName___closed__1;
x_80 = l_Lean_Name_toStringWithSep___main(x_79, x_2);
x_81 = l_Lean_IR_EmitC_emitFullApp___closed__1;
x_82 = lean_string_append(x_81, x_80);
lean_dec(x_80);
x_83 = l_Char_HasRepr___closed__1;
x_84 = lean_string_append(x_82, x_83);
lean_ctor_set_tag(x_8, 1);
lean_ctor_set(x_8, 0, x_84);
return x_8;
lean_dec(x_73);
return x_75;
}
}
else
{
lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91;
uint8_t x_76;
lean_dec(x_2);
x_85 = lean_ctor_get(x_78, 0);
lean_inc(x_85);
lean_dec(x_78);
x_86 = lean_string_append(x_73, x_85);
lean_dec(x_85);
x_87 = l_Lean_IR_formatFnBody___main___closed__1;
x_88 = lean_string_append(x_86, x_87);
x_89 = l_IO_println___rarg___closed__1;
x_90 = lean_string_append(x_88, x_89);
x_91 = lean_box(0);
lean_ctor_set(x_8, 1, x_90);
lean_ctor_set(x_8, 0, x_91);
x_76 = !lean_is_exclusive(x_8);
if (x_76 == 0)
{
return x_8;
}
}
else
{
lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96;
x_92 = lean_ctor_get(x_8, 1);
lean_inc(x_92);
lean_object* x_77; lean_object* x_78; lean_object* x_79;
x_77 = lean_ctor_get(x_8, 0);
x_78 = lean_ctor_get(x_8, 1);
lean_inc(x_78);
lean_inc(x_77);
lean_dec(x_8);
x_93 = lean_ctor_get(x_9, 3);
lean_inc(x_93);
lean_dec(x_9);
x_94 = l_Lean_IR_EmitC_toStringArgs(x_3);
x_95 = l_List_mfor___main___at_Lean_IR_EmitC_emitFnDecls___spec__5___closed__2;
x_96 = l_Lean_mkExternCall(x_93, x_95, x_94);
lean_dec(x_93);
if (lean_obj_tag(x_96) == 0)
{
lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103;
x_97 = l_System_FilePath_dirName___closed__1;
x_98 = l_Lean_Name_toStringWithSep___main(x_97, x_2);
x_99 = l_Lean_IR_EmitC_emitFullApp___closed__1;
x_100 = lean_string_append(x_99, x_98);
lean_dec(x_98);
x_101 = l_Char_HasRepr___closed__1;
x_102 = lean_string_append(x_100, x_101);
x_103 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_103, 0, x_102);
lean_ctor_set(x_103, 1, x_92);
return x_103;
}
else
{
lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111;
lean_dec(x_2);
x_104 = lean_ctor_get(x_96, 0);
lean_inc(x_104);
lean_dec(x_96);
x_105 = lean_string_append(x_92, x_104);
lean_dec(x_104);
x_106 = l_Lean_IR_formatFnBody___main___closed__1;
x_107 = lean_string_append(x_105, x_106);
x_108 = l_IO_println___rarg___closed__1;
x_109 = lean_string_append(x_107, x_108);
x_110 = lean_box(0);
x_111 = lean_alloc_ctor(0, 2, 0);
lean_ctor_set(x_111, 0, x_110);
lean_ctor_set(x_111, 1, x_109);
return x_111;
}
}
}
}
else
{
uint8_t x_112;
lean_dec(x_2);
x_112 = !lean_is_exclusive(x_8);
if (x_112 == 0)
{
return x_8;
}
else
{
lean_object* x_113; lean_object* x_114; lean_object* x_115;
x_113 = lean_ctor_get(x_8, 0);
x_114 = lean_ctor_get(x_8, 1);
lean_inc(x_114);
lean_inc(x_113);
lean_dec(x_8);
x_115 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_115, 0, x_113);
lean_ctor_set(x_115, 1, x_114);
return x_115;
x_79 = lean_alloc_ctor(1, 2, 0);
lean_ctor_set(x_79, 0, x_77);
lean_ctor_set(x_79, 1, x_78);
return x_79;
}
}
}
@ -13293,8 +13576,8 @@ l_Lean_IR_EmitC_emitSProj___closed__3 = _init_l_Lean_IR_EmitC_emitSProj___closed
lean_mark_persistent(l_Lean_IR_EmitC_emitSProj___closed__3);
l_Lean_IR_EmitC_emitSProj___closed__4 = _init_l_Lean_IR_EmitC_emitSProj___closed__4();
lean_mark_persistent(l_Lean_IR_EmitC_emitSProj___closed__4);
l_Lean_IR_EmitC_emitFullApp___closed__1 = _init_l_Lean_IR_EmitC_emitFullApp___closed__1();
lean_mark_persistent(l_Lean_IR_EmitC_emitFullApp___closed__1);
l_Lean_IR_EmitC_emitExternCall___closed__1 = _init_l_Lean_IR_EmitC_emitExternCall___closed__1();
lean_mark_persistent(l_Lean_IR_EmitC_emitExternCall___closed__1);
l_Nat_mforAux___main___at_Lean_IR_EmitC_emitPartialApp___spec__1___closed__1 = _init_l_Nat_mforAux___main___at_Lean_IR_EmitC_emitPartialApp___spec__1___closed__1();
lean_mark_persistent(l_Nat_mforAux___main___at_Lean_IR_EmitC_emitPartialApp___spec__1___closed__1);
l_Lean_IR_EmitC_emitPartialApp___closed__1 = _init_l_Lean_IR_EmitC_emitPartialApp___closed__1();

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Expr
// Imports: Init.Lean.Level Init.Lean.KVMap
// Imports: Init.Lean.Level Init.Lean.KVMap Init.Data.HashMap.Default Init.Data.PersistentHashMap.Default
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -21,11 +21,13 @@ uint8_t lean_expr_quick_lt(lean_object*, lean_object*);
lean_object* l_Lean_Expr_hash___boxed(lean_object*);
uint8_t lean_name_dec_eq(lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppFn(lean_object*);
lean_object* l_Lean_ExprStructEq_HasRepr(lean_object*);
lean_object* l_Lean_mkBinApp(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_MData_empty;
lean_object* l_Lean_Expr_constName(lean_object*);
lean_object* lean_expr_mk_sort(lean_object*);
lean_object* l_Lean_Expr_pi___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_expr_update_app(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppRevArgs(lean_object*);
lean_object* l_Lean_Expr_isLambda___boxed(lean_object*);
lean_object* lean_nat_sub(lean_object*, lean_object*);
@ -36,7 +38,9 @@ lean_object* l_Lean_Expr_HasBeq___closed__1;
lean_object* l_Lean_Expr_isAppOfArity___main___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Array_mkArray(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_exprIsInhabited;
lean_object* l_Lean_exprToExprStructEq(lean_object*);
size_t lean_expr_hash(lean_object*);
lean_object* l_Lean_ExprStructEq_Hashable;
lean_object* lean_expr_dbg_to_string(lean_object*);
lean_object* l_Lean_Expr_constName___boxed(lean_object*);
lean_object* l_Lean_mkApp(lean_object*, lean_object*);
@ -44,6 +48,7 @@ lean_object* l_Lean_Expr_instantiate1___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Expr_eqv___boxed(lean_object*, lean_object*);
lean_object* l_Lean_mkDecIsTrue___closed__4;
lean_object* lean_expr_mk_pi(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_ExprStructEq_HasBeq___closed__1;
lean_object* l_Lean_Expr_isBVar___boxed(lean_object*);
lean_object* l_panicWithPos___at_Lean_Expr_constName___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_expr_instantiate(lean_object*, lean_object*);
@ -57,6 +62,7 @@ lean_object* l_Lean_Expr_isAppOf___boxed(lean_object*, lean_object*);
lean_object* lean_expr_mk_let(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_BinderInfo_isInstImplicit___boxed(lean_object*);
lean_object* lean_expr_instantiate1(lean_object*, lean_object*);
lean_object* l_Lean_exprToExprStructEq___boxed(lean_object*);
lean_object* l_Lean_Expr_getAppFn___main(lean_object*);
extern lean_object* l_Lean_Inhabited;
lean_object* l_Lean_mkDecIsFalse___closed__1;
@ -66,9 +72,11 @@ lean_object* l_Array_miterateAux___main___at_Lean_mkApp___spec__1___boxed(lean_o
lean_object* l_Lean_mkDecIsTrue___closed__3;
lean_object* l_Lean_mkConst(lean_object*, lean_object*);
lean_object* l_Lean_Expr_getAppNumArgsAux___main(lean_object*, lean_object*);
lean_object* l_Lean_Expr_equal___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Expr_hasMVar___boxed(lean_object*);
lean_object* l_Lean_Expr_sort___boxed(lean_object*);
lean_object* l_Lean_Expr_HasToString___closed__1;
lean_object* l_Lean_ExprStructEq_HasToString(lean_object*);
lean_object* lean_expr_mk_fvar(lean_object*);
lean_object* l_Array_mkEmpty(lean_object*, lean_object*);
lean_object* l_Array_miterateAux___main___at_Lean_mkApp___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
@ -85,12 +93,15 @@ lean_object* l_Lean_Expr_bvar___boxed(lean_object*);
lean_object* l_Lean_Expr_Hashable___closed__1;
uint8_t lean_expr_eqv(lean_object*, lean_object*);
lean_object* l_Lean_MData_HasEmptyc;
lean_object* l_Lean_ExprStructEq_HasBeq;
lean_object* l_Lean_Expr_constLevels___boxed(lean_object*);
lean_object* l_Lean_Expr_isApp___boxed(lean_object*);
lean_object* l_panicWithPos___at_Lean_Expr_constLevels___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_ExprStructEq_HasRepr___boxed(lean_object*);
lean_object* l_Lean_Expr_bindingDomain(lean_object*);
lean_object* l_Lean_BinderInfo_HasBeq;
lean_object* l_Lean_Expr_dbgToString___boxed(lean_object*);
uint8_t lean_expr_equal(lean_object*, lean_object*);
lean_object* l_Lean_Expr_instantiateRev___boxed(lean_object*, lean_object*);
lean_object* lean_string_append(lean_object*, lean_object*);
lean_object* l_Lean_Expr_constLevels___closed__1;
@ -104,9 +115,12 @@ lean_object* l_Lean_mkDecIsTrue___closed__1;
lean_object* l_Lean_mkBinCApp(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkDecIsFalse(lean_object*, lean_object*);
lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_ExprStructEq_beq___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Expr_lit___boxed(lean_object*);
lean_object* l_Lean_Expr_HasRepr;
lean_object* l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Lean_Expr_updateApp_x21___closed__1;
uint8_t l_Lean_BinderInfo_beq(uint8_t, uint8_t);
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
lean_object* l_Lean_Expr_app___boxed(lean_object*, lean_object*);
@ -121,7 +135,9 @@ lean_object* l_Array_set_x21(lean_object*, lean_object*, lean_object*, lean_obje
lean_object* l_Lean_Expr_fvarName___boxed(lean_object*);
uint8_t l_Lean_BinderInfo_isInstImplicit(uint8_t);
lean_object* l___private_Init_Lean_Expr_2__getAppRevArgsAux(lean_object*, lean_object*);
lean_object* l_Lean_ExprStructEq_hash___boxed(lean_object*);
lean_object* lean_expr_instantiate_rev(lean_object*, lean_object*);
uint8_t l_Lean_ExprStructEq_beq(lean_object*, lean_object*);
lean_object* l_Lean_mkCApp(lean_object*, lean_object*);
lean_object* l_Lean_mkDecIsTrue___closed__5;
lean_object* l_Lean_Expr_hasFVar___boxed(lean_object*);
@ -132,6 +148,7 @@ uint8_t l_Lean_Expr_isBinding(lean_object*);
lean_object* lean_expr_mk_mvar(lean_object*);
uint8_t l_Lean_Expr_isMVar(lean_object*);
lean_object* lean_expr_mk_bvar(lean_object*);
lean_object* l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_bindingDomain___boxed(lean_object*);
lean_object* lean_expr_abstract_range(lean_object*, lean_object*, lean_object*);
lean_object* l_panic(lean_object*, lean_object*, lean_object*);
@ -139,18 +156,22 @@ lean_object* l___private_Init_Lean_Expr_1__getAppArgsAux___main(lean_object*, le
lean_object* l_Lean_Expr_proj___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_BinderInfo_HasBeq___closed__1;
uint8_t lean_expr_lt(lean_object*, lean_object*);
lean_object* l_Lean_Expr_updateApp___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_Expr_isApp(lean_object*);
lean_object* l_Array_size(lean_object*, lean_object*);
lean_object* l_Lean_mkDecIsTrue(lean_object*, lean_object*);
lean_object* l_Array_get(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_abstract___boxed(lean_object*, lean_object*);
uint8_t l_Lean_Expr_isAppOf(lean_object*, lean_object*);
size_t l_Lean_ExprStructEq_hash(lean_object*);
lean_object* l_Lean_Expr_const___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Expr_constLevels(lean_object*);
lean_object* l_Lean_Expr_updateApp_x21(lean_object*, lean_object*, lean_object*);
uint8_t lean_expr_has_mvar(lean_object*);
lean_object* l_Lean_Expr_isFVar___boxed(lean_object*);
lean_object* l_Lean_Expr_abstractRange___boxed(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_fvar___boxed(lean_object*);
lean_object* l_Lean_ExprStructEq_HasToString___boxed(lean_object*);
lean_object* lean_expr_mk_lambda(lean_object*, uint8_t, lean_object*, lean_object*);
lean_object* l_Lean_Expr_mdata___boxed(lean_object*, lean_object*);
lean_object* l_Lean_Expr_bvarIdx___closed__1;
@ -173,6 +194,7 @@ uint8_t l_Lean_Expr_isAppOfArity(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_isForall___boxed(lean_object*);
lean_object* l_Lean_Expr_getAppNumArgsAux(lean_object*, lean_object*);
lean_object* l_Lean_Expr_isMVar___boxed(lean_object*);
lean_object* l_Lean_ExprStructEq_Inhabited;
lean_object* l_panicWithPos___at_Lean_Expr_constName___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_mkDecIsFalse___closed__3;
lean_object* l_Lean_exprIsInhabited___closed__1;
@ -180,6 +202,7 @@ lean_object* lean_expr_mk_lit(lean_object*);
lean_object* l_Lean_mkDecIsFalse___closed__2;
lean_object* l_Lean_Expr_isConst___boxed(lean_object*);
lean_object* l_Lean_Expr_lt___boxed(lean_object*, lean_object*);
lean_object* l_Lean_ExprStructEq_Hashable___closed__1;
uint8_t l_Lean_Expr_isLambda(lean_object*);
lean_object* l_panicWithPos___at_Array_findIdx_x21___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
uint8_t l_Lean_BinderInfo_isInstImplicit(uint8_t x_1) {
@ -641,6 +664,17 @@ x_1 = l_Lean_Expr_HasBeq___closed__1;
return x_1;
}
}
lean_object* l_Lean_Expr_equal___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = lean_expr_equal(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
lean_object* l_Lean_Expr_hasMVar___boxed(lean_object* x_1) {
_start:
{
@ -1318,7 +1352,7 @@ else
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_3 = l_Lean_Expr_constName___closed__1;
x_4 = lean_unsigned_to_nat(190u);
x_4 = lean_unsigned_to_nat(199u);
x_5 = lean_unsigned_to_nat(15u);
x_6 = l_Lean_Expr_constName___closed__2;
x_7 = l_panicWithPos___at_Lean_Expr_constName___spec__1(x_3, x_4, x_5, x_6);
@ -1391,7 +1425,7 @@ else
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_3 = l_Lean_Expr_constName___closed__1;
x_4 = lean_unsigned_to_nat(194u);
x_4 = lean_unsigned_to_nat(203u);
x_5 = lean_unsigned_to_nat(16u);
x_6 = l_Lean_Expr_constLevels___closed__1;
x_7 = l_panicWithPos___at_Lean_Expr_constLevels___spec__1(x_3, x_4, x_5, x_6);
@ -1440,7 +1474,7 @@ else
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_3 = l_Lean_Expr_constName___closed__1;
x_4 = lean_unsigned_to_nat(198u);
x_4 = lean_unsigned_to_nat(207u);
x_5 = lean_unsigned_to_nat(7u);
x_6 = l_Lean_Expr_bvarIdx___closed__1;
x_7 = l_panicWithPos___at_Array_findIdx_x21___spec__1(x_3, x_4, x_5, x_6);
@ -1479,7 +1513,7 @@ else
{
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7;
x_3 = l_Lean_Expr_constName___closed__1;
x_4 = lean_unsigned_to_nat(202u);
x_4 = lean_unsigned_to_nat(211u);
x_5 = lean_unsigned_to_nat(7u);
x_6 = l_Lean_Expr_fvarName___closed__1;
x_7 = l_panicWithPos___at_Lean_Expr_constName___spec__1(x_3, x_4, x_5, x_6);
@ -1751,8 +1785,211 @@ x_4 = l_Lean_mkBinApp(x_3, x_1, x_2);
return x_4;
}
}
lean_object* l_Lean_exprToExprStructEq(lean_object* x_1) {
_start:
{
lean_inc(x_1);
return x_1;
}
}
lean_object* l_Lean_exprToExprStructEq___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_exprToExprStructEq(x_1);
lean_dec(x_1);
return x_2;
}
}
uint8_t l_Lean_ExprStructEq_beq(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3;
x_3 = lean_expr_equal(x_1, x_2);
return x_3;
}
}
lean_object* l_Lean_ExprStructEq_beq___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
uint8_t x_3; lean_object* x_4;
x_3 = l_Lean_ExprStructEq_beq(x_1, x_2);
lean_dec(x_2);
lean_dec(x_1);
x_4 = lean_box(x_3);
return x_4;
}
}
size_t l_Lean_ExprStructEq_hash(lean_object* x_1) {
_start:
{
size_t x_2;
x_2 = lean_expr_hash(x_1);
return x_2;
}
}
lean_object* l_Lean_ExprStructEq_hash___boxed(lean_object* x_1) {
_start:
{
size_t x_2; lean_object* x_3;
x_2 = l_Lean_ExprStructEq_hash(x_1);
lean_dec(x_1);
x_3 = lean_box_usize(x_2);
return x_3;
}
}
lean_object* _init_l_Lean_ExprStructEq_Inhabited() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_exprIsInhabited___closed__1;
return x_1;
}
}
lean_object* _init_l_Lean_ExprStructEq_HasBeq___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_ExprStructEq_beq___boxed), 2, 0);
return x_1;
}
}
lean_object* _init_l_Lean_ExprStructEq_HasBeq() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_ExprStructEq_HasBeq___closed__1;
return x_1;
}
}
lean_object* _init_l_Lean_ExprStructEq_Hashable___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_ExprStructEq_hash___boxed), 1, 0);
return x_1;
}
}
lean_object* _init_l_Lean_ExprStructEq_Hashable() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_ExprStructEq_Hashable___closed__1;
return x_1;
}
}
lean_object* l_Lean_ExprStructEq_HasToString(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_expr_dbg_to_string(x_1);
return x_2;
}
}
lean_object* l_Lean_ExprStructEq_HasToString___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_ExprStructEq_HasToString(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* l_Lean_ExprStructEq_HasRepr(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = lean_expr_dbg_to_string(x_1);
return x_2;
}
}
lean_object* l_Lean_ExprStructEq_HasRepr___boxed(lean_object* x_1) {
_start:
{
lean_object* x_2;
x_2 = l_Lean_ExprStructEq_HasRepr(x_1);
lean_dec(x_1);
return x_2;
}
}
lean_object* l_Lean_Expr_updateApp___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
x_5 = lean_expr_update_app(x_1, x_2, x_3, x_4);
return x_5;
}
}
lean_object* l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_5 = l_panicWithPos___rarg___closed__1;
x_6 = lean_string_append(x_5, x_1);
x_7 = l_panicWithPos___rarg___closed__2;
x_8 = lean_string_append(x_6, x_7);
x_9 = l_Nat_repr(x_2);
x_10 = lean_string_append(x_8, x_9);
lean_dec(x_9);
x_11 = l_panicWithPos___rarg___closed__2;
x_12 = lean_string_append(x_10, x_11);
x_13 = l_Nat_repr(x_3);
x_14 = lean_string_append(x_12, x_13);
lean_dec(x_13);
x_15 = l_panicWithPos___rarg___closed__3;
x_16 = lean_string_append(x_14, x_15);
x_17 = lean_string_append(x_16, x_4);
x_18 = l_Lean_exprIsInhabited;
x_19 = lean_panic_fn(x_17);
return x_19;
}
}
lean_object* _init_l_Lean_Expr_updateApp_x21___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_mk_string("application expected");
return x_1;
}
}
lean_object* l_Lean_Expr_updateApp_x21(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
_start:
{
if (lean_obj_tag(x_1) == 5)
{
lean_object* x_4;
x_4 = lean_expr_update_app(x_1, x_2, x_3, lean_box(0));
return x_4;
}
else
{
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
lean_dec(x_3);
lean_dec(x_2);
lean_dec(x_1);
x_5 = l_Lean_Expr_constName___closed__1;
x_6 = lean_unsigned_to_nat(304u);
x_7 = lean_unsigned_to_nat(7u);
x_8 = l_Lean_Expr_updateApp_x21___closed__1;
x_9 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_5, x_6, x_7, x_8);
return x_9;
}
}
}
lean_object* l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
x_5 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_1, x_2, x_3, x_4);
lean_dec(x_4);
lean_dec(x_1);
return x_5;
}
}
lean_object* initialize_Init_Lean_Level(lean_object*);
lean_object* initialize_Init_Lean_KVMap(lean_object*);
lean_object* initialize_Init_Data_HashMap_Default(lean_object*);
lean_object* initialize_Init_Data_PersistentHashMap_Default(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Expr(lean_object* w) {
lean_object * res;
@ -1764,6 +2001,12 @@ lean_dec_ref(res);
res = initialize_Init_Lean_KVMap(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Data_HashMap_Default(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Data_PersistentHashMap_Default(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_BinderInfo_HasBeq___closed__1 = _init_l_Lean_BinderInfo_HasBeq___closed__1();
lean_mark_persistent(l_Lean_BinderInfo_HasBeq___closed__1);
l_Lean_BinderInfo_HasBeq = _init_l_Lean_BinderInfo_HasBeq();
@ -1816,6 +2059,18 @@ l_Lean_mkDecIsFalse___closed__2 = _init_l_Lean_mkDecIsFalse___closed__2();
lean_mark_persistent(l_Lean_mkDecIsFalse___closed__2);
l_Lean_mkDecIsFalse___closed__3 = _init_l_Lean_mkDecIsFalse___closed__3();
lean_mark_persistent(l_Lean_mkDecIsFalse___closed__3);
l_Lean_ExprStructEq_Inhabited = _init_l_Lean_ExprStructEq_Inhabited();
lean_mark_persistent(l_Lean_ExprStructEq_Inhabited);
l_Lean_ExprStructEq_HasBeq___closed__1 = _init_l_Lean_ExprStructEq_HasBeq___closed__1();
lean_mark_persistent(l_Lean_ExprStructEq_HasBeq___closed__1);
l_Lean_ExprStructEq_HasBeq = _init_l_Lean_ExprStructEq_HasBeq();
lean_mark_persistent(l_Lean_ExprStructEq_HasBeq);
l_Lean_ExprStructEq_Hashable___closed__1 = _init_l_Lean_ExprStructEq_Hashable___closed__1();
lean_mark_persistent(l_Lean_ExprStructEq_Hashable___closed__1);
l_Lean_ExprStructEq_Hashable = _init_l_Lean_ExprStructEq_Hashable();
lean_mark_persistent(l_Lean_ExprStructEq_Hashable);
l_Lean_Expr_updateApp_x21___closed__1 = _init_l_Lean_Expr_updateApp_x21___closed__1();
lean_mark_persistent(l_Lean_Expr_updateApp_x21___closed__1);
return lean_mk_io_result(lean_box(0));
}
#ifdef __cplusplus

View file

@ -1,6 +1,6 @@
// Lean compiler output
// Module: Init.Lean.Level
// Imports: Init.Data.Option.Basic Init.Lean.Name Init.Lean.Format
// Imports: Init.Data.Option.Basic Init.Lean.Name Init.Lean.Format Init.Data.HashMap.Default Init.Data.PersistentHashMap.Default
#include "runtime/lean.h"
#if defined(__clang__)
#pragma clang diagnostic ignored "-Wunused-parameter"
@ -88,6 +88,8 @@ lean_object* l_Lean_LevelToFormat_Result_format___boxed(lean_object*, lean_objec
lean_object* l_Lean_Level_toNat___main___closed__1;
lean_object* l_Lean_LevelToFormat_Result_imax(lean_object*, lean_object*);
lean_object* l_Lean_Level_addOffsetAux___main(lean_object*, lean_object*);
lean_object* l_Lean_Level_hashable___closed__1;
lean_object* l_Lean_Level_hashable;
lean_object* l_Lean_Level_addOffset(lean_object*, lean_object*);
lean_object* l_Lean_Level_hasMVar___main___boxed(lean_object*);
lean_object* l_Lean_Level_succ___boxed(lean_object*);
@ -818,6 +820,22 @@ x_3 = lean_box_usize(x_2);
return x_3;
}
}
lean_object* _init_l_Lean_Level_hashable___closed__1() {
_start:
{
lean_object* x_1;
x_1 = lean_alloc_closure((void*)(l_Lean_Level_hash___boxed), 1, 0);
return x_1;
}
}
lean_object* _init_l_Lean_Level_hashable() {
_start:
{
lean_object* x_1;
x_1 = l_Lean_Level_hashable___closed__1;
return x_1;
}
}
lean_object* l_Lean_Level_beq___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{
@ -1489,6 +1507,8 @@ return x_1;
lean_object* initialize_Init_Data_Option_Basic(lean_object*);
lean_object* initialize_Init_Lean_Name(lean_object*);
lean_object* initialize_Init_Lean_Format(lean_object*);
lean_object* initialize_Init_Data_HashMap_Default(lean_object*);
lean_object* initialize_Init_Data_PersistentHashMap_Default(lean_object*);
static bool _G_initialized = false;
lean_object* initialize_Init_Lean_Level(lean_object* w) {
lean_object * res;
@ -1503,6 +1523,12 @@ lean_dec_ref(res);
res = initialize_Init_Lean_Format(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Data_HashMap_Default(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
res = initialize_Init_Data_PersistentHashMap_Default(lean_io_mk_world());
if (lean_io_result_is_error(res)) return res;
lean_dec_ref(res);
l_Lean_levelIsInhabited = _init_l_Lean_levelIsInhabited();
lean_mark_persistent(l_Lean_levelIsInhabited);
l_Lean_Level_one___closed__1 = _init_l_Lean_Level_one___closed__1();
@ -1511,6 +1537,10 @@ l_Lean_Level_one = _init_l_Lean_Level_one();
lean_mark_persistent(l_Lean_Level_one);
l_Lean_Level_toNat___main___closed__1 = _init_l_Lean_Level_toNat___main___closed__1();
lean_mark_persistent(l_Lean_Level_toNat___main___closed__1);
l_Lean_Level_hashable___closed__1 = _init_l_Lean_Level_hashable___closed__1();
lean_mark_persistent(l_Lean_Level_hashable___closed__1);
l_Lean_Level_hashable = _init_l_Lean_Level_hashable();
lean_mark_persistent(l_Lean_Level_hashable);
l_Lean_HasBeq___closed__1 = _init_l_Lean_HasBeq___closed__1();
lean_mark_persistent(l_Lean_HasBeq___closed__1);
l_Lean_HasBeq = _init_l_Lean_HasBeq();

View file

@ -655,6 +655,7 @@ lean_object* l_Lean_Parser_Term_subtype___elambda__1___rarg___closed__5;
lean_object* l_Lean_Parser_Term_structInstField___closed__4;
lean_object* l_Lean_Parser_Term_forall___closed__4;
lean_object* l_Lean_Parser_Term_bind___elambda__1___closed__1;
extern lean_object* l_PersistentArray_Stats_toString___closed__4;
lean_object* l_Lean_Parser_Term_mapConst___closed__1;
lean_object* l_Lean_Parser_Term_uminus___elambda__1(lean_object*);
lean_object* l_Lean_Parser_Term_app___closed__2;
@ -780,7 +781,6 @@ lean_object* l_Lean_Parser_Term_typeAscription___elambda__1(lean_object*);
lean_object* l_Lean_Parser_Term_type___elambda__1___rarg___closed__2;
lean_object* l_Lean_Parser_Term_binderType___closed__3;
lean_object* l_Lean_Parser_Term_fun___elambda__1___closed__5;
extern lean_object* l_PersistentHashMap_Stats_toString___closed__5;
lean_object* l_Lean_Parser_Term_letIdDecl___closed__1;
lean_object* l_Lean_Parser_Term_doPat;
lean_object* l_Lean_Parser_Term_emptyC___elambda__1___boxed(lean_object*);
@ -2407,7 +2407,7 @@ lean_object* _init_l_Lean_Parser_Term_explicitUniv___elambda__1___closed__7() {
_start:
{
lean_object* x_1; lean_object* x_2;
x_1 = l_PersistentHashMap_Stats_toString___closed__5;
x_1 = l_PersistentArray_Stats_toString___closed__4;
x_2 = l_String_trim(x_1);
return x_2;
}

View file

@ -13,7 +13,6 @@
#ifdef __cplusplus
extern "C" {
#endif
lean_object* l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_TypeClass_Context_slowWhnf(lean_object*);
uint8_t l_Lean_TypeClass_Context_eHasETmpMVar(lean_object*);
lean_object* l_Lean_TypeClass_Context_eHasTmpMVar___closed__1;
@ -53,7 +52,6 @@ lean_object* level_mk_mvar(lean_object*);
lean_object* l_Lean_TypeClass_Context_eFind___main___boxed(lean_object*, lean_object*);
lean_object* lean_expr_mk_app(lean_object*, lean_object*);
lean_object* l_Lean_TypeClass_Context_eInferIdx(lean_object*, lean_object*);
lean_object* l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_Expr_bindingBody(lean_object*);
lean_object* l_Lean_TypeClass_Context_uInstantiate___boxed(lean_object*, lean_object*);
size_t l_USize_sub(size_t, size_t);
@ -123,6 +121,7 @@ lean_object* l_Lean_TypeClass_Context_eAssignIdx___boxed(lean_object*, lean_obje
lean_object* l_Nat_mforAux___main___at_Lean_TypeClass_Context_eUnify___main___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_name_mk_string(lean_object*, lean_object*);
uint8_t l_List_foldr___main___at_Lean_TypeClass_Context_eHasTmpMVar___spec__1(uint8_t, lean_object*);
lean_object* l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_PersistentArray_getAux___main___at_Lean_TypeClass_Context_eInferIdx___spec__2___boxed(lean_object*, lean_object*, lean_object*);
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_Lean_TypeClass_Context_slowWhnfApp___main___boxed(lean_object*, lean_object*, lean_object*);
@ -713,30 +712,6 @@ lean_dec(x_1);
return x_3;
}
}
lean_object* l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19;
x_5 = l_panicWithPos___rarg___closed__1;
x_6 = lean_string_append(x_5, x_1);
x_7 = l_panicWithPos___rarg___closed__2;
x_8 = lean_string_append(x_6, x_7);
x_9 = l_Nat_repr(x_2);
x_10 = lean_string_append(x_8, x_9);
lean_dec(x_9);
x_11 = l_panicWithPos___rarg___closed__2;
x_12 = lean_string_append(x_10, x_11);
x_13 = l_Nat_repr(x_3);
x_14 = lean_string_append(x_12, x_13);
lean_dec(x_13);
x_15 = l_panicWithPos___rarg___closed__3;
x_16 = lean_string_append(x_14, x_15);
x_17 = lean_string_append(x_16, x_4);
x_18 = l_Lean_exprIsInhabited;
x_19 = lean_panic_fn(x_17);
return x_19;
}
}
lean_object* _init_l_Lean_TypeClass_Context_eInfer___closed__1() {
_start:
{
@ -766,7 +741,7 @@ x_4 = l_Lean_TypeClass_Context_eInfer___closed__1;
x_5 = lean_unsigned_to_nat(70u);
x_6 = lean_unsigned_to_nat(14u);
x_7 = l_Lean_TypeClass_Context_eInfer___closed__2;
x_8 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_4, x_5, x_6, x_7);
x_8 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_4, x_5, x_6, x_7);
return x_8;
}
else
@ -784,16 +759,6 @@ return x_11;
}
}
}
lean_object* l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
_start:
{
lean_object* x_5;
x_5 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_1, x_2, x_3, x_4);
lean_dec(x_4);
lean_dec(x_1);
return x_5;
}
}
lean_object* l_Lean_TypeClass_Context_eInfer___boxed(lean_object* x_1, lean_object* x_2) {
_start:
{

View file

@ -44,7 +44,6 @@ uint8_t l_Lean_Level_hasMVar___main(lean_object*);
lean_object* l_Lean_TypeClass_newAnswer(lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_TypeClass_synthCore___main___closed__1;
lean_object* lean_expr_mk_app(lean_object*, lean_object*);
lean_object* l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_TypeClass_wakeUp(lean_object*, lean_object*, lean_object*);
size_t l_USize_sub(size_t, size_t);
lean_object* lean_expr_instantiate1(lean_object*, lean_object*);
@ -109,6 +108,7 @@ lean_object* l_List_append___rarg(lean_object*, lean_object*);
lean_object* l_Array_miterateAux___main___at_Lean_TypeClass_consume___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* lean_name_mk_string(lean_object*, lean_object*);
lean_object* l_Lean_TypeClass_collectEReplacements___main___closed__2;
lean_object* l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
lean_object* l_Lean_TypeClass_ConsumerNode_Inhabited___closed__1;
lean_object* lean_nat_add(lean_object*, lean_object*);
lean_object* l_PersistentHashMap_insert___at_Lean_TypeClass_newSubgoal___spec__2(lean_object*, lean_object*, lean_object*);
@ -4495,7 +4495,7 @@ x_70 = l_Lean_TypeClass_collectEReplacements___main___closed__1;
x_71 = lean_unsigned_to_nat(284u);
x_72 = lean_unsigned_to_nat(16u);
x_73 = l_Lean_TypeClass_preprocessForOutParams___closed__1;
x_74 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_70, x_71, x_72, x_73);
x_74 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_70, x_71, x_72, x_73);
lean_inc(x_12);
lean_inc(x_11);
x_75 = l_Lean_TypeClass_collectEReplacements___main(x_11, x_12, x_74, x_37, x_32, x_6, x_6);
@ -4628,7 +4628,7 @@ x_108 = l_Lean_TypeClass_collectEReplacements___main___closed__1;
x_109 = lean_unsigned_to_nat(284u);
x_110 = lean_unsigned_to_nat(16u);
x_111 = l_Lean_TypeClass_preprocessForOutParams___closed__1;
x_112 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_108, x_109, x_110, x_111);
x_112 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_108, x_109, x_110, x_111);
lean_inc(x_12);
lean_inc(x_11);
x_113 = l_Lean_TypeClass_collectEReplacements___main(x_11, x_12, x_112, x_37, x_32, x_6, x_6);
@ -4860,7 +4860,7 @@ x_163 = l_Lean_TypeClass_collectEReplacements___main___closed__1;
x_164 = lean_unsigned_to_nat(284u);
x_165 = lean_unsigned_to_nat(16u);
x_166 = l_Lean_TypeClass_preprocessForOutParams___closed__1;
x_167 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_163, x_164, x_165, x_166);
x_167 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_163, x_164, x_165, x_166);
lean_inc(x_119);
lean_inc(x_118);
x_168 = l_Lean_TypeClass_collectEReplacements___main(x_118, x_119, x_167, x_145, x_140, x_6, x_6);
@ -4946,7 +4946,7 @@ x_186 = l_Lean_TypeClass_collectEReplacements___main___closed__1;
x_187 = lean_unsigned_to_nat(284u);
x_188 = lean_unsigned_to_nat(16u);
x_189 = l_Lean_TypeClass_preprocessForOutParams___closed__1;
x_190 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_186, x_187, x_188, x_189);
x_190 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_186, x_187, x_188, x_189);
lean_inc(x_119);
lean_inc(x_118);
x_191 = l_Lean_TypeClass_collectEReplacements___main(x_118, x_119, x_190, x_145, x_140, x_6, x_6);
@ -5153,7 +5153,7 @@ x_245 = l_Lean_TypeClass_collectEReplacements___main___closed__1;
x_246 = lean_unsigned_to_nat(284u);
x_247 = lean_unsigned_to_nat(16u);
x_248 = l_Lean_TypeClass_preprocessForOutParams___closed__1;
x_249 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_245, x_246, x_247, x_248);
x_249 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_245, x_246, x_247, x_248);
lean_inc(x_198);
lean_inc(x_197);
x_250 = l_Lean_TypeClass_collectEReplacements___main(x_197, x_198, x_249, x_227, x_222, x_6, x_6);
@ -5239,7 +5239,7 @@ x_268 = l_Lean_TypeClass_collectEReplacements___main___closed__1;
x_269 = lean_unsigned_to_nat(284u);
x_270 = lean_unsigned_to_nat(16u);
x_271 = l_Lean_TypeClass_preprocessForOutParams___closed__1;
x_272 = l_panicWithPos___at_Lean_TypeClass_Context_eInfer___spec__1(x_268, x_269, x_270, x_271);
x_272 = l_panicWithPos___at_Lean_Expr_updateApp_x21___spec__1(x_268, x_269, x_270, x_271);
lean_inc(x_198);
lean_inc(x_197);
x_273 = l_Lean_TypeClass_collectEReplacements___main(x_197, x_198, x_272, x_227, x_222, x_6, x_6);