diff --git a/stage0/src/Init/Notation.lean b/stage0/src/Init/Notation.lean index 81329a1584..13f38a31f6 100644 --- a/stage0/src/Init/Notation.lean +++ b/stage0/src/Init/Notation.lean @@ -335,7 +335,7 @@ syntax (name := change) "change " term (location)? : tactic syntax (name := changeWith) "change " term " with " term (location)? : tactic syntax rwRule := ("← " <|> "<- ")? term -syntax rwRuleSeq := "[" rwRule,+,? "]" +syntax rwRuleSeq := "[" rwRule,*,? "]" syntax (name := rewriteSeq) "rewrite " (config)? rwRuleSeq (location)? : tactic diff --git a/stage0/src/Lean/Elab/Do.lean b/stage0/src/Lean/Elab/Do.lean index 35da6b130c..b324d61470 100644 --- a/stage0/src/Lean/Elab/Do.lean +++ b/stage0/src/Lean/Elab/Do.lean @@ -603,22 +603,28 @@ def getDoLetVars (doLet : Syntax) : TermElabM (Array Name) := -- leading_parser "let " >> optional "mut " >> letDecl getLetDeclVars doLet[2] -def getDoHaveVar (doHave : Syntax) : Name := - /- - `leading_parser "have " >> Term.haveDecl` - where - ``` - haveDecl := leading_parser optIdent >> termParser >> (haveAssign <|> fromTerm <|> byTactic) - optIdent := optional (try (ident >> " : ")) - - ``` - -/ - let optIdent := doHave[1][0] +def getHaveIdLhsVar (optIdent : Syntax) : Name := if optIdent.isNone then `this else optIdent[0].getId +def getDoHaveVars (doHave : Syntax) : TermElabM (Array Name) := + -- doHave := leading_parser "have " >> Term.haveDecl + -- haveDecl := leading_parser haveIdDecl <|> letPatDecl <|> haveEqnsDecl + let arg := doHave[1][0] + if arg.getKind == ``Lean.Parser.Term.haveIdDecl then + -- haveIdDecl := leading_parser atomic (haveIdLhs >> " := ") >> termParser + -- haveIdLhs := optional (ident >> many (ppSpace >> (simpleBinderWithoutType <|> bracketedBinder))) >> optType + pure #[getHaveIdLhsVar arg[0]] + else if arg.getKind == ``Lean.Parser.Term.letPatDecl then + getLetPatDeclVars arg + else if arg.getKind == ``Lean.Parser.Term.haveEqnsDecl then + -- haveEqnsDecl := leading_parser haveIdLhs >> matchAlts + pure #[getHaveIdLhsVar arg[0]] + else + throwError "unexpected kind of have declaration" + def getDoLetRecVars (doLetRec : Syntax) : TermElabM (Array Name) := do -- letRecDecls is an array of `(group (optional attributes >> letDecl))` let letRecDecls := doLetRec[1][0].getSepArgs @@ -1530,9 +1536,9 @@ mutual checkNotShadowingMutable vars mkVarDeclCore vars doElem <$> withNewMutableVars vars (isMutableLet doElem) (doSeqToCode doElems) else if k == ``Lean.Parser.Term.doHave then - let var := getDoHaveVar doElem - checkNotShadowingMutable #[var] - mkVarDeclCore #[var] doElem <$> (doSeqToCode doElems) + let vars ← getDoHaveVars doElem + checkNotShadowingMutable vars + mkVarDeclCore vars doElem <$> (doSeqToCode doElems) else if k == ``Lean.Parser.Term.doLetRec then let vars ← getDoLetRecVars doElem checkNotShadowingMutable vars diff --git a/stage0/src/Lean/Elab/PreDefinition/Basic.lean b/stage0/src/Lean/Elab/PreDefinition/Basic.lean index e802b54920..d62ca38b42 100644 --- a/stage0/src/Lean/Elab/PreDefinition/Basic.lean +++ b/stage0/src/Lean/Elab/PreDefinition/Basic.lean @@ -129,16 +129,20 @@ def addNonRec (preDef : PreDefinition) : TermElabM Unit := do /-- Eliminate recursive application annotations containing syntax. These annotations are used by the well-founded recursion module to produce better error messages. -/ -def eraseRecAppSyntax (e : Expr) : CoreM Expr := +def eraseRecAppSyntaxExpr (e : Expr) : CoreM Expr := Core.transform e (post := fun e => TransformStep.done <| if (getRecAppSyntax? e).isSome then e.mdataExpr! else e) -def addAndCompileUnsafe (preDefs : Array PreDefinition) (safety := DefinitionSafety.unsafe) : TermElabM Unit := +def eraseRecAppSyntax (preDef : PreDefinition) : CoreM PreDefinition := + return { preDef with value := (← eraseRecAppSyntaxExpr preDef.value) } + +def addAndCompileUnsafe (preDefs : Array PreDefinition) (safety := DefinitionSafety.unsafe) : TermElabM Unit := do + let preDefs ← preDefs.mapM fun d => eraseRecAppSyntax d withRef preDefs[0].ref do let decl := Declaration.mutualDefnDecl <| ← preDefs.toList.mapM fun preDef => return { name := preDef.declName levelParams := preDef.levelParams type := preDef.type - value := (← eraseRecAppSyntax preDef.value) + value := preDef.value safety := safety hints := ReducibilityHints.opaque } diff --git a/stage0/src/Lean/Elab/PreDefinition/Structural/Main.lean b/stage0/src/Lean/Elab/PreDefinition/Structural/Main.lean index 02c64db037..1ef5fdd13a 100644 --- a/stage0/src/Lean/Elab/PreDefinition/Structural/Main.lean +++ b/stage0/src/Lean/Elab/PreDefinition/Structural/Main.lean @@ -81,11 +81,13 @@ def structuralRecursion (preDefs : Array PreDefinition) : TermElabM Unit := throwError "structural recursion does not handle mutually recursive functions" else do let ((recArgPos, preDefNonRec), state) ← run <| elimRecursion preDefs[0] + let preDefNonRec ← eraseRecAppSyntax preDefNonRec + let preDef ← eraseRecAppSyntax preDefs[0] state.addMatchers.forM liftM mapError (addNonRec preDefNonRec) (fun msg => m!"structural recursion failed, produced type incorrect term{indentD msg}") - addAndCompilePartialRec preDefs - addSmartUnfoldingDef preDefs[0] recArgPos - registerEqnsInfo preDefs[0] recArgPos + addAndCompilePartialRec #[preDef] + addSmartUnfoldingDef preDef recArgPos + registerEqnsInfo preDef recArgPos builtin_initialize registerTraceClass `Elab.definition.structural diff --git a/stage0/src/Lean/Elab/PreDefinition/WF/Main.lean b/stage0/src/Lean/Elab/PreDefinition/WF/Main.lean index a3b553d01b..5d03771565 100644 --- a/stage0/src/Lean/Elab/PreDefinition/WF/Main.lean +++ b/stage0/src/Lean/Elab/PreDefinition/WF/Main.lean @@ -56,6 +56,7 @@ def wfRecursion (preDefs : Array PreDefinition) (wfStx? : Option Syntax) (decrTa let preDefNonRec ← withoutModifyingEnv do addAsAxiom unaryPreDef mkFix unaryPreDef wfRel decrTactic? + let preDefNonRec ← eraseRecAppSyntax preDefNonRec trace[Elab.definition.wf] ">> {preDefNonRec.declName}" addNonRec preDefNonRec addNonRecPreDefs preDefs preDefNonRec diff --git a/stage0/stdlib/Init/Notation.c b/stage0/stdlib/Init/Notation.c index caf1abc203..10f78695f0 100644 --- a/stage0/stdlib/Init/Notation.c +++ b/stage0/stdlib/Init/Notation.c @@ -35037,7 +35037,7 @@ x_1 = l_Lean_Parser_Tactic_rwRule; x_2 = l___aux__Init__Notation______macroRules__stx___x3c_x7c_x3e____1___closed__7; x_3 = l_term_x5b___x5d___closed__6; x_4 = 1; -x_5 = lean_alloc_ctor(11, 3, 1); +x_5 = lean_alloc_ctor(10, 3, 1); lean_ctor_set(x_5, 0, x_1); lean_ctor_set(x_5, 1, x_2); lean_ctor_set(x_5, 2, x_3); diff --git a/stage0/stdlib/Init/System/IO.c b/stage0/stdlib/Init/System/IO.c index 65d00b8572..20cdc8d68a 100644 --- a/stage0/stdlib/Init/System/IO.c +++ b/stage0/stdlib/Init/System/IO.c @@ -4301,11 +4301,11 @@ x_3 = lean_ctor_get(x_1, 0); x_4 = lean_ctor_get_uint32(x_1, sizeof(void*)*1); x_5 = lean_ctor_get(x_2, 0); x_6 = lean_ctor_get_uint32(x_2, sizeof(void*)*1); -x_7 = lean_uint32_dec_lt(x_4, x_6); +x_7 = lean_int_dec_lt(x_3, x_5); if (x_7 == 0) { uint8_t x_8; -x_8 = lean_uint32_dec_eq(x_4, x_6); +x_8 = lean_int_dec_eq(x_3, x_5); if (x_8 == 0) { uint8_t x_9; @@ -4315,11 +4315,11 @@ return x_9; else { uint8_t x_10; -x_10 = lean_int_dec_lt(x_3, x_5); +x_10 = lean_uint32_dec_lt(x_4, x_6); if (x_10 == 0) { uint8_t x_11; -x_11 = lean_int_dec_eq(x_3, x_5); +x_11 = lean_uint32_dec_eq(x_4, x_6); if (x_11 == 0) { uint8_t x_12; diff --git a/stage0/stdlib/Lean/Elab/Do.c b/stage0/stdlib/Lean/Elab/Do.c index c8bc4a9be6..df57a07b17 100644 --- a/stage0/stdlib/Lean/Elab/Do.c +++ b/stage0/stdlib/Lean/Elab/Do.c @@ -145,6 +145,7 @@ static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_liftMethodForbidd static lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__29; lean_object* l_Lean_SourceInfo_fromRef(lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__5; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_Kind_noConfusion___rarg___lambda__1(lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__8___boxed(lean_object**); @@ -231,6 +232,7 @@ static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__2 LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getPatternsVarsEx(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_getPatternVarsEx___spec__1___boxed(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_mkNestedKind___closed__2; +static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__3; LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at___aux__Init__Notation______macroRules__precMax__1___spec__1(lean_object*, lean_object*); LEAN_EXPORT uint8_t l_Lean_Elab_Term_Do_hasBreakContinue___lambda__1(lean_object*); @@ -313,6 +315,7 @@ lean_object* l_Lean_Elab_Term_getMainModule___rarg(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Term_Do_concat___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkUnit___closed__6; uint8_t lean_usize_dec_lt(size_t, size_t); +static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__6; static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__27; LEAN_EXPORT lean_object* l_Array_sequenceMap_loop___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_expandDoIf_x3f___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__35; @@ -513,6 +516,7 @@ static lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__4___closed static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__22; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_instInhabitedAlt___rarg(lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_addFreshJP___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__2; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_mkIte___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkPureUnit___closed__2; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -539,6 +543,7 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_actionTerminalToTerm___closed__16 static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doReassignArrowToCode___lambda__1___closed__3; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_homogenize(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__29; +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_hasExitPoint(lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_hasReturn(lean_object*); @@ -548,6 +553,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Term_Do_ToCodeBlo lean_object* l_Lean_replaceRef(lean_object*, lean_object*); lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_matchNestedTermResult___closed__10; +static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__1; LEAN_EXPORT lean_object* l_Array_foldrMUnsafe_fold___at_Lean_Elab_Term_Do_attachJPs___spec__1(lean_object*, size_t, size_t, lean_object*); static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkUnit___closed__9; static lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___spec__2___closed__5; @@ -616,6 +622,7 @@ static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkUnit___close static lean_object* l_Lean_Elab_Term_Do_ToTerm_declToTerm___closed__4; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__12(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at_Lean_Elab_Term_Do_ToCodeBlock_tryCatchPred___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___closed__4; static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doForToCode___lambda__1___closed__30; static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__20; static lean_object* l_Lean_Elab_Term_Do_concat___closed__1; @@ -651,6 +658,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Term_Do_mkJmp___s lean_object* l_Lean_Macro_throwErrorAt___rarg(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Environment_contains(lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_toDoElem___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_Do_pullExitPointsAux___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_ToCodeBlock_doMatchToCode___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_expandOptType(lean_object*, lean_object*); @@ -690,6 +698,7 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_mkNestedKind___closed__1; LEAN_EXPORT lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_seqToTerm___closed__10; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_checkLetArrowRHS(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar(lean_object*); static lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__8___closed__14; LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_ToTerm_mkUVarTuple___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getLetEqnsDeclVar___boxed(lean_object*); @@ -702,7 +711,6 @@ uint8_t l_Array_isEmpty___rarg(lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_seqToTerm___closed__5; LEAN_EXPORT lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___boxed(lean_object*); static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_mkMonadAlias___closed__1; static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__3; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkSingletonDoSeq(lean_object*); @@ -712,7 +720,6 @@ extern lean_object* l_Lean_instInhabitedSyntax; static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doForToCode___lambda__1___closed__11; LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkReassignCore___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__23; -static lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___closed__1; LEAN_EXPORT lean_object* l_Lean_throwError___at_Lean_Elab_Term_Do_concat___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Std_RBNode_erase___at_Lean_Elab_Term_Do_eraseVars___spec__2___boxed(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__3(uint8_t, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -843,7 +850,7 @@ LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__L LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_pullExitPointsAux___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__8___closed__10; static lean_object* l_Lean_Elab_Term_Do_ToTerm_breakToTerm___closed__15; -LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28011_(lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28082_(lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___lambda__1___closed__1; static lean_object* l_Lean_Elab_Term_Do_pullExitPointsAux___lambda__1___closed__9; static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___closed__3; @@ -1089,7 +1096,6 @@ lean_object* lean_panic_fn(lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__39; static lean_object* l_Lean_Elab_Term_Do_ToTerm_reassignToTerm___closed__5; static lean_object* l___regBuiltin_Lean_Elab_Term_expandTermTry_declRange___closed__7; -LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar(lean_object*); static lean_object* l_Lean_Elab_Term_Do_getLetDeclVars___closed__2; LEAN_EXPORT uint8_t l_Lean_Elab_Term_Do_hasExitPoint___lambda__1(lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -1198,6 +1204,7 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_reassignToTerm___closed__4; LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_ToCodeBlock_expandLiftMethodAux___spec__2(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_simp_macro_scopes(lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_hasTerminalAction___lambda__1___boxed(lean_object*); +static lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2; static lean_object* l_Lean_Elab_Term_Do_ToTerm_actionTerminalToTerm___closed__17; static lean_object* l_Lean_Elab_Term_Do_instInhabitedCode___closed__1; LEAN_EXPORT lean_object* l_Lean_Elab_Term_expandTermUnless(lean_object*, lean_object*, lean_object*); @@ -1212,6 +1219,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_ToTerm_mkNestedKind(uint8_t, uint8_ static lean_object* l___regBuiltin_Lean_Elab_Term_expandTermFor_declRange___closed__5; static lean_object* l_Lean_Elab_Term_Do_ToTerm_reassignToTerm___closed__2; static lean_object* l_Lean_Elab_Term_Do_ToTerm_matchNestedTermResult___closed__23; +static lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1; uint8_t l_List_isEmpty___rarg(lean_object*); static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_Do_ToCodeBlock_checkReassignable___spec__2___closed__1; static lean_object* l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__7; @@ -1234,6 +1242,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoLetArrowVars(lean_object*, lea static lean_object* l_Lean_Elab_Term_Do_CodeBlocl_toMessageData_loop___closed__19; static lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_Do_ToCodeBlock_checkReassignable___spec__2___closed__2; static lean_object* l_Lean_Elab_Term_Do_ToCodeBlock_doForToCode___closed__3; +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___boxed(lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_mkAuxDeclFor___rarg___lambda__10(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__2; static lean_object* l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__2; @@ -1253,7 +1262,6 @@ static lean_object* l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__27; static lean_object* l___regBuiltin_Lean_Elab_Term_Do_elabDo_declRange___closed__4; static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_ToCodeBlock_doTryToCode___spec__3___closed__10; lean_object* l_Lean_MonadRef_mkInfoFromRefPos___rarg(lean_object*, lean_object*); -static lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___closed__2; static lean_object* l_Lean_Elab_Term_Do_ToTerm_mkIte___closed__4; LEAN_EXPORT uint8_t l___private_Lean_Elab_Do_0__Lean_Elab_Term_liftMethodDelimiter(lean_object*); static lean_object* l_Lean_Elab_Term_Do_getDoReassignVars___closed__1; @@ -11847,7 +11855,7 @@ lean_dec(x_1); return x_9; } } -static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__1() { +static lean_object* _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1() { _start: { lean_object* x_1; @@ -11855,53 +11863,199 @@ x_1 = lean_mk_string("this"); return x_1; } } -static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__2() { +static lean_object* _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2() { _start: { lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_box(0); -x_2 = l_Lean_Elab_Term_Do_getDoHaveVar___closed__1; +x_2 = l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1; x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } -LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar(lean_object* x_1) { +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; -x_2 = lean_unsigned_to_nat(1u); -x_3 = l_Lean_Syntax_getArg(x_1, x_2); -x_4 = lean_unsigned_to_nat(0u); -x_5 = l_Lean_Syntax_getArg(x_3, x_4); -lean_dec(x_3); -x_6 = l_Lean_Syntax_isNone(x_5); -if (x_6 == 0) +uint8_t x_2; +x_2 = l_Lean_Syntax_isNone(x_1); +if (x_2 == 0) { -lean_object* x_7; lean_object* x_8; -x_7 = l_Lean_Syntax_getArg(x_5, x_4); -lean_dec(x_5); -x_8 = l_Lean_Syntax_getId(x_7); -lean_dec(x_7); -return x_8; +lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_3 = lean_unsigned_to_nat(0u); +x_4 = l_Lean_Syntax_getArg(x_1, x_3); +x_5 = l_Lean_Syntax_getId(x_4); +lean_dec(x_4); +return x_5; } else { -lean_object* x_9; -lean_dec(x_5); -x_9 = l_Lean_Elab_Term_Do_getDoHaveVar___closed__2; -return x_9; +lean_object* x_6; +x_6 = l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2; +return x_6; } } } -LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVar___boxed(lean_object* x_1) { +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getHaveIdLhsVar___boxed(lean_object* x_1) { _start: { lean_object* x_2; -x_2 = l_Lean_Elab_Term_Do_getDoHaveVar(x_1); +x_2 = l_Lean_Elab_Term_Do_getHaveIdLhsVar(x_1); lean_dec(x_1); return x_2; } } +static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("haveIdDecl"); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__6; +x_2 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__3() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("haveEqnsDecl"); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__4() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_getDoSeqElems___closed__6; +x_2 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__3; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__5() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("unexpected kind of have declaration"); +return x_1; +} +} +static lean_object* _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__6() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__5; +x_2 = l_Lean_stringToMessageData(x_1); +return x_2; +} +} +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars(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, lean_object* x_8) { +_start: +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15; +x_9 = lean_unsigned_to_nat(1u); +x_10 = l_Lean_Syntax_getArg(x_1, x_9); +x_11 = lean_unsigned_to_nat(0u); +x_12 = l_Lean_Syntax_getArg(x_10, x_11); +lean_dec(x_10); +lean_inc(x_12); +x_13 = l_Lean_Syntax_getKind(x_12); +x_14 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__2; +x_15 = lean_name_eq(x_13, x_14); +if (x_15 == 0) +{ +lean_object* x_16; uint8_t x_17; +x_16 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_letDeclArgHasBinders___closed__2; +x_17 = lean_name_eq(x_13, x_16); +if (x_17 == 0) +{ +lean_object* x_18; uint8_t x_19; +x_18 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__4; +x_19 = lean_name_eq(x_13, x_18); +lean_dec(x_13); +if (x_19 == 0) +{ +lean_object* x_20; lean_object* x_21; +lean_dec(x_12); +x_20 = l_Lean_Elab_Term_Do_getDoHaveVars___closed__6; +x_21 = l_Lean_throwError___at_Lean_Elab_Term_Do_getLetDeclVars___spec__1(x_20, x_2, x_3, x_4, x_5, x_6, x_7, x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +return x_21; +} +else +{ +lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_22 = l_Lean_Syntax_getArg(x_12, x_11); +lean_dec(x_12); +x_23 = l_Lean_Elab_Term_Do_getHaveIdLhsVar(x_22); +lean_dec(x_22); +x_24 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_extractBind___lambda__1___closed__3; +x_25 = lean_array_push(x_24, x_23); +x_26 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_26, 0, x_25); +lean_ctor_set(x_26, 1, x_8); +return x_26; +} +} +else +{ +lean_object* x_27; +lean_dec(x_13); +x_27 = l_Lean_Elab_Term_Do_getLetPatDeclVars(x_12, x_2, x_3, x_4, x_5, x_6, x_7, x_8); +lean_dec(x_12); +return x_27; +} +} +else +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; +lean_dec(x_13); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_28 = l_Lean_Syntax_getArg(x_12, x_11); +lean_dec(x_12); +x_29 = l_Lean_Elab_Term_Do_getHaveIdLhsVar(x_28); +lean_dec(x_28); +x_30 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_extractBind___lambda__1___closed__3; +x_31 = lean_array_push(x_30, x_29); +x_32 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_32, 0, x_31); +lean_ctor_set(x_32, 1, x_8); +return x_32; +} +} +} +LEAN_EXPORT lean_object* l_Lean_Elab_Term_Do_getDoHaveVars___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, lean_object* x_8) { +_start: +{ +lean_object* x_9; +x_9 = l_Lean_Elab_Term_Do_getDoHaveVars(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8); +lean_dec(x_1); +return x_9; +} +} LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_Do_getDoLetRecVars___spec__1(size_t x_1, size_t x_2, lean_object* x_3) { _start: { @@ -15312,7 +15466,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__2; -x_3 = lean_unsigned_to_nat(760u); +x_3 = lean_unsigned_to_nat(766u); x_4 = lean_unsigned_to_nat(13u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -16697,7 +16851,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_returnToTerm___closed__21; -x_3 = lean_unsigned_to_nat(879u); +x_3 = lean_unsigned_to_nat(885u); x_4 = lean_unsigned_to_nat(28u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -17749,7 +17903,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__1; -x_3 = lean_unsigned_to_nat(888u); +x_3 = lean_unsigned_to_nat(894u); x_4 = lean_unsigned_to_nat(28u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -18001,7 +18155,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_continueToTerm___closed__1; -x_3 = lean_unsigned_to_nat(892u); +x_3 = lean_unsigned_to_nat(898u); x_4 = lean_unsigned_to_nat(28u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -18734,7 +18888,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_breakToTerm___closed__1; -x_3 = lean_unsigned_to_nat(900u); +x_3 = lean_unsigned_to_nat(906u); x_4 = lean_unsigned_to_nat(28u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -18820,7 +18974,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_breakToTerm___closed__1; -x_3 = lean_unsigned_to_nat(904u); +x_3 = lean_unsigned_to_nat(910u); x_4 = lean_unsigned_to_nat(28u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -19702,7 +19856,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_actionTerminalToTerm___closed__15; -x_3 = lean_unsigned_to_nat(915u); +x_3 = lean_unsigned_to_nat(921u); x_4 = lean_unsigned_to_nat(28u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -23666,7 +23820,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_mkNestedKind___closed__1; -x_3 = lean_unsigned_to_nat(1062u); +x_3 = lean_unsigned_to_nat(1068u); x_4 = lean_unsigned_to_nat(27u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -23872,7 +24026,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__1; x_2 = l_Lean_Elab_Term_Do_ToTerm_matchNestedTermResult___closed__1; -x_3 = lean_unsigned_to_nat(1118u); +x_3 = lean_unsigned_to_nat(1124u); x_4 = lean_unsigned_to_nat(27u); x_5 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_Do_destructTuple_destruct___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -32062,12 +32216,24 @@ return x_195; } else { -lean_object* x_196; lean_object* x_197; lean_object* x_198; lean_object* x_199; +lean_object* x_196; lean_dec(x_46); -x_196 = l_Lean_Elab_Term_Do_getDoHaveVar(x_39); -x_197 = l___private_Lean_Elab_Do_0__Lean_Elab_Term_extractBind___lambda__1___closed__3; -x_198 = lean_array_push(x_197, x_196); -x_199 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_198, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_37); +lean_inc(x_11); +lean_inc(x_23); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +x_196 = l_Lean_Elab_Term_Do_getDoHaveVars(x_39, x_6, x_7, x_8, x_9, x_23, x_11, x_37); +if (lean_obj_tag(x_196) == 0) +{ +lean_object* x_197; lean_object* x_198; lean_object* x_199; +x_197 = lean_ctor_get(x_196, 0); +lean_inc(x_197); +x_198 = lean_ctor_get(x_196, 1); +lean_inc(x_198); +lean_dec(x_196); +x_199 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_197, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_198); if (lean_obj_tag(x_199) == 0) { lean_object* x_200; lean_object* x_201; @@ -32083,7 +32249,7 @@ lean_inc(x_202); x_203 = lean_ctor_get(x_201, 1); lean_inc(x_203); lean_dec(x_201); -x_204 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_198, x_39, x_202); +x_204 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_197, x_39, x_202); x_205 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_205, 0, x_204); lean_ctor_set(x_205, 1, x_203); @@ -32092,7 +32258,7 @@ return x_205; else { lean_object* x_206; lean_object* x_207; lean_object* x_208; -lean_dec(x_198); +lean_dec(x_197); lean_dec(x_39); x_206 = lean_ctor_get(x_201, 0); lean_inc(x_206); @@ -32108,7 +32274,7 @@ return x_208; else { lean_object* x_209; lean_object* x_210; lean_object* x_211; -lean_dec(x_198); +lean_dec(x_197); lean_dec(x_39); lean_dec(x_23); lean_dec(x_11); @@ -32129,73 +32295,9 @@ lean_ctor_set(x_211, 1, x_210); return x_211; } } -} else { -lean_object* x_212; -lean_dec(x_46); -lean_inc(x_11); -lean_inc(x_23); -lean_inc(x_9); -lean_inc(x_8); -lean_inc(x_7); -lean_inc(x_6); -x_212 = l_Lean_Elab_Term_Do_getDoLetVars(x_39, x_6, x_7, x_8, x_9, x_23, x_11, x_37); -if (lean_obj_tag(x_212) == 0) -{ -lean_object* x_213; lean_object* x_214; lean_object* x_215; -x_213 = lean_ctor_get(x_212, 0); -lean_inc(x_213); -x_214 = lean_ctor_get(x_212, 1); -lean_inc(x_214); -lean_dec(x_212); -x_215 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_213, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_214); -if (lean_obj_tag(x_215) == 0) -{ -lean_object* x_216; uint8_t x_217; lean_object* x_218; lean_object* x_219; -x_216 = lean_ctor_get(x_215, 1); -lean_inc(x_216); -lean_dec(x_215); -lean_inc(x_39); -x_217 = l_Lean_Elab_Term_Do_isMutableLet(x_39); -x_218 = lean_alloc_closure((void*)(l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode), 9, 1); -lean_closure_set(x_218, 0, x_3); -lean_inc(x_213); -x_219 = l_Lean_Elab_Term_Do_ToCodeBlock_withNewMutableVars___rarg(x_213, x_217, x_218, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_216); -if (lean_obj_tag(x_219) == 0) -{ -lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223; -x_220 = lean_ctor_get(x_219, 0); -lean_inc(x_220); -x_221 = lean_ctor_get(x_219, 1); -lean_inc(x_221); -lean_dec(x_219); -x_222 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_213, x_39, x_220); -x_223 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_223, 0, x_222); -lean_ctor_set(x_223, 1, x_221); -return x_223; -} -else -{ -lean_object* x_224; lean_object* x_225; lean_object* x_226; -lean_dec(x_213); -lean_dec(x_39); -x_224 = lean_ctor_get(x_219, 0); -lean_inc(x_224); -x_225 = lean_ctor_get(x_219, 1); -lean_inc(x_225); -lean_dec(x_219); -x_226 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_226, 0, x_224); -lean_ctor_set(x_226, 1, x_225); -return x_226; -} -} -else -{ -lean_object* x_227; lean_object* x_228; lean_object* x_229; -lean_dec(x_213); +lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_dec(x_39); lean_dec(x_23); lean_dec(x_11); @@ -32205,11 +32307,74 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_227 = lean_ctor_get(x_215, 0); -lean_inc(x_227); -x_228 = lean_ctor_get(x_215, 1); -lean_inc(x_228); +x_212 = lean_ctor_get(x_196, 0); +lean_inc(x_212); +x_213 = lean_ctor_get(x_196, 1); +lean_inc(x_213); +lean_dec(x_196); +x_214 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_214, 0, x_212); +lean_ctor_set(x_214, 1, x_213); +return x_214; +} +} +} +else +{ +lean_object* x_215; +lean_dec(x_46); +lean_inc(x_11); +lean_inc(x_23); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +x_215 = l_Lean_Elab_Term_Do_getDoLetVars(x_39, x_6, x_7, x_8, x_9, x_23, x_11, x_37); +if (lean_obj_tag(x_215) == 0) +{ +lean_object* x_216; lean_object* x_217; lean_object* x_218; +x_216 = lean_ctor_get(x_215, 0); +lean_inc(x_216); +x_217 = lean_ctor_get(x_215, 1); +lean_inc(x_217); lean_dec(x_215); +x_218 = l_Lean_Elab_Term_Do_ToCodeBlock_checkNotShadowingMutable(x_216, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_217); +if (lean_obj_tag(x_218) == 0) +{ +lean_object* x_219; uint8_t x_220; lean_object* x_221; lean_object* x_222; +x_219 = lean_ctor_get(x_218, 1); +lean_inc(x_219); +lean_dec(x_218); +lean_inc(x_39); +x_220 = l_Lean_Elab_Term_Do_isMutableLet(x_39); +x_221 = lean_alloc_closure((void*)(l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode), 9, 1); +lean_closure_set(x_221, 0, x_3); +lean_inc(x_216); +x_222 = l_Lean_Elab_Term_Do_ToCodeBlock_withNewMutableVars___rarg(x_216, x_220, x_221, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_219); +if (lean_obj_tag(x_222) == 0) +{ +lean_object* x_223; lean_object* x_224; lean_object* x_225; lean_object* x_226; +x_223 = lean_ctor_get(x_222, 0); +lean_inc(x_223); +x_224 = lean_ctor_get(x_222, 1); +lean_inc(x_224); +lean_dec(x_222); +x_225 = l_Lean_Elab_Term_Do_mkVarDeclCore(x_216, x_39, x_223); +x_226 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_226, 0, x_225); +lean_ctor_set(x_226, 1, x_224); +return x_226; +} +else +{ +lean_object* x_227; lean_object* x_228; lean_object* x_229; +lean_dec(x_216); +lean_dec(x_39); +x_227 = lean_ctor_get(x_222, 0); +lean_inc(x_227); +x_228 = lean_ctor_get(x_222, 1); +lean_inc(x_228); +lean_dec(x_222); x_229 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_229, 0, x_227); lean_ctor_set(x_229, 1, x_228); @@ -32219,6 +32384,7 @@ return x_229; else { lean_object* x_230; lean_object* x_231; lean_object* x_232; +lean_dec(x_216); lean_dec(x_39); lean_dec(x_23); lean_dec(x_11); @@ -32228,22 +32394,21 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_230 = lean_ctor_get(x_212, 0); +x_230 = lean_ctor_get(x_218, 0); lean_inc(x_230); -x_231 = lean_ctor_get(x_212, 1); +x_231 = lean_ctor_get(x_218, 1); lean_inc(x_231); -lean_dec(x_212); +lean_dec(x_218); x_232 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_232, 0, x_230); lean_ctor_set(x_232, 1, x_231); return x_232; } } -} -} else { lean_object* x_233; lean_object* x_234; lean_object* x_235; +lean_dec(x_39); lean_dec(x_23); lean_dec(x_11); lean_dec(x_9); @@ -32252,37 +32417,22 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_233 = lean_ctor_get(x_35, 0); +x_233 = lean_ctor_get(x_215, 0); lean_inc(x_233); -x_234 = lean_ctor_get(x_35, 1); +x_234 = lean_ctor_get(x_215, 1); lean_inc(x_234); -lean_dec(x_35); +lean_dec(x_215); x_235 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_235, 0, x_233); lean_ctor_set(x_235, 1, x_234); return x_235; } } -else -{ -lean_object* x_236; lean_object* x_237; lean_object* x_238; lean_object* x_239; -lean_dec(x_2); -x_236 = lean_ctor_get(x_32, 1); -lean_inc(x_236); -lean_dec(x_32); -x_237 = lean_ctor_get(x_33, 0); -lean_inc(x_237); -lean_dec(x_33); -x_238 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_238, 0, x_237); -lean_ctor_set(x_238, 1, x_3); -x_239 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_238, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_236); -return x_239; } } else { -lean_object* x_240; lean_object* x_241; lean_object* x_242; +lean_object* x_236; lean_object* x_237; lean_object* x_238; lean_dec(x_23); lean_dec(x_11); lean_dec(x_9); @@ -32291,38 +32441,37 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); +x_236 = lean_ctor_get(x_35, 0); +lean_inc(x_236); +x_237 = lean_ctor_get(x_35, 1); +lean_inc(x_237); +lean_dec(x_35); +x_238 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_238, 0, x_236); +lean_ctor_set(x_238, 1, x_237); +return x_238; +} +} +else +{ +lean_object* x_239; lean_object* x_240; lean_object* x_241; lean_object* x_242; lean_dec(x_2); -x_240 = lean_ctor_get(x_32, 0); -lean_inc(x_240); -x_241 = lean_ctor_get(x_32, 1); -lean_inc(x_241); +x_239 = lean_ctor_get(x_32, 1); +lean_inc(x_239); lean_dec(x_32); -x_242 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_242, 0, x_240); -lean_ctor_set(x_242, 1, x_241); +x_240 = lean_ctor_get(x_33, 0); +lean_inc(x_240); +lean_dec(x_33); +x_241 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_241, 0, x_240); +lean_ctor_set(x_241, 1, x_3); +x_242 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_241, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_239); return x_242; } } else { -lean_object* x_243; lean_object* x_244; lean_object* x_245; lean_object* x_246; -lean_dec(x_2); -x_243 = lean_ctor_get(x_28, 1); -lean_inc(x_243); -lean_dec(x_28); -x_244 = lean_ctor_get(x_29, 0); -lean_inc(x_244); -lean_dec(x_29); -x_245 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_245, 0, x_244); -lean_ctor_set(x_245, 1, x_3); -x_246 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_245, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_243); -return x_246; -} -} -else -{ -lean_object* x_247; lean_object* x_248; lean_object* x_249; +lean_object* x_243; lean_object* x_244; lean_object* x_245; lean_dec(x_23); lean_dec(x_11); lean_dec(x_9); @@ -32332,14 +32481,31 @@ lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); -x_247 = lean_ctor_get(x_28, 0); -lean_inc(x_247); -x_248 = lean_ctor_get(x_28, 1); -lean_inc(x_248); +x_243 = lean_ctor_get(x_32, 0); +lean_inc(x_243); +x_244 = lean_ctor_get(x_32, 1); +lean_inc(x_244); +lean_dec(x_32); +x_245 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_245, 0, x_243); +lean_ctor_set(x_245, 1, x_244); +return x_245; +} +} +else +{ +lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249; +lean_dec(x_2); +x_246 = lean_ctor_get(x_28, 1); +lean_inc(x_246); lean_dec(x_28); -x_249 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_249, 0, x_247); -lean_ctor_set(x_249, 1, x_248); +x_247 = lean_ctor_get(x_29, 0); +lean_inc(x_247); +lean_dec(x_29); +x_248 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_248, 0, x_247); +lean_ctor_set(x_248, 1, x_3); +x_249 = l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode(x_248, x_5, x_6, x_7, x_8, x_9, x_23, x_11, x_246); return x_249; } } @@ -32355,17 +32521,40 @@ lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); -x_250 = lean_ctor_get(x_25, 0); +x_250 = lean_ctor_get(x_28, 0); lean_inc(x_250); -x_251 = lean_ctor_get(x_25, 1); +x_251 = lean_ctor_get(x_28, 1); lean_inc(x_251); -lean_dec(x_25); +lean_dec(x_28); x_252 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_252, 0, x_250); lean_ctor_set(x_252, 1, x_251); return x_252; } } +else +{ +lean_object* x_253; lean_object* x_254; lean_object* x_255; +lean_dec(x_23); +lean_dec(x_11); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +x_253 = lean_ctor_get(x_25, 0); +lean_inc(x_253); +x_254 = lean_ctor_get(x_25, 1); +lean_inc(x_254); +lean_dec(x_25); +x_255 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_255, 0, x_253); +lean_ctor_set(x_255, 1, x_254); +return x_255; +} +} } static lean_object* _init_l_Lean_Elab_Term_Do_ToCodeBlock_doSeqToCode___closed__1() { _start: @@ -40487,7 +40676,7 @@ x_4 = l_Lean_addBuiltinDeclarationRanges(x_2, x_3, x_1); return x_4; } } -LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28011_(lean_object* x_1) { +LEAN_EXPORT lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28082_(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; @@ -41628,10 +41817,22 @@ l_Lean_Elab_Term_Do_getLetDeclVars___closed__1 = _init_l_Lean_Elab_Term_Do_getLe lean_mark_persistent(l_Lean_Elab_Term_Do_getLetDeclVars___closed__1); l_Lean_Elab_Term_Do_getLetDeclVars___closed__2 = _init_l_Lean_Elab_Term_Do_getLetDeclVars___closed__2(); lean_mark_persistent(l_Lean_Elab_Term_Do_getLetDeclVars___closed__2); -l_Lean_Elab_Term_Do_getDoHaveVar___closed__1 = _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__1(); -lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVar___closed__1); -l_Lean_Elab_Term_Do_getDoHaveVar___closed__2 = _init_l_Lean_Elab_Term_Do_getDoHaveVar___closed__2(); -lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVar___closed__2); +l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1 = _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__1); +l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2 = _init_l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getHaveIdLhsVar___closed__2); +l_Lean_Elab_Term_Do_getDoHaveVars___closed__1 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__1(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__1); +l_Lean_Elab_Term_Do_getDoHaveVars___closed__2 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__2(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__2); +l_Lean_Elab_Term_Do_getDoHaveVars___closed__3 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__3(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__3); +l_Lean_Elab_Term_Do_getDoHaveVars___closed__4 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__4(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__4); +l_Lean_Elab_Term_Do_getDoHaveVars___closed__5 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__5(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__5); +l_Lean_Elab_Term_Do_getDoHaveVars___closed__6 = _init_l_Lean_Elab_Term_Do_getDoHaveVars___closed__6(); +lean_mark_persistent(l_Lean_Elab_Term_Do_getDoHaveVars___closed__6); l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__1 = _init_l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__1(); lean_mark_persistent(l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__1); l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__2 = _init_l_Lean_Elab_Term_Do_getDoLetArrowVars___closed__2(); @@ -42478,7 +42679,7 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_Do_elabDo_declRange___closed_ res = l___regBuiltin_Lean_Elab_Term_Do_elabDo_declRange(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); -res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28011_(lean_io_mk_world()); +res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Do___hyg_28082_(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); l___regBuiltin_Lean_Elab_Term_expandTermFor___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_expandTermFor___closed__1(); diff --git a/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c b/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c index 6ea3156be0..563946b1e3 100644 --- a/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c +++ b/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c @@ -15,8 +15,8 @@ extern "C" { #endif LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__7___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_getConstInfo___at_Lean_Elab_Term_mkConst___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_update_forall(lean_object*, uint8_t, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompilePartialRec___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_compileDecl___at_Lean_Elab_Term_evalExpr___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -24,11 +24,9 @@ LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefi size_t lean_usize_add(size_t, size_t); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamPreDeclsAux___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_fixLevelParams___spec__4(lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addAsAxiom(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_mk_empty_array_with_capacity(lean_object*); -LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_instantiateMVarsAtPreDecls___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); uint8_t lean_usize_dec_eq(size_t, size_t); @@ -64,8 +62,8 @@ LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_ LEAN_EXPORT lean_object* l_Lean_throwError___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelParamsPreDecls___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompilePartialRec___spec__3(lean_object*, lean_object*, size_t, size_t, lean_object*); static uint64_t l_Lean_Elab_instInhabitedPreDefinition___closed__3; +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompileUnsafe___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint32_t lean_uint32_add(uint32_t, uint32_t); -LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__2(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addAndCompileUnsafe(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__12___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_instInhabitedPreDefinition___closed__5; @@ -73,12 +71,12 @@ LEAN_EXPORT lean_object* l_Lean_Elab_applyAttributesOf(lean_object*, uint8_t, le lean_object* l_Lean_ConstantInfo_levelParams(lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_instantiateMVarsAtPreDecls___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__12(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_instInhabitedPreDefinition___closed__2; +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompileUnsafe___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_levelMVarToParamPreDecls(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_st_ref_take(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__10___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Elab_instInhabitedPreDefinition___closed__1; LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__10(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addNonRec(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -95,6 +93,7 @@ lean_object* lean_st_mk_ref(lean_object*, lean_object*); static lean_object* l_Lean_Elab_instInhabitedPreDefinition___closed__4; LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelParamsPreDecls___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_addMacroStack___at_Lean_Elab_Term_instAddErrorMessageContextTermElabM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_instInhabitedPreDefinition; lean_object* lean_array_to_list(lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -109,6 +108,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_abstractNestedProofs(lean_object*, lean_obj LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_fixLevelParams___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_getResetInfoTrees___at_Lean_Elab_Term_withoutModifyingElabMetaStateWithInfo___spec__2___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_sortDeclLevelParams(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_update_let(lean_object*, lean_object*, lean_object*, lean_object*); @@ -124,15 +124,16 @@ lean_object* l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(lean_object*, size_t lean_usize_mod(size_t, size_t); lean_object* l_Lean_Elab_Term_levelMVarToParam_x27(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t lean_ptr_addr(lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addAndCompileUnsafe___lambda__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l_Array_anyMUnsafe_any___at_Lean_Elab_addAndCompilePartialRec___spec__4(lean_object*, size_t, size_t); lean_object* l_Lean_Meta_abstractNestedProofs(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addAsAxiom___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_le(lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Std_PersistentArray_mapMAux___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__9___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addAndCompileUnsafe___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_addTermInfo(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_applyAttributesOf___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_addAndCompilePartialRec___spec__2___closed__1; LEAN_EXPORT lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_addAndCompilePartialRec___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -143,6 +144,7 @@ LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefi lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_addMessageContextFull___at_Lean_Meta_instAddMessageContextMetaM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_update_lambda(lean_object*, uint8_t, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__3(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at_Lean_Elab_addAndCompilePartialRec___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shouldGenCodeFor(lean_object*); lean_object* l_Lean_Meta_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -152,6 +154,8 @@ LEAN_EXPORT lean_object* l_Lean_Elab_instantiateMVarsAtPreDecls(lean_object*, le LEAN_EXPORT lean_object* l_Array_anyMUnsafe_any___at_Lean_Elab_fixLevelParams___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addAndCompileUnsafe___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr(lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_mkConstWithLevelParams___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelParamsPreDecls(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -159,17 +163,16 @@ LEAN_EXPORT lean_object* l_Lean_Elab_fixLevelParams(lean_object*, lean_object*, lean_object* lean_expr_update_app(lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__11(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_addAndCompileNonRec(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -static lean_object* l_Lean_Elab_eraseRecAppSyntax___closed__2; -static lean_object* l_Lean_Elab_eraseRecAppSyntax___closed__1; LEAN_EXPORT lean_object* l_Std_PersistentArray_mapMAux___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamPreDeclsAux___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkConst(lean_object*, lean_object*); +static lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2; lean_object* l_Lean_addDecl___at_Lean_Meta_mkAuxDefinition___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT uint8_t l_Array_anyMUnsafe_any___at_Lean_Elab_fixLevelParams___spec__1(lean_object*, lean_object*, size_t, size_t); LEAN_EXPORT lean_object* l_Lean_Elab_withSaveInfoContext___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamPreDeclsAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_applyAttributesOf___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1; LEAN_EXPORT lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_fixLevelParams___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Expr_ReplaceImpl_initCache; lean_object* l_Lean_Elab_getBetterRef(lean_object*, lean_object*); @@ -5918,7 +5921,7 @@ x_10 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux(x_1, return x_10; } } -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__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; @@ -5930,7 +5933,7 @@ lean_ctor_set(x_6, 1, x_4); return x_6; } } -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; @@ -5960,60 +5963,283 @@ return x_10; } } } -static lean_object* _init_l_Lean_Elab_eraseRecAppSyntax___closed__1() { +static lean_object* _init_l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1() { _start: { lean_object* x_1; -x_1 = lean_alloc_closure((void*)(l_Lean_Elab_eraseRecAppSyntax___lambda__1___boxed), 4, 0); +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__1___boxed), 4, 0); return x_1; } } -static lean_object* _init_l_Lean_Elab_eraseRecAppSyntax___closed__2() { +static lean_object* _init_l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2() { _start: { lean_object* x_1; -x_1 = lean_alloc_closure((void*)(l_Lean_Elab_eraseRecAppSyntax___lambda__2___boxed), 4, 0); +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__2___boxed), 4, 0); return x_1; } } +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr(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; +x_5 = l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1; +x_6 = l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2; +x_7 = l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(x_1, x_5, x_6, x_2, x_3, x_4); +return x_7; +} +} +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__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_Lean_Elab_eraseRecAppSyntaxExpr___lambda__1(x_1, x_2, x_3, x_4); +lean_dec(x_3); +lean_dec(x_2); +return x_5; +} +} +LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntaxExpr___lambda__2___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_Lean_Elab_eraseRecAppSyntaxExpr___lambda__2(x_1, x_2, x_3, x_4); +lean_dec(x_3); +lean_dec(x_2); +return x_5; +} +} LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax(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; -x_5 = l_Lean_Elab_eraseRecAppSyntax___closed__1; -x_6 = l_Lean_Elab_eraseRecAppSyntax___closed__2; -x_7 = l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(x_1, x_5, x_6, x_2, x_3, x_4); -return x_7; +uint8_t x_5; +x_5 = !lean_is_exclusive(x_1); +if (x_5 == 0) +{ +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; +x_6 = lean_ctor_get(x_1, 0); +x_7 = lean_ctor_get(x_1, 1); +x_8 = lean_ctor_get(x_1, 2); +x_9 = lean_ctor_get(x_1, 3); +x_10 = lean_ctor_get(x_1, 4); +x_11 = lean_ctor_get(x_1, 5); +x_12 = l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1; +x_13 = l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2; +x_14 = l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(x_11, x_12, x_13, x_2, x_3, x_4); +if (lean_obj_tag(x_14) == 0) +{ +uint8_t x_15; +x_15 = !lean_is_exclusive(x_14); +if (x_15 == 0) +{ +lean_object* x_16; +x_16 = lean_ctor_get(x_14, 0); +lean_ctor_set(x_1, 5, x_16); +lean_ctor_set(x_14, 0, x_1); +return x_14; +} +else +{ +lean_object* x_17; lean_object* x_18; lean_object* x_19; +x_17 = lean_ctor_get(x_14, 0); +x_18 = lean_ctor_get(x_14, 1); +lean_inc(x_18); +lean_inc(x_17); +lean_dec(x_14); +lean_ctor_set(x_1, 5, x_17); +x_19 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_19, 0, x_1); +lean_ctor_set(x_19, 1, x_18); +return x_19; } } -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +else +{ +uint8_t x_20; +lean_free_object(x_1); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +x_20 = !lean_is_exclusive(x_14); +if (x_20 == 0) +{ +return x_14; +} +else +{ +lean_object* x_21; lean_object* x_22; lean_object* x_23; +x_21 = lean_ctor_get(x_14, 0); +x_22 = lean_ctor_get(x_14, 1); +lean_inc(x_22); +lean_inc(x_21); +lean_dec(x_14); +x_23 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_23, 0, x_21); +lean_ctor_set(x_23, 1, x_22); +return x_23; +} +} +} +else +{ +lean_object* x_24; uint8_t x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; +x_24 = lean_ctor_get(x_1, 0); +x_25 = lean_ctor_get_uint8(x_1, sizeof(void*)*6); +x_26 = lean_ctor_get(x_1, 1); +x_27 = lean_ctor_get(x_1, 2); +x_28 = lean_ctor_get(x_1, 3); +x_29 = lean_ctor_get(x_1, 4); +x_30 = lean_ctor_get(x_1, 5); +lean_inc(x_30); +lean_inc(x_29); +lean_inc(x_28); +lean_inc(x_27); +lean_inc(x_26); +lean_inc(x_24); +lean_dec(x_1); +x_31 = l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1; +x_32 = l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2; +x_33 = l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(x_30, x_31, x_32, x_2, x_3, x_4); +if (lean_obj_tag(x_33) == 0) +{ +lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_34 = lean_ctor_get(x_33, 0); +lean_inc(x_34); +x_35 = lean_ctor_get(x_33, 1); +lean_inc(x_35); +if (lean_is_exclusive(x_33)) { + lean_ctor_release(x_33, 0); + lean_ctor_release(x_33, 1); + x_36 = x_33; +} else { + lean_dec_ref(x_33); + x_36 = lean_box(0); +} +x_37 = lean_alloc_ctor(0, 6, 1); +lean_ctor_set(x_37, 0, x_24); +lean_ctor_set(x_37, 1, x_26); +lean_ctor_set(x_37, 2, x_27); +lean_ctor_set(x_37, 3, x_28); +lean_ctor_set(x_37, 4, x_29); +lean_ctor_set(x_37, 5, x_34); +lean_ctor_set_uint8(x_37, sizeof(void*)*6, x_25); +if (lean_is_scalar(x_36)) { + x_38 = lean_alloc_ctor(0, 2, 0); +} else { + x_38 = x_36; +} +lean_ctor_set(x_38, 0, x_37); +lean_ctor_set(x_38, 1, x_35); +return x_38; +} +else +{ +lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; +lean_dec(x_29); +lean_dec(x_28); +lean_dec(x_27); +lean_dec(x_26); +lean_dec(x_24); +x_39 = lean_ctor_get(x_33, 0); +lean_inc(x_39); +x_40 = lean_ctor_get(x_33, 1); +lean_inc(x_40); +if (lean_is_exclusive(x_33)) { + lean_ctor_release(x_33, 0); + lean_ctor_release(x_33, 1); + x_41 = x_33; +} else { + lean_dec_ref(x_33); + x_41 = lean_box(0); +} +if (lean_is_scalar(x_41)) { + x_42 = lean_alloc_ctor(1, 2, 0); +} else { + x_42 = x_41; +} +lean_ctor_set(x_42, 0, x_39); +lean_ctor_set(x_42, 1, x_40); +return x_42; +} +} +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompileUnsafe___spec__1(size_t x_1, size_t x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) { _start: { -lean_object* x_5; -x_5 = l_Lean_Elab_eraseRecAppSyntax___lambda__1(x_1, x_2, x_3, x_4); -lean_dec(x_3); -lean_dec(x_2); -return x_5; -} -} -LEAN_EXPORT lean_object* l_Lean_Elab_eraseRecAppSyntax___lambda__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { -_start: +uint8_t x_11; +x_11 = lean_usize_dec_lt(x_2, x_1); +if (x_11 == 0) { -lean_object* x_5; -x_5 = l_Lean_Elab_eraseRecAppSyntax___lambda__2(x_1, x_2, x_3, x_4); -lean_dec(x_3); -lean_dec(x_2); -return x_5; +lean_object* x_12; +lean_dec(x_9); +lean_dec(x_8); +x_12 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_12, 0, x_3); +lean_ctor_set(x_12, 1, x_10); +return x_12; +} +else +{ +lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; +x_13 = lean_array_uget(x_3, x_2); +x_14 = lean_unsigned_to_nat(0u); +x_15 = lean_array_uset(x_3, x_2, x_14); +lean_inc(x_9); +lean_inc(x_8); +x_16 = l_Lean_Elab_eraseRecAppSyntax(x_13, x_8, x_9, x_10); +if (lean_obj_tag(x_16) == 0) +{ +lean_object* x_17; lean_object* x_18; size_t x_19; size_t x_20; lean_object* x_21; +x_17 = lean_ctor_get(x_16, 0); +lean_inc(x_17); +x_18 = lean_ctor_get(x_16, 1); +lean_inc(x_18); +lean_dec(x_16); +x_19 = 1; +x_20 = lean_usize_add(x_2, x_19); +x_21 = lean_array_uset(x_15, x_2, x_17); +x_2 = x_20; +x_3 = x_21; +x_10 = x_18; +goto _start; +} +else +{ +uint8_t x_23; +lean_dec(x_15); +lean_dec(x_9); +lean_dec(x_8); +x_23 = !lean_is_exclusive(x_16); +if (x_23 == 0) +{ +return x_16; +} +else +{ +lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_24 = lean_ctor_get(x_16, 0); +x_25 = lean_ctor_get(x_16, 1); +lean_inc(x_25); +lean_inc(x_24); +lean_dec(x_16); +x_26 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_26, 0, x_24); +lean_ctor_set(x_26, 1, x_25); +return x_26; } } -LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1(uint8_t 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, lean_object* x_8, lean_object* x_9) { +} +} +} +LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2(uint8_t 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, lean_object* x_8, lean_object* x_9) { _start: { if (lean_obj_tag(x_2) == 0) { lean_object* x_10; lean_object* x_11; -lean_dec(x_8); -lean_dec(x_7); x_10 = lean_box(0); x_11 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_11, 0, x_10); @@ -6026,251 +6252,111 @@ uint8_t x_12; x_12 = !lean_is_exclusive(x_2); 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_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; lean_object* x_20; lean_object* x_21; lean_object* x_22; uint8_t x_23; x_13 = lean_ctor_get(x_2, 0); x_14 = lean_ctor_get(x_2, 1); -x_15 = lean_ctor_get(x_13, 5); +x_15 = lean_ctor_get(x_13, 3); lean_inc(x_15); -x_16 = l_Lean_Elab_eraseRecAppSyntax___closed__1; -x_17 = l_Lean_Elab_eraseRecAppSyntax___closed__2; -lean_inc(x_8); -lean_inc(x_7); -x_18 = l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(x_15, x_16, x_17, x_7, x_8, x_9); -if (lean_obj_tag(x_18) == 0) -{ -lean_object* x_19; 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; lean_object* x_27; -x_19 = lean_ctor_get(x_18, 0); +x_16 = lean_ctor_get(x_13, 1); +lean_inc(x_16); +x_17 = lean_ctor_get(x_13, 4); +lean_inc(x_17); +x_18 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_18, 0, x_15); +lean_ctor_set(x_18, 1, x_16); +lean_ctor_set(x_18, 2, x_17); +x_19 = lean_ctor_get(x_13, 5); lean_inc(x_19); -x_20 = lean_ctor_get(x_18, 1); -lean_inc(x_20); -lean_dec(x_18); -x_21 = lean_ctor_get(x_13, 3); -lean_inc(x_21); -x_22 = lean_ctor_get(x_13, 1); -lean_inc(x_22); -x_23 = lean_ctor_get(x_13, 4); -lean_inc(x_23); lean_dec(x_13); -x_24 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_24, 0, x_21); -lean_ctor_set(x_24, 1, x_22); -lean_ctor_set(x_24, 2, x_23); -x_25 = lean_box(0); -x_26 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_26, 0, x_24); -lean_ctor_set(x_26, 1, x_19); -lean_ctor_set(x_26, 2, x_25); -lean_ctor_set_uint8(x_26, sizeof(void*)*3, x_1); -x_27 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1(x_1, x_14, x_3, x_4, x_5, x_6, x_7, x_8, x_20); -if (lean_obj_tag(x_27) == 0) +x_20 = lean_box(0); +x_21 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_21, 0, x_18); +lean_ctor_set(x_21, 1, x_19); +lean_ctor_set(x_21, 2, x_20); +lean_ctor_set_uint8(x_21, sizeof(void*)*3, x_1); +x_22 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2(x_1, x_14, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +x_23 = !lean_is_exclusive(x_22); +if (x_23 == 0) { -uint8_t x_28; -x_28 = !lean_is_exclusive(x_27); -if (x_28 == 0) +lean_object* x_24; +x_24 = lean_ctor_get(x_22, 0); +lean_ctor_set(x_2, 1, x_24); +lean_ctor_set(x_2, 0, x_21); +lean_ctor_set(x_22, 0, x_2); +return x_22; +} +else { -lean_object* x_29; -x_29 = lean_ctor_get(x_27, 0); -lean_ctor_set(x_2, 1, x_29); -lean_ctor_set(x_2, 0, x_26); +lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_25 = lean_ctor_get(x_22, 0); +x_26 = lean_ctor_get(x_22, 1); +lean_inc(x_26); +lean_inc(x_25); +lean_dec(x_22); +lean_ctor_set(x_2, 1, x_25); +lean_ctor_set(x_2, 0, x_21); +x_27 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_27, 0, x_2); +lean_ctor_set(x_27, 1, x_26); return x_27; } -else -{ -lean_object* x_30; lean_object* x_31; lean_object* x_32; -x_30 = lean_ctor_get(x_27, 0); -x_31 = lean_ctor_get(x_27, 1); -lean_inc(x_31); -lean_inc(x_30); -lean_dec(x_27); -lean_ctor_set(x_2, 1, x_30); -lean_ctor_set(x_2, 0, x_26); -x_32 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_32, 0, x_2); -lean_ctor_set(x_32, 1, x_31); -return x_32; -} } else { -uint8_t x_33; -lean_dec(x_26); -lean_free_object(x_2); -x_33 = !lean_is_exclusive(x_27); -if (x_33 == 0) -{ -return x_27; -} -else -{ -lean_object* x_34; lean_object* x_35; lean_object* x_36; -x_34 = lean_ctor_get(x_27, 0); -x_35 = lean_ctor_get(x_27, 1); -lean_inc(x_35); -lean_inc(x_34); -lean_dec(x_27); -x_36 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_36, 0, x_34); -lean_ctor_set(x_36, 1, x_35); -return x_36; -} -} -} -else -{ -uint8_t x_37; -lean_free_object(x_2); -lean_dec(x_14); -lean_dec(x_13); -lean_dec(x_8); -lean_dec(x_7); -x_37 = !lean_is_exclusive(x_18); -if (x_37 == 0) -{ -return x_18; -} -else -{ -lean_object* x_38; lean_object* x_39; lean_object* x_40; -x_38 = lean_ctor_get(x_18, 0); -x_39 = lean_ctor_get(x_18, 1); -lean_inc(x_39); -lean_inc(x_38); -lean_dec(x_18); -x_40 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_40, 0, x_38); -lean_ctor_set(x_40, 1, x_39); -return x_40; -} -} -} -else -{ -lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; -x_41 = lean_ctor_get(x_2, 0); -x_42 = lean_ctor_get(x_2, 1); -lean_inc(x_42); -lean_inc(x_41); +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; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; +x_28 = lean_ctor_get(x_2, 0); +x_29 = lean_ctor_get(x_2, 1); +lean_inc(x_29); +lean_inc(x_28); lean_dec(x_2); -x_43 = lean_ctor_get(x_41, 5); -lean_inc(x_43); -x_44 = l_Lean_Elab_eraseRecAppSyntax___closed__1; -x_45 = l_Lean_Elab_eraseRecAppSyntax___closed__2; -lean_inc(x_8); -lean_inc(x_7); -x_46 = l_Lean_Core_transform___at_Lean_Core_betaReduce___spec__1(x_43, x_44, x_45, x_7, x_8, x_9); -if (lean_obj_tag(x_46) == 0) -{ -lean_object* x_47; lean_object* x_48; 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; -x_47 = lean_ctor_get(x_46, 0); -lean_inc(x_47); -x_48 = lean_ctor_get(x_46, 1); -lean_inc(x_48); -lean_dec(x_46); -x_49 = lean_ctor_get(x_41, 3); -lean_inc(x_49); -x_50 = lean_ctor_get(x_41, 1); -lean_inc(x_50); -x_51 = lean_ctor_get(x_41, 4); -lean_inc(x_51); -lean_dec(x_41); -x_52 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_52, 0, x_49); -lean_ctor_set(x_52, 1, x_50); -lean_ctor_set(x_52, 2, x_51); -x_53 = lean_box(0); -x_54 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_54, 0, x_52); -lean_ctor_set(x_54, 1, x_47); -lean_ctor_set(x_54, 2, x_53); -lean_ctor_set_uint8(x_54, sizeof(void*)*3, x_1); -x_55 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1(x_1, x_42, x_3, x_4, x_5, x_6, x_7, x_8, x_48); -if (lean_obj_tag(x_55) == 0) -{ -lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; -x_56 = lean_ctor_get(x_55, 0); -lean_inc(x_56); -x_57 = lean_ctor_get(x_55, 1); -lean_inc(x_57); -if (lean_is_exclusive(x_55)) { - lean_ctor_release(x_55, 0); - lean_ctor_release(x_55, 1); - x_58 = x_55; +x_30 = lean_ctor_get(x_28, 3); +lean_inc(x_30); +x_31 = lean_ctor_get(x_28, 1); +lean_inc(x_31); +x_32 = lean_ctor_get(x_28, 4); +lean_inc(x_32); +x_33 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_33, 0, x_30); +lean_ctor_set(x_33, 1, x_31); +lean_ctor_set(x_33, 2, x_32); +x_34 = lean_ctor_get(x_28, 5); +lean_inc(x_34); +lean_dec(x_28); +x_35 = lean_box(0); +x_36 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_36, 0, x_33); +lean_ctor_set(x_36, 1, x_34); +lean_ctor_set(x_36, 2, x_35); +lean_ctor_set_uint8(x_36, sizeof(void*)*3, x_1); +x_37 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2(x_1, x_29, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +x_38 = lean_ctor_get(x_37, 0); +lean_inc(x_38); +x_39 = lean_ctor_get(x_37, 1); +lean_inc(x_39); +if (lean_is_exclusive(x_37)) { + lean_ctor_release(x_37, 0); + lean_ctor_release(x_37, 1); + x_40 = x_37; } else { - lean_dec_ref(x_55); - x_58 = lean_box(0); + lean_dec_ref(x_37); + x_40 = lean_box(0); } -x_59 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_59, 0, x_54); -lean_ctor_set(x_59, 1, x_56); -if (lean_is_scalar(x_58)) { - x_60 = lean_alloc_ctor(0, 2, 0); +x_41 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_41, 0, x_36); +lean_ctor_set(x_41, 1, x_38); +if (lean_is_scalar(x_40)) { + x_42 = lean_alloc_ctor(0, 2, 0); } else { - x_60 = x_58; + x_42 = x_40; } -lean_ctor_set(x_60, 0, x_59); -lean_ctor_set(x_60, 1, x_57); -return x_60; -} -else -{ -lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; -lean_dec(x_54); -x_61 = lean_ctor_get(x_55, 0); -lean_inc(x_61); -x_62 = lean_ctor_get(x_55, 1); -lean_inc(x_62); -if (lean_is_exclusive(x_55)) { - lean_ctor_release(x_55, 0); - lean_ctor_release(x_55, 1); - x_63 = x_55; -} else { - lean_dec_ref(x_55); - x_63 = lean_box(0); -} -if (lean_is_scalar(x_63)) { - x_64 = lean_alloc_ctor(1, 2, 0); -} else { - x_64 = x_63; -} -lean_ctor_set(x_64, 0, x_61); -lean_ctor_set(x_64, 1, x_62); -return x_64; -} -} -else -{ -lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; -lean_dec(x_42); -lean_dec(x_41); -lean_dec(x_8); -lean_dec(x_7); -x_65 = lean_ctor_get(x_46, 0); -lean_inc(x_65); -x_66 = lean_ctor_get(x_46, 1); -lean_inc(x_66); -if (lean_is_exclusive(x_46)) { - lean_ctor_release(x_46, 0); - lean_ctor_release(x_46, 1); - x_67 = x_46; -} else { - lean_dec_ref(x_46); - x_67 = lean_box(0); -} -if (lean_is_scalar(x_67)) { - x_68 = lean_alloc_ctor(1, 2, 0); -} else { - x_68 = x_67; -} -lean_ctor_set(x_68, 0, x_65); -lean_ctor_set(x_68, 1, x_66); -return x_68; +lean_ctor_set(x_42, 0, x_41); +lean_ctor_set(x_42, 1, x_39); +return x_42; } } } } -} -LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__2(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4, 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_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__3(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4, 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) { _start: { uint8_t x_12; @@ -6399,7 +6485,7 @@ _start: { lean_object* x_11; lean_object* x_12; x_11 = lean_box(0); -x_12 = l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__2(x_1, x_2, x_3, x_11, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +x_12 = l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__3(x_1, x_2, x_3, x_11, x_4, x_5, x_6, x_7, x_8, x_9, x_10); if (lean_obj_tag(x_12) == 0) { uint8_t x_13; @@ -6516,616 +6602,606 @@ return x_2; LEAN_EXPORT lean_object* l_Lean_Elab_addAndCompileUnsafe(lean_object* x_1, uint8_t x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { _start: { -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15; -x_10 = l_Lean_Elab_instInhabitedPreDefinition; -x_11 = lean_unsigned_to_nat(0u); -x_12 = lean_array_get(x_10, x_1, x_11); -x_13 = lean_ctor_get(x_12, 0); -lean_inc(x_13); -lean_dec(x_12); -lean_inc(x_1); -x_14 = lean_array_to_list(lean_box(0), x_1); -x_15 = !lean_is_exclusive(x_7); -if (x_15 == 0) -{ -lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_7, 3); -x_17 = l_Lean_replaceRef(x_13, x_16); -lean_dec(x_16); -lean_dec(x_13); -lean_ctor_set(x_7, 3, x_17); +lean_object* x_10; size_t x_11; size_t x_12; lean_object* x_13; +x_10 = lean_array_get_size(x_1); +x_11 = lean_usize_of_nat(x_10); +lean_dec(x_10); +x_12 = 0; lean_inc(x_8); lean_inc(x_7); -x_18 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1(x_2, x_14, x_3, x_4, x_5, x_6, x_7, x_8, x_9); -if (lean_obj_tag(x_18) == 0) +x_13 = l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompileUnsafe___spec__1(x_11, x_12, x_1, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +if (lean_obj_tag(x_13) == 0) { -lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; +lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; uint8_t x_21; +x_14 = lean_ctor_get(x_13, 0); +lean_inc(x_14); +x_15 = lean_ctor_get(x_13, 1); +lean_inc(x_15); +lean_dec(x_13); +x_16 = l_Lean_Elab_instInhabitedPreDefinition; +x_17 = lean_unsigned_to_nat(0u); +x_18 = lean_array_get(x_16, x_14, x_17); x_19 = lean_ctor_get(x_18, 0); lean_inc(x_19); -x_20 = lean_ctor_get(x_18, 1); -lean_inc(x_20); lean_dec(x_18); -x_21 = lean_alloc_ctor(5, 1, 0); -lean_ctor_set(x_21, 0, x_19); -lean_inc(x_7); -lean_inc(x_3); -lean_inc(x_21); -x_22 = l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(x_21, x_3, x_4, x_5, x_6, x_7, x_8, x_20); -if (lean_obj_tag(x_22) == 0) +lean_inc(x_14); +x_20 = lean_array_to_list(lean_box(0), x_14); +x_21 = !lean_is_exclusive(x_7); +if (x_21 == 0) { -lean_object* x_23; lean_object* x_24; size_t x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; -x_23 = lean_ctor_get(x_22, 1); -lean_inc(x_23); +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; +x_22 = lean_ctor_get(x_7, 3); +x_23 = l_Lean_replaceRef(x_19, x_22); lean_dec(x_22); -x_24 = lean_array_get_size(x_1); -x_25 = lean_usize_of_nat(x_24); +lean_dec(x_19); +lean_ctor_set(x_7, 3, x_23); +x_24 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2(x_2, x_20, x_3, x_4, x_5, x_6, x_7, x_8, x_15); +x_25 = lean_ctor_get(x_24, 0); +lean_inc(x_25); +x_26 = lean_ctor_get(x_24, 1); +lean_inc(x_26); lean_dec(x_24); -x_26 = lean_box_usize(x_25); -x_27 = l_Lean_Elab_addAndCompileUnsafe___boxed__const__1; -lean_inc(x_1); -x_28 = lean_alloc_closure((void*)(l_Lean_Elab_addAndCompileUnsafe___lambda__1___boxed), 10, 3); -lean_closure_set(x_28, 0, x_1); -lean_closure_set(x_28, 1, x_26); -lean_closure_set(x_28, 2, x_27); +x_27 = lean_alloc_ctor(5, 1, 0); +lean_ctor_set(x_27, 0, x_25); +lean_inc(x_7); +lean_inc(x_3); +lean_inc(x_27); +x_28 = l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(x_27, x_3, x_4, x_5, x_6, x_7, x_8, x_26); +if (lean_obj_tag(x_28) == 0) +{ +lean_object* x_29; lean_object* x_30; size_t x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; +x_29 = lean_ctor_get(x_28, 1); +lean_inc(x_29); +lean_dec(x_28); +x_30 = lean_array_get_size(x_14); +x_31 = lean_usize_of_nat(x_30); +lean_dec(x_30); +x_32 = lean_box_usize(x_31); +x_33 = l_Lean_Elab_addAndCompileUnsafe___boxed__const__1; +lean_inc(x_14); +x_34 = lean_alloc_closure((void*)(l_Lean_Elab_addAndCompileUnsafe___lambda__1___boxed), 10, 3); +lean_closure_set(x_34, 0, x_14); +lean_closure_set(x_34, 1, x_32); +lean_closure_set(x_34, 2, x_33); lean_inc(x_8); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); lean_inc(x_3); -x_29 = l_Lean_Elab_withSaveInfoContext___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__2(x_28, x_3, x_4, x_5, x_6, x_7, x_8, x_23); -if (lean_obj_tag(x_29) == 0) +x_35 = l_Lean_Elab_withSaveInfoContext___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__2(x_34, x_3, x_4, x_5, x_6, x_7, x_8, x_29); +if (lean_obj_tag(x_35) == 0) { -lean_object* x_30; uint8_t x_31; lean_object* x_32; -x_30 = lean_ctor_get(x_29, 1); -lean_inc(x_30); -lean_dec(x_29); -x_31 = 0; -lean_inc(x_8); -lean_inc(x_7); -lean_inc(x_3); -x_32 = l_Lean_Elab_applyAttributesOf(x_1, x_31, x_3, x_4, x_5, x_6, x_7, x_8, x_30); -if (lean_obj_tag(x_32) == 0) -{ -lean_object* x_33; lean_object* x_34; -x_33 = lean_ctor_get(x_32, 1); -lean_inc(x_33); -lean_dec(x_32); -lean_inc(x_8); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -lean_inc(x_3); -x_34 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl(x_21, x_3, x_4, x_5, x_6, x_7, x_8, x_33); -if (lean_obj_tag(x_34) == 0) -{ -lean_object* x_35; uint8_t x_36; -x_35 = lean_ctor_get(x_34, 0); -lean_inc(x_35); -x_36 = lean_unbox(x_35); +lean_object* x_36; uint8_t x_37; lean_object* x_38; +x_36 = lean_ctor_get(x_35, 1); +lean_inc(x_36); lean_dec(x_35); -if (x_36 == 0) +x_37 = 0; +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_3); +x_38 = l_Lean_Elab_applyAttributesOf(x_14, x_37, x_3, x_4, x_5, x_6, x_7, x_8, x_36); +if (lean_obj_tag(x_38) == 0) { -uint8_t x_37; -lean_dec(x_7); -lean_dec(x_8); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_1); -x_37 = !lean_is_exclusive(x_34); -if (x_37 == 0) -{ -lean_object* x_38; lean_object* x_39; -x_38 = lean_ctor_get(x_34, 0); +lean_object* x_39; lean_object* x_40; +x_39 = lean_ctor_get(x_38, 1); +lean_inc(x_39); lean_dec(x_38); -x_39 = lean_box(0); -lean_ctor_set(x_34, 0, x_39); -return x_34; -} -else +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_4); +lean_inc(x_3); +x_40 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl(x_27, x_3, x_4, x_5, x_6, x_7, x_8, x_39); +if (lean_obj_tag(x_40) == 0) { -lean_object* x_40; lean_object* x_41; lean_object* x_42; -x_40 = lean_ctor_get(x_34, 1); -lean_inc(x_40); -lean_dec(x_34); -x_41 = lean_box(0); -x_42 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_42, 0, x_41); -lean_ctor_set(x_42, 1, x_40); -return x_42; -} -} -else +lean_object* x_41; uint8_t x_42; +x_41 = lean_ctor_get(x_40, 0); +lean_inc(x_41); +x_42 = lean_unbox(x_41); +lean_dec(x_41); +if (x_42 == 0) { -lean_object* x_43; lean_object* x_44; lean_object* x_45; -x_43 = lean_ctor_get(x_34, 1); -lean_inc(x_43); -lean_dec(x_34); -x_44 = lean_box(0); -x_45 = l_Lean_Elab_addAndCompileUnsafe___lambda__2(x_1, x_44, x_3, x_4, x_5, x_6, x_7, x_8, x_43); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_1); -return x_45; -} -} -else -{ -uint8_t x_46; +uint8_t x_43; lean_dec(x_7); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_46 = !lean_is_exclusive(x_34); -if (x_46 == 0) +x_43 = !lean_is_exclusive(x_40); +if (x_43 == 0) { -return x_34; +lean_object* x_44; lean_object* x_45; +x_44 = lean_ctor_get(x_40, 0); +lean_dec(x_44); +x_45 = lean_box(0); +lean_ctor_set(x_40, 0, x_45); +return x_40; } else { -lean_object* x_47; lean_object* x_48; lean_object* x_49; -x_47 = lean_ctor_get(x_34, 0); -x_48 = lean_ctor_get(x_34, 1); -lean_inc(x_48); -lean_inc(x_47); -lean_dec(x_34); -x_49 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_49, 0, x_47); -lean_ctor_set(x_49, 1, x_48); -return x_49; -} +lean_object* x_46; lean_object* x_47; lean_object* x_48; +x_46 = lean_ctor_get(x_40, 1); +lean_inc(x_46); +lean_dec(x_40); +x_47 = lean_box(0); +x_48 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_48, 0, x_47); +lean_ctor_set(x_48, 1, x_46); +return x_48; } } else { -uint8_t x_50; -lean_dec(x_21); +lean_object* x_49; lean_object* x_50; lean_object* x_51; +x_49 = lean_ctor_get(x_40, 1); +lean_inc(x_49); +lean_dec(x_40); +x_50 = lean_box(0); +x_51 = l_Lean_Elab_addAndCompileUnsafe___lambda__2(x_14, x_50, x_3, x_4, x_5, x_6, x_7, x_8, x_49); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_14); +return x_51; +} +} +else +{ +uint8_t x_52; lean_dec(x_7); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_50 = !lean_is_exclusive(x_32); -if (x_50 == 0) +x_52 = !lean_is_exclusive(x_40); +if (x_52 == 0) { -return x_32; +return x_40; } else { -lean_object* x_51; lean_object* x_52; lean_object* x_53; -x_51 = lean_ctor_get(x_32, 0); -x_52 = lean_ctor_get(x_32, 1); -lean_inc(x_52); -lean_inc(x_51); -lean_dec(x_32); -x_53 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_53, 0, x_51); -lean_ctor_set(x_53, 1, x_52); -return x_53; +lean_object* x_53; lean_object* x_54; lean_object* x_55; +x_53 = lean_ctor_get(x_40, 0); +x_54 = lean_ctor_get(x_40, 1); +lean_inc(x_54); +lean_inc(x_53); +lean_dec(x_40); +x_55 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_55, 0, x_53); +lean_ctor_set(x_55, 1, x_54); +return x_55; } } } else { -uint8_t x_54; -lean_dec(x_21); +uint8_t x_56; +lean_dec(x_27); lean_dec(x_7); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_54 = !lean_is_exclusive(x_29); -if (x_54 == 0) +x_56 = !lean_is_exclusive(x_38); +if (x_56 == 0) { -return x_29; +return x_38; } else { -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_29, 0); -x_56 = lean_ctor_get(x_29, 1); -lean_inc(x_56); -lean_inc(x_55); -lean_dec(x_29); -x_57 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_57, 0, x_55); -lean_ctor_set(x_57, 1, x_56); -return x_57; +lean_object* x_57; lean_object* x_58; lean_object* x_59; +x_57 = lean_ctor_get(x_38, 0); +x_58 = lean_ctor_get(x_38, 1); +lean_inc(x_58); +lean_inc(x_57); +lean_dec(x_38); +x_59 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_59, 0, x_57); +lean_ctor_set(x_59, 1, x_58); +return x_59; } } } else { -uint8_t x_58; -lean_dec(x_21); +uint8_t x_60; +lean_dec(x_27); lean_dec(x_7); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_58 = !lean_is_exclusive(x_22); -if (x_58 == 0) +x_60 = !lean_is_exclusive(x_35); +if (x_60 == 0) { -return x_22; +return x_35; } else { -lean_object* x_59; lean_object* x_60; lean_object* x_61; -x_59 = lean_ctor_get(x_22, 0); -x_60 = lean_ctor_get(x_22, 1); -lean_inc(x_60); -lean_inc(x_59); -lean_dec(x_22); -x_61 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_61, 0, x_59); -lean_ctor_set(x_61, 1, x_60); -return x_61; +lean_object* x_61; lean_object* x_62; lean_object* x_63; +x_61 = lean_ctor_get(x_35, 0); +x_62 = lean_ctor_get(x_35, 1); +lean_inc(x_62); +lean_inc(x_61); +lean_dec(x_35); +x_63 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_63, 0, x_61); +lean_ctor_set(x_63, 1, x_62); +return x_63; } } } else { -uint8_t x_62; +uint8_t x_64; +lean_dec(x_27); lean_dec(x_7); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_62 = !lean_is_exclusive(x_18); -if (x_62 == 0) +x_64 = !lean_is_exclusive(x_28); +if (x_64 == 0) { -return x_18; +return x_28; } else { -lean_object* x_63; lean_object* x_64; lean_object* x_65; -x_63 = lean_ctor_get(x_18, 0); -x_64 = lean_ctor_get(x_18, 1); -lean_inc(x_64); -lean_inc(x_63); -lean_dec(x_18); -x_65 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_65, 0, x_63); -lean_ctor_set(x_65, 1, x_64); -return x_65; +lean_object* x_65; lean_object* x_66; lean_object* x_67; +x_65 = lean_ctor_get(x_28, 0); +x_66 = lean_ctor_get(x_28, 1); +lean_inc(x_66); +lean_inc(x_65); +lean_dec(x_28); +x_67 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_67, 0, x_65); +lean_ctor_set(x_67, 1, x_66); +return x_67; } } } else { -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_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; -x_66 = lean_ctor_get(x_7, 0); -x_67 = lean_ctor_get(x_7, 1); -x_68 = lean_ctor_get(x_7, 2); -x_69 = lean_ctor_get(x_7, 3); -x_70 = lean_ctor_get(x_7, 4); -x_71 = lean_ctor_get(x_7, 5); -x_72 = lean_ctor_get(x_7, 6); -x_73 = lean_ctor_get(x_7, 7); +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_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; +x_68 = lean_ctor_get(x_7, 0); +x_69 = lean_ctor_get(x_7, 1); +x_70 = lean_ctor_get(x_7, 2); +x_71 = lean_ctor_get(x_7, 3); +x_72 = lean_ctor_get(x_7, 4); +x_73 = lean_ctor_get(x_7, 5); +x_74 = lean_ctor_get(x_7, 6); +x_75 = lean_ctor_get(x_7, 7); +lean_inc(x_75); +lean_inc(x_74); lean_inc(x_73); lean_inc(x_72); lean_inc(x_71); lean_inc(x_70); lean_inc(x_69); lean_inc(x_68); -lean_inc(x_67); -lean_inc(x_66); lean_dec(x_7); -x_74 = l_Lean_replaceRef(x_13, x_69); -lean_dec(x_69); -lean_dec(x_13); -x_75 = lean_alloc_ctor(0, 8, 0); -lean_ctor_set(x_75, 0, x_66); -lean_ctor_set(x_75, 1, x_67); -lean_ctor_set(x_75, 2, x_68); -lean_ctor_set(x_75, 3, x_74); -lean_ctor_set(x_75, 4, x_70); -lean_ctor_set(x_75, 5, x_71); -lean_ctor_set(x_75, 6, x_72); -lean_ctor_set(x_75, 7, x_73); -lean_inc(x_8); -lean_inc(x_75); -x_76 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1(x_2, x_14, x_3, x_4, x_5, x_6, x_75, x_8, x_9); -if (lean_obj_tag(x_76) == 0) -{ -lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; -x_77 = lean_ctor_get(x_76, 0); -lean_inc(x_77); -x_78 = lean_ctor_get(x_76, 1); -lean_inc(x_78); -lean_dec(x_76); -x_79 = lean_alloc_ctor(5, 1, 0); -lean_ctor_set(x_79, 0, x_77); -lean_inc(x_75); -lean_inc(x_3); +x_76 = l_Lean_replaceRef(x_19, x_71); +lean_dec(x_71); +lean_dec(x_19); +x_77 = lean_alloc_ctor(0, 8, 0); +lean_ctor_set(x_77, 0, x_68); +lean_ctor_set(x_77, 1, x_69); +lean_ctor_set(x_77, 2, x_70); +lean_ctor_set(x_77, 3, x_76); +lean_ctor_set(x_77, 4, x_72); +lean_ctor_set(x_77, 5, x_73); +lean_ctor_set(x_77, 6, x_74); +lean_ctor_set(x_77, 7, x_75); +x_78 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2(x_2, x_20, x_3, x_4, x_5, x_6, x_77, x_8, x_15); +x_79 = lean_ctor_get(x_78, 0); lean_inc(x_79); -x_80 = l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(x_79, x_3, x_4, x_5, x_6, x_75, x_8, x_78); -if (lean_obj_tag(x_80) == 0) -{ -lean_object* x_81; lean_object* x_82; size_t x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; -x_81 = lean_ctor_get(x_80, 1); +x_80 = lean_ctor_get(x_78, 1); +lean_inc(x_80); +lean_dec(x_78); +x_81 = lean_alloc_ctor(5, 1, 0); +lean_ctor_set(x_81, 0, x_79); +lean_inc(x_77); +lean_inc(x_3); lean_inc(x_81); -lean_dec(x_80); -x_82 = lean_array_get_size(x_1); -x_83 = lean_usize_of_nat(x_82); +x_82 = l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(x_81, x_3, x_4, x_5, x_6, x_77, x_8, x_80); +if (lean_obj_tag(x_82) == 0) +{ +lean_object* x_83; lean_object* x_84; size_t x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; +x_83 = lean_ctor_get(x_82, 1); +lean_inc(x_83); lean_dec(x_82); -x_84 = lean_box_usize(x_83); -x_85 = l_Lean_Elab_addAndCompileUnsafe___boxed__const__1; -lean_inc(x_1); -x_86 = lean_alloc_closure((void*)(l_Lean_Elab_addAndCompileUnsafe___lambda__1___boxed), 10, 3); -lean_closure_set(x_86, 0, x_1); -lean_closure_set(x_86, 1, x_84); -lean_closure_set(x_86, 2, x_85); +x_84 = lean_array_get_size(x_14); +x_85 = lean_usize_of_nat(x_84); +lean_dec(x_84); +x_86 = lean_box_usize(x_85); +x_87 = l_Lean_Elab_addAndCompileUnsafe___boxed__const__1; +lean_inc(x_14); +x_88 = lean_alloc_closure((void*)(l_Lean_Elab_addAndCompileUnsafe___lambda__1___boxed), 10, 3); +lean_closure_set(x_88, 0, x_14); +lean_closure_set(x_88, 1, x_86); +lean_closure_set(x_88, 2, x_87); lean_inc(x_8); -lean_inc(x_75); +lean_inc(x_77); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); lean_inc(x_3); -x_87 = l_Lean_Elab_withSaveInfoContext___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__2(x_86, x_3, x_4, x_5, x_6, x_75, x_8, x_81); -if (lean_obj_tag(x_87) == 0) +x_89 = l_Lean_Elab_withSaveInfoContext___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___spec__2(x_88, x_3, x_4, x_5, x_6, x_77, x_8, x_83); +if (lean_obj_tag(x_89) == 0) { -lean_object* x_88; uint8_t x_89; lean_object* x_90; -x_88 = lean_ctor_get(x_87, 1); -lean_inc(x_88); -lean_dec(x_87); -x_89 = 0; +lean_object* x_90; uint8_t x_91; lean_object* x_92; +x_90 = lean_ctor_get(x_89, 1); +lean_inc(x_90); +lean_dec(x_89); +x_91 = 0; lean_inc(x_8); -lean_inc(x_75); +lean_inc(x_77); lean_inc(x_3); -x_90 = l_Lean_Elab_applyAttributesOf(x_1, x_89, x_3, x_4, x_5, x_6, x_75, x_8, x_88); -if (lean_obj_tag(x_90) == 0) -{ -lean_object* x_91; lean_object* x_92; -x_91 = lean_ctor_get(x_90, 1); -lean_inc(x_91); -lean_dec(x_90); -lean_inc(x_8); -lean_inc(x_75); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -lean_inc(x_3); -x_92 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl(x_79, x_3, x_4, x_5, x_6, x_75, x_8, x_91); +x_92 = l_Lean_Elab_applyAttributesOf(x_14, x_91, x_3, x_4, x_5, x_6, x_77, x_8, x_90); if (lean_obj_tag(x_92) == 0) { -lean_object* x_93; uint8_t x_94; -x_93 = lean_ctor_get(x_92, 0); +lean_object* x_93; lean_object* x_94; +x_93 = lean_ctor_get(x_92, 1); lean_inc(x_93); -x_94 = lean_unbox(x_93); -lean_dec(x_93); -if (x_94 == 0) -{ -lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; -lean_dec(x_75); -lean_dec(x_8); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_1); -x_95 = lean_ctor_get(x_92, 1); -lean_inc(x_95); -if (lean_is_exclusive(x_92)) { - lean_ctor_release(x_92, 0); - lean_ctor_release(x_92, 1); - x_96 = x_92; -} else { - lean_dec_ref(x_92); - x_96 = lean_box(0); -} -x_97 = lean_box(0); -if (lean_is_scalar(x_96)) { - x_98 = lean_alloc_ctor(0, 2, 0); -} else { - x_98 = x_96; -} -lean_ctor_set(x_98, 0, x_97); -lean_ctor_set(x_98, 1, x_95); -return x_98; -} -else -{ -lean_object* x_99; lean_object* x_100; lean_object* x_101; -x_99 = lean_ctor_get(x_92, 1); -lean_inc(x_99); lean_dec(x_92); -x_100 = lean_box(0); -x_101 = l_Lean_Elab_addAndCompileUnsafe___lambda__2(x_1, x_100, x_3, x_4, x_5, x_6, x_75, x_8, x_99); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_1); -return x_101; -} -} -else +lean_inc(x_8); +lean_inc(x_77); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_4); +lean_inc(x_3); +x_94 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl(x_81, x_3, x_4, x_5, x_6, x_77, x_8, x_93); +if (lean_obj_tag(x_94) == 0) { -lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; -lean_dec(x_75); +lean_object* x_95; uint8_t x_96; +x_95 = lean_ctor_get(x_94, 0); +lean_inc(x_95); +x_96 = lean_unbox(x_95); +lean_dec(x_95); +if (x_96 == 0) +{ +lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; +lean_dec(x_77); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_102 = lean_ctor_get(x_92, 0); -lean_inc(x_102); -x_103 = lean_ctor_get(x_92, 1); -lean_inc(x_103); +x_97 = lean_ctor_get(x_94, 1); +lean_inc(x_97); +if (lean_is_exclusive(x_94)) { + lean_ctor_release(x_94, 0); + lean_ctor_release(x_94, 1); + x_98 = x_94; +} else { + lean_dec_ref(x_94); + x_98 = lean_box(0); +} +x_99 = lean_box(0); +if (lean_is_scalar(x_98)) { + x_100 = lean_alloc_ctor(0, 2, 0); +} else { + x_100 = x_98; +} +lean_ctor_set(x_100, 0, x_99); +lean_ctor_set(x_100, 1, x_97); +return x_100; +} +else +{ +lean_object* x_101; lean_object* x_102; lean_object* x_103; +x_101 = lean_ctor_get(x_94, 1); +lean_inc(x_101); +lean_dec(x_94); +x_102 = lean_box(0); +x_103 = l_Lean_Elab_addAndCompileUnsafe___lambda__2(x_14, x_102, x_3, x_4, x_5, x_6, x_77, x_8, x_101); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_14); +return x_103; +} +} +else +{ +lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; +lean_dec(x_77); +lean_dec(x_14); +lean_dec(x_8); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +x_104 = lean_ctor_get(x_94, 0); +lean_inc(x_104); +x_105 = lean_ctor_get(x_94, 1); +lean_inc(x_105); +if (lean_is_exclusive(x_94)) { + lean_ctor_release(x_94, 0); + lean_ctor_release(x_94, 1); + x_106 = x_94; +} else { + lean_dec_ref(x_94); + x_106 = lean_box(0); +} +if (lean_is_scalar(x_106)) { + x_107 = lean_alloc_ctor(1, 2, 0); +} else { + x_107 = x_106; +} +lean_ctor_set(x_107, 0, x_104); +lean_ctor_set(x_107, 1, x_105); +return x_107; +} +} +else +{ +lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; +lean_dec(x_81); +lean_dec(x_77); +lean_dec(x_14); +lean_dec(x_8); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +x_108 = lean_ctor_get(x_92, 0); +lean_inc(x_108); +x_109 = lean_ctor_get(x_92, 1); +lean_inc(x_109); if (lean_is_exclusive(x_92)) { lean_ctor_release(x_92, 0); lean_ctor_release(x_92, 1); - x_104 = x_92; + x_110 = x_92; } else { lean_dec_ref(x_92); - x_104 = lean_box(0); + x_110 = lean_box(0); } -if (lean_is_scalar(x_104)) { - x_105 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_110)) { + x_111 = lean_alloc_ctor(1, 2, 0); } else { - x_105 = x_104; + x_111 = x_110; } -lean_ctor_set(x_105, 0, x_102); -lean_ctor_set(x_105, 1, x_103); -return x_105; +lean_ctor_set(x_111, 0, x_108); +lean_ctor_set(x_111, 1, x_109); +return x_111; } } else { -lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; -lean_dec(x_79); -lean_dec(x_75); +lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; +lean_dec(x_81); +lean_dec(x_77); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_106 = lean_ctor_get(x_90, 0); -lean_inc(x_106); -x_107 = lean_ctor_get(x_90, 1); -lean_inc(x_107); -if (lean_is_exclusive(x_90)) { - lean_ctor_release(x_90, 0); - lean_ctor_release(x_90, 1); - x_108 = x_90; +x_112 = lean_ctor_get(x_89, 0); +lean_inc(x_112); +x_113 = lean_ctor_get(x_89, 1); +lean_inc(x_113); +if (lean_is_exclusive(x_89)) { + lean_ctor_release(x_89, 0); + lean_ctor_release(x_89, 1); + x_114 = x_89; } else { - lean_dec_ref(x_90); - x_108 = lean_box(0); + lean_dec_ref(x_89); + x_114 = lean_box(0); } -if (lean_is_scalar(x_108)) { - x_109 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_114)) { + x_115 = lean_alloc_ctor(1, 2, 0); } else { - x_109 = x_108; + x_115 = x_114; } -lean_ctor_set(x_109, 0, x_106); -lean_ctor_set(x_109, 1, x_107); -return x_109; +lean_ctor_set(x_115, 0, x_112); +lean_ctor_set(x_115, 1, x_113); +return x_115; } } else { -lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; -lean_dec(x_79); -lean_dec(x_75); +lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; +lean_dec(x_81); +lean_dec(x_77); +lean_dec(x_14); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_110 = lean_ctor_get(x_87, 0); -lean_inc(x_110); -x_111 = lean_ctor_get(x_87, 1); -lean_inc(x_111); -if (lean_is_exclusive(x_87)) { - lean_ctor_release(x_87, 0); - lean_ctor_release(x_87, 1); - x_112 = x_87; +x_116 = lean_ctor_get(x_82, 0); +lean_inc(x_116); +x_117 = lean_ctor_get(x_82, 1); +lean_inc(x_117); +if (lean_is_exclusive(x_82)) { + lean_ctor_release(x_82, 0); + lean_ctor_release(x_82, 1); + x_118 = x_82; } else { - lean_dec_ref(x_87); - x_112 = lean_box(0); + lean_dec_ref(x_82); + x_118 = lean_box(0); } -if (lean_is_scalar(x_112)) { - x_113 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_118)) { + x_119 = lean_alloc_ctor(1, 2, 0); } else { - x_113 = x_112; + x_119 = x_118; +} +lean_ctor_set(x_119, 0, x_116); +lean_ctor_set(x_119, 1, x_117); +return x_119; } -lean_ctor_set(x_113, 0, x_110); -lean_ctor_set(x_113, 1, x_111); -return x_113; } } else { -lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; -lean_dec(x_79); -lean_dec(x_75); +uint8_t x_120; lean_dec(x_8); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_1); -x_114 = lean_ctor_get(x_80, 0); -lean_inc(x_114); -x_115 = lean_ctor_get(x_80, 1); -lean_inc(x_115); -if (lean_is_exclusive(x_80)) { - lean_ctor_release(x_80, 0); - lean_ctor_release(x_80, 1); - x_116 = x_80; -} else { - lean_dec_ref(x_80); - x_116 = lean_box(0); -} -if (lean_is_scalar(x_116)) { - x_117 = lean_alloc_ctor(1, 2, 0); -} else { - x_117 = x_116; -} -lean_ctor_set(x_117, 0, x_114); -lean_ctor_set(x_117, 1, x_115); -return x_117; -} +x_120 = !lean_is_exclusive(x_13); +if (x_120 == 0) +{ +return x_13; } else { -lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; -lean_dec(x_75); -lean_dec(x_8); +lean_object* x_121; lean_object* x_122; lean_object* x_123; +x_121 = lean_ctor_get(x_13, 0); +x_122 = lean_ctor_get(x_13, 1); +lean_inc(x_122); +lean_inc(x_121); +lean_dec(x_13); +x_123 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_123, 0, x_121); +lean_ctor_set(x_123, 1, x_122); +return x_123; +} +} +} +} +LEAN_EXPORT lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompileUnsafe___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, lean_object* x_8, lean_object* x_9, lean_object* x_10) { +_start: +{ +size_t x_11; size_t x_12; lean_object* x_13; +x_11 = lean_unbox_usize(x_1); +lean_dec(x_1); +x_12 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_13 = l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompileUnsafe___spec__1(x_11, x_12, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_1); -x_118 = lean_ctor_get(x_76, 0); -lean_inc(x_118); -x_119 = lean_ctor_get(x_76, 1); -lean_inc(x_119); -if (lean_is_exclusive(x_76)) { - lean_ctor_release(x_76, 0); - lean_ctor_release(x_76, 1); - x_120 = x_76; -} else { - lean_dec_ref(x_76); - x_120 = lean_box(0); -} -if (lean_is_scalar(x_120)) { - x_121 = lean_alloc_ctor(1, 2, 0); -} else { - x_121 = x_120; -} -lean_ctor_set(x_121, 0, x_118); -lean_ctor_set(x_121, 1, x_119); -return x_121; +return x_13; } } -} -} -LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___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, lean_object* x_8, lean_object* x_9) { +LEAN_EXPORT lean_object* l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2___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, lean_object* x_8, lean_object* x_9) { _start: { uint8_t x_10; lean_object* x_11; x_10 = lean_unbox(x_1); lean_dec(x_1); -x_11 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__1(x_10, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +x_11 = l_List_mapM___at_Lean_Elab_addAndCompileUnsafe___spec__2(x_10, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +lean_dec(x_8); +lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); @@ -7133,7 +7209,7 @@ lean_dec(x_3); return x_11; } } -LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__2___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, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) { +LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__3___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, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) { _start: { size_t x_12; size_t x_13; lean_object* x_14; @@ -7141,7 +7217,7 @@ x_12 = lean_unbox_usize(x_2); lean_dec(x_2); x_13 = lean_unbox_usize(x_3); lean_dec(x_3); -x_14 = l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__2(x_1, x_12, x_13, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11); +x_14 = l_Array_forInUnsafe_loop___at_Lean_Elab_addAndCompileUnsafe___spec__3(x_1, x_12, x_13, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11); lean_dec(x_1); return x_14; } @@ -8320,10 +8396,10 @@ l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl___closed__1 = lean_mark_persistent(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_compileDecl___closed__1); l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1 = _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1(); lean_mark_persistent(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1); -l_Lean_Elab_eraseRecAppSyntax___closed__1 = _init_l_Lean_Elab_eraseRecAppSyntax___closed__1(); -lean_mark_persistent(l_Lean_Elab_eraseRecAppSyntax___closed__1); -l_Lean_Elab_eraseRecAppSyntax___closed__2 = _init_l_Lean_Elab_eraseRecAppSyntax___closed__2(); -lean_mark_persistent(l_Lean_Elab_eraseRecAppSyntax___closed__2); +l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1 = _init_l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1(); +lean_mark_persistent(l_Lean_Elab_eraseRecAppSyntaxExpr___closed__1); +l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2 = _init_l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2(); +lean_mark_persistent(l_Lean_Elab_eraseRecAppSyntaxExpr___closed__2); l_Lean_Elab_addAndCompileUnsafe___boxed__const__1 = _init_l_Lean_Elab_addAndCompileUnsafe___boxed__const__1(); lean_mark_persistent(l_Lean_Elab_addAndCompileUnsafe___boxed__const__1); l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_addAndCompilePartialRec___spec__2___closed__1 = _init_l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_addAndCompilePartialRec___spec__2___closed__1(); diff --git a/stage0/stdlib/Lean/Elab/PreDefinition/Main.c b/stage0/stdlib/Lean/Elab/PreDefinition/Main.c index 2c8fac3b54..cd9adaaa49 100644 --- a/stage0/stdlib/Lean/Elab/PreDefinition/Main.c +++ b/stage0/stdlib/Lean/Elab/PreDefinition/Main.c @@ -4593,7 +4593,6 @@ lean_inc(x_6); lean_inc(x_5); lean_inc(x_3); lean_inc(x_2); -lean_inc(x_1); x_20 = l_Lean_Elab_Structural_structuralRecursion(x_1, x_2, x_3, x_5, x_6, x_7, x_8, x_18); if (lean_obj_tag(x_20) == 0) { diff --git a/stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c b/stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c index 4431faf78b..0b01edb18b 100644 --- a/stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c +++ b/stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c @@ -28,7 +28,7 @@ lean_object* lean_array_uget(lean_object*, size_t); LEAN_EXPORT lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Structural_structuralRecursion___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__6___closed__3; -LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1045_(lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1079_(lean_object*); static lean_object* l_Lean_Elab_Structural_structuralRecursion___lambda__1___closed__1; lean_object* lean_st_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Elab_Structural_mkIndPredBRecOn(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -36,9 +36,11 @@ lean_object* l_Lean_Elab_Structural_findRecArg___rarg(lean_object*, lean_object* static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__1; uint8_t l_Lean_Expr_isAppOf(lean_object*, lean_object*); lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*); +lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* l_Lean_MessageData_ofList(lean_object*); static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__8; +lean_object* l_Lean_Elab_eraseRecAppSyntax(lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__4; uint8_t lean_usize_dec_lt(size_t, size_t); static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___closed__2; @@ -92,6 +94,7 @@ LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_PreDe lean_object* l_Lean_Expr_getAppNumArgsAux(lean_object*, lean_object*); uint8_t lean_nat_dec_le(lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Elab_Structural_structuralRecursion___closed__5; static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__5___closed__2; static lean_object* l_Lean_Elab_Structural_structuralRecursion___closed__4; lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*); @@ -115,6 +118,7 @@ LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__ static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__2___closed__3; static lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__6___closed__1; LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_PreDefinition_Structural_IndPred_0__Lean_Elab_Structural_replaceIndPredRecApps_loop___spec__8(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_Structural_Main_0__Lean_Elab_Structural_elimRecursion___lambda__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_lt(lean_object*, lean_object*); @@ -2426,6 +2430,15 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Structural_structuralRecursion___la return x_1; } } +static lean_object* _init_l_Lean_Elab_Structural_structuralRecursion___closed__5() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = lean_unsigned_to_nat(1u); +x_2 = lean_mk_empty_array_with_capacity(x_1); +return x_2; +} +} LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion(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, lean_object* x_8) { _start: { @@ -2437,7 +2450,6 @@ lean_dec(x_9); if (x_11 == 0) { lean_object* x_12; lean_object* x_13; -lean_dec(x_1); x_12 = l_Lean_Elab_Structural_structuralRecursion___closed__2; x_13 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1(x_12, x_2, x_3, x_4, x_5, x_6, x_7, x_8); lean_dec(x_7); @@ -2464,7 +2476,7 @@ lean_inc(x_4); x_19 = l_Lean_Elab_Structural_run___rarg(x_17, x_18, x_4, x_5, x_6, x_7, x_8); if (lean_obj_tag(x_19) == 0) { -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; uint8_t x_27; lean_object* x_28; +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_19, 0); lean_inc(x_20); x_21 = lean_ctor_get(x_20, 0); @@ -2480,215 +2492,176 @@ lean_inc(x_24); x_25 = lean_ctor_get(x_21, 1); lean_inc(x_25); lean_dec(x_21); -x_26 = lean_array_get_size(x_23); -x_27 = lean_nat_dec_lt(x_15, x_26); -if (x_27 == 0) +lean_inc(x_7); +lean_inc(x_6); +x_26 = l_Lean_Elab_eraseRecAppSyntax(x_25, x_6, x_7, x_22); +if (lean_obj_tag(x_26) == 0) { +lean_object* x_27; lean_object* x_28; lean_object* x_29; +x_27 = lean_ctor_get(x_26, 0); +lean_inc(x_27); +x_28 = lean_ctor_get(x_26, 1); +lean_inc(x_28); lean_dec(x_26); +lean_inc(x_7); +lean_inc(x_6); +x_29 = l_Lean_Elab_eraseRecAppSyntax(x_16, x_6, x_7, x_28); +if (lean_obj_tag(x_29) == 0) +{ +lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33; lean_object* x_34; +x_30 = lean_ctor_get(x_29, 0); +lean_inc(x_30); +x_31 = lean_ctor_get(x_29, 1); +lean_inc(x_31); +lean_dec(x_29); +x_32 = lean_array_get_size(x_23); +x_33 = lean_nat_dec_lt(x_15, x_32); +if (x_33 == 0) +{ +lean_dec(x_32); lean_dec(x_23); -x_28 = x_22; -goto block_50; +x_34 = x_31; +goto block_58; } else { -uint8_t x_51; -x_51 = lean_nat_dec_le(x_26, x_26); -if (x_51 == 0) +uint8_t x_59; +x_59 = lean_nat_dec_le(x_32, x_32); +if (x_59 == 0) { -lean_dec(x_26); +lean_dec(x_32); lean_dec(x_23); -x_28 = x_22; -goto block_50; +x_34 = x_31; +goto block_58; } else { -size_t x_52; size_t x_53; lean_object* x_54; lean_object* x_55; -x_52 = 0; -x_53 = lean_usize_of_nat(x_26); -lean_dec(x_26); -x_54 = lean_box(0); +size_t x_60; size_t x_61; lean_object* x_62; lean_object* x_63; +x_60 = 0; +x_61 = lean_usize_of_nat(x_32); +lean_dec(x_32); +x_62 = lean_box(0); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); -x_55 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Structural_structuralRecursion___spec__1(x_23, x_52, x_53, x_54, x_2, x_3, x_4, x_5, x_6, x_7, x_22); +x_63 = l_Array_foldlMUnsafe_fold___at_Lean_Elab_Structural_structuralRecursion___spec__1(x_23, x_60, x_61, x_62, x_2, x_3, x_4, x_5, x_6, x_7, x_31); lean_dec(x_23); -if (lean_obj_tag(x_55) == 0) +if (lean_obj_tag(x_63) == 0) { -lean_object* x_56; -x_56 = lean_ctor_get(x_55, 1); -lean_inc(x_56); -lean_dec(x_55); -x_28 = x_56; -goto block_50; +lean_object* x_64; +x_64 = lean_ctor_get(x_63, 1); +lean_inc(x_64); +lean_dec(x_63); +x_34 = x_64; +goto block_58; } else { -uint8_t x_57; -lean_dec(x_25); +uint8_t x_65; +lean_dec(x_30); +lean_dec(x_27); lean_dec(x_24); -lean_dec(x_16); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -lean_dec(x_1); -x_57 = !lean_is_exclusive(x_55); -if (x_57 == 0) +x_65 = !lean_is_exclusive(x_63); +if (x_65 == 0) { -return x_55; +return x_63; } else { -lean_object* x_58; lean_object* x_59; lean_object* x_60; -x_58 = lean_ctor_get(x_55, 0); -x_59 = lean_ctor_get(x_55, 1); -lean_inc(x_59); -lean_inc(x_58); -lean_dec(x_55); -x_60 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_60, 0, x_58); -lean_ctor_set(x_60, 1, x_59); -return x_60; +lean_object* x_66; lean_object* x_67; lean_object* x_68; +x_66 = lean_ctor_get(x_63, 0); +x_67 = lean_ctor_get(x_63, 1); +lean_inc(x_67); +lean_inc(x_66); +lean_dec(x_63); +x_68 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_68, 0, x_66); +lean_ctor_set(x_68, 1, x_67); +return x_68; } } } } -block_50: +block_58: { -lean_object* x_29; lean_object* x_30; lean_object* x_31; +lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_inc(x_3); lean_inc(x_2); -x_29 = lean_alloc_closure((void*)(l_Lean_Elab_addNonRec), 8, 3); -lean_closure_set(x_29, 0, x_25); -lean_closure_set(x_29, 1, x_2); -lean_closure_set(x_29, 2, x_3); -x_30 = l_Lean_Elab_Structural_structuralRecursion___closed__4; +x_35 = lean_alloc_closure((void*)(l_Lean_Elab_addNonRec), 8, 3); +lean_closure_set(x_35, 0, x_27); +lean_closure_set(x_35, 1, x_2); +lean_closure_set(x_35, 2, x_3); +x_36 = l_Lean_Elab_Structural_structuralRecursion___closed__4; lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); -x_31 = l_Lean_Meta_mapErrorImp___rarg(x_29, x_30, x_4, x_5, x_6, x_7, x_28); -if (lean_obj_tag(x_31) == 0) +x_37 = l_Lean_Meta_mapErrorImp___rarg(x_35, x_36, x_4, x_5, x_6, x_7, x_34); +if (lean_obj_tag(x_37) == 0) { -lean_object* x_32; lean_object* x_33; -x_32 = lean_ctor_get(x_31, 1); -lean_inc(x_32); -lean_dec(x_31); +lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; +x_38 = lean_ctor_get(x_37, 1); +lean_inc(x_38); +lean_dec(x_37); +x_39 = l_Lean_Elab_Structural_structuralRecursion___closed__5; +lean_inc(x_30); +x_40 = lean_array_push(x_39, x_30); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); lean_inc(x_3); lean_inc(x_2); -x_33 = l_Lean_Elab_addAndCompilePartialRec(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_32); -if (lean_obj_tag(x_33) == 0) +x_41 = l_Lean_Elab_addAndCompilePartialRec(x_40, x_2, x_3, x_4, x_5, x_6, x_7, x_38); +if (lean_obj_tag(x_41) == 0) { -lean_object* x_34; lean_object* x_35; -x_34 = lean_ctor_get(x_33, 1); -lean_inc(x_34); -lean_dec(x_33); +lean_object* x_42; lean_object* x_43; +x_42 = lean_ctor_get(x_41, 1); +lean_inc(x_42); +lean_dec(x_41); lean_inc(x_7); lean_inc(x_6); lean_inc(x_24); -lean_inc(x_16); -x_35 = l_Lean_Elab_Structural_addSmartUnfoldingDef(x_16, x_24, x_2, x_3, x_4, x_5, x_6, x_7, x_34); -if (lean_obj_tag(x_35) == 0) +lean_inc(x_30); +x_43 = l_Lean_Elab_Structural_addSmartUnfoldingDef(x_30, x_24, x_2, x_3, x_4, x_5, x_6, x_7, x_42); +if (lean_obj_tag(x_43) == 0) { -lean_object* x_36; lean_object* x_37; -x_36 = lean_ctor_get(x_35, 1); -lean_inc(x_36); -lean_dec(x_35); -x_37 = l_Lean_Elab_Structural_registerEqnsInfo(x_16, x_24, x_6, x_7, x_36); -lean_dec(x_7); -lean_dec(x_6); -return x_37; -} -else -{ -uint8_t x_38; -lean_dec(x_24); -lean_dec(x_16); -lean_dec(x_7); -lean_dec(x_6); -x_38 = !lean_is_exclusive(x_35); -if (x_38 == 0) -{ -return x_35; -} -else -{ -lean_object* x_39; lean_object* x_40; lean_object* x_41; -x_39 = lean_ctor_get(x_35, 0); -x_40 = lean_ctor_get(x_35, 1); -lean_inc(x_40); -lean_inc(x_39); -lean_dec(x_35); -x_41 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_41, 0, x_39); -lean_ctor_set(x_41, 1, x_40); -return x_41; -} -} -} -else -{ -uint8_t x_42; -lean_dec(x_24); -lean_dec(x_16); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_2); -x_42 = !lean_is_exclusive(x_33); -if (x_42 == 0) -{ -return x_33; -} -else -{ -lean_object* x_43; lean_object* x_44; lean_object* x_45; -x_43 = lean_ctor_get(x_33, 0); -x_44 = lean_ctor_get(x_33, 1); +lean_object* x_44; lean_object* x_45; +x_44 = lean_ctor_get(x_43, 1); lean_inc(x_44); -lean_inc(x_43); -lean_dec(x_33); -x_45 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_45, 0, x_43); -lean_ctor_set(x_45, 1, x_44); +lean_dec(x_43); +x_45 = l_Lean_Elab_Structural_registerEqnsInfo(x_30, x_24, x_6, x_7, x_44); +lean_dec(x_7); +lean_dec(x_6); return x_45; } -} -} else { uint8_t x_46; +lean_dec(x_30); lean_dec(x_24); -lean_dec(x_16); lean_dec(x_7); lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_2); -lean_dec(x_1); -x_46 = !lean_is_exclusive(x_31); +x_46 = !lean_is_exclusive(x_43); if (x_46 == 0) { -return x_31; +return x_43; } else { lean_object* x_47; lean_object* x_48; lean_object* x_49; -x_47 = lean_ctor_get(x_31, 0); -x_48 = lean_ctor_get(x_31, 1); +x_47 = lean_ctor_get(x_43, 0); +x_48 = lean_ctor_get(x_43, 1); lean_inc(x_48); lean_inc(x_47); -lean_dec(x_31); +lean_dec(x_43); x_49 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_49, 0, x_47); lean_ctor_set(x_49, 1, x_48); @@ -2696,10 +2669,106 @@ return x_49; } } } +else +{ +uint8_t x_50; +lean_dec(x_30); +lean_dec(x_24); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_50 = !lean_is_exclusive(x_41); +if (x_50 == 0) +{ +return x_41; } else { -uint8_t x_61; +lean_object* x_51; lean_object* x_52; lean_object* x_53; +x_51 = lean_ctor_get(x_41, 0); +x_52 = lean_ctor_get(x_41, 1); +lean_inc(x_52); +lean_inc(x_51); +lean_dec(x_41); +x_53 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_53, 0, x_51); +lean_ctor_set(x_53, 1, x_52); +return x_53; +} +} +} +else +{ +uint8_t x_54; +lean_dec(x_30); +lean_dec(x_24); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_54 = !lean_is_exclusive(x_37); +if (x_54 == 0) +{ +return x_37; +} +else +{ +lean_object* x_55; lean_object* x_56; lean_object* x_57; +x_55 = lean_ctor_get(x_37, 0); +x_56 = lean_ctor_get(x_37, 1); +lean_inc(x_56); +lean_inc(x_55); +lean_dec(x_37); +x_57 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_57, 0, x_55); +lean_ctor_set(x_57, 1, x_56); +return x_57; +} +} +} +} +else +{ +uint8_t x_69; +lean_dec(x_27); +lean_dec(x_24); +lean_dec(x_23); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_69 = !lean_is_exclusive(x_29); +if (x_69 == 0) +{ +return x_29; +} +else +{ +lean_object* x_70; lean_object* x_71; lean_object* x_72; +x_70 = lean_ctor_get(x_29, 0); +x_71 = lean_ctor_get(x_29, 1); +lean_inc(x_71); +lean_inc(x_70); +lean_dec(x_29); +x_72 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_72, 0, x_70); +lean_ctor_set(x_72, 1, x_71); +return x_72; +} +} +} +else +{ +uint8_t x_73; +lean_dec(x_24); +lean_dec(x_23); lean_dec(x_16); lean_dec(x_7); lean_dec(x_6); @@ -2707,24 +2776,53 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -lean_dec(x_1); -x_61 = !lean_is_exclusive(x_19); -if (x_61 == 0) +x_73 = !lean_is_exclusive(x_26); +if (x_73 == 0) +{ +return x_26; +} +else +{ +lean_object* x_74; lean_object* x_75; lean_object* x_76; +x_74 = lean_ctor_get(x_26, 0); +x_75 = lean_ctor_get(x_26, 1); +lean_inc(x_75); +lean_inc(x_74); +lean_dec(x_26); +x_76 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_76, 0, x_74); +lean_ctor_set(x_76, 1, x_75); +return x_76; +} +} +} +else +{ +uint8_t x_77; +lean_dec(x_16); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_77 = !lean_is_exclusive(x_19); +if (x_77 == 0) { return x_19; } else { -lean_object* x_62; lean_object* x_63; lean_object* x_64; -x_62 = lean_ctor_get(x_19, 0); -x_63 = lean_ctor_get(x_19, 1); -lean_inc(x_63); -lean_inc(x_62); +lean_object* x_78; lean_object* x_79; lean_object* x_80; +x_78 = lean_ctor_get(x_19, 0); +x_79 = lean_ctor_get(x_19, 1); +lean_inc(x_79); +lean_inc(x_78); lean_dec(x_19); -x_64 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_64, 0, x_62); -lean_ctor_set(x_64, 1, x_63); -return x_64; +x_80 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_80, 0, x_78); +lean_ctor_set(x_80, 1, x_79); +return x_80; } } } @@ -2745,7 +2843,16 @@ lean_dec(x_1); return x_14; } } -LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1045_(lean_object* x_1) { +LEAN_EXPORT lean_object* l_Lean_Elab_Structural_structuralRecursion___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, lean_object* x_8) { +_start: +{ +lean_object* x_9; +x_9 = l_Lean_Elab_Structural_structuralRecursion(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8); +lean_dec(x_1); +return x_9; +} +} +LEAN_EXPORT lean_object* l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1079_(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; @@ -2845,7 +2952,9 @@ l_Lean_Elab_Structural_structuralRecursion___closed__3 = _init_l_Lean_Elab_Struc lean_mark_persistent(l_Lean_Elab_Structural_structuralRecursion___closed__3); l_Lean_Elab_Structural_structuralRecursion___closed__4 = _init_l_Lean_Elab_Structural_structuralRecursion___closed__4(); lean_mark_persistent(l_Lean_Elab_Structural_structuralRecursion___closed__4); -res = l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1045_(lean_io_mk_world()); +l_Lean_Elab_Structural_structuralRecursion___closed__5 = _init_l_Lean_Elab_Structural_structuralRecursion___closed__5(); +lean_mark_persistent(l_Lean_Elab_Structural_structuralRecursion___closed__5); +res = l_Lean_Elab_Structural_initFn____x40_Lean_Elab_PreDefinition_Structural_Main___hyg_1079_(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); return lean_io_result_mk_ok(lean_box(0)); diff --git a/stage0/stdlib/Lean/Elab/PreDefinition/WF/Main.c b/stage0/stdlib/Lean/Elab/PreDefinition/WF/Main.c index dfee6ebf5a..91e1f309cb 100644 --- a/stage0/stdlib/Lean/Elab/PreDefinition/WF/Main.c +++ b/stage0/stdlib/Lean/Elab/PreDefinition/WF/Main.c @@ -34,6 +34,7 @@ static lean_object* l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinitio lean_object* lean_array_get_size(lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Elab_WF_packMutual(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_eraseRecAppSyntax(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_instInhabitedTermElabM(lean_object*); uint8_t lean_usize_dec_lt(size_t, size_t); LEAN_EXPORT lean_object* l_Lean_Elab_wfRecursion___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -55,7 +56,7 @@ lean_object* l_Lean_Elab_WF_mkUnaryArg_go___boxed(lean_object*, lean_object*, le lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkLambdaFVars(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs_mkSum___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_881_(lean_object*); +LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_895_(lean_object*); static lean_object* l_Lean_Expr_withAppAux___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs_mkSum___spec__1___closed__10; extern lean_object* l_Lean_Elab_instInhabitedPreDefinition; lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -1795,7 +1796,7 @@ lean_inc(x_4); x_38 = l_Lean_Elab_WF_mkFix(x_25, x_30, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_37); if (lean_obj_tag(x_38) == 0) { -lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; uint8_t x_44; lean_object* x_45; lean_object* x_58; lean_object* x_59; lean_object* x_60; uint8_t x_61; +lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; x_39 = lean_ctor_get(x_38, 0); lean_inc(x_39); x_40 = lean_ctor_get(x_38, 1); @@ -1805,113 +1806,115 @@ x_41 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6, x_42 = lean_ctor_get(x_41, 1); lean_inc(x_42); lean_dec(x_41); -x_43 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__6; -x_58 = lean_st_ref_get(x_9, x_42); -x_59 = lean_ctor_get(x_58, 0); -lean_inc(x_59); -x_60 = lean_ctor_get(x_59, 3); -lean_inc(x_60); -lean_dec(x_59); -x_61 = lean_ctor_get_uint8(x_60, sizeof(void*)*1); -lean_dec(x_60); -if (x_61 == 0) +lean_inc(x_9); +lean_inc(x_8); +x_43 = l_Lean_Elab_eraseRecAppSyntax(x_39, x_8, x_9, x_42); +if (lean_obj_tag(x_43) == 0) { -lean_object* x_62; uint8_t x_63; -x_62 = lean_ctor_get(x_58, 1); +lean_object* x_44; lean_object* x_45; lean_object* x_46; uint8_t x_47; lean_object* x_48; lean_object* x_61; lean_object* x_62; lean_object* x_63; uint8_t x_64; +x_44 = lean_ctor_get(x_43, 0); +lean_inc(x_44); +x_45 = lean_ctor_get(x_43, 1); +lean_inc(x_45); +lean_dec(x_43); +x_46 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__6; +x_61 = lean_st_ref_get(x_9, x_45); +x_62 = lean_ctor_get(x_61, 0); lean_inc(x_62); -lean_dec(x_58); -x_63 = 0; -x_44 = x_63; -x_45 = x_62; -goto block_57; +x_63 = lean_ctor_get(x_62, 3); +lean_inc(x_63); +lean_dec(x_62); +x_64 = lean_ctor_get_uint8(x_63, sizeof(void*)*1); +lean_dec(x_63); +if (x_64 == 0) +{ +lean_object* x_65; uint8_t x_66; +x_65 = lean_ctor_get(x_61, 1); +lean_inc(x_65); +lean_dec(x_61); +x_66 = 0; +x_47 = x_66; +x_48 = x_65; +goto block_60; } else { -lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; uint8_t x_68; -x_64 = lean_ctor_get(x_58, 1); -lean_inc(x_64); -lean_dec(x_58); -x_65 = l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(x_43, x_4, x_5, x_6, x_7, x_8, x_9, x_64); -x_66 = lean_ctor_get(x_65, 0); -lean_inc(x_66); -x_67 = lean_ctor_get(x_65, 1); +lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; uint8_t x_71; +x_67 = lean_ctor_get(x_61, 1); lean_inc(x_67); -lean_dec(x_65); -x_68 = lean_unbox(x_66); -lean_dec(x_66); -x_44 = x_68; -x_45 = x_67; -goto block_57; -} -block_57: -{ -if (x_44 == 0) -{ -lean_object* x_46; -x_46 = l_Lean_Elab_wfRecursion___lambda__1(x_39, x_1, x_18, x_4, x_5, x_6, x_7, x_8, x_9, x_45); -return x_46; -} -else -{ -lean_object* x_47; lean_object* x_48; 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; -x_47 = lean_ctor_get(x_39, 3); -lean_inc(x_47); -x_48 = lean_alloc_ctor(4, 1, 0); -lean_ctor_set(x_48, 0, x_47); -x_49 = l_Lean_Elab_wfRecursion___closed__2; -x_50 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_50, 0, x_49); -lean_ctor_set(x_50, 1, x_48); -x_51 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__8; -x_52 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_52, 0, x_50); -lean_ctor_set(x_52, 1, x_51); -x_53 = l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(x_43, x_52, x_4, x_5, x_6, x_7, x_8, x_9, x_45); -x_54 = lean_ctor_get(x_53, 0); -lean_inc(x_54); -x_55 = lean_ctor_get(x_53, 1); -lean_inc(x_55); -lean_dec(x_53); -x_56 = l_Lean_Elab_wfRecursion___lambda__1(x_39, x_1, x_54, x_4, x_5, x_6, x_7, x_8, x_9, x_55); -lean_dec(x_54); -return x_56; -} -} -} -else -{ -lean_object* x_69; lean_object* x_70; lean_object* x_71; uint8_t x_72; -lean_dec(x_1); -x_69 = lean_ctor_get(x_38, 0); +lean_dec(x_61); +x_68 = l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__2(x_46, x_4, x_5, x_6, x_7, x_8, x_9, x_67); +x_69 = lean_ctor_get(x_68, 0); lean_inc(x_69); -x_70 = lean_ctor_get(x_38, 1); +x_70 = lean_ctor_get(x_68, 1); lean_inc(x_70); -lean_dec(x_38); -x_71 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_70); +lean_dec(x_68); +x_71 = lean_unbox(x_69); +lean_dec(x_69); +x_47 = x_71; +x_48 = x_70; +goto block_60; +} +block_60: +{ +if (x_47 == 0) +{ +lean_object* x_49; +x_49 = l_Lean_Elab_wfRecursion___lambda__1(x_44, x_1, x_18, x_4, x_5, x_6, x_7, x_8, x_9, x_48); +return x_49; +} +else +{ +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; lean_object* x_58; lean_object* x_59; +x_50 = lean_ctor_get(x_44, 3); +lean_inc(x_50); +x_51 = lean_alloc_ctor(4, 1, 0); +lean_ctor_set(x_51, 0, x_50); +x_52 = l_Lean_Elab_wfRecursion___closed__2; +x_53 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_53, 0, x_52); +lean_ctor_set(x_53, 1, x_51); +x_54 = l_Std_Range_forIn_loop___at___private_Lean_Elab_PreDefinition_WF_Main_0__Lean_Elab_addNonRecPreDefs___spec__2___closed__8; +x_55 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_55, 0, x_53); +lean_ctor_set(x_55, 1, x_54); +x_56 = l_Lean_addTrace___at___private_Lean_Elab_Term_0__Lean_Elab_Term_postponeElabTerm___spec__1(x_46, x_55, x_4, x_5, x_6, x_7, x_8, x_9, x_48); +x_57 = lean_ctor_get(x_56, 0); +lean_inc(x_57); +x_58 = lean_ctor_get(x_56, 1); +lean_inc(x_58); +lean_dec(x_56); +x_59 = l_Lean_Elab_wfRecursion___lambda__1(x_44, x_1, x_57, x_4, x_5, x_6, x_7, x_8, x_9, x_58); +lean_dec(x_57); +return x_59; +} +} +} +else +{ +uint8_t x_72; lean_dec(x_9); lean_dec(x_8); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); -x_72 = !lean_is_exclusive(x_71); +lean_dec(x_1); +x_72 = !lean_is_exclusive(x_43); if (x_72 == 0) { -lean_object* x_73; -x_73 = lean_ctor_get(x_71, 0); -lean_dec(x_73); -lean_ctor_set_tag(x_71, 1); -lean_ctor_set(x_71, 0, x_69); -return x_71; +return x_43; } else { -lean_object* x_74; lean_object* x_75; -x_74 = lean_ctor_get(x_71, 1); +lean_object* x_73; lean_object* x_74; lean_object* x_75; +x_73 = lean_ctor_get(x_43, 0); +x_74 = lean_ctor_get(x_43, 1); lean_inc(x_74); -lean_dec(x_71); +lean_inc(x_73); +lean_dec(x_43); x_75 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_75, 0, x_69); +lean_ctor_set(x_75, 0, x_73); lean_ctor_set(x_75, 1, x_74); return x_75; } @@ -1920,15 +1923,12 @@ return x_75; else { lean_object* x_76; lean_object* x_77; lean_object* x_78; uint8_t x_79; -lean_dec(x_30); -lean_dec(x_25); -lean_dec(x_3); lean_dec(x_1); -x_76 = lean_ctor_get(x_36, 0); +x_76 = lean_ctor_get(x_38, 0); lean_inc(x_76); -x_77 = lean_ctor_get(x_36, 1); +x_77 = lean_ctor_get(x_38, 1); lean_inc(x_77); -lean_dec(x_36); +lean_dec(x_38); x_78 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_77); lean_dec(x_9); lean_dec(x_8); @@ -1961,7 +1961,49 @@ return x_82; } else { -uint8_t x_83; +lean_object* x_83; lean_object* x_84; lean_object* x_85; uint8_t x_86; +lean_dec(x_30); +lean_dec(x_25); +lean_dec(x_3); +lean_dec(x_1); +x_83 = lean_ctor_get(x_36, 0); +lean_inc(x_83); +x_84 = lean_ctor_get(x_36, 1); +lean_inc(x_84); +lean_dec(x_36); +x_85 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_84); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +x_86 = !lean_is_exclusive(x_85); +if (x_86 == 0) +{ +lean_object* x_87; +x_87 = lean_ctor_get(x_85, 0); +lean_dec(x_87); +lean_ctor_set_tag(x_85, 1); +lean_ctor_set(x_85, 0, x_83); +return x_85; +} +else +{ +lean_object* x_88; lean_object* x_89; +x_88 = lean_ctor_get(x_85, 1); +lean_inc(x_88); +lean_dec(x_85); +x_89 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_89, 0, x_83); +lean_ctor_set(x_89, 1, x_88); +return x_89; +} +} +} +else +{ +uint8_t x_90; lean_dec(x_25); lean_dec(x_9); lean_dec(x_8); @@ -1971,62 +2013,21 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_1); -x_83 = !lean_is_exclusive(x_29); -if (x_83 == 0) +x_90 = !lean_is_exclusive(x_29); +if (x_90 == 0) { return x_29; } else { -lean_object* x_84; lean_object* x_85; lean_object* x_86; -x_84 = lean_ctor_get(x_29, 0); -x_85 = lean_ctor_get(x_29, 1); -lean_inc(x_85); -lean_inc(x_84); -lean_dec(x_29); -x_86 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_86, 0, x_84); -lean_ctor_set(x_86, 1, x_85); -return x_86; -} -} -} -else -{ -lean_object* x_87; lean_object* x_88; lean_object* x_89; uint8_t x_90; -lean_dec(x_3); -lean_dec(x_2); -lean_dec(x_1); -x_87 = lean_ctor_get(x_24, 0); -lean_inc(x_87); -x_88 = lean_ctor_get(x_24, 1); -lean_inc(x_88); -lean_dec(x_24); -x_89 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_88); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -x_90 = !lean_is_exclusive(x_89); -if (x_90 == 0) -{ -lean_object* x_91; -x_91 = lean_ctor_get(x_89, 0); -lean_dec(x_91); -lean_ctor_set_tag(x_89, 1); -lean_ctor_set(x_89, 0, x_87); -return x_89; -} -else -{ -lean_object* x_92; lean_object* x_93; -x_92 = lean_ctor_get(x_89, 1); +lean_object* x_91; lean_object* x_92; lean_object* x_93; +x_91 = lean_ctor_get(x_29, 0); +x_92 = lean_ctor_get(x_29, 1); lean_inc(x_92); -lean_dec(x_89); +lean_inc(x_91); +lean_dec(x_29); x_93 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_93, 0, x_87); +lean_ctor_set(x_93, 0, x_91); lean_ctor_set(x_93, 1, x_92); return x_93; } @@ -2038,11 +2039,11 @@ lean_object* x_94; lean_object* x_95; lean_object* x_96; uint8_t x_97; lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_94 = lean_ctor_get(x_21, 0); +x_94 = lean_ctor_get(x_24, 0); lean_inc(x_94); -x_95 = lean_ctor_get(x_21, 1); +x_95 = lean_ctor_get(x_24, 1); lean_inc(x_95); -lean_dec(x_21); +lean_dec(x_24); x_96 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_95); lean_dec(x_9); lean_dec(x_8); @@ -2079,11 +2080,11 @@ lean_object* x_101; lean_object* x_102; lean_object* x_103; uint8_t x_104; lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_101 = lean_ctor_get(x_19, 0); +x_101 = lean_ctor_get(x_21, 0); lean_inc(x_101); -x_102 = lean_ctor_get(x_19, 1); +x_102 = lean_ctor_get(x_21, 1); lean_inc(x_102); -lean_dec(x_19); +lean_dec(x_21); x_103 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_102); lean_dec(x_9); lean_dec(x_8); @@ -2114,6 +2115,47 @@ return x_107; } } } +else +{ +lean_object* x_108; lean_object* x_109; lean_object* x_110; uint8_t x_111; +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_108 = lean_ctor_get(x_19, 0); +lean_inc(x_108); +x_109 = lean_ctor_get(x_19, 1); +lean_inc(x_109); +lean_dec(x_19); +x_110 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_17, x_4, x_5, x_6, x_7, x_8, x_9, x_109); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +x_111 = !lean_is_exclusive(x_110); +if (x_111 == 0) +{ +lean_object* x_112; +x_112 = lean_ctor_get(x_110, 0); +lean_dec(x_112); +lean_ctor_set_tag(x_110, 1); +lean_ctor_set(x_110, 0, x_108); +return x_110; +} +else +{ +lean_object* x_113; lean_object* x_114; +x_113 = lean_ctor_get(x_110, 1); +lean_inc(x_113); +lean_dec(x_110); +x_114 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_114, 0, x_108); +lean_ctor_set(x_114, 1, x_113); +return x_114; +} +} +} } LEAN_EXPORT lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_wfRecursion___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, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) { _start: @@ -2142,7 +2184,7 @@ lean_dec(x_3); return x_11; } } -LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_881_(lean_object* x_1) { +LEAN_EXPORT lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_895_(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; @@ -2246,7 +2288,7 @@ l_Lean_Elab_wfRecursion___closed__1 = _init_l_Lean_Elab_wfRecursion___closed__1( lean_mark_persistent(l_Lean_Elab_wfRecursion___closed__1); l_Lean_Elab_wfRecursion___closed__2 = _init_l_Lean_Elab_wfRecursion___closed__2(); lean_mark_persistent(l_Lean_Elab_wfRecursion___closed__2); -res = l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_881_(lean_io_mk_world()); +res = l_Lean_Elab_initFn____x40_Lean_Elab_PreDefinition_WF_Main___hyg_895_(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); return lean_io_result_mk_ok(lean_box(0));