diff --git a/stage0/src/Lean/Elab/Do.lean b/stage0/src/Lean/Elab/Do.lean index 8573e6e150..212b4592a1 100644 --- a/stage0/src/Lean/Elab/Do.lean +++ b/stage0/src/Lean/Elab/Do.lean @@ -90,7 +90,7 @@ partial def toMessageDataAux (updateVars : MessageData) : Code → MessageData | Code.«break» _ => "break " ++ updateVars | Code.«continue» _ => "continue " ++ updateVars | Code.«return» _ none => "return " ++ updateVars -| Code.«return» _ (some x) => "return " ++ x ++ " " ++ updateVars +| Code.«return» _ (some x) => "return " ++ x.simpMacroScopes ++ " " ++ updateVars | Code.«match» _ ds t alts => "match " ++ MessageData.joinSep (ds.toList.map MessageData.ofSyntax) ", " ++ " with " ++ alts.foldl @@ -176,13 +176,13 @@ partial def pullExitPointsAux : NameSet → Code → StateRefT (Array JPDecl) Te | rs, Code.«continue» ref => do let xs := nameSetToArray rs; jp ← addFreshJP xs (Code.«continue» ref); pure $ Code.jmp ref jp xs | rs, Code.«return» ref y? => do let xs := nameSetToArray rs; - (ps, xs) ← match y? with - | none => pure (xs, xs) + (ps, xs, y?) ← match y? with + | none => pure (xs, xs, none) | some y => - if rs.contains y then pure (xs, xs) + if rs.contains y then pure (xs, xs, some y) else do { yFresh ← mkFreshUserName y; - pure (xs.push y, xs.push yFresh) + pure (xs.push yFresh, xs.push y, some yFresh) }; jp ← addFreshJP ps (Code.«return» ref y?); pure $ Code.jmp ref jp xs @@ -500,11 +500,6 @@ private partial def expandDoElems : Bool → Array Syntax → Nat → MacroM Syn else Macro.throwUnsupported -@[builtinMacro Lean.Parser.Term.do] def expandDo : Macro := -fun stx => - let doElems := getDoElems stx; - expandDoElems false doElems 0 - structure ProcessedDoElem := (action : Expr) (var : Expr) @@ -574,17 +569,25 @@ private partial def processDoElemsAux (doElems : Array Syntax) (m bindInstVal : private def processDoElems (doElems : Array Syntax) (m bindInstVal : Expr) (expectedType : Expr) : TermElabM Expr := processDoElemsAux doElems m bindInstVal expectedType 0 #[] +def expandDo? (stx : Syntax) : MacroM (Option Syntax) := +let doElems := getDoElems stx; +catch + (do stx ← expandDoElems false doElems 0; pure $ some stx) + (fun _ => pure none) + @[builtinTermElab «do»] def elabDo : TermElab := fun stx expectedType? => do - tryPostponeIfNoneOrMVar expectedType?; - let doElems := getDoElems stx; - trace `Elab.do $ fun _ => stx; - let doElems := doElems.getSepElems; - trace `Elab.do $ fun _ => "doElems: " ++ toString doElems; - { m := m, hasBindInst := bindInstVal, .. } ← extractBind expectedType?; - result ← processDoElems doElems m bindInstVal expectedType?.get!; - -- dbgTrace ("result: " ++ toString result); - pure result + stxNew? ← liftMacroM $ expandDo? stx; + match stxNew? with + | some stxNew => withMacroExpansion stx stxNew $ elabTerm stxNew expectedType? + | none => do + tryPostponeIfNoneOrMVar expectedType?; + let doElems := getDoElems stx; + trace `Elab.do $ fun _ => stx; + let doElems := doElems.getSepElems; + trace `Elab.do $ fun _ => "doElems: " ++ toString doElems; + { m := m, hasBindInst := bindInstVal, .. } ← extractBind expectedType?; + processDoElems doElems m bindInstVal expectedType?.get! @[builtinTermElab liftMethod] def elabLiftMethod : TermElab := fun stx _ => diff --git a/stage0/src/Lean/Elab/SyntheticMVars.lean b/stage0/src/Lean/Elab/SyntheticMVars.lean index ba6726fdf7..ae2b3bb0e1 100644 --- a/stage0/src/Lean/Elab/SyntheticMVars.lean +++ b/stage0/src/Lean/Elab/SyntheticMVars.lean @@ -151,7 +151,8 @@ newSyntheticMVars ← s.syntheticMVars.filterM $ fun mvarDecl => val ← instantiateMVars (mkMVar mvarDecl.mvarId); when val.getAppFn.isMVar $ unlessM (isDefEq val defaultVal) $ - throwError "failed to assign default value to metavariable"; -- TODO: better error message + -- TODO: better error message + throwError ("failed to assign default value to metavariable" ++ indentExpr val ++ Format.line ++ "default value" ++ indentExpr defaultVal) ; pure false | _ => pure true; modify $ fun s => { s with syntheticMVars := newSyntheticMVars }; diff --git a/stage0/src/Lean/Elab/Term.lean b/stage0/src/Lean/Elab/Term.lean index 6cdbedf96c..6aa2541e79 100644 --- a/stage0/src/Lean/Elab/Term.lean +++ b/stage0/src/Lean/Elab/Term.lean @@ -66,9 +66,6 @@ namespace Term Haskell would work on this example since it always uses first-order unification. - - We do not change the - -/ def setElabConfig (cfg : Meta.Config) : Meta.Config := { cfg with foApprox := true, ctxApprox := true, constApprox := false, quasiPatternApprox := false } @@ -520,19 +517,18 @@ if hasCDot stx then do else pure none +def mkTypeMismatchError (e : Expr) (eType : Expr) (expectedType : Expr) (header : String := "type mismatch") : MessageData := +header ++ indentExpr e +++ Format.line ++ "has type" ++ indentExpr eType +++ Format.line ++ "but it is expected to have type" ++ indentExpr expectedType + def throwTypeMismatchError {α} (expectedType : Expr) (eType : Expr) (e : Expr) (f? : Option Expr := none) (extraMsg? : Option MessageData := none) : TermElabM α := let extraMsg : MessageData := match extraMsg? with | none => Format.nil | some extraMsg => Format.line ++ extraMsg; match f? with -| none => - let msg : MessageData := - "type mismatch" ++ indentExpr e - ++ Format.line ++ "has type" ++ indentExpr eType - ++ Format.line ++ "but it is expected to have type" ++ indentExpr expectedType - ++ extraMsg; - throwError msg +| none => throwError $ mkTypeMismatchError e eType expectedType ++ extraMsg | some f => Meta.throwAppTypeMismatch f e extraMsg @[inline] def withoutMacroStackAtErr {α} (x : TermElabM α) : TermElabM α := @@ -1277,6 +1273,23 @@ fun stx _ => | some val => pure $ toExpr val | none => throwIllFormedSyntax +@[builtinTermElab typeOf] def elabTypeOf : TermElab := +fun stx _ => do + e ← elabTerm (stx.getArg 1) none; + inferType e + +@[builtinTermElab ensureTypeOf] def elabEnsureTypeOf : TermElab := +fun stx expectedType? => + match (stx.getArg 2).isStrLit? with + | none => throwIllFormedSyntax + | some msg => do + refTerm ← elabTerm (stx.getArg 1) none; + refTermType ← inferType refTerm; + e ← elabTerm (stx.getArg 3) expectedType?; + eType ← inferType e; + unlessM (isDefEq eType refTermType) $ throwError $ mkTypeMismatchError e eType refTermType msg; + pure e + private def mkSomeContext : Context := { fileName := "", fileMap := arbitrary _, diff --git a/stage0/src/Lean/Parser/Do.lean b/stage0/src/Lean/Parser/Do.lean index 42a691e928..b26ad38fe2 100644 --- a/stage0/src/Lean/Parser/Do.lean +++ b/stage0/src/Lean/Parser/Do.lean @@ -25,11 +25,13 @@ def doSeqIndent := many1Indent $ doElemParser >> optional "; " def doSeqBracketed := parser! "{" >> sepBy1 doElemParser "; " true >> "}" def doSeq := doSeqBracketed <|> doSeqIndent -@[builtinDoElemParser] def doLet := parser! "let " >> letDecl -@[builtinDoElemParser] def doLetRec := parser! group ("let " >> nonReservedSymbol "rec ") >> letRecDecls +@[builtinDoElemParser] def doLet := parser! "let " >> letDecl +@[builtinDoElemParser] def doLetRec := parser! group ("let " >> nonReservedSymbol "rec ") >> letRecDecls def doId := parser! «try» (ident >> optType >> leftArrow) >> termParser def doPat := parser! «try» (termParser >> leftArrow) >> termParser >> optional (" | " >> termParser) -@[builtinDoElemParser] def doLetArrow := parser! "let " >> (doId <|> doPat) +@[builtinDoElemParser] def doLetArrow := parser! "let " >> (doId <|> doPat) +@[builtinDoElemParser] def doReassign := parser! letIdDecl <|> letPatDecl +@[builtinDoElemParser] def doReassignArrow := doId <|> doPat @[builtinDoElemParser] def doHave := parser! "have " >> Term.haveDecl /- In `do` blocks, we support `if` without an `else`. Thus, we use indentation to prevent examples such as diff --git a/stage0/stdlib/Lean/Elab/Do.c b/stage0/stdlib/Lean/Elab/Do.c index 52514d084c..95d5c0b63a 100644 --- a/stage0/stdlib/Lean/Elab/Do.c +++ b/stage0/stdlib/Lean/Elab/Do.c @@ -82,7 +82,6 @@ extern lean_object* l_String_splitAux___main___closed__1; extern lean_object* l___private_Lean_Elab_Binders_17__expandMatchAltsIntoMatchAux___main___closed__12; extern lean_object* l___private_Lean_Elab_Binders_12__expandFunBindersAux___main___closed__9; lean_object* l___private_Lean_Meta_InferType_4__getLevelImp(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___regBuiltin_Lean_Elab_Term_expandDo___closed__1; extern lean_object* l_List_repr___rarg___closed__3; lean_object* l___private_Lean_Elab_Do_14__processDoElemsAux___main___closed__7; lean_object* l_Array_back___at___private_Lean_Elab_Do_13__mkBind___spec__1___boxed(lean_object*); @@ -145,6 +144,7 @@ lean_object* l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__12; extern lean_object* l___regBuiltin_Lean_Elab_Term_Quotation_elabTermQuot___closed__1; extern lean_object* l___private_Lean_Elab_Quotation_2__quoteSyntax___main___closed__42; lean_object* l___private_Lean_Elab_Do_5__mkIdBindFor___closed__2; +lean_object* l_Lean_Elab_Term_elabTerm(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); 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*); uint8_t l_Lean_Elab_Term_Do_hasExitPoint(lean_object*); lean_object* l___private_Lean_Elab_Do_5__mkIdBindFor___closed__1; @@ -164,6 +164,7 @@ lean_object* l_Lean_Elab_Term_Do_mkBreak(lean_object*); lean_object* l_Lean_Elab_Term_Do_attachJPs___boxed(lean_object*, lean_object*); extern lean_object* l___private_Lean_Elab_Binders_12__expandFunBindersAux___main___closed__2; lean_object* l_Std_RBNode_balRight___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_expandDo_x3f___boxed(lean_object*, lean_object*, lean_object*); uint8_t l_Std_RBNode_isBlack___rarg(lean_object*); lean_object* l_Array_umapMAux___main___at_Lean_Elab_Term_Do_convertReturnIntoJmpAux___main___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_Do_CodeBlock_toMessageData(lean_object*); @@ -179,6 +180,7 @@ extern lean_object* l_List_reprAux___main___rarg___closed__1; extern lean_object* l___private_Lean_Elab_Binders_12__expandFunBindersAux___main___closed__6; uint8_t l_Std_RBNode_any___main___at_Lean_Elab_Term_Do_extendUpdatedVars___spec__1(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__26; +lean_object* l_Lean_Elab_Term_getCurrMacroScope(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Do_11__expandDoElems___main___closed__2; lean_object* l___private_Lean_Elab_Do_6__extractBind___closed__1; lean_object* l_Lean_Elab_Term_expandOptType(lean_object*, lean_object*); @@ -186,6 +188,7 @@ lean_object* l___private_Lean_Elab_Do_6__extractBind___boxed(lean_object*, lean_ lean_object* l___private_Lean_Elab_Do_8__hasLiftMethod___main___closed__2; lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at___private_Lean_Elab_Do_13__mkBind___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_object*, lean_object*); lean_object* l___private_Lean_Elab_Do_14__processDoElemsAux___main___closed__1; +lean_object* l_Lean_Elab_Term_expandDo_x3f(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_CoreM_1__mkFreshNameImp(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_mkAppStx___closed__6; lean_object* l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__14; @@ -247,11 +250,12 @@ extern lean_object* l_Lean_myMacro____x40_Lean_Util_Trace___hyg_45____closed__20 lean_object* l_Lean_throwErrorAt___at___private_Lean_Elab_Term_19__elabTermAux___main___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_Do_pullExitPoints(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Do_14__processDoElemsAux___main___closed__5; -extern lean_object* l_Lean_Elab_macroAttribute; lean_object* l_Lean_Elab_Term_elabDo___closed__2; extern lean_object* l_Lean_Elab_Term_quoteAutoTactic___main___closed__4; +lean_object* lean_environment_main_module(lean_object*); uint8_t l_Lean_Expr_isMVar(lean_object*); lean_object* l___private_Lean_Elab_Do_5__mkIdBindFor(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_Util_5__expandMacro_x3f___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__24; lean_object* l___private_Lean_Elab_Do_7__getDoElems(lean_object*); lean_object* l_Lean_mkApp(lean_object*, lean_object*); @@ -272,7 +276,6 @@ extern lean_object* l___private_Lean_Elab_Binders_17__expandMatchAltsIntoMatchAu lean_object* l_Lean_Elab_Term_Do_Code_inhabited___closed__1; extern lean_object* l___private_Lean_Elab_Binders_12__expandFunBindersAux___main___closed__7; lean_object* l_Lean_Elab_Term_Do_mkVarDeclCore(lean_object*, lean_object*, lean_object*); -lean_object* l___regBuiltin_Lean_Elab_Term_expandDo(lean_object*); lean_object* l___private_Lean_Elab_Do_8__hasLiftMethod___main___closed__3; lean_object* l___regBuiltin_Lean_Elab_Term_elabDo(lean_object*); lean_object* l_Lean_Elab_Term_Do_extendUpdatedVarsAux___main(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -346,7 +349,6 @@ lean_object* l_Array_back___at_Lean_Syntax_Traverser_up___spec__2(lean_object*); lean_object* l_Lean_indentExpr(lean_object*); uint8_t l_Array_anyRangeMAux___main___at_Lean_Elab_Term_Do_extendUpdatedVarsAux___main___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_Do_hasExitPoint___main___boxed(lean_object*); -lean_object* l_Lean_Elab_Term_expandDo(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Do_11__expandDoElems___main(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Do_12__extractTypeFormerAppArg___closed__1; @@ -362,7 +364,6 @@ lean_object* l___private_Lean_Elab_Do_14__processDoElemsAux___main___lambda__1(l lean_object* l_Array_umapMAux___main___at_Lean_Elab_Term_Do_extendUpdatedVarsAux___main___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l___private_Lean_Elab_Util_6__regTraceClasses___closed__1; lean_object* l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__25; -lean_object* l_Lean_Elab_Term_expandDo___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_Do_hasExitPoint___boxed(lean_object*); lean_object* l_Lean_Elab_Term_Do_toMessageDataAux___main(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Do_14__processDoElemsAux___main___closed__6; @@ -1072,129 +1073,130 @@ return x_57; } else { -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; +lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; x_58 = lean_ctor_get(x_55, 0); lean_inc(x_58); lean_dec(x_55); -x_59 = lean_alloc_ctor(4, 1, 0); -lean_ctor_set(x_59, 0, x_58); -x_60 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__15; -x_61 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_61, 0, x_60); -lean_ctor_set(x_61, 1, x_59); -x_62 = l_Lean_Meta_SynthInstance_getInstances___lambda__1___closed__1; -x_63 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_63, 0, x_61); -lean_ctor_set(x_63, 1, x_62); +x_59 = lean_simp_macro_scopes(x_58); +x_60 = lean_alloc_ctor(4, 1, 0); +lean_ctor_set(x_60, 0, x_59); +x_61 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__15; +x_62 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_62, 0, x_61); +lean_ctor_set(x_62, 1, x_60); +x_63 = l_Lean_Meta_SynthInstance_getInstances___lambda__1___closed__1; x_64 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_64, 0, x_63); -lean_ctor_set(x_64, 1, x_1); -return x_64; +lean_ctor_set(x_64, 0, x_62); +lean_ctor_set(x_64, 1, x_63); +x_65 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_65, 0, x_64); +lean_ctor_set(x_65, 1, x_1); +return x_65; } } case 7: { -lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_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_65 = lean_ctor_get(x_2, 3); -lean_inc(x_65); -x_66 = lean_ctor_get(x_2, 4); +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; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; +x_66 = lean_ctor_get(x_2, 3); lean_inc(x_66); -x_67 = lean_ctor_get(x_2, 5); +x_67 = lean_ctor_get(x_2, 4); lean_inc(x_67); +x_68 = lean_ctor_get(x_2, 5); +lean_inc(x_68); lean_dec(x_2); -x_68 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_68, 0, x_65); -x_69 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__18; -x_70 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_70, 0, x_69); -lean_ctor_set(x_70, 1, x_68); -x_71 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__21; -x_72 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_72, 0, x_70); -lean_ctor_set(x_72, 1, x_71); +x_69 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_69, 0, x_66); +x_70 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__18; +x_71 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_71, 0, x_70); +lean_ctor_set(x_71, 1, x_69); +x_72 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__21; +x_73 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_73, 0, x_71); +lean_ctor_set(x_73, 1, x_72); lean_inc(x_1); -x_73 = l_Lean_Elab_Term_Do_toMessageDataAux___main(x_1, x_66); -x_74 = l_Lean_indentD(x_73); -x_75 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_75, 0, x_72); -lean_ctor_set(x_75, 1, x_74); -x_76 = l_Lean_MessageData_ofList___closed__3; -x_77 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_77, 0, x_75); -lean_ctor_set(x_77, 1, x_76); -x_78 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__24; -x_79 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_79, 0, x_77); -lean_ctor_set(x_79, 1, x_78); -x_80 = l_Lean_Elab_Term_Do_toMessageDataAux___main(x_1, x_67); -x_81 = l_Lean_indentD(x_80); -x_82 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_82, 0, x_79); -lean_ctor_set(x_82, 1, x_81); -return x_82; +x_74 = l_Lean_Elab_Term_Do_toMessageDataAux___main(x_1, x_67); +x_75 = l_Lean_indentD(x_74); +x_76 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_76, 0, x_73); +lean_ctor_set(x_76, 1, x_75); +x_77 = l_Lean_MessageData_ofList___closed__3; +x_78 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_78, 0, x_76); +lean_ctor_set(x_78, 1, x_77); +x_79 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__24; +x_80 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_80, 0, x_78); +lean_ctor_set(x_80, 1, x_79); +x_81 = l_Lean_Elab_Term_Do_toMessageDataAux___main(x_1, x_68); +x_82 = l_Lean_indentD(x_81); +x_83 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_83, 0, x_80); +lean_ctor_set(x_83, 1, x_82); +return x_83; } case 8: { -lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; -x_83 = lean_ctor_get(x_2, 1); -lean_inc(x_83); -x_84 = lean_ctor_get(x_2, 3); +lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; +x_84 = lean_ctor_get(x_2, 1); lean_inc(x_84); +x_85 = lean_ctor_get(x_2, 3); +lean_inc(x_85); lean_dec(x_2); -x_85 = l_Array_toList___rarg(x_83); -lean_dec(x_83); -x_86 = l_List_map___main___at_Lean_Elab_Term_Do_toMessageDataAux___main___spec__1(x_85); -x_87 = l_Lean_MessageData_arrayExpr_toMessageData___main___closed__2; -x_88 = l_Lean_MessageData_joinSep___main(x_86, x_87); -lean_dec(x_86); -x_89 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__26; -x_90 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_90, 0, x_89); -lean_ctor_set(x_90, 1, x_88); -x_91 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__28; -x_92 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_92, 0, x_90); -lean_ctor_set(x_92, 1, x_91); -x_93 = lean_unsigned_to_nat(0u); -x_94 = l_Lean_MessageData_Inhabited___closed__1; -x_95 = l_Array_iterateMAux___main___at_Lean_Elab_Term_Do_toMessageDataAux___main___spec__2(x_1, x_84, x_87, x_84, x_93, x_94); +x_86 = l_Array_toList___rarg(x_84); lean_dec(x_84); -x_96 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_96, 0, x_92); -lean_ctor_set(x_96, 1, x_95); -return x_96; +x_87 = l_List_map___main___at_Lean_Elab_Term_Do_toMessageDataAux___main___spec__1(x_86); +x_88 = l_Lean_MessageData_arrayExpr_toMessageData___main___closed__2; +x_89 = l_Lean_MessageData_joinSep___main(x_87, x_88); +lean_dec(x_87); +x_90 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__26; +x_91 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_91, 0, x_90); +lean_ctor_set(x_91, 1, x_89); +x_92 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__28; +x_93 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_93, 0, x_91); +lean_ctor_set(x_93, 1, x_92); +x_94 = lean_unsigned_to_nat(0u); +x_95 = l_Lean_MessageData_Inhabited___closed__1; +x_96 = l_Array_iterateMAux___main___at_Lean_Elab_Term_Do_toMessageDataAux___main___spec__2(x_1, x_85, x_88, x_85, x_94, x_95); +lean_dec(x_85); +x_97 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_97, 0, x_93); +lean_ctor_set(x_97, 1, x_96); +return x_97; } default: { -lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; +lean_object* x_98; lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_dec(x_1); -x_97 = lean_ctor_get(x_2, 1); -lean_inc(x_97); -x_98 = lean_ctor_get(x_2, 2); +x_98 = lean_ctor_get(x_2, 1); lean_inc(x_98); +x_99 = lean_ctor_get(x_2, 2); +lean_inc(x_99); lean_dec(x_2); -x_99 = lean_simp_macro_scopes(x_97); -x_100 = lean_alloc_ctor(4, 1, 0); -lean_ctor_set(x_100, 0, x_99); -x_101 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__31; -x_102 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_102, 0, x_101); -lean_ctor_set(x_102, 1, x_100); -x_103 = l_Lean_Meta_SynthInstance_getInstances___lambda__1___closed__1; -x_104 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_104, 0, x_102); -lean_ctor_set(x_104, 1, x_103); -x_105 = l_Array_toList___rarg(x_98); -lean_dec(x_98); -x_106 = l_List_toString___at_Lean_OpenDecl_HasToString___spec__2(x_105); -x_107 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_107, 0, x_106); -x_108 = lean_alloc_ctor(0, 1, 0); +x_100 = lean_simp_macro_scopes(x_98); +x_101 = lean_alloc_ctor(4, 1, 0); +lean_ctor_set(x_101, 0, x_100); +x_102 = l_Lean_Elab_Term_Do_toMessageDataAux___main___closed__31; +x_103 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_103, 0, x_102); +lean_ctor_set(x_103, 1, x_101); +x_104 = l_Lean_Meta_SynthInstance_getInstances___lambda__1___closed__1; +x_105 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_105, 0, x_103); +lean_ctor_set(x_105, 1, x_104); +x_106 = l_Array_toList___rarg(x_99); +lean_dec(x_99); +x_107 = l_List_toString___at_Lean_OpenDecl_HasToString___spec__2(x_106); +x_108 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_108, 0, x_107); -x_109 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_109, 0, x_104); -lean_ctor_set(x_109, 1, x_108); -return x_109; +x_109 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_109, 0, x_108); +x_110 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_110, 0, x_105); +lean_ctor_set(x_110, 1, x_109); +return x_110; } } } @@ -3175,19 +3177,140 @@ return x_140; } case 6: { -lean_object* x_141; lean_object* x_142; lean_object* x_143; +lean_object* x_141; lean_object* x_142; lean_object* x_143; lean_object* x_144; lean_object* x_145; lean_object* x_160; x_141 = lean_ctor_get(x_2, 0); lean_inc(x_141); x_142 = lean_ctor_get(x_2, 1); lean_inc(x_142); +if (lean_is_exclusive(x_2)) { + lean_ctor_release(x_2, 0); + lean_ctor_release(x_2, 1); + x_143 = x_2; +} else { + lean_dec_ref(x_2); + x_143 = lean_box(0); +} lean_inc(x_1); -x_143 = l___private_Lean_Elab_Do_2__nameSetToArray(x_1); +x_160 = l___private_Lean_Elab_Do_2__nameSetToArray(x_1); if (lean_obj_tag(x_142) == 0) { -lean_object* x_144; uint8_t x_145; +lean_object* x_161; lean_object* x_162; lean_dec(x_1); -lean_inc(x_143); -x_144 = l_Lean_Elab_Term_Do_addFreshJP(x_143, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +lean_inc(x_160); +x_161 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_161, 0, x_160); +lean_ctor_set(x_161, 1, x_142); +x_162 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_162, 0, x_160); +lean_ctor_set(x_162, 1, x_161); +x_144 = x_162; +x_145 = x_10; +goto block_159; +} +else +{ +lean_object* x_163; uint8_t x_164; +x_163 = lean_ctor_get(x_142, 0); +lean_inc(x_163); +x_164 = l_Lean_NameSet_contains(x_1, x_163); +lean_dec(x_1); +if (x_164 == 0) +{ +uint8_t x_165; +x_165 = !lean_is_exclusive(x_142); +if (x_165 == 0) +{ +lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; lean_object* x_171; lean_object* x_172; lean_object* x_173; +x_166 = lean_ctor_get(x_142, 0); +lean_dec(x_166); +lean_inc(x_163); +x_167 = l___private_Lean_CoreM_1__mkFreshNameImp(x_163, x_8, x_9, x_10); +x_168 = lean_ctor_get(x_167, 0); +lean_inc(x_168); +x_169 = lean_ctor_get(x_167, 1); +lean_inc(x_169); +lean_dec(x_167); +lean_inc(x_168); +lean_inc(x_160); +x_170 = lean_array_push(x_160, x_168); +x_171 = lean_array_push(x_160, x_163); +lean_ctor_set(x_142, 0, x_168); +x_172 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_172, 0, x_171); +lean_ctor_set(x_172, 1, x_142); +x_173 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_173, 0, x_170); +lean_ctor_set(x_173, 1, x_172); +x_144 = x_173; +x_145 = x_169; +goto block_159; +} +else +{ +lean_object* x_174; lean_object* x_175; lean_object* x_176; lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; lean_object* x_181; +lean_dec(x_142); +lean_inc(x_163); +x_174 = l___private_Lean_CoreM_1__mkFreshNameImp(x_163, x_8, x_9, x_10); +x_175 = lean_ctor_get(x_174, 0); +lean_inc(x_175); +x_176 = lean_ctor_get(x_174, 1); +lean_inc(x_176); +lean_dec(x_174); +lean_inc(x_175); +lean_inc(x_160); +x_177 = lean_array_push(x_160, x_175); +x_178 = lean_array_push(x_160, x_163); +x_179 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_179, 0, x_175); +x_180 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_180, 0, x_178); +lean_ctor_set(x_180, 1, x_179); +x_181 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_181, 0, x_177); +lean_ctor_set(x_181, 1, x_180); +x_144 = x_181; +x_145 = x_176; +goto block_159; +} +} +else +{ +lean_object* x_182; lean_object* x_183; +lean_dec(x_163); +lean_inc(x_160); +x_182 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_182, 0, x_160); +lean_ctor_set(x_182, 1, x_142); +x_183 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_183, 0, x_160); +lean_ctor_set(x_183, 1, x_182); +x_144 = x_183; +x_145 = x_10; +goto block_159; +} +} +block_159: +{ +lean_object* x_146; lean_object* x_147; lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; uint8_t x_152; +x_146 = lean_ctor_get(x_144, 1); +lean_inc(x_146); +x_147 = lean_ctor_get(x_144, 0); +lean_inc(x_147); +lean_dec(x_144); +x_148 = lean_ctor_get(x_146, 0); +lean_inc(x_148); +x_149 = lean_ctor_get(x_146, 1); +lean_inc(x_149); +lean_dec(x_146); +lean_inc(x_141); +if (lean_is_scalar(x_143)) { + x_150 = lean_alloc_ctor(6, 2, 0); +} else { + x_150 = x_143; +} +lean_ctor_set(x_150, 0, x_141); +lean_ctor_set(x_150, 1, x_149); +x_151 = l_Lean_Elab_Term_Do_addFreshJP(x_147, x_150, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_145); lean_dec(x_9); lean_dec(x_8); lean_dec(x_7); @@ -3195,155 +3318,52 @@ lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -x_145 = !lean_is_exclusive(x_144); -if (x_145 == 0) +x_152 = !lean_is_exclusive(x_151); +if (x_152 == 0) { -lean_object* x_146; lean_object* x_147; -x_146 = lean_ctor_get(x_144, 0); -x_147 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_147, 0, x_141); -lean_ctor_set(x_147, 1, x_146); -lean_ctor_set(x_147, 2, x_143); -lean_ctor_set(x_144, 0, x_147); -return x_144; -} -else -{ -lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; -x_148 = lean_ctor_get(x_144, 0); -x_149 = lean_ctor_get(x_144, 1); -lean_inc(x_149); -lean_inc(x_148); -lean_dec(x_144); -x_150 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_150, 0, x_141); -lean_ctor_set(x_150, 1, x_148); -lean_ctor_set(x_150, 2, x_143); -x_151 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_151, 0, x_150); -lean_ctor_set(x_151, 1, x_149); +lean_object* x_153; lean_object* x_154; +x_153 = lean_ctor_get(x_151, 0); +x_154 = lean_alloc_ctor(9, 3, 0); +lean_ctor_set(x_154, 0, x_141); +lean_ctor_set(x_154, 1, x_153); +lean_ctor_set(x_154, 2, x_148); +lean_ctor_set(x_151, 0, x_154); return x_151; } -} else { -lean_object* x_152; uint8_t x_153; -x_152 = lean_ctor_get(x_142, 0); -lean_inc(x_152); -lean_dec(x_142); -x_153 = l_Lean_NameSet_contains(x_1, x_152); -lean_dec(x_1); -if (x_153 == 0) -{ -lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; lean_object* x_159; uint8_t x_160; -lean_inc(x_152); -x_154 = l___private_Lean_CoreM_1__mkFreshNameImp(x_152, x_8, x_9, x_10); -x_155 = lean_ctor_get(x_154, 0); -lean_inc(x_155); -x_156 = lean_ctor_get(x_154, 1); +lean_object* x_155; lean_object* x_156; lean_object* x_157; lean_object* x_158; +x_155 = lean_ctor_get(x_151, 0); +x_156 = lean_ctor_get(x_151, 1); lean_inc(x_156); -lean_dec(x_154); -lean_inc(x_143); -x_157 = lean_array_push(x_143, x_152); -x_158 = lean_array_push(x_143, x_155); -x_159 = l_Lean_Elab_Term_Do_addFreshJP(x_157, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_156); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -x_160 = !lean_is_exclusive(x_159); -if (x_160 == 0) -{ -lean_object* x_161; lean_object* x_162; -x_161 = lean_ctor_get(x_159, 0); -x_162 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_162, 0, x_141); -lean_ctor_set(x_162, 1, x_161); -lean_ctor_set(x_162, 2, x_158); -lean_ctor_set(x_159, 0, x_162); -return x_159; -} -else -{ -lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; -x_163 = lean_ctor_get(x_159, 0); -x_164 = lean_ctor_get(x_159, 1); -lean_inc(x_164); -lean_inc(x_163); -lean_dec(x_159); -x_165 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_165, 0, x_141); -lean_ctor_set(x_165, 1, x_163); -lean_ctor_set(x_165, 2, x_158); -x_166 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_166, 0, x_165); -lean_ctor_set(x_166, 1, x_164); -return x_166; -} -} -else -{ -lean_object* x_167; uint8_t x_168; -lean_dec(x_152); -lean_inc(x_143); -x_167 = l_Lean_Elab_Term_Do_addFreshJP(x_143, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -x_168 = !lean_is_exclusive(x_167); -if (x_168 == 0) -{ -lean_object* x_169; lean_object* x_170; -x_169 = lean_ctor_get(x_167, 0); -x_170 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_170, 0, x_141); -lean_ctor_set(x_170, 1, x_169); -lean_ctor_set(x_170, 2, x_143); -lean_ctor_set(x_167, 0, x_170); -return x_167; -} -else -{ -lean_object* x_171; lean_object* x_172; lean_object* x_173; lean_object* x_174; -x_171 = lean_ctor_get(x_167, 0); -x_172 = lean_ctor_get(x_167, 1); -lean_inc(x_172); -lean_inc(x_171); -lean_dec(x_167); -x_173 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_173, 0, x_141); -lean_ctor_set(x_173, 1, x_171); -lean_ctor_set(x_173, 2, x_143); -x_174 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_174, 0, x_173); -lean_ctor_set(x_174, 1, x_172); -return x_174; -} +lean_inc(x_155); +lean_dec(x_151); +x_157 = lean_alloc_ctor(9, 3, 0); +lean_ctor_set(x_157, 0, x_141); +lean_ctor_set(x_157, 1, x_155); +lean_ctor_set(x_157, 2, x_148); +x_158 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_158, 0, x_157); +lean_ctor_set(x_158, 1, x_156); +return x_158; } } } case 7: { -uint8_t x_175; -x_175 = !lean_is_exclusive(x_2); -if (x_175 == 0) +uint8_t x_184; +x_184 = !lean_is_exclusive(x_2); +if (x_184 == 0) { -lean_object* x_176; lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; lean_object* x_181; lean_object* x_182; lean_object* x_183; -x_176 = lean_ctor_get(x_2, 0); -x_177 = lean_ctor_get(x_2, 1); -x_178 = lean_ctor_get(x_2, 2); -x_179 = lean_ctor_get(x_2, 3); -x_180 = lean_ctor_get(x_2, 4); -x_181 = lean_ctor_get(x_2, 5); -lean_inc(x_177); -x_182 = l_Lean_Elab_Term_Do_eraseOptVar(x_1, x_177); +lean_object* x_185; lean_object* x_186; lean_object* x_187; lean_object* x_188; lean_object* x_189; lean_object* x_190; lean_object* x_191; lean_object* x_192; +x_185 = lean_ctor_get(x_2, 0); +x_186 = lean_ctor_get(x_2, 1); +x_187 = lean_ctor_get(x_2, 2); +x_188 = lean_ctor_get(x_2, 3); +x_189 = lean_ctor_get(x_2, 4); +x_190 = lean_ctor_get(x_2, 5); +lean_inc(x_186); +x_191 = l_Lean_Elab_Term_Do_eraseOptVar(x_1, x_186); lean_inc(x_9); lean_inc(x_8); lean_inc(x_7); @@ -3351,85 +3371,85 @@ lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); lean_inc(x_3); -lean_inc(x_182); -x_183 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_182, x_180, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); -if (lean_obj_tag(x_183) == 0) -{ -lean_object* x_184; lean_object* x_185; lean_object* x_186; -x_184 = lean_ctor_get(x_183, 0); -lean_inc(x_184); -x_185 = lean_ctor_get(x_183, 1); -lean_inc(x_185); -lean_dec(x_183); -x_186 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_182, x_181, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_185); -if (lean_obj_tag(x_186) == 0) -{ -uint8_t x_187; -x_187 = !lean_is_exclusive(x_186); -if (x_187 == 0) -{ -lean_object* x_188; -x_188 = lean_ctor_get(x_186, 0); -lean_ctor_set(x_2, 5, x_188); -lean_ctor_set(x_2, 4, x_184); -lean_ctor_set(x_186, 0, x_2); -return x_186; -} -else -{ -lean_object* x_189; lean_object* x_190; lean_object* x_191; -x_189 = lean_ctor_get(x_186, 0); -x_190 = lean_ctor_get(x_186, 1); -lean_inc(x_190); -lean_inc(x_189); -lean_dec(x_186); -lean_ctor_set(x_2, 5, x_189); -lean_ctor_set(x_2, 4, x_184); -x_191 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_191, 0, x_2); -lean_ctor_set(x_191, 1, x_190); -return x_191; -} -} -else -{ -uint8_t x_192; -lean_dec(x_184); -lean_free_object(x_2); -lean_dec(x_179); -lean_dec(x_178); -lean_dec(x_177); -lean_dec(x_176); -x_192 = !lean_is_exclusive(x_186); -if (x_192 == 0) -{ -return x_186; -} -else +lean_inc(x_191); +x_192 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_191, x_189, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +if (lean_obj_tag(x_192) == 0) { lean_object* x_193; lean_object* x_194; lean_object* x_195; -x_193 = lean_ctor_get(x_186, 0); -x_194 = lean_ctor_get(x_186, 1); -lean_inc(x_194); +x_193 = lean_ctor_get(x_192, 0); lean_inc(x_193); -lean_dec(x_186); -x_195 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_195, 0, x_193); -lean_ctor_set(x_195, 1, x_194); +x_194 = lean_ctor_get(x_192, 1); +lean_inc(x_194); +lean_dec(x_192); +x_195 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_191, x_190, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_194); +if (lean_obj_tag(x_195) == 0) +{ +uint8_t x_196; +x_196 = !lean_is_exclusive(x_195); +if (x_196 == 0) +{ +lean_object* x_197; +x_197 = lean_ctor_get(x_195, 0); +lean_ctor_set(x_2, 5, x_197); +lean_ctor_set(x_2, 4, x_193); +lean_ctor_set(x_195, 0, x_2); return x_195; } +else +{ +lean_object* x_198; lean_object* x_199; lean_object* x_200; +x_198 = lean_ctor_get(x_195, 0); +x_199 = lean_ctor_get(x_195, 1); +lean_inc(x_199); +lean_inc(x_198); +lean_dec(x_195); +lean_ctor_set(x_2, 5, x_198); +lean_ctor_set(x_2, 4, x_193); +x_200 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_200, 0, x_2); +lean_ctor_set(x_200, 1, x_199); +return x_200; +} +} +else +{ +uint8_t x_201; +lean_dec(x_193); +lean_free_object(x_2); +lean_dec(x_188); +lean_dec(x_187); +lean_dec(x_186); +lean_dec(x_185); +x_201 = !lean_is_exclusive(x_195); +if (x_201 == 0) +{ +return x_195; +} +else +{ +lean_object* x_202; lean_object* x_203; lean_object* x_204; +x_202 = lean_ctor_get(x_195, 0); +x_203 = lean_ctor_get(x_195, 1); +lean_inc(x_203); +lean_inc(x_202); +lean_dec(x_195); +x_204 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_204, 0, x_202); +lean_ctor_set(x_204, 1, x_203); +return x_204; +} } } else { -uint8_t x_196; -lean_dec(x_182); +uint8_t x_205; +lean_dec(x_191); lean_free_object(x_2); -lean_dec(x_181); -lean_dec(x_179); -lean_dec(x_178); -lean_dec(x_177); -lean_dec(x_176); +lean_dec(x_190); +lean_dec(x_188); +lean_dec(x_187); +lean_dec(x_186); +lean_dec(x_185); lean_dec(x_9); lean_dec(x_8); lean_dec(x_7); @@ -3437,44 +3457,44 @@ lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -x_196 = !lean_is_exclusive(x_183); -if (x_196 == 0) +x_205 = !lean_is_exclusive(x_192); +if (x_205 == 0) { -return x_183; +return x_192; } else { -lean_object* x_197; lean_object* x_198; lean_object* x_199; -x_197 = lean_ctor_get(x_183, 0); -x_198 = lean_ctor_get(x_183, 1); -lean_inc(x_198); -lean_inc(x_197); -lean_dec(x_183); -x_199 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_199, 0, x_197); -lean_ctor_set(x_199, 1, x_198); -return x_199; +lean_object* x_206; lean_object* x_207; lean_object* x_208; +x_206 = lean_ctor_get(x_192, 0); +x_207 = lean_ctor_get(x_192, 1); +lean_inc(x_207); +lean_inc(x_206); +lean_dec(x_192); +x_208 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_208, 0, x_206); +lean_ctor_set(x_208, 1, x_207); +return x_208; } } } else { -lean_object* x_200; lean_object* x_201; lean_object* x_202; lean_object* x_203; lean_object* x_204; lean_object* x_205; lean_object* x_206; lean_object* x_207; -x_200 = lean_ctor_get(x_2, 0); -x_201 = lean_ctor_get(x_2, 1); -x_202 = lean_ctor_get(x_2, 2); -x_203 = lean_ctor_get(x_2, 3); -x_204 = lean_ctor_get(x_2, 4); -x_205 = lean_ctor_get(x_2, 5); -lean_inc(x_205); -lean_inc(x_204); -lean_inc(x_203); -lean_inc(x_202); -lean_inc(x_201); -lean_inc(x_200); +lean_object* x_209; lean_object* x_210; lean_object* x_211; lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; lean_object* x_216; +x_209 = lean_ctor_get(x_2, 0); +x_210 = lean_ctor_get(x_2, 1); +x_211 = lean_ctor_get(x_2, 2); +x_212 = lean_ctor_get(x_2, 3); +x_213 = lean_ctor_get(x_2, 4); +x_214 = lean_ctor_get(x_2, 5); +lean_inc(x_214); +lean_inc(x_213); +lean_inc(x_212); +lean_inc(x_211); +lean_inc(x_210); +lean_inc(x_209); lean_dec(x_2); -lean_inc(x_201); -x_206 = l_Lean_Elab_Term_Do_eraseOptVar(x_1, x_201); +lean_inc(x_210); +x_215 = l_Lean_Elab_Term_Do_eraseOptVar(x_1, x_210); lean_inc(x_9); lean_inc(x_8); lean_inc(x_7); @@ -3482,87 +3502,87 @@ lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); lean_inc(x_3); -lean_inc(x_206); -x_207 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_206, x_204, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); -if (lean_obj_tag(x_207) == 0) +lean_inc(x_215); +x_216 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_215, x_213, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +if (lean_obj_tag(x_216) == 0) { -lean_object* x_208; lean_object* x_209; lean_object* x_210; -x_208 = lean_ctor_get(x_207, 0); -lean_inc(x_208); -x_209 = lean_ctor_get(x_207, 1); -lean_inc(x_209); -lean_dec(x_207); -x_210 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_206, x_205, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_209); -if (lean_obj_tag(x_210) == 0) -{ -lean_object* x_211; lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; -x_211 = lean_ctor_get(x_210, 0); -lean_inc(x_211); -x_212 = lean_ctor_get(x_210, 1); -lean_inc(x_212); -if (lean_is_exclusive(x_210)) { - lean_ctor_release(x_210, 0); - lean_ctor_release(x_210, 1); - x_213 = x_210; -} else { - lean_dec_ref(x_210); - x_213 = lean_box(0); -} -x_214 = lean_alloc_ctor(7, 6, 0); -lean_ctor_set(x_214, 0, x_200); -lean_ctor_set(x_214, 1, x_201); -lean_ctor_set(x_214, 2, x_202); -lean_ctor_set(x_214, 3, x_203); -lean_ctor_set(x_214, 4, x_208); -lean_ctor_set(x_214, 5, x_211); -if (lean_is_scalar(x_213)) { - x_215 = lean_alloc_ctor(0, 2, 0); -} else { - x_215 = x_213; -} -lean_ctor_set(x_215, 0, x_214); -lean_ctor_set(x_215, 1, x_212); -return x_215; -} -else -{ -lean_object* x_216; lean_object* x_217; lean_object* x_218; lean_object* x_219; -lean_dec(x_208); -lean_dec(x_203); -lean_dec(x_202); -lean_dec(x_201); -lean_dec(x_200); -x_216 = lean_ctor_get(x_210, 0); -lean_inc(x_216); -x_217 = lean_ctor_get(x_210, 1); +lean_object* x_217; lean_object* x_218; lean_object* x_219; +x_217 = lean_ctor_get(x_216, 0); lean_inc(x_217); -if (lean_is_exclusive(x_210)) { - lean_ctor_release(x_210, 0); - lean_ctor_release(x_210, 1); - x_218 = x_210; +x_218 = lean_ctor_get(x_216, 1); +lean_inc(x_218); +lean_dec(x_216); +x_219 = l_Lean_Elab_Term_Do_pullExitPointsAux___main(x_215, x_214, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_218); +if (lean_obj_tag(x_219) == 0) +{ +lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223; lean_object* x_224; +x_220 = lean_ctor_get(x_219, 0); +lean_inc(x_220); +x_221 = lean_ctor_get(x_219, 1); +lean_inc(x_221); +if (lean_is_exclusive(x_219)) { + lean_ctor_release(x_219, 0); + lean_ctor_release(x_219, 1); + x_222 = x_219; } else { - lean_dec_ref(x_210); - x_218 = lean_box(0); + lean_dec_ref(x_219); + x_222 = lean_box(0); } -if (lean_is_scalar(x_218)) { - x_219 = lean_alloc_ctor(1, 2, 0); +x_223 = lean_alloc_ctor(7, 6, 0); +lean_ctor_set(x_223, 0, x_209); +lean_ctor_set(x_223, 1, x_210); +lean_ctor_set(x_223, 2, x_211); +lean_ctor_set(x_223, 3, x_212); +lean_ctor_set(x_223, 4, x_217); +lean_ctor_set(x_223, 5, x_220); +if (lean_is_scalar(x_222)) { + x_224 = lean_alloc_ctor(0, 2, 0); } else { - x_219 = x_218; + x_224 = x_222; } -lean_ctor_set(x_219, 0, x_216); -lean_ctor_set(x_219, 1, x_217); -return x_219; +lean_ctor_set(x_224, 0, x_223); +lean_ctor_set(x_224, 1, x_221); +return x_224; +} +else +{ +lean_object* x_225; lean_object* x_226; lean_object* x_227; lean_object* x_228; +lean_dec(x_217); +lean_dec(x_212); +lean_dec(x_211); +lean_dec(x_210); +lean_dec(x_209); +x_225 = lean_ctor_get(x_219, 0); +lean_inc(x_225); +x_226 = lean_ctor_get(x_219, 1); +lean_inc(x_226); +if (lean_is_exclusive(x_219)) { + lean_ctor_release(x_219, 0); + lean_ctor_release(x_219, 1); + x_227 = x_219; +} else { + lean_dec_ref(x_219); + x_227 = lean_box(0); +} +if (lean_is_scalar(x_227)) { + x_228 = lean_alloc_ctor(1, 2, 0); +} else { + x_228 = x_227; +} +lean_ctor_set(x_228, 0, x_225); +lean_ctor_set(x_228, 1, x_226); +return x_228; } } else { -lean_object* x_220; lean_object* x_221; lean_object* x_222; lean_object* x_223; -lean_dec(x_206); -lean_dec(x_205); -lean_dec(x_203); -lean_dec(x_202); -lean_dec(x_201); -lean_dec(x_200); +lean_object* x_229; lean_object* x_230; lean_object* x_231; lean_object* x_232; +lean_dec(x_215); +lean_dec(x_214); +lean_dec(x_212); +lean_dec(x_211); +lean_dec(x_210); +lean_dec(x_209); lean_dec(x_9); lean_dec(x_8); lean_dec(x_7); @@ -3570,183 +3590,183 @@ lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -x_220 = lean_ctor_get(x_207, 0); -lean_inc(x_220); -x_221 = lean_ctor_get(x_207, 1); -lean_inc(x_221); -if (lean_is_exclusive(x_207)) { - lean_ctor_release(x_207, 0); - lean_ctor_release(x_207, 1); - x_222 = x_207; +x_229 = lean_ctor_get(x_216, 0); +lean_inc(x_229); +x_230 = lean_ctor_get(x_216, 1); +lean_inc(x_230); +if (lean_is_exclusive(x_216)) { + lean_ctor_release(x_216, 0); + lean_ctor_release(x_216, 1); + x_231 = x_216; } else { - lean_dec_ref(x_207); - x_222 = lean_box(0); + lean_dec_ref(x_216); + x_231 = lean_box(0); } -if (lean_is_scalar(x_222)) { - x_223 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_231)) { + x_232 = lean_alloc_ctor(1, 2, 0); } else { - x_223 = x_222; + x_232 = x_231; } -lean_ctor_set(x_223, 0, x_220); -lean_ctor_set(x_223, 1, x_221); -return x_223; +lean_ctor_set(x_232, 0, x_229); +lean_ctor_set(x_232, 1, x_230); +return x_232; } } } case 8: { -uint8_t x_224; -x_224 = !lean_is_exclusive(x_2); -if (x_224 == 0) +uint8_t x_233; +x_233 = !lean_is_exclusive(x_2); +if (x_233 == 0) { -lean_object* x_225; lean_object* x_226; lean_object* x_227; lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_object* x_231; lean_object* x_232; lean_object* x_233; -x_225 = lean_ctor_get(x_2, 0); -x_226 = lean_ctor_get(x_2, 1); -x_227 = lean_ctor_get(x_2, 2); -x_228 = lean_ctor_get(x_2, 3); -x_229 = x_228; -x_230 = lean_unsigned_to_nat(0u); -x_231 = lean_alloc_closure((void*)(l_Array_umapMAux___main___at_Lean_Elab_Term_Do_pullExitPointsAux___main___spec__2), 11, 3); -lean_closure_set(x_231, 0, x_1); -lean_closure_set(x_231, 1, x_230); -lean_closure_set(x_231, 2, x_229); -x_232 = x_231; -x_233 = lean_apply_8(x_232, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); -if (lean_obj_tag(x_233) == 0) +lean_object* x_234; lean_object* x_235; lean_object* x_236; lean_object* x_237; lean_object* x_238; lean_object* x_239; lean_object* x_240; lean_object* x_241; lean_object* x_242; +x_234 = lean_ctor_get(x_2, 0); +x_235 = lean_ctor_get(x_2, 1); +x_236 = lean_ctor_get(x_2, 2); +x_237 = lean_ctor_get(x_2, 3); +x_238 = x_237; +x_239 = lean_unsigned_to_nat(0u); +x_240 = lean_alloc_closure((void*)(l_Array_umapMAux___main___at_Lean_Elab_Term_Do_pullExitPointsAux___main___spec__2), 11, 3); +lean_closure_set(x_240, 0, x_1); +lean_closure_set(x_240, 1, x_239); +lean_closure_set(x_240, 2, x_238); +x_241 = x_240; +x_242 = lean_apply_8(x_241, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +if (lean_obj_tag(x_242) == 0) { -uint8_t x_234; -x_234 = !lean_is_exclusive(x_233); -if (x_234 == 0) +uint8_t x_243; +x_243 = !lean_is_exclusive(x_242); +if (x_243 == 0) { -lean_object* x_235; -x_235 = lean_ctor_get(x_233, 0); -lean_ctor_set(x_2, 3, x_235); -lean_ctor_set(x_233, 0, x_2); -return x_233; -} -else -{ -lean_object* x_236; lean_object* x_237; lean_object* x_238; -x_236 = lean_ctor_get(x_233, 0); -x_237 = lean_ctor_get(x_233, 1); -lean_inc(x_237); -lean_inc(x_236); -lean_dec(x_233); -lean_ctor_set(x_2, 3, x_236); -x_238 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_238, 0, x_2); -lean_ctor_set(x_238, 1, x_237); -return x_238; -} -} -else -{ -uint8_t x_239; -lean_free_object(x_2); -lean_dec(x_227); -lean_dec(x_226); -lean_dec(x_225); -x_239 = !lean_is_exclusive(x_233); -if (x_239 == 0) -{ -return x_233; -} -else -{ -lean_object* x_240; lean_object* x_241; lean_object* x_242; -x_240 = lean_ctor_get(x_233, 0); -x_241 = lean_ctor_get(x_233, 1); -lean_inc(x_241); -lean_inc(x_240); -lean_dec(x_233); -x_242 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_242, 0, x_240); -lean_ctor_set(x_242, 1, x_241); +lean_object* x_244; +x_244 = lean_ctor_get(x_242, 0); +lean_ctor_set(x_2, 3, x_244); +lean_ctor_set(x_242, 0, x_2); return x_242; } -} -} else { -lean_object* x_243; lean_object* x_244; lean_object* x_245; lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249; lean_object* x_250; lean_object* x_251; -x_243 = lean_ctor_get(x_2, 0); -x_244 = lean_ctor_get(x_2, 1); -x_245 = lean_ctor_get(x_2, 2); -x_246 = lean_ctor_get(x_2, 3); +lean_object* x_245; lean_object* x_246; lean_object* x_247; +x_245 = lean_ctor_get(x_242, 0); +x_246 = lean_ctor_get(x_242, 1); lean_inc(x_246); lean_inc(x_245); -lean_inc(x_244); -lean_inc(x_243); -lean_dec(x_2); -x_247 = x_246; -x_248 = lean_unsigned_to_nat(0u); -x_249 = lean_alloc_closure((void*)(l_Array_umapMAux___main___at_Lean_Elab_Term_Do_pullExitPointsAux___main___spec__2), 11, 3); -lean_closure_set(x_249, 0, x_1); -lean_closure_set(x_249, 1, x_248); -lean_closure_set(x_249, 2, x_247); -x_250 = x_249; -x_251 = lean_apply_8(x_250, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); -if (lean_obj_tag(x_251) == 0) -{ -lean_object* x_252; lean_object* x_253; lean_object* x_254; lean_object* x_255; lean_object* x_256; -x_252 = lean_ctor_get(x_251, 0); -lean_inc(x_252); -x_253 = lean_ctor_get(x_251, 1); -lean_inc(x_253); -if (lean_is_exclusive(x_251)) { - lean_ctor_release(x_251, 0); - lean_ctor_release(x_251, 1); - x_254 = x_251; -} else { - lean_dec_ref(x_251); - x_254 = lean_box(0); +lean_dec(x_242); +lean_ctor_set(x_2, 3, x_245); +x_247 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_247, 0, x_2); +lean_ctor_set(x_247, 1, x_246); +return x_247; } -x_255 = lean_alloc_ctor(8, 4, 0); -lean_ctor_set(x_255, 0, x_243); -lean_ctor_set(x_255, 1, x_244); -lean_ctor_set(x_255, 2, x_245); -lean_ctor_set(x_255, 3, x_252); -if (lean_is_scalar(x_254)) { - x_256 = lean_alloc_ctor(0, 2, 0); -} else { - x_256 = x_254; -} -lean_ctor_set(x_256, 0, x_255); -lean_ctor_set(x_256, 1, x_253); -return x_256; } else { -lean_object* x_257; lean_object* x_258; lean_object* x_259; lean_object* x_260; -lean_dec(x_245); -lean_dec(x_244); -lean_dec(x_243); -x_257 = lean_ctor_get(x_251, 0); -lean_inc(x_257); -x_258 = lean_ctor_get(x_251, 1); -lean_inc(x_258); -if (lean_is_exclusive(x_251)) { - lean_ctor_release(x_251, 0); - lean_ctor_release(x_251, 1); - x_259 = x_251; -} else { - lean_dec_ref(x_251); - x_259 = lean_box(0); +uint8_t x_248; +lean_free_object(x_2); +lean_dec(x_236); +lean_dec(x_235); +lean_dec(x_234); +x_248 = !lean_is_exclusive(x_242); +if (x_248 == 0) +{ +return x_242; } -if (lean_is_scalar(x_259)) { - x_260 = lean_alloc_ctor(1, 2, 0); -} else { - x_260 = x_259; +else +{ +lean_object* x_249; lean_object* x_250; lean_object* x_251; +x_249 = lean_ctor_get(x_242, 0); +x_250 = lean_ctor_get(x_242, 1); +lean_inc(x_250); +lean_inc(x_249); +lean_dec(x_242); +x_251 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_251, 0, x_249); +lean_ctor_set(x_251, 1, x_250); +return x_251; } -lean_ctor_set(x_260, 0, x_257); -lean_ctor_set(x_260, 1, x_258); -return x_260; +} +} +else +{ +lean_object* x_252; lean_object* x_253; lean_object* x_254; lean_object* x_255; lean_object* x_256; lean_object* x_257; lean_object* x_258; lean_object* x_259; lean_object* x_260; +x_252 = lean_ctor_get(x_2, 0); +x_253 = lean_ctor_get(x_2, 1); +x_254 = lean_ctor_get(x_2, 2); +x_255 = lean_ctor_get(x_2, 3); +lean_inc(x_255); +lean_inc(x_254); +lean_inc(x_253); +lean_inc(x_252); +lean_dec(x_2); +x_256 = x_255; +x_257 = lean_unsigned_to_nat(0u); +x_258 = lean_alloc_closure((void*)(l_Array_umapMAux___main___at_Lean_Elab_Term_Do_pullExitPointsAux___main___spec__2), 11, 3); +lean_closure_set(x_258, 0, x_1); +lean_closure_set(x_258, 1, x_257); +lean_closure_set(x_258, 2, x_256); +x_259 = x_258; +x_260 = lean_apply_8(x_259, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +if (lean_obj_tag(x_260) == 0) +{ +lean_object* x_261; lean_object* x_262; lean_object* x_263; lean_object* x_264; lean_object* x_265; +x_261 = lean_ctor_get(x_260, 0); +lean_inc(x_261); +x_262 = lean_ctor_get(x_260, 1); +lean_inc(x_262); +if (lean_is_exclusive(x_260)) { + lean_ctor_release(x_260, 0); + lean_ctor_release(x_260, 1); + x_263 = x_260; +} else { + lean_dec_ref(x_260); + x_263 = lean_box(0); +} +x_264 = lean_alloc_ctor(8, 4, 0); +lean_ctor_set(x_264, 0, x_252); +lean_ctor_set(x_264, 1, x_253); +lean_ctor_set(x_264, 2, x_254); +lean_ctor_set(x_264, 3, x_261); +if (lean_is_scalar(x_263)) { + x_265 = lean_alloc_ctor(0, 2, 0); +} else { + x_265 = x_263; +} +lean_ctor_set(x_265, 0, x_264); +lean_ctor_set(x_265, 1, x_262); +return x_265; +} +else +{ +lean_object* x_266; lean_object* x_267; lean_object* x_268; lean_object* x_269; +lean_dec(x_254); +lean_dec(x_253); +lean_dec(x_252); +x_266 = lean_ctor_get(x_260, 0); +lean_inc(x_266); +x_267 = lean_ctor_get(x_260, 1); +lean_inc(x_267); +if (lean_is_exclusive(x_260)) { + lean_ctor_release(x_260, 0); + lean_ctor_release(x_260, 1); + x_268 = x_260; +} else { + lean_dec_ref(x_260); + x_268 = lean_box(0); +} +if (lean_is_scalar(x_268)) { + x_269 = lean_alloc_ctor(1, 2, 0); +} else { + x_269 = x_268; +} +lean_ctor_set(x_269, 0, x_266); +lean_ctor_set(x_269, 1, x_267); +return x_269; } } } case 9: { -lean_object* x_261; +lean_object* x_270; lean_dec(x_9); lean_dec(x_8); lean_dec(x_7); @@ -3755,19 +3775,19 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_1); -x_261 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_261, 0, x_2); -lean_ctor_set(x_261, 1, x_10); -return x_261; +x_270 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_270, 0, x_2); +lean_ctor_set(x_270, 1, x_10); +return x_270; } default: { -lean_object* x_262; lean_object* x_263; lean_object* x_264; uint8_t x_265; -x_262 = lean_ctor_get(x_2, 0); -lean_inc(x_262); -x_263 = l___private_Lean_Elab_Do_2__nameSetToArray(x_1); -lean_inc(x_263); -x_264 = l_Lean_Elab_Term_Do_addFreshJP(x_263, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +lean_object* x_271; lean_object* x_272; lean_object* x_273; uint8_t x_274; +x_271 = lean_ctor_get(x_2, 0); +lean_inc(x_271); +x_272 = l___private_Lean_Elab_Do_2__nameSetToArray(x_1); +lean_inc(x_272); +x_273 = l_Lean_Elab_Term_Do_addFreshJP(x_272, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); lean_dec(x_9); lean_dec(x_8); lean_dec(x_7); @@ -3775,34 +3795,34 @@ lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -x_265 = !lean_is_exclusive(x_264); -if (x_265 == 0) +x_274 = !lean_is_exclusive(x_273); +if (x_274 == 0) { -lean_object* x_266; lean_object* x_267; -x_266 = lean_ctor_get(x_264, 0); -x_267 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_267, 0, x_262); -lean_ctor_set(x_267, 1, x_266); -lean_ctor_set(x_267, 2, x_263); -lean_ctor_set(x_264, 0, x_267); -return x_264; +lean_object* x_275; lean_object* x_276; +x_275 = lean_ctor_get(x_273, 0); +x_276 = lean_alloc_ctor(9, 3, 0); +lean_ctor_set(x_276, 0, x_271); +lean_ctor_set(x_276, 1, x_275); +lean_ctor_set(x_276, 2, x_272); +lean_ctor_set(x_273, 0, x_276); +return x_273; } else { -lean_object* x_268; lean_object* x_269; lean_object* x_270; lean_object* x_271; -x_268 = lean_ctor_get(x_264, 0); -x_269 = lean_ctor_get(x_264, 1); -lean_inc(x_269); -lean_inc(x_268); -lean_dec(x_264); -x_270 = lean_alloc_ctor(9, 3, 0); -lean_ctor_set(x_270, 0, x_262); -lean_ctor_set(x_270, 1, x_268); -lean_ctor_set(x_270, 2, x_263); -x_271 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_271, 0, x_270); -lean_ctor_set(x_271, 1, x_269); -return x_271; +lean_object* x_277; lean_object* x_278; lean_object* x_279; lean_object* x_280; +x_277 = lean_ctor_get(x_273, 0); +x_278 = lean_ctor_get(x_273, 1); +lean_inc(x_278); +lean_inc(x_277); +lean_dec(x_273); +x_279 = lean_alloc_ctor(9, 3, 0); +lean_ctor_set(x_279, 0, x_271); +lean_ctor_set(x_279, 1, x_277); +lean_ctor_set(x_279, 2, x_272); +x_280 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_280, 0, x_279); +lean_ctor_set(x_280, 1, x_278); +return x_280; } } } @@ -11010,45 +11030,6 @@ x_7 = l___private_Lean_Elab_Do_11__expandDoElems(x_6, x_2, x_3, x_4, x_5); return x_7; } } -lean_object* l_Lean_Elab_Term_expandDo(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; uint8_t x_5; lean_object* x_6; lean_object* x_7; -x_4 = l___private_Lean_Elab_Do_7__getDoElems(x_1); -x_5 = 0; -x_6 = lean_unsigned_to_nat(0u); -x_7 = l___private_Lean_Elab_Do_11__expandDoElems___main(x_5, x_4, x_6, x_2, x_3); -return x_7; -} -} -lean_object* l_Lean_Elab_Term_expandDo___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = l_Lean_Elab_Term_expandDo(x_1, x_2, x_3); -lean_dec(x_1); -return x_4; -} -} -lean_object* _init_l___regBuiltin_Lean_Elab_Term_expandDo___closed__1() { -_start: -{ -lean_object* x_1; -x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Term_expandDo___boxed), 3, 0); -return x_1; -} -} -lean_object* l___regBuiltin_Lean_Elab_Term_expandDo(lean_object* x_1) { -_start: -{ -lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; -x_2 = l_Lean_Elab_macroAttribute; -x_3 = l___private_Lean_Elab_Do_8__hasLiftMethod___main___closed__2; -x_4 = l___regBuiltin_Lean_Elab_Term_expandDo___closed__1; -x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); -return x_5; -} -} lean_object* _init_l_Lean_Elab_Term_ProcessedDoElem_inhabited___closed__1() { _start: { @@ -12704,6 +12685,81 @@ x_14 = l___private_Lean_Elab_Do_14__processDoElemsAux___main(x_1, x_2, x_3, x_4, return x_14; } } +lean_object* l_Lean_Elab_Term_expandDo_x3f(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; uint8_t x_5; lean_object* x_6; lean_object* x_7; +x_4 = l___private_Lean_Elab_Do_7__getDoElems(x_1); +x_5 = 0; +x_6 = lean_unsigned_to_nat(0u); +x_7 = l___private_Lean_Elab_Do_11__expandDoElems___main(x_5, x_4, x_6, x_2, x_3); +if (lean_obj_tag(x_7) == 0) +{ +uint8_t x_8; +x_8 = !lean_is_exclusive(x_7); +if (x_8 == 0) +{ +lean_object* x_9; lean_object* x_10; +x_9 = lean_ctor_get(x_7, 0); +x_10 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_10, 0, x_9); +lean_ctor_set(x_7, 0, x_10); +return x_7; +} +else +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_11 = lean_ctor_get(x_7, 0); +x_12 = lean_ctor_get(x_7, 1); +lean_inc(x_12); +lean_inc(x_11); +lean_dec(x_7); +x_13 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_13, 0, x_11); +x_14 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_14, 0, x_13); +lean_ctor_set(x_14, 1, x_12); +return x_14; +} +} +else +{ +uint8_t x_15; +x_15 = !lean_is_exclusive(x_7); +if (x_15 == 0) +{ +lean_object* x_16; lean_object* x_17; +x_16 = lean_ctor_get(x_7, 0); +lean_dec(x_16); +x_17 = lean_box(0); +lean_ctor_set_tag(x_7, 0); +lean_ctor_set(x_7, 0, x_17); +return x_7; +} +else +{ +lean_object* x_18; lean_object* x_19; lean_object* x_20; +x_18 = lean_ctor_get(x_7, 1); +lean_inc(x_18); +lean_dec(x_7); +x_19 = lean_box(0); +x_20 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_20, 0, x_19); +lean_ctor_set(x_20, 1, x_18); +return x_20; +} +} +} +} +lean_object* l_Lean_Elab_Term_expandDo_x3f___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Term_expandDo_x3f(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} lean_object* l_List_toStringAux___main___at_Lean_Elab_Term_elabDo___spec__2(uint8_t x_1, lean_object* x_2) { _start: { @@ -12832,192 +12888,200 @@ return x_2; lean_object* l_Lean_Elab_Term_elabDo(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: { -lean_object* x_10; -lean_inc(x_2); -x_10 = l_Lean_Elab_Term_tryPostponeIfNoneOrMVar(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +lean_object* x_10; lean_object* x_11; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; uint8_t x_126; +x_103 = l_Lean_Elab_Term_getCurrMacroScope(x_3, x_4, x_5, x_6, x_7, x_8, x_9); +x_104 = lean_ctor_get(x_103, 0); +lean_inc(x_104); +x_105 = lean_ctor_get(x_103, 1); +lean_inc(x_105); +lean_dec(x_103); +x_106 = lean_st_ref_get(x_8, x_105); +x_107 = lean_ctor_get(x_106, 0); +lean_inc(x_107); +x_108 = lean_ctor_get(x_106, 1); +lean_inc(x_108); +lean_dec(x_106); +x_109 = lean_ctor_get(x_107, 0); +lean_inc(x_109); +lean_dec(x_107); +x_110 = lean_st_ref_get(x_8, x_108); +x_111 = lean_ctor_get(x_110, 0); +lean_inc(x_111); +x_112 = lean_ctor_get(x_110, 1); +lean_inc(x_112); +lean_dec(x_110); +x_113 = lean_ctor_get(x_111, 1); +lean_inc(x_113); +lean_dec(x_111); +x_114 = lean_ctor_get(x_7, 1); +lean_inc(x_114); +x_115 = lean_ctor_get(x_7, 2); +lean_inc(x_115); +lean_inc(x_109); +x_116 = lean_alloc_closure((void*)(l___private_Lean_Elab_Util_5__expandMacro_x3f___boxed), 4, 1); +lean_closure_set(x_116, 0, x_109); +x_117 = x_116; +x_118 = lean_environment_main_module(x_109); +x_119 = lean_alloc_ctor(0, 5, 0); +lean_ctor_set(x_119, 0, x_117); +lean_ctor_set(x_119, 1, x_118); +lean_ctor_set(x_119, 2, x_104); +lean_ctor_set(x_119, 3, x_114); +lean_ctor_set(x_119, 4, x_115); +x_120 = l_Lean_Elab_Term_expandDo_x3f(x_1, x_119, x_113); +x_121 = lean_ctor_get(x_120, 0); +lean_inc(x_121); +x_122 = lean_ctor_get(x_120, 1); +lean_inc(x_122); +lean_dec(x_120); +x_123 = lean_st_ref_take(x_8, x_112); +x_124 = lean_ctor_get(x_123, 0); +lean_inc(x_124); +x_125 = lean_ctor_get(x_123, 1); +lean_inc(x_125); +lean_dec(x_123); +x_126 = !lean_is_exclusive(x_124); +if (x_126 == 0) +{ +lean_object* x_127; lean_object* x_128; lean_object* x_129; +x_127 = lean_ctor_get(x_124, 1); +lean_dec(x_127); +lean_ctor_set(x_124, 1, x_122); +x_128 = lean_st_ref_set(x_8, x_124, x_125); +x_129 = lean_ctor_get(x_128, 1); +lean_inc(x_129); +lean_dec(x_128); +x_10 = x_121; +x_11 = x_129; +goto block_102; +} +else +{ +lean_object* x_130; lean_object* x_131; lean_object* x_132; lean_object* x_133; lean_object* x_134; lean_object* x_135; +x_130 = lean_ctor_get(x_124, 0); +x_131 = lean_ctor_get(x_124, 2); +x_132 = lean_ctor_get(x_124, 3); +lean_inc(x_132); +lean_inc(x_131); +lean_inc(x_130); +lean_dec(x_124); +x_133 = lean_alloc_ctor(0, 4, 0); +lean_ctor_set(x_133, 0, x_130); +lean_ctor_set(x_133, 1, x_122); +lean_ctor_set(x_133, 2, x_131); +lean_ctor_set(x_133, 3, x_132); +x_134 = lean_st_ref_set(x_8, x_133, x_125); +x_135 = lean_ctor_get(x_134, 1); +lean_inc(x_135); +lean_dec(x_134); +x_10 = x_121; +x_11 = x_135; +goto block_102; +} +block_102: +{ if (lean_obj_tag(x_10) == 0) { -lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_100; lean_object* x_101; uint8_t x_102; -x_11 = lean_ctor_get(x_10, 1); -lean_inc(x_11); -lean_dec(x_10); -x_12 = l___private_Lean_Elab_Do_7__getDoElems(x_1); -x_100 = lean_ctor_get(x_7, 0); -lean_inc(x_100); -x_101 = l_Lean_Elab_Term_elabDo___closed__1; -x_102 = l_Lean_checkTraceOption(x_100, x_101); -lean_dec(x_100); -if (x_102 == 0) +lean_object* x_12; +lean_inc(x_2); +x_12 = l_Lean_Elab_Term_tryPostponeIfNoneOrMVar(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_11); +if (lean_obj_tag(x_12) == 0) +{ +lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_70; lean_object* x_71; uint8_t x_72; +x_13 = lean_ctor_get(x_12, 1); +lean_inc(x_13); +lean_dec(x_12); +x_14 = l___private_Lean_Elab_Do_7__getDoElems(x_1); +x_70 = lean_ctor_get(x_7, 0); +lean_inc(x_70); +x_71 = l_Lean_Elab_Term_elabDo___closed__1; +x_72 = l_Lean_checkTraceOption(x_70, x_71); +lean_dec(x_70); +if (x_72 == 0) { lean_dec(x_1); -x_13 = x_11; -goto block_99; +x_15 = x_13; +goto block_69; } else { -lean_object* x_103; lean_object* x_104; lean_object* x_105; -x_103 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_103, 0, x_1); -x_104 = l_Lean_Elab_logTrace___at_Lean_Elab_Term_traceAtCmdPos___spec__1(x_101, x_103, x_3, x_4, x_5, x_6, x_7, x_8, x_11); -x_105 = lean_ctor_get(x_104, 1); -lean_inc(x_105); -lean_dec(x_104); -x_13 = x_105; -goto block_99; +lean_object* x_73; lean_object* x_74; lean_object* x_75; +x_73 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_73, 0, x_1); +x_74 = l_Lean_Elab_logTrace___at_Lean_Elab_Term_traceAtCmdPos___spec__1(x_71, x_73, x_3, x_4, x_5, x_6, x_7, x_8, x_13); +x_75 = lean_ctor_get(x_74, 1); +lean_inc(x_75); +lean_dec(x_74); +x_15 = x_75; +goto block_69; } -block_99: +block_69: { -lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; -x_14 = lean_unsigned_to_nat(2u); -x_15 = lean_unsigned_to_nat(0u); -x_16 = l_Array_empty___closed__1; -x_17 = l_Array_foldlStepMAux___main___at_Lean_Elab_Term_elabParen___spec__1(x_14, x_12, x_15, x_16); -lean_dec(x_12); -x_18 = lean_ctor_get(x_7, 0); -lean_inc(x_18); -x_19 = l_Lean_Elab_Term_elabDo___closed__1; -x_20 = l_Lean_checkTraceOption(x_18, x_19); -lean_dec(x_18); -if (x_20 == 0) +lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; uint8_t x_22; +x_16 = lean_unsigned_to_nat(2u); +x_17 = lean_unsigned_to_nat(0u); +x_18 = l_Array_empty___closed__1; +x_19 = l_Array_foldlStepMAux___main___at_Lean_Elab_Term_elabParen___spec__1(x_16, x_14, x_17, x_18); +lean_dec(x_14); +x_20 = lean_ctor_get(x_7, 0); +lean_inc(x_20); +x_21 = l_Lean_Elab_Term_elabDo___closed__1; +x_22 = l_Lean_checkTraceOption(x_20, x_21); +lean_dec(x_20); +if (x_22 == 0) { -lean_object* x_21; +lean_object* x_23; lean_inc(x_8); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); lean_inc(x_3); lean_inc(x_2); -x_21 = l___private_Lean_Elab_Do_6__extractBind(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_13); -if (lean_obj_tag(x_21) == 0) +x_23 = l___private_Lean_Elab_Do_6__extractBind(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_15); +if (lean_obj_tag(x_23) == 0) { -lean_object* x_22; -x_22 = lean_ctor_get(x_21, 0); -lean_inc(x_22); +lean_object* x_24; +x_24 = lean_ctor_get(x_23, 0); +lean_inc(x_24); if (lean_obj_tag(x_2) == 0) { -lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; -x_23 = lean_ctor_get(x_21, 1); -lean_inc(x_23); -lean_dec(x_21); -x_24 = lean_ctor_get(x_22, 0); -lean_inc(x_24); -x_25 = lean_ctor_get(x_22, 2); +lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; +x_25 = lean_ctor_get(x_23, 1); lean_inc(x_25); -lean_dec(x_22); -x_26 = l_Lean_Expr_Inhabited; -x_27 = l_Option_get_x21___rarg___closed__3; -x_28 = lean_panic_fn(x_26, x_27); -x_29 = l___private_Lean_Elab_Do_15__processDoElems(x_17, x_24, x_25, x_28, x_3, x_4, x_5, x_6, x_7, x_8, x_23); -if (lean_obj_tag(x_29) == 0) -{ -uint8_t x_30; -x_30 = !lean_is_exclusive(x_29); -if (x_30 == 0) -{ -return x_29; +lean_dec(x_23); +x_26 = lean_ctor_get(x_24, 0); +lean_inc(x_26); +x_27 = lean_ctor_get(x_24, 2); +lean_inc(x_27); +lean_dec(x_24); +x_28 = l_Lean_Expr_Inhabited; +x_29 = l_Option_get_x21___rarg___closed__3; +x_30 = lean_panic_fn(x_28, x_29); +x_31 = l___private_Lean_Elab_Do_15__processDoElems(x_19, x_26, x_27, x_30, x_3, x_4, x_5, x_6, x_7, x_8, x_25); +return x_31; } else { -lean_object* x_31; lean_object* x_32; lean_object* x_33; -x_31 = lean_ctor_get(x_29, 0); -x_32 = lean_ctor_get(x_29, 1); +lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; +x_32 = lean_ctor_get(x_23, 1); lean_inc(x_32); -lean_inc(x_31); -lean_dec(x_29); -x_33 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_33, 0, x_31); -lean_ctor_set(x_33, 1, x_32); -return x_33; -} -} -else -{ -uint8_t x_34; -x_34 = !lean_is_exclusive(x_29); -if (x_34 == 0) -{ -return x_29; -} -else -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; -x_35 = lean_ctor_get(x_29, 0); -x_36 = lean_ctor_get(x_29, 1); -lean_inc(x_36); +lean_dec(x_23); +x_33 = lean_ctor_get(x_24, 0); +lean_inc(x_33); +x_34 = lean_ctor_get(x_24, 2); +lean_inc(x_34); +lean_dec(x_24); +x_35 = lean_ctor_get(x_2, 0); lean_inc(x_35); -lean_dec(x_29); -x_37 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_37, 0, x_35); -lean_ctor_set(x_37, 1, x_36); -return x_37; -} -} -} -else -{ -lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; -x_38 = lean_ctor_get(x_21, 1); -lean_inc(x_38); -lean_dec(x_21); -x_39 = lean_ctor_get(x_22, 0); -lean_inc(x_39); -x_40 = lean_ctor_get(x_22, 2); -lean_inc(x_40); -lean_dec(x_22); -x_41 = lean_ctor_get(x_2, 0); -lean_inc(x_41); lean_dec(x_2); -x_42 = l___private_Lean_Elab_Do_15__processDoElems(x_17, x_39, x_40, x_41, x_3, x_4, x_5, x_6, x_7, x_8, x_38); -if (lean_obj_tag(x_42) == 0) -{ -uint8_t x_43; -x_43 = !lean_is_exclusive(x_42); -if (x_43 == 0) -{ -return x_42; -} -else -{ -lean_object* x_44; lean_object* x_45; lean_object* x_46; -x_44 = lean_ctor_get(x_42, 0); -x_45 = lean_ctor_get(x_42, 1); -lean_inc(x_45); -lean_inc(x_44); -lean_dec(x_42); -x_46 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_46, 0, x_44); -lean_ctor_set(x_46, 1, x_45); -return x_46; +x_36 = l___private_Lean_Elab_Do_15__processDoElems(x_19, x_33, x_34, x_35, x_3, x_4, x_5, x_6, x_7, x_8, x_32); +return x_36; } } else { -uint8_t x_47; -x_47 = !lean_is_exclusive(x_42); -if (x_47 == 0) -{ -return x_42; -} -else -{ -lean_object* x_48; lean_object* x_49; lean_object* x_50; -x_48 = lean_ctor_get(x_42, 0); -x_49 = lean_ctor_get(x_42, 1); -lean_inc(x_49); -lean_inc(x_48); -lean_dec(x_42); -x_50 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_50, 0, x_48); -lean_ctor_set(x_50, 1, x_49); -return x_50; -} -} -} -} -else -{ -uint8_t x_51; -lean_dec(x_17); +uint8_t x_37; +lean_dec(x_19); lean_dec(x_8); lean_dec(x_7); lean_dec(x_6); @@ -13025,244 +13089,228 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -x_51 = !lean_is_exclusive(x_21); -if (x_51 == 0) +x_37 = !lean_is_exclusive(x_23); +if (x_37 == 0) { -return x_21; +return x_23; } else { -lean_object* x_52; lean_object* x_53; lean_object* x_54; -x_52 = lean_ctor_get(x_21, 0); -x_53 = lean_ctor_get(x_21, 1); -lean_inc(x_53); -lean_inc(x_52); -lean_dec(x_21); -x_54 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_54, 0, x_52); -lean_ctor_set(x_54, 1, x_53); -return x_54; +lean_object* x_38; lean_object* x_39; lean_object* x_40; +x_38 = lean_ctor_get(x_23, 0); +x_39 = lean_ctor_get(x_23, 1); +lean_inc(x_39); +lean_inc(x_38); +lean_dec(x_23); +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_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; -x_55 = l_Array_toList___rarg(x_17); -x_56 = l_List_toString___at_Lean_Elab_Term_elabDo___spec__1(x_55); -x_57 = l_Array_HasRepr___rarg___closed__1; -x_58 = lean_string_append(x_57, x_56); -lean_dec(x_56); -x_59 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_59, 0, x_58); -x_60 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_60, 0, x_59); -x_61 = l_Lean_Elab_Term_elabDo___closed__4; -x_62 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_62, 0, x_61); -lean_ctor_set(x_62, 1, x_60); -x_63 = l_Lean_Elab_logTrace___at_Lean_Elab_Term_traceAtCmdPos___spec__1(x_19, x_62, x_3, x_4, x_5, x_6, x_7, x_8, x_13); -x_64 = lean_ctor_get(x_63, 1); -lean_inc(x_64); -lean_dec(x_63); +lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; +x_41 = l_Array_toList___rarg(x_19); +x_42 = l_List_toString___at_Lean_Elab_Term_elabDo___spec__1(x_41); +x_43 = l_Array_HasRepr___rarg___closed__1; +x_44 = lean_string_append(x_43, x_42); +lean_dec(x_42); +x_45 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_45, 0, x_44); +x_46 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_46, 0, x_45); +x_47 = l_Lean_Elab_Term_elabDo___closed__4; +x_48 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_48, 0, x_47); +lean_ctor_set(x_48, 1, x_46); +x_49 = l_Lean_Elab_logTrace___at_Lean_Elab_Term_traceAtCmdPos___spec__1(x_21, x_48, x_3, x_4, x_5, x_6, x_7, x_8, x_15); +x_50 = lean_ctor_get(x_49, 1); +lean_inc(x_50); +lean_dec(x_49); lean_inc(x_8); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); lean_inc(x_3); lean_inc(x_2); -x_65 = l___private_Lean_Elab_Do_6__extractBind(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_64); -if (lean_obj_tag(x_65) == 0) +x_51 = l___private_Lean_Elab_Do_6__extractBind(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_50); +if (lean_obj_tag(x_51) == 0) { -lean_object* x_66; -x_66 = lean_ctor_get(x_65, 0); -lean_inc(x_66); +lean_object* x_52; +x_52 = lean_ctor_get(x_51, 0); +lean_inc(x_52); if (lean_obj_tag(x_2) == 0) { -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; -x_67 = lean_ctor_get(x_65, 1); -lean_inc(x_67); -lean_dec(x_65); -x_68 = lean_ctor_get(x_66, 0); -lean_inc(x_68); -x_69 = lean_ctor_get(x_66, 2); -lean_inc(x_69); -lean_dec(x_66); -x_70 = l_Lean_Expr_Inhabited; -x_71 = l_Option_get_x21___rarg___closed__3; -x_72 = lean_panic_fn(x_70, x_71); -x_73 = l___private_Lean_Elab_Do_15__processDoElems(x_17, x_68, x_69, x_72, x_3, x_4, x_5, x_6, x_7, x_8, x_67); -if (lean_obj_tag(x_73) == 0) -{ -uint8_t x_74; -x_74 = !lean_is_exclusive(x_73); -if (x_74 == 0) -{ -return x_73; +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_53 = lean_ctor_get(x_51, 1); +lean_inc(x_53); +lean_dec(x_51); +x_54 = lean_ctor_get(x_52, 0); +lean_inc(x_54); +x_55 = lean_ctor_get(x_52, 2); +lean_inc(x_55); +lean_dec(x_52); +x_56 = l_Lean_Expr_Inhabited; +x_57 = l_Option_get_x21___rarg___closed__3; +x_58 = lean_panic_fn(x_56, x_57); +x_59 = l___private_Lean_Elab_Do_15__processDoElems(x_19, x_54, x_55, x_58, x_3, x_4, x_5, x_6, x_7, x_8, x_53); +return x_59; } else { -lean_object* x_75; lean_object* x_76; lean_object* x_77; -x_75 = lean_ctor_get(x_73, 0); -x_76 = lean_ctor_get(x_73, 1); -lean_inc(x_76); -lean_inc(x_75); -lean_dec(x_73); -x_77 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_77, 0, x_75); -lean_ctor_set(x_77, 1, x_76); -return x_77; -} -} -else -{ -uint8_t x_78; -x_78 = !lean_is_exclusive(x_73); -if (x_78 == 0) -{ -return x_73; -} -else -{ -lean_object* x_79; lean_object* x_80; lean_object* x_81; -x_79 = lean_ctor_get(x_73, 0); -x_80 = lean_ctor_get(x_73, 1); -lean_inc(x_80); -lean_inc(x_79); -lean_dec(x_73); -x_81 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_81, 0, x_79); -lean_ctor_set(x_81, 1, x_80); -return x_81; -} -} -} -else -{ -lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; -x_82 = lean_ctor_get(x_65, 1); -lean_inc(x_82); -lean_dec(x_65); -x_83 = lean_ctor_get(x_66, 0); -lean_inc(x_83); -x_84 = lean_ctor_get(x_66, 2); -lean_inc(x_84); -lean_dec(x_66); -x_85 = lean_ctor_get(x_2, 0); -lean_inc(x_85); +lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; +x_60 = lean_ctor_get(x_51, 1); +lean_inc(x_60); +lean_dec(x_51); +x_61 = lean_ctor_get(x_52, 0); +lean_inc(x_61); +x_62 = lean_ctor_get(x_52, 2); +lean_inc(x_62); +lean_dec(x_52); +x_63 = lean_ctor_get(x_2, 0); +lean_inc(x_63); lean_dec(x_2); -x_86 = l___private_Lean_Elab_Do_15__processDoElems(x_17, x_83, x_84, x_85, x_3, x_4, x_5, x_6, x_7, x_8, x_82); -if (lean_obj_tag(x_86) == 0) +x_64 = l___private_Lean_Elab_Do_15__processDoElems(x_19, x_61, x_62, x_63, x_3, x_4, x_5, x_6, x_7, x_8, x_60); +return x_64; +} +} +else { -uint8_t x_87; -x_87 = !lean_is_exclusive(x_86); -if (x_87 == 0) +uint8_t x_65; +lean_dec(x_19); +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_2); +x_65 = !lean_is_exclusive(x_51); +if (x_65 == 0) { +return x_51; +} +else +{ +lean_object* x_66; lean_object* x_67; lean_object* x_68; +x_66 = lean_ctor_get(x_51, 0); +x_67 = lean_ctor_get(x_51, 1); +lean_inc(x_67); +lean_inc(x_66); +lean_dec(x_51); +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; +} +} +} +} +} +else +{ +uint8_t x_76; +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_2); +lean_dec(x_1); +x_76 = !lean_is_exclusive(x_12); +if (x_76 == 0) +{ +return x_12; +} +else +{ +lean_object* x_77; lean_object* x_78; lean_object* x_79; +x_77 = lean_ctor_get(x_12, 0); +x_78 = lean_ctor_get(x_12, 1); +lean_inc(x_78); +lean_inc(x_77); +lean_dec(x_12); +x_79 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_79, 0, x_77); +lean_ctor_set(x_79, 1, x_78); +return x_79; +} +} +} +else +{ +lean_object* x_80; uint8_t x_81; +x_80 = lean_ctor_get(x_10, 0); +lean_inc(x_80); +lean_dec(x_10); +x_81 = !lean_is_exclusive(x_3); +if (x_81 == 0) +{ +lean_object* x_82; lean_object* x_83; lean_object* x_84; uint8_t x_85; lean_object* x_86; +x_82 = lean_ctor_get(x_3, 6); +lean_inc(x_80); +x_83 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_83, 0, x_1); +lean_ctor_set(x_83, 1, x_80); +x_84 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_84, 0, x_83); +lean_ctor_set(x_84, 1, x_82); +lean_ctor_set(x_3, 6, x_84); +x_85 = 1; +x_86 = l_Lean_Elab_Term_elabTerm(x_80, x_2, x_85, x_3, x_4, x_5, x_6, x_7, x_8, x_11); return x_86; } else { -lean_object* x_88; lean_object* x_89; lean_object* x_90; -x_88 = lean_ctor_get(x_86, 0); -x_89 = lean_ctor_get(x_86, 1); -lean_inc(x_89); -lean_inc(x_88); -lean_dec(x_86); -x_90 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_90, 0, x_88); -lean_ctor_set(x_90, 1, x_89); -return x_90; -} -} -else -{ -uint8_t x_91; -x_91 = !lean_is_exclusive(x_86); -if (x_91 == 0) -{ -return x_86; -} -else -{ -lean_object* x_92; lean_object* x_93; lean_object* x_94; -x_92 = lean_ctor_get(x_86, 0); -x_93 = lean_ctor_get(x_86, 1); +lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; uint8_t x_95; uint8_t x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; uint8_t x_100; lean_object* x_101; +x_87 = lean_ctor_get(x_3, 0); +x_88 = lean_ctor_get(x_3, 1); +x_89 = lean_ctor_get(x_3, 2); +x_90 = lean_ctor_get(x_3, 3); +x_91 = lean_ctor_get(x_3, 4); +x_92 = lean_ctor_get(x_3, 5); +x_93 = lean_ctor_get(x_3, 6); +x_94 = lean_ctor_get(x_3, 7); +x_95 = lean_ctor_get_uint8(x_3, sizeof(void*)*8); +x_96 = lean_ctor_get_uint8(x_3, sizeof(void*)*8 + 1); +lean_inc(x_94); lean_inc(x_93); lean_inc(x_92); -lean_dec(x_86); -x_94 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_94, 0, x_92); -lean_ctor_set(x_94, 1, x_93); -return x_94; -} -} -} -} -else -{ -uint8_t x_95; -lean_dec(x_17); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); +lean_inc(x_91); +lean_inc(x_90); +lean_inc(x_89); +lean_inc(x_88); +lean_inc(x_87); lean_dec(x_3); -lean_dec(x_2); -x_95 = !lean_is_exclusive(x_65); -if (x_95 == 0) -{ -return x_65; -} -else -{ -lean_object* x_96; lean_object* x_97; lean_object* x_98; -x_96 = lean_ctor_get(x_65, 0); -x_97 = lean_ctor_get(x_65, 1); -lean_inc(x_97); -lean_inc(x_96); -lean_dec(x_65); +lean_inc(x_80); +x_97 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_97, 0, x_1); +lean_ctor_set(x_97, 1, x_80); x_98 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_98, 0, x_96); -lean_ctor_set(x_98, 1, x_97); -return x_98; +lean_ctor_set(x_98, 0, x_97); +lean_ctor_set(x_98, 1, x_93); +x_99 = lean_alloc_ctor(0, 8, 2); +lean_ctor_set(x_99, 0, x_87); +lean_ctor_set(x_99, 1, x_88); +lean_ctor_set(x_99, 2, x_89); +lean_ctor_set(x_99, 3, x_90); +lean_ctor_set(x_99, 4, x_91); +lean_ctor_set(x_99, 5, x_92); +lean_ctor_set(x_99, 6, x_98); +lean_ctor_set(x_99, 7, x_94); +lean_ctor_set_uint8(x_99, sizeof(void*)*8, x_95); +lean_ctor_set_uint8(x_99, sizeof(void*)*8 + 1, x_96); +x_100 = 1; +x_101 = l_Lean_Elab_Term_elabTerm(x_80, x_2, x_100, x_99, x_4, x_5, x_6, x_7, x_8, x_11); +return x_101; } } } } } -else -{ -uint8_t x_106; -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_2); -lean_dec(x_1); -x_106 = !lean_is_exclusive(x_10); -if (x_106 == 0) -{ -return x_10; -} -else -{ -lean_object* x_107; lean_object* x_108; lean_object* x_109; -x_107 = lean_ctor_get(x_10, 0); -x_108 = lean_ctor_get(x_10, 1); -lean_inc(x_108); -lean_inc(x_107); -lean_dec(x_10); -x_109 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_109, 0, x_107); -lean_ctor_set(x_109, 1, x_108); -return x_109; -} -} -} -} lean_object* l_List_toStringAux___main___at_Lean_Elab_Term_elabDo___spec__2___boxed(lean_object* x_1, lean_object* x_2) { _start: { @@ -13581,11 +13629,6 @@ l___private_Lean_Elab_Do_11__expandDoElems___main___closed__7 = _init_l___privat lean_mark_persistent(l___private_Lean_Elab_Do_11__expandDoElems___main___closed__7); l___private_Lean_Elab_Do_11__expandDoElems___main___closed__8 = _init_l___private_Lean_Elab_Do_11__expandDoElems___main___closed__8(); lean_mark_persistent(l___private_Lean_Elab_Do_11__expandDoElems___main___closed__8); -l___regBuiltin_Lean_Elab_Term_expandDo___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_expandDo___closed__1(); -lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_expandDo___closed__1); -res = l___regBuiltin_Lean_Elab_Term_expandDo(lean_io_mk_world()); -if (lean_io_result_is_error(res)) return res; -lean_dec_ref(res); l_Lean_Elab_Term_ProcessedDoElem_inhabited___closed__1 = _init_l_Lean_Elab_Term_ProcessedDoElem_inhabited___closed__1(); lean_mark_persistent(l_Lean_Elab_Term_ProcessedDoElem_inhabited___closed__1); l_Lean_Elab_Term_ProcessedDoElem_inhabited = _init_l_Lean_Elab_Term_ProcessedDoElem_inhabited(); diff --git a/stage0/stdlib/Lean/Elab/SyntheticMVars.c b/stage0/stdlib/Lean/Elab/SyntheticMVars.c index da30ef8daf..ed5b8addfd 100644 --- a/stage0/stdlib/Lean/Elab/SyntheticMVars.c +++ b/stage0/stdlib/Lean/Elab/SyntheticMVars.c @@ -28,6 +28,7 @@ lean_object* l___private_Lean_Elab_SyntheticMVars_7__synthesizeSyntheticMVarsSte extern lean_object* l_Lean_withIncRecDepth___rarg___lambda__2___closed__2; lean_object* l_unreachable_x21___rarg(lean_object*); lean_object* l_Lean_Elab_Term_liftTacticElabM___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +extern lean_object* l_Lean_MessageData_ofList___closed__3; lean_object* l_Lean_Elab_Term_runTactic___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_ensureAssignmentHasNoMVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_liftTacticElabM___rarg___closed__1; @@ -50,6 +51,7 @@ lean_object* l_Lean_Elab_Term_getMVarDecl(lean_object*, lean_object*, lean_objec lean_object* l_List_find_x3f___main___rarg(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_SyntheticMVars_2__resumePostponed___lambda__1(uint8_t, 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* l_Lean_Expr_getAppFn___main(lean_object*); +lean_object* l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__4; lean_object* l_List_forM___main___at___private_Lean_Elab_SyntheticMVars_9__reportStuckSyntheticMVars___spec__1___closed__1; lean_object* l_List_forM___main___at___private_Lean_Elab_SyntheticMVars_9__reportStuckSyntheticMVars___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_7__synthesizeSyntheticMVarsStep___spec__2___closed__1; @@ -132,12 +134,14 @@ lean_object* l_Lean_Elab_Term_synthesizeSyntheticMVarsNoPostponing(lean_object*, lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_SyntheticMVars_2__resumePostponed(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_object* l_Lean_Elab_Term_withSynthesize___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__6; lean_object* l_Lean_Elab_Term_reportUnsolvedGoals(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_SyntheticMVars_7__synthesizeSyntheticMVarsStep___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_throwTypeMismatchError___rarg(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* l___private_Lean_Elab_SyntheticMVars_7__synthesizeSyntheticMVarsStep___closed__1; lean_object* l___private_Lean_Elab_SyntheticMVars_11__synthesizeSyntheticMVarsAux(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_MetavarContext_instantiateMVarDeclMVars(lean_object*, lean_object*); +lean_object* l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__5; uint8_t l___private_Lean_Elab_SyntheticMVars_10__getSomeSynthethicMVarsRef___rarg___lambda__1(lean_object*); lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_SyntheticMVars_7__synthesizeSyntheticMVarsStep___closed__2; @@ -3392,6 +3396,34 @@ lean_ctor_set(x_2, 0, x_1); return x_2; } } +lean_object* _init_l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__4() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("default value"); +return x_1; +} +} +lean_object* _init_l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__5() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__4; +x_2 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} +lean_object* _init_l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__6() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__5; +x_2 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} lean_object* l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1(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: { @@ -3423,6 +3455,8 @@ lean_inc(x_8); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); +lean_inc(x_1); +lean_inc(x_2); x_15 = l_Lean_Meta_isExprDefEq___at_Lean_Elab_Term_synthesizeInstMVarCore___spec__3(x_2, x_1, x_3, x_4, x_5, x_6, x_7, x_8, x_9); if (lean_obj_tag(x_15) == 0) { @@ -3433,69 +3467,51 @@ x_17 = lean_unbox(x_16); lean_dec(x_16); if (x_17 == 0) { -lean_object* x_18; lean_object* x_19; lean_object* x_20; uint8_t x_21; +lean_object* x_18; 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; lean_object* x_28; uint8_t x_29; x_18 = lean_ctor_get(x_15, 1); lean_inc(x_18); lean_dec(x_15); -x_19 = l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__3; -x_20 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1___rarg(x_19, x_3, x_4, x_5, x_6, x_7, x_8, x_18); +x_19 = l_Lean_indentExpr(x_2); +x_20 = l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__3; +x_21 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_21, 0, x_20); +lean_ctor_set(x_21, 1, x_19); +x_22 = l_Lean_MessageData_ofList___closed__3; +x_23 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_23, 0, x_21); +lean_ctor_set(x_23, 1, x_22); +x_24 = l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__6; +x_25 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_25, 0, x_23); +lean_ctor_set(x_25, 1, x_24); +x_26 = l_Lean_indentExpr(x_1); +x_27 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_27, 0, x_25); +lean_ctor_set(x_27, 1, x_26); +x_28 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1___rarg(x_27, x_3, x_4, x_5, x_6, x_7, x_8, x_18); lean_dec(x_8); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); -x_21 = !lean_is_exclusive(x_20); -if (x_21 == 0) +x_29 = !lean_is_exclusive(x_28); +if (x_29 == 0) { -return x_20; +return x_28; } else { -lean_object* x_22; lean_object* x_23; lean_object* x_24; -x_22 = lean_ctor_get(x_20, 0); -x_23 = lean_ctor_get(x_20, 1); -lean_inc(x_23); -lean_inc(x_22); -lean_dec(x_20); -x_24 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_24, 0, x_22); -lean_ctor_set(x_24, 1, x_23); -return x_24; -} -} -else -{ -uint8_t x_25; -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_3); -x_25 = !lean_is_exclusive(x_15); -if (x_25 == 0) -{ -lean_object* x_26; uint8_t x_27; lean_object* x_28; -x_26 = lean_ctor_get(x_15, 0); -lean_dec(x_26); -x_27 = 0; -x_28 = lean_box(x_27); -lean_ctor_set(x_15, 0, x_28); -return x_15; -} -else -{ -lean_object* x_29; uint8_t x_30; lean_object* x_31; lean_object* x_32; -x_29 = lean_ctor_get(x_15, 1); -lean_inc(x_29); -lean_dec(x_15); -x_30 = 0; -x_31 = lean_box(x_30); -x_32 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_32, 0, x_31); -lean_ctor_set(x_32, 1, x_29); +lean_object* x_30; lean_object* x_31; lean_object* x_32; +x_30 = lean_ctor_get(x_28, 0); +x_31 = lean_ctor_get(x_28, 1); +lean_inc(x_31); +lean_inc(x_30); +lean_dec(x_28); +x_32 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_32, 0, x_30); +lean_ctor_set(x_32, 1, x_31); return x_32; } } -} else { uint8_t x_33; @@ -3504,23 +3520,61 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); x_33 = !lean_is_exclusive(x_15); if (x_33 == 0) { +lean_object* x_34; uint8_t x_35; lean_object* x_36; +x_34 = lean_ctor_get(x_15, 0); +lean_dec(x_34); +x_35 = 0; +x_36 = lean_box(x_35); +lean_ctor_set(x_15, 0, x_36); +return x_15; +} +else +{ +lean_object* x_37; uint8_t x_38; lean_object* x_39; lean_object* x_40; +x_37 = lean_ctor_get(x_15, 1); +lean_inc(x_37); +lean_dec(x_15); +x_38 = 0; +x_39 = lean_box(x_38); +x_40 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_40, 0, x_39); +lean_ctor_set(x_40, 1, x_37); +return x_40; +} +} +} +else +{ +uint8_t x_41; +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_41 = !lean_is_exclusive(x_15); +if (x_41 == 0) +{ return x_15; } else { -lean_object* x_34; lean_object* x_35; lean_object* x_36; -x_34 = lean_ctor_get(x_15, 0); -x_35 = lean_ctor_get(x_15, 1); -lean_inc(x_35); -lean_inc(x_34); +lean_object* x_42; lean_object* x_43; lean_object* x_44; +x_42 = lean_ctor_get(x_15, 0); +x_43 = lean_ctor_get(x_15, 1); +lean_inc(x_43); +lean_inc(x_42); lean_dec(x_15); -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; +x_44 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_44, 0, x_42); +lean_ctor_set(x_44, 1, x_43); +return x_44; } } } @@ -6688,6 +6742,12 @@ l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUs lean_mark_persistent(l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__2); l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__3 = _init_l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__3(); lean_mark_persistent(l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__3); +l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__4 = _init_l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__4(); +lean_mark_persistent(l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__4); +l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__5 = _init_l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__5(); +lean_mark_persistent(l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__5); +l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__6 = _init_l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__6(); +lean_mark_persistent(l_List_filterAuxM___main___at___private_Lean_Elab_SyntheticMVars_8__synthesizeUsingDefault___spec__1___lambda__1___closed__6); l_List_forM___main___at___private_Lean_Elab_SyntheticMVars_9__reportStuckSyntheticMVars___spec__1___lambda__1___closed__1 = _init_l_List_forM___main___at___private_Lean_Elab_SyntheticMVars_9__reportStuckSyntheticMVars___spec__1___lambda__1___closed__1(); lean_mark_persistent(l_List_forM___main___at___private_Lean_Elab_SyntheticMVars_9__reportStuckSyntheticMVars___spec__1___lambda__1___closed__1); l_List_forM___main___at___private_Lean_Elab_SyntheticMVars_9__reportStuckSyntheticMVars___spec__1___lambda__1___closed__2 = _init_l_List_forM___main___at___private_Lean_Elab_SyntheticMVars_9__reportStuckSyntheticMVars___spec__1___lambda__1___closed__2(); diff --git a/stage0/stdlib/Lean/Elab/Term.c b/stage0/stdlib/Lean/Elab/Term.c index 3f7f122f88..0ba5ea1adb 100644 --- a/stage0/stdlib/Lean/Elab/Term.c +++ b/stage0/stdlib/Lean/Elab/Term.c @@ -22,6 +22,8 @@ lean_object* l_Lean_getConstInfo___at_Lean_Elab_Term_mkConst___spec__1(lean_obje lean_object* l___regBuiltin_Lean_Elab_Term_elabByTactic___closed__3; lean_object* l___private_Lean_Elab_Term_27__mkFreshLevelMVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___regBuiltin_Lean_Elab_Term_elabStrLit___closed__1; +lean_object* l_Lean_Elab_Term_elabTypeOf___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__2; lean_object* l_Lean_Elab_Term_synthesizeInstMVarCore___closed__1; lean_object* l_Lean_mkAppStx(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_monadQuotation; @@ -122,6 +124,7 @@ lean_object* l___regBuiltin_Lean_Elab_Term_elabQuotedName___closed__1; extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* l_Lean_Elab_Term_expandArrayLit___closed__7; lean_object* l___private_Lean_Elab_Term_23__mkPairsAux___main___closed__1; +lean_object* l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__1; lean_object* l___private_Lean_Elab_Term_11__elabUsingElabFns___closed__1; lean_object* l___private_Lean_Elab_Term_18__elabImplicitLambda___main___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_Elab_Term_MonadLiftT___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -135,6 +138,7 @@ lean_object* l_Lean_Meta_getMVarsAtDeclImp(lean_object*, lean_object*, lean_obje lean_object* l_Lean_Elab_Term_synthesizeInstMVarCore___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Prod_HasRepr___rarg___closed__1; lean_object* l___private_Lean_Elab_Term_9__postponeElabTerm___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___regBuiltin_Lean_Elab_Term_elabTypeOf(lean_object*); lean_object* l_Lean_Elab_Term_elabQuotedName___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withLocalDecl___at___private_Lean_Elab_Term_18__elabImplicitLambda___main___spec__1___rarg___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_MacroScopesView_format(lean_object*, lean_object*); @@ -227,6 +231,7 @@ extern lean_object* l_List_repr___rarg___closed__3; extern lean_object* l_Lean_unitToExpr___lambda__1___closed__3; lean_object* l___regBuiltin_Lean_Elab_Term_elabTypeStx___closed__2; lean_object* l_Lean_Elab_Term_elabSort___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_elabTypeOf(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t l_USize_shiftRight(size_t, size_t); lean_object* l___private_Lean_Elab_Term_7__tryPureCoe_x3f(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_Elab_Term_synthesizeInst(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -370,6 +375,7 @@ lean_object* l_Array_anyRangeMAux___main___at___private_Lean_Elab_Term_14__isLam lean_object* l_Lean_Elab_Term_mkFreshInstanceName(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Name_append___main(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Term_25__resolveLocalNameAux___main(lean_object*, lean_object*, lean_object*); +lean_object* l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__3; lean_object* l_Lean_Elab_Term_synthesizeInstMVarCore___closed__3; lean_object* l_Lean_Elab_Term_withMacroExpansion___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_elabByTactic___closed__2; @@ -415,7 +421,6 @@ uint8_t l_Lean_Elab_Term_blockImplicitLambda(lean_object*); lean_object* l_Lean_Elab_Term_elabTypeStx(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_assignLevelMVar(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_setMCtx___at_Lean_Elab_Term_savingMCtx___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__3; lean_object* l_Lean_Elab_Term_monadLog___closed__6; lean_object* l_Lean_Elab_Term_levelMVarToParam___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Term_1__liftAttrM___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -448,6 +453,7 @@ lean_object* l_Lean_Elab_Term_liftLevelM___rarg(lean_object*, lean_object*, lean lean_object* l_Lean_Syntax_getId(lean_object*); lean_object* l___regBuiltin_Lean_Elab_Term_elabParen___closed__1; lean_object* l_Lean_Elab_Term_Lean_Elab_MonadMacroAdapter; +lean_object* l_Lean_Elab_Term_mkTypeMismatchError(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_throwPostpone___at_Lean_Elab_Term_tryPostpone___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Term_9__postponeElabTerm(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -507,6 +513,7 @@ lean_object* l_Lean_Elab_Term_MVarErrorInfo_logError___closed__5; lean_object* l_Lean_LocalDecl_toExpr(lean_object*); extern lean_object* l_Lean_firstFrontendMacroScope; lean_object* l___private_Lean_Elab_Term_10__elabUsingElabFnsAux___main___closed__1; +lean_object* l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__3; lean_object* l_Lean_Elab_Term_expandArrayLit___closed__8; lean_object* l_Lean_Elab_Term_ensureHasType___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_isType___at_Lean_Elab_Term_ensureType___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -572,7 +579,6 @@ lean_object* l_Lean_Elab_Term_mkConst___closed__3; lean_object* l_Lean_Elab_Term_resolveName___closed__4; extern lean_object* l_Lean_nullKind___closed__2; uint8_t l_Array_anyRangeMAux___main___at___private_Lean_Elab_Term_14__isLambdaWithImplicit___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2; lean_object* l_Lean_Elab_Term_elabCharLit(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Term_MVarErrorInfo_logError___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_expandListLit___boxed(lean_object*, lean_object*, lean_object*); @@ -598,8 +604,10 @@ lean_object* l_Lean_Elab_Term_mkTermElabAttribute___closed__9; lean_object* l_Lean_Meta_whnfForall___at___private_Lean_Elab_Term_16__useImplicitLambda_x3f___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_log___at_Lean_Elab_Term_traceAtCmdPos___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Term_MVarErrorInfo_logError___spec__2___closed__1; +lean_object* l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf(lean_object*); 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*); lean_object* l_Lean_Elab_Term_Lean_Ref___closed__4; +lean_object* l_Lean_Elab_Term_elabEnsureTypeOf___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Option_HasRepr___rarg___closed__3; lean_object* l_Lean_Elab_Term_resetMessageLog(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_traceAtCmdPos___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -681,6 +689,7 @@ lean_object* l_Lean_Elab_Term_registerMVarErrorCustomInfo(lean_object*, lean_obj extern lean_object* l_Std_PersistentHashMap_mkCollisionNode___rarg___closed__1; lean_object* l_Lean_Meta_getMVarsImp(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Name_toExprAux___main(lean_object*); +lean_object* l_Lean_Elab_Term_elabEnsureTypeOf(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___regBuiltin_Lean_Elab_Term_elabBadCDot(lean_object*); lean_object* l_Lean_Elab_Term_elabTerm___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l___private_Lean_Elab_Term_14__isLambdaWithImplicit(lean_object*); @@ -949,6 +958,7 @@ lean_object* l_Lean_Elab_throwAbort___at_Lean_Elab_Term_ensureNoUnassignedMVars_ lean_object* l_Lean_Elab_Term_elabTermWithoutImplicitLambdas___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_mkFreshInstanceName___closed__1; lean_object* l_Lean_mkApp3(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__2; lean_object* l_Lean_Meta_mkFreshExprMVar___at_Lean_Elab_Term_tryCoe___spec__2(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_elabSyntheticHole___closed__7; lean_object* l_Lean_Elab_Term_monadLog___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -971,6 +981,7 @@ lean_object* l_Lean_Elab_Term_resolveGlobalConstNoOverload___closed__5; lean_object* l_Lean_Elab_Term_expandArrayLit___closed__5; uint8_t l_Lean_Syntax_isIdent(lean_object*); extern lean_object* l_Lean_Elab_registerPostponeId___closed__1; +lean_object* l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__1; extern lean_object* l_Lean_KernelException_toMessageData___closed__39; lean_object* l_Lean_Elab_Term_tryCoe___closed__3; lean_object* l_Lean_Elab_Term_setElabConfig(lean_object* x_1) { @@ -8114,6 +8125,44 @@ return x_45; } } } +lean_object* l_Lean_Elab_Term_mkTypeMismatchError(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; +x_5 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_5, 0, x_4); +x_6 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_6, 0, x_5); +x_7 = l_Lean_indentExpr(x_1); +x_8 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_8, 0, x_6); +lean_ctor_set(x_8, 1, x_7); +x_9 = l_Lean_MessageData_ofList___closed__3; +x_10 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_10, 0, x_8); +lean_ctor_set(x_10, 1, x_9); +x_11 = l_Lean_KernelException_toMessageData___closed__12; +x_12 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +x_13 = l_Lean_indentExpr(x_2); +x_14 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_14, 0, x_12); +lean_ctor_set(x_14, 1, x_13); +x_15 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_15, 0, x_14); +lean_ctor_set(x_15, 1, x_9); +x_16 = l_Lean_KernelException_toMessageData___closed__15; +x_17 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_17, 0, x_15); +lean_ctor_set(x_17, 1, x_16); +x_18 = l_Lean_indentExpr(x_3); +x_19 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_19, 0, x_17); +lean_ctor_set(x_19, 1, x_18); +return x_19; +} +} lean_object* l_Lean_Meta_inferType___at_Lean_Elab_Term_throwTypeMismatchError___spec__2(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: { @@ -8534,121 +8583,78 @@ x_1 = lean_mk_string("type mismatch"); return x_1; } } -lean_object* _init_l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2() { -_start: -{ -lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1; -x_2 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_2, 0, x_1); -return x_2; -} -} -lean_object* _init_l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__3() { -_start: -{ -lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2; -x_2 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_2, 0, x_1); -return x_2; -} -} lean_object* l_Lean_Elab_Term_throwTypeMismatchError___rarg(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_object* x_12) { _start: { -lean_object* x_13; if (lean_obj_tag(x_5) == 0) { if (lean_obj_tag(x_4) == 0) { -lean_object* x_31; -x_31 = l_Lean_MessageData_Inhabited___closed__1; -x_13 = x_31; -goto block_30; -} -else -{ -lean_object* x_32; lean_object* x_33; lean_object* x_34; -lean_dec(x_2); -lean_dec(x_1); -x_32 = lean_ctor_get(x_4, 0); -lean_inc(x_32); -lean_dec(x_4); -x_33 = l_Lean_MessageData_Inhabited___closed__1; -x_34 = l_Lean_Meta_throwAppTypeMismatch___at_Lean_Elab_Term_throwTypeMismatchError___spec__1___rarg(x_32, x_3, x_33, x_6, x_7, x_8, x_9, x_10, x_11, x_12); -return x_34; -} -} -else -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; -x_35 = lean_ctor_get(x_5, 0); -x_36 = l_Lean_MessageData_ofList___closed__3; -lean_inc(x_35); -x_37 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_37, 0, x_36); -lean_ctor_set(x_37, 1, x_35); -if (lean_obj_tag(x_4) == 0) -{ -x_13 = x_37; -goto block_30; -} -else -{ -lean_object* x_38; lean_object* x_39; -lean_dec(x_2); -lean_dec(x_1); -x_38 = lean_ctor_get(x_4, 0); -lean_inc(x_38); -lean_dec(x_4); -x_39 = l_Lean_Meta_throwAppTypeMismatch___at_Lean_Elab_Term_throwTypeMismatchError___spec__3___rarg(x_38, x_3, x_37, x_6, x_7, x_8, x_9, x_10, x_11, x_12); -return x_39; -} -} -block_30: -{ -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; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; -x_14 = l_Lean_indentExpr(x_3); -x_15 = l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__3; +lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; +x_13 = l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1; +x_14 = l_Lean_Elab_Term_mkTypeMismatchError(x_3, x_2, x_1, x_13); +x_15 = l_Lean_MessageData_Inhabited___closed__1; x_16 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_16, 0, x_15); -lean_ctor_set(x_16, 1, x_14); -x_17 = l_Lean_MessageData_ofList___closed__3; -x_18 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_18, 0, x_16); -lean_ctor_set(x_18, 1, x_17); -x_19 = l_Lean_KernelException_toMessageData___closed__12; -x_20 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_20, 0, x_18); -lean_ctor_set(x_20, 1, x_19); -x_21 = l_Lean_indentExpr(x_2); -x_22 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_22, 0, x_20); -lean_ctor_set(x_22, 1, x_21); -x_23 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_23, 0, x_22); -lean_ctor_set(x_23, 1, x_17); -x_24 = l_Lean_KernelException_toMessageData___closed__15; -x_25 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_25, 0, x_23); -lean_ctor_set(x_25, 1, x_24); -x_26 = l_Lean_indentExpr(x_1); -x_27 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_27, 0, x_25); -lean_ctor_set(x_27, 1, x_26); -x_28 = lean_alloc_ctor(10, 2, 0); -lean_ctor_set(x_28, 0, x_27); -lean_ctor_set(x_28, 1, x_13); -x_29 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1___rarg(x_28, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +lean_ctor_set(x_16, 0, x_14); +lean_ctor_set(x_16, 1, x_15); +x_17 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1___rarg(x_16, x_6, x_7, x_8, x_9, x_10, x_11, x_12); lean_dec(x_11); lean_dec(x_10); lean_dec(x_9); lean_dec(x_8); +return x_17; +} +else +{ +lean_object* x_18; lean_object* x_19; lean_object* x_20; +lean_dec(x_2); +lean_dec(x_1); +x_18 = lean_ctor_get(x_4, 0); +lean_inc(x_18); +lean_dec(x_4); +x_19 = l_Lean_MessageData_Inhabited___closed__1; +x_20 = l_Lean_Meta_throwAppTypeMismatch___at_Lean_Elab_Term_throwTypeMismatchError___spec__1___rarg(x_18, x_3, x_19, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +return x_20; +} +} +else +{ +lean_object* x_21; lean_object* x_22; lean_object* x_23; +x_21 = lean_ctor_get(x_5, 0); +x_22 = l_Lean_MessageData_ofList___closed__3; +lean_inc(x_21); +x_23 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_23, 0, x_22); +lean_ctor_set(x_23, 1, x_21); +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_24 = l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1; +x_25 = l_Lean_Elab_Term_mkTypeMismatchError(x_3, x_2, x_1, x_24); +x_26 = lean_alloc_ctor(10, 2, 0); +lean_ctor_set(x_26, 0, x_25); +lean_ctor_set(x_26, 1, x_23); +x_27 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1___rarg(x_26, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +return x_27; +} +else +{ +lean_object* x_28; lean_object* x_29; +lean_dec(x_2); +lean_dec(x_1); +x_28 = lean_ctor_get(x_4, 0); +lean_inc(x_28); +lean_dec(x_4); +x_29 = l_Lean_Meta_throwAppTypeMismatch___at_Lean_Elab_Term_throwTypeMismatchError___spec__3___rarg(x_28, x_3, x_23, x_6, x_7, x_8, x_9, x_10, x_11, x_12); return x_29; } } } +} lean_object* l_Lean_Elab_Term_throwTypeMismatchError(lean_object* x_1) { _start: { @@ -28873,6 +28879,486 @@ x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); return x_5; } } +lean_object* l_Lean_Elab_Term_elabTypeOf(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: +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; uint8_t x_13; lean_object* x_14; +x_10 = lean_unsigned_to_nat(1u); +x_11 = l_Lean_Syntax_getArg(x_1, x_10); +x_12 = lean_box(0); +x_13 = 1; +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_14 = l_Lean_Elab_Term_elabTerm(x_11, x_12, x_13, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +if (lean_obj_tag(x_14) == 0) +{ +lean_object* x_15; lean_object* x_16; lean_object* x_17; +x_15 = lean_ctor_get(x_14, 0); +lean_inc(x_15); +x_16 = lean_ctor_get(x_14, 1); +lean_inc(x_16); +lean_dec(x_14); +x_17 = l_Lean_Meta_inferType___at_Lean_Elab_Term_throwTypeMismatchError___spec__2(x_15, x_3, x_4, x_5, x_6, x_7, x_8, x_16); +lean_dec(x_4); +lean_dec(x_3); +return x_17; +} +else +{ +uint8_t x_18; +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +x_18 = !lean_is_exclusive(x_14); +if (x_18 == 0) +{ +return x_14; +} +else +{ +lean_object* x_19; lean_object* x_20; lean_object* x_21; +x_19 = lean_ctor_get(x_14, 0); +x_20 = lean_ctor_get(x_14, 1); +lean_inc(x_20); +lean_inc(x_19); +lean_dec(x_14); +x_21 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_21, 0, x_19); +lean_ctor_set(x_21, 1, x_20); +return x_21; +} +} +} +} +lean_object* l_Lean_Elab_Term_elabTypeOf___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: +{ +lean_object* x_10; +x_10 = l_Lean_Elab_Term_elabTypeOf(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +lean_dec(x_2); +lean_dec(x_1); +return x_10; +} +} +lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("typeOf"); +return x_1; +} +} +lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_mkAppStx___closed__6; +x_2 = l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__3() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabTypeOf___boxed), 9, 0); +return x_1; +} +} +lean_object* l___regBuiltin_Lean_Elab_Term_elabTypeOf(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_2 = l_Lean_Elab_Term_termElabAttribute; +x_3 = l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__2; +x_4 = l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__3; +x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); +return x_5; +} +} +lean_object* l_Lean_Elab_Term_elabEnsureTypeOf(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: +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_unsigned_to_nat(2u); +x_11 = l_Lean_Syntax_getArg(x_1, x_10); +x_12 = l_Lean_Syntax_isStrLit_x3f(x_11); +lean_dec(x_11); +if (lean_obj_tag(x_12) == 0) +{ +lean_object* x_13; +lean_dec(x_2); +x_13 = l_Lean_Elab_throwIllFormedSyntax___at_Lean_Elab_Term_elabStrLit___spec__1(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); +return x_13; +} +else +{ +lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18; lean_object* x_19; +x_14 = lean_ctor_get(x_12, 0); +lean_inc(x_14); +lean_dec(x_12); +x_15 = lean_unsigned_to_nat(1u); +x_16 = l_Lean_Syntax_getArg(x_1, x_15); +x_17 = lean_box(0); +x_18 = 1; +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_19 = l_Lean_Elab_Term_elabTerm(x_16, x_17, x_18, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +if (lean_obj_tag(x_19) == 0) +{ +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_19, 0); +lean_inc(x_20); +x_21 = lean_ctor_get(x_19, 1); +lean_inc(x_21); +lean_dec(x_19); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +x_22 = l_Lean_Meta_inferType___at_Lean_Elab_Term_throwTypeMismatchError___spec__2(x_20, x_3, x_4, x_5, x_6, x_7, x_8, x_21); +if (lean_obj_tag(x_22) == 0) +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_23 = lean_ctor_get(x_22, 0); +lean_inc(x_23); +x_24 = lean_ctor_get(x_22, 1); +lean_inc(x_24); +lean_dec(x_22); +x_25 = lean_unsigned_to_nat(3u); +x_26 = l_Lean_Syntax_getArg(x_1, x_25); +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_27 = l_Lean_Elab_Term_elabTerm(x_26, x_2, x_18, x_3, x_4, x_5, x_6, x_7, x_8, x_24); +if (lean_obj_tag(x_27) == 0) +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_27, 0); +lean_inc(x_28); +x_29 = lean_ctor_get(x_27, 1); +lean_inc(x_29); +lean_dec(x_27); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_28); +x_30 = l_Lean_Meta_inferType___at_Lean_Elab_Term_throwTypeMismatchError___spec__2(x_28, x_3, x_4, x_5, x_6, x_7, x_8, x_29); +if (lean_obj_tag(x_30) == 0) +{ +lean_object* x_31; lean_object* x_32; lean_object* x_33; +x_31 = lean_ctor_get(x_30, 0); +lean_inc(x_31); +x_32 = lean_ctor_get(x_30, 1); +lean_inc(x_32); +lean_dec(x_30); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_23); +lean_inc(x_31); +x_33 = l_Lean_Meta_isExprDefEq___at_Lean_Elab_Term_synthesizeInstMVarCore___spec__3(x_31, x_23, x_3, x_4, x_5, x_6, x_7, x_8, x_32); +if (lean_obj_tag(x_33) == 0) +{ +lean_object* x_34; uint8_t x_35; +x_34 = lean_ctor_get(x_33, 0); +lean_inc(x_34); +x_35 = lean_unbox(x_34); +lean_dec(x_34); +if (x_35 == 0) +{ +lean_object* x_36; lean_object* x_37; lean_object* x_38; uint8_t x_39; +x_36 = lean_ctor_get(x_33, 1); +lean_inc(x_36); +lean_dec(x_33); +x_37 = l_Lean_Elab_Term_mkTypeMismatchError(x_28, x_31, x_23, x_14); +x_38 = l_Lean_throwError___at_Lean_Elab_Term_throwErrorIfErrors___spec__1___rarg(x_37, x_3, x_4, x_5, x_6, x_7, x_8, x_36); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +x_39 = !lean_is_exclusive(x_38); +if (x_39 == 0) +{ +return x_38; +} +else +{ +lean_object* x_40; lean_object* x_41; lean_object* x_42; +x_40 = lean_ctor_get(x_38, 0); +x_41 = lean_ctor_get(x_38, 1); +lean_inc(x_41); +lean_inc(x_40); +lean_dec(x_38); +x_42 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_42, 0, x_40); +lean_ctor_set(x_42, 1, x_41); +return x_42; +} +} +else +{ +uint8_t x_43; +lean_dec(x_31); +lean_dec(x_23); +lean_dec(x_14); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +x_43 = !lean_is_exclusive(x_33); +if (x_43 == 0) +{ +lean_object* x_44; +x_44 = lean_ctor_get(x_33, 0); +lean_dec(x_44); +lean_ctor_set(x_33, 0, x_28); +return x_33; +} +else +{ +lean_object* x_45; lean_object* x_46; +x_45 = lean_ctor_get(x_33, 1); +lean_inc(x_45); +lean_dec(x_33); +x_46 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_46, 0, x_28); +lean_ctor_set(x_46, 1, x_45); +return x_46; +} +} +} +else +{ +uint8_t x_47; +lean_dec(x_31); +lean_dec(x_28); +lean_dec(x_23); +lean_dec(x_14); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +x_47 = !lean_is_exclusive(x_33); +if (x_47 == 0) +{ +return x_33; +} +else +{ +lean_object* x_48; lean_object* x_49; lean_object* x_50; +x_48 = lean_ctor_get(x_33, 0); +x_49 = lean_ctor_get(x_33, 1); +lean_inc(x_49); +lean_inc(x_48); +lean_dec(x_33); +x_50 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_50, 0, x_48); +lean_ctor_set(x_50, 1, x_49); +return x_50; +} +} +} +else +{ +uint8_t x_51; +lean_dec(x_28); +lean_dec(x_23); +lean_dec(x_14); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +x_51 = !lean_is_exclusive(x_30); +if (x_51 == 0) +{ +return x_30; +} +else +{ +lean_object* x_52; lean_object* x_53; lean_object* x_54; +x_52 = lean_ctor_get(x_30, 0); +x_53 = lean_ctor_get(x_30, 1); +lean_inc(x_53); +lean_inc(x_52); +lean_dec(x_30); +x_54 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_54, 0, x_52); +lean_ctor_set(x_54, 1, x_53); +return x_54; +} +} +} +else +{ +uint8_t x_55; +lean_dec(x_23); +lean_dec(x_14); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +x_55 = !lean_is_exclusive(x_27); +if (x_55 == 0) +{ +return x_27; +} +else +{ +lean_object* x_56; lean_object* x_57; lean_object* x_58; +x_56 = lean_ctor_get(x_27, 0); +x_57 = lean_ctor_get(x_27, 1); +lean_inc(x_57); +lean_inc(x_56); +lean_dec(x_27); +x_58 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_58, 0, x_56); +lean_ctor_set(x_58, 1, x_57); +return x_58; +} +} +} +else +{ +uint8_t x_59; +lean_dec(x_14); +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_2); +x_59 = !lean_is_exclusive(x_22); +if (x_59 == 0) +{ +return x_22; +} +else +{ +lean_object* x_60; lean_object* x_61; lean_object* x_62; +x_60 = lean_ctor_get(x_22, 0); +x_61 = lean_ctor_get(x_22, 1); +lean_inc(x_61); +lean_inc(x_60); +lean_dec(x_22); +x_62 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_62, 0, x_60); +lean_ctor_set(x_62, 1, x_61); +return x_62; +} +} +} +else +{ +uint8_t x_63; +lean_dec(x_14); +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_2); +x_63 = !lean_is_exclusive(x_19); +if (x_63 == 0) +{ +return x_19; +} +else +{ +lean_object* x_64; lean_object* x_65; lean_object* x_66; +x_64 = lean_ctor_get(x_19, 0); +x_65 = lean_ctor_get(x_19, 1); +lean_inc(x_65); +lean_inc(x_64); +lean_dec(x_19); +x_66 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_66, 0, x_64); +lean_ctor_set(x_66, 1, x_65); +return x_66; +} +} +} +} +} +lean_object* l_Lean_Elab_Term_elabEnsureTypeOf___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: +{ +lean_object* x_10; +x_10 = l_Lean_Elab_Term_elabEnsureTypeOf(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +lean_dec(x_1); +return x_10; +} +} +lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("ensureTypeOf"); +return x_1; +} +} +lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_mkAppStx___closed__6; +x_2 = l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__3() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabEnsureTypeOf___boxed), 9, 0); +return x_1; +} +} +lean_object* l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_2 = l_Lean_Elab_Term_termElabAttribute; +x_3 = l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__2; +x_4 = l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__3; +x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); +return x_5; +} +} lean_object* _init_l___private_Lean_Elab_Term_29__mkSomeContext___closed__1() { _start: { @@ -30730,10 +31216,6 @@ l___private_Lean_Elab_Term_4__expandCDot___main___closed__3 = _init_l___private_ lean_mark_persistent(l___private_Lean_Elab_Term_4__expandCDot___main___closed__3); l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1 = _init_l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1(); lean_mark_persistent(l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__1); -l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2 = _init_l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2(); -lean_mark_persistent(l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__2); -l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__3 = _init_l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__3(); -lean_mark_persistent(l_Lean_Elab_Term_throwTypeMismatchError___rarg___closed__3); l_Lean_Elab_Term_synthesizeInstMVarCore___closed__1 = _init_l_Lean_Elab_Term_synthesizeInstMVarCore___closed__1(); lean_mark_persistent(l_Lean_Elab_Term_synthesizeInstMVarCore___closed__1); l_Lean_Elab_Term_synthesizeInstMVarCore___closed__2 = _init_l_Lean_Elab_Term_synthesizeInstMVarCore___closed__2(); @@ -31068,6 +31550,24 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabQuotedName___closed__3); res = l___regBuiltin_Lean_Elab_Term_elabQuotedName(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__1(); +lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__1); +l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__2 = _init_l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__2(); +lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__2); +l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__3 = _init_l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__3(); +lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabTypeOf___closed__3); +res = l___regBuiltin_Lean_Elab_Term_elabTypeOf(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__1 = _init_l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__1(); +lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__1); +l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__2 = _init_l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__2(); +lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__2); +l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__3 = _init_l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__3(); +lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf___closed__3); +res = l___regBuiltin_Lean_Elab_Term_elabEnsureTypeOf(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); l___private_Lean_Elab_Term_29__mkSomeContext___closed__1 = _init_l___private_Lean_Elab_Term_29__mkSomeContext___closed__1(); lean_mark_persistent(l___private_Lean_Elab_Term_29__mkSomeContext___closed__1); l___private_Lean_Elab_Term_29__mkSomeContext___closed__2 = _init_l___private_Lean_Elab_Term_29__mkSomeContext___closed__2(); diff --git a/stage0/stdlib/Lean/Parser/Do.c b/stage0/stdlib/Lean/Parser/Do.c index d23c20a776..15794bf9e2 100644 --- a/stage0/stdlib/Lean/Parser/Do.c +++ b/stage0/stdlib/Lean/Parser/Do.c @@ -13,6 +13,7 @@ #ifdef __cplusplus extern "C" { #endif +lean_object* l_Lean_Parser_Term_doReassign___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_do___closed__4; extern lean_object* l_Lean_Parser_Term_match___elambda__1___closed__6; lean_object* l_Lean_PrettyPrinter_Parenthesizer_visitToken___rarg(lean_object*, lean_object*, lean_object*, lean_object*); @@ -23,6 +24,7 @@ lean_object* l_Lean_Parser_Term_liftMethod_parenthesizer(lean_object*, lean_obje lean_object* l_Lean_Parser_Term_doSeqBracketed_formatter___closed__2; lean_object* l_Lean_Parser_Term_doIf_parenthesizer___closed__9; lean_object* l_Lean_Parser_Term_doCatch___closed__1; +extern lean_object* l_Lean_Parser_Term_letIdDecl; lean_object* l_Lean_Parser_many1Indent_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_binderType_parenthesizer___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doDbgTrace_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -31,6 +33,7 @@ lean_object* l_Lean_Parser_Term_doPat_formatter(lean_object*, lean_object*, lean lean_object* l_Lean_Parser_doElemParser(lean_object*); lean_object* l_Lean_Parser_Term_doUnless_formatter___closed__2; lean_object* l_Lean_Parser_Term_doSeqBracketed___closed__1; +extern lean_object* l_Lean_Parser_Term_letDecl_formatter___closed__6; lean_object* l_Lean_Parser_Term_doMatch_parenthesizer___closed__5; lean_object* l_Lean_Parser_Term_doSeqBracketed___closed__2; extern lean_object* l_Lean_Parser_manyAux___main___closed__1; @@ -49,6 +52,7 @@ lean_object* l___regBuiltin_Lean_Parser_Term_do_parenthesizer(lean_object*); lean_object* l_Lean_Parser_manyAux___main___at_Lean_Parser_Term_doIf___elambda__1___spec__1___closed__6; lean_object* l_Lean_Parser_Term_continue_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doId_parenthesizer___closed__3; +extern lean_object* l_Lean_Parser_Term_letDecl_parenthesizer___closed__2; lean_object* l_Lean_Parser_Term_doPat___closed__3; extern lean_object* l_Lean_Parser_Term_matchAlt___closed__3; extern lean_object* l_Lean_Parser_Term_matchAlts_formatter___closed__10; @@ -68,6 +72,7 @@ lean_object* l_Lean_Parser_Term_doUnless___closed__6; lean_object* l_Lean_Parser_Term_doIf_formatter___closed__20; extern lean_object* l_Lean_nullKind; lean_object* l_Lean_Parser_Term_doMatch_formatter___closed__6; +lean_object* l_Lean_Parser_Term_doReassign___elambda__1___closed__1; lean_object* l_Lean_Parser_Term_continue_formatter___closed__1; lean_object* l___regBuiltinParser_Lean_Parser_Term_doHave(lean_object*); extern lean_object* l_Lean_Parser_Term_letrec___elambda__1___closed__6; @@ -79,7 +84,9 @@ lean_object* l_Lean_Parser_Term_doTry___closed__4; lean_object* l_Lean_Parser_Term_doLetArrow___closed__1; lean_object* l_Lean_Parser_Term_doSeqBracketed___closed__4; lean_object* l_Lean_Parser_Term_doDbgTrace_formatter___closed__2; +extern lean_object* l_Lean_Parser_Term_letDecl_parenthesizer___closed__5; lean_object* l_Lean_Parser_Term_doHave_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_doReassign___elambda__1(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doFor___elambda__1___closed__8; lean_object* l_Lean_Parser_Term_doExpr___elambda__1___closed__11; lean_object* l_Lean_PrettyPrinter_Formatter_many_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -128,6 +135,7 @@ extern lean_object* l_Lean_Parser_Term_match___elambda__1___closed__1; lean_object* l_Lean_Parser_Term_doDbgTrace___closed__4; lean_object* l_Lean_Parser_Term_doCatchMatch_formatter___closed__1; lean_object* l_Lean_Parser_Term_break___closed__6; +extern lean_object* l_Lean_Parser_Term_letPatDecl; lean_object* l___regBuiltin_Lean_Parser_Term_doLetArrow_parenthesizer(lean_object*); lean_object* l_Lean_Parser_Term_doFinally___closed__5; extern lean_object* l_Lean_Parser_Term_binderTactic_parenthesizer___closed__2; @@ -137,6 +145,7 @@ lean_object* l_Lean_Parser_Term_doMatchAlts___elambda__1___closed__7; lean_object* l_Lean_Parser_Term_doIf_parenthesizer___closed__4; lean_object* l_Lean_Parser_Term_doAssert___elambda__1(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doCatch___closed__6; +lean_object* l_Lean_Parser_Term_doReassignArrow; lean_object* l_Lean_Parser_Term_continue___elambda__1___closed__5; lean_object* l_Lean_Parser_Term_doSeqBracketed___closed__8; lean_object* l_Lean_Parser_Term_doUnless_parenthesizer___closed__3; @@ -170,6 +179,7 @@ lean_object* l_Lean_Parser_Term_doFor___closed__1; extern lean_object* l_Lean_Parser_darrow; lean_object* l_Lean_Parser_Term_return_parenthesizer___closed__1; lean_object* l_Lean_Parser_Term_doCatch___elambda__1___closed__2; +lean_object* l_Lean_Parser_Term_doReassign___closed__4; lean_object* l_Lean_Parser_Term_doPat___closed__2; lean_object* l_Lean_Parser_Term_doMatchAlts___closed__4; extern lean_object* l_Lean_Parser_manyAux___main___at_Lean_Parser_Tactic_tacticSeq1Indented___elambda__1___spec__1___closed__1; @@ -201,9 +211,11 @@ lean_object* l_Lean_Parser_Term_doExpr___closed__6; lean_object* l_Lean_Parser_Term_doSeqBracketed_formatter___closed__1; lean_object* l_Lean_Parser_Term_doDbgTrace___elambda__1(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doFor___closed__8; +lean_object* l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter(lean_object*); lean_object* l_Lean_Parser_Term_doTry___elambda__1___closed__2; lean_object* l___regBuiltin_Lean_Parser_Term_doFor_parenthesizer___closed__1; lean_object* l_Lean_Parser_regDoElemParserAttribute___closed__1; +lean_object* l_Lean_Parser_Term_doReassignArrow_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___regBuiltin_Lean_Parser_Term_doLetRec_formatter___closed__1; extern lean_object* l___private_Lean_Parser_Basic_2__sepByFnAux___main___at_Lean_Parser_Term_matchAlts___spec__2___closed__2; lean_object* l_Lean_Parser_Term_return_parenthesizer___closed__2; @@ -217,6 +229,7 @@ extern lean_object* l_Lean_Parser_Term_subtype_formatter___closed__6; lean_object* l_Lean_Parser_Term_leftArrow_parenthesizer___boxed(lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doIf___closed__13; +lean_object* l_Lean_Parser_Term_doReassign___closed__1; lean_object* l_Lean_Parser_Term_break___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_return_formatter___closed__3; extern lean_object* l_Lean_Parser_Term_structInst___elambda__1___closed__18; @@ -242,6 +255,7 @@ lean_object* l_Lean_Parser_Term_doTry_parenthesizer___closed__5; lean_object* l_Lean_Parser_Term_doMatchAlts_parenthesizer___closed__3; lean_object* l_Lean_Parser_Term_liftMethod___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_return; +lean_object* l_Lean_Parser_Term_doReassign___closed__2; lean_object* l_Lean_Parser_Term_doCatch_parenthesizer___closed__8; lean_object* l_Lean_Parser_Term_doId_parenthesizer___closed__5; lean_object* l_Lean_Parser_Term_break___closed__3; @@ -263,6 +277,7 @@ lean_object* l_Lean_Parser_Term_doFor_formatter___closed__2; lean_object* l_Lean_Parser_Term_doFor___elambda__1___closed__14; lean_object* l_Lean_Parser_Term_doCatch___closed__2; lean_object* l_Lean_Parser_Term_doAssert___closed__4; +lean_object* l_Lean_Parser_Term_doReassign; lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doTry_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_do___elambda__1___closed__2; @@ -291,7 +306,9 @@ lean_object* l_Lean_Parser_Term_liftMethod___closed__5; lean_object* l_Lean_Parser_Term_doIf; lean_object* l_Lean_Parser_checkPrecFn(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_return_formatter___closed__2; +lean_object* l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter___closed__1; lean_object* l_Lean_Parser_Term_doIf_parenthesizer___closed__12; +lean_object* l_Lean_Parser_Term_doReassign___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_doIf___closed__4; lean_object* l_Lean_Parser_Term_doLetArrow_parenthesizer___closed__4; lean_object* l_Lean_Parser_Term_doUnless___elambda__1___closed__2; @@ -309,6 +326,7 @@ lean_object* l_Lean_Parser_Term_doIf___closed__5; lean_object* l___regBuiltin_Lean_Parser_Term_doLetRec_parenthesizer(lean_object*); lean_object* l_Lean_Parser_Term_return_formatter___closed__1; extern lean_object* l_Lean_Parser_Term_assert___closed__2; +lean_object* l_Lean_Parser_Term_doReassignArrow___elambda__1(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Tactic_tacticSeqBracketed___elambda__1___closed__6; lean_object* l_Lean_Parser_Term_doIf___closed__9; lean_object* l_Lean_Parser_Term_doIf_parenthesizer___closed__14; @@ -316,6 +334,8 @@ lean_object* l_Lean_Parser_Term_doLetArrow_parenthesizer___closed__1; lean_object* l_Lean_Parser_Term_doLet_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doUnless___closed__9; lean_object* l_Lean_Parser_Term_continue___elambda__1___closed__2; +lean_object* l_Lean_Parser_Term_doReassignArrow_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___regBuiltin_Lean_Parser_Term_doReassign_formatter(lean_object*); lean_object* l_Lean_Parser_Term_doUnless___elambda__1___closed__1; lean_object* l___regBuiltin_Lean_Parser_Term_doLet_formatter(lean_object*); extern lean_object* l_Lean___kind_term____x40_Lean_Util_Trace___hyg_3____closed__15; @@ -329,10 +349,12 @@ extern lean_object* l_Lean_PrettyPrinter_parenthesizerAttribute; lean_object* l_Lean_Parser_Term_liftMethod_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doLetRec___elambda__1(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Term_let___closed__2; +lean_object* l_Lean_Parser_Term_doReassign___closed__5; lean_object* l_Lean_Parser_Term_leftArrow_parenthesizer___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doLetRec___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_doSeq_formatter___closed__1; lean_object* l_Lean_Parser_Term_break___elambda__1(lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_doReassign_parenthesizer___closed__2; lean_object* l_Lean_Parser_Term_doMatchAlts_parenthesizer___closed__5; lean_object* l_Lean_Parser_Term_doId_formatter___closed__4; lean_object* l_Lean_Parser_Term_doIf___closed__8; @@ -364,6 +386,7 @@ lean_object* l___regBuiltin_Lean_Parser_Term_doTry_formatter(lean_object*); lean_object* l_Lean_Parser_Term_doFor___closed__4; extern lean_object* l_Lean_Parser_Term_structInst_parenthesizer___closed__6; lean_object* l_Lean_Parser_regBuiltinDoElemParserAttr___closed__3; +lean_object* l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer(lean_object*); lean_object* l_Lean_Parser_Term_doMatch___elambda__1___closed__4; lean_object* l_Lean_Parser_nodeInfo(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_continue_parenthesizer___closed__1; @@ -420,6 +443,7 @@ lean_object* l_Lean_Parser_Term_doFor___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_doMatchAlts_formatter___closed__6; lean_object* l_Lean_Parser_Term_doExpr_formatter___closed__3; lean_object* l_Lean_Parser_Term_doHave_parenthesizer___closed__1; +lean_object* l_Lean_Parser_Term_letIdDecl___elambda__1(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_return___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_doMatch_parenthesizer___closed__4; lean_object* l_Lean_Parser_Term_doAssert_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -438,6 +462,7 @@ lean_object* l_Lean_Parser_Term_doMatch___closed__3; extern lean_object* l_Lean_Parser_Term_if___elambda__1___closed__6; lean_object* l_Lean_Parser_Term_doHave_formatter___closed__1; lean_object* l_Lean_Parser_Term_doId___elambda__1___closed__2; +lean_object* l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__1; lean_object* l_Lean_Parser_Term_doSeqIndent___closed__4; lean_object* l_Lean_Parser_Term_doLetArrow___closed__6; lean_object* l_Lean_Parser_Term_doTry_parenthesizer___closed__9; @@ -470,10 +495,12 @@ lean_object* l_Lean_Parser_Term_doUnless___elambda__1___closed__8; lean_object* l___regBuiltin_Lean_Parser_Term_break_formatter(lean_object*); lean_object* l_Lean_Parser_doElemParser_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Char_HasRepr___closed__1; +lean_object* l_Lean_Parser_Term_doReassign___closed__3; lean_object* l_Lean_Parser_Term_doSeqIndent___closed__5; lean_object* l_Lean_Parser_Term_doExpr___elambda__1___closed__24; lean_object* l_Lean_Parser_Term_doFor_formatter___closed__5; lean_object* l___regBuiltin_Lean_Parser_Term_doFor_formatter(lean_object*); +lean_object* l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2; lean_object* l_Lean_Parser_Term_doCatch___elambda__1___closed__7; lean_object* l_Lean_Parser_Term_continue___elambda__1___closed__1; lean_object* l_Lean_Parser_sepBy1Fn___at_Lean_Parser_Term_tupleTail___elambda__1___spec__1(uint8_t, lean_object*, lean_object*); @@ -547,6 +574,7 @@ lean_object* l_Lean_Parser_Term_leftArrow___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_doCatchMatch___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_doExpr_formatter___closed__8; lean_object* l_Lean_Parser_Term_do; +lean_object* l_Lean_Parser_Term_doReassign_formatter___closed__2; lean_object* l_Lean_Parser_Term_doLetRec___closed__5; lean_object* l_Lean_Parser_Term_doMatchAlts___closed__5; lean_object* l_Lean_Parser_registerBuiltinParserAttribute(lean_object*, lean_object*, uint8_t, lean_object*); @@ -577,6 +605,7 @@ extern lean_object* l_Lean_Parser_Tactic_tacticSeqBracketed_formatter___closed__ lean_object* l_Lean_Parser_Term_doLetArrow_formatter___closed__6; lean_object* l_Lean_Parser_Term_doUnless___closed__3; lean_object* l_Lean_Parser_Term_doSeq_parenthesizer___closed__1; +lean_object* l_Lean_Parser_Term_doReassign_formatter___closed__1; lean_object* l_Lean_Parser_Term_doId_formatter___closed__5; lean_object* l_Lean_Parser_Term_doLetArrow_parenthesizer___closed__6; lean_object* l_Lean_Parser_Term_doAssert___elambda__1___closed__4; @@ -632,7 +661,9 @@ lean_object* l_Lean_Parser_Term_doLetRec_formatter(lean_object*, lean_object*, l lean_object* l_Lean_Parser_Term_doUnless_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doAssert___elambda__1___closed__2; lean_object* l_Lean_PrettyPrinter_Formatter_withPosition_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_doReassign_parenthesizer___closed__3; lean_object* l_Lean_Parser_Term_optType___elambda__1(lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_doReassign_formatter___closed__3; lean_object* l___regBuiltin_Lean_Parser_Term_doExpr_formatter(lean_object*); lean_object* l_Lean_Parser_Term_liftMethod___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_doHave___closed__2; @@ -694,6 +725,8 @@ lean_object* l_Lean_Parser_Term_doAssert___closed__5; lean_object* l_Lean_Parser_Term_doPat_formatter___closed__9; extern lean_object* l_Lean_Parser_Term_matchAlt_parenthesizer___closed__1; lean_object* l_Lean_Parser_Term_ident___elambda__1(lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_doReassignArrow___closed__1; +lean_object* l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer(lean_object*); extern lean_object* l_Lean_Parser_Term_match_formatter___closed__2; lean_object* l_Lean_Parser_Term_doPat___closed__10; lean_object* l_Lean_Parser_Term_doCatch_parenthesizer___closed__6; @@ -714,8 +747,10 @@ lean_object* l_Lean_Parser_Term_doIf_parenthesizer___closed__18; lean_object* l_Lean_Parser_Term_doFor___closed__10; lean_object* l_Lean_Parser_Term_doLetArrow_parenthesizer___closed__3; lean_object* l_Lean_Parser_Term_doLetArrow_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_doReassign___closed__6; lean_object* l_Lean_Parser_Term_doLetArrow___closed__7; extern lean_object* l_Lean_Parser_Tactic_tacticSeqBracketed___elambda__1___closed__5; +extern lean_object* l_Lean_Parser_Term_letDecl_formatter___closed__3; lean_object* l_Lean_Parser_Term_doAssert_parenthesizer___closed__2; lean_object* l_Lean_Parser_Term_doHave___closed__4; lean_object* l_Lean_Parser_Term_liftMethod_parenthesizer___closed__1; @@ -795,6 +830,7 @@ extern lean_object* l_Lean_Parser_Term_if___elambda__1___closed__8; lean_object* l_Lean_Parser_Term_doFor___elambda__1___closed__11; lean_object* l___regBuiltin_Lean_Parser_Term_doMatch_parenthesizer(lean_object*); extern lean_object* l_Lean_Parser_Term_matchAlts___closed__9; +lean_object* l_Lean_Parser_Term_doReassign___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_doIf_parenthesizer___closed__3; lean_object* l_Lean_Parser_sepBy1Fn___at_Lean_Parser_Term_doMatchAlts___elambda__1___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doCatch_formatter___closed__6; @@ -828,6 +864,7 @@ lean_object* l_Lean_Parser_Term_doFor_formatter___closed__1; lean_object* l_Lean_Parser_Term_doExpr_formatter___closed__9; lean_object* l_Lean_Parser_Term_doSeqBracketed___elambda__1___closed__3; extern lean_object* l_Lean_Parser_manyAux___main___at_Lean_Parser_many1Indent___spec__1___closed__1; +lean_object* l_Lean_Parser_Term_doReassignArrow___closed__2; lean_object* l_Lean_Parser_Term_doMatchAlts_parenthesizer___closed__6; lean_object* l_Lean_Parser_Term_doTry___elambda__1___closed__5; lean_object* l_Lean_Parser_Term_doIf_formatter___closed__3; @@ -864,6 +901,7 @@ lean_object* l_String_trim(lean_object*); lean_object* l_Lean_Parser_Term_doSeq_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_continue___closed__5; lean_object* l_Lean_Parser_Term_doExpr___elambda__1___closed__4; +lean_object* l_Lean_Parser_Term_doReassign_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_darrow___elambda__1(lean_object*, lean_object*); lean_object* l___regBuiltinParser_Lean_Parser_Term_doLetRec(lean_object*); lean_object* l_Lean_Parser_Term_doPat_parenthesizer___closed__6; @@ -916,8 +954,10 @@ lean_object* l_Lean_Parser_Term_doTry_parenthesizer___closed__7; lean_object* l_Lean_Parser_Term_doId_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_regBuiltinDoElemParserAttr___closed__2; lean_object* l_Lean_Parser_Term_doId_formatter___closed__1; +lean_object* l___regBuiltinParser_Lean_Parser_Term_doReassignArrow(lean_object*); lean_object* l_Lean_Parser_Term_doPat_formatter___closed__8; lean_object* l_Lean_Parser_Term_doSeqBracketed_parenthesizer___closed__5; +lean_object* l_Lean_Parser_Term_letPatDecl___elambda__1(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Term_have_formatter___closed__4; extern lean_object* l_Lean_Parser_Term_if_formatter___closed__2; lean_object* l_Lean_Parser_Term_doExpr___elambda__1___closed__13; @@ -926,6 +966,7 @@ lean_object* l_Lean_Parser_Term_doLet___elambda__1___closed__2; lean_object* l_Lean_Parser_mkAntiquot(lean_object*, lean_object*, uint8_t); lean_object* l___regBuiltin_Lean_Parser_Term_doExpr_parenthesizer___closed__1; lean_object* l_Lean_Parser_Term_doFor___elambda__1___closed__6; +lean_object* l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer___closed__1; lean_object* l_Lean_PrettyPrinter_Parenthesizer_withPosition_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doExpr_formatter___closed__11; lean_object* l_Lean_Parser_Term_doIf_formatter___closed__15; @@ -1002,11 +1043,15 @@ lean_object* l_Lean_Parser_Term_doIf_parenthesizer___closed__10; lean_object* l_Lean_Parser_Term_doExpr___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_doLetArrow_formatter___closed__2; lean_object* l_Lean_Parser_Term_doUnless_formatter___closed__4; +lean_object* l_Lean_Parser_Term_doReassign_formatter(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doMatchAlts___closed__6; lean_object* l_Lean_Parser_Term_doIf___closed__19; +lean_object* l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer___closed__1; lean_object* l_Lean_Parser_Term_doPat___closed__5; +lean_object* l___regBuiltin_Lean_Parser_Term_doReassign_formatter___closed__1; lean_object* l_Lean_Parser_Term_doMatch___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_doSeqBracketed___elambda__1___closed__4; +lean_object* l___regBuiltinParser_Lean_Parser_Term_doReassign(lean_object*); lean_object* l_Lean_PrettyPrinter_Formatter_notFollowedBy_formatter___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doHave_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_do___elambda__1(lean_object*, lean_object*); @@ -1068,6 +1113,7 @@ lean_object* l_Lean_Parser_Term_doHave___elambda__1(lean_object*, lean_object*); extern lean_object* l___regBuiltin_Lean_Parser_Term_ident_formatter___closed__1; lean_object* l_Lean_Parser_mkAntiquot_parenthesizer___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doTry___closed__5; +lean_object* l_Lean_Parser_Term_doReassign_parenthesizer___closed__1; lean_object* l_Lean_Parser_Term_doIf___closed__11; lean_object* l_Lean_PrettyPrinter_Parenthesizer_try_parenthesizer(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_regDoElemParserAttribute(lean_object*); @@ -6909,6 +6955,651 @@ x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); return x_5; } } +lean_object* _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("doReassign"); +return x_1; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_mkAppStx___closed__6; +x_2 = l_Lean_Parser_Term_doReassign___elambda__1___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_2 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__4() { +_start: +{ +lean_object* x_1; lean_object* x_2; uint8_t x_3; lean_object* x_4; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__1; +x_2 = l_Lean_Parser_Term_doReassign___elambda__1___closed__3; +x_3 = 1; +x_4 = l_Lean_Parser_mkAntiquot(x_1, x_2, x_3); +return x_4; +} +} +lean_object* l_Lean_Parser_Term_doReassign___elambda__1(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; lean_object* x_4; uint8_t x_5; +x_3 = l_Lean_Parser_Term_doReassign___elambda__1___closed__4; +x_4 = lean_ctor_get(x_3, 1); +lean_inc(x_4); +lean_inc(x_2); +lean_inc(x_1); +x_5 = l_Lean_Parser_tryAnti(x_1, x_2); +if (x_5 == 0) +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +lean_dec(x_4); +x_6 = lean_unsigned_to_nat(1024u); +x_7 = l_Lean_Parser_checkPrecFn(x_6, x_1, x_2); +x_8 = lean_ctor_get(x_7, 3); +lean_inc(x_8); +if (lean_obj_tag(x_8) == 0) +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; +x_9 = lean_ctor_get(x_7, 0); +lean_inc(x_9); +x_10 = lean_array_get_size(x_9); +lean_dec(x_9); +x_11 = lean_ctor_get(x_7, 1); +lean_inc(x_11); +lean_inc(x_1); +x_12 = l_Lean_Parser_Term_letIdDecl___elambda__1(x_1, x_7); +x_13 = lean_ctor_get(x_12, 3); +lean_inc(x_13); +if (lean_obj_tag(x_13) == 0) +{ +lean_object* x_14; lean_object* x_15; +lean_dec(x_11); +lean_dec(x_1); +x_14 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_15 = l_Lean_Parser_ParserState_mkNode(x_12, x_14, x_10); +return x_15; +} +else +{ +lean_object* x_16; lean_object* x_17; uint8_t x_18; +x_16 = lean_ctor_get(x_13, 0); +lean_inc(x_16); +lean_dec(x_13); +x_17 = lean_ctor_get(x_12, 1); +lean_inc(x_17); +x_18 = lean_nat_dec_eq(x_17, x_11); +lean_dec(x_17); +if (x_18 == 0) +{ +lean_object* x_19; lean_object* x_20; +lean_dec(x_16); +lean_dec(x_11); +lean_dec(x_1); +x_19 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_20 = l_Lean_Parser_ParserState_mkNode(x_12, x_19, x_10); +return x_20; +} +else +{ +lean_object* x_21; lean_object* x_22; uint8_t x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; +lean_inc(x_11); +x_21 = l_Lean_Parser_ParserState_restore(x_12, x_10, x_11); +x_22 = l_Lean_Parser_Term_letPatDecl___elambda__1(x_1, x_21); +x_23 = 1; +x_24 = l_Lean_Parser_mergeOrElseErrors(x_22, x_16, x_11, x_23); +lean_dec(x_11); +x_25 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_26 = l_Lean_Parser_ParserState_mkNode(x_24, x_25, x_10); +return x_26; +} +} +} +else +{ +lean_dec(x_8); +lean_dec(x_1); +return x_7; +} +} +else +{ +lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; +x_27 = lean_ctor_get(x_2, 0); +lean_inc(x_27); +x_28 = lean_array_get_size(x_27); +lean_dec(x_27); +x_29 = lean_ctor_get(x_2, 1); +lean_inc(x_29); +lean_inc(x_1); +x_30 = lean_apply_2(x_4, x_1, x_2); +x_31 = lean_ctor_get(x_30, 3); +lean_inc(x_31); +if (lean_obj_tag(x_31) == 0) +{ +lean_dec(x_29); +lean_dec(x_28); +lean_dec(x_1); +return x_30; +} +else +{ +lean_object* x_32; lean_object* x_33; uint8_t x_34; +x_32 = lean_ctor_get(x_31, 0); +lean_inc(x_32); +lean_dec(x_31); +x_33 = lean_ctor_get(x_30, 1); +lean_inc(x_33); +x_34 = lean_nat_dec_eq(x_33, x_29); +lean_dec(x_33); +if (x_34 == 0) +{ +lean_dec(x_32); +lean_dec(x_29); +lean_dec(x_28); +lean_dec(x_1); +return x_30; +} +else +{ +lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; +lean_inc(x_29); +x_35 = l_Lean_Parser_ParserState_restore(x_30, x_28, x_29); +lean_dec(x_28); +x_36 = lean_unsigned_to_nat(1024u); +x_37 = l_Lean_Parser_checkPrecFn(x_36, x_1, x_35); +x_38 = lean_ctor_get(x_37, 3); +lean_inc(x_38); +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; +x_39 = lean_ctor_get(x_37, 0); +lean_inc(x_39); +x_40 = lean_array_get_size(x_39); +lean_dec(x_39); +x_41 = lean_ctor_get(x_37, 1); +lean_inc(x_41); +lean_inc(x_1); +x_42 = l_Lean_Parser_Term_letIdDecl___elambda__1(x_1, x_37); +x_43 = lean_ctor_get(x_42, 3); +lean_inc(x_43); +if (lean_obj_tag(x_43) == 0) +{ +lean_object* x_44; lean_object* x_45; uint8_t x_46; lean_object* x_47; +lean_dec(x_41); +lean_dec(x_1); +x_44 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_45 = l_Lean_Parser_ParserState_mkNode(x_42, x_44, x_40); +x_46 = 1; +x_47 = l_Lean_Parser_mergeOrElseErrors(x_45, x_32, x_29, x_46); +lean_dec(x_29); +return x_47; +} +else +{ +lean_object* x_48; lean_object* x_49; uint8_t x_50; +x_48 = lean_ctor_get(x_43, 0); +lean_inc(x_48); +lean_dec(x_43); +x_49 = lean_ctor_get(x_42, 1); +lean_inc(x_49); +x_50 = lean_nat_dec_eq(x_49, x_41); +lean_dec(x_49); +if (x_50 == 0) +{ +lean_object* x_51; lean_object* x_52; uint8_t x_53; lean_object* x_54; +lean_dec(x_48); +lean_dec(x_41); +lean_dec(x_1); +x_51 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_52 = l_Lean_Parser_ParserState_mkNode(x_42, x_51, x_40); +x_53 = 1; +x_54 = l_Lean_Parser_mergeOrElseErrors(x_52, x_32, x_29, x_53); +lean_dec(x_29); +return x_54; +} +else +{ +lean_object* x_55; lean_object* x_56; uint8_t x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; +lean_inc(x_41); +x_55 = l_Lean_Parser_ParserState_restore(x_42, x_40, x_41); +x_56 = l_Lean_Parser_Term_letPatDecl___elambda__1(x_1, x_55); +x_57 = 1; +x_58 = l_Lean_Parser_mergeOrElseErrors(x_56, x_48, x_41, x_57); +lean_dec(x_41); +x_59 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_60 = l_Lean_Parser_ParserState_mkNode(x_58, x_59, x_40); +x_61 = l_Lean_Parser_mergeOrElseErrors(x_60, x_32, x_29, x_57); +lean_dec(x_29); +return x_61; +} +} +} +else +{ +uint8_t x_62; lean_object* x_63; +lean_dec(x_38); +lean_dec(x_1); +x_62 = 1; +x_63 = l_Lean_Parser_mergeOrElseErrors(x_37, x_32, x_29, x_62); +lean_dec(x_29); +return x_63; +} +} +} +} +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_1 = l_Lean_Parser_Term_letIdDecl; +x_2 = lean_ctor_get(x_1, 0); +lean_inc(x_2); +x_3 = l_Lean_Parser_Term_letPatDecl; +x_4 = lean_ctor_get(x_3, 0); +lean_inc(x_4); +x_5 = l_Lean_Parser_orelseInfo(x_2, x_4); +return x_5; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_2 = l_Lean_Parser_Term_doReassign___closed__1; +x_3 = l_Lean_Parser_nodeInfo(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_epsilonInfo; +x_2 = l_Lean_Parser_Term_doReassign___closed__2; +x_3 = l_Lean_Parser_andthenInfo(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___closed__4() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__4; +x_2 = lean_ctor_get(x_1, 0); +lean_inc(x_2); +x_3 = l_Lean_Parser_Term_doReassign___closed__3; +x_4 = l_Lean_Parser_orelseInfo(x_2, x_3); +return x_4; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___closed__5() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Parser_Term_doReassign___elambda__1), 2, 0); +return x_1; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign___closed__6() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_doReassign___closed__4; +x_2 = l_Lean_Parser_Term_doReassign___closed__5; +x_3 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_3, 0, x_1); +lean_ctor_set(x_3, 1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Parser_Term_doReassign___closed__6; +return x_1; +} +} +lean_object* l___regBuiltinParser_Lean_Parser_Term_doReassign(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; uint8_t x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_2 = l_Lean_Parser_regBuiltinDoElemParserAttr___closed__4; +x_3 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_4 = 1; +x_5 = l_Lean_Parser_Term_doReassign; +x_6 = lean_unsigned_to_nat(0u); +x_7 = l_Lean_Parser_addBuiltinParser(x_2, x_3, x_4, x_5, x_6, x_1); +return x_7; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign_formatter___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; uint8_t x_3; lean_object* x_4; lean_object* x_5; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__1; +x_2 = l_Lean_Parser_Term_doReassign___elambda__1___closed__3; +x_3 = 1; +x_4 = lean_box(x_3); +x_5 = lean_alloc_closure((void*)(l_Lean_Parser_mkAntiquot_formatter___boxed), 8, 3); +lean_closure_set(x_5, 0, x_1); +lean_closure_set(x_5, 1, x_2); +lean_closure_set(x_5, 2, x_4); +return x_5; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign_formatter___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_letDecl_formatter___closed__6; +x_2 = l_Lean_Parser_Term_letDecl_formatter___closed__3; +x_3 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_Formatter_orelse_formatter), 7, 2); +lean_closure_set(x_3, 0, x_1); +lean_closure_set(x_3, 1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign_formatter___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_2 = lean_unsigned_to_nat(1024u); +x_3 = l_Lean_Parser_Term_doReassign_formatter___closed__2; +x_4 = lean_alloc_closure((void*)(l_Lean_Parser_leadingNode_formatter___boxed), 8, 3); +lean_closure_set(x_4, 0, x_1); +lean_closure_set(x_4, 1, x_2); +lean_closure_set(x_4, 2, x_3); +return x_4; +} +} +lean_object* l_Lean_Parser_Term_doReassign_formatter(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = l_Lean_Parser_Term_doReassign_formatter___closed__1; +x_7 = l_Lean_Parser_Term_doReassign_formatter___closed__3; +x_8 = l_Lean_PrettyPrinter_Formatter_orelse_formatter(x_6, x_7, x_1, x_2, x_3, x_4, x_5); +return x_8; +} +} +lean_object* _init_l___regBuiltin_Lean_Parser_Term_doReassign_formatter___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Parser_Term_doReassign_formatter), 5, 0); +return x_1; +} +} +lean_object* l___regBuiltin_Lean_Parser_Term_doReassign_formatter(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_2 = l_Lean_PrettyPrinter_formatterAttribute; +x_3 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_4 = l___regBuiltin_Lean_Parser_Term_doReassign_formatter___closed__1; +x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); +return x_5; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign_parenthesizer___closed__1() { +_start: +{ +lean_object* x_1; uint8_t x_2; lean_object* x_3; lean_object* x_4; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__3; +x_2 = 1; +x_3 = lean_box(x_2); +x_4 = lean_alloc_closure((void*)(l_Lean_Parser_mkAntiquot_parenthesizer___rarg___boxed), 7, 2); +lean_closure_set(x_4, 0, x_1); +lean_closure_set(x_4, 1, x_3); +return x_4; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign_parenthesizer___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_letDecl_parenthesizer___closed__5; +x_2 = l_Lean_Parser_Term_letDecl_parenthesizer___closed__2; +x_3 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_Parenthesizer_orelse_parenthesizer), 7, 2); +lean_closure_set(x_3, 0, x_1); +lean_closure_set(x_3, 1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassign_parenthesizer___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; +x_1 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_2 = lean_unsigned_to_nat(1024u); +x_3 = l_Lean_Parser_Term_doReassign_parenthesizer___closed__2; +x_4 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_Parenthesizer_leadingNode_parenthesizer___boxed), 8, 3); +lean_closure_set(x_4, 0, x_1); +lean_closure_set(x_4, 1, x_2); +lean_closure_set(x_4, 2, x_3); +return x_4; +} +} +lean_object* l_Lean_Parser_Term_doReassign_parenthesizer(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = l_Lean_Parser_Term_doReassign_parenthesizer___closed__1; +x_7 = l_Lean_Parser_Term_doReassign_parenthesizer___closed__3; +x_8 = l_Lean_PrettyPrinter_Parenthesizer_orelse_parenthesizer(x_6, x_7, x_1, x_2, x_3, x_4, x_5); +return x_8; +} +} +lean_object* _init_l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Parser_Term_doReassign_parenthesizer), 5, 0); +return x_1; +} +} +lean_object* l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_2 = l_Lean_PrettyPrinter_parenthesizerAttribute; +x_3 = l_Lean_Parser_Term_doReassign___elambda__1___closed__2; +x_4 = l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer___closed__1; +x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); +return x_5; +} +} +lean_object* l_Lean_Parser_Term_doReassignArrow___elambda__1(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_3 = lean_ctor_get(x_2, 0); +lean_inc(x_3); +x_4 = lean_array_get_size(x_3); +lean_dec(x_3); +x_5 = lean_ctor_get(x_2, 1); +lean_inc(x_5); +lean_inc(x_1); +x_6 = l_Lean_Parser_Term_doId___elambda__1(x_1, x_2); +x_7 = lean_ctor_get(x_6, 3); +lean_inc(x_7); +if (lean_obj_tag(x_7) == 0) +{ +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_1); +return x_6; +} +else +{ +lean_object* x_8; lean_object* x_9; uint8_t x_10; +x_8 = lean_ctor_get(x_7, 0); +lean_inc(x_8); +lean_dec(x_7); +x_9 = lean_ctor_get(x_6, 1); +lean_inc(x_9); +x_10 = lean_nat_dec_eq(x_9, x_5); +lean_dec(x_9); +if (x_10 == 0) +{ +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_1); +return x_6; +} +else +{ +lean_object* x_11; lean_object* x_12; uint8_t x_13; lean_object* x_14; +lean_inc(x_5); +x_11 = l_Lean_Parser_ParserState_restore(x_6, x_4, x_5); +lean_dec(x_4); +x_12 = l_Lean_Parser_Term_doPat___elambda__1(x_1, x_11); +x_13 = 1; +x_14 = l_Lean_Parser_mergeOrElseErrors(x_12, x_8, x_5, x_13); +lean_dec(x_5); +return x_14; +} +} +} +} +lean_object* _init_l_Lean_Parser_Term_doReassignArrow___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Parser_Term_doReassignArrow___elambda__1), 2, 0); +return x_1; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassignArrow___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_doLetArrow___closed__1; +x_2 = l_Lean_Parser_Term_doReassignArrow___closed__1; +x_3 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_3, 0, x_1); +lean_ctor_set(x_3, 1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_doReassignArrow() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Parser_Term_doReassignArrow___closed__2; +return x_1; +} +} +lean_object* _init_l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("doReassignArrow"); +return x_1; +} +} +lean_object* _init_l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_mkAppStx___closed__6; +x_2 = l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* l___regBuiltinParser_Lean_Parser_Term_doReassignArrow(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; uint8_t x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_2 = l_Lean_Parser_regBuiltinDoElemParserAttr___closed__4; +x_3 = l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2; +x_4 = 1; +x_5 = l_Lean_Parser_Term_doReassignArrow; +x_6 = lean_unsigned_to_nat(0u); +x_7 = l_Lean_Parser_addBuiltinParser(x_2, x_3, x_4, x_5, x_6, x_1); +return x_7; +} +} +lean_object* l_Lean_Parser_Term_doReassignArrow_formatter(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = l_Lean_Parser_Term_doLetArrow_formatter___closed__2; +x_7 = l_Lean_Parser_Term_doLetArrow_formatter___closed__3; +x_8 = l_Lean_PrettyPrinter_Formatter_orelse_formatter(x_6, x_7, x_1, x_2, x_3, x_4, x_5); +return x_8; +} +} +lean_object* _init_l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Parser_Term_doReassignArrow_formatter), 5, 0); +return x_1; +} +} +lean_object* l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_2 = l_Lean_PrettyPrinter_formatterAttribute; +x_3 = l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2; +x_4 = l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter___closed__1; +x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); +return x_5; +} +} +lean_object* l_Lean_Parser_Term_doReassignArrow_parenthesizer(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = l_Lean_Parser_Term_doLetArrow_parenthesizer___closed__2; +x_7 = l_Lean_Parser_Term_doLetArrow_parenthesizer___closed__3; +x_8 = l_Lean_PrettyPrinter_Parenthesizer_orelse_parenthesizer(x_6, x_7, x_1, x_2, x_3, x_4, x_5); +return x_8; +} +} +lean_object* _init_l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Parser_Term_doReassignArrow_parenthesizer), 5, 0); +return x_1; +} +} +lean_object* l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_2 = l_Lean_PrettyPrinter_parenthesizerAttribute; +x_3 = l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2; +x_4 = l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer___closed__1; +x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); +return x_5; +} +} lean_object* _init_l_Lean_Parser_Term_doHave___elambda__1___closed__1() { _start: { @@ -24586,6 +25277,76 @@ lean_mark_persistent(l___regBuiltin_Lean_Parser_Term_doLetArrow_parenthesizer___ res = l___regBuiltin_Lean_Parser_Term_doLetArrow_parenthesizer(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l_Lean_Parser_Term_doReassign___elambda__1___closed__1 = _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__1(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___elambda__1___closed__1); +l_Lean_Parser_Term_doReassign___elambda__1___closed__2 = _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__2(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___elambda__1___closed__2); +l_Lean_Parser_Term_doReassign___elambda__1___closed__3 = _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__3(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___elambda__1___closed__3); +l_Lean_Parser_Term_doReassign___elambda__1___closed__4 = _init_l_Lean_Parser_Term_doReassign___elambda__1___closed__4(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___elambda__1___closed__4); +l_Lean_Parser_Term_doReassign___closed__1 = _init_l_Lean_Parser_Term_doReassign___closed__1(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___closed__1); +l_Lean_Parser_Term_doReassign___closed__2 = _init_l_Lean_Parser_Term_doReassign___closed__2(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___closed__2); +l_Lean_Parser_Term_doReassign___closed__3 = _init_l_Lean_Parser_Term_doReassign___closed__3(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___closed__3); +l_Lean_Parser_Term_doReassign___closed__4 = _init_l_Lean_Parser_Term_doReassign___closed__4(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___closed__4); +l_Lean_Parser_Term_doReassign___closed__5 = _init_l_Lean_Parser_Term_doReassign___closed__5(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___closed__5); +l_Lean_Parser_Term_doReassign___closed__6 = _init_l_Lean_Parser_Term_doReassign___closed__6(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign___closed__6); +l_Lean_Parser_Term_doReassign = _init_l_Lean_Parser_Term_doReassign(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign); +res = l___regBuiltinParser_Lean_Parser_Term_doReassign(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l_Lean_Parser_Term_doReassign_formatter___closed__1 = _init_l_Lean_Parser_Term_doReassign_formatter___closed__1(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign_formatter___closed__1); +l_Lean_Parser_Term_doReassign_formatter___closed__2 = _init_l_Lean_Parser_Term_doReassign_formatter___closed__2(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign_formatter___closed__2); +l_Lean_Parser_Term_doReassign_formatter___closed__3 = _init_l_Lean_Parser_Term_doReassign_formatter___closed__3(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign_formatter___closed__3); +l___regBuiltin_Lean_Parser_Term_doReassign_formatter___closed__1 = _init_l___regBuiltin_Lean_Parser_Term_doReassign_formatter___closed__1(); +lean_mark_persistent(l___regBuiltin_Lean_Parser_Term_doReassign_formatter___closed__1); +res = l___regBuiltin_Lean_Parser_Term_doReassign_formatter(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l_Lean_Parser_Term_doReassign_parenthesizer___closed__1 = _init_l_Lean_Parser_Term_doReassign_parenthesizer___closed__1(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign_parenthesizer___closed__1); +l_Lean_Parser_Term_doReassign_parenthesizer___closed__2 = _init_l_Lean_Parser_Term_doReassign_parenthesizer___closed__2(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign_parenthesizer___closed__2); +l_Lean_Parser_Term_doReassign_parenthesizer___closed__3 = _init_l_Lean_Parser_Term_doReassign_parenthesizer___closed__3(); +lean_mark_persistent(l_Lean_Parser_Term_doReassign_parenthesizer___closed__3); +l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer___closed__1 = _init_l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer___closed__1(); +lean_mark_persistent(l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer___closed__1); +res = l___regBuiltin_Lean_Parser_Term_doReassign_parenthesizer(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l_Lean_Parser_Term_doReassignArrow___closed__1 = _init_l_Lean_Parser_Term_doReassignArrow___closed__1(); +lean_mark_persistent(l_Lean_Parser_Term_doReassignArrow___closed__1); +l_Lean_Parser_Term_doReassignArrow___closed__2 = _init_l_Lean_Parser_Term_doReassignArrow___closed__2(); +lean_mark_persistent(l_Lean_Parser_Term_doReassignArrow___closed__2); +l_Lean_Parser_Term_doReassignArrow = _init_l_Lean_Parser_Term_doReassignArrow(); +lean_mark_persistent(l_Lean_Parser_Term_doReassignArrow); +l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__1 = _init_l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__1(); +lean_mark_persistent(l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__1); +l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2 = _init_l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2(); +lean_mark_persistent(l___regBuiltinParser_Lean_Parser_Term_doReassignArrow___closed__2); +res = l___regBuiltinParser_Lean_Parser_Term_doReassignArrow(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter___closed__1 = _init_l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter___closed__1(); +lean_mark_persistent(l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter___closed__1); +res = l___regBuiltin_Lean_Parser_Term_doReassignArrow_formatter(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer___closed__1 = _init_l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer___closed__1(); +lean_mark_persistent(l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer___closed__1); +res = l___regBuiltin_Lean_Parser_Term_doReassignArrow_parenthesizer(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); l_Lean_Parser_Term_doHave___elambda__1___closed__1 = _init_l_Lean_Parser_Term_doHave___elambda__1___closed__1(); lean_mark_persistent(l_Lean_Parser_Term_doHave___elambda__1___closed__1); l_Lean_Parser_Term_doHave___elambda__1___closed__2 = _init_l_Lean_Parser_Term_doHave___elambda__1___closed__2();