diff --git a/stage0/src/Init/Lean/Elab/Definition.lean b/stage0/src/Init/Lean/Elab/Definition.lean index d5b8f9025c..9d669e8756 100644 --- a/stage0/src/Init/Lean/Elab/Definition.lean +++ b/stage0/src/Init/Lean/Elab/Definition.lean @@ -83,8 +83,7 @@ withUsedWhen ref vars xs e dummyExpr cond k def mkDef (view : DefView) (declName : Name) (explictLevelNames : List Name) (vars : Array Expr) (xs : Array Expr) (type : Expr) (val : Expr) : TermElabM (Option Declaration) := do let ref := view.ref; -valType ← Term.inferType view.val val; -val ← Term.ensureHasType ref type valType val; +val ← Term.ensureHasType ref type val; Term.synthesizeSyntheticMVars false; type ← Term.instantiateMVars ref type; val ← Term.instantiateMVars view.val val; diff --git a/stage0/src/Init/Lean/Elab/Syntax.lean b/stage0/src/Init/Lean/Elab/Syntax.lean index 18c77e696a..0b6fac88ed 100644 --- a/stage0/src/Init/Lean/Elab/Syntax.lean +++ b/stage0/src/Init/Lean/Elab/Syntax.lean @@ -143,12 +143,16 @@ fun stx => do env ← liftIO stx $ Parser.registerParserCategory env attrName catName; setEnv env +def mkFreshKind (catName : Name) : CommandElabM Name := do +env ← getEnv; +let (env, kind) := Parser.mkFreshKind env catName; +setEnv env; +pure kind + + private def elabKind (stx : Syntax) (catName : Name) : CommandElabM Name := do -if stx.isNone then do - env ← getEnv; - let (env, kind) := Parser.mkFreshKind env catName; - setEnv env; - pure kind +if stx.isNone then + mkFreshKind catName else do let kind := stx.getIdAt 1; currNamespace ← getCurrNamespace; @@ -205,6 +209,11 @@ else if k == `Lean.Parser.Command.strLitPrec then else throwUnsupportedSyntax +def strLitPrecToPattern (stx: Syntax) : CommandElabM Syntax := +match (stx.getArg 0).isStrLit? with +| some str => pure $ mkAtomFrom stx str +| none => throwUnsupportedSyntax + /- Convert `notation` command lhs item a pattern element -/ def expandNotationItemIntoPattern (stx : Syntax) : CommandElabM Syntax := let k := stx.getKind; @@ -214,30 +223,92 @@ if k == `Lean.Parser.Command.identPrec then else if k == `Lean.Parser.Command.quotedSymbolPrec then pure $ (stx.getArg 0).getArg 1 else if k == `Lean.Parser.Command.strLitPrec then - match (stx.getArg 0).isStrLit? with - | some str => pure $ mkAtomFrom stx str - | none => throwUnsupportedSyntax + strLitPrecToPattern stx else throwUnsupportedSyntax @[builtinCommandElab «notation»] def elabNotation : CommandElab := adaptExpander $ fun stx => match_syntax stx with | `(notation $items* => $rhs) => do + kind ← mkFreshKind `term; -- build parser syntaxParts ← items.mapM expandNotationItemIntoSyntaxItem; let cat := mkIdentFrom stx `term; - -- build macro + -- build macro rules let vars := items.filter $ fun item => item.getKind == `Lean.Parser.Command.identPrec; let vars := vars.map $ fun var => var.getArg 0; let rhs := antiquote vars rhs; patArgs ← items.mapM expandNotationItemIntoPattern; - scp ← getCurrMacroScope; - -- manually create hygienic kind name - let kind := addMacroScope `myParser scp; let pat := Syntax.node kind patArgs; `(syntax [$(mkIdentFrom stx kind)] $syntaxParts* : $cat macro_rules | `($pat) => `($rhs)) | _ => throwUnsupportedSyntax +/- Convert `macro` head into a `syntax` command item -/ +def expandMacroHeadIntoSyntaxItem (stx : Syntax) : CommandElabM Syntax := +let k := stx.getKind; +if k == `Lean.Parser.Command.identPrec then + let info := stx.getHeadInfo; + let id := (stx.getArg 0).getId; + pure $ Syntax.node `Lean.Parser.Syntax.atom #[mkStxStrLit (toString id) info, stx.getArg 1] +else if k == `Lean.Parser.Command.strLitPrec then + pure $ Syntax.node `Lean.Parser.Syntax.atom stx.getArgs +else + throwUnsupportedSyntax + +/- Convert `macro` argument into a `syntax` command item -/ +def expandMacroArgIntoSyntaxItem (stx : Syntax) : CommandElabM Syntax := +let k := stx.getKind; +if k == `Lean.Parser.Command.macroArgSimple then + pure $ Syntax.node `Lean.Parser.Syntax.cat #[stx.getArg 2, stx.getArg 3] +else if k == `Lean.Parser.Command.strLitPrec then + pure $ Syntax.node `Lean.Parser.Syntax.atom stx.getArgs +else + throwUnsupportedSyntax + +/- Convert `macro` head into a pattern element -/ +def expandMacroHeadIntoPattern (stx : Syntax) : CommandElabM Syntax := +let k := stx.getKind; +if k == `Lean.Parser.Command.identPrec then + let str := toString (stx.getArg 0).getId; + pure $ mkAtomFrom stx str +else if k == `Lean.Parser.Command.strLitPrec then + strLitPrecToPattern stx +else + throwUnsupportedSyntax + +/- Convert `macro` arg into a pattern element -/ +def expandMacroArgIntoPattern (stx : Syntax) : CommandElabM Syntax := +let k := stx.getKind; +if k == `Lean.Parser.Command.macroArgSimple then + let item := stx.getArg 0; + pure $ mkNode `antiquot #[mkAtom "$", mkTermIdFromIdent item, mkNullNode, mkNullNode] +else if k == `Lean.Parser.Command.strLitPrec then + strLitPrecToPattern stx +else + throwUnsupportedSyntax + +@[builtinCommandElab «macro»] def elabMacro : CommandElab := +adaptExpander $ fun stx => do + let head := stx.getArg 1; + let args := (stx.getArg 2).getArgs; + let cat := stx.getArg 4; + let rhsBody := stx.getArg 7; + kind ← mkFreshKind cat.getId; + -- build parser + stxPart ← expandMacroHeadIntoSyntaxItem head; + stxParts ← args.mapM expandMacroArgIntoSyntaxItem; + let stxParts := #[stxPart] ++ stxParts; + -- build macro rules + patHead ← expandMacroHeadIntoPattern head; + patArgs ← args.mapM expandMacroArgIntoPattern; + let pat := Syntax.node kind (#[patHead] ++ patArgs); + trace `Elab.syntax stx $ fun _ => pat; + `(syntax [$(mkIdentFrom stx kind)] $stxParts* : $cat macro_rules | `($pat) => `($rhsBody)) + +@[init] private def regTraceClasses : IO Unit := do +registerTraceClass `Elab.syntax; +pure () + end Command end Elab end Lean diff --git a/stage0/src/Init/Lean/Elab/Tactic.lean b/stage0/src/Init/Lean/Elab/Tactic.lean index 871761281c..2ae2bef354 100644 --- a/stage0/src/Init/Lean/Elab/Tactic.lean +++ b/stage0/src/Init/Lean/Elab/Tactic.lean @@ -35,12 +35,16 @@ withMVarContext mvarId $ fun ctx s => def reportUnsolvedGoals (ref : Syntax) (goals : List MVarId) : TermElabM Unit := throwError ref $ "unsolved goals" ++ Format.line ++ MessageData.joinSep (goals.map $ MessageData.ofGoal) Format.line +def ensureAssignmentHasNoMVars (ref : Syntax) (mvarId : MVarId) : TermElabM Unit := do +val ← instantiateMVars ref (mkMVar mvarId); +when val.hasMVar $ throwError ref ("tactic failed, result still contain metavariables" ++ indentExpr val) + def runTactic (ref : Syntax) (mvarId : MVarId) (tacticCode : Syntax) : TermElabM Unit := do modify $ fun s => { mctx := s.mctx.instantiateMVarDeclMVars mvarId, .. s }; remainingGoals ← liftTacticElabM ref mvarId $ do { evalTactic tacticCode; s ← get; pure s.goals }; -unless remainingGoals.isEmpty (reportUnsolvedGoals ref remainingGoals); --- TODO: check unassigned metavariables in mvarId -pure () +let tailRef := ref.getTailWithInfo.getD ref; +unless remainingGoals.isEmpty (reportUnsolvedGoals tailRef remainingGoals); +ensureAssignmentHasNoMVars tailRef mvarId end Term diff --git a/stage0/src/Init/Lean/Elab/Tactic/Basic.lean b/stage0/src/Init/Lean/Elab/Tactic/Basic.lean index 2e8b6a6a7b..2f5437be69 100644 --- a/stage0/src/Init/Lean/Elab/Tactic/Basic.lean +++ b/stage0/src/Init/Lean/Elab/Tactic/Basic.lean @@ -44,6 +44,9 @@ def getOptions : TacticM Options := do ctx ← read; pure ctx.config.opts def getMVarDecl (mvarId : MVarId) : TacticM MetavarDecl := do mctx ← getMCtx; pure $ mctx.getDecl mvarId def instantiateMVars (ref : Syntax) (e : Expr) : TacticM Expr := liftTermElabM $ Term.instantiateMVars ref e def addContext (msg : MessageData) : TacticM MessageData := liftTermElabM $ Term.addContext msg +def assignExprMVar (mvarId : MVarId) (val : Expr) : TacticM Unit := liftTermElabM $ Term.assignExprMVar mvarId val +def ensureHasType (ref : Syntax) (expectedType? : Option Expr) (e : Expr) : TacticM Expr := liftTermElabM $ Term.ensureHasType ref expectedType? e +def elabTerm (stx : Syntax) (expectedType? : Option Expr) : TacticM Expr := liftTermElabM $ Term.elabTerm stx expectedType? instance monadLog : MonadLog TacticM := { getCmdPos := do ctx ← read; pure ctx.cmdPos, @@ -176,12 +179,18 @@ ctx ← read; let needReset := ctx.localInstances == mvarDecl.localInstances; withLCtx mvarDecl.lctx mvarDecl.localInstances $ resettingSynthInstanceCacheWhen needReset x +def getGoals : TacticM (List MVarId) := do s ← get; pure s.goals +def getMainGoal (ref : Syntax) : TacticM (MVarId × List MVarId) := do (g::gs) ← getGoals | throwError ref "no goals to be solved"; pure (g, gs) +def updateGoals (gs : List MVarId) : TacticM Unit := modify $ fun s => { goals := gs, .. s } +def ensureHasNoMVars (ref : Syntax) (e : Expr) : TacticM Unit := do +e ← instantiateMVars ref e; +when e.hasMVar $ throwError ref ("tactic failed, resulting expression contains metavariables" ++ indentExpr e) + @[inline] def liftMetaTactic (ref : Syntax) (tactic : MVarId → MetaM (List MVarId)) : TacticM Unit := do -s ← get; -(g :: gs) ← pure s.goals | throwError ref "no goals to be solved"; +(g, gs) ← getMainGoal ref; withMVarContext g $ do gs' ← liftMetaM ref $ tactic g; - modify $ fun s => { goals := gs' ++ gs, .. s } + updateGoals (gs' ++ gs) @[builtinTactic seq] def evalSeq : Tactic := fun stx => (stx.getArg 0).forSepArgsM evalTactic @@ -195,6 +204,21 @@ fun stx => match_syntax stx with | `(tactic| intro $h) => liftMetaTactic stx $ fun mvarId => do (_, mvarId) ← Meta.intro mvarId h.getId; pure [mvarId] | _ => throwUnsupportedSyntax +@[builtinTactic «exact»] def evalExact : Tactic := +fun stx => match_syntax stx with + | `(tactic| exact $e) => do + let ref := stx; + (g, gs) ← getMainGoal stx; + withMVarContext g $ do { + decl ← getMVarDecl g; + val ← elabTerm e decl.type; + val ← ensureHasType ref decl.type val; + ensureHasNoMVars ref val; + assignExprMVar g val + }; + updateGoals gs + | _ => throwUnsupportedSyntax + @[init] private def regTraceClasses : IO Unit := do registerTraceClass `Elab.tactic; pure () diff --git a/stage0/src/Init/Lean/Elab/Term.lean b/stage0/src/Init/Lean/Elab/Term.lean index 02a1e77f7f..a7cd5e68a4 100644 --- a/stage0/src/Init/Lean/Elab/Term.lean +++ b/stage0/src/Init/Lean/Elab/Term.lean @@ -571,7 +571,7 @@ match expectedType? with /-- If `expectedType?` is `some t`, then ensure `t` and `eType` are definitionally equal. If they are not, then try coercions. -/ -def ensureHasType (ref : Syntax) (expectedType? : Option Expr) (eType : Expr) (e : Expr) : TermElabM Expr := do +def ensureHasTypeAux (ref : Syntax) (expectedType? : Option Expr) (eType : Expr) (e : Expr) : TermElabM Expr := do e? ← tryEnsureHasType? ref expectedType? eType e; match e? with | some e => pure e @@ -582,6 +582,14 @@ match e? with ++ Format.line ++ "but it is expected to have type" ++ indentExpr expectedType?.get!; throwError ref msg +/-- + If `expectedType?` is `some t`, then ensure `t` and type of `e` are definitionally equal. + If they are not, then try coercions. -/ +def ensureHasType (ref : Syntax) (expectedType? : Option Expr) (e : Expr) : TermElabM Expr := +match expectedType? with +| none => pure e +| _ => do eType ← inferType ref e; ensureHasTypeAux ref expectedType? eType e + /- Try to synthesize metavariable using type class resolution. This method assumes the local context and local instances of `instMVar` coincide with the current local context and local instances. @@ -667,8 +675,7 @@ fun stx expectedType? => | `(($e : $type)) => do type ← elabType type; e ← elabCDot e type; - eType ← inferType ref e; - ensureHasType ref type eType e + ensureHasType ref type e | `(($e)) => elabCDot e expectedType? | `(($e, $es*)) => do pairs ← mkPairs (#[e] ++ es.getEvenElems); diff --git a/stage0/src/Init/Lean/Elab/TermApp.lean b/stage0/src/Init/Lean/Elab/TermApp.lean index f93a5c8186..789fc3f5e0 100644 --- a/stage0/src/Init/Lean/Elab/TermApp.lean +++ b/stage0/src/Init/Lean/Elab/TermApp.lean @@ -66,7 +66,7 @@ private partial def elabAppArgsAux (ref : Syntax) (args : Array Arg) (expectedTy | argIdx, namedArgs, instMVars, eType, e => do let finalize : Unit → TermElabM Expr := fun _ => do { -- all user explicit arguments have been consumed - e ← ensureHasType ref expectedType? eType e; + e ← ensureHasTypeAux ref expectedType? eType e; synthesizeAppInstMVars ref instMVars; pure e }; diff --git a/stage0/src/Init/Lean/Parser/Term.lean b/stage0/src/Init/Lean/Parser/Term.lean index 0026f7756c..02aba4691a 100644 --- a/stage0/src/Init/Lean/Parser/Term.lean +++ b/stage0/src/Init/Lean/Parser/Term.lean @@ -41,6 +41,7 @@ def namedPattern := checkNoWsBefore "no space before '@'" >> parser! "@" >> term @[builtinTermParser] def sort := parser! symbol "Sort" appPrec @[builtinTermParser] def prop := parser! symbol "Prop" appPrec @[builtinTermParser] def hole := parser! symbol "_" appPrec +@[builtinTermParser] def namedHole := parser! symbol "?" appPrec >> ident @[builtinTermParser] def «sorry» := parser! symbol "sorry" appPrec @[builtinTermParser] def cdot := parser! symbol "·" appPrec @[builtinTermParser] def emptyC := parser! symbol "∅" appPrec diff --git a/stage0/src/Init/Lean/Syntax.lean b/stage0/src/Init/Lean/Syntax.lean index f97062bdee..2fa0d4e17a 100644 --- a/stage0/src/Init/Lean/Syntax.lean +++ b/stage0/src/Init/Lean/Syntax.lean @@ -216,6 +216,12 @@ partial def getHeadInfo : Syntax → Option SourceInfo def getPos (stx : Syntax) : Option String.Pos := SourceInfo.pos <$> stx.getHeadInfo +partial def getTailWithInfo : Syntax → Option Syntax +| stx@(atom (some _) _) => some stx +| stx@(ident (some _) _ _ _) => some stx +| node _ args => args.findRev? getTailWithInfo +| _ => none + partial def getTailInfo : Syntax → Option SourceInfo | atom info _ => info | ident info _ _ _ => info diff --git a/stage0/stdlib/Init/Lean/Elab/Definition.c b/stage0/stdlib/Init/Lean/Elab/Definition.c index 3a2bac6a36..9c0aeac188 100644 --- a/stage0/stdlib/Init/Lean/Elab/Definition.c +++ b/stage0/stdlib/Init/Lean/Elab/Definition.c @@ -49,7 +49,7 @@ uint8_t l_Lean_Elab_Command_DefKind_isExample(uint8_t); lean_object* l_Lean_Name_getNumParts___main(lean_object*); extern lean_object* l___private_Init_Lean_Elab_Util_8__regTraceClasses___closed__2; lean_object* lean_nat_add(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_mkFreshTypeMVar(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_getOptions(lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_Basic_3__iterateRevMAux___main___at_Lean_Elab_Command_removeUnused___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -1731,162 +1731,150 @@ _start: lean_object* x_10; lean_object* x_11; lean_object* x_12; x_10 = lean_ctor_get(x_1, 0); lean_inc(x_10); -x_11 = lean_ctor_get(x_1, 5); -lean_inc(x_11); +lean_inc(x_6); +x_11 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_11, 0, x_6); lean_inc(x_8); -lean_inc(x_7); -x_12 = l_Lean_Elab_Term_inferType(x_11, x_7, x_8, x_9); +x_12 = l_Lean_Elab_Term_ensureHasType(x_10, x_11, x_7, x_8, x_9); if (lean_obj_tag(x_12) == 0) { -lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; +lean_object* x_13; lean_object* x_14; uint8_t x_15; lean_object* x_16; lean_object* x_17; x_13 = lean_ctor_get(x_12, 0); lean_inc(x_13); x_14 = lean_ctor_get(x_12, 1); lean_inc(x_14); lean_dec(x_12); -lean_inc(x_6); -x_15 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_15, 0, x_6); +x_15 = 0; +x_16 = lean_box(0); lean_inc(x_8); -x_16 = l_Lean_Elab_Term_ensureHasType(x_10, x_15, x_13, x_7, x_8, x_14); -if (lean_obj_tag(x_16) == 0) +x_17 = l___private_Init_Lean_Elab_SynthesizeSyntheticMVars_10__synthesizeSyntheticMVarsAux___main(x_15, x_16, x_8, x_14); +if (lean_obj_tag(x_17) == 0) { -lean_object* x_17; lean_object* x_18; uint8_t x_19; lean_object* x_20; lean_object* x_21; -x_17 = lean_ctor_get(x_16, 0); -lean_inc(x_17); -x_18 = lean_ctor_get(x_16, 1); +lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; uint8_t x_24; +x_18 = lean_ctor_get(x_17, 1); lean_inc(x_18); -lean_dec(x_16); -x_19 = 0; -x_20 = lean_box(0); -lean_inc(x_8); -x_21 = l___private_Init_Lean_Elab_SynthesizeSyntheticMVars_10__synthesizeSyntheticMVarsAux___main(x_19, x_20, x_8, x_18); -if (lean_obj_tag(x_21) == 0) -{ -lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; uint8_t x_27; -x_22 = lean_ctor_get(x_21, 1); -lean_inc(x_22); -lean_dec(x_21); -lean_inc(x_8); -x_23 = l_Lean_Elab_Term_instantiateMVars(x_10, x_6, x_8, x_22); -x_24 = lean_ctor_get(x_23, 0); -lean_inc(x_24); -x_25 = lean_ctor_get(x_23, 1); -lean_inc(x_25); -lean_dec(x_23); -lean_inc(x_8); -x_26 = l_Lean_Elab_Term_instantiateMVars(x_11, x_17, x_8, x_25); -x_27 = !lean_is_exclusive(x_26); -if (x_27 == 0) -{ -lean_object* x_28; lean_object* x_29; uint8_t x_30; uint8_t x_31; -x_28 = lean_ctor_get(x_26, 0); -x_29 = lean_ctor_get(x_26, 1); -x_30 = lean_ctor_get_uint8(x_1, sizeof(void*)*6); -x_31 = l_Lean_Elab_Command_DefKind_isExample(x_30); -if (x_31 == 0) -{ -uint8_t x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; -lean_free_object(x_26); -x_32 = l_Lean_Elab_Command_DefKind_isDefOrOpaque(x_30); -x_33 = lean_box(x_30); -lean_inc(x_28); -lean_inc(x_24); -lean_inc(x_5); -lean_inc(x_10); -x_34 = lean_alloc_closure((void*)(l_Lean_Elab_Command_mkDef___lambda__1___boxed), 12, 9); -lean_closure_set(x_34, 0, x_10); -lean_closure_set(x_34, 1, x_5); -lean_closure_set(x_34, 2, x_24); -lean_closure_set(x_34, 3, x_28); -lean_closure_set(x_34, 4, x_11); -lean_closure_set(x_34, 5, x_3); -lean_closure_set(x_34, 6, x_33); -lean_closure_set(x_34, 7, x_2); -lean_closure_set(x_34, 8, x_1); -x_35 = l_Lean_Elab_Command_withUsedWhen___rarg(x_10, x_4, x_5, x_28, x_24, x_32, x_34, x_8, x_29); -lean_dec(x_5); -lean_dec(x_10); -return x_35; -} -else -{ -lean_object* x_36; -lean_dec(x_28); -lean_dec(x_24); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_8); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_2); -lean_dec(x_1); -x_36 = lean_box(0); -lean_ctor_set(x_26, 0, x_36); -return x_26; -} -} -else -{ -lean_object* x_37; lean_object* x_38; uint8_t x_39; uint8_t x_40; -x_37 = lean_ctor_get(x_26, 0); -x_38 = lean_ctor_get(x_26, 1); -lean_inc(x_38); -lean_inc(x_37); -lean_dec(x_26); -x_39 = lean_ctor_get_uint8(x_1, sizeof(void*)*6); -x_40 = l_Lean_Elab_Command_DefKind_isExample(x_39); -if (x_40 == 0) -{ -uint8_t x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; -x_41 = l_Lean_Elab_Command_DefKind_isDefOrOpaque(x_39); -x_42 = lean_box(x_39); -lean_inc(x_37); -lean_inc(x_24); -lean_inc(x_5); -lean_inc(x_10); -x_43 = lean_alloc_closure((void*)(l_Lean_Elab_Command_mkDef___lambda__1___boxed), 12, 9); -lean_closure_set(x_43, 0, x_10); -lean_closure_set(x_43, 1, x_5); -lean_closure_set(x_43, 2, x_24); -lean_closure_set(x_43, 3, x_37); -lean_closure_set(x_43, 4, x_11); -lean_closure_set(x_43, 5, x_3); -lean_closure_set(x_43, 6, x_42); -lean_closure_set(x_43, 7, x_2); -lean_closure_set(x_43, 8, x_1); -x_44 = l_Lean_Elab_Command_withUsedWhen___rarg(x_10, x_4, x_5, x_37, x_24, x_41, x_43, x_8, x_38); -lean_dec(x_5); -lean_dec(x_10); -return x_44; -} -else -{ -lean_object* x_45; lean_object* x_46; -lean_dec(x_37); -lean_dec(x_24); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_8); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_2); -lean_dec(x_1); -x_45 = lean_box(0); -x_46 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_46, 0, x_45); -lean_ctor_set(x_46, 1, x_38); -return x_46; -} -} -} -else -{ -uint8_t x_47; lean_dec(x_17); -lean_dec(x_11); +lean_inc(x_8); +x_19 = l_Lean_Elab_Term_instantiateMVars(x_10, x_6, x_8, x_18); +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); +x_22 = lean_ctor_get(x_1, 5); +lean_inc(x_22); +lean_inc(x_8); +x_23 = l_Lean_Elab_Term_instantiateMVars(x_22, x_13, x_8, x_21); +x_24 = !lean_is_exclusive(x_23); +if (x_24 == 0) +{ +lean_object* x_25; lean_object* x_26; uint8_t x_27; uint8_t x_28; +x_25 = lean_ctor_get(x_23, 0); +x_26 = lean_ctor_get(x_23, 1); +x_27 = lean_ctor_get_uint8(x_1, sizeof(void*)*6); +x_28 = l_Lean_Elab_Command_DefKind_isExample(x_27); +if (x_28 == 0) +{ +uint8_t x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; +lean_free_object(x_23); +x_29 = l_Lean_Elab_Command_DefKind_isDefOrOpaque(x_27); +x_30 = lean_box(x_27); +lean_inc(x_25); +lean_inc(x_20); +lean_inc(x_5); +lean_inc(x_10); +x_31 = lean_alloc_closure((void*)(l_Lean_Elab_Command_mkDef___lambda__1___boxed), 12, 9); +lean_closure_set(x_31, 0, x_10); +lean_closure_set(x_31, 1, x_5); +lean_closure_set(x_31, 2, x_20); +lean_closure_set(x_31, 3, x_25); +lean_closure_set(x_31, 4, x_22); +lean_closure_set(x_31, 5, x_3); +lean_closure_set(x_31, 6, x_30); +lean_closure_set(x_31, 7, x_2); +lean_closure_set(x_31, 8, x_1); +x_32 = l_Lean_Elab_Command_withUsedWhen___rarg(x_10, x_4, x_5, x_25, x_20, x_29, x_31, x_8, x_26); +lean_dec(x_5); +lean_dec(x_10); +return x_32; +} +else +{ +lean_object* x_33; +lean_dec(x_25); +lean_dec(x_22); +lean_dec(x_20); +lean_dec(x_10); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_33 = lean_box(0); +lean_ctor_set(x_23, 0, x_33); +return x_23; +} +} +else +{ +lean_object* x_34; lean_object* x_35; uint8_t x_36; uint8_t x_37; +x_34 = lean_ctor_get(x_23, 0); +x_35 = lean_ctor_get(x_23, 1); +lean_inc(x_35); +lean_inc(x_34); +lean_dec(x_23); +x_36 = lean_ctor_get_uint8(x_1, sizeof(void*)*6); +x_37 = l_Lean_Elab_Command_DefKind_isExample(x_36); +if (x_37 == 0) +{ +uint8_t x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; +x_38 = l_Lean_Elab_Command_DefKind_isDefOrOpaque(x_36); +x_39 = lean_box(x_36); +lean_inc(x_34); +lean_inc(x_20); +lean_inc(x_5); +lean_inc(x_10); +x_40 = lean_alloc_closure((void*)(l_Lean_Elab_Command_mkDef___lambda__1___boxed), 12, 9); +lean_closure_set(x_40, 0, x_10); +lean_closure_set(x_40, 1, x_5); +lean_closure_set(x_40, 2, x_20); +lean_closure_set(x_40, 3, x_34); +lean_closure_set(x_40, 4, x_22); +lean_closure_set(x_40, 5, x_3); +lean_closure_set(x_40, 6, x_39); +lean_closure_set(x_40, 7, x_2); +lean_closure_set(x_40, 8, x_1); +x_41 = l_Lean_Elab_Command_withUsedWhen___rarg(x_10, x_4, x_5, x_34, x_20, x_38, x_40, x_8, x_35); +lean_dec(x_5); +lean_dec(x_10); +return x_41; +} +else +{ +lean_object* x_42; lean_object* x_43; +lean_dec(x_34); +lean_dec(x_22); +lean_dec(x_20); +lean_dec(x_10); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_42 = lean_box(0); +x_43 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_43, 0, x_42); +lean_ctor_set(x_43, 1, x_35); +return x_43; +} +} +} +else +{ +uint8_t x_44; +lean_dec(x_13); lean_dec(x_10); lean_dec(x_8); lean_dec(x_6); @@ -1895,30 +1883,29 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_47 = !lean_is_exclusive(x_21); -if (x_47 == 0) +x_44 = !lean_is_exclusive(x_17); +if (x_44 == 0) { -return x_21; +return x_17; } else { -lean_object* x_48; lean_object* x_49; lean_object* x_50; -x_48 = lean_ctor_get(x_21, 0); -x_49 = lean_ctor_get(x_21, 1); -lean_inc(x_49); -lean_inc(x_48); -lean_dec(x_21); -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; +lean_object* x_45; lean_object* x_46; lean_object* x_47; +x_45 = lean_ctor_get(x_17, 0); +x_46 = lean_ctor_get(x_17, 1); +lean_inc(x_46); +lean_inc(x_45); +lean_dec(x_17); +x_47 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_47, 0, x_45); +lean_ctor_set(x_47, 1, x_46); +return x_47; } } } else { -uint8_t x_51; -lean_dec(x_11); +uint8_t x_48; lean_dec(x_10); lean_dec(x_8); lean_dec(x_6); @@ -1927,56 +1914,23 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_51 = !lean_is_exclusive(x_16); -if (x_51 == 0) -{ -return x_16; -} -else -{ -lean_object* x_52; lean_object* x_53; lean_object* x_54; -x_52 = lean_ctor_get(x_16, 0); -x_53 = lean_ctor_get(x_16, 1); -lean_inc(x_53); -lean_inc(x_52); -lean_dec(x_16); -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_11); -lean_dec(x_10); -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_55 = !lean_is_exclusive(x_12); -if (x_55 == 0) +x_48 = !lean_is_exclusive(x_12); +if (x_48 == 0) { return x_12; } else { -lean_object* x_56; lean_object* x_57; lean_object* x_58; -x_56 = lean_ctor_get(x_12, 0); -x_57 = lean_ctor_get(x_12, 1); -lean_inc(x_57); -lean_inc(x_56); +lean_object* x_49; lean_object* x_50; lean_object* x_51; +x_49 = lean_ctor_get(x_12, 0); +x_50 = lean_ctor_get(x_12, 1); +lean_inc(x_50); +lean_inc(x_49); lean_dec(x_12); -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; +x_51 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_51, 0, x_49); +lean_ctor_set(x_51, 1, x_50); +return x_51; } } } diff --git a/stage0/stdlib/Init/Lean/Elab/Syntax.c b/stage0/stdlib/Init/Lean/Elab/Syntax.c index b3a28bf77e..9661b964aa 100644 --- a/stage0/stdlib/Init/Lean/Elab/Syntax.c +++ b/stage0/stdlib/Init/Lean/Elab/Syntax.c @@ -18,6 +18,7 @@ lean_object* l_Lean_Elab_Command_elabSyntax___closed__11; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__95; extern lean_object* l_Lean_Parser_Syntax_many___elambda__1___closed__1; lean_object* l_Lean_Elab_Term_getEnv___rarg(lean_object*); +extern lean_object* l_Lean_Name_toString___closed__1; lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Elab_Syntax_2__mkParserSeq___spec__1___closed__2; lean_object* l_Lean_Elab_Command_elabNotation___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__24; @@ -28,9 +29,9 @@ extern lean_object* l_Lean_Parser_Term_andthen___elambda__1___closed__1; lean_object* l_Array_umapMAux___main___at___private_Init_Lean_Elab_Syntax_8__antiquote___main___spec__2(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabNotation___lambda__1___closed__4; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__116; +lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__12; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__7; -lean_object* l_Lean_Elab_Command_elabNotation___lambda__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_isNatLitAux(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Syntax_many___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_getOptions(lean_object*, lean_object*); @@ -46,6 +47,7 @@ extern lean_object* l_Lean_Parser_Syntax_many1___elambda__1___closed__1; lean_object* l___private_Init_Lean_Elab_Syntax_1__expandOptPrecedence(lean_object*); extern lean_object* l_Lean_Elab_Term_elabArrayLit___closed__13; lean_object* l_Lean_mkTermIdFromIdent(lean_object*); +lean_object* l_Lean_Elab_Command_expandMacroArgIntoSyntaxItem(lean_object*, lean_object*, lean_object*); lean_object* l_unreachable_x21___rarg(lean_object*); extern lean_object* l_Lean_nullKind; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__26; @@ -63,6 +65,7 @@ lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabReserve___closed__1 lean_object* l_Lean_Syntax_getIdAt(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Syntax_paren___elambda__1___closed__3; extern lean_object* l_Lean_nameToExprAux___main___closed__4; +lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__3; lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_fswap(lean_object*, lean_object*, lean_object*); extern uint8_t l___private_Init_Lean_Elab_Term_4__isCDot___closed__1; @@ -70,6 +73,7 @@ extern lean_object* l_Lean_Elab_Command_runTermElabM___rarg___closed__1; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__3; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__15; lean_object* l_Lean_Elab_Command_elabSyntax___closed__7; +lean_object* l_Lean_Elab_Command_expandMacroArgIntoPattern(lean_object*, lean_object*, lean_object*); extern lean_object* l_PersistentHashMap_mkCollisionNode___rarg___closed__1; extern lean_object* l_Lean_Parser_Syntax_orelse___elambda__1___closed__1; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__101; @@ -86,6 +90,7 @@ extern lean_object* l_Lean_Parser_Command_declaration___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__21; extern lean_object* l_Lean_Parser_Level_num___elambda__1___closed__1; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__19; +lean_object* l_Lean_Elab_Command_strLitPrecToPattern___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkIdentFrom(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_Syntax_3__getMode(lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_Command_8__getVarDecls(lean_object*); @@ -99,10 +104,12 @@ lean_object* lean_array_get_size(lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__51; extern lean_object* l___private_Init_Lean_Elab_TermBinders_10__expandFunBindersAux___main___closed__7; extern lean_object* l_Lean_Parser_Term_num___elambda__1___closed__1; +lean_object* l_Lean_Elab_Command_strLitPrecToPattern(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabNotation___closed__1; lean_object* l_Lean_Elab_Command_elabSyntax___closed__20; extern lean_object* l_Lean_Elab_mkMacroAttribute___closed__3; lean_object* l_Array_findIdxAux___main___at___private_Init_Lean_Elab_Syntax_8__antiquote___main___spec__4(lean_object*, lean_object*, lean_object*); +lean_object* l___private_Init_Lean_Elab_Syntax_9__regTraceClasses(lean_object*); lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabDeclareSyntaxCat___closed__2; lean_object* l_Lean_Elab_Term_toParserDescrAux(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__81; @@ -119,6 +126,7 @@ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__32; lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__3(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabSyntax___closed__10; extern lean_object* l_Lean_Parser_Command_mixfix___elambda__1___closed__2; +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__16; lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabSyntax___closed__1; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__43; @@ -154,10 +162,12 @@ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__115; lean_object* l_Array_umapMAux___main___at_Lean_Elab_Term_toParserDescrAux___main___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabMacroRules___closed__3; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__85; +lean_object* l_Lean_Elab_Command_elabMacro___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__100; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__53; lean_object* l___private_Init_Lean_Elab_Syntax_8__antiquote___main___closed__1; lean_object* l___private_Init_Lean_Elab_Syntax_8__antiquote___main___boxed(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoPattern(lean_object*, lean_object*, lean_object*); lean_object* l_Array_umapMAux___main___at_Lean_Elab_Term_toParserDescrAux___main___spec__2(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); extern lean_object* l_Lean_Syntax_getKind___closed__4; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__42; @@ -184,6 +194,7 @@ lean_object* l_Lean_Elab_Command_elabNotation___lambda__1___closed__3; lean_object* l_Lean_Syntax_isStrLit_x3f(lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__13; lean_object* l_Lean_Elab_Command_elabSyntax___closed__6; +lean_object* l_Lean_Elab_Command_expandMacroArgIntoPattern___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Name_append___main(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_expandNotationItemIntoPattern(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__14; @@ -233,6 +244,7 @@ lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__33; lean_object* l_Lean_Elab_Command_elabSyntax___closed__22; extern lean_object* l_Lean_Parser_Term_fun___elambda__1___closed__2; +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__25; extern lean_object* l___regBuiltinParser_Lean_Parser_Command_antiquot___closed__2; lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Elab_Syntax_2__mkParserSeq___spec__1___closed__1; @@ -273,8 +285,10 @@ lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__27; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__25; lean_object* l_Lean_Elab_Command_elabSyntax___closed__3; lean_object* l_Array_umapMAux___main___at___private_Init_Lean_Elab_Syntax_8__antiquote___main___spec__3(lean_object*, lean_object*, lean_object*); +extern lean_object* l_Lean_Parser_Command_macroArgSimple___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__9; extern lean_object* l_Lean_Parser_Syntax_sepBy___elambda__1___closed__1; +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__52; lean_object* l___private_Init_Lean_Elab_Syntax_4__markAsTrailingParser___rarg(lean_object*); lean_object* l___private_Init_Lean_Elab_Syntax_7__elabKind(lean_object*, lean_object*, lean_object*, lean_object*); @@ -282,10 +296,12 @@ lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabSyntax(lean_object* lean_object* l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__34; extern lean_object* l_Lean_Parser_Command_declModifiers___elambda__1___closed__2; +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoSyntaxItem___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__117; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__77; extern lean_object* l_Lean_Parser_dollarSymbol___elambda__1___rarg___closed__1; extern lean_object* l_Lean_Parser_Command_notation___elambda__1___closed__2; +lean_object* l_Lean_Elab_Command_elabMacro(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_nullKind___closed__2; extern lean_object* l_Lean_Parser_Term_str___elambda__1___closed__1; extern lean_object* l_Lean_Unhygienic_MonadQuotation___closed__1; @@ -294,6 +310,7 @@ extern lean_object* l_Lean_Parser_Syntax_lookahead___elambda__1___closed__1; extern lean_object* l_Lean_Parser_Syntax_sepBy1___elambda__1___closed__2; lean_object* l_Lean_mkAtomFrom(lean_object*, lean_object*); lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabMixfix___closed__3; +lean_object* l_Lean_Syntax_getHeadInfo___main(lean_object*); extern lean_object* l_Lean_Parser_regBuiltinTermParserAttr___closed__4; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__108; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__7; @@ -321,15 +338,18 @@ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__90; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__76; lean_object* l_Lean_Elab_Command_elabSyntax___closed__17; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__18; +lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro(lean_object*); extern lean_object* l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__57; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__3; extern lean_object* l_Lean_Parser_Syntax_sepBy1___elambda__1___closed__1; +lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__2; lean_object* l_Array_umapMAux___main___at___private_Init_Lean_Elab_Syntax_8__antiquote___main___spec__5(lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Parser_isParserCategory(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__10; lean_object* l_Lean_Elab_Command_getCurrMacroScope(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_Syntax_7__elabKind___boxed(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Term_elabArrayLit___closed__12; +lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__1; extern lean_object* l_Lean_Syntax_asNode___closed__1; extern lean_object* l_Lean_Parser_Syntax_optional___elambda__1___closed__2; lean_object* l___private_Init_Lean_Elab_Syntax_4__markAsTrailingParser___boxed(lean_object*, lean_object*, lean_object*); @@ -355,6 +375,7 @@ lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec_ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__64; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__1; lean_object* l___private_Init_Lean_Elab_Syntax_1__expandOptPrecedence___boxed(lean_object*); +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__2(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabSyntax___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__2; @@ -423,32 +444,40 @@ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__50; lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__6; extern lean_object* l_Lean_Parser_Command_optDeclSig___elambda__1___closed__2; +lean_object* l_Lean_Elab_Command_elabMacro___closed__1; extern lean_object* l_Lean_Parser_Command_quotedSymbolPrec___elambda__1___closed__2; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__99; extern lean_object* l_Lean_Parser_Term_typeSpec___elambda__1___closed__2; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__11; extern lean_object* l_Lean_Meta_DiscrTree_Trie_format___main___rarg___closed__1; +lean_object* l_Lean_Elab_Command_mkFreshKind(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMixfix(lean_object*, lean_object*); lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabNotation___closed__1; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__28; lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoSyntaxItem(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__14; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__18; +lean_object* l_Lean_Name_toStringWithSep___main(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__106; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__24; +lean_object* l_Lean_Elab_Command_elabMacro___lambda__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__21; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__38; +extern lean_object* l_Lean_Parser_Command_macro___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_elabSyntax___closed__12; extern lean_object* l_Lean_Elab_mkMacroAttribute___closed__2; lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__26; extern lean_object* l___private_Init_Lean_Elab_Quotation_3__quoteOption___rarg___closed__4; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__88; +lean_object* l_Lean_Elab_Command_elabMacro___lambda__1___closed__1; extern lean_object* l_Lean_Parser_Syntax_sepBy___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_elabSyntax___closed__26; lean_object* l_Array_umapMAux___main___at___private_Init_Lean_Elab_Syntax_8__antiquote___main___spec__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__107; lean_object* l_Lean_Elab_Command_elabMacroRules___lambda__1___closed__5; +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoPattern___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__72; extern lean_object* l_Lean_Parser_Term_stxQuot___elambda__1___closed__5; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__96; @@ -468,6 +497,7 @@ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__35; extern lean_object* l_Lean_Parser_mkAntiquot___closed__2; extern lean_object* l_Lean_Parser_Term_orelse___elambda__1___closed__1; lean_object* lean_name_mk_numeral(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Command_expandMacroArgIntoSyntaxItem___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Array_umapMAux___main___at___private_Init_Lean_Elab_Syntax_8__antiquote___main___spec__2___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDeclareSyntaxCat(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Syntax_try___elambda__1___closed__2; @@ -6134,6 +6164,101 @@ x_5 = l_Lean_Elab_Command_addBuiltinCommandElab(x_2, x_3, x_4, x_1); return x_5; } } +lean_object* l_Lean_Elab_Command_mkFreshKind(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +lean_inc(x_2); +x_4 = l_Lean_Elab_Command_getEnv(x_2, x_3); +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); +lean_dec(x_4); +x_7 = l_Lean_Parser_mkFreshKind(x_5, x_1); +x_8 = lean_ctor_get(x_7, 0); +lean_inc(x_8); +x_9 = lean_ctor_get(x_7, 1); +lean_inc(x_9); +lean_dec(x_7); +x_10 = l_Lean_Elab_Command_setEnv(x_8, x_2, x_6); +if (lean_obj_tag(x_10) == 0) +{ +uint8_t x_11; +x_11 = !lean_is_exclusive(x_10); +if (x_11 == 0) +{ +lean_object* x_12; +x_12 = lean_ctor_get(x_10, 0); +lean_dec(x_12); +lean_ctor_set(x_10, 0, x_9); +return x_10; +} +else +{ +lean_object* x_13; lean_object* x_14; +x_13 = lean_ctor_get(x_10, 1); +lean_inc(x_13); +lean_dec(x_10); +x_14 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_14, 0, x_9); +lean_ctor_set(x_14, 1, x_13); +return x_14; +} +} +else +{ +uint8_t x_15; +lean_dec(x_9); +x_15 = !lean_is_exclusive(x_10); +if (x_15 == 0) +{ +return x_10; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_10, 0); +x_17 = lean_ctor_get(x_10, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_10); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +else +{ +uint8_t x_19; +lean_dec(x_2); +lean_dec(x_1); +x_19 = !lean_is_exclusive(x_4); +if (x_19 == 0) +{ +return x_4; +} +else +{ +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_4, 0); +x_21 = lean_ctor_get(x_4, 1); +lean_inc(x_21); +lean_inc(x_20); +lean_dec(x_4); +x_22 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_22, 0, x_20); +lean_ctor_set(x_22, 1, x_21); +return x_22; +} +} +} +} lean_object* l___private_Init_Lean_Elab_Syntax_7__elabKind(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { @@ -6202,96 +6327,9 @@ return x_19; else { lean_object* x_20; -lean_inc(x_3); -x_20 = l_Lean_Elab_Command_getEnv(x_3, x_4); -if (lean_obj_tag(x_20) == 0) -{ -lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; -x_21 = lean_ctor_get(x_20, 0); -lean_inc(x_21); -x_22 = lean_ctor_get(x_20, 1); -lean_inc(x_22); -lean_dec(x_20); -x_23 = l_Lean_Parser_mkFreshKind(x_21, x_2); -x_24 = lean_ctor_get(x_23, 0); -lean_inc(x_24); -x_25 = lean_ctor_get(x_23, 1); -lean_inc(x_25); -lean_dec(x_23); -x_26 = l_Lean_Elab_Command_setEnv(x_24, x_3, x_22); -if (lean_obj_tag(x_26) == 0) -{ -uint8_t x_27; -x_27 = !lean_is_exclusive(x_26); -if (x_27 == 0) -{ -lean_object* x_28; -x_28 = lean_ctor_get(x_26, 0); -lean_dec(x_28); -lean_ctor_set(x_26, 0, x_25); -return x_26; -} -else -{ -lean_object* x_29; lean_object* x_30; -x_29 = lean_ctor_get(x_26, 1); -lean_inc(x_29); -lean_dec(x_26); -x_30 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_30, 0, x_25); -lean_ctor_set(x_30, 1, x_29); -return x_30; -} -} -else -{ -uint8_t x_31; -lean_dec(x_25); -x_31 = !lean_is_exclusive(x_26); -if (x_31 == 0) -{ -return x_26; -} -else -{ -lean_object* x_32; lean_object* x_33; lean_object* x_34; -x_32 = lean_ctor_get(x_26, 0); -x_33 = lean_ctor_get(x_26, 1); -lean_inc(x_33); -lean_inc(x_32); -lean_dec(x_26); -x_34 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_34, 0, x_32); -lean_ctor_set(x_34, 1, x_33); -return x_34; -} -} -} -else -{ -uint8_t x_35; -lean_dec(x_3); -lean_dec(x_2); -x_35 = !lean_is_exclusive(x_20); -if (x_35 == 0) -{ +x_20 = l_Lean_Elab_Command_mkFreshKind(x_2, x_3, x_4); return x_20; } -else -{ -lean_object* x_36; lean_object* x_37; lean_object* x_38; -x_36 = lean_ctor_get(x_20, 0); -x_37 = lean_ctor_get(x_20, 1); -lean_inc(x_37); -lean_inc(x_36); -lean_dec(x_20); -x_38 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_38, 0, x_36); -lean_ctor_set(x_38, 1, x_37); -return x_38; -} -} -} } } lean_object* l___private_Init_Lean_Elab_Syntax_7__elabKind___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { @@ -10067,6 +10105,47 @@ lean_dec(x_2); return x_4; } } +lean_object* l_Lean_Elab_Command_strLitPrecToPattern(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; lean_object* x_6; +x_4 = lean_unsigned_to_nat(0u); +x_5 = l_Lean_Syntax_getArg(x_1, x_4); +x_6 = l_Lean_Syntax_isStrLit_x3f(x_5); +lean_dec(x_5); +if (lean_obj_tag(x_6) == 0) +{ +lean_object* x_7; lean_object* x_8; +x_7 = lean_box(1); +x_8 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_8, 0, x_7); +lean_ctor_set(x_8, 1, x_3); +return x_8; +} +else +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; +x_9 = lean_ctor_get(x_6, 0); +lean_inc(x_9); +lean_dec(x_6); +x_10 = l_Lean_mkAtomFrom(x_1, x_9); +x_11 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_11, 0, x_10); +lean_ctor_set(x_11, 1, x_3); +return x_11; +} +} +} +lean_object* l_Lean_Elab_Command_strLitPrecToPattern___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Command_strLitPrecToPattern(x_1, x_2, x_3); +lean_dec(x_2); +lean_dec(x_1); +return x_4; +} +} lean_object* l_Lean_Elab_Command_expandNotationItemIntoPattern(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { @@ -10098,73 +10177,49 @@ return x_12; } else { -lean_object* x_13; lean_object* x_14; lean_object* x_15; -x_13 = lean_unsigned_to_nat(0u); -x_14 = l_Lean_Syntax_getArg(x_1, x_13); -x_15 = l_Lean_Syntax_isStrLit_x3f(x_14); -lean_dec(x_14); -if (lean_obj_tag(x_15) == 0) -{ -lean_object* x_16; lean_object* x_17; +lean_object* x_13; +x_13 = l_Lean_Elab_Command_strLitPrecToPattern(x_1, x_2, x_3); lean_dec(x_1); -x_16 = lean_box(1); -x_17 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_17, 0, x_16); -lean_ctor_set(x_17, 1, x_3); -return x_17; +return x_13; +} } else { -lean_object* x_18; lean_object* x_19; lean_object* x_20; -x_18 = lean_ctor_get(x_15, 0); -lean_inc(x_18); +lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; +lean_dec(x_4); +x_14 = lean_unsigned_to_nat(0u); +x_15 = l_Lean_Syntax_getArg(x_1, x_14); +lean_dec(x_1); +x_16 = lean_unsigned_to_nat(1u); +x_17 = l_Lean_Syntax_getArg(x_15, x_16); lean_dec(x_15); -x_19 = l_Lean_mkAtomFrom(x_1, x_18); -lean_dec(x_1); -x_20 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_20, 0, x_19); -lean_ctor_set(x_20, 1, x_3); -return x_20; -} -} -} -else -{ -lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; -lean_dec(x_4); -x_21 = lean_unsigned_to_nat(0u); -x_22 = l_Lean_Syntax_getArg(x_1, x_21); -lean_dec(x_1); -x_23 = lean_unsigned_to_nat(1u); -x_24 = l_Lean_Syntax_getArg(x_22, x_23); -lean_dec(x_22); -x_25 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_25, 0, x_24); -lean_ctor_set(x_25, 1, x_3); -return x_25; +x_18 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_18, 0, x_17); +lean_ctor_set(x_18, 1, x_3); +return x_18; } } else { -lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; +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; lean_dec(x_4); -x_26 = lean_unsigned_to_nat(0u); -x_27 = l_Lean_Syntax_getArg(x_1, x_26); +x_19 = lean_unsigned_to_nat(0u); +x_20 = l_Lean_Syntax_getArg(x_1, x_19); lean_dec(x_1); -x_28 = l_Lean_mkTermIdFromIdent(x_27); -x_29 = l___private_Init_Lean_Elab_Syntax_8__antiquote___main___closed__2; -x_30 = lean_array_push(x_29, x_28); -x_31 = l_Lean_Syntax_asNode___closed__1; -x_32 = lean_array_push(x_30, x_31); -x_33 = lean_array_push(x_32, x_31); -x_34 = l_Lean_Parser_mkAntiquot___closed__2; -x_35 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_35, 0, x_34); -lean_ctor_set(x_35, 1, x_33); -x_36 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_36, 0, x_35); -lean_ctor_set(x_36, 1, x_3); -return x_36; +x_21 = l_Lean_mkTermIdFromIdent(x_20); +x_22 = l___private_Init_Lean_Elab_Syntax_8__antiquote___main___closed__2; +x_23 = lean_array_push(x_22, x_21); +x_24 = l_Lean_Syntax_asNode___closed__1; +x_25 = lean_array_push(x_23, x_24); +x_26 = lean_array_push(x_25, x_24); +x_27 = l_Lean_Parser_mkAntiquot___closed__2; +x_28 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_28, 0, x_27); +lean_ctor_set(x_28, 1, x_26); +x_29 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_29, 0, x_28); +lean_ctor_set(x_29, 1, x_3); +return x_29; } } } @@ -10500,36 +10555,37 @@ return x_3; lean_object* l_Lean_Elab_Command_elabNotation___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { -uint8_t x_4; lean_object* x_136; uint8_t x_137; -x_136 = l_Lean_Parser_Command_notation___elambda__1___closed__2; +uint8_t x_4; lean_object* x_138; uint8_t x_139; +x_138 = l_Lean_Parser_Command_notation___elambda__1___closed__2; lean_inc(x_1); -x_137 = l_Lean_Syntax_isOfKind(x_1, x_136); -if (x_137 == 0) +x_139 = l_Lean_Syntax_isOfKind(x_1, x_138); +if (x_139 == 0) { -uint8_t x_138; -x_138 = 0; -x_4 = x_138; -goto block_135; +uint8_t x_140; +x_140 = 0; +x_4 = x_140; +goto block_137; } else { -lean_object* x_139; lean_object* x_140; lean_object* x_141; uint8_t x_142; -x_139 = l_Lean_Syntax_getArgs(x_1); -x_140 = lean_array_get_size(x_139); -lean_dec(x_139); -x_141 = lean_unsigned_to_nat(4u); -x_142 = lean_nat_dec_eq(x_140, x_141); -lean_dec(x_140); -x_4 = x_142; -goto block_135; +lean_object* x_141; lean_object* x_142; lean_object* x_143; uint8_t x_144; +x_141 = l_Lean_Syntax_getArgs(x_1); +x_142 = lean_array_get_size(x_141); +lean_dec(x_141); +x_143 = lean_unsigned_to_nat(4u); +x_144 = lean_nat_dec_eq(x_142, x_143); +lean_dec(x_142); +x_4 = x_144; +goto block_137; } -block_135: +block_137: { uint8_t x_5; x_5 = l_coeDecidableEq(x_4); if (x_5 == 0) { lean_object* x_6; lean_object* x_7; +lean_dec(x_2); lean_dec(x_1); x_6 = lean_box(1); x_7 = lean_alloc_ctor(1, 2, 0); @@ -10546,252 +10602,286 @@ x_10 = lean_unsigned_to_nat(3u); x_11 = l_Lean_Syntax_getArg(x_1, x_10); x_12 = l_Lean_Syntax_getArgs(x_9); lean_dec(x_9); -x_13 = lean_unsigned_to_nat(0u); -lean_inc(x_12); -x_14 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__1(x_13, x_12, x_2, x_3); +x_13 = l_Lean_Parser_regBuiltinTermParserAttr___closed__4; +lean_inc(x_2); +x_14 = l_Lean_Elab_Command_mkFreshKind(x_13, x_2, x_3); if (lean_obj_tag(x_14) == 0) { -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_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; 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_Parser_regBuiltinTermParserAttr___closed__4; -x_18 = l_Lean_mkIdentFrom(x_1, x_17); -x_19 = l___regBuiltinParser_Lean_Parser_Command_antiquot___closed__2; +x_17 = lean_unsigned_to_nat(0u); lean_inc(x_12); -x_20 = l_Array_filterAux___main___at_Lean_Elab_Command_elabNotation___spec__2(x_19, x_12, x_13, x_13); -x_21 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__3(x_13, x_20); -x_22 = l___private_Init_Lean_Elab_Syntax_8__antiquote___main(x_21, x_11); -lean_dec(x_21); -x_23 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__4(x_13, x_12, x_2, x_16); -if (lean_obj_tag(x_23) == 0) +x_18 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__1(x_17, x_12, x_2, x_16); +if (lean_obj_tag(x_18) == 0) { -lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33; -x_24 = lean_ctor_get(x_23, 0); -lean_inc(x_24); -x_25 = lean_ctor_get(x_23, 1); -lean_inc(x_25); -lean_dec(x_23); -x_26 = l_Lean_Elab_Command_getCurrMacroScope(x_2, x_25); +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; +x_19 = lean_ctor_get(x_18, 0); +lean_inc(x_19); +x_20 = lean_ctor_get(x_18, 1); +lean_inc(x_20); +lean_dec(x_18); +x_21 = l_Lean_mkIdentFrom(x_1, x_13); +x_22 = l___regBuiltinParser_Lean_Parser_Command_antiquot___closed__2; +lean_inc(x_12); +x_23 = l_Array_filterAux___main___at_Lean_Elab_Command_elabNotation___spec__2(x_22, x_12, x_17, x_17); +x_24 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__3(x_17, x_23); +x_25 = l___private_Init_Lean_Elab_Syntax_8__antiquote___main(x_24, x_11); +lean_dec(x_24); +x_26 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabNotation___spec__4(x_17, x_12, x_2, x_20); +if (lean_obj_tag(x_26) == 0) +{ +lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31; x_27 = lean_ctor_get(x_26, 0); lean_inc(x_27); x_28 = lean_ctor_get(x_26, 1); lean_inc(x_28); lean_dec(x_26); -x_29 = l_Lean_Elab_Command_elabSyntax___closed__14; -x_30 = lean_name_mk_numeral(x_29, x_27); -lean_inc(x_30); -x_31 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_31, 0, x_30); -lean_ctor_set(x_31, 1, x_24); -x_32 = l_Lean_Elab_Command_getCurrMacroScope(x_2, x_28); -x_33 = !lean_is_exclusive(x_32); -if (x_33 == 0) +lean_inc(x_15); +x_29 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_29, 0, x_15); +lean_ctor_set(x_29, 1, x_27); +x_30 = l_Lean_Elab_Command_getCurrMacroScope(x_2, x_28); +lean_dec(x_2); +x_31 = !lean_is_exclusive(x_30); +if (x_31 == 0) { -lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; 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; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; 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; -x_34 = lean_ctor_get(x_32, 0); -lean_dec(x_34); -x_35 = l_Lean_mkIdentFrom(x_1, x_30); -lean_dec(x_1); -x_36 = l_Lean_Elab_Term_elabArrayLit___closed__12; -x_37 = lean_array_push(x_36, x_35); -x_38 = l_Lean_Elab_Term_elabArrayLit___closed__13; -x_39 = lean_array_push(x_37, x_38); -x_40 = l_Lean_nullKind___closed__2; -x_41 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_41, 0, x_40); -lean_ctor_set(x_41, 1, x_39); -x_42 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__2; -x_43 = lean_array_push(x_42, x_41); -x_44 = l_Array_empty___closed__1; -x_45 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_15, x_15, x_13, x_44); -lean_dec(x_15); -x_46 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_46, 0, x_40); -lean_ctor_set(x_46, 1, x_45); -x_47 = lean_array_push(x_43, x_46); -x_48 = l_Lean_Elab_Term_elabArrow___lambda__1___closed__5; -x_49 = lean_array_push(x_47, x_48); -x_50 = lean_array_push(x_49, x_18); -x_51 = l_Lean_Parser_Command_syntax___elambda__1___closed__1; -x_52 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_52, 0, x_51); -lean_ctor_set(x_52, 1, x_50); -x_53 = lean_array_push(x_44, x_52); -x_54 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__6; -x_55 = lean_array_push(x_54, x_31); -x_56 = l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__57; -x_57 = lean_array_push(x_55, x_56); -x_58 = l_Lean_Parser_Term_stxQuot___elambda__1___closed__2; -x_59 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_59, 0, x_58); -lean_ctor_set(x_59, 1, x_57); -x_60 = lean_array_push(x_44, x_59); -x_61 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_61, 0, x_40); -lean_ctor_set(x_61, 1, x_60); -x_62 = l___private_Init_Lean_Elab_TermBinders_10__expandFunBindersAux___main___closed__7; -x_63 = lean_array_push(x_62, x_61); -x_64 = l_Lean_Elab_Term_expandCDot_x3f___closed__3; -x_65 = lean_array_push(x_63, x_64); -x_66 = lean_array_push(x_54, x_22); -x_67 = lean_array_push(x_66, x_56); -x_68 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_68, 0, x_58); -lean_ctor_set(x_68, 1, x_67); -x_69 = lean_array_push(x_65, x_68); -x_70 = l_Lean_Parser_Term_matchAlt___elambda__1___closed__2; -x_71 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_71, 0, x_70); -lean_ctor_set(x_71, 1, x_69); -x_72 = lean_array_push(x_44, x_71); -x_73 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_73, 0, x_40); -lean_ctor_set(x_73, 1, x_72); -x_74 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__4; -x_75 = lean_array_push(x_74, x_73); -x_76 = l_Lean_Parser_Command_macro__rules___elambda__1___closed__2; -x_77 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_77, 0, x_76); -lean_ctor_set(x_77, 1, x_75); -x_78 = lean_array_push(x_53, x_77); -x_79 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_79, 0, x_40); -lean_ctor_set(x_79, 1, x_78); -lean_ctor_set(x_32, 0, x_79); -return x_32; -} -else -{ -lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_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; 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_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; lean_object* x_126; -x_80 = lean_ctor_get(x_32, 1); -lean_inc(x_80); +lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; 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; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; 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; +x_32 = lean_ctor_get(x_30, 0); lean_dec(x_32); -x_81 = l_Lean_mkIdentFrom(x_1, x_30); +x_33 = l_Lean_mkIdentFrom(x_1, x_15); lean_dec(x_1); -x_82 = l_Lean_Elab_Term_elabArrayLit___closed__12; -x_83 = lean_array_push(x_82, x_81); -x_84 = l_Lean_Elab_Term_elabArrayLit___closed__13; -x_85 = lean_array_push(x_83, x_84); -x_86 = l_Lean_nullKind___closed__2; -x_87 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_87, 0, x_86); -lean_ctor_set(x_87, 1, x_85); -x_88 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__2; -x_89 = lean_array_push(x_88, x_87); -x_90 = l_Array_empty___closed__1; -x_91 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_15, x_15, x_13, x_90); -lean_dec(x_15); -x_92 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_92, 0, x_86); -lean_ctor_set(x_92, 1, x_91); -x_93 = lean_array_push(x_89, x_92); -x_94 = l_Lean_Elab_Term_elabArrow___lambda__1___closed__5; -x_95 = lean_array_push(x_93, x_94); -x_96 = lean_array_push(x_95, x_18); -x_97 = l_Lean_Parser_Command_syntax___elambda__1___closed__1; -x_98 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_98, 0, x_97); -lean_ctor_set(x_98, 1, x_96); -x_99 = lean_array_push(x_90, x_98); -x_100 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__6; -x_101 = lean_array_push(x_100, x_31); -x_102 = l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__57; -x_103 = lean_array_push(x_101, x_102); -x_104 = l_Lean_Parser_Term_stxQuot___elambda__1___closed__2; +x_34 = l_Lean_Elab_Term_elabArrayLit___closed__12; +x_35 = lean_array_push(x_34, x_33); +x_36 = l_Lean_Elab_Term_elabArrayLit___closed__13; +x_37 = lean_array_push(x_35, x_36); +x_38 = l_Lean_nullKind___closed__2; +x_39 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_39, 0, x_38); +lean_ctor_set(x_39, 1, x_37); +x_40 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__2; +x_41 = lean_array_push(x_40, x_39); +x_42 = l_Array_empty___closed__1; +x_43 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_19, x_19, x_17, x_42); +lean_dec(x_19); +x_44 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_44, 0, x_38); +lean_ctor_set(x_44, 1, x_43); +x_45 = lean_array_push(x_41, x_44); +x_46 = l_Lean_Elab_Term_elabArrow___lambda__1___closed__5; +x_47 = lean_array_push(x_45, x_46); +x_48 = lean_array_push(x_47, x_21); +x_49 = l_Lean_Parser_Command_syntax___elambda__1___closed__1; +x_50 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_50, 0, x_49); +lean_ctor_set(x_50, 1, x_48); +x_51 = lean_array_push(x_42, x_50); +x_52 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__6; +x_53 = lean_array_push(x_52, x_29); +x_54 = l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__57; +x_55 = lean_array_push(x_53, x_54); +x_56 = l_Lean_Parser_Term_stxQuot___elambda__1___closed__2; +x_57 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_57, 0, x_56); +lean_ctor_set(x_57, 1, x_55); +x_58 = lean_array_push(x_42, x_57); +x_59 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_59, 0, x_38); +lean_ctor_set(x_59, 1, x_58); +x_60 = l___private_Init_Lean_Elab_TermBinders_10__expandFunBindersAux___main___closed__7; +x_61 = lean_array_push(x_60, x_59); +x_62 = l_Lean_Elab_Term_expandCDot_x3f___closed__3; +x_63 = lean_array_push(x_61, x_62); +x_64 = lean_array_push(x_52, x_25); +x_65 = lean_array_push(x_64, x_54); +x_66 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_66, 0, x_56); +lean_ctor_set(x_66, 1, x_65); +x_67 = lean_array_push(x_63, x_66); +x_68 = l_Lean_Parser_Term_matchAlt___elambda__1___closed__2; +x_69 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_69, 0, x_68); +lean_ctor_set(x_69, 1, x_67); +x_70 = lean_array_push(x_42, x_69); +x_71 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_71, 0, x_38); +lean_ctor_set(x_71, 1, x_70); +x_72 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__4; +x_73 = lean_array_push(x_72, x_71); +x_74 = l_Lean_Parser_Command_macro__rules___elambda__1___closed__2; +x_75 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_75, 0, x_74); +lean_ctor_set(x_75, 1, x_73); +x_76 = lean_array_push(x_51, x_75); +x_77 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_77, 0, x_38); +lean_ctor_set(x_77, 1, x_76); +lean_ctor_set(x_30, 0, x_77); +return x_30; +} +else +{ +lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_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; 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_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; +x_78 = lean_ctor_get(x_30, 1); +lean_inc(x_78); +lean_dec(x_30); +x_79 = l_Lean_mkIdentFrom(x_1, x_15); +lean_dec(x_1); +x_80 = l_Lean_Elab_Term_elabArrayLit___closed__12; +x_81 = lean_array_push(x_80, x_79); +x_82 = l_Lean_Elab_Term_elabArrayLit___closed__13; +x_83 = lean_array_push(x_81, x_82); +x_84 = l_Lean_nullKind___closed__2; +x_85 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_85, 0, x_84); +lean_ctor_set(x_85, 1, x_83); +x_86 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__2; +x_87 = lean_array_push(x_86, x_85); +x_88 = l_Array_empty___closed__1; +x_89 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_19, x_19, x_17, x_88); +lean_dec(x_19); +x_90 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_90, 0, x_84); +lean_ctor_set(x_90, 1, x_89); +x_91 = lean_array_push(x_87, x_90); +x_92 = l_Lean_Elab_Term_elabArrow___lambda__1___closed__5; +x_93 = lean_array_push(x_91, x_92); +x_94 = lean_array_push(x_93, x_21); +x_95 = l_Lean_Parser_Command_syntax___elambda__1___closed__1; +x_96 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_96, 0, x_95); +lean_ctor_set(x_96, 1, x_94); +x_97 = lean_array_push(x_88, x_96); +x_98 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__6; +x_99 = lean_array_push(x_98, x_29); +x_100 = l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__57; +x_101 = lean_array_push(x_99, x_100); +x_102 = l_Lean_Parser_Term_stxQuot___elambda__1___closed__2; +x_103 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_103, 0, x_102); +lean_ctor_set(x_103, 1, x_101); +x_104 = lean_array_push(x_88, x_103); x_105 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_105, 0, x_104); -lean_ctor_set(x_105, 1, x_103); -x_106 = lean_array_push(x_90, x_105); -x_107 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_107, 0, x_86); -lean_ctor_set(x_107, 1, x_106); -x_108 = l___private_Init_Lean_Elab_TermBinders_10__expandFunBindersAux___main___closed__7; -x_109 = lean_array_push(x_108, x_107); -x_110 = l_Lean_Elab_Term_expandCDot_x3f___closed__3; -x_111 = lean_array_push(x_109, x_110); -x_112 = lean_array_push(x_100, x_22); -x_113 = lean_array_push(x_112, x_102); -x_114 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_114, 0, x_104); -lean_ctor_set(x_114, 1, x_113); -x_115 = lean_array_push(x_111, x_114); -x_116 = l_Lean_Parser_Term_matchAlt___elambda__1___closed__2; +lean_ctor_set(x_105, 0, x_84); +lean_ctor_set(x_105, 1, x_104); +x_106 = l___private_Init_Lean_Elab_TermBinders_10__expandFunBindersAux___main___closed__7; +x_107 = lean_array_push(x_106, x_105); +x_108 = l_Lean_Elab_Term_expandCDot_x3f___closed__3; +x_109 = lean_array_push(x_107, x_108); +x_110 = lean_array_push(x_98, x_25); +x_111 = lean_array_push(x_110, x_100); +x_112 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_112, 0, x_102); +lean_ctor_set(x_112, 1, x_111); +x_113 = lean_array_push(x_109, x_112); +x_114 = l_Lean_Parser_Term_matchAlt___elambda__1___closed__2; +x_115 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_115, 0, x_114); +lean_ctor_set(x_115, 1, x_113); +x_116 = lean_array_push(x_88, x_115); x_117 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_117, 0, x_116); -lean_ctor_set(x_117, 1, x_115); -x_118 = lean_array_push(x_90, x_117); -x_119 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_119, 0, x_86); -lean_ctor_set(x_119, 1, x_118); -x_120 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__4; -x_121 = lean_array_push(x_120, x_119); -x_122 = l_Lean_Parser_Command_macro__rules___elambda__1___closed__2; +lean_ctor_set(x_117, 0, x_84); +lean_ctor_set(x_117, 1, x_116); +x_118 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__4; +x_119 = lean_array_push(x_118, x_117); +x_120 = l_Lean_Parser_Command_macro__rules___elambda__1___closed__2; +x_121 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_121, 0, x_120); +lean_ctor_set(x_121, 1, x_119); +x_122 = lean_array_push(x_97, x_121); x_123 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_123, 0, x_122); -lean_ctor_set(x_123, 1, x_121); -x_124 = lean_array_push(x_99, x_123); -x_125 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_125, 0, x_86); -lean_ctor_set(x_125, 1, x_124); -x_126 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_126, 0, x_125); -lean_ctor_set(x_126, 1, x_80); -return x_126; +lean_ctor_set(x_123, 0, x_84); +lean_ctor_set(x_123, 1, x_122); +x_124 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_124, 0, x_123); +lean_ctor_set(x_124, 1, x_78); +return x_124; } } else { -uint8_t x_127; -lean_dec(x_22); -lean_dec(x_18); +uint8_t x_125; +lean_dec(x_25); +lean_dec(x_21); +lean_dec(x_19); lean_dec(x_15); +lean_dec(x_2); lean_dec(x_1); -x_127 = !lean_is_exclusive(x_23); -if (x_127 == 0) +x_125 = !lean_is_exclusive(x_26); +if (x_125 == 0) { -return x_23; +return x_26; } else { -lean_object* x_128; lean_object* x_129; lean_object* x_130; -x_128 = lean_ctor_get(x_23, 0); -x_129 = lean_ctor_get(x_23, 1); -lean_inc(x_129); -lean_inc(x_128); -lean_dec(x_23); -x_130 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_130, 0, x_128); -lean_ctor_set(x_130, 1, x_129); -return x_130; +lean_object* x_126; lean_object* x_127; lean_object* x_128; +x_126 = lean_ctor_get(x_26, 0); +x_127 = lean_ctor_get(x_26, 1); +lean_inc(x_127); +lean_inc(x_126); +lean_dec(x_26); +x_128 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_128, 0, x_126); +lean_ctor_set(x_128, 1, x_127); +return x_128; } } } else { -uint8_t x_131; +uint8_t x_129; +lean_dec(x_15); lean_dec(x_12); lean_dec(x_11); +lean_dec(x_2); lean_dec(x_1); -x_131 = !lean_is_exclusive(x_14); -if (x_131 == 0) +x_129 = !lean_is_exclusive(x_18); +if (x_129 == 0) +{ +return x_18; +} +else +{ +lean_object* x_130; lean_object* x_131; lean_object* x_132; +x_130 = lean_ctor_get(x_18, 0); +x_131 = lean_ctor_get(x_18, 1); +lean_inc(x_131); +lean_inc(x_130); +lean_dec(x_18); +x_132 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_132, 0, x_130); +lean_ctor_set(x_132, 1, x_131); +return x_132; +} +} +} +else +{ +uint8_t x_133; +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_2); +lean_dec(x_1); +x_133 = !lean_is_exclusive(x_14); +if (x_133 == 0) { return x_14; } else { -lean_object* x_132; lean_object* x_133; lean_object* x_134; -x_132 = lean_ctor_get(x_14, 0); -x_133 = lean_ctor_get(x_14, 1); -lean_inc(x_133); -lean_inc(x_132); +lean_object* x_134; lean_object* x_135; lean_object* x_136; +x_134 = lean_ctor_get(x_14, 0); +x_135 = lean_ctor_get(x_14, 1); +lean_inc(x_135); +lean_inc(x_134); lean_dec(x_14); -x_134 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_134, 0, x_132); -lean_ctor_set(x_134, 1, x_133); -return x_134; +x_136 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_136, 0, x_134); +lean_ctor_set(x_136, 1, x_135); +return x_136; } } } @@ -10802,7 +10892,7 @@ lean_object* _init_l_Lean_Elab_Command_elabNotation___closed__1() { _start: { lean_object* x_1; -x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabNotation___lambda__1___boxed), 3, 0); +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabNotation___lambda__1), 3, 0); return x_1; } } @@ -10833,15 +10923,6 @@ lean_dec(x_3); return x_5; } } -lean_object* l_Lean_Elab_Command_elabNotation___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = l_Lean_Elab_Command_elabNotation___lambda__1(x_1, x_2, x_3); -lean_dec(x_2); -return x_4; -} -} lean_object* _init_l___regBuiltinCommandElab_Lean_Elab_Command_elabNotation___closed__1() { _start: { @@ -10879,6 +10960,1047 @@ x_5 = l_Lean_Elab_Command_addBuiltinCommandElab(x_2, x_3, x_4, x_1); return x_5; } } +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoSyntaxItem(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; uint8_t x_6; +lean_inc(x_1); +x_4 = l_Lean_Syntax_getKind(x_1); +x_5 = l_Lean_Parser_Command_identPrec___elambda__1___closed__2; +x_6 = lean_name_eq(x_4, x_5); +if (x_6 == 0) +{ +lean_object* x_7; uint8_t x_8; +x_7 = l_Lean_Parser_Command_strLitPrec___elambda__1___closed__2; +x_8 = lean_name_eq(x_4, x_7); +lean_dec(x_4); +if (x_8 == 0) +{ +lean_object* x_9; lean_object* x_10; +lean_dec(x_1); +x_9 = lean_box(1); +x_10 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_10, 0, x_9); +lean_ctor_set(x_10, 1, x_3); +return x_10; +} +else +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_11 = l_Lean_Syntax_getArgs(x_1); +lean_dec(x_1); +x_12 = l_Lean_Parser_Syntax_atom___elambda__1___closed__2; +x_13 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_13, 0, x_12); +lean_ctor_set(x_13, 1, 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_3); +return x_14; +} +} +else +{ +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; +lean_dec(x_4); +x_15 = l_Lean_Syntax_getHeadInfo___main(x_1); +x_16 = lean_unsigned_to_nat(0u); +x_17 = l_Lean_Syntax_getArg(x_1, x_16); +x_18 = l_Lean_Syntax_getId(x_17); +lean_dec(x_17); +x_19 = l_Lean_Name_toString___closed__1; +x_20 = l_Lean_Name_toStringWithSep___main(x_19, x_18); +x_21 = l_Lean_mkStxStrLit(x_20, x_15); +x_22 = lean_unsigned_to_nat(1u); +x_23 = l_Lean_Syntax_getArg(x_1, x_22); +lean_dec(x_1); +x_24 = l_Lean_Meta_mkEqTrans___closed__3; +x_25 = lean_array_push(x_24, x_21); +x_26 = lean_array_push(x_25, x_23); +x_27 = l_Lean_Parser_Syntax_atom___elambda__1___closed__2; +x_28 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_28, 0, x_27); +lean_ctor_set(x_28, 1, x_26); +x_29 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_29, 0, x_28); +lean_ctor_set(x_29, 1, x_3); +return x_29; +} +} +} +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoSyntaxItem___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Command_expandMacroHeadIntoSyntaxItem(x_1, x_2, x_3); +lean_dec(x_2); +return x_4; +} +} +lean_object* l_Lean_Elab_Command_expandMacroArgIntoSyntaxItem(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; uint8_t x_6; +lean_inc(x_1); +x_4 = l_Lean_Syntax_getKind(x_1); +x_5 = l_Lean_Parser_Command_macroArgSimple___elambda__1___closed__2; +x_6 = lean_name_eq(x_4, x_5); +if (x_6 == 0) +{ +lean_object* x_7; uint8_t x_8; +x_7 = l_Lean_Parser_Command_strLitPrec___elambda__1___closed__2; +x_8 = lean_name_eq(x_4, x_7); +lean_dec(x_4); +if (x_8 == 0) +{ +lean_object* x_9; lean_object* x_10; +lean_dec(x_1); +x_9 = lean_box(1); +x_10 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_10, 0, x_9); +lean_ctor_set(x_10, 1, x_3); +return x_10; +} +else +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_11 = l_Lean_Syntax_getArgs(x_1); +lean_dec(x_1); +x_12 = l_Lean_Parser_Syntax_atom___elambda__1___closed__2; +x_13 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_13, 0, x_12); +lean_ctor_set(x_13, 1, 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_3); +return x_14; +} +} +else +{ +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_dec(x_4); +x_15 = lean_unsigned_to_nat(2u); +x_16 = l_Lean_Syntax_getArg(x_1, x_15); +x_17 = lean_unsigned_to_nat(3u); +x_18 = l_Lean_Syntax_getArg(x_1, x_17); +lean_dec(x_1); +x_19 = l_Lean_Meta_mkEqTrans___closed__3; +x_20 = lean_array_push(x_19, x_16); +x_21 = lean_array_push(x_20, x_18); +x_22 = l_Lean_Parser_Syntax_cat___elambda__1___closed__2; +x_23 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_23, 0, x_22); +lean_ctor_set(x_23, 1, x_21); +x_24 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_24, 0, x_23); +lean_ctor_set(x_24, 1, x_3); +return x_24; +} +} +} +lean_object* l_Lean_Elab_Command_expandMacroArgIntoSyntaxItem___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Command_expandMacroArgIntoSyntaxItem(x_1, x_2, x_3); +lean_dec(x_2); +return x_4; +} +} +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoPattern(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; uint8_t x_6; +lean_inc(x_1); +x_4 = l_Lean_Syntax_getKind(x_1); +x_5 = l_Lean_Parser_Command_identPrec___elambda__1___closed__2; +x_6 = lean_name_eq(x_4, x_5); +if (x_6 == 0) +{ +lean_object* x_7; uint8_t x_8; +x_7 = l_Lean_Parser_Command_strLitPrec___elambda__1___closed__2; +x_8 = lean_name_eq(x_4, x_7); +lean_dec(x_4); +if (x_8 == 0) +{ +lean_object* x_9; lean_object* x_10; +lean_dec(x_1); +x_9 = lean_box(1); +x_10 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_10, 0, x_9); +lean_ctor_set(x_10, 1, x_3); +return x_10; +} +else +{ +lean_object* x_11; +x_11 = l_Lean_Elab_Command_strLitPrecToPattern(x_1, x_2, x_3); +lean_dec(x_1); +return x_11; +} +} +else +{ +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_dec(x_4); +x_12 = lean_unsigned_to_nat(0u); +x_13 = l_Lean_Syntax_getArg(x_1, x_12); +x_14 = l_Lean_Syntax_getId(x_13); +lean_dec(x_13); +x_15 = l_Lean_Name_toString___closed__1; +x_16 = l_Lean_Name_toStringWithSep___main(x_15, x_14); +x_17 = l_Lean_mkAtomFrom(x_1, x_16); +lean_dec(x_1); +x_18 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_18, 0, x_17); +lean_ctor_set(x_18, 1, x_3); +return x_18; +} +} +} +lean_object* l_Lean_Elab_Command_expandMacroHeadIntoPattern___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Command_expandMacroHeadIntoPattern(x_1, x_2, x_3); +lean_dec(x_2); +return x_4; +} +} +lean_object* l_Lean_Elab_Command_expandMacroArgIntoPattern(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; uint8_t x_6; +lean_inc(x_1); +x_4 = l_Lean_Syntax_getKind(x_1); +x_5 = l_Lean_Parser_Command_macroArgSimple___elambda__1___closed__2; +x_6 = lean_name_eq(x_4, x_5); +if (x_6 == 0) +{ +lean_object* x_7; uint8_t x_8; +x_7 = l_Lean_Parser_Command_strLitPrec___elambda__1___closed__2; +x_8 = lean_name_eq(x_4, x_7); +lean_dec(x_4); +if (x_8 == 0) +{ +lean_object* x_9; lean_object* x_10; +lean_dec(x_1); +x_9 = lean_box(1); +x_10 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_10, 0, x_9); +lean_ctor_set(x_10, 1, x_3); +return x_10; +} +else +{ +lean_object* x_11; +x_11 = l_Lean_Elab_Command_strLitPrecToPattern(x_1, x_2, x_3); +lean_dec(x_1); +return x_11; +} +} +else +{ +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; lean_object* x_20; lean_object* x_21; lean_object* x_22; +lean_dec(x_4); +x_12 = lean_unsigned_to_nat(0u); +x_13 = l_Lean_Syntax_getArg(x_1, x_12); +lean_dec(x_1); +x_14 = l_Lean_mkTermIdFromIdent(x_13); +x_15 = l___private_Init_Lean_Elab_Syntax_8__antiquote___main___closed__2; +x_16 = lean_array_push(x_15, x_14); +x_17 = l_Lean_Syntax_asNode___closed__1; +x_18 = lean_array_push(x_16, x_17); +x_19 = lean_array_push(x_18, x_17); +x_20 = l_Lean_Parser_mkAntiquot___closed__2; +x_21 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_21, 0, x_20); +lean_ctor_set(x_21, 1, x_19); +x_22 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_22, 0, x_21); +lean_ctor_set(x_22, 1, x_3); +return x_22; +} +} +} +lean_object* l_Lean_Elab_Command_expandMacroArgIntoPattern___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Command_expandMacroArgIntoPattern(x_1, x_2, x_3); +lean_dec(x_2); +return x_4; +} +} +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; uint8_t x_6; +x_5 = lean_array_get_size(x_2); +x_6 = lean_nat_dec_lt(x_1, x_5); +lean_dec(x_5); +if (x_6 == 0) +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; +lean_dec(x_1); +x_7 = l_Array_empty___closed__1; +x_8 = x_2; +x_9 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_9, 0, x_8); +lean_ctor_set(x_9, 1, x_4); +return x_9; +} +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_10 = lean_array_fget(x_2, x_1); +x_11 = lean_box(0); +x_12 = x_11; +x_13 = lean_array_fset(x_2, x_1, x_12); +lean_inc(x_10); +x_14 = l_Lean_Elab_Command_expandMacroArgIntoSyntaxItem(x_10, x_3, x_4); +if (lean_obj_tag(x_14) == 0) +{ +lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; +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 = lean_unsigned_to_nat(1u); +x_18 = lean_nat_add(x_1, x_17); +x_19 = x_15; +lean_dec(x_10); +x_20 = lean_array_fset(x_13, x_1, x_19); +lean_dec(x_1); +x_1 = x_18; +x_2 = x_20; +x_4 = x_16; +goto _start; +} +else +{ +uint8_t x_22; +lean_dec(x_13); +lean_dec(x_10); +lean_dec(x_1); +x_22 = !lean_is_exclusive(x_14); +if (x_22 == 0) +{ +return x_14; +} +else +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_14, 0); +x_24 = lean_ctor_get(x_14, 1); +lean_inc(x_24); +lean_inc(x_23); +lean_dec(x_14); +x_25 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_25, 0, x_23); +lean_ctor_set(x_25, 1, x_24); +return x_25; +} +} +} +} +} +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; uint8_t x_6; +x_5 = lean_array_get_size(x_2); +x_6 = lean_nat_dec_lt(x_1, x_5); +lean_dec(x_5); +if (x_6 == 0) +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; +lean_dec(x_1); +x_7 = l_Array_empty___closed__1; +x_8 = x_2; +x_9 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_9, 0, x_8); +lean_ctor_set(x_9, 1, x_4); +return x_9; +} +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_10 = lean_array_fget(x_2, x_1); +x_11 = lean_box(0); +x_12 = x_11; +x_13 = lean_array_fset(x_2, x_1, x_12); +lean_inc(x_10); +x_14 = l_Lean_Elab_Command_expandMacroArgIntoPattern(x_10, x_3, x_4); +if (lean_obj_tag(x_14) == 0) +{ +lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; +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 = lean_unsigned_to_nat(1u); +x_18 = lean_nat_add(x_1, x_17); +x_19 = x_15; +lean_dec(x_10); +x_20 = lean_array_fset(x_13, x_1, x_19); +lean_dec(x_1); +x_1 = x_18; +x_2 = x_20; +x_4 = x_16; +goto _start; +} +else +{ +uint8_t x_22; +lean_dec(x_13); +lean_dec(x_10); +lean_dec(x_1); +x_22 = !lean_is_exclusive(x_14); +if (x_22 == 0) +{ +return x_14; +} +else +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_14, 0); +x_24 = lean_ctor_get(x_14, 1); +lean_inc(x_24); +lean_inc(x_23); +lean_dec(x_14); +x_25 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_25, 0, x_23); +lean_ctor_set(x_25, 1, x_24); +return x_25; +} +} +} +} +} +lean_object* _init_l_Lean_Elab_Command_elabMacro___lambda__1___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l___private_Init_Lean_Elab_Util_8__regTraceClasses___closed__2; +x_2 = l_Lean_Parser_regBuiltinSyntaxParserAttr___closed__3; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* l_Lean_Elab_Command_elabMacro___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +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; lean_object* x_13; lean_object* x_14; +x_4 = lean_unsigned_to_nat(1u); +x_5 = l_Lean_Syntax_getArg(x_1, x_4); +x_6 = lean_unsigned_to_nat(2u); +x_7 = l_Lean_Syntax_getArg(x_1, x_6); +x_8 = l_Lean_Syntax_getArgs(x_7); +lean_dec(x_7); +x_9 = lean_unsigned_to_nat(4u); +x_10 = l_Lean_Syntax_getArg(x_1, x_9); +x_11 = lean_unsigned_to_nat(7u); +x_12 = l_Lean_Syntax_getArg(x_1, x_11); +x_13 = l_Lean_Syntax_getId(x_10); +lean_inc(x_2); +x_14 = l_Lean_Elab_Command_mkFreshKind(x_13, x_2, x_3); +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); +lean_inc(x_5); +x_17 = l_Lean_Elab_Command_expandMacroHeadIntoSyntaxItem(x_5, x_2, x_16); +if (lean_obj_tag(x_17) == 0) +{ +lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; +x_18 = lean_ctor_get(x_17, 0); +lean_inc(x_18); +x_19 = lean_ctor_get(x_17, 1); +lean_inc(x_19); +lean_dec(x_17); +x_20 = lean_unsigned_to_nat(0u); +lean_inc(x_8); +x_21 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__1(x_20, x_8, x_2, x_19); +if (lean_obj_tag(x_21) == 0) +{ +lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_22 = lean_ctor_get(x_21, 0); +lean_inc(x_22); +x_23 = lean_ctor_get(x_21, 1); +lean_inc(x_23); +lean_dec(x_21); +x_24 = l_Lean_mkOptionalNode___closed__1; +x_25 = lean_array_push(x_24, x_18); +x_26 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_22, x_22, x_20, x_25); +lean_dec(x_22); +x_27 = l_Lean_Elab_Command_expandMacroHeadIntoPattern(x_5, x_2, x_23); +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); +x_30 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__2(x_20, x_8, x_2, x_29); +if (lean_obj_tag(x_30) == 0) +{ +lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_133; +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); +x_33 = lean_array_push(x_24, x_28); +x_34 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_31, x_31, x_20, x_33); +lean_dec(x_31); +lean_inc(x_15); +x_35 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_35, 0, x_15); +lean_ctor_set(x_35, 1, x_34); +lean_inc(x_2); +x_133 = l_Lean_Elab_Command_getOptions(x_2, x_32); +if (lean_obj_tag(x_133) == 0) +{ +lean_object* x_134; lean_object* x_135; lean_object* x_136; uint8_t x_137; +x_134 = lean_ctor_get(x_133, 0); +lean_inc(x_134); +x_135 = lean_ctor_get(x_133, 1); +lean_inc(x_135); +lean_dec(x_133); +x_136 = l_Lean_Elab_Command_elabMacro___lambda__1___closed__1; +x_137 = l_Lean_checkTraceOption(x_134, x_136); +lean_dec(x_134); +if (x_137 == 0) +{ +x_36 = x_135; +goto block_132; +} +else +{ +lean_object* x_138; lean_object* x_139; +lean_inc(x_35); +x_138 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_138, 0, x_35); +lean_inc(x_2); +x_139 = l_Lean_Elab_Command_logTrace(x_136, x_1, x_138, x_2, x_135); +if (lean_obj_tag(x_139) == 0) +{ +lean_object* x_140; +x_140 = lean_ctor_get(x_139, 1); +lean_inc(x_140); +lean_dec(x_139); +x_36 = x_140; +goto block_132; +} +else +{ +uint8_t x_141; +lean_dec(x_35); +lean_dec(x_26); +lean_dec(x_15); +lean_dec(x_12); +lean_dec(x_10); +lean_dec(x_2); +x_141 = !lean_is_exclusive(x_139); +if (x_141 == 0) +{ +return x_139; +} +else +{ +lean_object* x_142; lean_object* x_143; lean_object* x_144; +x_142 = lean_ctor_get(x_139, 0); +x_143 = lean_ctor_get(x_139, 1); +lean_inc(x_143); +lean_inc(x_142); +lean_dec(x_139); +x_144 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_144, 0, x_142); +lean_ctor_set(x_144, 1, x_143); +return x_144; +} +} +} +} +else +{ +uint8_t x_145; +lean_dec(x_35); +lean_dec(x_26); +lean_dec(x_15); +lean_dec(x_12); +lean_dec(x_10); +lean_dec(x_2); +x_145 = !lean_is_exclusive(x_133); +if (x_145 == 0) +{ +return x_133; +} +else +{ +lean_object* x_146; lean_object* x_147; lean_object* x_148; +x_146 = lean_ctor_get(x_133, 0); +x_147 = lean_ctor_get(x_133, 1); +lean_inc(x_147); +lean_inc(x_146); +lean_dec(x_133); +x_148 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_148, 0, x_146); +lean_ctor_set(x_148, 1, x_147); +return x_148; +} +} +block_132: +{ +lean_object* x_37; uint8_t x_38; +x_37 = l_Lean_Elab_Command_getCurrMacroScope(x_2, x_36); +lean_dec(x_2); +x_38 = !lean_is_exclusive(x_37); +if (x_38 == 0) +{ +lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_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; lean_object* x_84; +x_39 = lean_ctor_get(x_37, 0); +lean_dec(x_39); +x_40 = l_Lean_mkIdentFrom(x_1, x_15); +x_41 = l_Lean_Elab_Term_elabArrayLit___closed__12; +x_42 = lean_array_push(x_41, x_40); +x_43 = l_Lean_Elab_Term_elabArrayLit___closed__13; +x_44 = lean_array_push(x_42, x_43); +x_45 = l_Lean_nullKind___closed__2; +x_46 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_46, 0, x_45); +lean_ctor_set(x_46, 1, x_44); +x_47 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__2; +x_48 = lean_array_push(x_47, x_46); +x_49 = l_Array_empty___closed__1; +x_50 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_26, x_26, x_20, x_49); +lean_dec(x_26); +x_51 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_51, 0, x_45); +lean_ctor_set(x_51, 1, x_50); +x_52 = lean_array_push(x_48, x_51); +x_53 = l_Lean_Elab_Term_elabArrow___lambda__1___closed__5; +x_54 = lean_array_push(x_52, x_53); +x_55 = lean_array_push(x_54, x_10); +x_56 = l_Lean_Parser_Command_syntax___elambda__1___closed__1; +x_57 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_57, 0, x_56); +lean_ctor_set(x_57, 1, x_55); +x_58 = lean_array_push(x_49, x_57); +x_59 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__6; +x_60 = lean_array_push(x_59, x_35); +x_61 = l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__57; +x_62 = lean_array_push(x_60, x_61); +x_63 = l_Lean_Parser_Term_stxQuot___elambda__1___closed__2; +x_64 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_64, 0, x_63); +lean_ctor_set(x_64, 1, x_62); +x_65 = lean_array_push(x_49, x_64); +x_66 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_66, 0, x_45); +lean_ctor_set(x_66, 1, x_65); +x_67 = l___private_Init_Lean_Elab_TermBinders_10__expandFunBindersAux___main___closed__7; +x_68 = lean_array_push(x_67, x_66); +x_69 = l_Lean_Elab_Term_expandCDot_x3f___closed__3; +x_70 = lean_array_push(x_68, x_69); +x_71 = lean_array_push(x_59, x_12); +x_72 = lean_array_push(x_71, x_61); +x_73 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_73, 0, x_63); +lean_ctor_set(x_73, 1, x_72); +x_74 = lean_array_push(x_70, x_73); +x_75 = l_Lean_Parser_Term_matchAlt___elambda__1___closed__2; +x_76 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_76, 0, x_75); +lean_ctor_set(x_76, 1, x_74); +x_77 = lean_array_push(x_49, x_76); +x_78 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_78, 0, x_45); +lean_ctor_set(x_78, 1, x_77); +x_79 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__4; +x_80 = lean_array_push(x_79, x_78); +x_81 = l_Lean_Parser_Command_macro__rules___elambda__1___closed__2; +x_82 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_82, 0, x_81); +lean_ctor_set(x_82, 1, x_80); +x_83 = lean_array_push(x_58, x_82); +x_84 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_84, 0, x_45); +lean_ctor_set(x_84, 1, x_83); +lean_ctor_set(x_37, 0, x_84); +return x_37; +} +else +{ +lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; 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_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; lean_object* x_126; lean_object* x_127; lean_object* x_128; lean_object* x_129; lean_object* x_130; lean_object* x_131; +x_85 = lean_ctor_get(x_37, 1); +lean_inc(x_85); +lean_dec(x_37); +x_86 = l_Lean_mkIdentFrom(x_1, x_15); +x_87 = l_Lean_Elab_Term_elabArrayLit___closed__12; +x_88 = lean_array_push(x_87, x_86); +x_89 = l_Lean_Elab_Term_elabArrayLit___closed__13; +x_90 = lean_array_push(x_88, x_89); +x_91 = l_Lean_nullKind___closed__2; +x_92 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_92, 0, x_91); +lean_ctor_set(x_92, 1, x_90); +x_93 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__2; +x_94 = lean_array_push(x_93, x_92); +x_95 = l_Array_empty___closed__1; +x_96 = l_Array_iterateMAux___main___at_Array_append___spec__1___rarg(x_26, x_26, x_20, x_95); +lean_dec(x_26); +x_97 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_97, 0, x_91); +lean_ctor_set(x_97, 1, x_96); +x_98 = lean_array_push(x_94, x_97); +x_99 = l_Lean_Elab_Term_elabArrow___lambda__1___closed__5; +x_100 = lean_array_push(x_98, x_99); +x_101 = lean_array_push(x_100, x_10); +x_102 = l_Lean_Parser_Command_syntax___elambda__1___closed__1; +x_103 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_103, 0, x_102); +lean_ctor_set(x_103, 1, x_101); +x_104 = lean_array_push(x_95, x_103); +x_105 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__6; +x_106 = lean_array_push(x_105, x_35); +x_107 = l___private_Init_Lean_Elab_Quotation_5__quoteSyntax___main___closed__57; +x_108 = lean_array_push(x_106, x_107); +x_109 = l_Lean_Parser_Term_stxQuot___elambda__1___closed__2; +x_110 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_110, 0, x_109); +lean_ctor_set(x_110, 1, x_108); +x_111 = lean_array_push(x_95, x_110); +x_112 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_112, 0, x_91); +lean_ctor_set(x_112, 1, x_111); +x_113 = l___private_Init_Lean_Elab_TermBinders_10__expandFunBindersAux___main___closed__7; +x_114 = lean_array_push(x_113, x_112); +x_115 = l_Lean_Elab_Term_expandCDot_x3f___closed__3; +x_116 = lean_array_push(x_114, x_115); +x_117 = lean_array_push(x_105, x_12); +x_118 = lean_array_push(x_117, x_107); +x_119 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_119, 0, x_109); +lean_ctor_set(x_119, 1, x_118); +x_120 = lean_array_push(x_116, x_119); +x_121 = l_Lean_Parser_Term_matchAlt___elambda__1___closed__2; +x_122 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_122, 0, x_121); +lean_ctor_set(x_122, 1, x_120); +x_123 = lean_array_push(x_95, x_122); +x_124 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_124, 0, x_91); +lean_ctor_set(x_124, 1, x_123); +x_125 = l_Lean_Elab_Command_elabNotation___lambda__1___closed__4; +x_126 = lean_array_push(x_125, x_124); +x_127 = l_Lean_Parser_Command_macro__rules___elambda__1___closed__2; +x_128 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_128, 0, x_127); +lean_ctor_set(x_128, 1, x_126); +x_129 = lean_array_push(x_104, x_128); +x_130 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_130, 0, x_91); +lean_ctor_set(x_130, 1, x_129); +x_131 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_131, 0, x_130); +lean_ctor_set(x_131, 1, x_85); +return x_131; +} +} +} +else +{ +uint8_t x_149; +lean_dec(x_28); +lean_dec(x_26); +lean_dec(x_15); +lean_dec(x_12); +lean_dec(x_10); +lean_dec(x_2); +x_149 = !lean_is_exclusive(x_30); +if (x_149 == 0) +{ +return x_30; +} +else +{ +lean_object* x_150; lean_object* x_151; lean_object* x_152; +x_150 = lean_ctor_get(x_30, 0); +x_151 = lean_ctor_get(x_30, 1); +lean_inc(x_151); +lean_inc(x_150); +lean_dec(x_30); +x_152 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_152, 0, x_150); +lean_ctor_set(x_152, 1, x_151); +return x_152; +} +} +} +else +{ +uint8_t x_153; +lean_dec(x_26); +lean_dec(x_15); +lean_dec(x_12); +lean_dec(x_10); +lean_dec(x_8); +lean_dec(x_2); +x_153 = !lean_is_exclusive(x_27); +if (x_153 == 0) +{ +return x_27; +} +else +{ +lean_object* x_154; lean_object* x_155; lean_object* x_156; +x_154 = lean_ctor_get(x_27, 0); +x_155 = lean_ctor_get(x_27, 1); +lean_inc(x_155); +lean_inc(x_154); +lean_dec(x_27); +x_156 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_156, 0, x_154); +lean_ctor_set(x_156, 1, x_155); +return x_156; +} +} +} +else +{ +uint8_t x_157; +lean_dec(x_18); +lean_dec(x_15); +lean_dec(x_12); +lean_dec(x_10); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_2); +x_157 = !lean_is_exclusive(x_21); +if (x_157 == 0) +{ +return x_21; +} +else +{ +lean_object* x_158; lean_object* x_159; lean_object* x_160; +x_158 = lean_ctor_get(x_21, 0); +x_159 = lean_ctor_get(x_21, 1); +lean_inc(x_159); +lean_inc(x_158); +lean_dec(x_21); +x_160 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_160, 0, x_158); +lean_ctor_set(x_160, 1, x_159); +return x_160; +} +} +} +else +{ +uint8_t x_161; +lean_dec(x_15); +lean_dec(x_12); +lean_dec(x_10); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_2); +x_161 = !lean_is_exclusive(x_17); +if (x_161 == 0) +{ +return x_17; +} +else +{ +lean_object* x_162; lean_object* x_163; lean_object* x_164; +x_162 = lean_ctor_get(x_17, 0); +x_163 = lean_ctor_get(x_17, 1); +lean_inc(x_163); +lean_inc(x_162); +lean_dec(x_17); +x_164 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_164, 0, x_162); +lean_ctor_set(x_164, 1, x_163); +return x_164; +} +} +} +else +{ +uint8_t x_165; +lean_dec(x_12); +lean_dec(x_10); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_2); +x_165 = !lean_is_exclusive(x_14); +if (x_165 == 0) +{ +return x_14; +} +else +{ +lean_object* x_166; lean_object* x_167; lean_object* x_168; +x_166 = lean_ctor_get(x_14, 0); +x_167 = lean_ctor_get(x_14, 1); +lean_inc(x_167); +lean_inc(x_166); +lean_dec(x_14); +x_168 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_168, 0, x_166); +lean_ctor_set(x_168, 1, x_167); +return x_168; +} +} +} +} +lean_object* _init_l_Lean_Elab_Command_elabMacro___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabMacro___lambda__1___boxed), 3, 0); +return x_1; +} +} +lean_object* l_Lean_Elab_Command_elabMacro(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; +x_4 = l_Lean_Elab_Command_elabMacro___closed__1; +x_5 = l_Lean_Elab_Command_adaptExpander(x_4, x_1, x_2, x_3); +return x_5; +} +} +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; +x_5 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__1(x_1, x_2, x_3, x_4); +lean_dec(x_3); +return x_5; +} +} +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; +x_5 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabMacro___spec__2(x_1, x_2, x_3, x_4); +lean_dec(x_3); +return x_5; +} +} +lean_object* l_Lean_Elab_Command_elabMacro___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Command_elabMacro___lambda__1(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} +lean_object* _init_l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("elabMacro"); +return x_1; +} +} +lean_object* _init_l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Elab_Command_declareBuiltinCommandElab___closed__3; +x_2 = l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* _init_l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__3() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabMacro), 3, 0); +return x_1; +} +} +lean_object* l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro(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_Parser_Command_macro___elambda__1___closed__2; +x_3 = l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__2; +x_4 = l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__3; +x_5 = l_Lean_Elab_Command_addBuiltinCommandElab(x_2, x_3, x_4, x_1); +return x_5; +} +} +lean_object* l___private_Init_Lean_Elab_Syntax_9__regTraceClasses(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; +x_2 = l_Lean_Elab_Command_elabMacro___lambda__1___closed__1; +x_3 = l_Lean_registerTraceClass(x_2, x_1); +if (lean_obj_tag(x_3) == 0) +{ +uint8_t x_4; +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ +lean_object* x_5; lean_object* x_6; +x_5 = lean_ctor_get(x_3, 0); +lean_dec(x_5); +x_6 = lean_box(0); +lean_ctor_set(x_3, 0, x_6); +return x_3; +} +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_7 = lean_ctor_get(x_3, 1); +lean_inc(x_7); +lean_dec(x_3); +x_8 = lean_box(0); +x_9 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_9, 0, x_8); +lean_ctor_set(x_9, 1, x_7); +return x_9; +} +} +else +{ +uint8_t x_10; +x_10 = !lean_is_exclusive(x_3); +if (x_10 == 0) +{ +return x_3; +} +else +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; +x_11 = lean_ctor_get(x_3, 0); +x_12 = lean_ctor_get(x_3, 1); +lean_inc(x_12); +lean_inc(x_11); +lean_dec(x_3); +x_13 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_13, 0, x_11); +lean_ctor_set(x_13, 1, x_12); +return x_13; +} +} +} +} lean_object* initialize_Init_Lean_Elab_Command(lean_object*); lean_object* initialize_Init_Lean_Elab_Quotation(lean_object*); static bool _G_initialized = false; @@ -11344,6 +12466,22 @@ lean_mark_persistent(l___regBuiltinCommandElab_Lean_Elab_Command_elabNotation___ res = l___regBuiltinCommandElab_Lean_Elab_Command_elabNotation(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l_Lean_Elab_Command_elabMacro___lambda__1___closed__1 = _init_l_Lean_Elab_Command_elabMacro___lambda__1___closed__1(); +lean_mark_persistent(l_Lean_Elab_Command_elabMacro___lambda__1___closed__1); +l_Lean_Elab_Command_elabMacro___closed__1 = _init_l_Lean_Elab_Command_elabMacro___closed__1(); +lean_mark_persistent(l_Lean_Elab_Command_elabMacro___closed__1); +l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__1 = _init_l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__1(); +lean_mark_persistent(l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__1); +l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__2 = _init_l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__2(); +lean_mark_persistent(l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__2); +l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__3 = _init_l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__3(); +lean_mark_persistent(l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro___closed__3); +res = l___regBuiltinCommandElab_Lean_Elab_Command_elabMacro(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +res = l___private_Init_Lean_Elab_Syntax_9__regTraceClasses(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); return lean_mk_io_result(lean_box(0)); } #ifdef __cplusplus diff --git a/stage0/stdlib/Init/Lean/Elab/Tactic.c b/stage0/stdlib/Init/Lean/Elab/Tactic.c index 58336d8906..d79984de5e 100644 --- a/stage0/stdlib/Init/Lean/Elab/Tactic.c +++ b/stage0/stdlib/Init/Lean/Elab/Tactic.c @@ -13,17 +13,24 @@ #ifdef __cplusplus extern "C" { #endif +lean_object* l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__1; +lean_object* l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__2; lean_object* l_Lean_Expr_mvarId_x21(lean_object*); lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabTacticBlock(lean_object*); +lean_object* l_Lean_Elab_Term_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_liftTacticElabM___rarg___lambda__1(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* l_Lean_Elab_Term_ensureAssignmentHasNoMVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_mkMVar(lean_object*); lean_object* l_Lean_Elab_Term_liftTacticElabM___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_evalTactic(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Term_tacticBlock___elambda__1___closed__2; lean_object* l_Lean_Elab_Term_reportUnsolvedGoals___closed__3; lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabTacticBlock___closed__3; +lean_object* l_Lean_Syntax_getTailWithInfo___main(lean_object*); +lean_object* l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__3; lean_object* l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_map___main___at_Lean_Elab_Term_reportUnsolvedGoals___spec__1(lean_object*); lean_object* l_Lean_Elab_Term_elabTacticBlock___closed__1; @@ -38,6 +45,7 @@ lean_object* l_Lean_MessageData_joinSep___main(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_runTactic(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_runTactic___closed__1; lean_object* l_Lean_Elab_Term_elabTacticBlock___closed__3; +uint8_t l_Lean_Expr_hasMVar(lean_object*); lean_object* l_Lean_Elab_Term_registerSyntheticMVar(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Term_declareBuiltinTermElab___closed__4; lean_object* l_Lean_Elab_Term_runTactic___lambda__1___boxed(lean_object*, lean_object*, lean_object*); @@ -50,10 +58,12 @@ lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_elabTacticBlock(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_List_isEmpty___rarg(lean_object*); lean_object* l_Lean_Elab_Term_mkTacticMVar(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_indentExpr(lean_object*); lean_object* l_Lean_Elab_Term_reportUnsolvedGoals___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_mkTacticMVar___closed__1; lean_object* l_Lean_Elab_Term_reportUnsolvedGoals___closed__2; lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabTacticBlock___closed__1; +lean_object* l_Lean_Elab_Term_ensureAssignmentHasNoMVars(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* _init_l_Lean_Elab_Term_mkTacticMVar___closed__1() { _start: { @@ -661,6 +671,117 @@ lean_dec(x_1); return x_5; } } +lean_object* _init_l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("tactic failed, result still contain metavariables"); +return x_1; +} +} +lean_object* _init_l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars___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_ensureAssignmentHasNoMVars___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars___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_ensureAssignmentHasNoMVars(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; uint8_t x_7; +x_5 = l_Lean_mkMVar(x_2); +lean_inc(x_3); +x_6 = l_Lean_Elab_Term_instantiateMVars(x_1, x_5, x_3, x_4); +x_7 = !lean_is_exclusive(x_6); +if (x_7 == 0) +{ +lean_object* x_8; lean_object* x_9; uint8_t x_10; +x_8 = lean_ctor_get(x_6, 0); +x_9 = lean_ctor_get(x_6, 1); +x_10 = l_Lean_Expr_hasMVar(x_8); +if (x_10 == 0) +{ +lean_object* x_11; +lean_dec(x_8); +lean_dec(x_3); +x_11 = lean_box(0); +lean_ctor_set(x_6, 0, x_11); +return x_6; +} +else +{ +lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; +lean_free_object(x_6); +x_12 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_12, 0, x_8); +x_13 = l_Lean_indentExpr(x_12); +x_14 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__3; +x_15 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_15, 0, x_14); +lean_ctor_set(x_15, 1, x_13); +x_16 = l_Lean_Elab_Term_throwError___rarg(x_1, x_15, x_3, x_9); +return x_16; +} +} +else +{ +lean_object* x_17; lean_object* x_18; uint8_t x_19; +x_17 = lean_ctor_get(x_6, 0); +x_18 = lean_ctor_get(x_6, 1); +lean_inc(x_18); +lean_inc(x_17); +lean_dec(x_6); +x_19 = l_Lean_Expr_hasMVar(x_17); +if (x_19 == 0) +{ +lean_object* x_20; lean_object* x_21; +lean_dec(x_17); +lean_dec(x_3); +x_20 = lean_box(0); +x_21 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_21, 0, x_20); +lean_ctor_set(x_21, 1, x_18); +return x_21; +} +else +{ +lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_22 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_22, 0, x_17); +x_23 = l_Lean_indentExpr(x_22); +x_24 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__3; +x_25 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_25, 0, x_24); +lean_ctor_set(x_25, 1, x_23); +x_26 = l_Lean_Elab_Term_throwError___rarg(x_1, x_25, x_3, x_18); +return x_26; +} +} +} +} +lean_object* l_Lean_Elab_Term_ensureAssignmentHasNoMVars___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; +x_5 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars(x_1, x_2, x_3, x_4); +lean_dec(x_1); +return x_5; +} +} lean_object* l_Lean_Elab_Term_runTactic___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { @@ -705,23 +826,27 @@ x_13 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog_ lean_closure_set(x_13, 0, x_11); lean_closure_set(x_13, 1, x_12); lean_inc(x_4); +lean_inc(x_2); lean_inc(x_1); x_14 = l_Lean_Elab_Term_liftTacticElabM___rarg(x_1, x_2, x_13, x_4, x_5); if (lean_obj_tag(x_14) == 0) { -uint8_t x_15; -x_15 = !lean_is_exclusive(x_14); -if (x_15 == 0) +lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18; +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); +lean_inc(x_1); +x_17 = l_Lean_Syntax_getTailWithInfo___main(x_1); +x_18 = l_List_isEmpty___rarg(x_15); +if (lean_obj_tag(x_17) == 0) { -lean_object* x_16; lean_object* x_17; uint8_t x_18; -x_16 = lean_ctor_get(x_14, 0); -x_17 = lean_ctor_get(x_14, 1); -x_18 = l_List_isEmpty___rarg(x_16); if (x_18 == 0) { lean_object* x_19; uint8_t x_20; -lean_free_object(x_14); -x_19 = l_Lean_Elab_Term_reportUnsolvedGoals(x_1, x_16, x_4, x_17); +lean_dec(x_2); +x_19 = l_Lean_Elab_Term_reportUnsolvedGoals(x_1, x_15, x_4, x_16); lean_dec(x_1); x_20 = !lean_is_exclusive(x_19); if (x_20 == 0) @@ -745,365 +870,433 @@ return x_23; else { lean_object* x_24; -lean_dec(x_16); -lean_dec(x_4); +lean_dec(x_15); +x_24 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars(x_1, x_2, x_4, x_16); lean_dec(x_1); -x_24 = lean_box(0); -lean_ctor_set(x_14, 0, x_24); -return x_14; +return x_24; } } else { +lean_dec(x_1); +if (x_18 == 0) +{ lean_object* x_25; lean_object* x_26; uint8_t x_27; -x_25 = lean_ctor_get(x_14, 0); -x_26 = lean_ctor_get(x_14, 1); -lean_inc(x_26); +lean_dec(x_2); +x_25 = lean_ctor_get(x_17, 0); lean_inc(x_25); -lean_dec(x_14); -x_27 = l_List_isEmpty___rarg(x_25); +lean_dec(x_17); +x_26 = l_Lean_Elab_Term_reportUnsolvedGoals(x_25, x_15, x_4, x_16); +lean_dec(x_25); +x_27 = !lean_is_exclusive(x_26); if (x_27 == 0) { -lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; -x_28 = l_Lean_Elab_Term_reportUnsolvedGoals(x_1, x_25, x_4, x_26); -lean_dec(x_1); -x_29 = lean_ctor_get(x_28, 0); +return x_26; +} +else +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_26, 0); +x_29 = lean_ctor_get(x_26, 1); lean_inc(x_29); -x_30 = lean_ctor_get(x_28, 1); -lean_inc(x_30); -if (lean_is_exclusive(x_28)) { - lean_ctor_release(x_28, 0); - lean_ctor_release(x_28, 1); - x_31 = x_28; -} else { - lean_dec_ref(x_28); - x_31 = lean_box(0); +lean_inc(x_28); +lean_dec(x_26); +x_30 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_30, 0, x_28); +lean_ctor_set(x_30, 1, x_29); +return x_30; } -if (lean_is_scalar(x_31)) { - x_32 = lean_alloc_ctor(1, 2, 0); -} else { - x_32 = x_31; } -lean_ctor_set(x_32, 0, x_29); -lean_ctor_set(x_32, 1, x_30); +else +{ +lean_object* x_31; lean_object* x_32; +lean_dec(x_15); +x_31 = lean_ctor_get(x_17, 0); +lean_inc(x_31); +lean_dec(x_17); +x_32 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars(x_31, x_2, x_4, x_16); +lean_dec(x_31); return x_32; } -else -{ -lean_object* x_33; lean_object* x_34; -lean_dec(x_25); -lean_dec(x_4); -lean_dec(x_1); -x_33 = lean_box(0); -x_34 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_34, 0, x_33); -lean_ctor_set(x_34, 1, x_26); -return x_34; -} } } else { -uint8_t x_35; +uint8_t x_33; lean_dec(x_4); +lean_dec(x_2); lean_dec(x_1); -x_35 = !lean_is_exclusive(x_14); -if (x_35 == 0) +x_33 = !lean_is_exclusive(x_14); +if (x_33 == 0) { return x_14; } else { -lean_object* x_36; lean_object* x_37; lean_object* x_38; -x_36 = lean_ctor_get(x_14, 0); -x_37 = lean_ctor_get(x_14, 1); -lean_inc(x_37); -lean_inc(x_36); +lean_object* x_34; lean_object* x_35; lean_object* x_36; +x_34 = lean_ctor_get(x_14, 0); +x_35 = lean_ctor_get(x_14, 1); +lean_inc(x_35); +lean_inc(x_34); lean_dec(x_14); -x_38 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_38, 0, x_36); -lean_ctor_set(x_38, 1, x_37); -return x_38; +x_36 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_36, 0, x_34); +lean_ctor_set(x_36, 1, x_35); +return x_36; } } } else { -lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; -x_39 = lean_ctor_get(x_7, 0); -x_40 = lean_ctor_get(x_7, 1); -x_41 = lean_ctor_get(x_7, 2); -x_42 = lean_ctor_get(x_7, 3); -x_43 = lean_ctor_get(x_7, 4); -x_44 = lean_ctor_get(x_7, 5); -lean_inc(x_44); -lean_inc(x_43); +lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; +x_37 = lean_ctor_get(x_7, 0); +x_38 = lean_ctor_get(x_7, 1); +x_39 = lean_ctor_get(x_7, 2); +x_40 = lean_ctor_get(x_7, 3); +x_41 = lean_ctor_get(x_7, 4); +x_42 = lean_ctor_get(x_7, 5); lean_inc(x_42); lean_inc(x_41); lean_inc(x_40); lean_inc(x_39); +lean_inc(x_38); +lean_inc(x_37); lean_dec(x_7); lean_inc(x_2); -x_45 = l_Lean_MetavarContext_instantiateMVarDeclMVars(x_40, x_2); -x_46 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_46, 0, x_39); -lean_ctor_set(x_46, 1, x_45); -lean_ctor_set(x_46, 2, x_41); -lean_ctor_set(x_46, 3, x_42); -lean_ctor_set(x_46, 4, x_43); -lean_ctor_set(x_46, 5, x_44); -lean_ctor_set(x_5, 0, x_46); -x_47 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalTactic), 3, 1); -lean_closure_set(x_47, 0, x_3); -x_48 = l_Lean_Elab_Term_runTactic___closed__1; -x_49 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); -lean_closure_set(x_49, 0, x_47); -lean_closure_set(x_49, 1, x_48); +x_43 = l_Lean_MetavarContext_instantiateMVarDeclMVars(x_38, x_2); +x_44 = lean_alloc_ctor(0, 6, 0); +lean_ctor_set(x_44, 0, x_37); +lean_ctor_set(x_44, 1, x_43); +lean_ctor_set(x_44, 2, x_39); +lean_ctor_set(x_44, 3, x_40); +lean_ctor_set(x_44, 4, x_41); +lean_ctor_set(x_44, 5, x_42); +lean_ctor_set(x_5, 0, x_44); +x_45 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalTactic), 3, 1); +lean_closure_set(x_45, 0, x_3); +x_46 = l_Lean_Elab_Term_runTactic___closed__1; +x_47 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); +lean_closure_set(x_47, 0, x_45); +lean_closure_set(x_47, 1, x_46); lean_inc(x_4); +lean_inc(x_2); lean_inc(x_1); -x_50 = l_Lean_Elab_Term_liftTacticElabM___rarg(x_1, x_2, x_49, x_4, x_5); -if (lean_obj_tag(x_50) == 0) +x_48 = l_Lean_Elab_Term_liftTacticElabM___rarg(x_1, x_2, x_47, x_4, x_5); +if (lean_obj_tag(x_48) == 0) { -lean_object* x_51; lean_object* x_52; lean_object* x_53; uint8_t x_54; -x_51 = lean_ctor_get(x_50, 0); -lean_inc(x_51); -x_52 = lean_ctor_get(x_50, 1); -lean_inc(x_52); -if (lean_is_exclusive(x_50)) { - lean_ctor_release(x_50, 0); - lean_ctor_release(x_50, 1); - x_53 = x_50; -} else { - lean_dec_ref(x_50); - x_53 = lean_box(0); -} -x_54 = l_List_isEmpty___rarg(x_51); -if (x_54 == 0) +lean_object* x_49; lean_object* x_50; lean_object* x_51; uint8_t x_52; +x_49 = lean_ctor_get(x_48, 0); +lean_inc(x_49); +x_50 = lean_ctor_get(x_48, 1); +lean_inc(x_50); +lean_dec(x_48); +lean_inc(x_1); +x_51 = l_Lean_Syntax_getTailWithInfo___main(x_1); +x_52 = l_List_isEmpty___rarg(x_49); +if (lean_obj_tag(x_51) == 0) { -lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; -lean_dec(x_53); -x_55 = l_Lean_Elab_Term_reportUnsolvedGoals(x_1, x_51, x_4, x_52); +if (x_52 == 0) +{ +lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; +lean_dec(x_2); +x_53 = l_Lean_Elab_Term_reportUnsolvedGoals(x_1, x_49, x_4, x_50); lean_dec(x_1); -x_56 = lean_ctor_get(x_55, 0); -lean_inc(x_56); -x_57 = lean_ctor_get(x_55, 1); -lean_inc(x_57); -if (lean_is_exclusive(x_55)) { - lean_ctor_release(x_55, 0); - lean_ctor_release(x_55, 1); - x_58 = x_55; +x_54 = lean_ctor_get(x_53, 0); +lean_inc(x_54); +x_55 = lean_ctor_get(x_53, 1); +lean_inc(x_55); +if (lean_is_exclusive(x_53)) { + lean_ctor_release(x_53, 0); + lean_ctor_release(x_53, 1); + x_56 = x_53; } else { - lean_dec_ref(x_55); - x_58 = lean_box(0); + lean_dec_ref(x_53); + x_56 = lean_box(0); } -if (lean_is_scalar(x_58)) { - x_59 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_56)) { + x_57 = lean_alloc_ctor(1, 2, 0); } else { - x_59 = x_58; + x_57 = x_56; } -lean_ctor_set(x_59, 0, x_56); -lean_ctor_set(x_59, 1, x_57); -return x_59; +lean_ctor_set(x_57, 0, x_54); +lean_ctor_set(x_57, 1, x_55); +return x_57; } else { -lean_object* x_60; lean_object* x_61; +lean_object* x_58; +lean_dec(x_49); +x_58 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars(x_1, x_2, x_4, x_50); +lean_dec(x_1); +return x_58; +} +} +else +{ +lean_dec(x_1); +if (x_52 == 0) +{ +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_dec(x_2); +x_59 = lean_ctor_get(x_51, 0); +lean_inc(x_59); lean_dec(x_51); -lean_dec(x_4); -lean_dec(x_1); -x_60 = lean_box(0); -if (lean_is_scalar(x_53)) { - x_61 = lean_alloc_ctor(0, 2, 0); -} else { - x_61 = x_53; -} -lean_ctor_set(x_61, 0, x_60); -lean_ctor_set(x_61, 1, x_52); -return x_61; -} -} -else -{ -lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; -lean_dec(x_4); -lean_dec(x_1); -x_62 = lean_ctor_get(x_50, 0); +x_60 = l_Lean_Elab_Term_reportUnsolvedGoals(x_59, x_49, x_4, x_50); +lean_dec(x_59); +x_61 = lean_ctor_get(x_60, 0); +lean_inc(x_61); +x_62 = lean_ctor_get(x_60, 1); lean_inc(x_62); -x_63 = lean_ctor_get(x_50, 1); -lean_inc(x_63); -if (lean_is_exclusive(x_50)) { - lean_ctor_release(x_50, 0); - lean_ctor_release(x_50, 1); - x_64 = x_50; +if (lean_is_exclusive(x_60)) { + lean_ctor_release(x_60, 0); + lean_ctor_release(x_60, 1); + x_63 = x_60; } else { - lean_dec_ref(x_50); - x_64 = lean_box(0); + lean_dec_ref(x_60); + x_63 = lean_box(0); } -if (lean_is_scalar(x_64)) { - x_65 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_63)) { + x_64 = lean_alloc_ctor(1, 2, 0); } else { - x_65 = x_64; + x_64 = x_63; } -lean_ctor_set(x_65, 0, x_62); -lean_ctor_set(x_65, 1, x_63); -return x_65; +lean_ctor_set(x_64, 0, x_61); +lean_ctor_set(x_64, 1, x_62); +return x_64; +} +else +{ +lean_object* x_65; lean_object* x_66; +lean_dec(x_49); +x_65 = lean_ctor_get(x_51, 0); +lean_inc(x_65); +lean_dec(x_51); +x_66 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars(x_65, x_2, x_4, x_50); +lean_dec(x_65); +return x_66; } } } else { -lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; 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; lean_object* x_84; lean_object* x_85; -x_66 = lean_ctor_get(x_5, 0); -x_67 = lean_ctor_get(x_5, 1); -x_68 = lean_ctor_get(x_5, 2); -x_69 = lean_ctor_get(x_5, 3); -x_70 = lean_ctor_get(x_5, 4); -x_71 = lean_ctor_get(x_5, 5); -lean_inc(x_71); -lean_inc(x_70); -lean_inc(x_69); -lean_inc(x_68); +lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_67 = lean_ctor_get(x_48, 0); lean_inc(x_67); -lean_inc(x_66); -lean_dec(x_5); -x_72 = lean_ctor_get(x_66, 0); -lean_inc(x_72); -x_73 = lean_ctor_get(x_66, 1); -lean_inc(x_73); -x_74 = lean_ctor_get(x_66, 2); -lean_inc(x_74); -x_75 = lean_ctor_get(x_66, 3); -lean_inc(x_75); -x_76 = lean_ctor_get(x_66, 4); -lean_inc(x_76); -x_77 = lean_ctor_get(x_66, 5); -lean_inc(x_77); -if (lean_is_exclusive(x_66)) { - lean_ctor_release(x_66, 0); - lean_ctor_release(x_66, 1); - lean_ctor_release(x_66, 2); - lean_ctor_release(x_66, 3); - lean_ctor_release(x_66, 4); - lean_ctor_release(x_66, 5); - x_78 = x_66; +x_68 = lean_ctor_get(x_48, 1); +lean_inc(x_68); +if (lean_is_exclusive(x_48)) { + lean_ctor_release(x_48, 0); + lean_ctor_release(x_48, 1); + x_69 = x_48; } else { - lean_dec_ref(x_66); - x_78 = lean_box(0); + lean_dec_ref(x_48); + x_69 = lean_box(0); +} +if (lean_is_scalar(x_69)) { + x_70 = lean_alloc_ctor(1, 2, 0); +} else { + x_70 = x_69; +} +lean_ctor_set(x_70, 0, x_67); +lean_ctor_set(x_70, 1, x_68); +return x_70; +} +} +} +else +{ +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; 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; +x_71 = lean_ctor_get(x_5, 0); +x_72 = lean_ctor_get(x_5, 1); +x_73 = lean_ctor_get(x_5, 2); +x_74 = lean_ctor_get(x_5, 3); +x_75 = lean_ctor_get(x_5, 4); +x_76 = lean_ctor_get(x_5, 5); +lean_inc(x_76); +lean_inc(x_75); +lean_inc(x_74); +lean_inc(x_73); +lean_inc(x_72); +lean_inc(x_71); +lean_dec(x_5); +x_77 = lean_ctor_get(x_71, 0); +lean_inc(x_77); +x_78 = lean_ctor_get(x_71, 1); +lean_inc(x_78); +x_79 = lean_ctor_get(x_71, 2); +lean_inc(x_79); +x_80 = lean_ctor_get(x_71, 3); +lean_inc(x_80); +x_81 = lean_ctor_get(x_71, 4); +lean_inc(x_81); +x_82 = lean_ctor_get(x_71, 5); +lean_inc(x_82); +if (lean_is_exclusive(x_71)) { + lean_ctor_release(x_71, 0); + lean_ctor_release(x_71, 1); + lean_ctor_release(x_71, 2); + lean_ctor_release(x_71, 3); + lean_ctor_release(x_71, 4); + lean_ctor_release(x_71, 5); + x_83 = x_71; +} else { + lean_dec_ref(x_71); + x_83 = lean_box(0); } lean_inc(x_2); -x_79 = l_Lean_MetavarContext_instantiateMVarDeclMVars(x_73, x_2); -if (lean_is_scalar(x_78)) { - x_80 = lean_alloc_ctor(0, 6, 0); +x_84 = l_Lean_MetavarContext_instantiateMVarDeclMVars(x_78, x_2); +if (lean_is_scalar(x_83)) { + x_85 = lean_alloc_ctor(0, 6, 0); } else { - x_80 = x_78; + x_85 = x_83; } -lean_ctor_set(x_80, 0, x_72); -lean_ctor_set(x_80, 1, x_79); -lean_ctor_set(x_80, 2, x_74); -lean_ctor_set(x_80, 3, x_75); -lean_ctor_set(x_80, 4, x_76); -lean_ctor_set(x_80, 5, x_77); -x_81 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_81, 0, x_80); -lean_ctor_set(x_81, 1, x_67); -lean_ctor_set(x_81, 2, x_68); -lean_ctor_set(x_81, 3, x_69); -lean_ctor_set(x_81, 4, x_70); -lean_ctor_set(x_81, 5, x_71); -x_82 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalTactic), 3, 1); -lean_closure_set(x_82, 0, x_3); -x_83 = l_Lean_Elab_Term_runTactic___closed__1; -x_84 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); -lean_closure_set(x_84, 0, x_82); -lean_closure_set(x_84, 1, x_83); +lean_ctor_set(x_85, 0, x_77); +lean_ctor_set(x_85, 1, x_84); +lean_ctor_set(x_85, 2, x_79); +lean_ctor_set(x_85, 3, x_80); +lean_ctor_set(x_85, 4, x_81); +lean_ctor_set(x_85, 5, x_82); +x_86 = lean_alloc_ctor(0, 6, 0); +lean_ctor_set(x_86, 0, x_85); +lean_ctor_set(x_86, 1, x_72); +lean_ctor_set(x_86, 2, x_73); +lean_ctor_set(x_86, 3, x_74); +lean_ctor_set(x_86, 4, x_75); +lean_ctor_set(x_86, 5, x_76); +x_87 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalTactic), 3, 1); +lean_closure_set(x_87, 0, x_3); +x_88 = l_Lean_Elab_Term_runTactic___closed__1; +x_89 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); +lean_closure_set(x_89, 0, x_87); +lean_closure_set(x_89, 1, x_88); lean_inc(x_4); +lean_inc(x_2); lean_inc(x_1); -x_85 = l_Lean_Elab_Term_liftTacticElabM___rarg(x_1, x_2, x_84, x_4, x_81); -if (lean_obj_tag(x_85) == 0) +x_90 = l_Lean_Elab_Term_liftTacticElabM___rarg(x_1, x_2, x_89, x_4, x_86); +if (lean_obj_tag(x_90) == 0) { -lean_object* x_86; lean_object* x_87; lean_object* x_88; uint8_t x_89; -x_86 = lean_ctor_get(x_85, 0); -lean_inc(x_86); -x_87 = lean_ctor_get(x_85, 1); -lean_inc(x_87); -if (lean_is_exclusive(x_85)) { - lean_ctor_release(x_85, 0); - lean_ctor_release(x_85, 1); - x_88 = x_85; -} else { - lean_dec_ref(x_85); - x_88 = lean_box(0); -} -x_89 = l_List_isEmpty___rarg(x_86); -if (x_89 == 0) -{ -lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; -lean_dec(x_88); -x_90 = l_Lean_Elab_Term_reportUnsolvedGoals(x_1, x_86, x_4, x_87); -lean_dec(x_1); +lean_object* x_91; lean_object* x_92; lean_object* x_93; uint8_t x_94; x_91 = lean_ctor_get(x_90, 0); lean_inc(x_91); x_92 = lean_ctor_get(x_90, 1); lean_inc(x_92); +lean_dec(x_90); +lean_inc(x_1); +x_93 = l_Lean_Syntax_getTailWithInfo___main(x_1); +x_94 = l_List_isEmpty___rarg(x_91); +if (lean_obj_tag(x_93) == 0) +{ +if (x_94 == 0) +{ +lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; +lean_dec(x_2); +x_95 = l_Lean_Elab_Term_reportUnsolvedGoals(x_1, x_91, x_4, x_92); +lean_dec(x_1); +x_96 = lean_ctor_get(x_95, 0); +lean_inc(x_96); +x_97 = lean_ctor_get(x_95, 1); +lean_inc(x_97); +if (lean_is_exclusive(x_95)) { + lean_ctor_release(x_95, 0); + lean_ctor_release(x_95, 1); + x_98 = x_95; +} else { + lean_dec_ref(x_95); + x_98 = lean_box(0); +} +if (lean_is_scalar(x_98)) { + x_99 = lean_alloc_ctor(1, 2, 0); +} else { + x_99 = x_98; +} +lean_ctor_set(x_99, 0, x_96); +lean_ctor_set(x_99, 1, x_97); +return x_99; +} +else +{ +lean_object* x_100; +lean_dec(x_91); +x_100 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars(x_1, x_2, x_4, x_92); +lean_dec(x_1); +return x_100; +} +} +else +{ +lean_dec(x_1); +if (x_94 == 0) +{ +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_dec(x_2); +x_101 = lean_ctor_get(x_93, 0); +lean_inc(x_101); +lean_dec(x_93); +x_102 = l_Lean_Elab_Term_reportUnsolvedGoals(x_101, x_91, x_4, x_92); +lean_dec(x_101); +x_103 = lean_ctor_get(x_102, 0); +lean_inc(x_103); +x_104 = lean_ctor_get(x_102, 1); +lean_inc(x_104); +if (lean_is_exclusive(x_102)) { + lean_ctor_release(x_102, 0); + lean_ctor_release(x_102, 1); + x_105 = x_102; +} else { + lean_dec_ref(x_102); + x_105 = lean_box(0); +} +if (lean_is_scalar(x_105)) { + x_106 = lean_alloc_ctor(1, 2, 0); +} else { + x_106 = x_105; +} +lean_ctor_set(x_106, 0, x_103); +lean_ctor_set(x_106, 1, x_104); +return x_106; +} +else +{ +lean_object* x_107; lean_object* x_108; +lean_dec(x_91); +x_107 = lean_ctor_get(x_93, 0); +lean_inc(x_107); +lean_dec(x_93); +x_108 = l_Lean_Elab_Term_ensureAssignmentHasNoMVars(x_107, x_2, x_4, x_92); +lean_dec(x_107); +return x_108; +} +} +} +else +{ +lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_109 = lean_ctor_get(x_90, 0); +lean_inc(x_109); +x_110 = lean_ctor_get(x_90, 1); +lean_inc(x_110); if (lean_is_exclusive(x_90)) { lean_ctor_release(x_90, 0); lean_ctor_release(x_90, 1); - x_93 = x_90; + x_111 = x_90; } else { lean_dec_ref(x_90); - x_93 = lean_box(0); + x_111 = lean_box(0); } -if (lean_is_scalar(x_93)) { - x_94 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_111)) { + x_112 = lean_alloc_ctor(1, 2, 0); } else { - x_94 = x_93; + x_112 = x_111; } -lean_ctor_set(x_94, 0, x_91); -lean_ctor_set(x_94, 1, x_92); -return x_94; -} -else -{ -lean_object* x_95; lean_object* x_96; -lean_dec(x_86); -lean_dec(x_4); -lean_dec(x_1); -x_95 = lean_box(0); -if (lean_is_scalar(x_88)) { - x_96 = lean_alloc_ctor(0, 2, 0); -} else { - x_96 = x_88; -} -lean_ctor_set(x_96, 0, x_95); -lean_ctor_set(x_96, 1, x_87); -return x_96; -} -} -else -{ -lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; -lean_dec(x_4); -lean_dec(x_1); -x_97 = lean_ctor_get(x_85, 0); -lean_inc(x_97); -x_98 = lean_ctor_get(x_85, 1); -lean_inc(x_98); -if (lean_is_exclusive(x_85)) { - lean_ctor_release(x_85, 0); - lean_ctor_release(x_85, 1); - x_99 = x_85; -} else { - lean_dec_ref(x_85); - x_99 = lean_box(0); -} -if (lean_is_scalar(x_99)) { - x_100 = lean_alloc_ctor(1, 2, 0); -} else { - x_100 = x_99; -} -lean_ctor_set(x_100, 0, x_97); -lean_ctor_set(x_100, 1, x_98); -return x_100; +lean_ctor_set(x_112, 0, x_109); +lean_ctor_set(x_112, 1, x_110); +return x_112; } } } @@ -1158,6 +1351,12 @@ l_Lean_Elab_Term_reportUnsolvedGoals___closed__3 = _init_l_Lean_Elab_Term_report lean_mark_persistent(l_Lean_Elab_Term_reportUnsolvedGoals___closed__3); l_Lean_Elab_Term_reportUnsolvedGoals___closed__4 = _init_l_Lean_Elab_Term_reportUnsolvedGoals___closed__4(); lean_mark_persistent(l_Lean_Elab_Term_reportUnsolvedGoals___closed__4); +l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__1 = _init_l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__1(); +lean_mark_persistent(l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__1); +l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__2 = _init_l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__2(); +lean_mark_persistent(l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__2); +l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__3 = _init_l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__3(); +lean_mark_persistent(l_Lean_Elab_Term_ensureAssignmentHasNoMVars___closed__3); l_Lean_Elab_Term_runTactic___closed__1 = _init_l_Lean_Elab_Term_runTactic___closed__1(); lean_mark_persistent(l_Lean_Elab_Term_runTactic___closed__1); return lean_mk_io_result(lean_box(0)); diff --git a/stage0/stdlib/Init/Lean/Elab/Tactic/Basic.c b/stage0/stdlib/Init/Lean/Elab/Tactic/Basic.c index fa5f99fa16..2ee1ae2668 100644 --- a/stage0/stdlib/Init/Lean/Elab/Tactic/Basic.c +++ b/stage0/stdlib/Init/Lean/Elab/Tactic/Basic.c @@ -40,6 +40,7 @@ lean_object* l_Lean_Elab_Tactic_mkTacticAttribute(lean_object*); lean_object* l_Lean_Elab_Tactic_getMCtx___rarg(lean_object*); extern lean_object* l_Lean_MessageData_ofList___closed__3; lean_object* lean_array_uget(lean_object*, size_t); +lean_object* l_Lean_Elab_Term_assignExprMVar___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___lambda__1___closed__2; lean_object* l_Lean_Elab_Tactic_evalIntro___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_PersistentHashMap_findAtAux___main___at_Lean_Elab_Tactic_evalTactic___main___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -78,6 +79,7 @@ lean_object* lean_array_get_size(lean_object*); uint8_t l_Lean_SMap_contains___at_Lean_Elab_Tactic_addBuiltinTactic___spec__1(lean_object*, lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_getMCtx___boxed(lean_object*); +lean_object* l_Lean_Elab_Tactic_getGoals___boxed(lean_object*); lean_object* l_PersistentArray_push___rarg(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___closed__2; extern lean_object* l_String_splitAux___main___closed__1; @@ -97,16 +99,17 @@ extern lean_object* l___private_Init_Lean_Elab_Util_8__regTraceClasses___closed_ lean_object* l_Lean_Elab_Term_trace___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_foldlStepMAux___main___at_Lean_Elab_Tactic_evalTactic___main___spec__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_tacticElabAttribute___closed__2; +lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalExact(lean_object*); extern lean_object* l_Lean_AttributeImpl_inhabited___closed__2; lean_object* lean_nat_add(lean_object*, lean_object*); lean_object* l_IO_ofExcept___at_Lean_registerClassAttr___spec__1(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___closed__1; +lean_object* l_Lean_Elab_Tactic_getMainGoal___closed__2; lean_object* l_Lean_Elab_Tactic_monadLog___closed__3; extern lean_object* l_Lean_Parser_Tactic_intro___elambda__1___closed__1; extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__1; lean_object* l_Lean_Meta_intro(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Meta_Exception_toMessageData___closed__45; -lean_object* l_Lean_Elab_Tactic_liftMetaTactic___closed__1; lean_object* l_Array_isEqvAux___main___at_Lean_Elab_Tactic_withMVarContext___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_declareBuiltinTactic___closed__7; extern lean_object* l_Lean_Meta_dbgTrace___rarg___closed__1; @@ -132,15 +135,19 @@ lean_object* l_PersistentHashMap_contains___at_Lean_Elab_Tactic_addBuiltinTactic lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_liftTermElabM(lean_object*); lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalAssumption___closed__4; +lean_object* l_Lean_Elab_Tactic_evalExact___closed__1; +lean_object* l_Lean_Elab_Tactic_getGoals___rarg(lean_object*); lean_object* l_PersistentHashMap_find_x3f___at_Lean_Elab_Tactic_evalTactic___main___spec__2___boxed(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_monadLog___lambda__2(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_resetSynthInstanceCache___closed__1; lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalAssumption___closed__2; uint8_t l_Array_isEqvAux___main___at_Lean_Elab_Tactic_withMVarContext___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t l_Lean_Name_hash(lean_object*); +lean_object* l_Lean_Elab_Tactic_getMainGoal___closed__1; extern lean_object* l_Lean_Elab_Term_State_inhabited___closed__2; extern lean_object* l_Char_HasRepr___closed__1; lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalAssumption___closed__1; +extern lean_object* l_Lean_Parser_Tactic_exact___elambda__1___closed__1; lean_object* l_Lean_Elab_Tactic_getMVarDecl___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_resetSynthInstanceCache(lean_object*, lean_object*); lean_object* l_PersistentHashMap_containsAux___main___at_Lean_Elab_Tactic_addBuiltinTactic___spec__5___boxed(lean_object*, lean_object*, lean_object*); @@ -155,6 +162,7 @@ lean_object* l_Lean_Elab_Tactic_State_inhabited___closed__1; lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalSeq___closed__2; lean_object* l_Lean_Elab_Tactic_monadLog___lambda__2___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_throwUnsupportedSyntax___boxed(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_getMainGoal(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_declareBuiltinParser___closed__7; lean_object* l_Lean_Elab_Tactic_monadLog___closed__8; extern lean_object* l_Lean_Options_empty; @@ -167,6 +175,7 @@ lean_object* l_Lean_Elab_Tactic_tacticElabAttribute___closed__1; lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___lambda__1___closed__3; lean_object* l_Lean_registerBuiltinAttribute(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_monadLog___closed__1; +lean_object* l_Lean_Elab_Term_ensureHasType___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_mkElabAttribute___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___closed__5; lean_object* l_mkHashMapImp___rarg(lean_object*); @@ -179,6 +188,7 @@ extern lean_object* l_Lean_Parser_Term_seq___elambda__1___closed__1; lean_object* l_Lean_ConstantInfo_type(lean_object*); lean_object* l_Lean_Elab_Tactic_State_inhabited; lean_object* l_HashMapImp_find_x3f___at_Lean_Elab_Tactic_evalTactic___main___spec__5(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_evalExact___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t l_USize_land(size_t, size_t); extern lean_object* l_Lean_nullKind___closed__2; lean_object* l_Lean_Elab_Tactic_monadLog___lambda__1(lean_object*, lean_object*, lean_object*); @@ -188,6 +198,7 @@ lean_object* l_Lean_Elab_Tactic_liftMetaTactic___lambda__1(lean_object*, lean_ob lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalAssumption(lean_object*); lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___closed__3; lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___lambda__1___closed__5; +lean_object* l_Lean_Elab_Tactic_evalExact___lambda__1(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* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_throwUnsupportedSyntax(lean_object*); @@ -196,6 +207,7 @@ lean_object* l_Lean_Elab_Tactic_withLCtx(lean_object*); lean_object* l_Lean_Elab_Term_liftMetaM___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_evalTactic___main___closed__4; lean_object* l_Lean_Elab_Tactic_registerBuiltinTacticAttr___lambda__1___closed__4; +lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__1; lean_object* l_Array_foldlStepMAux___main___at_Lean_Elab_Tactic_evalTactic___main___spec__7___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_evalAssumption___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_declareBuiltinTactic___closed__4; @@ -207,9 +219,12 @@ lean_object* l_Lean_Elab_Tactic_liftMetaTactic(lean_object*, lean_object*, lean_ lean_object* l_Lean_Elab_Tactic_evalTactic___main___closed__1; lean_object* l_Lean_Elab_Tactic_evalTactic___main___lambda__1___boxed(lean_object*, lean_object*); lean_object* l_PersistentHashMap_empty___at_Lean_Elab_Tactic_mkBuiltinTacticTable___spec__3; +lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__2; +lean_object* l_Lean_Elab_Tactic_ensureHasNoMVars___closed__2; lean_object* l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_liftMetaTactic___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_evalTactic___main(lean_object*, lean_object*, lean_object*); +uint8_t l_Lean_Expr_hasMVar(lean_object*); lean_object* l_Lean_nameToExprAux___main(lean_object*); lean_object* l_Lean_Elab_Tactic_declareBuiltinTactic___closed__1; lean_object* l_Lean_Elab_Term_throwError___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -218,11 +233,13 @@ lean_object* l_Lean_Elab_Tactic_monadLog___closed__6; lean_object* l_Lean_Elab_Tactic_evalSeq(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Environment_addAndCompile(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getKind(lean_object*); +lean_object* l_Lean_Elab_Tactic_ensureHasNoMVars___closed__1; lean_object* l_Lean_Elab_Tactic_resettingSynthInstanceCache(lean_object*); lean_object* l_Lean_Elab_Tactic_evalIntro___closed__1; lean_object* l_Lean_Elab_Tactic_evalAssumption(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_monadLog___closed__2; lean_object* l_Lean_Elab_Tactic_addBuiltinTactic(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_elabTerm___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_getOptions___boxed(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_declareBuiltinTactic___closed__2; lean_object* l_Lean_Elab_Tactic_withMVarContext___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -237,7 +254,10 @@ lean_object* l_Lean_Elab_Tactic_mkBuiltinTacticTable(lean_object*); lean_object* l_Lean_Elab_Tactic_addBuiltinTactic___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_SMap_empty___at_Lean_Elab_Tactic_mkBuiltinTacticTable___spec__1___closed__1; lean_object* l_Lean_Elab_Tactic_addBuiltinTactic___closed__1; +lean_object* l_Lean_Elab_Tactic_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_ensureHasNoMVars(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_instantiateMVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_elabTerm(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_SMap_empty___at_Lean_Elab_Tactic_mkBuiltinTacticTable___spec__1___closed__2; lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_liftTermElabM___rarg(lean_object*, lean_object*, lean_object*); @@ -246,6 +266,7 @@ lean_object* l_Lean_Elab_Tactic_tacticElabAttribute___closed__5; lean_object* l_Lean_Elab_Tactic_getEnv___rarg(lean_object*); lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalSeq___closed__3; lean_object* l_Lean_Meta_intro1(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_withMacroExpansion___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_AssocList_find___main___at_Lean_Elab_Tactic_evalTactic___main___spec__6(lean_object*, lean_object*); @@ -263,6 +284,8 @@ lean_object* l_Lean_Elab_Tactic_throwUnsupportedSyntax___rarg(lean_object*, lean uint8_t l_AssocList_contains___main___at_Lean_Elab_Tactic_addBuiltinTactic___spec__3(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_getMVarDecl(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_evalTactic___main___lambda__1(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_ensureHasNoMVars___closed__3; +lean_object* l_Lean_Elab_Tactic_getMainGoal___closed__3; lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalIntro___closed__2; lean_object* l_Lean_Elab_Tactic_monadLog___closed__11; @@ -275,7 +298,6 @@ lean_object* l_Lean_MetavarContext_getDecl(lean_object*, lean_object*); uint8_t l_HashMapImp_contains___at_Lean_Elab_Tactic_addBuiltinTactic___spec__2(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_resetSynthInstanceCache___boxed(lean_object*); lean_object* l_Lean_Elab_Tactic_monadLog___lambda__1___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Tactic_liftMetaTactic___closed__3; extern lean_object* l_Lean_Parser_regBuiltinTacticParserAttr___closed__4; lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalAssumption___closed__3; lean_object* l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); @@ -285,13 +307,17 @@ extern lean_object* l___private_Init_Lean_Elab_Util_8__regTraceClasses___closed_ lean_object* l_Lean_Elab_Tactic_monadLog___lambda__3___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_usize_to_nat(size_t); lean_object* l_Lean_Elab_Tactic_getCurrMacroScope(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_updateGoals(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_resettingSynthInstanceCache___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_throwUnsupportedSyntax___rarg___closed__1; +lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__3; +lean_object* l_Lean_indentExpr(lean_object*); lean_object* l_Lean_Elab_Tactic_monadQuotation___closed__3; lean_object* l_IO_ofExcept___at___private_Init_Lean_Elab_Util_6__ElabAttribute_add___spec__1(lean_object*, lean_object*); lean_object* l_Lean_mkConst(lean_object*, lean_object*); lean_object* l_Lean_Elab_Tactic_getCurrMacroScope___boxed(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Tactic_liftMetaTactic___closed__2; +lean_object* l_Lean_Elab_Tactic_getGoals(lean_object*); +lean_object* l_Lean_Elab_Tactic_evalExact(lean_object*, lean_object*, lean_object*); extern lean_object* l___private_Init_Lean_Elab_Term_8__elabTermUsing___main___closed__3; extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__4; lean_object* l_Lean_Elab_Tactic_traceAtCmdPos(lean_object*, lean_object*, lean_object*, lean_object*); @@ -304,6 +330,7 @@ lean_object* l_AssocList_contains___main___at_Lean_Elab_Tactic_addBuiltinTactic_ lean_object* l_Lean_Elab_Tactic_monadLog___closed__4; lean_object* l_Lean_Elab_Tactic_getMCtx(lean_object*); lean_object* l_Lean_Elab_Tactic_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Tactic_updateGoals___boxed(lean_object*, lean_object*, lean_object*); extern lean_object* l___private_Init_Lean_Parser_Parser_18__BuiltinParserAttribute_add___closed__2; lean_object* l_mkHashMap___at_Lean_Elab_Tactic_mkBuiltinTacticTable___spec__2(lean_object*); lean_object* l_Lean_Elab_Tactic_monadLog___closed__9; @@ -745,6 +772,45 @@ x_5 = l_Lean_Elab_Tactic_liftTermElabM___rarg(x_4, x_2, x_3); return x_5; } } +lean_object* l_Lean_Elab_Tactic_assignExprMVar(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; +x_5 = lean_alloc_closure((void*)(l_Lean_Elab_Term_assignExprMVar___boxed), 4, 2); +lean_closure_set(x_5, 0, x_1); +lean_closure_set(x_5, 1, x_2); +x_6 = l_Lean_Elab_Tactic_liftTermElabM___rarg(x_5, x_3, x_4); +return x_6; +} +} +lean_object* l_Lean_Elab_Tactic_ensureHasType(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; +x_6 = lean_alloc_closure((void*)(l_Lean_Elab_Term_ensureHasType___boxed), 5, 3); +lean_closure_set(x_6, 0, x_1); +lean_closure_set(x_6, 1, x_2); +lean_closure_set(x_6, 2, x_3); +x_7 = l_Lean_Elab_Tactic_liftTermElabM___rarg(x_6, x_4, x_5); +return x_7; +} +} +lean_object* l_Lean_Elab_Tactic_elabTerm(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +uint8_t x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_5 = 1; +x_6 = lean_box(x_5); +x_7 = lean_box(x_5); +x_8 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabTerm___boxed), 6, 4); +lean_closure_set(x_8, 0, x_1); +lean_closure_set(x_8, 1, x_2); +lean_closure_set(x_8, 2, x_6); +lean_closure_set(x_8, 3, x_7); +x_9 = l_Lean_Elab_Tactic_liftTermElabM___rarg(x_8, x_3, x_4); +return x_9; +} +} lean_object* l_ReaderT_read___at_Lean_Elab_Tactic_monadLog___spec__1(lean_object* x_1, lean_object* x_2) { _start: { @@ -9668,43 +9734,36 @@ lean_dec(x_1); return x_5; } } -lean_object* l_Lean_Elab_Tactic_liftMetaTactic___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_Lean_Elab_Tactic_getGoals___rarg(lean_object* x_1) { _start: { -uint8_t x_5; -x_5 = !lean_is_exclusive(x_4); -if (x_5 == 0) +lean_object* x_2; lean_object* x_3; +x_2 = lean_ctor_get(x_1, 1); +lean_inc(x_2); +x_3 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_3, 0, x_2); +lean_ctor_set(x_3, 1, x_1); +return x_3; +} +} +lean_object* l_Lean_Elab_Tactic_getGoals(lean_object* x_1) { +_start: { -lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; -x_6 = lean_ctor_get(x_4, 1); -lean_dec(x_6); -x_7 = l_List_append___rarg(x_2, x_1); -lean_ctor_set(x_4, 1, x_7); -x_8 = lean_box(0); -x_9 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_9, 0, x_8); -lean_ctor_set(x_9, 1, x_4); -return x_9; +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_getGoals___rarg), 1, 0); +return x_2; } -else +} +lean_object* l_Lean_Elab_Tactic_getGoals___boxed(lean_object* x_1) { +_start: { -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; -x_10 = lean_ctor_get(x_4, 0); -lean_inc(x_10); -lean_dec(x_4); -x_11 = l_List_append___rarg(x_2, x_1); -x_12 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_12, 0, x_10); -lean_ctor_set(x_12, 1, x_11); -x_13 = lean_box(0); -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; +lean_object* x_2; +x_2 = l_Lean_Elab_Tactic_getGoals(x_1); +lean_dec(x_1); +return x_2; } } -} -lean_object* _init_l_Lean_Elab_Tactic_liftMetaTactic___closed__1() { +lean_object* _init_l_Lean_Elab_Tactic_getMainGoal___closed__1() { _start: { lean_object* x_1; @@ -9712,48 +9771,291 @@ x_1 = lean_mk_string("no goals to be solved"); return x_1; } } -lean_object* _init_l_Lean_Elab_Tactic_liftMetaTactic___closed__2() { +lean_object* _init_l_Lean_Elab_Tactic_getMainGoal___closed__2() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Elab_Tactic_liftMetaTactic___closed__1; +x_1 = l_Lean_Elab_Tactic_getMainGoal___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_Tactic_liftMetaTactic___closed__3() { +lean_object* _init_l_Lean_Elab_Tactic_getMainGoal___closed__3() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Elab_Tactic_liftMetaTactic___closed__2; +x_1 = l_Lean_Elab_Tactic_getMainGoal___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_Tactic_getMainGoal(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; +x_4 = l_Lean_Elab_Tactic_getGoals___rarg(x_3); +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +if (lean_obj_tag(x_5) == 0) +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); +lean_dec(x_4); +x_7 = l_Lean_Elab_Tactic_getMainGoal___closed__3; +x_8 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_7, x_2, x_6); +return x_8; +} +else +{ +uint8_t x_9; +lean_dec(x_2); +lean_dec(x_1); +x_9 = !lean_is_exclusive(x_4); +if (x_9 == 0) +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; +x_10 = lean_ctor_get(x_4, 0); +lean_dec(x_10); +x_11 = lean_ctor_get(x_5, 0); +lean_inc(x_11); +x_12 = lean_ctor_get(x_5, 1); +lean_inc(x_12); +lean_dec(x_5); +x_13 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_13, 0, x_11); +lean_ctor_set(x_13, 1, x_12); +lean_ctor_set(x_4, 0, x_13); +return x_4; +} +else +{ +lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_14 = lean_ctor_get(x_4, 1); +lean_inc(x_14); +lean_dec(x_4); +x_15 = lean_ctor_get(x_5, 0); +lean_inc(x_15); +x_16 = lean_ctor_get(x_5, 1); +lean_inc(x_16); +lean_dec(x_5); +x_17 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_17, 0, x_15); +lean_ctor_set(x_17, 1, x_16); +x_18 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_18, 0, x_17); +lean_ctor_set(x_18, 1, x_14); +return x_18; +} +} +} +} +lean_object* l_Lean_Elab_Tactic_updateGoals(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +uint8_t x_4; +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 1); +lean_dec(x_5); +lean_ctor_set(x_3, 1, x_1); +x_6 = lean_box(0); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_6); +lean_ctor_set(x_7, 1, x_3); +return x_7; +} +else +{ +lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; +x_8 = lean_ctor_get(x_3, 0); +lean_inc(x_8); +lean_dec(x_3); +x_9 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_9, 0, x_8); +lean_ctor_set(x_9, 1, x_1); +x_10 = lean_box(0); +x_11 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_11, 0, x_10); +lean_ctor_set(x_11, 1, x_9); +return x_11; +} +} +} +lean_object* l_Lean_Elab_Tactic_updateGoals___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Tactic_updateGoals(x_1, x_2, x_3); +lean_dec(x_2); +return x_4; +} +} +lean_object* _init_l_Lean_Elab_Tactic_ensureHasNoMVars___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("tactic failed, resulting expression contains metavariables"); +return x_1; +} +} +lean_object* _init_l_Lean_Elab_Tactic_ensureHasNoMVars___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Tactic_ensureHasNoMVars___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_Tactic_ensureHasNoMVars___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Tactic_ensureHasNoMVars___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_Tactic_ensureHasNoMVars(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; +lean_inc(x_3); +lean_inc(x_1); +x_5 = l_Lean_Elab_Tactic_instantiateMVars(x_1, x_2, x_3, x_4); +if (lean_obj_tag(x_5) == 0) +{ +uint8_t x_6; +x_6 = !lean_is_exclusive(x_5); +if (x_6 == 0) +{ +lean_object* x_7; lean_object* x_8; uint8_t x_9; +x_7 = lean_ctor_get(x_5, 0); +x_8 = lean_ctor_get(x_5, 1); +x_9 = l_Lean_Expr_hasMVar(x_7); +if (x_9 == 0) +{ +lean_object* x_10; +lean_dec(x_7); +lean_dec(x_3); +lean_dec(x_1); +x_10 = lean_box(0); +lean_ctor_set(x_5, 0, x_10); +return x_5; +} +else +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; +lean_free_object(x_5); +x_11 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_11, 0, x_7); +x_12 = l_Lean_indentExpr(x_11); +x_13 = l_Lean_Elab_Tactic_ensureHasNoMVars___closed__3; +x_14 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_14, 0, x_13); +lean_ctor_set(x_14, 1, x_12); +x_15 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_14, x_3, x_8); +return x_15; +} +} +else +{ +lean_object* x_16; lean_object* x_17; uint8_t x_18; +x_16 = lean_ctor_get(x_5, 0); +x_17 = lean_ctor_get(x_5, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_5); +x_18 = l_Lean_Expr_hasMVar(x_16); +if (x_18 == 0) +{ +lean_object* x_19; lean_object* x_20; +lean_dec(x_16); +lean_dec(x_3); +lean_dec(x_1); +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_17); +return x_20; +} +else +{ +lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_21 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_21, 0, x_16); +x_22 = l_Lean_indentExpr(x_21); +x_23 = l_Lean_Elab_Tactic_ensureHasNoMVars___closed__3; +x_24 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_24, 0, x_23); +lean_ctor_set(x_24, 1, x_22); +x_25 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_24, x_3, x_17); +return x_25; +} +} +} +else +{ +uint8_t x_26; +lean_dec(x_3); +lean_dec(x_1); +x_26 = !lean_is_exclusive(x_5); +if (x_26 == 0) +{ +return x_5; +} +else +{ +lean_object* x_27; lean_object* x_28; lean_object* x_29; +x_27 = lean_ctor_get(x_5, 0); +x_28 = lean_ctor_get(x_5, 1); +lean_inc(x_28); +lean_inc(x_27); +lean_dec(x_5); +x_29 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_29, 0, x_27); +lean_ctor_set(x_29, 1, x_28); +return x_29; +} +} +} +} +lean_object* l_Lean_Elab_Tactic_liftMetaTactic___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; lean_object* x_6; +x_5 = l_List_append___rarg(x_2, x_1); +x_6 = l_Lean_Elab_Tactic_updateGoals(x_5, x_3, x_4); +return x_6; +} +} lean_object* l_Lean_Elab_Tactic_liftMetaTactic(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; -x_5 = lean_ctor_get(x_4, 1); -lean_inc(x_5); +lean_inc(x_3); +lean_inc(x_1); +x_5 = l_Lean_Elab_Tactic_getMainGoal(x_1, x_3, x_4); if (lean_obj_tag(x_5) == 0) { -lean_object* x_6; lean_object* x_7; -lean_dec(x_2); -x_6 = l_Lean_Elab_Tactic_liftMetaTactic___closed__3; -x_7 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_6, x_3, x_4); -return x_7; -} -else -{ -lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; -x_8 = lean_ctor_get(x_5, 0); -lean_inc(x_8); -x_9 = lean_ctor_get(x_5, 1); -lean_inc(x_9); +lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_6 = lean_ctor_get(x_5, 0); +lean_inc(x_6); +x_7 = lean_ctor_get(x_5, 1); +lean_inc(x_7); lean_dec(x_5); +x_8 = lean_ctor_get(x_6, 0); +lean_inc(x_8); +x_9 = lean_ctor_get(x_6, 1); +lean_inc(x_9); +lean_dec(x_6); lean_inc(x_8); x_10 = lean_apply_1(x_2, x_8); x_11 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaM___rarg), 4, 2); @@ -9764,10 +10066,35 @@ lean_closure_set(x_12, 0, x_9); x_13 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); lean_closure_set(x_13, 0, x_11); lean_closure_set(x_13, 1, x_12); -x_14 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_8, x_13, x_3, x_4); +x_14 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_8, x_13, x_3, x_7); lean_dec(x_8); return x_14; } +else +{ +uint8_t x_15; +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_15 = !lean_is_exclusive(x_5); +if (x_15 == 0) +{ +return x_5; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_5, 0); +x_17 = lean_ctor_get(x_5, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_5); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} } } lean_object* l_Lean_Elab_Tactic_liftMetaTactic___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { @@ -9873,23 +10200,22 @@ lean_object* l_Lean_Elab_Tactic_evalAssumption(lean_object* x_1, lean_object* x_ _start: { lean_object* x_4; -x_4 = lean_ctor_get(x_3, 1); -lean_inc(x_4); +lean_inc(x_2); +lean_inc(x_1); +x_4 = l_Lean_Elab_Tactic_getMainGoal(x_1, x_2, x_3); if (lean_obj_tag(x_4) == 0) { -lean_object* x_5; lean_object* x_6; -x_5 = l_Lean_Elab_Tactic_liftMetaTactic___closed__3; -x_6 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_5, x_2, x_3); -return x_6; -} -else -{ -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; -x_7 = lean_ctor_get(x_4, 0); -lean_inc(x_7); -x_8 = lean_ctor_get(x_4, 1); -lean_inc(x_8); +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; +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); lean_dec(x_4); +x_7 = lean_ctor_get(x_5, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_5, 1); +lean_inc(x_8); +lean_dec(x_5); lean_inc(x_7); x_9 = lean_alloc_closure((void*)(l_Lean_Meta_assumption___boxed), 3, 1); lean_closure_set(x_9, 0, x_7); @@ -9905,10 +10231,34 @@ lean_closure_set(x_13, 0, x_8); x_14 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); lean_closure_set(x_14, 0, x_12); lean_closure_set(x_14, 1, x_13); -x_15 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_7, x_14, x_2, x_3); +x_15 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_7, x_14, x_2, x_6); lean_dec(x_7); return x_15; } +else +{ +uint8_t x_16; +lean_dec(x_2); +lean_dec(x_1); +x_16 = !lean_is_exclusive(x_4); +if (x_16 == 0) +{ +return x_4; +} +else +{ +lean_object* x_17; lean_object* x_18; lean_object* x_19; +x_17 = lean_ctor_get(x_4, 0); +x_18 = lean_ctor_get(x_4, 1); +lean_inc(x_18); +lean_inc(x_17); +lean_dec(x_4); +x_19 = lean_alloc_ctor(1, 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_Elab_Tactic_evalAssumption___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { @@ -10118,30 +10468,30 @@ return x_3; lean_object* l_Lean_Elab_Tactic_evalIntro(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { -uint8_t x_4; lean_object* x_61; uint8_t x_62; -x_61 = l_Lean_Elab_Tactic_evalIntro___closed__1; +uint8_t x_4; lean_object* x_73; uint8_t x_74; +x_73 = l_Lean_Elab_Tactic_evalIntro___closed__1; lean_inc(x_1); -x_62 = l_Lean_Syntax_isOfKind(x_1, x_61); -if (x_62 == 0) +x_74 = l_Lean_Syntax_isOfKind(x_1, x_73); +if (x_74 == 0) { -uint8_t x_63; -x_63 = 0; -x_4 = x_63; -goto block_60; +uint8_t x_75; +x_75 = 0; +x_4 = x_75; +goto block_72; } else { -lean_object* x_64; lean_object* x_65; lean_object* x_66; uint8_t x_67; -x_64 = l_Lean_Syntax_getArgs(x_1); -x_65 = lean_array_get_size(x_64); -lean_dec(x_64); -x_66 = lean_unsigned_to_nat(2u); -x_67 = lean_nat_dec_eq(x_65, x_66); -lean_dec(x_65); -x_4 = x_67; -goto block_60; +lean_object* x_76; lean_object* x_77; lean_object* x_78; uint8_t x_79; +x_76 = l_Lean_Syntax_getArgs(x_1); +x_77 = lean_array_get_size(x_76); +lean_dec(x_76); +x_78 = lean_unsigned_to_nat(2u); +x_79 = lean_nat_dec_eq(x_77, x_78); +lean_dec(x_77); +x_4 = x_79; +goto block_72; } -block_60: +block_72: { uint8_t x_5; x_5 = l_coeDecidableEq(x_4); @@ -10162,24 +10512,24 @@ lean_inc(x_8); x_10 = l_Lean_Syntax_isOfKind(x_8, x_9); if (x_10 == 0) { -uint8_t x_55; -x_55 = 0; -x_11 = x_55; -goto block_54; +uint8_t x_67; +x_67 = 0; +x_11 = x_67; +goto block_66; } else { -lean_object* x_56; lean_object* x_57; lean_object* x_58; uint8_t x_59; -x_56 = l_Lean_Syntax_getArgs(x_8); -x_57 = lean_array_get_size(x_56); -lean_dec(x_56); -x_58 = lean_unsigned_to_nat(0u); -x_59 = lean_nat_dec_eq(x_57, x_58); -lean_dec(x_57); -x_11 = x_59; -goto block_54; +lean_object* x_68; lean_object* x_69; lean_object* x_70; uint8_t x_71; +x_68 = l_Lean_Syntax_getArgs(x_8); +x_69 = lean_array_get_size(x_68); +lean_dec(x_68); +x_70 = lean_unsigned_to_nat(0u); +x_71 = lean_nat_dec_eq(x_69, x_70); +lean_dec(x_69); +x_11 = x_71; +goto block_66; } -block_54: +block_66: { uint8_t x_12; x_12 = l_coeDecidableEq(x_11); @@ -10199,141 +10549,210 @@ return x_14; } else { -lean_object* x_15; -x_15 = lean_ctor_get(x_3, 1); -lean_inc(x_15); -if (lean_obj_tag(x_15) == 0) -{ -lean_object* x_16; lean_object* x_17; +lean_object* x_15; lean_object* x_16; lean_object* x_17; +x_15 = lean_unsigned_to_nat(0u); +x_16 = l_Lean_Syntax_getArg(x_8, x_15); lean_dec(x_8); -x_16 = l_Lean_Elab_Tactic_liftMetaTactic___closed__3; -x_17 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_16, x_2, x_3); -return x_17; -} -else +lean_inc(x_2); +lean_inc(x_1); +x_17 = l_Lean_Elab_Tactic_getMainGoal(x_1, x_2, x_3); +if (lean_obj_tag(x_17) == 0) { lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; -x_18 = lean_ctor_get(x_15, 0); +x_18 = lean_ctor_get(x_17, 0); lean_inc(x_18); -x_19 = lean_ctor_get(x_15, 1); +x_19 = lean_ctor_get(x_17, 1); lean_inc(x_19); -lean_dec(x_15); -x_20 = lean_unsigned_to_nat(0u); -x_21 = l_Lean_Syntax_getArg(x_8, x_20); -lean_dec(x_8); -lean_inc(x_18); +lean_dec(x_17); +x_20 = lean_ctor_get(x_18, 0); +lean_inc(x_20); +x_21 = lean_ctor_get(x_18, 1); +lean_inc(x_21); +lean_dec(x_18); +lean_inc(x_20); x_22 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalIntro___lambda__1___boxed), 4, 2); -lean_closure_set(x_22, 0, x_21); -lean_closure_set(x_22, 1, x_18); +lean_closure_set(x_22, 0, x_16); +lean_closure_set(x_22, 1, x_20); x_23 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaM___rarg), 4, 2); lean_closure_set(x_23, 0, x_1); lean_closure_set(x_23, 1, x_22); x_24 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaTactic___lambda__1___boxed), 4, 1); -lean_closure_set(x_24, 0, x_19); +lean_closure_set(x_24, 0, x_21); x_25 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); lean_closure_set(x_25, 0, x_23); lean_closure_set(x_25, 1, x_24); -x_26 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_18, x_25, x_2, x_3); -lean_dec(x_18); +x_26 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_20, x_25, x_2, x_19); +lean_dec(x_20); return x_26; } +else +{ +uint8_t x_27; +lean_dec(x_16); +lean_dec(x_2); +lean_dec(x_1); +x_27 = !lean_is_exclusive(x_17); +if (x_27 == 0) +{ +return x_17; +} +else +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_17, 0); +x_29 = lean_ctor_get(x_17, 1); +lean_inc(x_29); +lean_inc(x_28); +lean_dec(x_17); +x_30 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_30, 0, x_28); +lean_ctor_set(x_30, 1, x_29); +return x_30; +} +} } } else { -lean_object* x_27; lean_object* x_28; uint8_t x_29; uint8_t x_30; -x_27 = l_Lean_Syntax_getArgs(x_8); -x_28 = lean_array_get_size(x_27); -lean_dec(x_27); -x_29 = lean_nat_dec_eq(x_28, x_7); -lean_dec(x_28); -x_30 = l_coeDecidableEq(x_29); -if (x_30 == 0) +lean_object* x_31; lean_object* x_32; uint8_t x_33; uint8_t x_34; +x_31 = l_Lean_Syntax_getArgs(x_8); +x_32 = lean_array_get_size(x_31); +lean_dec(x_31); +x_33 = lean_nat_dec_eq(x_32, x_7); +lean_dec(x_32); +x_34 = l_coeDecidableEq(x_33); +if (x_34 == 0) { -lean_object* x_31; +lean_object* x_35; lean_dec(x_8); lean_dec(x_1); -x_31 = l_Lean_Elab_Tactic_throwUnsupportedSyntax___rarg(x_2, x_3); -return x_31; +x_35 = l_Lean_Elab_Tactic_throwUnsupportedSyntax___rarg(x_2, x_3); +return x_35; } else { -lean_object* x_32; -x_32 = lean_ctor_get(x_3, 1); -lean_inc(x_32); -if (lean_obj_tag(x_32) == 0) -{ -lean_object* x_33; lean_object* x_34; +lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_36 = lean_unsigned_to_nat(0u); +x_37 = l_Lean_Syntax_getArg(x_8, x_36); lean_dec(x_8); -x_33 = l_Lean_Elab_Tactic_liftMetaTactic___closed__3; -x_34 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_33, x_2, x_3); -return x_34; +lean_inc(x_2); +lean_inc(x_1); +x_38 = l_Lean_Elab_Tactic_getMainGoal(x_1, x_2, x_3); +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; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; +x_39 = lean_ctor_get(x_38, 0); +lean_inc(x_39); +x_40 = lean_ctor_get(x_38, 1); +lean_inc(x_40); +lean_dec(x_38); +x_41 = lean_ctor_get(x_39, 0); +lean_inc(x_41); +x_42 = lean_ctor_get(x_39, 1); +lean_inc(x_42); +lean_dec(x_39); +lean_inc(x_41); +x_43 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalIntro___lambda__1___boxed), 4, 2); +lean_closure_set(x_43, 0, x_37); +lean_closure_set(x_43, 1, x_41); +x_44 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaM___rarg), 4, 2); +lean_closure_set(x_44, 0, x_1); +lean_closure_set(x_44, 1, x_43); +x_45 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaTactic___lambda__1___boxed), 4, 1); +lean_closure_set(x_45, 0, x_42); +x_46 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); +lean_closure_set(x_46, 0, x_44); +lean_closure_set(x_46, 1, x_45); +x_47 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_41, x_46, x_2, x_40); +lean_dec(x_41); +return x_47; } else { -lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; -x_35 = lean_ctor_get(x_32, 0); -lean_inc(x_35); -x_36 = lean_ctor_get(x_32, 1); -lean_inc(x_36); -lean_dec(x_32); -x_37 = lean_unsigned_to_nat(0u); -x_38 = l_Lean_Syntax_getArg(x_8, x_37); +uint8_t x_48; +lean_dec(x_37); +lean_dec(x_2); +lean_dec(x_1); +x_48 = !lean_is_exclusive(x_38); +if (x_48 == 0) +{ +return x_38; +} +else +{ +lean_object* x_49; lean_object* x_50; lean_object* x_51; +x_49 = lean_ctor_get(x_38, 0); +x_50 = lean_ctor_get(x_38, 1); +lean_inc(x_50); +lean_inc(x_49); +lean_dec(x_38); +x_51 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_51, 0, x_49); +lean_ctor_set(x_51, 1, x_50); +return x_51; +} +} +} +} +} +else +{ +lean_object* x_52; lean_dec(x_8); -lean_inc(x_35); -x_39 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalIntro___lambda__1___boxed), 4, 2); -lean_closure_set(x_39, 0, x_38); -lean_closure_set(x_39, 1, x_35); -x_40 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaM___rarg), 4, 2); -lean_closure_set(x_40, 0, x_1); -lean_closure_set(x_40, 1, x_39); -x_41 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaTactic___lambda__1___boxed), 4, 1); -lean_closure_set(x_41, 0, x_36); -x_42 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); -lean_closure_set(x_42, 0, x_40); -lean_closure_set(x_42, 1, x_41); -x_43 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_35, x_42, x_2, x_3); -lean_dec(x_35); -return x_43; -} -} -} +lean_inc(x_2); +lean_inc(x_1); +x_52 = l_Lean_Elab_Tactic_getMainGoal(x_1, x_2, x_3); +if (lean_obj_tag(x_52) == 0) +{ +lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; +x_53 = lean_ctor_get(x_52, 0); +lean_inc(x_53); +x_54 = lean_ctor_get(x_52, 1); +lean_inc(x_54); +lean_dec(x_52); +x_55 = lean_ctor_get(x_53, 0); +lean_inc(x_55); +x_56 = lean_ctor_get(x_53, 1); +lean_inc(x_56); +lean_dec(x_53); +lean_inc(x_55); +x_57 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalIntro___lambda__2___boxed), 3, 1); +lean_closure_set(x_57, 0, x_55); +x_58 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaM___rarg), 4, 2); +lean_closure_set(x_58, 0, x_1); +lean_closure_set(x_58, 1, x_57); +x_59 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaTactic___lambda__1___boxed), 4, 1); +lean_closure_set(x_59, 0, x_56); +x_60 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); +lean_closure_set(x_60, 0, x_58); +lean_closure_set(x_60, 1, x_59); +x_61 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_55, x_60, x_2, x_54); +lean_dec(x_55); +return x_61; } else { -lean_object* x_44; -lean_dec(x_8); -x_44 = lean_ctor_get(x_3, 1); -lean_inc(x_44); -if (lean_obj_tag(x_44) == 0) +uint8_t x_62; +lean_dec(x_2); +lean_dec(x_1); +x_62 = !lean_is_exclusive(x_52); +if (x_62 == 0) { -lean_object* x_45; lean_object* x_46; -x_45 = l_Lean_Elab_Tactic_liftMetaTactic___closed__3; -x_46 = l_Lean_Elab_Tactic_throwError___rarg(x_1, x_45, x_2, x_3); -return x_46; +return x_52; } else { -lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; -x_47 = lean_ctor_get(x_44, 0); -lean_inc(x_47); -x_48 = lean_ctor_get(x_44, 1); -lean_inc(x_48); -lean_dec(x_44); -lean_inc(x_47); -x_49 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalIntro___lambda__2___boxed), 3, 1); -lean_closure_set(x_49, 0, x_47); -x_50 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaM___rarg), 4, 2); -lean_closure_set(x_50, 0, x_1); -lean_closure_set(x_50, 1, x_49); -x_51 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_liftMetaTactic___lambda__1___boxed), 4, 1); -lean_closure_set(x_51, 0, x_48); -x_52 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); -lean_closure_set(x_52, 0, x_50); -lean_closure_set(x_52, 1, x_51); -x_53 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_47, x_52, x_2, x_3); -lean_dec(x_47); -return x_53; +lean_object* x_63; lean_object* x_64; lean_object* x_65; +x_63 = lean_ctor_get(x_52, 0); +x_64 = lean_ctor_get(x_52, 1); +lean_inc(x_64); +lean_inc(x_63); +lean_dec(x_52); +x_65 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_65, 0, x_63); +lean_ctor_set(x_65, 1, x_64); +return x_65; +} } } } @@ -10397,6 +10816,320 @@ x_5 = l_Lean_Elab_Tactic_addBuiltinTactic(x_2, x_3, x_4, x_1); return x_5; } } +lean_object* l_Lean_Elab_Tactic_evalExact___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) { +_start: +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_7 = lean_ctor_get(x_4, 2); +lean_inc(x_7); +x_8 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_8, 0, x_7); +lean_inc(x_5); +lean_inc(x_8); +x_9 = l_Lean_Elab_Tactic_elabTerm(x_1, x_8, x_5, x_6); +if (lean_obj_tag(x_9) == 0) +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_9, 0); +lean_inc(x_10); +x_11 = lean_ctor_get(x_9, 1); +lean_inc(x_11); +lean_dec(x_9); +lean_inc(x_5); +lean_inc(x_2); +x_12 = l_Lean_Elab_Tactic_ensureHasType(x_2, x_8, x_10, x_5, x_11); +if (lean_obj_tag(x_12) == 0) +{ +lean_object* x_13; lean_object* x_14; lean_object* x_15; +x_13 = lean_ctor_get(x_12, 0); +lean_inc(x_13); +x_14 = lean_ctor_get(x_12, 1); +lean_inc(x_14); +lean_dec(x_12); +lean_inc(x_5); +lean_inc(x_13); +x_15 = l_Lean_Elab_Tactic_ensureHasNoMVars(x_2, x_13, x_5, x_14); +if (lean_obj_tag(x_15) == 0) +{ +lean_object* x_16; lean_object* x_17; +x_16 = lean_ctor_get(x_15, 1); +lean_inc(x_16); +lean_dec(x_15); +x_17 = l_Lean_Elab_Tactic_assignExprMVar(x_3, x_13, x_5, x_16); +return x_17; +} +else +{ +uint8_t x_18; +lean_dec(x_13); +lean_dec(x_5); +lean_dec(x_3); +x_18 = !lean_is_exclusive(x_15); +if (x_18 == 0) +{ +return x_15; +} +else +{ +lean_object* x_19; lean_object* x_20; lean_object* x_21; +x_19 = lean_ctor_get(x_15, 0); +x_20 = lean_ctor_get(x_15, 1); +lean_inc(x_20); +lean_inc(x_19); +lean_dec(x_15); +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; +} +} +} +else +{ +uint8_t x_22; +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +x_22 = !lean_is_exclusive(x_12); +if (x_22 == 0) +{ +return x_12; +} +else +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_12, 0); +x_24 = lean_ctor_get(x_12, 1); +lean_inc(x_24); +lean_inc(x_23); +lean_dec(x_12); +x_25 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_25, 0, x_23); +lean_ctor_set(x_25, 1, x_24); +return x_25; +} +} +} +else +{ +uint8_t x_26; +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +x_26 = !lean_is_exclusive(x_9); +if (x_26 == 0) +{ +return x_9; +} +else +{ +lean_object* x_27; lean_object* x_28; lean_object* x_29; +x_27 = lean_ctor_get(x_9, 0); +x_28 = lean_ctor_get(x_9, 1); +lean_inc(x_28); +lean_inc(x_27); +lean_dec(x_9); +x_29 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_29, 0, x_27); +lean_ctor_set(x_29, 1, x_28); +return x_29; +} +} +} +} +lean_object* _init_l_Lean_Elab_Tactic_evalExact___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Elab_Tactic_registerBuiltinTacticAttr___lambda__1___closed__3; +x_2 = l_Lean_Parser_Tactic_exact___elambda__1___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* l_Lean_Elab_Tactic_evalExact(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +uint8_t x_4; lean_object* x_29; uint8_t x_30; +x_29 = l_Lean_Elab_Tactic_evalExact___closed__1; +lean_inc(x_1); +x_30 = l_Lean_Syntax_isOfKind(x_1, x_29); +if (x_30 == 0) +{ +uint8_t x_31; +x_31 = 0; +x_4 = x_31; +goto block_28; +} +else +{ +lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35; +x_32 = l_Lean_Syntax_getArgs(x_1); +x_33 = lean_array_get_size(x_32); +lean_dec(x_32); +x_34 = lean_unsigned_to_nat(2u); +x_35 = lean_nat_dec_eq(x_33, x_34); +lean_dec(x_33); +x_4 = x_35; +goto block_28; +} +block_28: +{ +uint8_t x_5; +x_5 = l_coeDecidableEq(x_4); +if (x_5 == 0) +{ +lean_object* x_6; +lean_dec(x_1); +x_6 = l_Lean_Elab_Tactic_throwUnsupportedSyntax___rarg(x_2, x_3); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_7 = lean_unsigned_to_nat(1u); +x_8 = l_Lean_Syntax_getArg(x_1, x_7); +lean_inc(x_2); +lean_inc(x_1); +x_9 = l_Lean_Elab_Tactic_getMainGoal(x_1, x_2, x_3); +if (lean_obj_tag(x_9) == 0) +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; +x_10 = lean_ctor_get(x_9, 0); +lean_inc(x_10); +x_11 = lean_ctor_get(x_9, 1); +lean_inc(x_11); +lean_dec(x_9); +x_12 = lean_ctor_get(x_10, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_10, 1); +lean_inc(x_13); +lean_dec(x_10); +lean_inc(x_12); +x_14 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_getMVarDecl___boxed), 3, 1); +lean_closure_set(x_14, 0, x_12); +lean_inc(x_12); +x_15 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalExact___lambda__1___boxed), 6, 3); +lean_closure_set(x_15, 0, x_8); +lean_closure_set(x_15, 1, x_1); +lean_closure_set(x_15, 2, x_12); +x_16 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Elab_Tactic_monadLog___spec__2___rarg), 4, 2); +lean_closure_set(x_16, 0, x_14); +lean_closure_set(x_16, 1, x_15); +lean_inc(x_2); +x_17 = l_Lean_Elab_Tactic_withMVarContext___rarg(x_12, x_16, x_2, x_11); +lean_dec(x_12); +if (lean_obj_tag(x_17) == 0) +{ +lean_object* x_18; lean_object* x_19; +x_18 = lean_ctor_get(x_17, 1); +lean_inc(x_18); +lean_dec(x_17); +x_19 = l_Lean_Elab_Tactic_updateGoals(x_13, x_2, x_18); +lean_dec(x_2); +return x_19; +} +else +{ +uint8_t x_20; +lean_dec(x_13); +lean_dec(x_2); +x_20 = !lean_is_exclusive(x_17); +if (x_20 == 0) +{ +return x_17; +} +else +{ +lean_object* x_21; lean_object* x_22; lean_object* x_23; +x_21 = lean_ctor_get(x_17, 0); +x_22 = lean_ctor_get(x_17, 1); +lean_inc(x_22); +lean_inc(x_21); +lean_dec(x_17); +x_23 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_23, 0, x_21); +lean_ctor_set(x_23, 1, x_22); +return x_23; +} +} +} +else +{ +uint8_t x_24; +lean_dec(x_8); +lean_dec(x_2); +lean_dec(x_1); +x_24 = !lean_is_exclusive(x_9); +if (x_24 == 0) +{ +return x_9; +} +else +{ +lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_25 = lean_ctor_get(x_9, 0); +x_26 = lean_ctor_get(x_9, 1); +lean_inc(x_26); +lean_inc(x_25); +lean_dec(x_9); +x_27 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_27, 0, x_25); +lean_ctor_set(x_27, 1, x_26); +return x_27; +} +} +} +} +} +} +lean_object* l_Lean_Elab_Tactic_evalExact___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +_start: +{ +lean_object* x_7; +x_7 = l_Lean_Elab_Tactic_evalExact___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_4); +return x_7; +} +} +lean_object* _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("evalExact"); +return x_1; +} +} +lean_object* _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Elab_Tactic_declareBuiltinTactic___closed__3; +x_2 = l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__3() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Tactic_evalExact), 3, 0); +return x_1; +} +} +lean_object* l___regBuiltinTactic_Lean_Elab_Tactic_evalExact(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_Tactic_evalExact___closed__1; +x_3 = l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__2; +x_4 = l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__3; +x_5 = l_Lean_Elab_Tactic_addBuiltinTactic(x_2, x_3, x_4, x_1); +return x_5; +} +} lean_object* _init_l___private_Init_Lean_Elab_Tactic_Basic_2__regTraceClasses___closed__1() { _start: { @@ -10603,12 +11336,18 @@ l_Lean_Elab_Tactic_evalTactic___main___closed__4 = _init_l_Lean_Elab_Tactic_eval lean_mark_persistent(l_Lean_Elab_Tactic_evalTactic___main___closed__4); l_Lean_Elab_Tactic_resetSynthInstanceCache___closed__1 = _init_l_Lean_Elab_Tactic_resetSynthInstanceCache___closed__1(); lean_mark_persistent(l_Lean_Elab_Tactic_resetSynthInstanceCache___closed__1); -l_Lean_Elab_Tactic_liftMetaTactic___closed__1 = _init_l_Lean_Elab_Tactic_liftMetaTactic___closed__1(); -lean_mark_persistent(l_Lean_Elab_Tactic_liftMetaTactic___closed__1); -l_Lean_Elab_Tactic_liftMetaTactic___closed__2 = _init_l_Lean_Elab_Tactic_liftMetaTactic___closed__2(); -lean_mark_persistent(l_Lean_Elab_Tactic_liftMetaTactic___closed__2); -l_Lean_Elab_Tactic_liftMetaTactic___closed__3 = _init_l_Lean_Elab_Tactic_liftMetaTactic___closed__3(); -lean_mark_persistent(l_Lean_Elab_Tactic_liftMetaTactic___closed__3); +l_Lean_Elab_Tactic_getMainGoal___closed__1 = _init_l_Lean_Elab_Tactic_getMainGoal___closed__1(); +lean_mark_persistent(l_Lean_Elab_Tactic_getMainGoal___closed__1); +l_Lean_Elab_Tactic_getMainGoal___closed__2 = _init_l_Lean_Elab_Tactic_getMainGoal___closed__2(); +lean_mark_persistent(l_Lean_Elab_Tactic_getMainGoal___closed__2); +l_Lean_Elab_Tactic_getMainGoal___closed__3 = _init_l_Lean_Elab_Tactic_getMainGoal___closed__3(); +lean_mark_persistent(l_Lean_Elab_Tactic_getMainGoal___closed__3); +l_Lean_Elab_Tactic_ensureHasNoMVars___closed__1 = _init_l_Lean_Elab_Tactic_ensureHasNoMVars___closed__1(); +lean_mark_persistent(l_Lean_Elab_Tactic_ensureHasNoMVars___closed__1); +l_Lean_Elab_Tactic_ensureHasNoMVars___closed__2 = _init_l_Lean_Elab_Tactic_ensureHasNoMVars___closed__2(); +lean_mark_persistent(l_Lean_Elab_Tactic_ensureHasNoMVars___closed__2); +l_Lean_Elab_Tactic_ensureHasNoMVars___closed__3 = _init_l_Lean_Elab_Tactic_ensureHasNoMVars___closed__3(); +lean_mark_persistent(l_Lean_Elab_Tactic_ensureHasNoMVars___closed__3); l___regBuiltinTactic_Lean_Elab_Tactic_evalSeq___closed__1 = _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalSeq___closed__1(); lean_mark_persistent(l___regBuiltinTactic_Lean_Elab_Tactic_evalSeq___closed__1); l___regBuiltinTactic_Lean_Elab_Tactic_evalSeq___closed__2 = _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalSeq___closed__2(); @@ -10644,6 +11383,17 @@ lean_mark_persistent(l___regBuiltinTactic_Lean_Elab_Tactic_evalIntro___closed__3 res = l___regBuiltinTactic_Lean_Elab_Tactic_evalIntro(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l_Lean_Elab_Tactic_evalExact___closed__1 = _init_l_Lean_Elab_Tactic_evalExact___closed__1(); +lean_mark_persistent(l_Lean_Elab_Tactic_evalExact___closed__1); +l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__1 = _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__1(); +lean_mark_persistent(l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__1); +l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__2 = _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__2(); +lean_mark_persistent(l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__2); +l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__3 = _init_l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__3(); +lean_mark_persistent(l___regBuiltinTactic_Lean_Elab_Tactic_evalExact___closed__3); +res = l___regBuiltinTactic_Lean_Elab_Tactic_evalExact(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); l___private_Init_Lean_Elab_Tactic_Basic_2__regTraceClasses___closed__1 = _init_l___private_Init_Lean_Elab_Tactic_Basic_2__regTraceClasses___closed__1(); lean_mark_persistent(l___private_Init_Lean_Elab_Tactic_Basic_2__regTraceClasses___closed__1); res = l___private_Init_Lean_Elab_Tactic_Basic_2__regTraceClasses(lean_io_mk_world()); diff --git a/stage0/stdlib/Init/Lean/Elab/Term.c b/stage0/stdlib/Init/Lean/Elab/Term.c index 5a311d8e94..1ab0e29fdc 100644 --- a/stage0/stdlib/Init/Lean/Elab/Term.c +++ b/stage0/stdlib/Init/Lean/Elab/Term.c @@ -65,7 +65,6 @@ lean_object* l_Lean_Elab_Term_assignExprMVar___boxed(lean_object*, lean_object*, lean_object* l_Lean_Elab_Term_ppGoal___boxed(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Expr_hasSorry___main___closed__1; lean_object* l_Lean_Elab_Term_mkTermElabAttribute___closed__3; -lean_object* l_Lean_Elab_Term_ensureHasType___closed__2; lean_object* l_Lean_Elab_Term_synthesizeInstMVarCore___closed__2; extern lean_object* l_IO_Prim_fopenFlags___closed__12; lean_object* l_Lean_Elab_Term_resettingSynthInstanceCacheWhen(lean_object*); @@ -180,6 +179,7 @@ lean_object* l_Lean_Elab_Term_getMCtx(lean_object*); size_t l_USize_shiftRight(size_t, size_t); lean_object* l_Lean_Elab_Term_withLCtx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_elabArrayLit___closed__6; +lean_object* l_Lean_Elab_Term_ensureHasTypeAux___closed__3; lean_object* l_Lean_Elab_Term_monadLog___closed__10; lean_object* l_Lean_Elab_Term_resolveName___closed__6; lean_object* l_Lean_Elab_Term_elabTypeStx___rarg(lean_object*); @@ -212,7 +212,7 @@ lean_object* lean_nat_add(lean_object*, lean_object*); lean_object* l_Lean_Meta_ppGoal(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_mkFreshInstanceName___rarg___closed__1; lean_object* l_Lean_Elab_Term_termElabAttribute___closed__2; -lean_object* l_Lean_Elab_Term_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_ofExcept___at_Lean_registerClassAttr___spec__1(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_getTraceState(lean_object*); lean_object* l_Array_foldlStepMAux___main___at_Lean_Syntax_foldSepRevArgsM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); @@ -422,7 +422,7 @@ lean_object* l_Lean_Elab_addMacroStack(lean_object*, lean_object*); lean_object* l_Lean_LocalDecl_toExpr(lean_object*); lean_object* l_Lean_Elab_Term_elabTermAux(lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_termElabAttribute___closed__5; -lean_object* l_Lean_Elab_Term_ensureHasType___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_ensureHasType___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_mkElabAttribute___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabArrayLit___closed__3; lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabArrayLit(lean_object*); @@ -435,7 +435,6 @@ lean_object* l_Lean_Elab_Term_whnfCore___boxed(lean_object*, lean_object*, lean_ lean_object* l_Lean_Elab_Term_getCurrNamespace___boxed(lean_object*, lean_object*); lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabParen___closed__1; lean_object* l_Lean_Elab_Level_elabLevel___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_ensureHasType___closed__1; lean_object* l_Lean_Elab_Term_addBuiltinTermElab___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_getLocalInsts(lean_object*, lean_object*); lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabProp(lean_object*); @@ -517,7 +516,6 @@ lean_object* l___private_Init_Lean_Elab_Term_9__mkPairsAux___main___closed__6; lean_object* l_Lean_Elab_Term_traceAtCmdPos(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_Term_5__expandCDot___closed__2; uint8_t l_HashMapImp_contains___at_Lean_Elab_Term_addBuiltinTermElab___spec__2(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_ensureHasType___closed__3; lean_object* l_Lean_Elab_Term_decLevel___closed__5; lean_object* l_PersistentHashMap_contains___at_Lean_Elab_Term_addBuiltinTermElab___spec__4___boxed(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_TermElabM_inhabited___rarg(lean_object*); @@ -680,7 +678,9 @@ lean_object* l_Lean_Elab_Term_decLevel___closed__1; lean_object* l_Lean_Elab_Term_elabTermAux___main___closed__2; lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabBadCDot___closed__1; lean_object* l_Lean_Elab_Term_registerBuiltinTermElabAttr___lambda__1(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*); +lean_object* l_Lean_Elab_Term_ensureHasTypeAux___closed__1; lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_ensureHasTypeAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_builtinTermElabTable; uint8_t l_List_isEmpty___rarg(lean_object*); lean_object* l_Lean_Elab_Term_mkTermElabAttribute___closed__2; @@ -715,6 +715,7 @@ lean_object* l_IO_ofExcept___at___private_Init_Lean_Elab_Util_6__ElabAttribute_a lean_object* l_Lean_Elab_Term_resettingSynthInstanceCache(lean_object*); lean_object* l_Lean_mkConst(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_registerSyntheticMVar___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_ensureHasTypeAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Elab_Term_3__fromMetaState___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_tryPostponeIfNoneOrMVar___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_uint32_to_nat(uint32_t); @@ -755,6 +756,7 @@ lean_object* l_Lean_Elab_Term_mkFreshTypeMVar___boxed(lean_object*, lean_object* lean_object* l_Lean_Elab_Term_elabBadCDot(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_elabNum___closed__4; lean_object* l_Lean_Elab_getBetterRef(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_ensureHasTypeAux___closed__2; uint8_t lean_string_dec_eq(lean_object*, lean_object*); lean_object* l_Lean_Elab_expandMacro(lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_lt(lean_object*, lean_object*); @@ -16318,7 +16320,7 @@ lean_dec(x_1); return x_7; } } -lean_object* _init_l_Lean_Elab_Term_ensureHasType___closed__1() { +lean_object* _init_l_Lean_Elab_Term_ensureHasTypeAux___closed__1() { _start: { lean_object* x_1; @@ -16326,27 +16328,27 @@ x_1 = lean_mk_string("type mismatch"); return x_1; } } -lean_object* _init_l_Lean_Elab_Term_ensureHasType___closed__2() { +lean_object* _init_l_Lean_Elab_Term_ensureHasTypeAux___closed__2() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Elab_Term_ensureHasType___closed__1; +x_1 = l_Lean_Elab_Term_ensureHasTypeAux___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_ensureHasType___closed__3() { +lean_object* _init_l_Lean_Elab_Term_ensureHasTypeAux___closed__3() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Lean_Elab_Term_ensureHasType___closed__2; +x_1 = l_Lean_Elab_Term_ensureHasTypeAux___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_ensureHasType(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* l_Lean_Elab_Term_ensureHasTypeAux(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; @@ -16369,7 +16371,7 @@ lean_dec(x_7); x_10 = lean_alloc_ctor(2, 1, 0); lean_ctor_set(x_10, 0, x_4); x_11 = l_Lean_indentExpr(x_10); -x_12 = l_Lean_Elab_Term_ensureHasType___closed__3; +x_12 = l_Lean_Elab_Term_ensureHasTypeAux___closed__3; x_13 = lean_alloc_ctor(9, 2, 0); lean_ctor_set(x_13, 0, x_12); lean_ctor_set(x_13, 1, x_11); @@ -16488,15 +16490,81 @@ return x_45; } } } -lean_object* l_Lean_Elab_Term_ensureHasType___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* l_Lean_Elab_Term_ensureHasTypeAux___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; -x_7 = l_Lean_Elab_Term_ensureHasType(x_1, x_2, x_3, x_4, x_5, x_6); +x_7 = l_Lean_Elab_Term_ensureHasTypeAux(x_1, x_2, x_3, x_4, x_5, x_6); lean_dec(x_1); return x_7; } } +lean_object* l_Lean_Elab_Term_ensureHasType(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +if (lean_obj_tag(x_2) == 0) +{ +lean_object* x_6; +lean_dec(x_4); +x_6 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_5); +return x_6; +} +else +{ +lean_object* x_7; +lean_inc(x_4); +lean_inc(x_3); +x_7 = l_Lean_Elab_Term_inferType(x_1, x_3, x_4, x_5); +if (lean_obj_tag(x_7) == 0) +{ +lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_8 = lean_ctor_get(x_7, 0); +lean_inc(x_8); +x_9 = lean_ctor_get(x_7, 1); +lean_inc(x_9); +lean_dec(x_7); +x_10 = l_Lean_Elab_Term_ensureHasTypeAux(x_1, x_2, x_8, x_3, x_4, x_9); +return x_10; +} +else +{ +uint8_t x_11; +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_11 = !lean_is_exclusive(x_7); +if (x_11 == 0) +{ +return x_7; +} +else +{ +lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_12 = lean_ctor_get(x_7, 0); +x_13 = lean_ctor_get(x_7, 1); +lean_inc(x_13); +lean_inc(x_12); +lean_dec(x_7); +x_14 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_14, 0, x_12); +lean_ctor_set(x_14, 1, x_13); +return x_14; +} +} +} +} +} +lean_object* l_Lean_Elab_Term_ensureHasType___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +lean_object* x_6; +x_6 = l_Lean_Elab_Term_ensureHasType(x_1, x_2, x_3, x_4, x_5); +lean_dec(x_1); +return x_6; +} +} lean_object* _init_l_Lean_Elab_Term_synthesizeInstMVarCore___closed__1() { _start: { @@ -17674,30 +17742,30 @@ return x_3; lean_object* l_Lean_Elab_Term_elabParen(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -uint8_t x_5; lean_object* x_133; uint8_t x_134; -x_133 = l_Lean_Parser_Term_paren___elambda__1___closed__1; +uint8_t x_5; lean_object* x_144; uint8_t x_145; +x_144 = l_Lean_Parser_Term_paren___elambda__1___closed__1; lean_inc(x_1); -x_134 = l_Lean_Syntax_isOfKind(x_1, x_133); -if (x_134 == 0) +x_145 = l_Lean_Syntax_isOfKind(x_1, x_144); +if (x_145 == 0) { -uint8_t x_135; -x_135 = 0; -x_5 = x_135; -goto block_132; +uint8_t x_146; +x_146 = 0; +x_5 = x_146; +goto block_143; } else { -lean_object* x_136; lean_object* x_137; lean_object* x_138; uint8_t x_139; -x_136 = l_Lean_Syntax_getArgs(x_1); -x_137 = lean_array_get_size(x_136); -lean_dec(x_136); -x_138 = lean_unsigned_to_nat(3u); -x_139 = lean_nat_dec_eq(x_137, x_138); -lean_dec(x_137); -x_5 = x_139; -goto block_132; +lean_object* x_147; lean_object* x_148; lean_object* x_149; uint8_t x_150; +x_147 = l_Lean_Syntax_getArgs(x_1); +x_148 = lean_array_get_size(x_147); +lean_dec(x_147); +x_149 = lean_unsigned_to_nat(3u); +x_150 = lean_nat_dec_eq(x_148, x_149); +lean_dec(x_148); +x_5 = x_150; +goto block_143; } -block_132: +block_143: { uint8_t x_6; x_6 = l_coeDecidableEq(x_5); @@ -17712,71 +17780,71 @@ return x_8; } else { -lean_object* x_9; lean_object* x_10; uint8_t x_11; lean_object* x_117; uint8_t x_118; +lean_object* x_9; lean_object* x_10; uint8_t x_11; lean_object* x_128; uint8_t x_129; x_9 = lean_unsigned_to_nat(1u); x_10 = l_Lean_Syntax_getArg(x_1, x_9); -x_117 = l_Lean_nullKind___closed__2; +x_128 = l_Lean_nullKind___closed__2; lean_inc(x_10); -x_118 = l_Lean_Syntax_isOfKind(x_10, x_117); -if (x_118 == 0) +x_129 = l_Lean_Syntax_isOfKind(x_10, x_128); +if (x_129 == 0) { -uint8_t x_119; -x_119 = l___private_Init_Lean_Elab_Term_4__isCDot___closed__1; -if (x_119 == 0) +uint8_t x_130; +x_130 = l___private_Init_Lean_Elab_Term_4__isCDot___closed__1; +if (x_130 == 0) { -uint8_t x_120; -x_120 = 0; -x_11 = x_120; -goto block_116; +uint8_t x_131; +x_131 = 0; +x_11 = x_131; +goto block_127; } else { -lean_object* x_121; lean_object* x_122; +lean_object* x_132; lean_object* x_133; lean_dec(x_10); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_121 = l_Lean_Elab_Term_elabParen___closed__6; -x_122 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_122, 0, x_121); -lean_ctor_set(x_122, 1, x_4); -return x_122; +x_132 = l_Lean_Elab_Term_elabParen___closed__6; +x_133 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_133, 0, x_132); +lean_ctor_set(x_133, 1, x_4); +return x_133; } } else { -lean_object* x_123; lean_object* x_124; lean_object* x_125; uint8_t x_126; uint8_t x_127; -x_123 = l_Lean_Syntax_getArgs(x_10); -x_124 = lean_array_get_size(x_123); -lean_dec(x_123); -x_125 = lean_unsigned_to_nat(0u); -x_126 = lean_nat_dec_eq(x_124, x_125); -x_127 = l_coeDecidableEq(x_126); -if (x_127 == 0) +lean_object* x_134; lean_object* x_135; lean_object* x_136; uint8_t x_137; uint8_t x_138; +x_134 = l_Lean_Syntax_getArgs(x_10); +x_135 = lean_array_get_size(x_134); +lean_dec(x_134); +x_136 = lean_unsigned_to_nat(0u); +x_137 = lean_nat_dec_eq(x_135, x_136); +x_138 = l_coeDecidableEq(x_137); +if (x_138 == 0) { -lean_object* x_128; uint8_t x_129; -x_128 = lean_unsigned_to_nat(2u); -x_129 = lean_nat_dec_eq(x_124, x_128); -lean_dec(x_124); -x_11 = x_129; -goto block_116; +lean_object* x_139; uint8_t x_140; +x_139 = lean_unsigned_to_nat(2u); +x_140 = lean_nat_dec_eq(x_135, x_139); +lean_dec(x_135); +x_11 = x_140; +goto block_127; } else { -lean_object* x_130; lean_object* x_131; -lean_dec(x_124); +lean_object* x_141; lean_object* x_142; +lean_dec(x_135); lean_dec(x_10); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_130 = l_Lean_Elab_Term_elabParen___closed__6; -x_131 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_131, 0, x_130); -lean_ctor_set(x_131, 1, x_4); -return x_131; +x_141 = l_Lean_Elab_Term_elabParen___closed__6; +x_142 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_142, 0, x_141); +lean_ctor_set(x_142, 1, x_4); +return x_142; } } -block_116: +block_127: { uint8_t x_12; x_12 = l_coeDecidableEq(x_11); @@ -17802,23 +17870,23 @@ lean_inc(x_17); x_19 = l_Lean_Syntax_isOfKind(x_17, x_18); if (x_19 == 0) { -uint8_t x_112; -x_112 = 0; -x_20 = x_112; -goto block_111; +uint8_t x_123; +x_123 = 0; +x_20 = x_123; +goto block_122; } else { -lean_object* x_113; lean_object* x_114; uint8_t x_115; -x_113 = l_Lean_Syntax_getArgs(x_17); -x_114 = lean_array_get_size(x_113); -lean_dec(x_113); -x_115 = lean_nat_dec_eq(x_114, x_9); -lean_dec(x_114); -x_20 = x_115; -goto block_111; +lean_object* x_124; lean_object* x_125; uint8_t x_126; +x_124 = l_Lean_Syntax_getArgs(x_17); +x_125 = lean_array_get_size(x_124); +lean_dec(x_124); +x_126 = lean_nat_dec_eq(x_125, x_9); +lean_dec(x_125); +x_20 = x_126; +goto block_122; } -block_111: +block_122: { uint8_t x_21; x_21 = l_coeDecidableEq(x_20); @@ -17878,30 +17946,242 @@ return x_32; } else { -lean_object* x_33; uint8_t x_34; uint8_t x_70; lean_object* x_104; uint8_t x_105; +lean_object* x_33; uint8_t x_34; lean_object* x_70; uint8_t x_71; x_33 = l_Lean_Syntax_getArg(x_17, x_15); lean_dec(x_17); -x_104 = l_Lean_Parser_Term_typeAscription___elambda__1___closed__2; +x_70 = l_Lean_Parser_Term_typeAscription___elambda__1___closed__2; lean_inc(x_33); -x_105 = l_Lean_Syntax_isOfKind(x_33, x_104); -if (x_105 == 0) +x_71 = l_Lean_Syntax_isOfKind(x_33, x_70); +if (x_71 == 0) { -uint8_t x_106; -x_106 = 0; -x_70 = x_106; -goto block_103; +uint8_t x_72; +x_72 = l___private_Init_Lean_Elab_Term_4__isCDot___closed__1; +if (x_72 == 0) +{ +lean_object* x_73; uint8_t x_74; +x_73 = l_Lean_Parser_Term_tupleTail___elambda__1___closed__2; +lean_inc(x_33); +x_74 = l_Lean_Syntax_isOfKind(x_33, x_73); +if (x_74 == 0) +{ +uint8_t x_75; +x_75 = 0; +x_34 = x_75; +goto block_69; } else { -lean_object* x_107; lean_object* x_108; lean_object* x_109; uint8_t x_110; -x_107 = l_Lean_Syntax_getArgs(x_33); -x_108 = lean_array_get_size(x_107); -lean_dec(x_107); -x_109 = lean_unsigned_to_nat(2u); -x_110 = lean_nat_dec_eq(x_108, x_109); -lean_dec(x_108); -x_70 = x_110; -goto block_103; +lean_object* x_76; lean_object* x_77; lean_object* x_78; uint8_t x_79; +x_76 = l_Lean_Syntax_getArgs(x_33); +x_77 = lean_array_get_size(x_76); +lean_dec(x_76); +x_78 = lean_unsigned_to_nat(2u); +x_79 = lean_nat_dec_eq(x_77, x_78); +lean_dec(x_77); +x_34 = x_79; +goto block_69; +} +} +else +{ +lean_object* x_80; lean_object* x_81; +lean_dec(x_2); +x_80 = l_Lean_Syntax_getArg(x_33, x_9); +lean_dec(x_33); +lean_inc(x_3); +x_81 = l_Lean_Elab_Term_elabType(x_80, x_3, x_4); +if (lean_obj_tag(x_81) == 0) +{ +lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; +x_82 = lean_ctor_get(x_81, 0); +lean_inc(x_82); +x_83 = lean_ctor_get(x_81, 1); +lean_inc(x_83); +lean_dec(x_81); +x_84 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_84, 0, x_82); +lean_inc(x_3); +lean_inc(x_84); +x_85 = l___private_Init_Lean_Elab_Term_10__elabCDot(x_16, x_84, x_3, x_83); +if (lean_obj_tag(x_85) == 0) +{ +lean_object* x_86; lean_object* x_87; lean_object* x_88; +x_86 = lean_ctor_get(x_85, 0); +lean_inc(x_86); +x_87 = lean_ctor_get(x_85, 1); +lean_inc(x_87); +lean_dec(x_85); +x_88 = l_Lean_Elab_Term_ensureHasType(x_1, x_84, x_86, x_3, x_87); +lean_dec(x_1); +return x_88; +} +else +{ +uint8_t x_89; +lean_dec(x_84); +lean_dec(x_3); +lean_dec(x_1); +x_89 = !lean_is_exclusive(x_85); +if (x_89 == 0) +{ +return x_85; +} +else +{ +lean_object* x_90; lean_object* x_91; lean_object* x_92; +x_90 = lean_ctor_get(x_85, 0); +x_91 = lean_ctor_get(x_85, 1); +lean_inc(x_91); +lean_inc(x_90); +lean_dec(x_85); +x_92 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_92, 0, x_90); +lean_ctor_set(x_92, 1, x_91); +return x_92; +} +} +} +else +{ +uint8_t x_93; +lean_dec(x_16); +lean_dec(x_3); +lean_dec(x_1); +x_93 = !lean_is_exclusive(x_81); +if (x_93 == 0) +{ +return x_81; +} +else +{ +lean_object* x_94; lean_object* x_95; lean_object* x_96; +x_94 = lean_ctor_get(x_81, 0); +x_95 = lean_ctor_get(x_81, 1); +lean_inc(x_95); +lean_inc(x_94); +lean_dec(x_81); +x_96 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_96, 0, x_94); +lean_ctor_set(x_96, 1, x_95); +return x_96; +} +} +} +} +else +{ +lean_object* x_97; lean_object* x_98; lean_object* x_99; uint8_t x_100; uint8_t x_101; +x_97 = l_Lean_Syntax_getArgs(x_33); +x_98 = lean_array_get_size(x_97); +lean_dec(x_97); +x_99 = lean_unsigned_to_nat(2u); +x_100 = lean_nat_dec_eq(x_98, x_99); +lean_dec(x_98); +x_101 = l_coeDecidableEq(x_100); +if (x_101 == 0) +{ +lean_object* x_102; uint8_t x_103; +x_102 = l_Lean_Parser_Term_tupleTail___elambda__1___closed__2; +lean_inc(x_33); +x_103 = l_Lean_Syntax_isOfKind(x_33, x_102); +if (x_103 == 0) +{ +uint8_t x_104; +x_104 = 0; +x_34 = x_104; +goto block_69; +} +else +{ +x_34 = x_100; +goto block_69; +} +} +else +{ +lean_object* x_105; lean_object* x_106; +lean_dec(x_2); +x_105 = l_Lean_Syntax_getArg(x_33, x_9); +lean_dec(x_33); +lean_inc(x_3); +x_106 = l_Lean_Elab_Term_elabType(x_105, x_3, x_4); +if (lean_obj_tag(x_106) == 0) +{ +lean_object* x_107; lean_object* x_108; lean_object* x_109; lean_object* x_110; +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_alloc_ctor(1, 1, 0); +lean_ctor_set(x_109, 0, x_107); +lean_inc(x_3); +lean_inc(x_109); +x_110 = l___private_Init_Lean_Elab_Term_10__elabCDot(x_16, x_109, x_3, x_108); +if (lean_obj_tag(x_110) == 0) +{ +lean_object* x_111; lean_object* x_112; lean_object* x_113; +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 = l_Lean_Elab_Term_ensureHasType(x_1, x_109, x_111, x_3, x_112); +lean_dec(x_1); +return x_113; +} +else +{ +uint8_t x_114; +lean_dec(x_109); +lean_dec(x_3); +lean_dec(x_1); +x_114 = !lean_is_exclusive(x_110); +if (x_114 == 0) +{ +return x_110; +} +else +{ +lean_object* x_115; lean_object* x_116; lean_object* x_117; +x_115 = lean_ctor_get(x_110, 0); +x_116 = lean_ctor_get(x_110, 1); +lean_inc(x_116); +lean_inc(x_115); +lean_dec(x_110); +x_117 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_117, 0, x_115); +lean_ctor_set(x_117, 1, x_116); +return x_117; +} +} +} +else +{ +uint8_t x_118; +lean_dec(x_16); +lean_dec(x_3); +lean_dec(x_1); +x_118 = !lean_is_exclusive(x_106); +if (x_118 == 0) +{ +return x_106; +} +else +{ +lean_object* x_119; lean_object* x_120; lean_object* x_121; +x_119 = lean_ctor_get(x_106, 0); +x_120 = lean_ctor_get(x_106, 1); +lean_inc(x_120); +lean_inc(x_119); +lean_dec(x_106); +x_121 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_121, 0, x_119); +lean_ctor_set(x_121, 1, x_120); +return x_121; +} +} +} } block_69: { @@ -17999,160 +18279,6 @@ return x_68; } } } -block_103: -{ -uint8_t x_71; -x_71 = l_coeDecidableEq(x_70); -if (x_71 == 0) -{ -lean_object* x_72; uint8_t x_73; -x_72 = l_Lean_Parser_Term_tupleTail___elambda__1___closed__2; -lean_inc(x_33); -x_73 = l_Lean_Syntax_isOfKind(x_33, x_72); -if (x_73 == 0) -{ -uint8_t x_74; -x_74 = 0; -x_34 = x_74; -goto block_69; -} -else -{ -lean_object* x_75; lean_object* x_76; lean_object* x_77; uint8_t x_78; -x_75 = l_Lean_Syntax_getArgs(x_33); -x_76 = lean_array_get_size(x_75); -lean_dec(x_75); -x_77 = lean_unsigned_to_nat(2u); -x_78 = lean_nat_dec_eq(x_76, x_77); -lean_dec(x_76); -x_34 = x_78; -goto block_69; -} -} -else -{ -lean_object* x_79; lean_object* x_80; -lean_dec(x_2); -x_79 = l_Lean_Syntax_getArg(x_33, x_9); -lean_dec(x_33); -lean_inc(x_3); -x_80 = l_Lean_Elab_Term_elabType(x_79, x_3, x_4); -if (lean_obj_tag(x_80) == 0) -{ -lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; -x_81 = lean_ctor_get(x_80, 0); -lean_inc(x_81); -x_82 = lean_ctor_get(x_80, 1); -lean_inc(x_82); -lean_dec(x_80); -x_83 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_83, 0, x_81); -lean_inc(x_3); -lean_inc(x_83); -x_84 = l___private_Init_Lean_Elab_Term_10__elabCDot(x_16, x_83, x_3, x_82); -if (lean_obj_tag(x_84) == 0) -{ -lean_object* x_85; lean_object* x_86; lean_object* x_87; -x_85 = lean_ctor_get(x_84, 0); -lean_inc(x_85); -x_86 = lean_ctor_get(x_84, 1); -lean_inc(x_86); -lean_dec(x_84); -lean_inc(x_3); -lean_inc(x_85); -x_87 = l_Lean_Elab_Term_inferType(x_1, x_85, x_3, x_86); -if (lean_obj_tag(x_87) == 0) -{ -lean_object* x_88; lean_object* x_89; lean_object* x_90; -x_88 = lean_ctor_get(x_87, 0); -lean_inc(x_88); -x_89 = lean_ctor_get(x_87, 1); -lean_inc(x_89); -lean_dec(x_87); -x_90 = l_Lean_Elab_Term_ensureHasType(x_1, x_83, x_88, x_85, x_3, x_89); -lean_dec(x_1); -return x_90; -} -else -{ -uint8_t x_91; -lean_dec(x_85); -lean_dec(x_83); -lean_dec(x_3); -lean_dec(x_1); -x_91 = !lean_is_exclusive(x_87); -if (x_91 == 0) -{ -return x_87; -} -else -{ -lean_object* x_92; lean_object* x_93; lean_object* x_94; -x_92 = lean_ctor_get(x_87, 0); -x_93 = lean_ctor_get(x_87, 1); -lean_inc(x_93); -lean_inc(x_92); -lean_dec(x_87); -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_83); -lean_dec(x_3); -lean_dec(x_1); -x_95 = !lean_is_exclusive(x_84); -if (x_95 == 0) -{ -return x_84; -} -else -{ -lean_object* x_96; lean_object* x_97; lean_object* x_98; -x_96 = lean_ctor_get(x_84, 0); -x_97 = lean_ctor_get(x_84, 1); -lean_inc(x_97); -lean_inc(x_96); -lean_dec(x_84); -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; -} -} -} -else -{ -uint8_t x_99; -lean_dec(x_16); -lean_dec(x_3); -lean_dec(x_1); -x_99 = !lean_is_exclusive(x_80); -if (x_99 == 0) -{ -return x_80; -} -else -{ -lean_object* x_100; lean_object* x_101; lean_object* x_102; -x_100 = lean_ctor_get(x_80, 0); -x_101 = lean_ctor_get(x_80, 1); -lean_inc(x_101); -lean_inc(x_100); -lean_dec(x_80); -x_102 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_102, 0, x_100); -lean_ctor_set(x_102, 1, x_101); -return x_102; -} -} -} -} } } } @@ -20606,12 +20732,12 @@ l_Lean_Elab_Term_ensureType___closed__1 = _init_l_Lean_Elab_Term_ensureType___cl lean_mark_persistent(l_Lean_Elab_Term_ensureType___closed__1); l_Lean_Elab_Term_ensureType___closed__2 = _init_l_Lean_Elab_Term_ensureType___closed__2(); lean_mark_persistent(l_Lean_Elab_Term_ensureType___closed__2); -l_Lean_Elab_Term_ensureHasType___closed__1 = _init_l_Lean_Elab_Term_ensureHasType___closed__1(); -lean_mark_persistent(l_Lean_Elab_Term_ensureHasType___closed__1); -l_Lean_Elab_Term_ensureHasType___closed__2 = _init_l_Lean_Elab_Term_ensureHasType___closed__2(); -lean_mark_persistent(l_Lean_Elab_Term_ensureHasType___closed__2); -l_Lean_Elab_Term_ensureHasType___closed__3 = _init_l_Lean_Elab_Term_ensureHasType___closed__3(); -lean_mark_persistent(l_Lean_Elab_Term_ensureHasType___closed__3); +l_Lean_Elab_Term_ensureHasTypeAux___closed__1 = _init_l_Lean_Elab_Term_ensureHasTypeAux___closed__1(); +lean_mark_persistent(l_Lean_Elab_Term_ensureHasTypeAux___closed__1); +l_Lean_Elab_Term_ensureHasTypeAux___closed__2 = _init_l_Lean_Elab_Term_ensureHasTypeAux___closed__2(); +lean_mark_persistent(l_Lean_Elab_Term_ensureHasTypeAux___closed__2); +l_Lean_Elab_Term_ensureHasTypeAux___closed__3 = _init_l_Lean_Elab_Term_ensureHasTypeAux___closed__3(); +lean_mark_persistent(l_Lean_Elab_Term_ensureHasTypeAux___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(); diff --git a/stage0/stdlib/Init/Lean/Elab/TermApp.c b/stage0/stdlib/Init/Lean/Elab/TermApp.c index aa5837c778..0c284c1d47 100644 --- a/stage0/stdlib/Init/Lean/Elab/TermApp.c +++ b/stage0/stdlib/Init/Lean/Elab/TermApp.c @@ -104,7 +104,6 @@ lean_object* l___private_Init_Lean_Elab_TermApp_17__mergeFailures(lean_object*); lean_object* l___private_Init_Lean_Elab_TermApp_8__resolveLValLoop___main(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_forMAux___main___at___private_Init_Lean_Elab_TermApp_1__synthesizeAppInstMVars___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_nat_add(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_foldlStepMAux___main___at_Lean_Syntax_foldSepRevArgsM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_foldlM___main___at___private_Init_Lean_Elab_TermApp_10__mkBaseProjections___spec__1___closed__1; lean_object* l___private_Init_Lean_Elab_TermApp_11__addLValArg___main___closed__7; @@ -331,6 +330,7 @@ lean_object* l___private_Init_Lean_Elab_TermApp_12__elabAppLValsAux___main___box lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabSortApp(lean_object*); lean_object* l___private_Init_Lean_Elab_TermApp_1__synthesizeAppInstMVars(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_TermApp_7__resolveLValAux___closed__22; +lean_object* l_Lean_Elab_Term_ensureHasTypeAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_map___main___at___private_Init_Lean_Elab_TermApp_14__elabAppFn___main___spec__1(lean_object*); lean_object* l_Array_insertAt___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_findField_x3f___main(lean_object*, lean_object*, lean_object*); @@ -1306,7 +1306,7 @@ lean_object* x_87; lean_dec(x_41); lean_dec(x_6); lean_inc(x_10); -x_87 = l_Lean_Elab_Term_ensureHasType(x_1, x_3, x_8, x_9, x_10, x_14); +x_87 = l_Lean_Elab_Term_ensureHasTypeAux(x_1, x_3, x_8, x_9, x_10, x_14); if (lean_obj_tag(x_87) == 0) { lean_object* x_88; lean_object* x_89; lean_object* x_90; @@ -1530,7 +1530,7 @@ lean_object* x_138; lean_dec(x_41); lean_dec(x_6); lean_inc(x_10); -x_138 = l_Lean_Elab_Term_ensureHasType(x_1, x_3, x_8, x_9, x_10, x_14); +x_138 = l_Lean_Elab_Term_ensureHasTypeAux(x_1, x_3, x_8, x_9, x_10, x_14); if (lean_obj_tag(x_138) == 0) { lean_object* x_139; lean_object* x_140; lean_object* x_141; @@ -1812,7 +1812,7 @@ else { lean_object* x_23; lean_inc(x_10); -x_23 = l_Lean_Elab_Term_ensureHasType(x_1, x_3, x_8, x_9, x_10, x_14); +x_23 = l_Lean_Elab_Term_ensureHasTypeAux(x_1, x_3, x_8, x_9, x_10, x_14); if (lean_obj_tag(x_23) == 0) { lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; diff --git a/stage0/stdlib/Init/Lean/Parser/Term.c b/stage0/stdlib/Init/Lean/Parser/Term.c index 76fda06e98..23129fd3f1 100644 --- a/stage0/stdlib/Init/Lean/Parser/Term.c +++ b/stage0/stdlib/Init/Lean/Parser/Term.c @@ -609,6 +609,7 @@ lean_object* l_Lean_Parser_Term_hole___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_sort___closed__2; lean_object* l_Lean_Parser_Term_uminus___closed__3; lean_object* l_Lean_Parser_Term_let___closed__1; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_subtype___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_typeAscription; lean_object* l_Lean_Parser_Term_letIdDecl___elambda__1___closed__2; @@ -682,6 +683,7 @@ lean_object* l_Lean_Parser_Term_band___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_fun___elambda__1___closed__8; lean_object* l___private_Init_Lean_Parser_Parser_2__sepByFnAux___main___at_Lean_Parser_Term_where___elambda__1___spec__2___closed__2; lean_object* l_Lean_Parser_Term_nomatch; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__6; lean_object* l_Lean_Parser_Term_parenSpecial; lean_object* l_Lean_Parser_Term_mapConst___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_proj___closed__4; @@ -835,6 +837,7 @@ lean_object* l_Lean_Parser_Term_doElem; lean_object* l_Lean_Parser_Term_where___closed__8; lean_object* l_Lean_Parser_Term_do___closed__6; lean_object* l_Lean_Parser_Term_if___elambda__1___closed__6; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__8; lean_object* l_Lean_Parser_Term_doId___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_typeAscription___elambda__1___closed__7; lean_object* l_Lean_Parser_Term_fun___closed__1; @@ -892,6 +895,7 @@ lean_object* l___regBuiltinParser_Lean_Parser_Term_bindOp(lean_object*); lean_object* l_Lean_Parser_Term_seqRight___closed__2; lean_object* l_Lean_Parser_Term_matchAlt___elambda__1___closed__6; lean_object* l_Lean_Parser_Term_sort___closed__4; +lean_object* l_Lean_Parser_Term_namedHole; lean_object* l_Lean_Parser_Term_prod___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_heq___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_paren___closed__6; @@ -919,6 +923,7 @@ lean_object* l_Lean_Parser_Term_forall___elambda__1___closed__9; lean_object* l_Lean_Parser_Term_cdot___closed__5; lean_object* l_Lean_Parser_sepBy1Fn___at_Lean_Parser_Term_tupleTail___elambda__1___spec__1(uint8_t, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_num___closed__1; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__2; lean_object* l_Lean_Parser_orelseInfo(lean_object*, lean_object*); lean_object* l_Lean_Parser_dollarSymbol___elambda__1___rarg(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_suffices___elambda__1___closed__8; @@ -1014,6 +1019,7 @@ lean_object* l_Lean_Parser_Term_proj___closed__3; lean_object* l_Lean_Parser_manyAux___main___at_Lean_Parser_Term_match___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_uminus; lean_object* l_Lean_Parser_Term_namedArgument; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__1; lean_object* l_Lean_Parser_Term_implicitBinder(uint8_t); lean_object* l___regBuiltinParser_Lean_Parser_Term_seqLeft(lean_object*); lean_object* l_Lean_Parser_Term_orM___closed__3; @@ -1036,6 +1042,7 @@ lean_object* l_Lean_Parser_Term_show___closed__5; lean_object* l_Lean_Parser_Term_beq___elambda__1___closed__1; lean_object* l_Lean_Parser_Term_uminus___elambda__1___closed__5; lean_object* l_Lean_Parser_Term_have___elambda__1___closed__4; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__3; lean_object* l_Lean_Parser_sepByFn___at_Lean_Parser_Term_listLit___elambda__1___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_char___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_explicitBinder___closed__1; @@ -1055,6 +1062,7 @@ lean_object* l_Lean_Parser_Term_structInstField___elambda__1___closed__4; lean_object* l___regBuiltinParser_Lean_Parser_Term_fcomp(lean_object*); lean_object* l_Lean_Parser_Term_bne___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_let___elambda__1___closed__8; +lean_object* l_Lean_Parser_Term_namedHole___closed__5; lean_object* l_Lean_Parser_manyAux___main___at_Lean_Parser_Term_fun___elambda__1___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_mod___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_structInst___closed__2; @@ -1070,6 +1078,7 @@ lean_object* l___regBuiltinParser_Lean_Parser_Term_orM(lean_object*); lean_object* l___regBuiltinParser_Lean_Parser_Term_heq(lean_object*); lean_object* l_Lean_Parser_Term_typeAscription___elambda__1___closed__8; lean_object* l_Lean_Parser_Term_namedArgument___closed__1; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__5; lean_object* l_Lean_Parser_Term_arrow___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_uminus___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_namedPattern___closed__5; @@ -1159,6 +1168,7 @@ lean_object* l_Lean_Parser_Term_anonymousCtor___elambda__1(lean_object*, lean_ob lean_object* l_Lean_Parser_Term_listLit___elambda__1___closed__11; lean_object* l_Lean_Parser_ParserState_popSyntax(lean_object*); lean_object* l_Lean_Parser_Term_parser_x21; +extern lean_object* l_Lean_Parser_FirstTokens_toStr___closed__3; lean_object* l_Lean_Parser_Term_mapConstRev___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_inaccessible___elambda__1___closed__9; lean_object* l___regBuiltinParser_Lean_Parser_Term_nomatch(lean_object*); @@ -1217,6 +1227,7 @@ lean_object* l_Lean_Parser_Term_binderType___closed__5; lean_object* l_Lean_Parser_Term_explicitUniv___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_have___elambda__1___closed__8; lean_object* l_Lean_Parser_Term_fromTerm___elambda__1___closed__6; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__7; lean_object* l_Lean_Parser_Term_letIdLhs___closed__2; lean_object* l_Lean_Parser_categoryParserFn(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_doPat___closed__1; @@ -1256,6 +1267,7 @@ lean_object* l_Lean_Parser_Term_instBinder___closed__2; extern lean_object* l_Lean_Parser_regBuiltinTermParserAttr___closed__4; lean_object* l_Lean_Parser_Term_letDecl___closed__1; lean_object* l_Lean_Parser_Term_unicodeInfixL___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_namedHole___closed__3; lean_object* l_Lean_Parser_Term_doSeq___closed__5; lean_object* l_Lean_Parser_Term_emptyC___closed__4; lean_object* l_Lean_Parser_Term_band___closed__3; @@ -1523,6 +1535,7 @@ lean_object* l_Lean_Parser_Term_mul___closed__3; lean_object* l___regBuiltinParser_Lean_Parser_Term_cons(lean_object*); lean_object* l_Lean_Parser_Term_forall___closed__8; lean_object* l_Lean_Parser_Term_fromTerm___closed__6; +lean_object* l___regBuiltinParser_Lean_Parser_Term_namedHole(lean_object*); lean_object* l_Lean_Parser_Term_type; lean_object* l_Lean_Parser_Term_pow___closed__1; lean_object* l_Lean_Parser_Term_binderType___closed__4; @@ -1688,6 +1701,7 @@ lean_object* l_Lean_Parser_Term_fromTerm___elambda__1___closed__7; lean_object* l_Lean_Parser_Term_where___closed__2; lean_object* l_Lean_Parser_Term_do___elambda__1___closed__6; lean_object* l_Lean_Parser_Term_doLet___elambda__1___closed__2; +lean_object* l_Lean_Parser_Term_namedHole___closed__6; lean_object* l___regBuiltinParser_Lean_Parser_Term_listLit(lean_object*); lean_object* l_Lean_Parser_Term_type___elambda__1___closed__6; lean_object* l_Lean_Parser_mkAntiquot(uint8_t, lean_object*, lean_object*, uint8_t); @@ -1706,6 +1720,7 @@ lean_object* l_Lean_Parser_Term_doId___elambda__1(lean_object*, lean_object*, le lean_object* l_Lean_Parser_Term_mapConst___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_hole___closed__3; lean_object* l_Lean_Parser_Term_structInstSource___elambda__1___closed__3; +lean_object* l_Lean_Parser_Term_namedHole___closed__2; lean_object* l_Lean_Parser_Term_structInstField___closed__3; lean_object* l_Lean_Parser_Term_parser_x21___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_depArrow___elambda__1___closed__12; @@ -1783,6 +1798,7 @@ lean_object* l_Lean_Parser_Term_iff___elambda__1___closed__5; lean_object* l_Lean_Parser_many1Fn___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_letIdLhs; lean_object* l_Lean_Parser_darrow___elambda__1___rarg(lean_object*, lean_object*); +lean_object* l_Lean_Parser_Term_namedHole___closed__4; lean_object* l_Lean_Parser_Term_show___elambda__1___closed__9; lean_object* l_Lean_Parser_Term_subtype___closed__8; lean_object* l_Lean_Parser_Term_num___elambda__1(lean_object*, lean_object*, lean_object*); @@ -1855,6 +1871,7 @@ lean_object* l_Lean_Parser_charLitFn___rarg(lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_bindOp___elambda__1___closed__2; lean_object* l_Lean_Parser_Term_do___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_letDecl___closed__3; +lean_object* l_Lean_Parser_Term_namedHole___elambda__1___closed__4; lean_object* l_Lean_Parser_Term_subtype___elambda__1___closed__3; lean_object* l_Lean_Parser_Term_if___closed__7; lean_object* l_Lean_Parser_Term_match___closed__10; @@ -1907,6 +1924,7 @@ lean_object* l_Lean_Parser_Term_char___elambda__1___closed__1; lean_object* l_Lean_Parser_Term_bnot___elambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_let; lean_object* l_Lean_Parser_Term_depArrow___closed__3; +lean_object* l_Lean_Parser_Term_namedHole___closed__1; lean_object* l_Lean_Parser_Term_map; lean_object* l_Lean_Parser_Term_unicodeInfixR(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Term_tparser_x21___elambda__1___closed__9; @@ -5443,6 +5461,320 @@ x_6 = l_Lean_Parser_addBuiltinParser(x_2, x_3, x_4, x_5, x_1); return x_6; } } +lean_object* _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("namedHole"); +return x_1; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_explicitUniv___elambda__1___closed__2; +x_2 = l_Lean_Parser_Term_namedHole___elambda__1___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Parser_Term_namedHole___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_namedHole___elambda__1___closed__4() { +_start: +{ +uint8_t x_1; lean_object* x_2; lean_object* x_3; uint8_t x_4; lean_object* x_5; +x_1 = 0; +x_2 = l_Lean_Parser_Term_namedHole___elambda__1___closed__1; +x_3 = l_Lean_Parser_Term_namedHole___elambda__1___closed__3; +x_4 = 1; +x_5 = l_Lean_Parser_mkAntiquot(x_1, x_2, x_3, x_4); +return x_5; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__5() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Parser_FirstTokens_toStr___closed__3; +x_2 = l_String_trim(x_1); +return x_2; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__6() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Char_HasRepr___closed__1; +x_2 = l_Lean_Parser_Term_namedHole___elambda__1___closed__5; +x_3 = lean_string_append(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__7() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_namedHole___elambda__1___closed__6; +x_2 = l_Char_HasRepr___closed__1; +x_3 = lean_string_append(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__8() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = lean_box(0); +x_2 = l_Lean_Parser_Term_namedHole___elambda__1___closed__7; +x_3 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_3, 0, x_2); +lean_ctor_set(x_3, 1, x_1); +return x_3; +} +} +lean_object* l_Lean_Parser_Term_namedHole___elambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +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; +x_4 = l_Lean_Parser_Level_ident___elambda__1___closed__4; +x_5 = lean_ctor_get(x_4, 1); +lean_inc(x_5); +x_6 = l_Lean_Parser_Term_namedHole___elambda__1___closed__4; +x_7 = lean_ctor_get(x_6, 1); +lean_inc(x_7); +x_8 = lean_ctor_get(x_3, 0); +lean_inc(x_8); +x_9 = lean_array_get_size(x_8); +lean_dec(x_8); +x_10 = lean_ctor_get(x_3, 1); +lean_inc(x_10); +lean_inc(x_2); +lean_inc(x_1); +x_11 = lean_apply_3(x_7, x_1, x_2, x_3); +x_12 = lean_ctor_get(x_11, 3); +lean_inc(x_12); +if (lean_obj_tag(x_12) == 0) +{ +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_5); +lean_dec(x_2); +lean_dec(x_1); +return x_11; +} +else +{ +lean_object* x_13; lean_object* x_14; uint8_t x_15; +x_13 = lean_ctor_get(x_12, 0); +lean_inc(x_13); +lean_dec(x_12); +x_14 = lean_ctor_get(x_11, 1); +lean_inc(x_14); +x_15 = lean_nat_dec_eq(x_14, x_10); +lean_dec(x_14); +if (x_15 == 0) +{ +lean_dec(x_13); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_5); +lean_dec(x_2); +lean_dec(x_1); +return x_11; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_29; lean_object* x_30; +lean_inc(x_10); +x_16 = l_Lean_Parser_ParserState_restore(x_11, x_9, x_10); +lean_dec(x_9); +x_17 = lean_ctor_get(x_16, 0); +lean_inc(x_17); +x_18 = lean_array_get_size(x_17); +lean_dec(x_17); +lean_inc(x_2); +x_29 = l_Lean_Parser_tokenFn(x_2, x_16); +x_30 = lean_ctor_get(x_29, 3); +lean_inc(x_30); +if (lean_obj_tag(x_30) == 0) +{ +lean_object* x_31; lean_object* x_32; +x_31 = lean_ctor_get(x_29, 0); +lean_inc(x_31); +x_32 = l_Array_back___at___private_Init_Lean_Parser_Parser_6__updateCache___spec__1(x_31); +lean_dec(x_31); +if (lean_obj_tag(x_32) == 2) +{ +lean_object* x_33; lean_object* x_34; uint8_t x_35; +x_33 = lean_ctor_get(x_32, 1); +lean_inc(x_33); +lean_dec(x_32); +x_34 = l_Lean_Parser_Term_namedHole___elambda__1___closed__5; +x_35 = lean_string_dec_eq(x_33, x_34); +lean_dec(x_33); +if (x_35 == 0) +{ +lean_object* x_36; lean_object* x_37; +x_36 = l_Lean_Parser_Term_namedHole___elambda__1___closed__8; +lean_inc(x_10); +x_37 = l_Lean_Parser_ParserState_mkErrorsAt(x_29, x_36, x_10); +x_19 = x_37; +goto block_28; +} +else +{ +x_19 = x_29; +goto block_28; +} +} +else +{ +lean_object* x_38; lean_object* x_39; +lean_dec(x_32); +x_38 = l_Lean_Parser_Term_namedHole___elambda__1___closed__8; +lean_inc(x_10); +x_39 = l_Lean_Parser_ParserState_mkErrorsAt(x_29, x_38, x_10); +x_19 = x_39; +goto block_28; +} +} +else +{ +lean_object* x_40; lean_object* x_41; +lean_dec(x_30); +x_40 = l_Lean_Parser_Term_namedHole___elambda__1___closed__8; +lean_inc(x_10); +x_41 = l_Lean_Parser_ParserState_mkErrorsAt(x_29, x_40, x_10); +x_19 = x_41; +goto block_28; +} +block_28: +{ +lean_object* x_20; +x_20 = lean_ctor_get(x_19, 3); +lean_inc(x_20); +if (lean_obj_tag(x_20) == 0) +{ +lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; +x_21 = lean_apply_3(x_5, x_1, x_2, x_19); +x_22 = l_Lean_Parser_Term_namedHole___elambda__1___closed__2; +x_23 = l_Lean_Parser_ParserState_mkNode(x_21, x_22, x_18); +x_24 = l_Lean_Parser_mergeOrElseErrors(x_23, x_13, x_10); +lean_dec(x_10); +return x_24; +} +else +{ +lean_object* x_25; lean_object* x_26; lean_object* x_27; +lean_dec(x_20); +lean_dec(x_5); +lean_dec(x_2); +lean_dec(x_1); +x_25 = l_Lean_Parser_Term_namedHole___elambda__1___closed__2; +x_26 = l_Lean_Parser_ParserState_mkNode(x_19, x_25, x_18); +x_27 = l_Lean_Parser_mergeOrElseErrors(x_26, x_13, x_10); +lean_dec(x_10); +return x_27; +} +} +} +} +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_namedHole___elambda__1___closed__5; +x_2 = l_Lean_Parser_Level_paren___closed__1; +x_3 = l_Lean_Parser_symbolInfo(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; +x_1 = l_Lean_Parser_Level_ident___elambda__1___closed__4; +x_2 = lean_ctor_get(x_1, 0); +lean_inc(x_2); +x_3 = l_Lean_Parser_Term_namedHole___closed__1; +x_4 = l_Lean_Parser_andthenInfo(x_3, x_2); +return x_4; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_namedHole___elambda__1___closed__2; +x_2 = l_Lean_Parser_Term_namedHole___closed__2; +x_3 = l_Lean_Parser_nodeInfo(x_1, x_2); +return x_3; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___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_namedHole___elambda__1___closed__4; +x_2 = lean_ctor_get(x_1, 0); +lean_inc(x_2); +x_3 = l_Lean_Parser_Term_namedHole___closed__3; +x_4 = l_Lean_Parser_orelseInfo(x_2, x_3); +return x_4; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___closed__5() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Parser_Term_namedHole___elambda__1), 3, 0); +return x_1; +} +} +lean_object* _init_l_Lean_Parser_Term_namedHole___closed__6() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Parser_Term_namedHole___closed__4; +x_2 = l_Lean_Parser_Term_namedHole___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_namedHole() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Parser_Term_namedHole___closed__6; +return x_1; +} +} +lean_object* l___regBuiltinParser_Lean_Parser_Term_namedHole(lean_object* x_1) { +_start: +{ +uint8_t x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; +x_2 = 0; +x_3 = l_Lean_Parser_regBuiltinTermParserAttr___closed__4; +x_4 = l_Lean_Parser_Term_namedHole___elambda__1___closed__2; +x_5 = l_Lean_Parser_Term_namedHole; +x_6 = l_Lean_Parser_addBuiltinParser(x_2, x_3, x_4, x_5, x_1); +return x_6; +} +} lean_object* _init_l_Lean_Parser_Term_sorry___elambda__1___closed__1() { _start: { @@ -37549,6 +37881,39 @@ lean_mark_persistent(l_Lean_Parser_Term_hole); res = l___regBuiltinParser_Lean_Parser_Term_hole(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l_Lean_Parser_Term_namedHole___elambda__1___closed__1 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__1(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__1); +l_Lean_Parser_Term_namedHole___elambda__1___closed__2 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__2(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__2); +l_Lean_Parser_Term_namedHole___elambda__1___closed__3 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__3(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__3); +l_Lean_Parser_Term_namedHole___elambda__1___closed__4 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__4(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__4); +l_Lean_Parser_Term_namedHole___elambda__1___closed__5 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__5(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__5); +l_Lean_Parser_Term_namedHole___elambda__1___closed__6 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__6(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__6); +l_Lean_Parser_Term_namedHole___elambda__1___closed__7 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__7(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__7); +l_Lean_Parser_Term_namedHole___elambda__1___closed__8 = _init_l_Lean_Parser_Term_namedHole___elambda__1___closed__8(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___elambda__1___closed__8); +l_Lean_Parser_Term_namedHole___closed__1 = _init_l_Lean_Parser_Term_namedHole___closed__1(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___closed__1); +l_Lean_Parser_Term_namedHole___closed__2 = _init_l_Lean_Parser_Term_namedHole___closed__2(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___closed__2); +l_Lean_Parser_Term_namedHole___closed__3 = _init_l_Lean_Parser_Term_namedHole___closed__3(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___closed__3); +l_Lean_Parser_Term_namedHole___closed__4 = _init_l_Lean_Parser_Term_namedHole___closed__4(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___closed__4); +l_Lean_Parser_Term_namedHole___closed__5 = _init_l_Lean_Parser_Term_namedHole___closed__5(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___closed__5); +l_Lean_Parser_Term_namedHole___closed__6 = _init_l_Lean_Parser_Term_namedHole___closed__6(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole___closed__6); +l_Lean_Parser_Term_namedHole = _init_l_Lean_Parser_Term_namedHole(); +lean_mark_persistent(l_Lean_Parser_Term_namedHole); +res = l___regBuiltinParser_Lean_Parser_Term_namedHole(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); l_Lean_Parser_Term_sorry___elambda__1___closed__1 = _init_l_Lean_Parser_Term_sorry___elambda__1___closed__1(); lean_mark_persistent(l_Lean_Parser_Term_sorry___elambda__1___closed__1); l_Lean_Parser_Term_sorry___elambda__1___closed__2 = _init_l_Lean_Parser_Term_sorry___elambda__1___closed__2(); diff --git a/stage0/stdlib/Init/Lean/Syntax.c b/stage0/stdlib/Init/Lean/Syntax.c index ab5567d493..da03df6c86 100644 --- a/stage0/stdlib/Init/Lean/Syntax.c +++ b/stage0/stdlib/Init/Lean/Syntax.c @@ -41,8 +41,10 @@ lean_object* l_Lean_Syntax_ifNodeKind___rarg(lean_object*, lean_object*, lean_ob lean_object* l_Lean_Syntax_formatStxAux___main___closed__14; lean_object* l_Array_findMAux___main___at_Lean_Syntax_getHeadInfo___main___spec__1(lean_object*, lean_object*); lean_object* l_Lean_Syntax_isAtom___boxed(lean_object*); +lean_object* l_Array_findRevMAux___main___at_Lean_Syntax_getTailWithInfo___main___spec__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_mrewriteBottomUp___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getIdAt(lean_object*, lean_object*); +lean_object* l_Array_findRevMAux___main___at_Lean_Syntax_getTailWithInfo___main___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_toNat___boxed(lean_object*); lean_object* l___private_Init_Lean_Syntax_5__decodeBinLitAux(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_HasToString; @@ -105,6 +107,7 @@ lean_object* l___private_Init_Lean_Syntax_11__decodeQuotedChar___boxed__const__4 lean_object* l___private_Init_Lean_Syntax_11__decodeQuotedChar___boxed__const__1; lean_object* lean_mk_syntax_ident(lean_object*); lean_object* l_Lean_Syntax_hasArgs___boxed(lean_object*); +lean_object* l_Lean_Syntax_getTailWithInfo___main(lean_object*); lean_object* l_Lean_Syntax_formatStxAux___main___closed__4; lean_object* l_Array_findRevMAux___main___at_Lean_Syntax_getTailInfo___main___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkStxNumLit(lean_object*, lean_object*); @@ -220,6 +223,7 @@ lean_object* l_Lean_SourceInfo_updateTrailing(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Syntax_8__decodeHexLitAux___main(lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Syntax_2__updateLeadingAux(lean_object*, lean_object*); uint8_t l_Lean_Syntax_hasArgs(lean_object*); +lean_object* l_Lean_Syntax_getTailWithInfo(lean_object*); lean_object* l_String_quote(lean_object*); lean_object* l_Lean_Syntax_asNode___closed__1; lean_object* l_Lean_Syntax_HasToString___closed__2; @@ -2831,6 +2835,116 @@ lean_dec(x_1); return x_2; } } +lean_object* l_Array_findRevMAux___main___at_Lean_Syntax_getTailWithInfo___main___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; uint8_t x_5; +x_4 = lean_unsigned_to_nat(0u); +x_5 = lean_nat_dec_lt(x_4, x_2); +if (x_5 == 0) +{ +lean_object* x_6; +lean_dec(x_2); +x_6 = lean_box(0); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_7 = lean_unsigned_to_nat(1u); +x_8 = lean_nat_sub(x_2, x_7); +lean_dec(x_2); +x_9 = lean_array_fget(x_1, x_8); +x_10 = l_Lean_Syntax_getTailWithInfo___main(x_9); +if (lean_obj_tag(x_10) == 0) +{ +x_2 = x_8; +x_3 = lean_box(0); +goto _start; +} +else +{ +lean_dec(x_8); +return x_10; +} +} +} +} +lean_object* l_Lean_Syntax_getTailWithInfo___main(lean_object* x_1) { +_start: +{ +switch (lean_obj_tag(x_1)) { +case 0: +{ +lean_object* x_2; +x_2 = lean_box(0); +return x_2; +} +case 1: +{ +lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_3 = lean_ctor_get(x_1, 1); +lean_inc(x_3); +lean_dec(x_1); +x_4 = lean_array_get_size(x_3); +x_5 = l_Array_findRevMAux___main___at_Lean_Syntax_getTailWithInfo___main___spec__1(x_3, x_4, lean_box(0)); +lean_dec(x_3); +return x_5; +} +default: +{ +lean_object* x_6; +x_6 = lean_ctor_get(x_1, 0); +lean_inc(x_6); +if (lean_obj_tag(x_6) == 0) +{ +lean_object* x_7; +lean_dec(x_1); +x_7 = lean_box(0); +return x_7; +} +else +{ +uint8_t x_8; +x_8 = !lean_is_exclusive(x_6); +if (x_8 == 0) +{ +lean_object* x_9; +x_9 = lean_ctor_get(x_6, 0); +lean_dec(x_9); +lean_ctor_set(x_6, 0, x_1); +return x_6; +} +else +{ +lean_object* x_10; +lean_dec(x_6); +x_10 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_10, 0, x_1); +return x_10; +} +} +} +} +} +} +lean_object* l_Array_findRevMAux___main___at_Lean_Syntax_getTailWithInfo___main___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Array_findRevMAux___main___at_Lean_Syntax_getTailWithInfo___main___spec__1(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} +lean_object* l_Lean_Syntax_getTailWithInfo(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = l_Lean_Syntax_getTailWithInfo___main(x_1); +return x_2; +} +} lean_object* l_Array_findRevMAux___main___at_Lean_Syntax_getTailInfo___main___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: {