From d7905fcb5c7fff59e6a19a5edbc69e64cd95d307 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Mon, 10 Feb 2020 13:21:45 -0800 Subject: [PATCH] chore: update stage0 --- stage0/src/Init/Lean/Meta/Tactic.lean | 2 + stage0/src/Init/Lean/Meta/Tactic/Apply.lean | 17 +- stage0/src/Init/Lean/Meta/Tactic/Assert.lean | 39 + stage0/src/Init/Lean/Meta/Tactic/Clear.lean | 2 +- stage0/src/Init/Lean/Meta/Tactic/Intro.lean | 2 +- stage0/src/Init/Lean/Meta/Tactic/Subst.lean | 2 +- stage0/src/Init/Lean/Meta/Tactic/Target.lean | 50 + stage0/src/frontends/lean/builtin_exprs.cpp | 17 +- stage0/src/frontends/lean/elaborator.cpp | 37 +- stage0/src/frontends/lean/elaborator.h | 2 - stage0/src/library/constants.cpp | 8 - stage0/src/library/constants.h | 2 - stage0/src/library/constants.txt | 2 - stage0/stdlib/CMakeLists.txt | 2 +- stage0/stdlib/Init/Lean/Elab/App.c | 4 +- stage0/stdlib/Init/Lean/Meta/Tactic.c | 10 +- stage0/stdlib/Init/Lean/Meta/Tactic/Apply.c | 1485 +++++++------ stage0/stdlib/Init/Lean/Meta/Tactic/Assert.c | 470 +++++ stage0/stdlib/Init/Lean/Meta/Tactic/Clear.c | 516 ++--- stage0/stdlib/Init/Lean/Meta/Tactic/Intro.c | 187 +- stage0/stdlib/Init/Lean/Meta/Tactic/Subst.c | 1984 +++++++----------- stage0/stdlib/Init/Lean/Meta/Tactic/Target.c | 742 +++++++ 22 files changed, 3137 insertions(+), 2445 deletions(-) create mode 100644 stage0/src/Init/Lean/Meta/Tactic/Assert.lean create mode 100644 stage0/src/Init/Lean/Meta/Tactic/Target.lean create mode 100644 stage0/stdlib/Init/Lean/Meta/Tactic/Assert.c create mode 100644 stage0/stdlib/Init/Lean/Meta/Tactic/Target.c diff --git a/stage0/src/Init/Lean/Meta/Tactic.lean b/stage0/src/Init/Lean/Meta/Tactic.lean index 7c971ff0eb..fab4afd706 100644 --- a/stage0/src/Init/Lean/Meta/Tactic.lean +++ b/stage0/src/Init/Lean/Meta/Tactic.lean @@ -9,3 +9,5 @@ import Init.Lean.Meta.Tactic.Assumption import Init.Lean.Meta.Tactic.Apply import Init.Lean.Meta.Tactic.Revert import Init.Lean.Meta.Tactic.Clear +import Init.Lean.Meta.Tactic.Assert +import Init.Lean.Meta.Tactic.Target diff --git a/stage0/src/Init/Lean/Meta/Tactic/Apply.lean b/stage0/src/Init/Lean/Meta/Tactic/Apply.lean index 085f54673d..ffbc3d22d3 100644 --- a/stage0/src/Init/Lean/Meta/Tactic/Apply.lean +++ b/stage0/src/Init/Lean/Meta/Tactic/Apply.lean @@ -28,16 +28,16 @@ pure numArgs private def throwApplyError {α} (mvarId : MVarId) (eType : Expr) (targetType : Expr) : MetaM α := throwTacticEx `apply mvarId ("failed to unify" ++ indentExpr eType ++ Format.line ++ "with" ++ indentExpr targetType) -private def synthInstances (mvarId : MVarId) (newMVars : Array Expr) (binderInfos : Array BinderInfo) : MetaM Unit := +def synthAppInstances (tacticName : Name) (mvarId : MVarId) (newMVars : Array Expr) (binderInfos : Array BinderInfo) : MetaM Unit := newMVars.size.forM $ fun i => when (binderInfos.get! i).isInstImplicit $ do let mvar := newMVars.get! i; mvarType ← inferType mvar; mvarVal ← synthInstance mvarType; unlessM (isDefEq mvar mvarVal) $ - throwTacticEx `apply mvarId ("failed to assign synthesized instance") + throwTacticEx tacticName mvarId ("failed to assign synthesized instance") -private def appendParentTag (mvarId : MVarId) (newMVars : Array Expr) (binderInfos : Array BinderInfo) : MetaM Unit := do +def appendParentTag (mvarId : MVarId) (newMVars : Array Expr) (binderInfos : Array BinderInfo) : MetaM Unit := do parentTag ← getMVarTag mvarId; unless parentTag.isAnonymous $ newMVars.size.forM $ fun i => @@ -47,6 +47,11 @@ unless parentTag.isAnonymous $ currTag ← getMVarTag newMVarId; renameMVar newMVarId (parentTag ++ currTag.eraseMacroScopes) +def postprocessAppMVars (tacticName : Name) (mvarId : MVarId) (newMVars : Array Expr) (binderInfos : Array BinderInfo) : MetaM Unit := do +synthAppInstances tacticName mvarId newMVars binderInfos; +-- TODO: default and auto params +appendParentTag mvarId newMVars binderInfos + private def dependsOnOthers (mvar : Expr) (otherMVars : Array Expr) : MetaM Bool := otherMVars.anyM $ fun otherMVar => if mvar == otherMVar then pure false @@ -80,10 +85,8 @@ withMVarContext mvarId $ do }; (newMVars, binderInfos, eType) ← forallMetaTelescopeReducing eType (some numArgs); unlessM (isDefEq eType targetType) $ throwApplyError mvarId eType targetType; - synthInstances mvarId newMVars binderInfos; - let val := mkAppN e newMVars; - assignExprMVar mvarId val; - appendParentTag mvarId newMVars binderInfos; + postprocessAppMVars `apply mvarId newMVars binderInfos; + assignExprMVar mvarId (mkAppN e newMVars); newMVars ← newMVars.filterM $ fun mvar => not <$> isExprMVarAssigned mvar.mvarId!; -- TODO: add option `ApplyNewGoals` and implement other orders reorderNonDependentFirst newMVars diff --git a/stage0/src/Init/Lean/Meta/Tactic/Assert.lean b/stage0/src/Init/Lean/Meta/Tactic/Assert.lean new file mode 100644 index 0000000000..90f04d2182 --- /dev/null +++ b/stage0/src/Init/Lean/Meta/Tactic/Assert.lean @@ -0,0 +1,39 @@ +/- +Copyright (c) 2020 Microsoft Corporation. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Leonardo de Moura +-/ +prelude +import Init.Lean.Meta.Tactic.Util + +namespace Lean +namespace Meta + +/-- + Convert the given goal `Ctx |- target` into `Ctx |- type -> target`. + It assumes `val` has type `type` -/ +def assert (mvarId : MVarId) (name : Name) (type : Expr) (val : Expr) : MetaM MVarId := do +withMVarContext mvarId $ do + checkNotAssigned mvarId `assert; + tag ← getMVarTag mvarId; + target ← getMVarType mvarId; + let newType := Lean.mkForall name BinderInfo.default type target; + newMVar ← mkFreshExprSyntheticOpaqueMVar newType tag; + assignExprMVar mvarId (mkApp newMVar val); + pure newMVar.mvarId! + +/-- + Convert the given goal `Ctx |- target` into `Ctx |- let name : type := val; target`. + It assumes `val` has type `type` -/ +def define (mvarId : MVarId) (name : Name) (type : Expr) (val : Expr) : MetaM MVarId := do +withMVarContext mvarId $ do + checkNotAssigned mvarId `define; + tag ← getMVarTag mvarId; + target ← getMVarType mvarId; + let newType := Lean.mkLet name type val target; + newMVar ← mkFreshExprSyntheticOpaqueMVar newType tag; + assignExprMVar mvarId newMVar; + pure newMVar.mvarId! + +end Meta +end Lean diff --git a/stage0/src/Init/Lean/Meta/Tactic/Clear.lean b/stage0/src/Init/Lean/Meta/Tactic/Clear.lean index 330caf0a6b..4a017ab05d 100644 --- a/stage0/src/Init/Lean/Meta/Tactic/Clear.lean +++ b/stage0/src/Init/Lean/Meta/Tactic/Clear.lean @@ -30,7 +30,7 @@ withMVarContext mvarId $ do | none => localInsts | some idx => localInsts.eraseIdx idx; newMVar ← mkFreshExprMVarAt lctx localInsts mvarDecl.type tag MetavarKind.syntheticOpaque; - modify $ fun s => { mctx := s.mctx.assignExpr mvarId newMVar, .. s }; + assignExprMVar mvarId newMVar; pure newMVar.mvarId! end Meta diff --git a/stage0/src/Init/Lean/Meta/Tactic/Intro.lean b/stage0/src/Init/Lean/Meta/Tactic/Intro.lean index 5218f20c75..723b82e9f3 100644 --- a/stage0/src/Init/Lean/Meta/Tactic/Intro.lean +++ b/stage0/src/Init/Lean/Meta/Tactic/Intro.lean @@ -20,7 +20,7 @@ def introNCoreAux {σ} (mvarId : MVarId) (mkName : LocalContext → Name → σ newMVar ← mkFreshExprSyntheticOpaqueMVar type tag; lctx ← getLCtx; newVal ← mkLambda fvars newMVar; - modify $ fun s => { mctx := s.mctx.assignExpr mvarId newVal, .. s }; + assignExprMVar mvarId newVal; pure $ (fvars, newMVar.mvarId!) | (i+1), lctx, fvars, j, s, Expr.letE n type val body _ => do let type := type.instantiateRevRange j fvars.size fvars; diff --git a/stage0/src/Init/Lean/Meta/Tactic/Subst.lean b/stage0/src/Init/Lean/Meta/Tactic/Subst.lean index b28a3710e4..bd3cc3090f 100644 --- a/stage0/src/Init/Lean/Meta/Tactic/Subst.lean +++ b/stage0/src/Init/Lean/Meta/Tactic/Subst.lean @@ -52,7 +52,7 @@ withMVarContext mvarId $ do newMVar ← mkFreshExprSyntheticOpaqueMVar newType tag; let minor := newMVar; newVal ← if depElim then mkEqRec motive minor major else mkEqNDRec motive minor major; - modify $ fun s => { mctx := s.mctx.assignExpr mvarId newVal, .. s }; + assignExprMVar mvarId newVal; let mvarId := newMVar.mvarId!; mvarId ← clear mvarId hFVarId; mvarId ← clear mvarId aFVarId; diff --git a/stage0/src/Init/Lean/Meta/Tactic/Target.lean b/stage0/src/Init/Lean/Meta/Tactic/Target.lean new file mode 100644 index 0000000000..a493655c3b --- /dev/null +++ b/stage0/src/Init/Lean/Meta/Tactic/Target.lean @@ -0,0 +1,50 @@ +/- +Copyright (c) 2020 Microsoft Corporation. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Leonardo de Moura +-/ +prelude +import Init.Lean.Meta.AppBuilder +import Init.Lean.Meta.Tactic.Util + +namespace Lean +namespace Meta + +/-- + Convert the given goal `Ctx |- target` into `Ctx |- newTarget` using an equality proof `eqProof : target = newTarget`. + It assumes `eqProof` has type `target = newTarget` -/ +def replaceTargetEq (mvarId : MVarId) (newTarget : Expr) (eqProof : Expr) : MetaM MVarId := do +withMVarContext mvarId $ do + checkNotAssigned mvarId `replaceTarget; + tag ← getMVarTag mvarId; + newMVar ← mkFreshExprSyntheticOpaqueMVar newTarget tag; + target ← getMVarType mvarId; + u ← getLevel target; + eq ← mkEq target newTarget; + let newProof := mkApp2 (mkConst `id [levelZero]) eq eqProof; -- checkpoint for eqProof + let newVal := mkAppN (Lean.mkConst `Eq.mpr [u]) #[target, newTarget, eqProof, newMVar]; + assignExprMVar mvarId newMVar; + pure newMVar.mvarId! + +/-- + Convert the given goal `Ctx | target` into `Ctx |- newTarget`. It assumes the goals are definitionally equal. + We use the proof term + ``` + @id target newMVar + ``` + to create a checkpoint. -/ +def replaceTargetDefEq (mvarId : MVarId) (newTarget : Expr) : MetaM MVarId := +withMVarContext mvarId $ do + checkNotAssigned mvarId `change; + target ← getMVarType mvarId; + if target == newTarget then pure mvarId + else do + tag ← getMVarTag mvarId; + newMVar ← mkFreshExprSyntheticOpaqueMVar newTarget tag; + u ← getLevel target; + let newVal := mkApp2 (Lean.mkConst `id [u]) target newMVar; + assignExprMVar mvarId newMVar; + pure newMVar.mvarId! + +end Meta +end Lean diff --git a/stage0/src/frontends/lean/builtin_exprs.cpp b/stage0/src/frontends/lean/builtin_exprs.cpp index e481a01450..c445ce6b70 100644 --- a/stage0/src/frontends/lean/builtin_exprs.cpp +++ b/stage0/src/frontends/lean/builtin_exprs.cpp @@ -329,18 +329,13 @@ static expr parse_do(parser & p, bool has_braces) { if (optional r = else_cases[i]) { else_case = *r; ignore_if_unused = false; - } else { - else_case = p.save_pos(mark_do_failure_eq(p.save_pos(mk_constant(get_match_failed_name()), pos)), pos); - ignore_if_unused = true; + expr x = mk_local(p.next_name(), "_x", mk_expr_placeholder(), mk_binder_info()); + expr else_eq = Fun(fn, Fun(x, p.save_pos(mk_equation(p.rec_save_pos(mk_app(fn, x), pos), + else_case, + ignore_if_unused), + pos), p), p); + eqs.push_back(else_eq); } - // add case - // _ := else_case - expr x = mk_local(p.next_name(), "_x", mk_expr_placeholder(), mk_binder_info()); - expr else_eq = Fun(fn, Fun(x, p.save_pos(mk_equation(p.rec_save_pos(mk_app(fn, x), pos), - else_case, - ignore_if_unused), - pos), p), p); - eqs.push_back(else_eq); equations_header h = mk_match_header(match_scope.get_name(), match_scope.get_actual_name()); expr eqns = p.save_pos(mk_equations(h, eqs.size(), eqs.data()), pos); expr local = mk_local("_p", mk_expr_placeholder()); diff --git a/stage0/src/frontends/lean/elaborator.cpp b/stage0/src/frontends/lean/elaborator.cpp index 9be90484c6..06456a4c23 100644 --- a/stage0/src/frontends/lean/elaborator.cpp +++ b/stage0/src/frontends/lean/elaborator.cpp @@ -722,17 +722,6 @@ bool elaborator::is_monad(expr const & e) { } } -bool elaborator::is_monad_fail(expr const & e) { - try { - expr m = mk_app(m_ctx, get_monad_fail_name(), e); - return static_cast(m_ctx.mk_class_instance(m)); - } catch (app_builder_exception &) { - return false; - } catch (class_exception &) { - return false; - } -} - /* When lifting monads in do-notation and/or bind, it is very common to have coercion problems such as @@ -2355,18 +2344,6 @@ static void check_equations_arity(buffer const & eqns) { } } -bool elaborator::keep_do_failure_eq(expr const & first_eq) { - if (!is_lambda(first_eq)) - return false; // possible with error recovery - expr type = binding_domain(first_eq); - if (!is_pi(type)) - return false; - type = binding_body(type); - if (has_loose_bvars(type)) - return false; - return is_app(type) && is_monad_fail(app_fn(type)); -} - static void mvar_dep_sort_aux(type_context_old & ctx, expr const & m, name_set const & mvar_names, name_set & visited, buffer & result) { if (visited.contains(mvar_name(m))) @@ -2721,15 +2698,11 @@ expr elaborator::visit_equations(expr const & e) { for (expr const & eq : eqs) { expr new_eq; if (first_eq) { - if (is_do_failure_eq(eq) && !keep_do_failure_eq(*first_eq)) { - /* skip equation since it doesn't implement the monad_fail interface */ - } else { - /* Replace first num_fns domains of eq with the ones in first_eq. - This is a trick/hack to ensure the fns in each equation have - the same elaborated type. */ - new_eq = copy_pos(eq, visit_equation(copy_domain(num_fns, *first_eq, eq), num_fns)); - new_eqs.push_back(new_eq); - } + /* Replace first num_fns domains of eq with the ones in first_eq. + This is a trick/hack to ensure the fns in each equation have + the same elaborated type. */ + new_eq = copy_pos(eq, visit_equation(copy_domain(num_fns, *first_eq, eq), num_fns)); + new_eqs.push_back(new_eq); } else { new_eq = copy_pos(eq, visit_equation(eq, num_fns)); first_eq = new_eq; diff --git a/stage0/src/frontends/lean/elaborator.h b/stage0/src/frontends/lean/elaborator.h index 2a6aea67eb..016d8dad15 100644 --- a/stage0/src/frontends/lean/elaborator.h +++ b/stage0/src/frontends/lean/elaborator.h @@ -146,7 +146,6 @@ private: optional mk_Prop_to_bool_coercion(expr const & e, expr const & ref); optional mk_coercion_core(expr const & e, expr const & e_type, expr const & type, expr const & ref); bool is_monad(expr const & e); - bool is_monad_fail(expr const & e); optional try_monad_coercion(expr const & e, expr e_type, expr type, expr const & ref); optional mk_coercion(expr const & e, expr e_type, expr type, expr const & ref); @@ -239,7 +238,6 @@ private: expr visit_app(expr const & e, optional const & expected_type); expr visit_let(expr const & e, optional const & expected_type); expr visit_convoy(expr const & e, optional const & expected_type); - bool keep_do_failure_eq(expr const & first_eq); expr visit_equations(expr const & e); expr visit_equation(expr const & eq, unsigned num_fns); expr visit_inaccessible(expr const & e, optional const & expected_type); diff --git a/stage0/src/library/constants.cpp b/stage0/src/library/constants.cpp index 759bd41146..36868343ae 100644 --- a/stage0/src/library/constants.cpp +++ b/stage0/src/library/constants.cpp @@ -114,9 +114,7 @@ name const * g_list = nullptr; name const * g_list_nil = nullptr; name const * g_list_cons = nullptr; name const * g_list_to_array = nullptr; -name const * g_match_failed = nullptr; name const * g_monad = nullptr; -name const * g_monad_fail = nullptr; name const * g_lean_name_anonymous = nullptr; name const * g_lean_name_num = nullptr; name const * g_lean_name_str = nullptr; @@ -306,9 +304,7 @@ void initialize_constants() { g_list_nil = new name{"List", "nil"}; g_list_cons = new name{"List", "cons"}; g_list_to_array = new name{"List", "toArray"}; - g_match_failed = new name{"matchFailed"}; g_monad = new name{"Monad"}; - g_monad_fail = new name{"MonadFail"}; g_lean_name_anonymous = new name{"Lean", "Name", "anonymous"}; g_lean_name_num = new name{"Lean", "Name", "num"}; g_lean_name_str = new name{"Lean", "Name", "str"}; @@ -499,9 +495,7 @@ void finalize_constants() { delete g_list_nil; delete g_list_cons; delete g_list_to_array; - delete g_match_failed; delete g_monad; - delete g_monad_fail; delete g_lean_name_anonymous; delete g_lean_name_num; delete g_lean_name_str; @@ -691,9 +685,7 @@ name const & get_list_name() { return *g_list; } name const & get_list_nil_name() { return *g_list_nil; } name const & get_list_cons_name() { return *g_list_cons; } name const & get_list_to_array_name() { return *g_list_to_array; } -name const & get_match_failed_name() { return *g_match_failed; } name const & get_monad_name() { return *g_monad; } -name const & get_monad_fail_name() { return *g_monad_fail; } name const & get_lean_name_anonymous_name() { return *g_lean_name_anonymous; } name const & get_lean_name_num_name() { return *g_lean_name_num; } name const & get_lean_name_str_name() { return *g_lean_name_str; } diff --git a/stage0/src/library/constants.h b/stage0/src/library/constants.h index 49346eb211..6f8a9bc49f 100644 --- a/stage0/src/library/constants.h +++ b/stage0/src/library/constants.h @@ -116,9 +116,7 @@ name const & get_list_name(); name const & get_list_nil_name(); name const & get_list_cons_name(); name const & get_list_to_array_name(); -name const & get_match_failed_name(); name const & get_monad_name(); -name const & get_monad_fail_name(); name const & get_lean_name_anonymous_name(); name const & get_lean_name_num_name(); name const & get_lean_name_str_name(); diff --git a/stage0/src/library/constants.txt b/stage0/src/library/constants.txt index 5329d43dd8..ed814182d5 100644 --- a/stage0/src/library/constants.txt +++ b/stage0/src/library/constants.txt @@ -109,9 +109,7 @@ List List.nil List.cons List.toArray -matchFailed Monad -MonadFail Lean.Name.anonymous Lean.Name.num Lean.Name.str diff --git a/stage0/stdlib/CMakeLists.txt b/stage0/stdlib/CMakeLists.txt index 0e2c5e9bf0..567475f563 100644 --- a/stage0/stdlib/CMakeLists.txt +++ b/stage0/stdlib/CMakeLists.txt @@ -1 +1 @@ -add_library (stage0 OBJECT Init/./Coe.c Init/./Control.c Init/./Control/Alternative.c Init/./Control/Applicative.c Init/./Control/Conditional.c Init/./Control/EState.c Init/./Control/Except.c Init/./Control/Functor.c Init/./Control/Id.c Init/./Control/Lift.c Init/./Control/Monad.c Init/./Control/MonadFail.c Init/./Control/Option.c Init/./Control/Reader.c Init/./Control/State.c Init/./Core.c Init/./Data.c Init/./Data/Array.c Init/./Data/Array/Basic.c Init/./Data/Array/BinSearch.c Init/./Data/Array/QSort.c Init/./Data/AssocList.c Init/./Data/Basic.c Init/./Data/BinomialHeap.c Init/./Data/BinomialHeap/Basic.c Init/./Data/ByteArray.c Init/./Data/ByteArray/Basic.c Init/./Data/Char.c Init/./Data/Char/Basic.c Init/./Data/DList.c Init/./Data/Fin.c Init/./Data/Fin/Basic.c Init/./Data/HashMap.c Init/./Data/HashMap/Basic.c Init/./Data/HashSet.c Init/./Data/Hashable.c Init/./Data/Int.c Init/./Data/Int/Basic.c Init/./Data/List.c Init/./Data/List/Basic.c Init/./Data/List/BasicAux.c Init/./Data/List/Control.c Init/./Data/List/Instances.c Init/./Data/Nat.c Init/./Data/Nat/Basic.c Init/./Data/Nat/Bitwise.c Init/./Data/Nat/Control.c Init/./Data/Nat/Div.c Init/./Data/Option.c Init/./Data/Option/Basic.c Init/./Data/Option/BasicAux.c Init/./Data/Option/Instances.c Init/./Data/PersistentArray.c Init/./Data/PersistentArray/Basic.c Init/./Data/PersistentHashMap.c Init/./Data/PersistentHashMap/Basic.c Init/./Data/PersistentHashSet.c Init/./Data/Queue.c Init/./Data/Queue/Basic.c Init/./Data/RBMap.c Init/./Data/RBMap/Basic.c Init/./Data/RBMap/BasicAux.c Init/./Data/RBTree.c Init/./Data/RBTree/Basic.c Init/./Data/Random.c Init/./Data/Repr.c Init/./Data/Stack.c Init/./Data/Stack/Basic.c Init/./Data/String.c Init/./Data/String/Basic.c Init/./Data/ToString.c Init/./Data/UInt.c Init/./Default.c Init/./Fix.c Init/./HasCoe.c Init/./Lean.c Init/./Lean/Attributes.c Init/./Lean/AuxRecursor.c Init/./Lean/Class.c Init/./Lean/Compiler.c Init/./Lean/Compiler/ClosedTermCache.c Init/./Lean/Compiler/ConstFolding.c Init/./Lean/Compiler/ExportAttr.c Init/./Lean/Compiler/ExternAttr.c Init/./Lean/Compiler/IR.c Init/./Lean/Compiler/IR/Basic.c Init/./Lean/Compiler/IR/Borrow.c Init/./Lean/Compiler/IR/Boxing.c Init/./Lean/Compiler/IR/Checker.c Init/./Lean/Compiler/IR/CompilerM.c Init/./Lean/Compiler/IR/CtorLayout.c Init/./Lean/Compiler/IR/ElimDeadBranches.c Init/./Lean/Compiler/IR/ElimDeadVars.c Init/./Lean/Compiler/IR/EmitC.c Init/./Lean/Compiler/IR/EmitUtil.c Init/./Lean/Compiler/IR/ExpandResetReuse.c Init/./Lean/Compiler/IR/Format.c Init/./Lean/Compiler/IR/FreeVars.c Init/./Lean/Compiler/IR/LiveVars.c Init/./Lean/Compiler/IR/NormIds.c Init/./Lean/Compiler/IR/PushProj.c Init/./Lean/Compiler/IR/RC.c Init/./Lean/Compiler/IR/ResetReuse.c Init/./Lean/Compiler/IR/SimpCase.c Init/./Lean/Compiler/IR/UnboxResult.c Init/./Lean/Compiler/ImplementedByAttr.c Init/./Lean/Compiler/InitAttr.c Init/./Lean/Compiler/InlineAttrs.c Init/./Lean/Compiler/NameMangling.c Init/./Lean/Compiler/NeverExtractAttr.c Init/./Lean/Compiler/Specialize.c Init/./Lean/Compiler/Util.c Init/./Lean/Data/Format.c Init/./Lean/Data/KVMap.c Init/./Lean/Data/LBool.c Init/./Lean/Data/LOption.c Init/./Lean/Data/Name.c Init/./Lean/Data/Occurrences.c Init/./Lean/Data/Options.c Init/./Lean/Data/Position.c Init/./Lean/Data/SMap.c Init/./Lean/Data/Trie.c Init/./Lean/Declaration.c Init/./Lean/Elab.c Init/./Lean/Elab/Alias.c Init/./Lean/Elab/App.c Init/./Lean/Elab/Binders.c Init/./Lean/Elab/BuiltinNotation.c Init/./Lean/Elab/Command.c Init/./Lean/Elab/DeclModifiers.c Init/./Lean/Elab/Declaration.c Init/./Lean/Elab/Definition.c Init/./Lean/Elab/DoNotation.c Init/./Lean/Elab/Exception.c Init/./Lean/Elab/Frontend.c Init/./Lean/Elab/Import.c Init/./Lean/Elab/Level.c Init/./Lean/Elab/Log.c Init/./Lean/Elab/Match.c Init/./Lean/Elab/Quotation.c Init/./Lean/Elab/ResolveName.c Init/./Lean/Elab/StrategyAttrs.c Init/./Lean/Elab/StructInst.c Init/./Lean/Elab/Syntax.c Init/./Lean/Elab/SyntheticMVars.c Init/./Lean/Elab/Tactic.c Init/./Lean/Elab/Tactic/Basic.c Init/./Lean/Elab/Tactic/ElabTerm.c Init/./Lean/Elab/Term.c Init/./Lean/Elab/Util.c Init/./Lean/Environment.c Init/./Lean/EqnCompiler.c Init/./Lean/EqnCompiler/MatchPattern.c Init/./Lean/Eval.c Init/./Lean/Expr.c Init/./Lean/HeadIndex.c Init/./Lean/Hygiene.c Init/./Lean/Level.c Init/./Lean/Linter.c Init/./Lean/LocalContext.c Init/./Lean/Message.c Init/./Lean/Meta.c Init/./Lean/Meta/AbstractMVars.c Init/./Lean/Meta/AppBuilder.c Init/./Lean/Meta/Basic.c Init/./Lean/Meta/Check.c Init/./Lean/Meta/DiscrTree.c Init/./Lean/Meta/DiscrTreeTypes.c Init/./Lean/Meta/Exception.c Init/./Lean/Meta/ExprDefEq.c Init/./Lean/Meta/FunInfo.c Init/./Lean/Meta/InferType.c Init/./Lean/Meta/Instances.c Init/./Lean/Meta/KAbstract.c Init/./Lean/Meta/LevelDefEq.c Init/./Lean/Meta/Message.c Init/./Lean/Meta/Offset.c Init/./Lean/Meta/Reduce.c Init/./Lean/Meta/SynthInstance.c Init/./Lean/Meta/Tactic.c Init/./Lean/Meta/Tactic/Apply.c Init/./Lean/Meta/Tactic/Assumption.c Init/./Lean/Meta/Tactic/Clear.c Init/./Lean/Meta/Tactic/FVarSubst.c Init/./Lean/Meta/Tactic/Intro.c Init/./Lean/Meta/Tactic/Revert.c Init/./Lean/Meta/Tactic/Subst.c Init/./Lean/Meta/Tactic/Util.c Init/./Lean/Meta/WHNF.c Init/./Lean/MetavarContext.c Init/./Lean/Modifiers.c Init/./Lean/Parser.c Init/./Lean/Parser/Command.c Init/./Lean/Parser/Level.c Init/./Lean/Parser/Module.c Init/./Lean/Parser/Parser.c Init/./Lean/Parser/Syntax.c Init/./Lean/Parser/Tactic.c Init/./Lean/Parser/Term.c Init/./Lean/Parser/Transform.c Init/./Lean/ProjFns.c Init/./Lean/ReducibilityAttrs.c Init/./Lean/ReplaceExpr.c Init/./Lean/Runtime.c Init/./Lean/Scopes.c Init/./Lean/Structure.c Init/./Lean/Syntax.c Init/./Lean/ToExpr.c Init/./Lean/Util/CollectFVars.c Init/./Lean/Util/CollectLevelParams.c Init/./Lean/Util/CollectMVars.c Init/./Lean/Util/FindMVar.c Init/./Lean/Util/MonadCache.c Init/./Lean/Util/PPExt.c Init/./Lean/Util/PPGoal.c Init/./Lean/Util/Path.c Init/./Lean/Util/Profile.c Init/./Lean/Util/RecDepth.c Init/./Lean/Util/Sorry.c Init/./Lean/Util/Trace.c Init/./Lean/Util/WHNF.c Init/./LeanInit.c Init/./MutQuot.c Init/./System.c Init/./System/FilePath.c Init/./System/IO.c Init/./System/IOError.c Init/./System/Platform.c Init/./Util.c Init/./WF.c) +add_library (stage0 OBJECT Init/./Coe.c Init/./Control.c Init/./Control/Alternative.c Init/./Control/Applicative.c Init/./Control/Conditional.c Init/./Control/EState.c Init/./Control/Except.c Init/./Control/Functor.c Init/./Control/Id.c Init/./Control/Lift.c Init/./Control/Monad.c Init/./Control/MonadFail.c Init/./Control/Option.c Init/./Control/Reader.c Init/./Control/State.c Init/./Core.c Init/./Data.c Init/./Data/Array.c Init/./Data/Array/Basic.c Init/./Data/Array/BinSearch.c Init/./Data/Array/QSort.c Init/./Data/AssocList.c Init/./Data/Basic.c Init/./Data/BinomialHeap.c Init/./Data/BinomialHeap/Basic.c Init/./Data/ByteArray.c Init/./Data/ByteArray/Basic.c Init/./Data/Char.c Init/./Data/Char/Basic.c Init/./Data/DList.c Init/./Data/Fin.c Init/./Data/Fin/Basic.c Init/./Data/HashMap.c Init/./Data/HashMap/Basic.c Init/./Data/HashSet.c Init/./Data/Hashable.c Init/./Data/Int.c Init/./Data/Int/Basic.c Init/./Data/List.c Init/./Data/List/Basic.c Init/./Data/List/BasicAux.c Init/./Data/List/Control.c Init/./Data/List/Instances.c Init/./Data/Nat.c Init/./Data/Nat/Basic.c Init/./Data/Nat/Bitwise.c Init/./Data/Nat/Control.c Init/./Data/Nat/Div.c Init/./Data/Option.c Init/./Data/Option/Basic.c Init/./Data/Option/BasicAux.c Init/./Data/Option/Instances.c Init/./Data/PersistentArray.c Init/./Data/PersistentArray/Basic.c Init/./Data/PersistentHashMap.c Init/./Data/PersistentHashMap/Basic.c Init/./Data/PersistentHashSet.c Init/./Data/Queue.c Init/./Data/Queue/Basic.c Init/./Data/RBMap.c Init/./Data/RBMap/Basic.c Init/./Data/RBMap/BasicAux.c Init/./Data/RBTree.c Init/./Data/RBTree/Basic.c Init/./Data/Random.c Init/./Data/Repr.c Init/./Data/Stack.c Init/./Data/Stack/Basic.c Init/./Data/String.c Init/./Data/String/Basic.c Init/./Data/ToString.c Init/./Data/UInt.c Init/./Default.c Init/./Fix.c Init/./HasCoe.c Init/./Lean.c Init/./Lean/Attributes.c Init/./Lean/AuxRecursor.c Init/./Lean/Class.c Init/./Lean/Compiler.c Init/./Lean/Compiler/ClosedTermCache.c Init/./Lean/Compiler/ConstFolding.c Init/./Lean/Compiler/ExportAttr.c Init/./Lean/Compiler/ExternAttr.c Init/./Lean/Compiler/IR.c Init/./Lean/Compiler/IR/Basic.c Init/./Lean/Compiler/IR/Borrow.c Init/./Lean/Compiler/IR/Boxing.c Init/./Lean/Compiler/IR/Checker.c Init/./Lean/Compiler/IR/CompilerM.c Init/./Lean/Compiler/IR/CtorLayout.c Init/./Lean/Compiler/IR/ElimDeadBranches.c Init/./Lean/Compiler/IR/ElimDeadVars.c Init/./Lean/Compiler/IR/EmitC.c Init/./Lean/Compiler/IR/EmitUtil.c Init/./Lean/Compiler/IR/ExpandResetReuse.c Init/./Lean/Compiler/IR/Format.c Init/./Lean/Compiler/IR/FreeVars.c Init/./Lean/Compiler/IR/LiveVars.c Init/./Lean/Compiler/IR/NormIds.c Init/./Lean/Compiler/IR/PushProj.c Init/./Lean/Compiler/IR/RC.c Init/./Lean/Compiler/IR/ResetReuse.c Init/./Lean/Compiler/IR/SimpCase.c Init/./Lean/Compiler/IR/UnboxResult.c Init/./Lean/Compiler/ImplementedByAttr.c Init/./Lean/Compiler/InitAttr.c Init/./Lean/Compiler/InlineAttrs.c Init/./Lean/Compiler/NameMangling.c Init/./Lean/Compiler/NeverExtractAttr.c Init/./Lean/Compiler/Specialize.c Init/./Lean/Compiler/Util.c Init/./Lean/Data/Format.c Init/./Lean/Data/KVMap.c Init/./Lean/Data/LBool.c Init/./Lean/Data/LOption.c Init/./Lean/Data/Name.c Init/./Lean/Data/Occurrences.c Init/./Lean/Data/Options.c Init/./Lean/Data/Position.c Init/./Lean/Data/SMap.c Init/./Lean/Data/Trie.c Init/./Lean/Declaration.c Init/./Lean/Elab.c Init/./Lean/Elab/Alias.c Init/./Lean/Elab/App.c Init/./Lean/Elab/Binders.c Init/./Lean/Elab/BuiltinNotation.c Init/./Lean/Elab/Command.c Init/./Lean/Elab/DeclModifiers.c Init/./Lean/Elab/Declaration.c Init/./Lean/Elab/Definition.c Init/./Lean/Elab/DoNotation.c Init/./Lean/Elab/Exception.c Init/./Lean/Elab/Frontend.c Init/./Lean/Elab/Import.c Init/./Lean/Elab/Level.c Init/./Lean/Elab/Log.c Init/./Lean/Elab/Match.c Init/./Lean/Elab/Quotation.c Init/./Lean/Elab/ResolveName.c Init/./Lean/Elab/StrategyAttrs.c Init/./Lean/Elab/StructInst.c Init/./Lean/Elab/Syntax.c Init/./Lean/Elab/SyntheticMVars.c Init/./Lean/Elab/Tactic.c Init/./Lean/Elab/Tactic/Basic.c Init/./Lean/Elab/Tactic/ElabTerm.c Init/./Lean/Elab/Term.c Init/./Lean/Elab/Util.c Init/./Lean/Environment.c Init/./Lean/EqnCompiler.c Init/./Lean/EqnCompiler/MatchPattern.c Init/./Lean/Eval.c Init/./Lean/Expr.c Init/./Lean/HeadIndex.c Init/./Lean/Hygiene.c Init/./Lean/Level.c Init/./Lean/Linter.c Init/./Lean/LocalContext.c Init/./Lean/Message.c Init/./Lean/Meta.c Init/./Lean/Meta/AbstractMVars.c Init/./Lean/Meta/AppBuilder.c Init/./Lean/Meta/Basic.c Init/./Lean/Meta/Check.c Init/./Lean/Meta/DiscrTree.c Init/./Lean/Meta/DiscrTreeTypes.c Init/./Lean/Meta/Exception.c Init/./Lean/Meta/ExprDefEq.c Init/./Lean/Meta/FunInfo.c Init/./Lean/Meta/InferType.c Init/./Lean/Meta/Instances.c Init/./Lean/Meta/KAbstract.c Init/./Lean/Meta/LevelDefEq.c Init/./Lean/Meta/Message.c Init/./Lean/Meta/Offset.c Init/./Lean/Meta/Reduce.c Init/./Lean/Meta/SynthInstance.c Init/./Lean/Meta/Tactic.c Init/./Lean/Meta/Tactic/Apply.c Init/./Lean/Meta/Tactic/Assert.c Init/./Lean/Meta/Tactic/Assumption.c Init/./Lean/Meta/Tactic/Clear.c Init/./Lean/Meta/Tactic/FVarSubst.c Init/./Lean/Meta/Tactic/Intro.c Init/./Lean/Meta/Tactic/Revert.c Init/./Lean/Meta/Tactic/Subst.c Init/./Lean/Meta/Tactic/Target.c Init/./Lean/Meta/Tactic/Util.c Init/./Lean/Meta/WHNF.c Init/./Lean/MetavarContext.c Init/./Lean/Modifiers.c Init/./Lean/Parser.c Init/./Lean/Parser/Command.c Init/./Lean/Parser/Level.c Init/./Lean/Parser/Module.c Init/./Lean/Parser/Parser.c Init/./Lean/Parser/Syntax.c Init/./Lean/Parser/Tactic.c Init/./Lean/Parser/Term.c Init/./Lean/Parser/Transform.c Init/./Lean/ProjFns.c Init/./Lean/ReducibilityAttrs.c Init/./Lean/ReplaceExpr.c Init/./Lean/Runtime.c Init/./Lean/Scopes.c Init/./Lean/Structure.c Init/./Lean/Syntax.c Init/./Lean/ToExpr.c Init/./Lean/Util/CollectFVars.c Init/./Lean/Util/CollectLevelParams.c Init/./Lean/Util/CollectMVars.c Init/./Lean/Util/FindMVar.c Init/./Lean/Util/MonadCache.c Init/./Lean/Util/PPExt.c Init/./Lean/Util/PPGoal.c Init/./Lean/Util/Path.c Init/./Lean/Util/Profile.c Init/./Lean/Util/RecDepth.c Init/./Lean/Util/Sorry.c Init/./Lean/Util/Trace.c Init/./Lean/Util/WHNF.c Init/./LeanInit.c Init/./MutQuot.c Init/./System.c Init/./System/FilePath.c Init/./System/IO.c Init/./System/IOError.c Init/./System/Platform.c Init/./Util.c Init/./WF.c) diff --git a/stage0/stdlib/Init/Lean/Elab/App.c b/stage0/stdlib/Init/Lean/Elab/App.c index 690aa9f037..630eac4b93 100644 --- a/stage0/stdlib/Init/Lean/Elab/App.c +++ b/stage0/stdlib/Init/Lean/Elab/App.c @@ -115,6 +115,7 @@ lean_object* l___regBuiltinTermElab_Lean_Elab_Term_elabArrayRef___closed__3; lean_object* l___private_Init_Lean_Elab_App_12__throwLValError___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_getOptions(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_App_9__propagateExpectedType(lean_object*, lean_object*, lean_object*, lean_object*); +extern lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1; extern lean_object* l_Lean_mkTermIdFromIdent___closed__2; extern lean_object* l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8; extern lean_object* l_Lean_Parser_Term_proj___elambda__1___closed__2; @@ -360,7 +361,6 @@ lean_object* l___private_Init_Lean_Elab_App_12__throwLValError(lean_object*); uint8_t l_Lean_isStructureLike(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_App_13__resolveLValAux___closed__22; lean_object* l_Lean_indentExpr(lean_object*); -extern lean_object* l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1; lean_object* l___private_Init_Lean_Elab_App_10__elabAppArgsAux___main___closed__1; lean_object* l___private_Init_Lean_Elab_App_18__elabAppLValsAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Elab_App_4__tryCoeFun___closed__1; @@ -12233,7 +12233,7 @@ x_6 = lean_unsigned_to_nat(1u); x_7 = l_Lean_Syntax_getArg(x_1, x_6); x_8 = l_Lean_Syntax_getArgs(x_7); lean_dec(x_7); -x_9 = l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1; +x_9 = l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1; x_10 = l_Array_iterateMAux___main___at___private_Init_Lean_Elab_App_26__expandApp___spec__1(x_1, x_8, x_4, x_9, x_2, x_3); lean_dec(x_8); if (lean_obj_tag(x_10) == 0) diff --git a/stage0/stdlib/Init/Lean/Meta/Tactic.c b/stage0/stdlib/Init/Lean/Meta/Tactic.c index b9592356d3..12a8138566 100644 --- a/stage0/stdlib/Init/Lean/Meta/Tactic.c +++ b/stage0/stdlib/Init/Lean/Meta/Tactic.c @@ -1,6 +1,6 @@ // Lean compiler output // Module: Init.Lean.Meta.Tactic -// Imports: Init.Lean.Meta.Tactic.Intro Init.Lean.Meta.Tactic.Assumption Init.Lean.Meta.Tactic.Apply Init.Lean.Meta.Tactic.Revert Init.Lean.Meta.Tactic.Clear +// Imports: Init.Lean.Meta.Tactic.Intro Init.Lean.Meta.Tactic.Assumption Init.Lean.Meta.Tactic.Apply Init.Lean.Meta.Tactic.Revert Init.Lean.Meta.Tactic.Clear Init.Lean.Meta.Tactic.Assert Init.Lean.Meta.Tactic.Target #include "runtime/lean.h" #if defined(__clang__) #pragma clang diagnostic ignored "-Wunused-parameter" @@ -18,6 +18,8 @@ lean_object* initialize_Init_Lean_Meta_Tactic_Assumption(lean_object*); lean_object* initialize_Init_Lean_Meta_Tactic_Apply(lean_object*); lean_object* initialize_Init_Lean_Meta_Tactic_Revert(lean_object*); lean_object* initialize_Init_Lean_Meta_Tactic_Clear(lean_object*); +lean_object* initialize_Init_Lean_Meta_Tactic_Assert(lean_object*); +lean_object* initialize_Init_Lean_Meta_Tactic_Target(lean_object*); static bool _G_initialized = false; lean_object* initialize_Init_Lean_Meta_Tactic(lean_object* w) { lean_object * res; @@ -38,6 +40,12 @@ lean_dec_ref(res); res = initialize_Init_Lean_Meta_Tactic_Clear(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +res = initialize_Init_Lean_Meta_Tactic_Assert(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +res = initialize_Init_Lean_Meta_Tactic_Target(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/Meta/Tactic/Apply.c b/stage0/stdlib/Init/Lean/Meta/Tactic/Apply.c index f1cea64594..f7fcc71ebd 100644 --- a/stage0/stdlib/Init/Lean/Meta/Tactic/Apply.c +++ b/stage0/stdlib/Init/Lean/Meta/Tactic/Apply.c @@ -14,29 +14,34 @@ extern "C" { #endif lean_object* l___private_Init_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux___closed__1; +lean_object* l_Nat_forMAux___main___at_Lean_Meta_appendParentTag___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Expr_mvarId_x21(lean_object*); lean_object* l_Lean_Name_eraseMacroScopes(lean_object*); extern lean_object* l_Lean_MessageData_ofList___closed__3; uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_array_fswap(lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_Meta_getMVarTag(lean_object*, lean_object*, lean_object*); lean_object* l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_append___rarg(lean_object*, lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* l_Lean_Expr_getAppFn___main(lean_object*); -lean_object* l_Lean_Meta_apply___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_apply___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_checkNotAssigned___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_nat_add(lean_object*, lean_object*); +lean_object* l_Lean_Meta_postprocessAppMVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_synthAppInstances___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_apply(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1; uint8_t lean_metavar_ctx_is_expr_assigned(lean_object*, lean_object*); -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_appendParentTag___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__1; lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -45,26 +50,24 @@ lean_object* l_Lean_Meta_getMVarType(lean_object*, lean_object*, lean_object*); lean_object* l_Array_filterMAux___main___at_Lean_Meta_apply___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__2; -lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Name_append___main(lean_object*, lean_object*); +lean_object* l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__3; lean_object* l_Array_shrink___main___rarg(lean_object*, lean_object*); -lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_apply___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_renameMVar(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Meta_apply___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_apply___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_2__getExpectedNumArgs(lean_object*, lean_object*, lean_object*); -lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__3; -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__1; +lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__5; uint8_t l_Lean_BinderInfo_isInstImplicit(uint8_t); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError(lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__6; +lean_object* l_Lean_Meta_postprocessAppMVars___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_forallMetaTelescopeReducing(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*); @@ -72,32 +75,31 @@ extern uint8_t l_Lean_BinderInfo_inhabited; lean_object* l_Lean_Meta_synthInstance(lean_object*, lean_object*, lean_object*); lean_object* l_Array_filterMAux___main___at_Lean_Meta_apply___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_expr_eqv(lean_object*, lean_object*); -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__2; uint8_t l_Lean_Expr_isMVar(lean_object*); -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_synthAppInstances(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__8; -lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Expr_hasMVar(lean_object*); uint8_t l_Lean_Name_isAnonymous(lean_object*); lean_object* l_Lean_Meta_withMVarContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst(lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__4; +lean_object* l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__1; lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_toList___rarg(lean_object*); extern lean_object* l_Lean_Expr_Inhabited; -lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__2; lean_object* l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__7; -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__3; +lean_object* l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst(lean_object*, lean_object*, lean_object*); +lean_object* l_Nat_forMAux___main___at_Lean_Meta_appendParentTag___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_indentExpr(lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1; -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_forallTelescopeReducing___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_appendParentTag(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_lt(lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { @@ -420,7 +422,7 @@ lean_dec(x_4); return x_6; } } -lean_object* _init_l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__1() { +lean_object* _init_l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__1() { _start: { lean_object* x_1; @@ -428,100 +430,99 @@ x_1 = lean_mk_string("failed to assign synthesized instance"); return x_1; } } -lean_object* _init_l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__2() { +lean_object* _init_l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__2() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__1; +x_1 = l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___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_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__3() { +lean_object* _init_l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__3() { _start: { lean_object* x_1; lean_object* x_2; -x_1 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__2; +x_1 = l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__2; x_2 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_2, 0, x_1); return x_2; } } -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +lean_object* l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { _start: { -lean_object* x_8; uint8_t x_9; -x_8 = lean_unsigned_to_nat(0u); -x_9 = lean_nat_dec_eq(x_5, x_8); -if (x_9 == 0) -{ -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; uint8_t x_18; -x_10 = lean_unsigned_to_nat(1u); -x_11 = lean_nat_sub(x_5, x_10); -lean_dec(x_5); -x_12 = lean_nat_sub(x_4, x_11); -x_13 = lean_nat_sub(x_12, x_10); -lean_dec(x_12); -x_14 = l_Lean_BinderInfo_inhabited; -x_15 = lean_box(x_14); -x_16 = lean_array_get(x_15, x_3, x_13); -x_17 = lean_unbox(x_16); -lean_dec(x_16); -x_18 = l_Lean_BinderInfo_isInstImplicit(x_17); -if (x_18 == 0) +lean_object* x_9; uint8_t x_10; +x_9 = lean_unsigned_to_nat(0u); +x_10 = lean_nat_dec_eq(x_6, x_9); +if (x_10 == 0) { +lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18; uint8_t x_19; +x_11 = lean_unsigned_to_nat(1u); +x_12 = lean_nat_sub(x_6, x_11); +lean_dec(x_6); +x_13 = lean_nat_sub(x_5, x_12); +x_14 = lean_nat_sub(x_13, x_11); lean_dec(x_13); -x_5 = x_11; +x_15 = l_Lean_BinderInfo_inhabited; +x_16 = lean_box(x_15); +x_17 = lean_array_get(x_16, x_4, x_14); +x_18 = lean_unbox(x_17); +lean_dec(x_17); +x_19 = l_Lean_BinderInfo_isInstImplicit(x_18); +if (x_19 == 0) +{ +lean_dec(x_14); +x_6 = x_12; goto _start; } else { -lean_object* x_20; lean_object* x_21; lean_object* x_22; -x_20 = l_Lean_Expr_Inhabited; -x_21 = lean_array_get(x_20, x_2, x_13); -lean_dec(x_13); -lean_inc(x_6); -lean_inc(x_21); -x_22 = l_Lean_Meta_inferType(x_21, x_6, x_7); -if (lean_obj_tag(x_22) == 0) +lean_object* x_21; lean_object* x_22; lean_object* x_23; +x_21 = l_Lean_Expr_Inhabited; +x_22 = lean_array_get(x_21, x_3, x_14); +lean_dec(x_14); +lean_inc(x_7); +lean_inc(x_22); +x_23 = l_Lean_Meta_inferType(x_22, x_7, x_8); +if (lean_obj_tag(x_23) == 0) { -lean_object* x_23; lean_object* x_24; lean_object* x_25; -x_23 = lean_ctor_get(x_22, 0); -lean_inc(x_23); -x_24 = lean_ctor_get(x_22, 1); +lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_24 = lean_ctor_get(x_23, 0); lean_inc(x_24); -lean_dec(x_22); -lean_inc(x_6); -x_25 = l_Lean_Meta_synthInstance(x_23, x_6, x_24); -if (lean_obj_tag(x_25) == 0) +x_25 = lean_ctor_get(x_23, 1); +lean_inc(x_25); +lean_dec(x_23); +lean_inc(x_7); +x_26 = l_Lean_Meta_synthInstance(x_24, x_7, x_25); +if (lean_obj_tag(x_26) == 0) { -lean_object* x_26; lean_object* x_27; lean_object* x_28; -x_26 = lean_ctor_get(x_25, 0); -lean_inc(x_26); -x_27 = lean_ctor_get(x_25, 1); +lean_object* x_27; lean_object* x_28; lean_object* x_29; +x_27 = lean_ctor_get(x_26, 0); lean_inc(x_27); -lean_dec(x_25); -lean_inc(x_6); -x_28 = l_Lean_Meta_isExprDefEq(x_21, x_26, x_6, x_27); -if (lean_obj_tag(x_28) == 0) +x_28 = lean_ctor_get(x_26, 1); +lean_inc(x_28); +lean_dec(x_26); +lean_inc(x_7); +x_29 = l_Lean_Meta_isExprDefEq(x_22, x_27, x_7, x_28); +if (lean_obj_tag(x_29) == 0) { -lean_object* x_29; uint8_t x_30; -x_29 = lean_ctor_get(x_28, 0); -lean_inc(x_29); -x_30 = lean_unbox(x_29); +lean_object* x_30; uint8_t x_31; +x_30 = lean_ctor_get(x_29, 0); +lean_inc(x_30); +x_31 = lean_unbox(x_30); +lean_dec(x_30); +if (x_31 == 0) +{ +lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35; +lean_dec(x_12); +x_32 = lean_ctor_get(x_29, 1); +lean_inc(x_32); lean_dec(x_29); -if (x_30 == 0) -{ -lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35; -lean_dec(x_11); -x_31 = lean_ctor_get(x_28, 1); -lean_inc(x_31); -lean_dec(x_28); -x_32 = l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__2; -x_33 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__3; -x_34 = l_Lean_Meta_throwTacticEx___rarg(x_32, x_1, x_33, x_6, x_31); -lean_dec(x_6); +x_33 = l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__3; +x_34 = l_Lean_Meta_throwTacticEx___rarg(x_1, x_2, x_33, x_7, x_32); +lean_dec(x_7); x_35 = !lean_is_exclusive(x_34); if (x_35 == 0) { @@ -544,33 +545,34 @@ return x_38; else { lean_object* x_39; -x_39 = lean_ctor_get(x_28, 1); +x_39 = lean_ctor_get(x_29, 1); lean_inc(x_39); -lean_dec(x_28); -x_5 = x_11; -x_7 = x_39; +lean_dec(x_29); +x_6 = x_12; +x_8 = x_39; goto _start; } } else { uint8_t x_41; -lean_dec(x_11); -lean_dec(x_6); +lean_dec(x_12); +lean_dec(x_7); +lean_dec(x_2); lean_dec(x_1); -x_41 = !lean_is_exclusive(x_28); +x_41 = !lean_is_exclusive(x_29); if (x_41 == 0) { -return x_28; +return x_29; } else { lean_object* x_42; lean_object* x_43; lean_object* x_44; -x_42 = lean_ctor_get(x_28, 0); -x_43 = lean_ctor_get(x_28, 1); +x_42 = lean_ctor_get(x_29, 0); +x_43 = lean_ctor_get(x_29, 1); lean_inc(x_43); lean_inc(x_42); -lean_dec(x_28); +lean_dec(x_29); x_44 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_44, 0, x_42); lean_ctor_set(x_44, 1, x_43); @@ -581,23 +583,24 @@ return x_44; else { uint8_t x_45; -lean_dec(x_21); -lean_dec(x_11); -lean_dec(x_6); +lean_dec(x_22); +lean_dec(x_12); +lean_dec(x_7); +lean_dec(x_2); lean_dec(x_1); -x_45 = !lean_is_exclusive(x_25); +x_45 = !lean_is_exclusive(x_26); if (x_45 == 0) { -return x_25; +return x_26; } else { lean_object* x_46; lean_object* x_47; lean_object* x_48; -x_46 = lean_ctor_get(x_25, 0); -x_47 = lean_ctor_get(x_25, 1); +x_46 = lean_ctor_get(x_26, 0); +x_47 = lean_ctor_get(x_26, 1); lean_inc(x_47); lean_inc(x_46); -lean_dec(x_25); +lean_dec(x_26); x_48 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_48, 0, x_46); lean_ctor_set(x_48, 1, x_47); @@ -608,23 +611,24 @@ return x_48; else { uint8_t x_49; -lean_dec(x_21); -lean_dec(x_11); -lean_dec(x_6); +lean_dec(x_22); +lean_dec(x_12); +lean_dec(x_7); +lean_dec(x_2); lean_dec(x_1); -x_49 = !lean_is_exclusive(x_22); +x_49 = !lean_is_exclusive(x_23); if (x_49 == 0) { -return x_22; +return x_23; } else { lean_object* x_50; lean_object* x_51; lean_object* x_52; -x_50 = lean_ctor_get(x_22, 0); -x_51 = lean_ctor_get(x_22, 1); +x_50 = lean_ctor_get(x_23, 0); +x_51 = lean_ctor_get(x_23, 1); lean_inc(x_51); lean_inc(x_50); -lean_dec(x_22); +lean_dec(x_23); x_52 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_52, 0, x_50); lean_ctor_set(x_52, 1, x_51); @@ -636,50 +640,51 @@ return x_52; else { lean_object* x_53; lean_object* x_54; +lean_dec(x_7); lean_dec(x_6); -lean_dec(x_5); +lean_dec(x_2); lean_dec(x_1); x_53 = lean_box(0); x_54 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_54, 0, x_53); -lean_ctor_set(x_54, 1, x_7); +lean_ctor_set(x_54, 1, x_8); return x_54; } } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Lean_Meta_synthAppInstances(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_6; lean_object* x_7; -x_6 = lean_array_get_size(x_2); -lean_inc(x_6); -x_7 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1(x_1, x_2, x_3, x_6, x_6, x_4, x_5); -lean_dec(x_6); -return x_7; -} -} -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { -_start: -{ -lean_object* x_8; -x_8 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_2); +lean_object* x_7; lean_object* x_8; +x_7 = lean_array_get_size(x_3); +lean_inc(x_7); +x_8 = l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1(x_1, x_2, x_3, x_4, x_7, x_7, x_5, x_6); +lean_dec(x_7); return x_8; } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { _start: { -lean_object* x_6; -x_6 = l___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances(x_1, x_2, x_3, x_4, x_5); +lean_object* x_9; +x_9 = l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8); +lean_dec(x_5); +lean_dec(x_4); lean_dec(x_3); -lean_dec(x_2); -return x_6; +return x_9; } } -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +lean_object* l_Lean_Meta_synthAppInstances___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_Meta_synthAppInstances(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_4); +lean_dec(x_3); +return x_7; +} +} +lean_object* l_Nat_forMAux___main___at_Lean_Meta_appendParentTag___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { lean_object* x_8; uint8_t x_9; @@ -788,7 +793,7 @@ return x_39; } } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Lean_Meta_appendParentTag(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; @@ -809,7 +814,7 @@ lean_object* x_11; lean_object* x_12; lean_free_object(x_6); x_11 = lean_array_get_size(x_2); lean_inc(x_11); -x_12 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___spec__1(x_2, x_3, x_8, x_11, x_11, x_4, x_9); +x_12 = l_Nat_forMAux___main___at_Lean_Meta_appendParentTag___spec__1(x_2, x_3, x_8, x_11, x_11, x_4, x_9); lean_dec(x_11); lean_dec(x_8); return x_12; @@ -837,7 +842,7 @@ if (x_16 == 0) lean_object* x_17; lean_object* x_18; x_17 = lean_array_get_size(x_2); lean_inc(x_17); -x_18 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___spec__1(x_2, x_3, x_14, x_17, x_17, x_4, x_15); +x_18 = l_Nat_forMAux___main___at_Lean_Meta_appendParentTag___spec__1(x_2, x_3, x_14, x_17, x_17, x_4, x_15); lean_dec(x_17); lean_dec(x_14); return x_18; @@ -878,11 +883,11 @@ return x_24; } } } -lean_object* l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +lean_object* l_Nat_forMAux___main___at_Lean_Meta_appendParentTag___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { lean_object* x_8; -x_8 = l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7); +x_8 = l_Nat_forMAux___main___at_Lean_Meta_appendParentTag___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7); lean_dec(x_6); lean_dec(x_4); lean_dec(x_3); @@ -891,18 +896,71 @@ lean_dec(x_1); return x_8; } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Lean_Meta_appendParentTag___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___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag(x_1, x_2, x_3, x_4, x_5); +x_6 = l_Lean_Meta_appendParentTag(x_1, x_2, x_3, x_4, x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); return x_6; } } -lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_Lean_Meta_postprocessAppMVars(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_inc(x_5); +lean_inc(x_2); +x_7 = l_Lean_Meta_synthAppInstances(x_1, x_2, x_3, x_4, x_5, x_6); +if (lean_obj_tag(x_7) == 0) +{ +lean_object* x_8; lean_object* x_9; +x_8 = lean_ctor_get(x_7, 1); +lean_inc(x_8); +lean_dec(x_7); +x_9 = l_Lean_Meta_appendParentTag(x_2, x_3, x_4, x_5, x_8); +lean_dec(x_5); +return x_9; +} +else +{ +uint8_t x_10; +lean_dec(x_5); +lean_dec(x_2); +x_10 = !lean_is_exclusive(x_7); +if (x_10 == 0) +{ +return x_7; +} +else +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; +x_11 = lean_ctor_get(x_7, 0); +x_12 = lean_ctor_get(x_7, 1); +lean_inc(x_12); +lean_inc(x_11); +lean_dec(x_7); +x_13 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_13, 0, x_11); +lean_ctor_set(x_13, 1, x_12); +return x_13; +} +} +} +} +lean_object* l_Lean_Meta_postprocessAppMVars___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_Meta_postprocessAppMVars(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_4); +lean_dec(x_3); +return x_7; +} +} +lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { switch (lean_obj_tag(x_2)) { @@ -958,7 +1016,7 @@ goto _start; else { lean_object* x_13; -x_13 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_8, x_3); +x_13 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_8, x_3); if (lean_obj_tag(x_13) == 0) { uint8_t x_14; @@ -1010,7 +1068,7 @@ goto _start; else { lean_object* x_21; -x_21 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_16, x_3); +x_21 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_16, x_3); if (lean_obj_tag(x_21) == 0) { uint8_t x_22; @@ -1062,7 +1120,7 @@ goto _start; else { lean_object* x_29; -x_29 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_24, x_3); +x_29 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_24, x_3); if (lean_obj_tag(x_29) == 0) { uint8_t x_30; @@ -1107,7 +1165,7 @@ goto block_42; else { lean_object* x_44; -x_44 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_32, x_3); +x_44 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_32, x_3); if (lean_obj_tag(x_44) == 0) { x_35 = x_44; @@ -1152,7 +1210,7 @@ return x_35; else { lean_object* x_39; -x_39 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_33, x_35); +x_39 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_33, x_35); if (lean_obj_tag(x_39) == 0) { uint8_t x_40; @@ -1226,7 +1284,7 @@ return x_3; } } } -lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { uint8_t x_8; @@ -1263,7 +1321,7 @@ lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; x_16 = lean_ctor_get(x_14, 0); x_17 = lean_ctor_get(x_14, 1); x_18 = lean_box(0); -x_19 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_16, x_18); +x_19 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_16, x_18); lean_dec(x_16); if (lean_obj_tag(x_19) == 0) { @@ -1297,7 +1355,7 @@ lean_inc(x_26); lean_inc(x_25); lean_dec(x_14); x_27 = lean_box(0); -x_28 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_25, x_27); +x_28 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_25, x_27); lean_dec(x_25); if (lean_obj_tag(x_28) == 0) { @@ -1362,32 +1420,32 @@ goto _start; } } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; lean_object* x_6; lean_object* x_7; x_5 = lean_array_get_size(x_2); x_6 = lean_unsigned_to_nat(0u); -x_7 = l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__2(x_1, x_2, x_2, x_5, x_6, x_3, x_4); +x_7 = l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__2(x_1, x_2, x_2, x_5, x_6, x_3, x_4); lean_dec(x_5); return x_7; } } -lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; -x_4 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__1(x_1, x_2, x_3); +x_4 = l_Lean_FindMVar_main___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__1(x_1, x_2, x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } -lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +lean_object* l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { lean_object* x_8; -x_8 = l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___spec__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7); +x_8 = l_Array_anyRangeMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___spec__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); @@ -1395,17 +1453,17 @@ lean_dec(x_1); return x_8; } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers___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___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers(x_1, x_2, x_3, x_4); +x_5 = l___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers(x_1, x_2, x_3, x_4); lean_dec(x_2); lean_dec(x_1); return x_5; } } -lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___spec__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; uint8_t x_8; @@ -1437,7 +1495,7 @@ x_14 = lean_ctor_get(x_4, 0); x_15 = lean_ctor_get(x_4, 1); x_16 = l_Lean_Expr_mvarId_x21(x_10); lean_inc(x_5); -x_17 = l___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers(x_10, x_1, x_5, x_6); +x_17 = l___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers(x_10, x_1, x_5, x_6); lean_dec(x_10); if (lean_obj_tag(x_17) == 0) { @@ -1510,7 +1568,7 @@ lean_inc(x_30); lean_dec(x_4); x_32 = l_Lean_Expr_mvarId_x21(x_10); lean_inc(x_5); -x_33 = l___private_Init_Lean_Meta_Tactic_Apply_6__dependsOnOthers(x_10, x_1, x_5, x_6); +x_33 = l___private_Init_Lean_Meta_Tactic_Apply_4__dependsOnOthers(x_10, x_1, x_5, x_6); lean_dec(x_10); if (lean_obj_tag(x_33) == 0) { @@ -1583,7 +1641,7 @@ return x_47; } } } -lean_object* _init_l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1() { +lean_object* _init_l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1() { _start: { lean_object* x_1; lean_object* x_2; @@ -1594,13 +1652,13 @@ lean_ctor_set(x_2, 1, x_1); return x_2; } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst(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___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1; -x_6 = l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___spec__1(x_1, x_1, x_4, x_5, x_2, x_3); +x_5 = l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1; +x_6 = l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___spec__1(x_1, x_1, x_4, x_5, x_2, x_3); if (lean_obj_tag(x_6) == 0) { uint8_t x_7; @@ -1670,21 +1728,21 @@ return x_25; } } } -lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +lean_object* l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; -x_7 = l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___spec__1(x_1, x_2, x_3, x_4, x_5, x_6); +x_7 = l_Array_iterateMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___spec__1(x_1, x_2, x_3, x_4, x_5, x_6); lean_dec(x_2); lean_dec(x_1); return x_7; } } -lean_object* l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; -x_4 = l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst(x_1, x_2, x_3); +x_4 = l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst(x_1, x_2, x_3); lean_dec(x_1); return x_4; } @@ -1759,691 +1817,629 @@ goto _start; } } } -lean_object* l_Lean_Meta_apply___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Lean_Meta_apply___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_6; +lean_object* x_7; lean_inc(x_1); -x_6 = l_Lean_Meta_getMVarType(x_1, x_4, x_5); -if (lean_obj_tag(x_6) == 0) +x_7 = l_Lean_Meta_getMVarType(x_1, x_5, x_6); +if (lean_obj_tag(x_7) == 0) { -lean_object* x_7; lean_object* x_8; lean_object* x_9; -x_7 = lean_ctor_get(x_6, 0); -lean_inc(x_7); -x_8 = lean_ctor_get(x_6, 1); +lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_8 = lean_ctor_get(x_7, 0); lean_inc(x_8); -lean_dec(x_6); -lean_inc(x_4); +x_9 = lean_ctor_get(x_7, 1); +lean_inc(x_9); +lean_dec(x_7); +lean_inc(x_5); lean_inc(x_2); -x_9 = l_Lean_Meta_inferType(x_2, x_4, x_8); -if (lean_obj_tag(x_9) == 0) +x_10 = l_Lean_Meta_inferType(x_2, x_5, x_9); +if (lean_obj_tag(x_10) == 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_object* x_11; lean_object* x_12; lean_object* x_13; +x_11 = lean_ctor_get(x_10, 0); lean_inc(x_11); -lean_dec(x_9); -lean_inc(x_4); -lean_inc(x_10); -x_12 = l___private_Init_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux(x_10, x_4, x_11); -if (lean_obj_tag(x_12) == 0) +x_12 = lean_ctor_get(x_10, 1); +lean_inc(x_12); +lean_dec(x_10); +lean_inc(x_5); +lean_inc(x_11); +x_13 = l___private_Init_Lean_Meta_Tactic_Apply_1__getExpectedNumArgsAux(x_11, x_5, x_12); +if (lean_obj_tag(x_13) == 0) { -lean_object* x_13; lean_object* x_14; uint8_t x_15; -x_13 = lean_ctor_get(x_12, 0); -lean_inc(x_13); -x_14 = lean_ctor_get(x_13, 1); +lean_object* x_14; lean_object* x_15; uint8_t x_16; +x_14 = lean_ctor_get(x_13, 0); lean_inc(x_14); -x_15 = lean_unbox(x_14); -lean_dec(x_14); -if (x_15 == 0) +x_15 = lean_ctor_get(x_14, 1); +lean_inc(x_15); +x_16 = lean_unbox(x_15); +lean_dec(x_15); +if (x_16 == 0) { -lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19; lean_object* x_20; -x_16 = lean_ctor_get(x_12, 1); -lean_inc(x_16); -lean_dec(x_12); -x_17 = lean_ctor_get(x_13, 0); +lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_object* x_21; +x_17 = lean_ctor_get(x_13, 1); lean_inc(x_17); lean_dec(x_13); -x_18 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_18, 0, x_17); -x_19 = 0; -lean_inc(x_4); -x_20 = l_Lean_Meta_forallMetaTelescopeReducing(x_10, x_18, x_19, x_4, x_16); -lean_dec(x_18); -if (lean_obj_tag(x_20) == 0) +x_18 = lean_ctor_get(x_14, 0); +lean_inc(x_18); +lean_dec(x_14); +x_19 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_19, 0, x_18); +x_20 = 0; +lean_inc(x_5); +x_21 = l_Lean_Meta_forallMetaTelescopeReducing(x_11, x_19, x_20, x_5, x_17); +lean_dec(x_19); +if (lean_obj_tag(x_21) == 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; lean_object* x_27; lean_object* x_53; -x_21 = lean_ctor_get(x_20, 0); -lean_inc(x_21); -x_22 = lean_ctor_get(x_21, 1); +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_48; +x_22 = lean_ctor_get(x_21, 0); lean_inc(x_22); -x_23 = lean_ctor_get(x_20, 1); +x_23 = lean_ctor_get(x_22, 1); lean_inc(x_23); -lean_dec(x_20); -x_24 = lean_ctor_get(x_21, 0); +x_24 = lean_ctor_get(x_21, 1); lean_inc(x_24); lean_dec(x_21); x_25 = lean_ctor_get(x_22, 0); lean_inc(x_25); -x_26 = lean_ctor_get(x_22, 1); -lean_inc(x_26); lean_dec(x_22); -lean_inc(x_4); -lean_inc(x_7); +x_26 = lean_ctor_get(x_23, 0); lean_inc(x_26); -x_53 = l_Lean_Meta_isExprDefEq(x_26, x_7, x_4, x_23); -if (lean_obj_tag(x_53) == 0) +x_27 = lean_ctor_get(x_23, 1); +lean_inc(x_27); +lean_dec(x_23); +lean_inc(x_5); +lean_inc(x_8); +lean_inc(x_27); +x_48 = l_Lean_Meta_isExprDefEq(x_27, x_8, x_5, x_24); +if (lean_obj_tag(x_48) == 0) { -lean_object* x_54; uint8_t x_55; -x_54 = lean_ctor_get(x_53, 0); -lean_inc(x_54); -x_55 = lean_unbox(x_54); -lean_dec(x_54); -if (x_55 == 0) +lean_object* x_49; uint8_t x_50; +x_49 = lean_ctor_get(x_48, 0); +lean_inc(x_49); +x_50 = lean_unbox(x_49); +lean_dec(x_49); +if (x_50 == 0) { -lean_object* x_56; lean_object* x_57; uint8_t x_58; +lean_object* x_51; lean_object* x_52; uint8_t x_53; +lean_dec(x_26); lean_dec(x_25); -lean_dec(x_24); +lean_dec(x_3); lean_dec(x_2); -x_56 = lean_ctor_get(x_53, 1); -lean_inc(x_56); -lean_dec(x_53); -x_57 = l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg(x_1, x_26, x_7, x_4, x_56); -lean_dec(x_4); -x_58 = !lean_is_exclusive(x_57); +x_51 = lean_ctor_get(x_48, 1); +lean_inc(x_51); +lean_dec(x_48); +x_52 = l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg(x_1, x_27, x_8, x_5, x_51); +lean_dec(x_5); +x_53 = !lean_is_exclusive(x_52); +if (x_53 == 0) +{ +return x_52; +} +else +{ +lean_object* x_54; lean_object* x_55; lean_object* x_56; +x_54 = lean_ctor_get(x_52, 0); +x_55 = lean_ctor_get(x_52, 1); +lean_inc(x_55); +lean_inc(x_54); +lean_dec(x_52); +x_56 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_56, 0, x_54); +lean_ctor_set(x_56, 1, x_55); +return x_56; +} +} +else +{ +lean_object* x_57; +lean_dec(x_27); +lean_dec(x_8); +x_57 = lean_ctor_get(x_48, 1); +lean_inc(x_57); +lean_dec(x_48); +x_28 = x_57; +goto block_47; +} +} +else +{ +uint8_t x_58; +lean_dec(x_27); +lean_dec(x_26); +lean_dec(x_25); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_58 = !lean_is_exclusive(x_48); if (x_58 == 0) { -return x_57; +return x_48; } else { lean_object* x_59; lean_object* x_60; lean_object* x_61; -x_59 = lean_ctor_get(x_57, 0); -x_60 = lean_ctor_get(x_57, 1); +x_59 = lean_ctor_get(x_48, 0); +x_60 = lean_ctor_get(x_48, 1); lean_inc(x_60); lean_inc(x_59); -lean_dec(x_57); +lean_dec(x_48); x_61 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_61, 0, x_59); lean_ctor_set(x_61, 1, x_60); return x_61; } } -else +block_47: { -lean_object* x_62; -lean_dec(x_26); -lean_dec(x_7); -x_62 = lean_ctor_get(x_53, 1); -lean_inc(x_62); -lean_dec(x_53); -x_27 = x_62; -goto block_52; -} -} -else -{ -uint8_t x_63; -lean_dec(x_26); -lean_dec(x_25); -lean_dec(x_24); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_2); -lean_dec(x_1); -x_63 = !lean_is_exclusive(x_53); -if (x_63 == 0) -{ -return x_53; -} -else -{ -lean_object* x_64; lean_object* x_65; lean_object* x_66; -x_64 = lean_ctor_get(x_53, 0); -x_65 = lean_ctor_get(x_53, 1); -lean_inc(x_65); -lean_inc(x_64); -lean_dec(x_53); -x_66 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_66, 0, x_64); -lean_ctor_set(x_66, 1, x_65); -return x_66; -} -} -block_52: -{ -lean_object* x_28; -lean_inc(x_4); +lean_object* x_29; +lean_inc(x_5); lean_inc(x_1); -x_28 = l___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances(x_1, x_24, x_25, x_4, x_27); -if (lean_obj_tag(x_28) == 0) +x_29 = l_Lean_Meta_postprocessAppMVars(x_3, x_1, x_25, x_26, x_5, x_28); +lean_dec(x_26); +if (lean_obj_tag(x_29) == 0) { -lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; -x_29 = lean_ctor_get(x_28, 1); -lean_inc(x_29); -lean_dec(x_28); -x_30 = lean_unsigned_to_nat(0u); -x_31 = l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(x_24, x_24, x_30, x_2); -lean_inc(x_1); -x_32 = l_Lean_Meta_assignExprMVar(x_1, x_31, x_4, x_29); -if (lean_obj_tag(x_32) == 0) +lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; +x_30 = lean_ctor_get(x_29, 1); +lean_inc(x_30); +lean_dec(x_29); +x_31 = lean_unsigned_to_nat(0u); +x_32 = l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(x_25, x_25, x_31, x_2); +x_33 = l_Lean_Meta_assignExprMVar(x_1, x_32, x_5, x_30); +if (lean_obj_tag(x_33) == 0) { -lean_object* x_33; lean_object* x_34; -x_33 = lean_ctor_get(x_32, 1); -lean_inc(x_33); -lean_dec(x_32); -x_34 = l___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag(x_1, x_24, x_25, x_4, x_33); -lean_dec(x_25); -if (lean_obj_tag(x_34) == 0) -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; -x_35 = lean_ctor_get(x_34, 1); -lean_inc(x_35); -lean_dec(x_34); -x_36 = l_Array_filterMAux___main___at_Lean_Meta_apply___spec__1(x_24, x_30, x_30, x_4, x_35); -x_37 = lean_ctor_get(x_36, 0); +lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_34 = lean_ctor_get(x_33, 1); +lean_inc(x_34); +lean_dec(x_33); +x_35 = l_Array_filterMAux___main___at_Lean_Meta_apply___spec__1(x_25, x_31, x_31, x_5, x_34); +x_36 = lean_ctor_get(x_35, 0); +lean_inc(x_36); +x_37 = lean_ctor_get(x_35, 1); lean_inc(x_37); -x_38 = lean_ctor_get(x_36, 1); -lean_inc(x_38); +lean_dec(x_35); +x_38 = l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst(x_36, x_5, x_37); lean_dec(x_36); -x_39 = l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst(x_37, x_4, x_38); -lean_dec(x_37); -return x_39; +return x_38; } else { -uint8_t x_40; -lean_dec(x_24); -lean_dec(x_4); -x_40 = !lean_is_exclusive(x_34); -if (x_40 == 0) +uint8_t x_39; +lean_dec(x_25); +lean_dec(x_5); +x_39 = !lean_is_exclusive(x_33); +if (x_39 == 0) { -return x_34; +return x_33; } else { -lean_object* x_41; lean_object* x_42; lean_object* x_43; -x_41 = lean_ctor_get(x_34, 0); -x_42 = lean_ctor_get(x_34, 1); -lean_inc(x_42); +lean_object* x_40; lean_object* x_41; lean_object* x_42; +x_40 = lean_ctor_get(x_33, 0); +x_41 = lean_ctor_get(x_33, 1); lean_inc(x_41); -lean_dec(x_34); -x_43 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_43, 0, x_41); -lean_ctor_set(x_43, 1, x_42); -return x_43; +lean_inc(x_40); +lean_dec(x_33); +x_42 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_42, 0, x_40); +lean_ctor_set(x_42, 1, x_41); +return x_42; } } } else { -uint8_t x_44; +uint8_t x_43; lean_dec(x_25); -lean_dec(x_24); -lean_dec(x_4); +lean_dec(x_5); +lean_dec(x_2); lean_dec(x_1); -x_44 = !lean_is_exclusive(x_32); -if (x_44 == 0) +x_43 = !lean_is_exclusive(x_29); +if (x_43 == 0) { -return x_32; +return x_29; } else { -lean_object* x_45; lean_object* x_46; lean_object* x_47; -x_45 = lean_ctor_get(x_32, 0); -x_46 = lean_ctor_get(x_32, 1); -lean_inc(x_46); +lean_object* x_44; lean_object* x_45; lean_object* x_46; +x_44 = lean_ctor_get(x_29, 0); +x_45 = lean_ctor_get(x_29, 1); lean_inc(x_45); -lean_dec(x_32); -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; +lean_inc(x_44); +lean_dec(x_29); +x_46 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_46, 0, x_44); +lean_ctor_set(x_46, 1, x_45); +return x_46; +} } } } else { -uint8_t x_48; -lean_dec(x_25); -lean_dec(x_24); -lean_dec(x_4); +uint8_t x_62; +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_48 = !lean_is_exclusive(x_28); -if (x_48 == 0) +x_62 = !lean_is_exclusive(x_21); +if (x_62 == 0) { -return x_28; +return x_21; } else { -lean_object* x_49; lean_object* x_50; lean_object* x_51; -x_49 = lean_ctor_get(x_28, 0); -x_50 = lean_ctor_get(x_28, 1); -lean_inc(x_50); -lean_inc(x_49); -lean_dec(x_28); -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; -} +lean_object* x_63; lean_object* x_64; lean_object* x_65; +x_63 = lean_ctor_get(x_21, 0); +x_64 = lean_ctor_get(x_21, 1); +lean_inc(x_64); +lean_inc(x_63); +lean_dec(x_21); +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; } } } else { -uint8_t x_67; -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_2); -lean_dec(x_1); -x_67 = !lean_is_exclusive(x_20); -if (x_67 == 0) -{ -return x_20; -} -else -{ -lean_object* x_68; lean_object* x_69; lean_object* x_70; -x_68 = lean_ctor_get(x_20, 0); -x_69 = lean_ctor_get(x_20, 1); -lean_inc(x_69); -lean_inc(x_68); -lean_dec(x_20); -x_70 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_70, 0, x_68); -lean_ctor_set(x_70, 1, x_69); -return x_70; -} -} -} -else -{ -lean_object* x_71; lean_object* x_72; lean_object* x_73; -x_71 = lean_ctor_get(x_12, 1); -lean_inc(x_71); -lean_dec(x_12); -x_72 = lean_ctor_get(x_13, 0); -lean_inc(x_72); +lean_object* x_66; lean_object* x_67; lean_object* x_68; +x_66 = lean_ctor_get(x_13, 1); +lean_inc(x_66); lean_dec(x_13); -lean_inc(x_4); -lean_inc(x_7); -x_73 = l___private_Init_Lean_Meta_Tactic_Apply_2__getExpectedNumArgs(x_7, x_4, x_71); -if (lean_obj_tag(x_73) == 0) +x_67 = lean_ctor_get(x_14, 0); +lean_inc(x_67); +lean_dec(x_14); +lean_inc(x_5); +lean_inc(x_8); +x_68 = l___private_Init_Lean_Meta_Tactic_Apply_2__getExpectedNumArgs(x_8, x_5, x_66); +if (lean_obj_tag(x_68) == 0) { -lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; uint8_t x_78; lean_object* x_79; -x_74 = lean_ctor_get(x_73, 0); -lean_inc(x_74); -x_75 = lean_ctor_get(x_73, 1); -lean_inc(x_75); -lean_dec(x_73); -x_76 = lean_nat_sub(x_72, x_74); -lean_dec(x_74); +lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; uint8_t x_73; lean_object* x_74; +x_69 = lean_ctor_get(x_68, 0); +lean_inc(x_69); +x_70 = lean_ctor_get(x_68, 1); +lean_inc(x_70); +lean_dec(x_68); +x_71 = lean_nat_sub(x_67, x_69); +lean_dec(x_69); +lean_dec(x_67); +x_72 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_72, 0, x_71); +x_73 = 0; +lean_inc(x_5); +x_74 = l_Lean_Meta_forallMetaTelescopeReducing(x_11, x_72, x_73, x_5, x_70); lean_dec(x_72); -x_77 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_77, 0, x_76); -x_78 = 0; -lean_inc(x_4); -x_79 = l_Lean_Meta_forallMetaTelescopeReducing(x_10, x_77, x_78, x_4, x_75); -lean_dec(x_77); -if (lean_obj_tag(x_79) == 0) +if (lean_obj_tag(x_74) == 0) { -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_112; -x_80 = lean_ctor_get(x_79, 0); +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_101; +x_75 = lean_ctor_get(x_74, 0); +lean_inc(x_75); +x_76 = lean_ctor_get(x_75, 1); +lean_inc(x_76); +x_77 = lean_ctor_get(x_74, 1); +lean_inc(x_77); +lean_dec(x_74); +x_78 = lean_ctor_get(x_75, 0); +lean_inc(x_78); +lean_dec(x_75); +x_79 = lean_ctor_get(x_76, 0); +lean_inc(x_79); +x_80 = lean_ctor_get(x_76, 1); lean_inc(x_80); -x_81 = lean_ctor_get(x_80, 1); -lean_inc(x_81); -x_82 = lean_ctor_get(x_79, 1); -lean_inc(x_82); -lean_dec(x_79); -x_83 = lean_ctor_get(x_80, 0); -lean_inc(x_83); -lean_dec(x_80); -x_84 = lean_ctor_get(x_81, 0); -lean_inc(x_84); -x_85 = lean_ctor_get(x_81, 1); -lean_inc(x_85); -lean_dec(x_81); -lean_inc(x_4); -lean_inc(x_7); -lean_inc(x_85); -x_112 = l_Lean_Meta_isExprDefEq(x_85, x_7, x_4, x_82); -if (lean_obj_tag(x_112) == 0) +lean_dec(x_76); +lean_inc(x_5); +lean_inc(x_8); +lean_inc(x_80); +x_101 = l_Lean_Meta_isExprDefEq(x_80, x_8, x_5, x_77); +if (lean_obj_tag(x_101) == 0) { -lean_object* x_113; uint8_t x_114; -x_113 = lean_ctor_get(x_112, 0); -lean_inc(x_113); -x_114 = lean_unbox(x_113); -lean_dec(x_113); -if (x_114 == 0) -{ -lean_object* x_115; lean_object* x_116; uint8_t x_117; -lean_dec(x_84); -lean_dec(x_83); -lean_dec(x_2); -x_115 = lean_ctor_get(x_112, 1); -lean_inc(x_115); -lean_dec(x_112); -x_116 = l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg(x_1, x_85, x_7, x_4, x_115); -lean_dec(x_4); -x_117 = !lean_is_exclusive(x_116); -if (x_117 == 0) -{ -return x_116; -} -else -{ -lean_object* x_118; lean_object* x_119; lean_object* x_120; -x_118 = lean_ctor_get(x_116, 0); -x_119 = lean_ctor_get(x_116, 1); -lean_inc(x_119); -lean_inc(x_118); -lean_dec(x_116); -x_120 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_120, 0, x_118); -lean_ctor_set(x_120, 1, x_119); -return x_120; -} -} -else -{ -lean_object* x_121; -lean_dec(x_85); -lean_dec(x_7); -x_121 = lean_ctor_get(x_112, 1); -lean_inc(x_121); -lean_dec(x_112); -x_86 = x_121; -goto block_111; -} -} -else -{ -uint8_t x_122; -lean_dec(x_85); -lean_dec(x_84); -lean_dec(x_83); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_2); -lean_dec(x_1); -x_122 = !lean_is_exclusive(x_112); -if (x_122 == 0) -{ -return x_112; -} -else -{ -lean_object* x_123; lean_object* x_124; lean_object* x_125; -x_123 = lean_ctor_get(x_112, 0); -x_124 = lean_ctor_get(x_112, 1); -lean_inc(x_124); -lean_inc(x_123); -lean_dec(x_112); -x_125 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_125, 0, x_123); -lean_ctor_set(x_125, 1, x_124); -return x_125; -} -} -block_111: -{ -lean_object* x_87; -lean_inc(x_4); -lean_inc(x_1); -x_87 = l___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances(x_1, x_83, x_84, x_4, x_86); -if (lean_obj_tag(x_87) == 0) -{ -lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; -x_88 = lean_ctor_get(x_87, 1); -lean_inc(x_88); -lean_dec(x_87); -x_89 = lean_unsigned_to_nat(0u); -x_90 = l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(x_83, x_83, x_89, x_2); -lean_inc(x_1); -x_91 = l_Lean_Meta_assignExprMVar(x_1, x_90, x_4, x_88); -if (lean_obj_tag(x_91) == 0) -{ -lean_object* x_92; lean_object* x_93; -x_92 = lean_ctor_get(x_91, 1); -lean_inc(x_92); -lean_dec(x_91); -x_93 = l___private_Init_Lean_Meta_Tactic_Apply_5__appendParentTag(x_1, x_83, x_84, x_4, x_92); -lean_dec(x_84); -if (lean_obj_tag(x_93) == 0) -{ -lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; -x_94 = lean_ctor_get(x_93, 1); -lean_inc(x_94); -lean_dec(x_93); -x_95 = l_Array_filterMAux___main___at_Lean_Meta_apply___spec__1(x_83, x_89, x_89, x_4, x_94); -x_96 = lean_ctor_get(x_95, 0); -lean_inc(x_96); -x_97 = lean_ctor_get(x_95, 1); -lean_inc(x_97); -lean_dec(x_95); -x_98 = l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst(x_96, x_4, x_97); -lean_dec(x_96); -return x_98; -} -else -{ -uint8_t x_99; -lean_dec(x_83); -lean_dec(x_4); -x_99 = !lean_is_exclusive(x_93); -if (x_99 == 0) -{ -return x_93; -} -else -{ -lean_object* x_100; lean_object* x_101; lean_object* x_102; -x_100 = lean_ctor_get(x_93, 0); -x_101 = lean_ctor_get(x_93, 1); -lean_inc(x_101); -lean_inc(x_100); -lean_dec(x_93); -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; -} -} -} -else -{ -uint8_t x_103; -lean_dec(x_84); -lean_dec(x_83); -lean_dec(x_4); -lean_dec(x_1); -x_103 = !lean_is_exclusive(x_91); +lean_object* x_102; uint8_t x_103; +x_102 = lean_ctor_get(x_101, 0); +lean_inc(x_102); +x_103 = lean_unbox(x_102); +lean_dec(x_102); if (x_103 == 0) { +lean_object* x_104; lean_object* x_105; uint8_t x_106; +lean_dec(x_79); +lean_dec(x_78); +lean_dec(x_3); +lean_dec(x_2); +x_104 = lean_ctor_get(x_101, 1); +lean_inc(x_104); +lean_dec(x_101); +x_105 = l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg(x_1, x_80, x_8, x_5, x_104); +lean_dec(x_5); +x_106 = !lean_is_exclusive(x_105); +if (x_106 == 0) +{ +return x_105; +} +else +{ +lean_object* x_107; lean_object* x_108; lean_object* x_109; +x_107 = lean_ctor_get(x_105, 0); +x_108 = lean_ctor_get(x_105, 1); +lean_inc(x_108); +lean_inc(x_107); +lean_dec(x_105); +x_109 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_109, 0, x_107); +lean_ctor_set(x_109, 1, x_108); +return x_109; +} +} +else +{ +lean_object* x_110; +lean_dec(x_80); +lean_dec(x_8); +x_110 = lean_ctor_get(x_101, 1); +lean_inc(x_110); +lean_dec(x_101); +x_81 = x_110; +goto block_100; +} +} +else +{ +uint8_t x_111; +lean_dec(x_80); +lean_dec(x_79); +lean_dec(x_78); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_111 = !lean_is_exclusive(x_101); +if (x_111 == 0) +{ +return x_101; +} +else +{ +lean_object* x_112; lean_object* x_113; lean_object* x_114; +x_112 = lean_ctor_get(x_101, 0); +x_113 = lean_ctor_get(x_101, 1); +lean_inc(x_113); +lean_inc(x_112); +lean_dec(x_101); +x_114 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_114, 0, x_112); +lean_ctor_set(x_114, 1, x_113); +return x_114; +} +} +block_100: +{ +lean_object* x_82; +lean_inc(x_5); +lean_inc(x_1); +x_82 = l_Lean_Meta_postprocessAppMVars(x_3, x_1, x_78, x_79, x_5, x_81); +lean_dec(x_79); +if (lean_obj_tag(x_82) == 0) +{ +lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; +x_83 = lean_ctor_get(x_82, 1); +lean_inc(x_83); +lean_dec(x_82); +x_84 = lean_unsigned_to_nat(0u); +x_85 = l_Array_iterateMAux___main___at_Lean_mkAppN___spec__1(x_78, x_78, x_84, x_2); +x_86 = l_Lean_Meta_assignExprMVar(x_1, x_85, x_5, x_83); +if (lean_obj_tag(x_86) == 0) +{ +lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; +x_87 = lean_ctor_get(x_86, 1); +lean_inc(x_87); +lean_dec(x_86); +x_88 = l_Array_filterMAux___main___at_Lean_Meta_apply___spec__1(x_78, x_84, x_84, x_5, x_87); +x_89 = lean_ctor_get(x_88, 0); +lean_inc(x_89); +x_90 = lean_ctor_get(x_88, 1); +lean_inc(x_90); +lean_dec(x_88); +x_91 = l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst(x_89, x_5, x_90); +lean_dec(x_89); return x_91; } else { -lean_object* x_104; lean_object* x_105; lean_object* x_106; -x_104 = lean_ctor_get(x_91, 0); -x_105 = lean_ctor_get(x_91, 1); -lean_inc(x_105); -lean_inc(x_104); -lean_dec(x_91); -x_106 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_106, 0, x_104); -lean_ctor_set(x_106, 1, x_105); -return x_106; +uint8_t x_92; +lean_dec(x_78); +lean_dec(x_5); +x_92 = !lean_is_exclusive(x_86); +if (x_92 == 0) +{ +return x_86; +} +else +{ +lean_object* x_93; lean_object* x_94; lean_object* x_95; +x_93 = lean_ctor_get(x_86, 0); +x_94 = lean_ctor_get(x_86, 1); +lean_inc(x_94); +lean_inc(x_93); +lean_dec(x_86); +x_95 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_95, 0, x_93); +lean_ctor_set(x_95, 1, x_94); +return x_95; } } } else { -uint8_t x_107; -lean_dec(x_84); -lean_dec(x_83); -lean_dec(x_4); +uint8_t x_96; +lean_dec(x_78); +lean_dec(x_5); lean_dec(x_2); lean_dec(x_1); -x_107 = !lean_is_exclusive(x_87); -if (x_107 == 0) +x_96 = !lean_is_exclusive(x_82); +if (x_96 == 0) { -return x_87; +return x_82; } else { -lean_object* x_108; lean_object* x_109; lean_object* x_110; -x_108 = lean_ctor_get(x_87, 0); -x_109 = lean_ctor_get(x_87, 1); -lean_inc(x_109); -lean_inc(x_108); -lean_dec(x_87); -x_110 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_110, 0, x_108); -lean_ctor_set(x_110, 1, x_109); -return x_110; +lean_object* x_97; lean_object* x_98; lean_object* x_99; +x_97 = lean_ctor_get(x_82, 0); +x_98 = lean_ctor_get(x_82, 1); +lean_inc(x_98); +lean_inc(x_97); +lean_dec(x_82); +x_99 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_99, 0, x_97); +lean_ctor_set(x_99, 1, x_98); +return x_99; } } } } else { -uint8_t x_126; -lean_dec(x_7); -lean_dec(x_4); +uint8_t x_115; +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_126 = !lean_is_exclusive(x_79); -if (x_126 == 0) +x_115 = !lean_is_exclusive(x_74); +if (x_115 == 0) { -return x_79; +return x_74; } else { -lean_object* x_127; lean_object* x_128; lean_object* x_129; -x_127 = lean_ctor_get(x_79, 0); -x_128 = lean_ctor_get(x_79, 1); +lean_object* x_116; lean_object* x_117; lean_object* x_118; +x_116 = lean_ctor_get(x_74, 0); +x_117 = lean_ctor_get(x_74, 1); +lean_inc(x_117); +lean_inc(x_116); +lean_dec(x_74); +x_118 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_118, 0, x_116); +lean_ctor_set(x_118, 1, x_117); +return x_118; +} +} +} +else +{ +uint8_t x_119; +lean_dec(x_67); +lean_dec(x_11); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_119 = !lean_is_exclusive(x_68); +if (x_119 == 0) +{ +return x_68; +} +else +{ +lean_object* x_120; lean_object* x_121; lean_object* x_122; +x_120 = lean_ctor_get(x_68, 0); +x_121 = lean_ctor_get(x_68, 1); +lean_inc(x_121); +lean_inc(x_120); +lean_dec(x_68); +x_122 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_122, 0, x_120); +lean_ctor_set(x_122, 1, x_121); +return x_122; +} +} +} +} +else +{ +uint8_t x_123; +lean_dec(x_11); +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_123 = !lean_is_exclusive(x_13); +if (x_123 == 0) +{ +return x_13; +} +else +{ +lean_object* x_124; lean_object* x_125; lean_object* x_126; +x_124 = lean_ctor_get(x_13, 0); +x_125 = lean_ctor_get(x_13, 1); +lean_inc(x_125); +lean_inc(x_124); +lean_dec(x_13); +x_126 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_126, 0, x_124); +lean_ctor_set(x_126, 1, x_125); +return x_126; +} +} +} +else +{ +uint8_t x_127; +lean_dec(x_8); +lean_dec(x_5); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_127 = !lean_is_exclusive(x_10); +if (x_127 == 0) +{ +return x_10; +} +else +{ +lean_object* x_128; lean_object* x_129; lean_object* x_130; +x_128 = lean_ctor_get(x_10, 0); +x_129 = lean_ctor_get(x_10, 1); +lean_inc(x_129); lean_inc(x_128); -lean_inc(x_127); -lean_dec(x_79); -x_129 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_129, 0, x_127); -lean_ctor_set(x_129, 1, x_128); -return x_129; +lean_dec(x_10); +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; } } } else { -uint8_t x_130; -lean_dec(x_72); -lean_dec(x_10); -lean_dec(x_7); -lean_dec(x_4); +uint8_t x_131; +lean_dec(x_5); +lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_130 = !lean_is_exclusive(x_73); -if (x_130 == 0) +x_131 = !lean_is_exclusive(x_7); +if (x_131 == 0) { -return x_73; +return x_7; } else { -lean_object* x_131; lean_object* x_132; lean_object* x_133; -x_131 = lean_ctor_get(x_73, 0); -x_132 = lean_ctor_get(x_73, 1); +lean_object* x_132; lean_object* x_133; lean_object* x_134; +x_132 = lean_ctor_get(x_7, 0); +x_133 = lean_ctor_get(x_7, 1); +lean_inc(x_133); lean_inc(x_132); -lean_inc(x_131); -lean_dec(x_73); -x_133 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_133, 0, x_131); -lean_ctor_set(x_133, 1, x_132); -return x_133; -} -} -} -} -else -{ -uint8_t x_134; -lean_dec(x_10); lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_2); -lean_dec(x_1); -x_134 = !lean_is_exclusive(x_12); -if (x_134 == 0) -{ -return x_12; -} -else -{ -lean_object* x_135; lean_object* x_136; lean_object* x_137; -x_135 = lean_ctor_get(x_12, 0); -x_136 = lean_ctor_get(x_12, 1); -lean_inc(x_136); -lean_inc(x_135); -lean_dec(x_12); -x_137 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_137, 0, x_135); -lean_ctor_set(x_137, 1, x_136); -return x_137; -} -} -} -else -{ -uint8_t x_138; -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_2); -lean_dec(x_1); -x_138 = !lean_is_exclusive(x_9); -if (x_138 == 0) -{ -return x_9; -} -else -{ -lean_object* x_139; lean_object* x_140; lean_object* x_141; -x_139 = lean_ctor_get(x_9, 0); -x_140 = lean_ctor_get(x_9, 1); -lean_inc(x_140); -lean_inc(x_139); -lean_dec(x_9); -x_141 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_141, 0, x_139); -lean_ctor_set(x_141, 1, x_140); -return x_141; -} -} -} -else -{ -uint8_t x_142; -lean_dec(x_4); -lean_dec(x_2); -lean_dec(x_1); -x_142 = !lean_is_exclusive(x_6); -if (x_142 == 0) -{ -return x_6; -} -else -{ -lean_object* x_143; lean_object* x_144; lean_object* x_145; -x_143 = lean_ctor_get(x_6, 0); -x_144 = lean_ctor_get(x_6, 1); -lean_inc(x_144); -lean_inc(x_143); -lean_dec(x_6); -x_145 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_145, 0, x_143); -lean_ctor_set(x_145, 1, x_144); -return x_145; +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; } } } @@ -2458,9 +2454,10 @@ x_6 = lean_alloc_closure((void*)(l_Lean_Meta_checkNotAssigned___boxed), 4, 2); lean_closure_set(x_6, 0, x_1); lean_closure_set(x_6, 1, x_5); lean_inc(x_1); -x_7 = lean_alloc_closure((void*)(l_Lean_Meta_apply___lambda__1___boxed), 5, 2); +x_7 = lean_alloc_closure((void*)(l_Lean_Meta_apply___lambda__1___boxed), 6, 3); lean_closure_set(x_7, 0, x_1); lean_closure_set(x_7, 1, x_2); +lean_closure_set(x_7, 2, x_5); x_8 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg), 4, 2); lean_closure_set(x_8, 0, x_6); lean_closure_set(x_8, 1, x_7); @@ -2477,13 +2474,13 @@ lean_dec(x_4); return x_6; } } -lean_object* l_Lean_Meta_apply___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* l_Lean_Meta_apply___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_6; -x_6 = l_Lean_Meta_apply___lambda__1(x_1, x_2, x_3, x_4, x_5); -lean_dec(x_3); -return x_6; +lean_object* x_7; +x_7 = l_Lean_Meta_apply___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_4); +return x_7; } } lean_object* l_Lean_Meta_apply___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { @@ -2538,14 +2535,14 @@ l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__7 = lean_mark_persistent(l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__7); l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__8 = _init_l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__8(); lean_mark_persistent(l___private_Init_Lean_Meta_Tactic_Apply_3__throwApplyError___rarg___closed__8); -l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__1 = _init_l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__1(); -lean_mark_persistent(l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__1); -l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__2 = _init_l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__2(); -lean_mark_persistent(l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__2); -l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__3 = _init_l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__3(); -lean_mark_persistent(l_Nat_forMAux___main___at___private_Init_Lean_Meta_Tactic_Apply_4__synthInstances___spec__1___closed__3); -l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1 = _init_l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1(); -lean_mark_persistent(l___private_Init_Lean_Meta_Tactic_Apply_7__reorderNonDependentFirst___closed__1); +l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__1 = _init_l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__1(); +lean_mark_persistent(l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__1); +l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__2 = _init_l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__2(); +lean_mark_persistent(l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__2); +l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__3 = _init_l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__3(); +lean_mark_persistent(l_Nat_forMAux___main___at_Lean_Meta_synthAppInstances___spec__1___closed__3); +l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1 = _init_l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1(); +lean_mark_persistent(l___private_Init_Lean_Meta_Tactic_Apply_5__reorderNonDependentFirst___closed__1); return lean_mk_io_result(lean_box(0)); } #ifdef __cplusplus diff --git a/stage0/stdlib/Init/Lean/Meta/Tactic/Assert.c b/stage0/stdlib/Init/Lean/Meta/Tactic/Assert.c new file mode 100644 index 0000000000..39c0611af4 --- /dev/null +++ b/stage0/stdlib/Init/Lean/Meta/Tactic/Assert.c @@ -0,0 +1,470 @@ +// Lean compiler output +// Module: Init.Lean.Meta.Tactic.Assert +// Imports: Init.Lean.Meta.Tactic.Util +#include "runtime/lean.h" +#if defined(__clang__) +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-label" +#elif defined(__GNUC__) && !defined(__CLANG__) +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-label" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif +#ifdef __cplusplus +extern "C" { +#endif +lean_object* l_Lean_Meta_assert(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Expr_mvarId_x21(lean_object*); +lean_object* l_Lean_Meta_assert___closed__2; +lean_object* l_Lean_Meta_assert___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_define(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_getMVarTag(lean_object*, lean_object*, lean_object*); +lean_object* l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assert___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assert___closed__1; +lean_object* l_Lean_Meta_checkNotAssigned___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_getMVarType(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assert___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_name_mk_string(lean_object*, lean_object*); +lean_object* l_Lean_Meta_define___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); +lean_object* l_Lean_mkApp(lean_object*, lean_object*); +lean_object* l_Lean_Meta_withMVarContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_define___closed__2; +lean_object* l_Lean_mkForall(lean_object*, uint8_t, lean_object*, lean_object*); +lean_object* l_Lean_Meta_define___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_define___closed__1; +lean_object* l_Lean_mkLet(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t); +lean_object* l_Lean_Meta_define___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assert___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +_start: +{ +lean_object* x_8; +lean_inc(x_1); +x_8 = l_Lean_Meta_getMVarTag(x_1, x_6, x_7); +if (lean_obj_tag(x_8) == 0) +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; +x_9 = lean_ctor_get(x_8, 0); +lean_inc(x_9); +x_10 = lean_ctor_get(x_8, 1); +lean_inc(x_10); +lean_dec(x_8); +lean_inc(x_1); +x_11 = l_Lean_Meta_getMVarType(x_1, x_6, x_10); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; uint8_t x_14; lean_object* x_15; uint8_t x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_14 = 0; +x_15 = l_Lean_mkForall(x_2, x_14, x_3, x_12); +x_16 = 2; +lean_inc(x_6); +x_17 = l_Lean_Meta_mkFreshExprMVar(x_15, x_9, x_16, x_6, x_13); +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); +lean_inc(x_18); +x_20 = l_Lean_mkApp(x_18, x_4); +x_21 = l_Lean_Meta_assignExprMVar(x_1, x_20, x_6, x_19); +lean_dec(x_6); +if (lean_obj_tag(x_21) == 0) +{ +uint8_t x_22; +x_22 = !lean_is_exclusive(x_21); +if (x_22 == 0) +{ +lean_object* x_23; lean_object* x_24; +x_23 = lean_ctor_get(x_21, 0); +lean_dec(x_23); +x_24 = l_Lean_Expr_mvarId_x21(x_18); +lean_dec(x_18); +lean_ctor_set(x_21, 0, x_24); +return x_21; +} +else +{ +lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_25 = lean_ctor_get(x_21, 1); +lean_inc(x_25); +lean_dec(x_21); +x_26 = l_Lean_Expr_mvarId_x21(x_18); +lean_dec(x_18); +x_27 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_27, 0, x_26); +lean_ctor_set(x_27, 1, x_25); +return x_27; +} +} +else +{ +uint8_t x_28; +lean_dec(x_18); +x_28 = !lean_is_exclusive(x_21); +if (x_28 == 0) +{ +return x_21; +} +else +{ +lean_object* x_29; lean_object* x_30; lean_object* x_31; +x_29 = lean_ctor_get(x_21, 0); +x_30 = lean_ctor_get(x_21, 1); +lean_inc(x_30); +lean_inc(x_29); +lean_dec(x_21); +x_31 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_31, 0, x_29); +lean_ctor_set(x_31, 1, x_30); +return x_31; +} +} +} +else +{ +uint8_t x_32; +lean_dec(x_9); +lean_dec(x_6); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_1); +x_32 = !lean_is_exclusive(x_11); +if (x_32 == 0) +{ +return x_11; +} +else +{ +lean_object* x_33; lean_object* x_34; lean_object* x_35; +x_33 = lean_ctor_get(x_11, 0); +x_34 = lean_ctor_get(x_11, 1); +lean_inc(x_34); +lean_inc(x_33); +lean_dec(x_11); +x_35 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_35, 0, x_33); +lean_ctor_set(x_35, 1, x_34); +return x_35; +} +} +} +else +{ +uint8_t x_36; +lean_dec(x_6); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_1); +x_36 = !lean_is_exclusive(x_8); +if (x_36 == 0) +{ +return x_8; +} +else +{ +lean_object* x_37; lean_object* x_38; lean_object* x_39; +x_37 = lean_ctor_get(x_8, 0); +x_38 = lean_ctor_get(x_8, 1); +lean_inc(x_38); +lean_inc(x_37); +lean_dec(x_8); +x_39 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_39, 0, x_37); +lean_ctor_set(x_39, 1, x_38); +return x_39; +} +} +} +} +lean_object* _init_l_Lean_Meta_assert___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("assert"); +return x_1; +} +} +lean_object* _init_l_Lean_Meta_assert___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = lean_box(0); +x_2 = l_Lean_Meta_assert___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* l_Lean_Meta_assert(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; lean_object* x_10; lean_object* x_11; +x_7 = l_Lean_Meta_assert___closed__2; +lean_inc(x_1); +x_8 = lean_alloc_closure((void*)(l_Lean_Meta_checkNotAssigned___boxed), 4, 2); +lean_closure_set(x_8, 0, x_1); +lean_closure_set(x_8, 1, x_7); +lean_inc(x_1); +x_9 = lean_alloc_closure((void*)(l_Lean_Meta_assert___lambda__1___boxed), 7, 4); +lean_closure_set(x_9, 0, x_1); +lean_closure_set(x_9, 1, x_2); +lean_closure_set(x_9, 2, x_3); +lean_closure_set(x_9, 3, x_4); +x_10 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg), 4, 2); +lean_closure_set(x_10, 0, x_8); +lean_closure_set(x_10, 1, x_9); +x_11 = l_Lean_Meta_withMVarContext___rarg(x_1, x_10, x_5, x_6); +return x_11; +} +} +lean_object* l_Lean_Meta_assert___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, lean_object* x_7) { +_start: +{ +lean_object* x_8; +x_8 = l_Lean_Meta_assert___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7); +lean_dec(x_5); +lean_dec(x_2); +return x_8; +} +} +lean_object* l_Lean_Meta_assert___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_Meta_assert(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_5); +return x_7; +} +} +lean_object* l_Lean_Meta_define___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +_start: +{ +lean_object* x_8; +lean_inc(x_1); +x_8 = l_Lean_Meta_getMVarTag(x_1, x_6, x_7); +if (lean_obj_tag(x_8) == 0) +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; +x_9 = lean_ctor_get(x_8, 0); +lean_inc(x_9); +x_10 = lean_ctor_get(x_8, 1); +lean_inc(x_10); +lean_dec(x_8); +lean_inc(x_1); +x_11 = l_Lean_Meta_getMVarType(x_1, x_6, x_10); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; uint8_t x_14; lean_object* x_15; uint8_t x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_14 = 0; +x_15 = l_Lean_mkLet(x_2, x_3, x_4, x_12, x_14); +x_16 = 2; +lean_inc(x_6); +x_17 = l_Lean_Meta_mkFreshExprMVar(x_15, x_9, x_16, x_6, x_13); +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); +lean_inc(x_18); +x_20 = l_Lean_Meta_assignExprMVar(x_1, x_18, x_6, x_19); +lean_dec(x_6); +if (lean_obj_tag(x_20) == 0) +{ +uint8_t x_21; +x_21 = !lean_is_exclusive(x_20); +if (x_21 == 0) +{ +lean_object* x_22; lean_object* x_23; +x_22 = lean_ctor_get(x_20, 0); +lean_dec(x_22); +x_23 = l_Lean_Expr_mvarId_x21(x_18); +lean_dec(x_18); +lean_ctor_set(x_20, 0, x_23); +return x_20; +} +else +{ +lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_24 = lean_ctor_get(x_20, 1); +lean_inc(x_24); +lean_dec(x_20); +x_25 = l_Lean_Expr_mvarId_x21(x_18); +lean_dec(x_18); +x_26 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_26, 0, x_25); +lean_ctor_set(x_26, 1, x_24); +return x_26; +} +} +else +{ +uint8_t x_27; +lean_dec(x_18); +x_27 = !lean_is_exclusive(x_20); +if (x_27 == 0) +{ +return x_20; +} +else +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_20, 0); +x_29 = lean_ctor_get(x_20, 1); +lean_inc(x_29); +lean_inc(x_28); +lean_dec(x_20); +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 +{ +uint8_t x_31; +lean_dec(x_9); +lean_dec(x_6); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_1); +x_31 = !lean_is_exclusive(x_11); +if (x_31 == 0) +{ +return x_11; +} +else +{ +lean_object* x_32; lean_object* x_33; lean_object* x_34; +x_32 = lean_ctor_get(x_11, 0); +x_33 = lean_ctor_get(x_11, 1); +lean_inc(x_33); +lean_inc(x_32); +lean_dec(x_11); +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_6); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_1); +x_35 = !lean_is_exclusive(x_8); +if (x_35 == 0) +{ +return x_8; +} +else +{ +lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_36 = lean_ctor_get(x_8, 0); +x_37 = lean_ctor_get(x_8, 1); +lean_inc(x_37); +lean_inc(x_36); +lean_dec(x_8); +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* _init_l_Lean_Meta_define___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("define"); +return x_1; +} +} +lean_object* _init_l_Lean_Meta_define___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = lean_box(0); +x_2 = l_Lean_Meta_define___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* l_Lean_Meta_define(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; lean_object* x_10; lean_object* x_11; +x_7 = l_Lean_Meta_define___closed__2; +lean_inc(x_1); +x_8 = lean_alloc_closure((void*)(l_Lean_Meta_checkNotAssigned___boxed), 4, 2); +lean_closure_set(x_8, 0, x_1); +lean_closure_set(x_8, 1, x_7); +lean_inc(x_1); +x_9 = lean_alloc_closure((void*)(l_Lean_Meta_define___lambda__1___boxed), 7, 4); +lean_closure_set(x_9, 0, x_1); +lean_closure_set(x_9, 1, x_2); +lean_closure_set(x_9, 2, x_3); +lean_closure_set(x_9, 3, x_4); +x_10 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg), 4, 2); +lean_closure_set(x_10, 0, x_8); +lean_closure_set(x_10, 1, x_9); +x_11 = l_Lean_Meta_withMVarContext___rarg(x_1, x_10, x_5, x_6); +return x_11; +} +} +lean_object* l_Lean_Meta_define___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, lean_object* x_7) { +_start: +{ +lean_object* x_8; +x_8 = l_Lean_Meta_define___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7); +lean_dec(x_5); +lean_dec(x_2); +return x_8; +} +} +lean_object* l_Lean_Meta_define___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_Meta_define(x_1, x_2, x_3, x_4, x_5, x_6); +lean_dec(x_5); +return x_7; +} +} +lean_object* initialize_Init_Lean_Meta_Tactic_Util(lean_object*); +static bool _G_initialized = false; +lean_object* initialize_Init_Lean_Meta_Tactic_Assert(lean_object* w) { +lean_object * res; +if (_G_initialized) return lean_mk_io_result(lean_box(0)); +_G_initialized = true; +res = initialize_Init_Lean_Meta_Tactic_Util(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l_Lean_Meta_assert___closed__1 = _init_l_Lean_Meta_assert___closed__1(); +lean_mark_persistent(l_Lean_Meta_assert___closed__1); +l_Lean_Meta_assert___closed__2 = _init_l_Lean_Meta_assert___closed__2(); +lean_mark_persistent(l_Lean_Meta_assert___closed__2); +l_Lean_Meta_define___closed__1 = _init_l_Lean_Meta_define___closed__1(); +lean_mark_persistent(l_Lean_Meta_define___closed__1); +l_Lean_Meta_define___closed__2 = _init_l_Lean_Meta_define___closed__2(); +lean_mark_persistent(l_Lean_Meta_define___closed__2); +return lean_mk_io_result(lean_box(0)); +} +#ifdef __cplusplus +} +#endif diff --git a/stage0/stdlib/Init/Lean/Meta/Tactic/Clear.c b/stage0/stdlib/Init/Lean/Meta/Tactic/Clear.c index 60769f8d5a..f9bb4b8ed0 100644 --- a/stage0/stdlib/Init/Lean/Meta/Tactic/Clear.c +++ b/stage0/stdlib/Init/Lean/Meta/Tactic/Clear.c @@ -43,7 +43,6 @@ lean_object* l_Lean_Meta_clear___lambda__1(lean_object*, lean_object*, lean_obje extern lean_object* l_Char_HasRepr___closed__1; lean_object* l_PersistentArray_forMAux___main___at_Lean_Meta_clear___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* l_Lean_MetavarContext_assignExpr(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_clear___lambda__1___closed__4; lean_object* l_Lean_MetavarContext_localDeclDependsOn(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_LocalDecl_toExpr(lean_object*); @@ -53,6 +52,7 @@ lean_object* l_Array_forMAux___main___at_Lean_Meta_clear___spec__4___boxed(lean_ lean_object* l_Lean_Meta_mkFreshExprMVarAt(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l_Lean_MetavarContext_exprDependsOn(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Meta_clear___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_LocalContext_forM___at_Lean_Meta_clear___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withMVarContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*); @@ -650,53 +650,53 @@ return x_2; lean_object* l_Lean_Meta_clear___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; uint8_t x_117; +lean_object* x_7; lean_object* x_8; uint8_t x_83; x_7 = lean_ctor_get(x_5, 1); lean_inc(x_7); lean_inc(x_7); -x_117 = l_Lean_LocalContext_contains(x_7, x_2); -if (x_117 == 0) +x_83 = l_Lean_LocalContext_contains(x_7, x_2); +if (x_83 == 0) { -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; uint8_t x_125; +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; uint8_t x_91; lean_dec(x_7); -x_118 = l_Lean_mkFVar(x_2); -x_119 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_119, 0, x_118); -x_120 = l_Lean_Meta_clear___lambda__1___closed__6; -x_121 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_121, 0, x_120); -lean_ctor_set(x_121, 1, x_119); -x_122 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8; -x_123 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_123, 0, x_121); -lean_ctor_set(x_123, 1, x_122); -x_124 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_123, x_5, x_6); +x_84 = l_Lean_mkFVar(x_2); +x_85 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_85, 0, x_84); +x_86 = l_Lean_Meta_clear___lambda__1___closed__6; +x_87 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_87, 0, x_86); +lean_ctor_set(x_87, 1, x_85); +x_88 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8; +x_89 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_89, 0, x_87); +lean_ctor_set(x_89, 1, x_88); +x_90 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_89, x_5, x_6); lean_dec(x_5); -x_125 = !lean_is_exclusive(x_124); -if (x_125 == 0) +x_91 = !lean_is_exclusive(x_90); +if (x_91 == 0) { -return x_124; +return x_90; } else { -lean_object* x_126; lean_object* x_127; lean_object* x_128; -x_126 = lean_ctor_get(x_124, 0); -x_127 = lean_ctor_get(x_124, 1); -lean_inc(x_127); -lean_inc(x_126); -lean_dec(x_124); -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; +lean_object* x_92; lean_object* x_93; lean_object* x_94; +x_92 = lean_ctor_get(x_90, 0); +x_93 = lean_ctor_get(x_90, 1); +lean_inc(x_93); +lean_inc(x_92); +lean_dec(x_90); +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 { x_8 = x_6; -goto block_116; +goto block_82; } -block_116: +block_82: { lean_object* x_9; lean_inc(x_1); @@ -726,7 +726,7 @@ lean_inc(x_1); x_15 = l_Lean_Meta_getMVarDecl(x_1, x_5, x_14); if (lean_obj_tag(x_15) == 0) { -lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_91; uint8_t x_92; +lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_57; uint8_t x_58; x_16 = lean_ctor_get(x_15, 0); lean_inc(x_16); x_17 = lean_ctor_get(x_15, 1); @@ -736,54 +736,54 @@ x_18 = lean_ctor_get(x_16, 2); lean_inc(x_18); lean_dec(x_16); lean_inc(x_18); -x_91 = l_Lean_MetavarContext_exprDependsOn(x_12, x_18, x_2); -x_92 = lean_unbox(x_91); -lean_dec(x_91); -if (x_92 == 0) +x_57 = l_Lean_MetavarContext_exprDependsOn(x_12, x_18, x_2); +x_58 = lean_unbox(x_57); +lean_dec(x_57); +if (x_58 == 0) { lean_dec(x_3); x_19 = x_17; -goto block_90; +goto block_56; } else { -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; uint8_t x_100; +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; uint8_t x_66; lean_dec(x_18); lean_dec(x_10); lean_dec(x_7); -x_93 = l_Lean_mkFVar(x_2); -x_94 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_94, 0, x_93); -x_95 = l_Lean_Meta_clear___lambda__1___closed__3; -x_96 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_96, 0, x_95); -lean_ctor_set(x_96, 1, x_94); -x_97 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8; -x_98 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_98, 0, x_96); -lean_ctor_set(x_98, 1, x_97); -x_99 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_98, x_5, x_17); +x_59 = l_Lean_mkFVar(x_2); +x_60 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_60, 0, x_59); +x_61 = l_Lean_Meta_clear___lambda__1___closed__3; +x_62 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_62, 0, x_61); +lean_ctor_set(x_62, 1, x_60); +x_63 = l_Array_forMAux___main___at_Lean_Meta_clear___spec__5___closed__8; +x_64 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_64, 0, x_62); +lean_ctor_set(x_64, 1, x_63); +x_65 = l_Lean_Meta_throwTacticEx___rarg(x_3, x_1, x_64, x_5, x_17); lean_dec(x_5); -x_100 = !lean_is_exclusive(x_99); -if (x_100 == 0) +x_66 = !lean_is_exclusive(x_65); +if (x_66 == 0) { -return x_99; +return x_65; } else { -lean_object* x_101; lean_object* x_102; lean_object* x_103; -x_101 = lean_ctor_get(x_99, 0); -x_102 = lean_ctor_get(x_99, 1); -lean_inc(x_102); -lean_inc(x_101); -lean_dec(x_99); -x_103 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_103, 0, x_101); -lean_ctor_set(x_103, 1, x_102); -return x_103; +lean_object* x_67; lean_object* x_68; lean_object* x_69; +x_67 = lean_ctor_get(x_65, 0); +x_68 = lean_ctor_get(x_65, 1); +lean_inc(x_68); +lean_inc(x_67); +lean_dec(x_65); +x_69 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_69, 0, x_67); +lean_ctor_set(x_69, 1, x_68); +return x_69; } } -block_90: +block_56: { lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_inc(x_2); @@ -795,236 +795,144 @@ x_23 = l_Array_findIdxAux___main___at_Lean_Meta_clear___spec__7(x_2, x_21, x_22) lean_dec(x_2); if (lean_obj_tag(x_23) == 0) { -uint8_t x_24; lean_object* x_25; uint8_t x_26; +uint8_t x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; x_24 = 2; x_25 = l_Lean_Meta_mkFreshExprMVarAt(x_20, x_21, x_18, x_10, x_24, x_5, x_19); -lean_dec(x_5); -x_26 = !lean_is_exclusive(x_25); -if (x_26 == 0) -{ -lean_object* x_27; uint8_t x_28; +x_26 = lean_ctor_get(x_25, 0); +lean_inc(x_26); x_27 = lean_ctor_get(x_25, 1); -x_28 = !lean_is_exclusive(x_27); -if (x_28 == 0) +lean_inc(x_27); +lean_dec(x_25); +lean_inc(x_26); +x_28 = l_Lean_Meta_assignExprMVar(x_1, x_26, x_5, x_27); +lean_dec(x_5); +if (lean_obj_tag(x_28) == 0) { -lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; -x_29 = lean_ctor_get(x_25, 0); -x_30 = lean_ctor_get(x_27, 1); -lean_inc(x_29); -x_31 = l_Lean_MetavarContext_assignExpr(x_30, x_1, x_29); -lean_ctor_set(x_27, 1, x_31); -x_32 = l_Lean_Expr_mvarId_x21(x_29); -lean_dec(x_29); -lean_ctor_set(x_25, 0, x_32); -return x_25; +uint8_t x_29; +x_29 = !lean_is_exclusive(x_28); +if (x_29 == 0) +{ +lean_object* x_30; lean_object* x_31; +x_30 = lean_ctor_get(x_28, 0); +lean_dec(x_30); +x_31 = l_Lean_Expr_mvarId_x21(x_26); +lean_dec(x_26); +lean_ctor_set(x_28, 0, x_31); +return x_28; } else { -lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; -x_33 = lean_ctor_get(x_25, 0); -x_34 = lean_ctor_get(x_27, 0); -x_35 = lean_ctor_get(x_27, 1); -x_36 = lean_ctor_get(x_27, 2); -x_37 = lean_ctor_get(x_27, 3); -x_38 = lean_ctor_get(x_27, 4); -x_39 = lean_ctor_get(x_27, 5); -lean_inc(x_39); -lean_inc(x_38); +lean_object* x_32; lean_object* x_33; lean_object* x_34; +x_32 = lean_ctor_get(x_28, 1); +lean_inc(x_32); +lean_dec(x_28); +x_33 = l_Lean_Expr_mvarId_x21(x_26); +lean_dec(x_26); +x_34 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_34, 0, x_33); +lean_ctor_set(x_34, 1, x_32); +return x_34; +} +} +else +{ +uint8_t x_35; +lean_dec(x_26); +x_35 = !lean_is_exclusive(x_28); +if (x_35 == 0) +{ +return x_28; +} +else +{ +lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_36 = lean_ctor_get(x_28, 0); +x_37 = lean_ctor_get(x_28, 1); lean_inc(x_37); lean_inc(x_36); -lean_inc(x_35); -lean_inc(x_34); -lean_dec(x_27); -lean_inc(x_33); -x_40 = l_Lean_MetavarContext_assignExpr(x_35, x_1, x_33); -x_41 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_41, 0, x_34); -lean_ctor_set(x_41, 1, x_40); -lean_ctor_set(x_41, 2, x_36); -lean_ctor_set(x_41, 3, x_37); -lean_ctor_set(x_41, 4, x_38); -lean_ctor_set(x_41, 5, x_39); -x_42 = l_Lean_Expr_mvarId_x21(x_33); -lean_dec(x_33); -lean_ctor_set(x_25, 1, x_41); -lean_ctor_set(x_25, 0, x_42); -return x_25; +lean_dec(x_28); +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; +} } } else { -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; -x_43 = lean_ctor_get(x_25, 1); -x_44 = lean_ctor_get(x_25, 0); +lean_object* x_39; lean_object* x_40; uint8_t x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; +x_39 = lean_ctor_get(x_23, 0); +lean_inc(x_39); +lean_dec(x_23); +x_40 = l_Array_eraseIdx___rarg(x_21, x_39); +lean_dec(x_39); +x_41 = 2; +x_42 = l_Lean_Meta_mkFreshExprMVarAt(x_20, x_40, x_18, x_10, x_41, x_5, x_19); +x_43 = lean_ctor_get(x_42, 0); lean_inc(x_43); +x_44 = lean_ctor_get(x_42, 1); lean_inc(x_44); -lean_dec(x_25); -x_45 = lean_ctor_get(x_43, 0); -lean_inc(x_45); -x_46 = lean_ctor_get(x_43, 1); -lean_inc(x_46); -x_47 = lean_ctor_get(x_43, 2); -lean_inc(x_47); -x_48 = lean_ctor_get(x_43, 3); -lean_inc(x_48); -x_49 = lean_ctor_get(x_43, 4); +lean_dec(x_42); +lean_inc(x_43); +x_45 = l_Lean_Meta_assignExprMVar(x_1, x_43, x_5, x_44); +lean_dec(x_5); +if (lean_obj_tag(x_45) == 0) +{ +uint8_t x_46; +x_46 = !lean_is_exclusive(x_45); +if (x_46 == 0) +{ +lean_object* x_47; lean_object* x_48; +x_47 = lean_ctor_get(x_45, 0); +lean_dec(x_47); +x_48 = l_Lean_Expr_mvarId_x21(x_43); +lean_dec(x_43); +lean_ctor_set(x_45, 0, x_48); +return x_45; +} +else +{ +lean_object* x_49; lean_object* x_50; lean_object* x_51; +x_49 = lean_ctor_get(x_45, 1); lean_inc(x_49); -x_50 = lean_ctor_get(x_43, 5); -lean_inc(x_50); -if (lean_is_exclusive(x_43)) { - lean_ctor_release(x_43, 0); - lean_ctor_release(x_43, 1); - lean_ctor_release(x_43, 2); - lean_ctor_release(x_43, 3); - lean_ctor_release(x_43, 4); - lean_ctor_release(x_43, 5); - x_51 = x_43; -} else { - lean_dec_ref(x_43); - x_51 = lean_box(0); +lean_dec(x_45); +x_50 = l_Lean_Expr_mvarId_x21(x_43); +lean_dec(x_43); +x_51 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_51, 0, x_50); +lean_ctor_set(x_51, 1, x_49); +return x_51; } -lean_inc(x_44); -x_52 = l_Lean_MetavarContext_assignExpr(x_46, x_1, x_44); -if (lean_is_scalar(x_51)) { - x_53 = lean_alloc_ctor(0, 6, 0); -} else { - x_53 = x_51; } -lean_ctor_set(x_53, 0, x_45); -lean_ctor_set(x_53, 1, x_52); -lean_ctor_set(x_53, 2, x_47); -lean_ctor_set(x_53, 3, x_48); -lean_ctor_set(x_53, 4, x_49); -lean_ctor_set(x_53, 5, x_50); -x_54 = l_Lean_Expr_mvarId_x21(x_44); -lean_dec(x_44); -x_55 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_55, 0, x_54); -lean_ctor_set(x_55, 1, x_53); +else +{ +uint8_t x_52; +lean_dec(x_43); +x_52 = !lean_is_exclusive(x_45); +if (x_52 == 0) +{ +return x_45; +} +else +{ +lean_object* x_53; lean_object* x_54; lean_object* x_55; +x_53 = lean_ctor_get(x_45, 0); +x_54 = lean_ctor_get(x_45, 1); +lean_inc(x_54); +lean_inc(x_53); +lean_dec(x_45); +x_55 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_55, 0, x_53); +lean_ctor_set(x_55, 1, x_54); return x_55; } } -else -{ -lean_object* x_56; lean_object* x_57; uint8_t x_58; lean_object* x_59; uint8_t x_60; -x_56 = lean_ctor_get(x_23, 0); -lean_inc(x_56); -lean_dec(x_23); -x_57 = l_Array_eraseIdx___rarg(x_21, x_56); -lean_dec(x_56); -x_58 = 2; -x_59 = l_Lean_Meta_mkFreshExprMVarAt(x_20, x_57, x_18, x_10, x_58, x_5, x_19); -lean_dec(x_5); -x_60 = !lean_is_exclusive(x_59); -if (x_60 == 0) -{ -lean_object* x_61; uint8_t x_62; -x_61 = lean_ctor_get(x_59, 1); -x_62 = !lean_is_exclusive(x_61); -if (x_62 == 0) -{ -lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; -x_63 = lean_ctor_get(x_59, 0); -x_64 = lean_ctor_get(x_61, 1); -lean_inc(x_63); -x_65 = l_Lean_MetavarContext_assignExpr(x_64, x_1, x_63); -lean_ctor_set(x_61, 1, x_65); -x_66 = l_Lean_Expr_mvarId_x21(x_63); -lean_dec(x_63); -lean_ctor_set(x_59, 0, x_66); -return x_59; -} -else -{ -lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; -x_67 = lean_ctor_get(x_59, 0); -x_68 = lean_ctor_get(x_61, 0); -x_69 = lean_ctor_get(x_61, 1); -x_70 = lean_ctor_get(x_61, 2); -x_71 = lean_ctor_get(x_61, 3); -x_72 = lean_ctor_get(x_61, 4); -x_73 = lean_ctor_get(x_61, 5); -lean_inc(x_73); -lean_inc(x_72); -lean_inc(x_71); -lean_inc(x_70); -lean_inc(x_69); -lean_inc(x_68); -lean_dec(x_61); -lean_inc(x_67); -x_74 = l_Lean_MetavarContext_assignExpr(x_69, x_1, x_67); -x_75 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_75, 0, x_68); -lean_ctor_set(x_75, 1, x_74); -lean_ctor_set(x_75, 2, x_70); -lean_ctor_set(x_75, 3, x_71); -lean_ctor_set(x_75, 4, x_72); -lean_ctor_set(x_75, 5, x_73); -x_76 = l_Lean_Expr_mvarId_x21(x_67); -lean_dec(x_67); -lean_ctor_set(x_59, 1, x_75); -lean_ctor_set(x_59, 0, x_76); -return x_59; -} -} -else -{ -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; -x_77 = lean_ctor_get(x_59, 1); -x_78 = lean_ctor_get(x_59, 0); -lean_inc(x_77); -lean_inc(x_78); -lean_dec(x_59); -x_79 = lean_ctor_get(x_77, 0); -lean_inc(x_79); -x_80 = lean_ctor_get(x_77, 1); -lean_inc(x_80); -x_81 = lean_ctor_get(x_77, 2); -lean_inc(x_81); -x_82 = lean_ctor_get(x_77, 3); -lean_inc(x_82); -x_83 = lean_ctor_get(x_77, 4); -lean_inc(x_83); -x_84 = lean_ctor_get(x_77, 5); -lean_inc(x_84); -if (lean_is_exclusive(x_77)) { - lean_ctor_release(x_77, 0); - lean_ctor_release(x_77, 1); - lean_ctor_release(x_77, 2); - lean_ctor_release(x_77, 3); - lean_ctor_release(x_77, 4); - lean_ctor_release(x_77, 5); - x_85 = x_77; -} else { - lean_dec_ref(x_77); - x_85 = lean_box(0); -} -lean_inc(x_78); -x_86 = l_Lean_MetavarContext_assignExpr(x_80, x_1, x_78); -if (lean_is_scalar(x_85)) { - x_87 = lean_alloc_ctor(0, 6, 0); -} else { - x_87 = x_85; -} -lean_ctor_set(x_87, 0, x_79); -lean_ctor_set(x_87, 1, x_86); -lean_ctor_set(x_87, 2, x_81); -lean_ctor_set(x_87, 3, x_82); -lean_ctor_set(x_87, 4, x_83); -lean_ctor_set(x_87, 5, x_84); -x_88 = l_Lean_Expr_mvarId_x21(x_78); -lean_dec(x_78); -x_89 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_89, 0, x_88); -lean_ctor_set(x_89, 1, x_87); -return x_89; -} } } } else { -uint8_t x_104; +uint8_t x_70; lean_dec(x_12); lean_dec(x_10); lean_dec(x_7); @@ -1032,29 +940,29 @@ lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_104 = !lean_is_exclusive(x_15); -if (x_104 == 0) +x_70 = !lean_is_exclusive(x_15); +if (x_70 == 0) { return x_15; } else { -lean_object* x_105; lean_object* x_106; lean_object* x_107; -x_105 = lean_ctor_get(x_15, 0); -x_106 = lean_ctor_get(x_15, 1); -lean_inc(x_106); -lean_inc(x_105); +lean_object* x_71; lean_object* x_72; lean_object* x_73; +x_71 = lean_ctor_get(x_15, 0); +x_72 = lean_ctor_get(x_15, 1); +lean_inc(x_72); +lean_inc(x_71); lean_dec(x_15); -x_107 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_107, 0, x_105); -lean_ctor_set(x_107, 1, x_106); -return x_107; +x_73 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_73, 0, x_71); +lean_ctor_set(x_73, 1, x_72); +return x_73; } } } else { -uint8_t x_108; +uint8_t x_74; lean_dec(x_12); lean_dec(x_10); lean_dec(x_7); @@ -1062,51 +970,51 @@ lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_108 = !lean_is_exclusive(x_13); -if (x_108 == 0) +x_74 = !lean_is_exclusive(x_13); +if (x_74 == 0) { return x_13; } else { -lean_object* x_109; lean_object* x_110; lean_object* x_111; -x_109 = lean_ctor_get(x_13, 0); -x_110 = lean_ctor_get(x_13, 1); -lean_inc(x_110); -lean_inc(x_109); +lean_object* x_75; lean_object* x_76; lean_object* x_77; +x_75 = lean_ctor_get(x_13, 0); +x_76 = lean_ctor_get(x_13, 1); +lean_inc(x_76); +lean_inc(x_75); lean_dec(x_13); -x_111 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_111, 0, x_109); -lean_ctor_set(x_111, 1, x_110); -return x_111; +x_77 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_77, 0, x_75); +lean_ctor_set(x_77, 1, x_76); +return x_77; } } } else { -uint8_t x_112; +uint8_t x_78; lean_dec(x_7); lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_112 = !lean_is_exclusive(x_9); -if (x_112 == 0) +x_78 = !lean_is_exclusive(x_9); +if (x_78 == 0) { return x_9; } else { -lean_object* x_113; lean_object* x_114; lean_object* x_115; -x_113 = lean_ctor_get(x_9, 0); -x_114 = lean_ctor_get(x_9, 1); -lean_inc(x_114); -lean_inc(x_113); +lean_object* x_79; lean_object* x_80; lean_object* x_81; +x_79 = lean_ctor_get(x_9, 0); +x_80 = lean_ctor_get(x_9, 1); +lean_inc(x_80); +lean_inc(x_79); lean_dec(x_9); -x_115 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_115, 0, x_113); -lean_ctor_set(x_115, 1, x_114); -return x_115; +x_81 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_81, 0, x_79); +lean_ctor_set(x_81, 1, x_80); +return x_81; } } } diff --git a/stage0/stdlib/Init/Lean/Meta/Tactic/Intro.c b/stage0/stdlib/Init/Lean/Meta/Tactic/Intro.c index a67e742efa..9ddddbe08c 100644 --- a/stage0/stdlib/Init/Lean/Meta/Tactic/Intro.c +++ b/stage0/stdlib/Init/Lean/Meta/Tactic/Intro.c @@ -59,7 +59,6 @@ lean_object* l_Lean_Meta_introNCore___rarg___lambda__2___boxed(lean_object*, lea lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Lean_Meta_introNCoreAux___main___rarg___lambda__1___closed__3; lean_object* l_Lean_Meta_introNCore___rarg___lambda__2___closed__1; -lean_object* l_Lean_MetavarContext_assignExpr(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_introNCore(lean_object*); lean_object* l_Lean_Meta_mkFreshId___rarg(lean_object*); lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_introN___spec__4___lambda__1(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -76,6 +75,7 @@ lean_object* lean_local_ctx_mk_local_decl(lean_object*, lean_object*, lean_objec lean_object* l_Array_umapMAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_introNCore___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_introNCoreAux___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkAuxName___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -188,146 +188,103 @@ lean_inc(x_9); x_10 = lean_ctor_get(x_8, 1); lean_inc(x_10); lean_dec(x_8); +lean_inc(x_5); lean_inc(x_9); lean_inc(x_2); x_11 = l_Lean_Meta_mkLambda(x_2, x_9, x_5, x_10); if (lean_obj_tag(x_11) == 0) { -uint8_t x_12; -x_12 = !lean_is_exclusive(x_11); -if (x_12 == 0) -{ -lean_object* x_13; uint8_t x_14; +lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); x_13 = lean_ctor_get(x_11, 1); -x_14 = !lean_is_exclusive(x_13); -if (x_14 == 0) +lean_inc(x_13); +lean_dec(x_11); +x_14 = l_Lean_Meta_assignExprMVar(x_3, x_12, x_5, x_13); +lean_dec(x_5); +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; -x_15 = lean_ctor_get(x_11, 0); -x_16 = lean_ctor_get(x_13, 1); -x_17 = l_Lean_MetavarContext_assignExpr(x_16, x_3, x_15); -lean_ctor_set(x_13, 1, x_17); -x_18 = l_Lean_Expr_mvarId_x21(x_9); +uint8_t x_15; +x_15 = !lean_is_exclusive(x_14); +if (x_15 == 0) +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_14, 0); +lean_dec(x_16); +x_17 = l_Lean_Expr_mvarId_x21(x_9); lean_dec(x_9); -x_19 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_19, 0, x_2); -lean_ctor_set(x_19, 1, x_18); -lean_ctor_set(x_11, 0, x_19); -return x_11; +x_18 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_18, 0, x_2); +lean_ctor_set(x_18, 1, x_17); +lean_ctor_set(x_14, 0, x_18); +return x_14; } else { -lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; -x_20 = lean_ctor_get(x_11, 0); -x_21 = lean_ctor_get(x_13, 0); -x_22 = lean_ctor_get(x_13, 1); -x_23 = lean_ctor_get(x_13, 2); -x_24 = lean_ctor_get(x_13, 3); -x_25 = lean_ctor_get(x_13, 4); -x_26 = lean_ctor_get(x_13, 5); -lean_inc(x_26); +lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_19 = lean_ctor_get(x_14, 1); +lean_inc(x_19); +lean_dec(x_14); +x_20 = l_Lean_Expr_mvarId_x21(x_9); +lean_dec(x_9); +x_21 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_21, 0, x_2); +lean_ctor_set(x_21, 1, x_20); +x_22 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_22, 0, x_21); +lean_ctor_set(x_22, 1, x_19); +return x_22; +} +} +else +{ +uint8_t x_23; +lean_dec(x_9); +lean_dec(x_2); +x_23 = !lean_is_exclusive(x_14); +if (x_23 == 0) +{ +return x_14; +} +else +{ +lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_24 = lean_ctor_get(x_14, 0); +x_25 = lean_ctor_get(x_14, 1); lean_inc(x_25); lean_inc(x_24); -lean_inc(x_23); -lean_inc(x_22); -lean_inc(x_21); -lean_dec(x_13); -x_27 = l_Lean_MetavarContext_assignExpr(x_22, x_3, x_20); -x_28 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_28, 0, x_21); -lean_ctor_set(x_28, 1, x_27); -lean_ctor_set(x_28, 2, x_23); -lean_ctor_set(x_28, 3, x_24); -lean_ctor_set(x_28, 4, x_25); -lean_ctor_set(x_28, 5, x_26); -x_29 = l_Lean_Expr_mvarId_x21(x_9); -lean_dec(x_9); -x_30 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_30, 0, x_2); -lean_ctor_set(x_30, 1, x_29); -lean_ctor_set(x_11, 1, x_28); -lean_ctor_set(x_11, 0, x_30); -return x_11; +lean_dec(x_14); +x_26 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_26, 0, x_24); +lean_ctor_set(x_26, 1, x_25); +return x_26; +} } } else { -lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; -x_31 = lean_ctor_get(x_11, 1); -x_32 = lean_ctor_get(x_11, 0); -lean_inc(x_31); -lean_inc(x_32); -lean_dec(x_11); -x_33 = lean_ctor_get(x_31, 0); -lean_inc(x_33); -x_34 = lean_ctor_get(x_31, 1); -lean_inc(x_34); -x_35 = lean_ctor_get(x_31, 2); -lean_inc(x_35); -x_36 = lean_ctor_get(x_31, 3); -lean_inc(x_36); -x_37 = lean_ctor_get(x_31, 4); -lean_inc(x_37); -x_38 = lean_ctor_get(x_31, 5); -lean_inc(x_38); -if (lean_is_exclusive(x_31)) { - lean_ctor_release(x_31, 0); - lean_ctor_release(x_31, 1); - lean_ctor_release(x_31, 2); - lean_ctor_release(x_31, 3); - lean_ctor_release(x_31, 4); - lean_ctor_release(x_31, 5); - x_39 = x_31; -} else { - lean_dec_ref(x_31); - x_39 = lean_box(0); -} -x_40 = l_Lean_MetavarContext_assignExpr(x_34, x_3, x_32); -if (lean_is_scalar(x_39)) { - x_41 = lean_alloc_ctor(0, 6, 0); -} else { - x_41 = x_39; -} -lean_ctor_set(x_41, 0, x_33); -lean_ctor_set(x_41, 1, x_40); -lean_ctor_set(x_41, 2, x_35); -lean_ctor_set(x_41, 3, x_36); -lean_ctor_set(x_41, 4, x_37); -lean_ctor_set(x_41, 5, x_38); -x_42 = l_Lean_Expr_mvarId_x21(x_9); -lean_dec(x_9); -x_43 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_43, 0, x_2); -lean_ctor_set(x_43, 1, x_42); -x_44 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_44, 0, x_43); -lean_ctor_set(x_44, 1, x_41); -return x_44; -} -} -else -{ -uint8_t x_45; +uint8_t x_27; lean_dec(x_9); +lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); -x_45 = !lean_is_exclusive(x_11); -if (x_45 == 0) +x_27 = !lean_is_exclusive(x_11); +if (x_27 == 0) { return x_11; } else { -lean_object* x_46; lean_object* x_47; lean_object* x_48; -x_46 = lean_ctor_get(x_11, 0); -x_47 = lean_ctor_get(x_11, 1); -lean_inc(x_47); -lean_inc(x_46); +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_11, 0); +x_29 = lean_ctor_get(x_11, 1); +lean_inc(x_29); +lean_inc(x_28); lean_dec(x_11); -x_48 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_48, 0, x_46); -lean_ctor_set(x_48, 1, x_47); -return x_48; +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; } } } diff --git a/stage0/stdlib/Init/Lean/Meta/Tactic/Subst.c b/stage0/stdlib/Init/Lean/Meta/Tactic/Subst.c index c144bbf378..ac3ea010dc 100644 --- a/stage0/stdlib/Init/Lean/Meta/Tactic/Subst.c +++ b/stage0/stdlib/Init/Lean/Meta/Tactic/Subst.c @@ -66,7 +66,6 @@ lean_object* l_Lean_Meta_substCore___lambda__3___closed__19; lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Lean_Meta_revert(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkEqNDRec(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_MetavarContext_assignExpr(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_substCore___lambda__3___closed__10; lean_object* l_Lean_Meta_subst___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_findSomeMAux___main___at_Lean_Meta_subst___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -81,6 +80,7 @@ lean_object* l___private_Init_Lean_Meta_Tactic_Subst_1__regTraceClasses___closed lean_object* l_Lean_LocalDecl_type(lean_object*); lean_object* l_Lean_MetavarContext_exprDependsOn(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_substCore___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withLocalDecl___rarg(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_subst___lambda__1___closed__3; @@ -198,20 +198,20 @@ lean_inc(x_1); x_16 = l_Lean_Meta_getLocalDecl(x_1, x_13, x_14); if (lean_obj_tag(x_16) == 0) { -lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_371; lean_object* x_372; uint8_t x_373; +lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_260; lean_object* x_261; uint8_t x_262; x_17 = lean_ctor_get(x_16, 0); lean_inc(x_17); x_18 = lean_ctor_get(x_16, 1); lean_inc(x_18); lean_dec(x_16); -x_371 = l_Lean_LocalDecl_type(x_17); +x_260 = l_Lean_LocalDecl_type(x_17); lean_dec(x_17); -x_372 = lean_unsigned_to_nat(3u); -x_373 = l_Lean_Expr_isAppOfArity___main(x_371, x_11, x_372); -if (x_373 == 0) +x_261 = lean_unsigned_to_nat(3u); +x_262 = l_Lean_Expr_isAppOfArity___main(x_260, x_11, x_261); +if (x_262 == 0) { -lean_object* x_374; lean_object* x_375; lean_object* x_376; -lean_dec(x_371); +lean_object* x_263; lean_object* x_264; lean_object* x_265; +lean_dec(x_260); lean_dec(x_15); lean_dec(x_10); lean_dec(x_9); @@ -221,45 +221,45 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_374 = l_Lean_Meta_isClassQuick___main___closed__1; -x_375 = l_unreachable_x21___rarg(x_374); -x_376 = lean_apply_2(x_375, x_13, x_18); -return x_376; +x_263 = l_Lean_Meta_isClassQuick___main___closed__1; +x_264 = l_unreachable_x21___rarg(x_263); +x_265 = lean_apply_2(x_264, x_13, x_18); +return x_265; } else { -lean_object* x_377; lean_object* x_378; -x_377 = lean_unsigned_to_nat(0u); -x_378 = l_Lean_Expr_getAppNumArgsAux___main(x_371, x_377); +lean_object* x_266; lean_object* x_267; +x_266 = lean_unsigned_to_nat(0u); +x_267 = l_Lean_Expr_getAppNumArgsAux___main(x_260, x_266); if (x_8 == 0) { -lean_object* x_379; lean_object* x_380; lean_object* x_381; lean_object* x_382; lean_object* x_383; -x_379 = lean_unsigned_to_nat(2u); -x_380 = lean_nat_sub(x_378, x_379); -lean_dec(x_378); -x_381 = lean_unsigned_to_nat(1u); -x_382 = lean_nat_sub(x_380, x_381); -lean_dec(x_380); -x_383 = l_Lean_Expr_getRevArg_x21___main(x_371, x_382); -lean_dec(x_371); -x_19 = x_383; -goto block_370; +lean_object* x_268; lean_object* x_269; lean_object* x_270; lean_object* x_271; lean_object* x_272; +x_268 = lean_unsigned_to_nat(2u); +x_269 = lean_nat_sub(x_267, x_268); +lean_dec(x_267); +x_270 = lean_unsigned_to_nat(1u); +x_271 = lean_nat_sub(x_269, x_270); +lean_dec(x_269); +x_272 = l_Lean_Expr_getRevArg_x21___main(x_260, x_271); +lean_dec(x_260); +x_19 = x_272; +goto block_259; } else { -lean_object* x_384; lean_object* x_385; lean_object* x_386; lean_object* x_387; -x_384 = lean_unsigned_to_nat(1u); -x_385 = lean_nat_sub(x_378, x_384); -lean_dec(x_378); -x_386 = lean_nat_sub(x_385, x_384); -lean_dec(x_385); -x_387 = l_Lean_Expr_getRevArg_x21___main(x_371, x_386); -lean_dec(x_371); -x_19 = x_387; -goto block_370; +lean_object* x_273; lean_object* x_274; lean_object* x_275; lean_object* x_276; +x_273 = lean_unsigned_to_nat(1u); +x_274 = lean_nat_sub(x_267, x_273); +lean_dec(x_267); +x_275 = lean_nat_sub(x_274, x_273); +lean_dec(x_274); +x_276 = l_Lean_Expr_getRevArg_x21___main(x_260, x_275); +lean_dec(x_260); +x_19 = x_276; +goto block_259; } } -block_370: +block_259: { lean_object* x_20; lean_object* x_21; uint8_t x_22; x_20 = lean_ctor_get(x_18, 1); @@ -294,24 +294,24 @@ lean_dec(x_19); lean_dec(x_28); if (x_8 == 0) { -lean_object* x_126; +lean_object* x_89; lean_inc(x_13); -x_126 = l_Lean_Meta_mkEqSymm(x_9, x_13, x_27); -if (lean_obj_tag(x_126) == 0) +x_89 = l_Lean_Meta_mkEqSymm(x_9, x_13, x_27); +if (lean_obj_tag(x_89) == 0) { -lean_object* x_127; lean_object* x_128; -x_127 = lean_ctor_get(x_126, 0); -lean_inc(x_127); -x_128 = lean_ctor_get(x_126, 1); -lean_inc(x_128); -lean_dec(x_126); -x_30 = x_127; -x_31 = x_128; -goto block_125; +lean_object* x_90; lean_object* x_91; +x_90 = lean_ctor_get(x_89, 0); +lean_inc(x_90); +x_91 = lean_ctor_get(x_89, 1); +lean_inc(x_91); +lean_dec(x_89); +x_30 = x_90; +x_31 = x_91; +goto block_88; } else { -uint8_t x_129; +uint8_t x_92; lean_dec(x_29); lean_dec(x_26); lean_dec(x_13); @@ -320,23 +320,23 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_1); -x_129 = !lean_is_exclusive(x_126); -if (x_129 == 0) +x_92 = !lean_is_exclusive(x_89); +if (x_92 == 0) { -return x_126; +return x_89; } else { -lean_object* x_130; lean_object* x_131; lean_object* x_132; -x_130 = lean_ctor_get(x_126, 0); -x_131 = lean_ctor_get(x_126, 1); -lean_inc(x_131); -lean_inc(x_130); -lean_dec(x_126); -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; +lean_object* x_93; lean_object* x_94; lean_object* x_95; +x_93 = lean_ctor_get(x_89, 0); +x_94 = lean_ctor_get(x_89, 1); +lean_inc(x_94); +lean_inc(x_93); +lean_dec(x_89); +x_95 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_95, 0, x_93); +lean_ctor_set(x_95, 1, x_94); +return x_95; } } } @@ -344,9 +344,9 @@ else { x_30 = x_9; x_31 = x_27; -goto block_125; +goto block_88; } -block_125: +block_88: { uint8_t x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; x_32 = 2; @@ -362,391 +362,245 @@ lean_inc(x_34); x_36 = l_Lean_Meta_mkEqNDRec(x_26, x_34, x_30, x_13, x_35); if (lean_obj_tag(x_36) == 0) { -lean_object* x_37; lean_object* x_38; uint8_t x_39; -x_37 = lean_ctor_get(x_36, 1); +lean_object* x_37; lean_object* x_38; lean_object* x_39; +x_37 = lean_ctor_get(x_36, 0); lean_inc(x_37); -x_38 = lean_ctor_get(x_36, 0); +x_38 = lean_ctor_get(x_36, 1); lean_inc(x_38); lean_dec(x_36); -x_39 = !lean_is_exclusive(x_37); -if (x_39 == 0) +x_39 = l_Lean_Meta_assignExprMVar(x_4, x_37, x_13, x_38); +if (lean_obj_tag(x_39) == 0) { -lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; -x_40 = lean_ctor_get(x_37, 1); -x_41 = l_Lean_MetavarContext_assignExpr(x_40, x_4, x_38); -lean_ctor_set(x_37, 1, x_41); -x_42 = l_Lean_Expr_mvarId_x21(x_34); +lean_object* x_40; lean_object* x_41; lean_object* x_42; +x_40 = lean_ctor_get(x_39, 1); +lean_inc(x_40); +lean_dec(x_39); +x_41 = l_Lean_Expr_mvarId_x21(x_34); lean_dec(x_34); -x_43 = l_Lean_Meta_clear(x_42, x_1, x_13, x_37); -if (lean_obj_tag(x_43) == 0) +x_42 = l_Lean_Meta_clear(x_41, x_1, x_13, x_40); +if (lean_obj_tag(x_42) == 0) { -lean_object* x_44; lean_object* x_45; lean_object* x_46; -x_44 = lean_ctor_get(x_43, 0); +lean_object* x_43; lean_object* x_44; lean_object* x_45; +x_43 = lean_ctor_get(x_42, 0); +lean_inc(x_43); +x_44 = lean_ctor_get(x_42, 1); lean_inc(x_44); -x_45 = lean_ctor_get(x_43, 1); -lean_inc(x_45); -lean_dec(x_43); -x_46 = l_Lean_Meta_clear(x_44, x_5, x_13, x_45); -if (lean_obj_tag(x_46) == 0) +lean_dec(x_42); +x_45 = l_Lean_Meta_clear(x_43, x_5, x_13, x_44); +if (lean_obj_tag(x_45) == 0) { -lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; uint8_t x_52; lean_object* x_53; -x_47 = lean_ctor_get(x_46, 0); +lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; uint8_t x_51; lean_object* x_52; +x_46 = lean_ctor_get(x_45, 0); +lean_inc(x_46); +x_47 = lean_ctor_get(x_45, 1); lean_inc(x_47); -x_48 = lean_ctor_get(x_46, 1); -lean_inc(x_48); -lean_dec(x_46); -x_49 = lean_array_get_size(x_6); -x_50 = lean_unsigned_to_nat(2u); -x_51 = lean_nat_sub(x_49, x_50); -lean_dec(x_49); -x_52 = 0; -x_53 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_52, x_47, x_51, x_7, x_13, x_48); +lean_dec(x_45); +x_48 = lean_array_get_size(x_6); +x_49 = lean_unsigned_to_nat(2u); +x_50 = lean_nat_sub(x_48, x_49); +lean_dec(x_48); +x_51 = 0; +x_52 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_51, x_46, x_50, x_7, x_13, x_47); lean_dec(x_13); -if (lean_obj_tag(x_53) == 0) +if (lean_obj_tag(x_52) == 0) { -uint8_t x_54; -x_54 = !lean_is_exclusive(x_53); -if (x_54 == 0) +uint8_t x_53; +x_53 = !lean_is_exclusive(x_52); +if (x_53 == 0) { -lean_object* x_55; uint8_t x_56; -x_55 = lean_ctor_get(x_53, 0); -x_56 = !lean_is_exclusive(x_55); -if (x_56 == 0) +lean_object* x_54; uint8_t x_55; +x_54 = lean_ctor_get(x_52, 0); +x_55 = !lean_is_exclusive(x_54); +if (x_55 == 0) { -lean_object* x_57; lean_object* x_58; -x_57 = lean_ctor_get(x_55, 0); -lean_dec(x_57); -x_58 = lean_box(0); -lean_ctor_set(x_55, 0, x_58); -return x_53; +lean_object* x_56; lean_object* x_57; +x_56 = lean_ctor_get(x_54, 0); +lean_dec(x_56); +x_57 = lean_box(0); +lean_ctor_set(x_54, 0, x_57); +return x_52; } else { -lean_object* x_59; lean_object* x_60; lean_object* x_61; -x_59 = lean_ctor_get(x_55, 1); -lean_inc(x_59); -lean_dec(x_55); -x_60 = lean_box(0); -x_61 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_61, 0, x_60); -lean_ctor_set(x_61, 1, x_59); -lean_ctor_set(x_53, 0, x_61); -return x_53; +lean_object* x_58; lean_object* x_59; lean_object* x_60; +x_58 = lean_ctor_get(x_54, 1); +lean_inc(x_58); +lean_dec(x_54); +x_59 = lean_box(0); +x_60 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_60, 0, x_59); +lean_ctor_set(x_60, 1, x_58); +lean_ctor_set(x_52, 0, x_60); +return x_52; } } else { -lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; -x_62 = lean_ctor_get(x_53, 0); -x_63 = lean_ctor_get(x_53, 1); -lean_inc(x_63); +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; +x_61 = lean_ctor_get(x_52, 0); +x_62 = lean_ctor_get(x_52, 1); lean_inc(x_62); -lean_dec(x_53); -x_64 = lean_ctor_get(x_62, 1); -lean_inc(x_64); -if (lean_is_exclusive(x_62)) { - lean_ctor_release(x_62, 0); - lean_ctor_release(x_62, 1); - x_65 = x_62; +lean_inc(x_61); +lean_dec(x_52); +x_63 = lean_ctor_get(x_61, 1); +lean_inc(x_63); +if (lean_is_exclusive(x_61)) { + lean_ctor_release(x_61, 0); + lean_ctor_release(x_61, 1); + x_64 = x_61; } else { - lean_dec_ref(x_62); - x_65 = lean_box(0); + lean_dec_ref(x_61); + x_64 = lean_box(0); } -x_66 = lean_box(0); -if (lean_is_scalar(x_65)) { - x_67 = lean_alloc_ctor(0, 2, 0); +x_65 = lean_box(0); +if (lean_is_scalar(x_64)) { + x_66 = lean_alloc_ctor(0, 2, 0); } else { - x_67 = x_65; + x_66 = x_64; } +lean_ctor_set(x_66, 0, x_65); +lean_ctor_set(x_66, 1, x_63); +x_67 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_67, 0, x_66); -lean_ctor_set(x_67, 1, x_64); -x_68 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_68, 0, x_67); -lean_ctor_set(x_68, 1, x_63); -return x_68; +lean_ctor_set(x_67, 1, x_62); +return x_67; } } else { -uint8_t x_69; -x_69 = !lean_is_exclusive(x_53); -if (x_69 == 0) +uint8_t x_68; +x_68 = !lean_is_exclusive(x_52); +if (x_68 == 0) { -return x_53; +return x_52; } else { -lean_object* x_70; lean_object* x_71; lean_object* x_72; -x_70 = lean_ctor_get(x_53, 0); -x_71 = lean_ctor_get(x_53, 1); -lean_inc(x_71); +lean_object* x_69; lean_object* x_70; lean_object* x_71; +x_69 = lean_ctor_get(x_52, 0); +x_70 = lean_ctor_get(x_52, 1); lean_inc(x_70); -lean_dec(x_53); -x_72 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_72, 0, x_70); -lean_ctor_set(x_72, 1, x_71); -return x_72; +lean_inc(x_69); +lean_dec(x_52); +x_71 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_71, 0, x_69); +lean_ctor_set(x_71, 1, x_70); +return x_71; } } } else { -uint8_t x_73; +uint8_t x_72; lean_dec(x_13); lean_dec(x_7); -x_73 = !lean_is_exclusive(x_46); -if (x_73 == 0) +x_72 = !lean_is_exclusive(x_45); +if (x_72 == 0) { -return x_46; +return x_45; } else { -lean_object* x_74; lean_object* x_75; lean_object* x_76; -x_74 = lean_ctor_get(x_46, 0); -x_75 = lean_ctor_get(x_46, 1); -lean_inc(x_75); +lean_object* x_73; lean_object* x_74; lean_object* x_75; +x_73 = lean_ctor_get(x_45, 0); +x_74 = lean_ctor_get(x_45, 1); lean_inc(x_74); -lean_dec(x_46); -x_76 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_76, 0, x_74); -lean_ctor_set(x_76, 1, x_75); -return x_76; +lean_inc(x_73); +lean_dec(x_45); +x_75 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_75, 0, x_73); +lean_ctor_set(x_75, 1, x_74); +return x_75; } } } else { -uint8_t x_77; +uint8_t x_76; lean_dec(x_13); lean_dec(x_7); lean_dec(x_5); -x_77 = !lean_is_exclusive(x_43); -if (x_77 == 0) +x_76 = !lean_is_exclusive(x_42); +if (x_76 == 0) { -return x_43; +return x_42; } else { -lean_object* x_78; lean_object* x_79; lean_object* x_80; -x_78 = lean_ctor_get(x_43, 0); -x_79 = lean_ctor_get(x_43, 1); -lean_inc(x_79); +lean_object* x_77; lean_object* x_78; lean_object* x_79; +x_77 = lean_ctor_get(x_42, 0); +x_78 = lean_ctor_get(x_42, 1); lean_inc(x_78); -lean_dec(x_43); -x_80 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_80, 0, x_78); -lean_ctor_set(x_80, 1, x_79); -return x_80; +lean_inc(x_77); +lean_dec(x_42); +x_79 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_79, 0, x_77); +lean_ctor_set(x_79, 1, x_78); +return x_79; } } } else { -lean_object* x_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_81 = lean_ctor_get(x_37, 0); -x_82 = lean_ctor_get(x_37, 1); -x_83 = lean_ctor_get(x_37, 2); -x_84 = lean_ctor_get(x_37, 3); -x_85 = lean_ctor_get(x_37, 4); -x_86 = lean_ctor_get(x_37, 5); -lean_inc(x_86); -lean_inc(x_85); -lean_inc(x_84); -lean_inc(x_83); +uint8_t x_80; +lean_dec(x_34); +lean_dec(x_13); +lean_dec(x_7); +lean_dec(x_5); +lean_dec(x_1); +x_80 = !lean_is_exclusive(x_39); +if (x_80 == 0) +{ +return x_39; +} +else +{ +lean_object* x_81; lean_object* x_82; lean_object* x_83; +x_81 = lean_ctor_get(x_39, 0); +x_82 = lean_ctor_get(x_39, 1); lean_inc(x_82); lean_inc(x_81); -lean_dec(x_37); -x_87 = l_Lean_MetavarContext_assignExpr(x_82, x_4, x_38); -x_88 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_88, 0, x_81); -lean_ctor_set(x_88, 1, x_87); -lean_ctor_set(x_88, 2, x_83); -lean_ctor_set(x_88, 3, x_84); -lean_ctor_set(x_88, 4, x_85); -lean_ctor_set(x_88, 5, x_86); -x_89 = l_Lean_Expr_mvarId_x21(x_34); -lean_dec(x_34); -x_90 = l_Lean_Meta_clear(x_89, x_1, x_13, x_88); -if (lean_obj_tag(x_90) == 0) -{ -lean_object* x_91; lean_object* x_92; lean_object* x_93; -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); -x_93 = l_Lean_Meta_clear(x_91, x_5, x_13, x_92); -if (lean_obj_tag(x_93) == 0) -{ -lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; uint8_t x_99; lean_object* x_100; -x_94 = lean_ctor_get(x_93, 0); -lean_inc(x_94); -x_95 = lean_ctor_get(x_93, 1); -lean_inc(x_95); -lean_dec(x_93); -x_96 = lean_array_get_size(x_6); -x_97 = lean_unsigned_to_nat(2u); -x_98 = lean_nat_sub(x_96, x_97); -lean_dec(x_96); -x_99 = 0; -x_100 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_99, x_94, x_98, x_7, x_13, x_95); -lean_dec(x_13); -if (lean_obj_tag(x_100) == 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_object* x_107; lean_object* x_108; -x_101 = lean_ctor_get(x_100, 0); -lean_inc(x_101); -x_102 = lean_ctor_get(x_100, 1); -lean_inc(x_102); -if (lean_is_exclusive(x_100)) { - lean_ctor_release(x_100, 0); - lean_ctor_release(x_100, 1); - x_103 = x_100; -} else { - lean_dec_ref(x_100); - x_103 = lean_box(0); -} -x_104 = lean_ctor_get(x_101, 1); -lean_inc(x_104); -if (lean_is_exclusive(x_101)) { - lean_ctor_release(x_101, 0); - lean_ctor_release(x_101, 1); - x_105 = x_101; -} else { - lean_dec_ref(x_101); - x_105 = lean_box(0); -} -x_106 = lean_box(0); -if (lean_is_scalar(x_105)) { - x_107 = lean_alloc_ctor(0, 2, 0); -} else { - x_107 = x_105; -} -lean_ctor_set(x_107, 0, x_106); -lean_ctor_set(x_107, 1, x_104); -if (lean_is_scalar(x_103)) { - x_108 = lean_alloc_ctor(0, 2, 0); -} else { - x_108 = x_103; -} -lean_ctor_set(x_108, 0, x_107); -lean_ctor_set(x_108, 1, x_102); -return x_108; -} -else -{ -lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; -x_109 = lean_ctor_get(x_100, 0); -lean_inc(x_109); -x_110 = lean_ctor_get(x_100, 1); -lean_inc(x_110); -if (lean_is_exclusive(x_100)) { - lean_ctor_release(x_100, 0); - lean_ctor_release(x_100, 1); - x_111 = x_100; -} else { - lean_dec_ref(x_100); - x_111 = lean_box(0); -} -if (lean_is_scalar(x_111)) { - x_112 = lean_alloc_ctor(1, 2, 0); -} else { - x_112 = x_111; -} -lean_ctor_set(x_112, 0, x_109); -lean_ctor_set(x_112, 1, x_110); -return x_112; -} -} -else -{ -lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; -lean_dec(x_13); -lean_dec(x_7); -x_113 = lean_ctor_get(x_93, 0); -lean_inc(x_113); -x_114 = lean_ctor_get(x_93, 1); -lean_inc(x_114); -if (lean_is_exclusive(x_93)) { - lean_ctor_release(x_93, 0); - lean_ctor_release(x_93, 1); - x_115 = x_93; -} else { - lean_dec_ref(x_93); - x_115 = lean_box(0); -} -if (lean_is_scalar(x_115)) { - x_116 = lean_alloc_ctor(1, 2, 0); -} else { - x_116 = x_115; -} -lean_ctor_set(x_116, 0, x_113); -lean_ctor_set(x_116, 1, x_114); -return x_116; -} -} -else -{ -lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; -lean_dec(x_13); -lean_dec(x_7); -lean_dec(x_5); -x_117 = lean_ctor_get(x_90, 0); -lean_inc(x_117); -x_118 = lean_ctor_get(x_90, 1); -lean_inc(x_118); -if (lean_is_exclusive(x_90)) { - lean_ctor_release(x_90, 0); - lean_ctor_release(x_90, 1); - x_119 = x_90; -} else { - lean_dec_ref(x_90); - x_119 = lean_box(0); -} -if (lean_is_scalar(x_119)) { - x_120 = lean_alloc_ctor(1, 2, 0); -} else { - x_120 = x_119; -} -lean_ctor_set(x_120, 0, x_117); -lean_ctor_set(x_120, 1, x_118); -return x_120; +lean_dec(x_39); +x_83 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_83, 0, x_81); +lean_ctor_set(x_83, 1, x_82); +return x_83; } } } else { -uint8_t x_121; +uint8_t x_84; lean_dec(x_34); lean_dec(x_13); lean_dec(x_7); lean_dec(x_5); lean_dec(x_4); lean_dec(x_1); -x_121 = !lean_is_exclusive(x_36); -if (x_121 == 0) +x_84 = !lean_is_exclusive(x_36); +if (x_84 == 0) { return x_36; } else { -lean_object* x_122; lean_object* x_123; lean_object* x_124; -x_122 = lean_ctor_get(x_36, 0); -x_123 = lean_ctor_get(x_36, 1); -lean_inc(x_123); -lean_inc(x_122); +lean_object* x_85; lean_object* x_86; lean_object* x_87; +x_85 = lean_ctor_get(x_36, 0); +x_86 = lean_ctor_get(x_36, 1); +lean_inc(x_86); +lean_inc(x_85); lean_dec(x_36); -x_124 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_124, 0, x_122); -lean_ctor_set(x_124, 1, x_123); -return x_124; +x_87 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_87, 0, x_85); +lean_ctor_set(x_87, 1, x_86); +return x_87; } } } } else { -uint8_t x_133; +uint8_t x_96; lean_dec(x_24); lean_dec(x_19); lean_dec(x_15); @@ -757,524 +611,378 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_1); -x_133 = !lean_is_exclusive(x_25); -if (x_133 == 0) +x_96 = !lean_is_exclusive(x_25); +if (x_96 == 0) { return x_25; } else { -lean_object* x_134; lean_object* x_135; lean_object* x_136; -x_134 = lean_ctor_get(x_25, 0); -x_135 = lean_ctor_get(x_25, 1); -lean_inc(x_135); -lean_inc(x_134); +lean_object* x_97; lean_object* x_98; lean_object* x_99; +x_97 = lean_ctor_get(x_25, 0); +x_98 = lean_ctor_get(x_25, 1); +lean_inc(x_98); +lean_inc(x_97); lean_dec(x_25); -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; +x_99 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_99, 0, x_97); +lean_ctor_set(x_99, 1, x_98); +return x_99; } } } else { -lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; lean_object* x_141; -x_137 = l_Lean_mkOptionalNode___closed__2; +lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; +x_100 = l_Lean_mkOptionalNode___closed__2; lean_inc(x_2); -x_138 = lean_array_push(x_137, x_2); -x_139 = lean_expr_abstract(x_15, x_138); -lean_dec(x_138); -x_140 = lean_expr_instantiate1(x_139, x_19); -lean_dec(x_139); +x_101 = lean_array_push(x_100, x_2); +x_102 = lean_expr_abstract(x_15, x_101); +lean_dec(x_101); +x_103 = lean_expr_instantiate1(x_102, x_19); +lean_dec(x_102); lean_inc(x_13); lean_inc(x_19); -x_141 = l_Lean_Meta_mkEqRefl(x_19, x_13, x_18); -if (lean_obj_tag(x_141) == 0) +x_104 = l_Lean_Meta_mkEqRefl(x_19, x_13, x_18); +if (lean_obj_tag(x_104) == 0) { -lean_object* x_142; lean_object* x_143; lean_object* x_144; lean_object* x_145; lean_object* x_146; -x_142 = lean_ctor_get(x_141, 0); -lean_inc(x_142); -x_143 = lean_ctor_get(x_141, 1); -lean_inc(x_143); -lean_dec(x_141); +lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; +x_105 = lean_ctor_get(x_104, 0); +lean_inc(x_105); +x_106 = lean_ctor_get(x_104, 1); +lean_inc(x_106); +lean_dec(x_104); lean_inc(x_9); -x_144 = lean_array_push(x_137, x_9); -x_145 = lean_expr_abstract(x_140, x_144); -lean_dec(x_140); -x_146 = lean_expr_instantiate1(x_145, x_142); -lean_dec(x_142); -lean_dec(x_145); +x_107 = lean_array_push(x_100, x_9); +x_108 = lean_expr_abstract(x_103, x_107); +lean_dec(x_103); +x_109 = lean_expr_instantiate1(x_108, x_105); +lean_dec(x_105); +lean_dec(x_108); if (x_8 == 0) { -lean_object* x_147; +lean_object* x_110; lean_inc(x_13); lean_inc(x_2); -x_147 = l_Lean_Meta_mkEq(x_19, x_2, x_13, x_143); -if (lean_obj_tag(x_147) == 0) +x_110 = l_Lean_Meta_mkEq(x_19, x_2, x_13, x_106); +if (lean_obj_tag(x_110) == 0) { -lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; uint8_t x_152; lean_object* x_153; -x_148 = lean_ctor_get(x_147, 0); +lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; uint8_t x_115; lean_object* x_116; +x_111 = lean_ctor_get(x_110, 0); +lean_inc(x_111); +x_112 = lean_ctor_get(x_110, 1); +lean_inc(x_112); +lean_dec(x_110); +x_113 = lean_alloc_closure((void*)(l_Lean_Meta_substCore___lambda__1___boxed), 7, 4); +lean_closure_set(x_113, 0, x_15); +lean_closure_set(x_113, 1, x_107); +lean_closure_set(x_113, 2, x_10); +lean_closure_set(x_113, 3, x_2); +x_114 = l_Lean_Meta_substCore___lambda__2___closed__2; +x_115 = 0; +lean_inc(x_13); +x_116 = l_Lean_Meta_withLocalDecl___rarg(x_114, x_111, x_115, x_113, x_13, x_112); +if (lean_obj_tag(x_116) == 0) +{ +lean_object* x_117; lean_object* x_118; lean_object* x_119; +x_117 = lean_ctor_get(x_116, 0); +lean_inc(x_117); +x_118 = lean_ctor_get(x_116, 1); +lean_inc(x_118); +lean_dec(x_116); +lean_inc(x_13); +x_119 = l_Lean_Meta_mkEqSymm(x_9, x_13, x_118); +if (lean_obj_tag(x_119) == 0) +{ +lean_object* x_120; lean_object* x_121; uint8_t x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; +x_120 = lean_ctor_get(x_119, 0); +lean_inc(x_120); +x_121 = lean_ctor_get(x_119, 1); +lean_inc(x_121); +lean_dec(x_119); +x_122 = 2; +lean_inc(x_13); +x_123 = l_Lean_Meta_mkFreshExprMVar(x_109, x_3, x_122, x_13, x_121); +x_124 = lean_ctor_get(x_123, 0); +lean_inc(x_124); +x_125 = lean_ctor_get(x_123, 1); +lean_inc(x_125); +lean_dec(x_123); +lean_inc(x_13); +lean_inc(x_124); +x_126 = l_Lean_Meta_mkEqRec(x_117, x_124, x_120, x_13, x_125); +if (lean_obj_tag(x_126) == 0) +{ +lean_object* x_127; lean_object* x_128; lean_object* x_129; +x_127 = lean_ctor_get(x_126, 0); +lean_inc(x_127); +x_128 = lean_ctor_get(x_126, 1); +lean_inc(x_128); +lean_dec(x_126); +x_129 = l_Lean_Meta_assignExprMVar(x_4, x_127, x_13, x_128); +if (lean_obj_tag(x_129) == 0) +{ +lean_object* x_130; lean_object* x_131; lean_object* x_132; +x_130 = lean_ctor_get(x_129, 1); +lean_inc(x_130); +lean_dec(x_129); +x_131 = l_Lean_Expr_mvarId_x21(x_124); +lean_dec(x_124); +x_132 = l_Lean_Meta_clear(x_131, x_1, x_13, x_130); +if (lean_obj_tag(x_132) == 0) +{ +lean_object* x_133; lean_object* x_134; lean_object* x_135; +x_133 = lean_ctor_get(x_132, 0); +lean_inc(x_133); +x_134 = lean_ctor_get(x_132, 1); +lean_inc(x_134); +lean_dec(x_132); +x_135 = l_Lean_Meta_clear(x_133, x_5, x_13, x_134); +if (lean_obj_tag(x_135) == 0) +{ +lean_object* x_136; lean_object* x_137; lean_object* x_138; lean_object* x_139; lean_object* x_140; uint8_t x_141; lean_object* x_142; +x_136 = lean_ctor_get(x_135, 0); +lean_inc(x_136); +x_137 = lean_ctor_get(x_135, 1); +lean_inc(x_137); +lean_dec(x_135); +x_138 = lean_array_get_size(x_6); +x_139 = lean_unsigned_to_nat(2u); +x_140 = lean_nat_sub(x_138, x_139); +lean_dec(x_138); +x_141 = 0; +x_142 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_141, x_136, x_140, x_7, x_13, x_137); +lean_dec(x_13); +if (lean_obj_tag(x_142) == 0) +{ +uint8_t x_143; +x_143 = !lean_is_exclusive(x_142); +if (x_143 == 0) +{ +lean_object* x_144; uint8_t x_145; +x_144 = lean_ctor_get(x_142, 0); +x_145 = !lean_is_exclusive(x_144); +if (x_145 == 0) +{ +lean_object* x_146; lean_object* x_147; +x_146 = lean_ctor_get(x_144, 0); +lean_dec(x_146); +x_147 = lean_box(0); +lean_ctor_set(x_144, 0, x_147); +return x_142; +} +else +{ +lean_object* x_148; lean_object* x_149; lean_object* x_150; +x_148 = lean_ctor_get(x_144, 1); lean_inc(x_148); -x_149 = lean_ctor_get(x_147, 1); -lean_inc(x_149); -lean_dec(x_147); -x_150 = lean_alloc_closure((void*)(l_Lean_Meta_substCore___lambda__1___boxed), 7, 4); -lean_closure_set(x_150, 0, x_15); -lean_closure_set(x_150, 1, x_144); -lean_closure_set(x_150, 2, x_10); -lean_closure_set(x_150, 3, x_2); -x_151 = l_Lean_Meta_substCore___lambda__2___closed__2; -x_152 = 0; -lean_inc(x_13); -x_153 = l_Lean_Meta_withLocalDecl___rarg(x_151, x_148, x_152, x_150, x_13, x_149); -if (lean_obj_tag(x_153) == 0) +lean_dec(x_144); +x_149 = lean_box(0); +x_150 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_150, 0, x_149); +lean_ctor_set(x_150, 1, x_148); +lean_ctor_set(x_142, 0, x_150); +return x_142; +} +} +else { -lean_object* x_154; lean_object* x_155; lean_object* x_156; -x_154 = lean_ctor_get(x_153, 0); -lean_inc(x_154); -x_155 = lean_ctor_get(x_153, 1); -lean_inc(x_155); -lean_dec(x_153); -lean_inc(x_13); -x_156 = l_Lean_Meta_mkEqSymm(x_9, x_13, x_155); -if (lean_obj_tag(x_156) == 0) +lean_object* x_151; lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; +x_151 = lean_ctor_get(x_142, 0); +x_152 = lean_ctor_get(x_142, 1); +lean_inc(x_152); +lean_inc(x_151); +lean_dec(x_142); +x_153 = lean_ctor_get(x_151, 1); +lean_inc(x_153); +if (lean_is_exclusive(x_151)) { + lean_ctor_release(x_151, 0); + lean_ctor_release(x_151, 1); + x_154 = x_151; +} else { + lean_dec_ref(x_151); + x_154 = lean_box(0); +} +x_155 = lean_box(0); +if (lean_is_scalar(x_154)) { + x_156 = lean_alloc_ctor(0, 2, 0); +} else { + x_156 = x_154; +} +lean_ctor_set(x_156, 0, x_155); +lean_ctor_set(x_156, 1, x_153); +x_157 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_157, 0, x_156); +lean_ctor_set(x_157, 1, x_152); +return x_157; +} +} +else { -lean_object* x_157; lean_object* x_158; uint8_t x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; -x_157 = lean_ctor_get(x_156, 0); -lean_inc(x_157); -x_158 = lean_ctor_get(x_156, 1); -lean_inc(x_158); -lean_dec(x_156); -x_159 = 2; -lean_inc(x_13); -x_160 = l_Lean_Meta_mkFreshExprMVar(x_146, x_3, x_159, x_13, x_158); -x_161 = lean_ctor_get(x_160, 0); -lean_inc(x_161); -x_162 = lean_ctor_get(x_160, 1); -lean_inc(x_162); -lean_dec(x_160); -lean_inc(x_13); -lean_inc(x_161); -x_163 = l_Lean_Meta_mkEqRec(x_154, x_161, x_157, x_13, x_162); -if (lean_obj_tag(x_163) == 0) +uint8_t x_158; +x_158 = !lean_is_exclusive(x_142); +if (x_158 == 0) { -lean_object* x_164; lean_object* x_165; uint8_t x_166; -x_164 = lean_ctor_get(x_163, 1); +return x_142; +} +else +{ +lean_object* x_159; lean_object* x_160; lean_object* x_161; +x_159 = lean_ctor_get(x_142, 0); +x_160 = lean_ctor_get(x_142, 1); +lean_inc(x_160); +lean_inc(x_159); +lean_dec(x_142); +x_161 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_161, 0, x_159); +lean_ctor_set(x_161, 1, x_160); +return x_161; +} +} +} +else +{ +uint8_t x_162; +lean_dec(x_13); +lean_dec(x_7); +x_162 = !lean_is_exclusive(x_135); +if (x_162 == 0) +{ +return x_135; +} +else +{ +lean_object* x_163; lean_object* x_164; lean_object* x_165; +x_163 = lean_ctor_get(x_135, 0); +x_164 = lean_ctor_get(x_135, 1); lean_inc(x_164); -x_165 = lean_ctor_get(x_163, 0); -lean_inc(x_165); -lean_dec(x_163); -x_166 = !lean_is_exclusive(x_164); +lean_inc(x_163); +lean_dec(x_135); +x_165 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_165, 0, x_163); +lean_ctor_set(x_165, 1, x_164); +return x_165; +} +} +} +else +{ +uint8_t x_166; +lean_dec(x_13); +lean_dec(x_7); +lean_dec(x_5); +x_166 = !lean_is_exclusive(x_132); if (x_166 == 0) { -lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; -x_167 = lean_ctor_get(x_164, 1); -x_168 = l_Lean_MetavarContext_assignExpr(x_167, x_4, x_165); -lean_ctor_set(x_164, 1, x_168); -x_169 = l_Lean_Expr_mvarId_x21(x_161); -lean_dec(x_161); -x_170 = l_Lean_Meta_clear(x_169, x_1, x_13, x_164); -if (lean_obj_tag(x_170) == 0) +return x_132; +} +else +{ +lean_object* x_167; lean_object* x_168; lean_object* x_169; +x_167 = lean_ctor_get(x_132, 0); +x_168 = lean_ctor_get(x_132, 1); +lean_inc(x_168); +lean_inc(x_167); +lean_dec(x_132); +x_169 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_169, 0, x_167); +lean_ctor_set(x_169, 1, x_168); +return x_169; +} +} +} +else +{ +uint8_t x_170; +lean_dec(x_124); +lean_dec(x_13); +lean_dec(x_7); +lean_dec(x_5); +lean_dec(x_1); +x_170 = !lean_is_exclusive(x_129); +if (x_170 == 0) +{ +return x_129; +} +else { lean_object* x_171; lean_object* x_172; lean_object* x_173; -x_171 = lean_ctor_get(x_170, 0); -lean_inc(x_171); -x_172 = lean_ctor_get(x_170, 1); +x_171 = lean_ctor_get(x_129, 0); +x_172 = lean_ctor_get(x_129, 1); lean_inc(x_172); -lean_dec(x_170); -x_173 = l_Lean_Meta_clear(x_171, x_5, x_13, x_172); -if (lean_obj_tag(x_173) == 0) -{ -lean_object* x_174; lean_object* x_175; lean_object* x_176; lean_object* x_177; lean_object* x_178; uint8_t x_179; lean_object* x_180; -x_174 = lean_ctor_get(x_173, 0); -lean_inc(x_174); -x_175 = lean_ctor_get(x_173, 1); -lean_inc(x_175); -lean_dec(x_173); -x_176 = lean_array_get_size(x_6); -x_177 = lean_unsigned_to_nat(2u); -x_178 = lean_nat_sub(x_176, x_177); -lean_dec(x_176); -x_179 = 0; -x_180 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_179, x_174, x_178, x_7, x_13, x_175); -lean_dec(x_13); -if (lean_obj_tag(x_180) == 0) -{ -uint8_t x_181; -x_181 = !lean_is_exclusive(x_180); -if (x_181 == 0) -{ -lean_object* x_182; uint8_t x_183; -x_182 = lean_ctor_get(x_180, 0); -x_183 = !lean_is_exclusive(x_182); -if (x_183 == 0) -{ -lean_object* x_184; lean_object* x_185; -x_184 = lean_ctor_get(x_182, 0); -lean_dec(x_184); -x_185 = lean_box(0); -lean_ctor_set(x_182, 0, x_185); -return x_180; -} -else -{ -lean_object* x_186; lean_object* x_187; lean_object* x_188; -x_186 = lean_ctor_get(x_182, 1); -lean_inc(x_186); -lean_dec(x_182); -x_187 = lean_box(0); -x_188 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_188, 0, x_187); -lean_ctor_set(x_188, 1, x_186); -lean_ctor_set(x_180, 0, x_188); -return x_180; -} -} -else -{ -lean_object* x_189; lean_object* x_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; -x_189 = lean_ctor_get(x_180, 0); -x_190 = lean_ctor_get(x_180, 1); -lean_inc(x_190); -lean_inc(x_189); -lean_dec(x_180); -x_191 = lean_ctor_get(x_189, 1); -lean_inc(x_191); -if (lean_is_exclusive(x_189)) { - lean_ctor_release(x_189, 0); - lean_ctor_release(x_189, 1); - x_192 = x_189; -} else { - lean_dec_ref(x_189); - x_192 = lean_box(0); -} -x_193 = lean_box(0); -if (lean_is_scalar(x_192)) { - x_194 = lean_alloc_ctor(0, 2, 0); -} else { - x_194 = x_192; -} -lean_ctor_set(x_194, 0, x_193); -lean_ctor_set(x_194, 1, x_191); -x_195 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_195, 0, x_194); -lean_ctor_set(x_195, 1, x_190); -return x_195; -} -} -else -{ -uint8_t x_196; -x_196 = !lean_is_exclusive(x_180); -if (x_196 == 0) -{ -return x_180; -} -else -{ -lean_object* x_197; lean_object* x_198; lean_object* x_199; -x_197 = lean_ctor_get(x_180, 0); -x_198 = lean_ctor_get(x_180, 1); -lean_inc(x_198); -lean_inc(x_197); -lean_dec(x_180); -x_199 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_199, 0, x_197); -lean_ctor_set(x_199, 1, x_198); -return x_199; -} -} -} -else -{ -uint8_t x_200; -lean_dec(x_13); -lean_dec(x_7); -x_200 = !lean_is_exclusive(x_173); -if (x_200 == 0) -{ +lean_inc(x_171); +lean_dec(x_129); +x_173 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_173, 0, x_171); +lean_ctor_set(x_173, 1, x_172); return x_173; } -else -{ -lean_object* x_201; lean_object* x_202; lean_object* x_203; -x_201 = lean_ctor_get(x_173, 0); -x_202 = lean_ctor_get(x_173, 1); -lean_inc(x_202); -lean_inc(x_201); -lean_dec(x_173); -x_203 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_203, 0, x_201); -lean_ctor_set(x_203, 1, x_202); -return x_203; -} -} -} -else -{ -uint8_t x_204; -lean_dec(x_13); -lean_dec(x_7); -lean_dec(x_5); -x_204 = !lean_is_exclusive(x_170); -if (x_204 == 0) -{ -return x_170; -} -else -{ -lean_object* x_205; lean_object* x_206; lean_object* x_207; -x_205 = lean_ctor_get(x_170, 0); -x_206 = lean_ctor_get(x_170, 1); -lean_inc(x_206); -lean_inc(x_205); -lean_dec(x_170); -x_207 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_207, 0, x_205); -lean_ctor_set(x_207, 1, x_206); -return x_207; -} -} -} -else -{ -lean_object* x_208; lean_object* x_209; lean_object* x_210; lean_object* x_211; lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; lean_object* x_216; lean_object* x_217; -x_208 = lean_ctor_get(x_164, 0); -x_209 = lean_ctor_get(x_164, 1); -x_210 = lean_ctor_get(x_164, 2); -x_211 = lean_ctor_get(x_164, 3); -x_212 = lean_ctor_get(x_164, 4); -x_213 = lean_ctor_get(x_164, 5); -lean_inc(x_213); -lean_inc(x_212); -lean_inc(x_211); -lean_inc(x_210); -lean_inc(x_209); -lean_inc(x_208); -lean_dec(x_164); -x_214 = l_Lean_MetavarContext_assignExpr(x_209, x_4, x_165); -x_215 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_215, 0, x_208); -lean_ctor_set(x_215, 1, x_214); -lean_ctor_set(x_215, 2, x_210); -lean_ctor_set(x_215, 3, x_211); -lean_ctor_set(x_215, 4, x_212); -lean_ctor_set(x_215, 5, x_213); -x_216 = l_Lean_Expr_mvarId_x21(x_161); -lean_dec(x_161); -x_217 = l_Lean_Meta_clear(x_216, x_1, x_13, x_215); -if (lean_obj_tag(x_217) == 0) -{ -lean_object* x_218; lean_object* x_219; lean_object* x_220; -x_218 = lean_ctor_get(x_217, 0); -lean_inc(x_218); -x_219 = lean_ctor_get(x_217, 1); -lean_inc(x_219); -lean_dec(x_217); -x_220 = l_Lean_Meta_clear(x_218, x_5, x_13, x_219); -if (lean_obj_tag(x_220) == 0) -{ -lean_object* x_221; lean_object* x_222; lean_object* x_223; lean_object* x_224; lean_object* x_225; uint8_t x_226; lean_object* x_227; -x_221 = lean_ctor_get(x_220, 0); -lean_inc(x_221); -x_222 = lean_ctor_get(x_220, 1); -lean_inc(x_222); -lean_dec(x_220); -x_223 = lean_array_get_size(x_6); -x_224 = lean_unsigned_to_nat(2u); -x_225 = lean_nat_sub(x_223, x_224); -lean_dec(x_223); -x_226 = 0; -x_227 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_226, x_221, x_225, x_7, x_13, x_222); -lean_dec(x_13); -if (lean_obj_tag(x_227) == 0) -{ -lean_object* x_228; lean_object* x_229; lean_object* x_230; lean_object* x_231; lean_object* x_232; lean_object* x_233; lean_object* x_234; lean_object* x_235; -x_228 = lean_ctor_get(x_227, 0); -lean_inc(x_228); -x_229 = lean_ctor_get(x_227, 1); -lean_inc(x_229); -if (lean_is_exclusive(x_227)) { - lean_ctor_release(x_227, 0); - lean_ctor_release(x_227, 1); - x_230 = x_227; -} else { - lean_dec_ref(x_227); - x_230 = lean_box(0); -} -x_231 = lean_ctor_get(x_228, 1); -lean_inc(x_231); -if (lean_is_exclusive(x_228)) { - lean_ctor_release(x_228, 0); - lean_ctor_release(x_228, 1); - x_232 = x_228; -} else { - lean_dec_ref(x_228); - x_232 = lean_box(0); -} -x_233 = lean_box(0); -if (lean_is_scalar(x_232)) { - x_234 = lean_alloc_ctor(0, 2, 0); -} else { - x_234 = x_232; -} -lean_ctor_set(x_234, 0, x_233); -lean_ctor_set(x_234, 1, x_231); -if (lean_is_scalar(x_230)) { - x_235 = lean_alloc_ctor(0, 2, 0); -} else { - x_235 = x_230; -} -lean_ctor_set(x_235, 0, x_234); -lean_ctor_set(x_235, 1, x_229); -return x_235; -} -else -{ -lean_object* x_236; lean_object* x_237; lean_object* x_238; lean_object* x_239; -x_236 = lean_ctor_get(x_227, 0); -lean_inc(x_236); -x_237 = lean_ctor_get(x_227, 1); -lean_inc(x_237); -if (lean_is_exclusive(x_227)) { - lean_ctor_release(x_227, 0); - lean_ctor_release(x_227, 1); - x_238 = x_227; -} else { - lean_dec_ref(x_227); - x_238 = lean_box(0); -} -if (lean_is_scalar(x_238)) { - x_239 = lean_alloc_ctor(1, 2, 0); -} else { - x_239 = x_238; -} -lean_ctor_set(x_239, 0, x_236); -lean_ctor_set(x_239, 1, x_237); -return x_239; } } else { -lean_object* x_240; lean_object* x_241; lean_object* x_242; lean_object* x_243; -lean_dec(x_13); -lean_dec(x_7); -x_240 = lean_ctor_get(x_220, 0); -lean_inc(x_240); -x_241 = lean_ctor_get(x_220, 1); -lean_inc(x_241); -if (lean_is_exclusive(x_220)) { - lean_ctor_release(x_220, 0); - lean_ctor_release(x_220, 1); - x_242 = x_220; -} else { - lean_dec_ref(x_220); - x_242 = lean_box(0); -} -if (lean_is_scalar(x_242)) { - x_243 = lean_alloc_ctor(1, 2, 0); -} else { - x_243 = x_242; -} -lean_ctor_set(x_243, 0, x_240); -lean_ctor_set(x_243, 1, x_241); -return x_243; -} -} -else -{ -lean_object* x_244; lean_object* x_245; lean_object* x_246; lean_object* x_247; -lean_dec(x_13); -lean_dec(x_7); -lean_dec(x_5); -x_244 = lean_ctor_get(x_217, 0); -lean_inc(x_244); -x_245 = lean_ctor_get(x_217, 1); -lean_inc(x_245); -if (lean_is_exclusive(x_217)) { - lean_ctor_release(x_217, 0); - lean_ctor_release(x_217, 1); - x_246 = x_217; -} else { - lean_dec_ref(x_217); - x_246 = lean_box(0); -} -if (lean_is_scalar(x_246)) { - x_247 = lean_alloc_ctor(1, 2, 0); -} else { - x_247 = x_246; -} -lean_ctor_set(x_247, 0, x_244); -lean_ctor_set(x_247, 1, x_245); -return x_247; -} -} -} -else -{ -uint8_t x_248; -lean_dec(x_161); +uint8_t x_174; +lean_dec(x_124); lean_dec(x_13); lean_dec(x_7); lean_dec(x_5); lean_dec(x_4); lean_dec(x_1); -x_248 = !lean_is_exclusive(x_163); -if (x_248 == 0) +x_174 = !lean_is_exclusive(x_126); +if (x_174 == 0) { -return x_163; +return x_126; } else { -lean_object* x_249; lean_object* x_250; lean_object* x_251; -x_249 = lean_ctor_get(x_163, 0); -x_250 = lean_ctor_get(x_163, 1); -lean_inc(x_250); -lean_inc(x_249); -lean_dec(x_163); -x_251 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_251, 0, x_249); -lean_ctor_set(x_251, 1, x_250); -return x_251; +lean_object* x_175; lean_object* x_176; lean_object* x_177; +x_175 = lean_ctor_get(x_126, 0); +x_176 = lean_ctor_get(x_126, 1); +lean_inc(x_176); +lean_inc(x_175); +lean_dec(x_126); +x_177 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_177, 0, x_175); +lean_ctor_set(x_177, 1, x_176); +return x_177; } } } else { -uint8_t x_252; -lean_dec(x_154); -lean_dec(x_146); +uint8_t x_178; +lean_dec(x_117); +lean_dec(x_109); lean_dec(x_13); lean_dec(x_7); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_1); -x_252 = !lean_is_exclusive(x_156); -if (x_252 == 0) +x_178 = !lean_is_exclusive(x_119); +if (x_178 == 0) { -return x_156; +return x_119; } else { -lean_object* x_253; lean_object* x_254; lean_object* x_255; -x_253 = lean_ctor_get(x_156, 0); -x_254 = lean_ctor_get(x_156, 1); -lean_inc(x_254); -lean_inc(x_253); -lean_dec(x_156); -x_255 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_255, 0, x_253); -lean_ctor_set(x_255, 1, x_254); -return x_255; +lean_object* x_179; lean_object* x_180; lean_object* x_181; +x_179 = lean_ctor_get(x_119, 0); +x_180 = lean_ctor_get(x_119, 1); +lean_inc(x_180); +lean_inc(x_179); +lean_dec(x_119); +x_181 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_181, 0, x_179); +lean_ctor_set(x_181, 1, x_180); +return x_181; } } } else { -uint8_t x_256; -lean_dec(x_146); +uint8_t x_182; +lean_dec(x_109); lean_dec(x_13); lean_dec(x_9); lean_dec(x_7); @@ -1282,31 +990,31 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_1); -x_256 = !lean_is_exclusive(x_153); -if (x_256 == 0) +x_182 = !lean_is_exclusive(x_116); +if (x_182 == 0) { -return x_153; +return x_116; } else { -lean_object* x_257; lean_object* x_258; lean_object* x_259; -x_257 = lean_ctor_get(x_153, 0); -x_258 = lean_ctor_get(x_153, 1); -lean_inc(x_258); -lean_inc(x_257); -lean_dec(x_153); -x_259 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_259, 0, x_257); -lean_ctor_set(x_259, 1, x_258); -return x_259; +lean_object* x_183; lean_object* x_184; lean_object* x_185; +x_183 = lean_ctor_get(x_116, 0); +x_184 = lean_ctor_get(x_116, 1); +lean_inc(x_184); +lean_inc(x_183); +lean_dec(x_116); +x_185 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_185, 0, x_183); +lean_ctor_set(x_185, 1, x_184); +return x_185; } } } else { -uint8_t x_260; -lean_dec(x_146); -lean_dec(x_144); +uint8_t x_186; +lean_dec(x_109); +lean_dec(x_107); lean_dec(x_15); lean_dec(x_13); lean_dec(x_10); @@ -1317,442 +1025,296 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_260 = !lean_is_exclusive(x_147); -if (x_260 == 0) +x_186 = !lean_is_exclusive(x_110); +if (x_186 == 0) { -return x_147; +return x_110; } else { -lean_object* x_261; lean_object* x_262; lean_object* x_263; -x_261 = lean_ctor_get(x_147, 0); -x_262 = lean_ctor_get(x_147, 1); -lean_inc(x_262); -lean_inc(x_261); -lean_dec(x_147); -x_263 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_263, 0, x_261); -lean_ctor_set(x_263, 1, x_262); -return x_263; +lean_object* x_187; lean_object* x_188; lean_object* x_189; +x_187 = lean_ctor_get(x_110, 0); +x_188 = lean_ctor_get(x_110, 1); +lean_inc(x_188); +lean_inc(x_187); +lean_dec(x_110); +x_189 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_189, 0, x_187); +lean_ctor_set(x_189, 1, x_188); +return x_189; } } } else { -lean_object* x_264; lean_object* x_265; lean_object* x_266; -lean_dec(x_144); +lean_object* x_190; lean_object* x_191; lean_object* x_192; +lean_dec(x_107); lean_dec(x_19); -x_264 = lean_array_push(x_10, x_2); +x_190 = lean_array_push(x_10, x_2); lean_inc(x_9); -x_265 = lean_array_push(x_264, x_9); +x_191 = lean_array_push(x_190, x_9); lean_inc(x_13); -x_266 = l_Lean_Meta_mkLambda(x_265, x_15, x_13, x_143); -if (lean_obj_tag(x_266) == 0) +x_192 = l_Lean_Meta_mkLambda(x_191, x_15, x_13, x_106); +if (lean_obj_tag(x_192) == 0) { -lean_object* x_267; lean_object* x_268; uint8_t x_269; lean_object* x_270; lean_object* x_271; lean_object* x_272; lean_object* x_273; -x_267 = lean_ctor_get(x_266, 0); -lean_inc(x_267); -x_268 = lean_ctor_get(x_266, 1); -lean_inc(x_268); -lean_dec(x_266); -x_269 = 2; +lean_object* x_193; lean_object* x_194; uint8_t x_195; lean_object* x_196; lean_object* x_197; lean_object* x_198; lean_object* x_199; +x_193 = lean_ctor_get(x_192, 0); +lean_inc(x_193); +x_194 = lean_ctor_get(x_192, 1); +lean_inc(x_194); +lean_dec(x_192); +x_195 = 2; lean_inc(x_13); -x_270 = l_Lean_Meta_mkFreshExprMVar(x_146, x_3, x_269, x_13, x_268); -x_271 = lean_ctor_get(x_270, 0); -lean_inc(x_271); -x_272 = lean_ctor_get(x_270, 1); -lean_inc(x_272); -lean_dec(x_270); +x_196 = l_Lean_Meta_mkFreshExprMVar(x_109, x_3, x_195, x_13, x_194); +x_197 = lean_ctor_get(x_196, 0); +lean_inc(x_197); +x_198 = lean_ctor_get(x_196, 1); +lean_inc(x_198); +lean_dec(x_196); lean_inc(x_13); -lean_inc(x_271); -x_273 = l_Lean_Meta_mkEqRec(x_267, x_271, x_9, x_13, x_272); -if (lean_obj_tag(x_273) == 0) +lean_inc(x_197); +x_199 = l_Lean_Meta_mkEqRec(x_193, x_197, x_9, x_13, x_198); +if (lean_obj_tag(x_199) == 0) { -lean_object* x_274; lean_object* x_275; uint8_t x_276; -x_274 = lean_ctor_get(x_273, 1); -lean_inc(x_274); -x_275 = lean_ctor_get(x_273, 0); -lean_inc(x_275); -lean_dec(x_273); -x_276 = !lean_is_exclusive(x_274); -if (x_276 == 0) +lean_object* x_200; lean_object* x_201; lean_object* x_202; +x_200 = lean_ctor_get(x_199, 0); +lean_inc(x_200); +x_201 = lean_ctor_get(x_199, 1); +lean_inc(x_201); +lean_dec(x_199); +x_202 = l_Lean_Meta_assignExprMVar(x_4, x_200, x_13, x_201); +if (lean_obj_tag(x_202) == 0) { -lean_object* x_277; lean_object* x_278; lean_object* x_279; lean_object* x_280; -x_277 = lean_ctor_get(x_274, 1); -x_278 = l_Lean_MetavarContext_assignExpr(x_277, x_4, x_275); -lean_ctor_set(x_274, 1, x_278); -x_279 = l_Lean_Expr_mvarId_x21(x_271); -lean_dec(x_271); -x_280 = l_Lean_Meta_clear(x_279, x_1, x_13, x_274); -if (lean_obj_tag(x_280) == 0) +lean_object* x_203; lean_object* x_204; lean_object* x_205; +x_203 = lean_ctor_get(x_202, 1); +lean_inc(x_203); +lean_dec(x_202); +x_204 = l_Lean_Expr_mvarId_x21(x_197); +lean_dec(x_197); +x_205 = l_Lean_Meta_clear(x_204, x_1, x_13, x_203); +if (lean_obj_tag(x_205) == 0) { -lean_object* x_281; lean_object* x_282; lean_object* x_283; -x_281 = lean_ctor_get(x_280, 0); -lean_inc(x_281); -x_282 = lean_ctor_get(x_280, 1); -lean_inc(x_282); -lean_dec(x_280); -x_283 = l_Lean_Meta_clear(x_281, x_5, x_13, x_282); -if (lean_obj_tag(x_283) == 0) +lean_object* x_206; lean_object* x_207; lean_object* x_208; +x_206 = lean_ctor_get(x_205, 0); +lean_inc(x_206); +x_207 = lean_ctor_get(x_205, 1); +lean_inc(x_207); +lean_dec(x_205); +x_208 = l_Lean_Meta_clear(x_206, x_5, x_13, x_207); +if (lean_obj_tag(x_208) == 0) { -lean_object* x_284; lean_object* x_285; lean_object* x_286; lean_object* x_287; lean_object* x_288; uint8_t x_289; lean_object* x_290; -x_284 = lean_ctor_get(x_283, 0); -lean_inc(x_284); -x_285 = lean_ctor_get(x_283, 1); -lean_inc(x_285); -lean_dec(x_283); -x_286 = lean_array_get_size(x_6); -x_287 = lean_unsigned_to_nat(2u); -x_288 = lean_nat_sub(x_286, x_287); -lean_dec(x_286); -x_289 = 0; -x_290 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_289, x_284, x_288, x_7, x_13, x_285); +lean_object* x_209; lean_object* x_210; lean_object* x_211; lean_object* x_212; lean_object* x_213; uint8_t x_214; lean_object* x_215; +x_209 = lean_ctor_get(x_208, 0); +lean_inc(x_209); +x_210 = lean_ctor_get(x_208, 1); +lean_inc(x_210); +lean_dec(x_208); +x_211 = lean_array_get_size(x_6); +x_212 = lean_unsigned_to_nat(2u); +x_213 = lean_nat_sub(x_211, x_212); +lean_dec(x_211); +x_214 = 0; +x_215 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_214, x_209, x_213, x_7, x_13, x_210); lean_dec(x_13); -if (lean_obj_tag(x_290) == 0) +if (lean_obj_tag(x_215) == 0) { -uint8_t x_291; -x_291 = !lean_is_exclusive(x_290); -if (x_291 == 0) +uint8_t x_216; +x_216 = !lean_is_exclusive(x_215); +if (x_216 == 0) { -lean_object* x_292; uint8_t x_293; -x_292 = lean_ctor_get(x_290, 0); -x_293 = !lean_is_exclusive(x_292); -if (x_293 == 0) +lean_object* x_217; uint8_t x_218; +x_217 = lean_ctor_get(x_215, 0); +x_218 = !lean_is_exclusive(x_217); +if (x_218 == 0) { -lean_object* x_294; lean_object* x_295; -x_294 = lean_ctor_get(x_292, 0); -lean_dec(x_294); -x_295 = lean_box(0); -lean_ctor_set(x_292, 0, x_295); -return x_290; +lean_object* x_219; lean_object* x_220; +x_219 = lean_ctor_get(x_217, 0); +lean_dec(x_219); +x_220 = lean_box(0); +lean_ctor_set(x_217, 0, x_220); +return x_215; } else { -lean_object* x_296; lean_object* x_297; lean_object* x_298; -x_296 = lean_ctor_get(x_292, 1); -lean_inc(x_296); -lean_dec(x_292); -x_297 = lean_box(0); -x_298 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_298, 0, x_297); -lean_ctor_set(x_298, 1, x_296); -lean_ctor_set(x_290, 0, x_298); -return x_290; +lean_object* x_221; lean_object* x_222; lean_object* x_223; +x_221 = lean_ctor_get(x_217, 1); +lean_inc(x_221); +lean_dec(x_217); +x_222 = lean_box(0); +x_223 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_223, 0, x_222); +lean_ctor_set(x_223, 1, x_221); +lean_ctor_set(x_215, 0, x_223); +return x_215; } } else { -lean_object* x_299; lean_object* x_300; lean_object* x_301; lean_object* x_302; lean_object* x_303; lean_object* x_304; lean_object* x_305; -x_299 = lean_ctor_get(x_290, 0); -x_300 = lean_ctor_get(x_290, 1); -lean_inc(x_300); -lean_inc(x_299); -lean_dec(x_290); -x_301 = lean_ctor_get(x_299, 1); -lean_inc(x_301); -if (lean_is_exclusive(x_299)) { - lean_ctor_release(x_299, 0); - lean_ctor_release(x_299, 1); - x_302 = x_299; +lean_object* x_224; lean_object* x_225; lean_object* x_226; lean_object* x_227; lean_object* x_228; lean_object* x_229; lean_object* x_230; +x_224 = lean_ctor_get(x_215, 0); +x_225 = lean_ctor_get(x_215, 1); +lean_inc(x_225); +lean_inc(x_224); +lean_dec(x_215); +x_226 = lean_ctor_get(x_224, 1); +lean_inc(x_226); +if (lean_is_exclusive(x_224)) { + lean_ctor_release(x_224, 0); + lean_ctor_release(x_224, 1); + x_227 = x_224; } else { - lean_dec_ref(x_299); - x_302 = lean_box(0); + lean_dec_ref(x_224); + x_227 = lean_box(0); } -x_303 = lean_box(0); -if (lean_is_scalar(x_302)) { - x_304 = lean_alloc_ctor(0, 2, 0); +x_228 = lean_box(0); +if (lean_is_scalar(x_227)) { + x_229 = lean_alloc_ctor(0, 2, 0); } else { - x_304 = x_302; + x_229 = x_227; } -lean_ctor_set(x_304, 0, x_303); -lean_ctor_set(x_304, 1, x_301); -x_305 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_305, 0, x_304); -lean_ctor_set(x_305, 1, x_300); -return x_305; +lean_ctor_set(x_229, 0, x_228); +lean_ctor_set(x_229, 1, x_226); +x_230 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_230, 0, x_229); +lean_ctor_set(x_230, 1, x_225); +return x_230; } } else { -uint8_t x_306; -x_306 = !lean_is_exclusive(x_290); -if (x_306 == 0) +uint8_t x_231; +x_231 = !lean_is_exclusive(x_215); +if (x_231 == 0) { -return x_290; +return x_215; } else { -lean_object* x_307; lean_object* x_308; lean_object* x_309; -x_307 = lean_ctor_get(x_290, 0); -x_308 = lean_ctor_get(x_290, 1); -lean_inc(x_308); -lean_inc(x_307); -lean_dec(x_290); -x_309 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_309, 0, x_307); -lean_ctor_set(x_309, 1, x_308); -return x_309; +lean_object* x_232; lean_object* x_233; lean_object* x_234; +x_232 = lean_ctor_get(x_215, 0); +x_233 = lean_ctor_get(x_215, 1); +lean_inc(x_233); +lean_inc(x_232); +lean_dec(x_215); +x_234 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_234, 0, x_232); +lean_ctor_set(x_234, 1, x_233); +return x_234; } } } else { -uint8_t x_310; +uint8_t x_235; lean_dec(x_13); lean_dec(x_7); -x_310 = !lean_is_exclusive(x_283); -if (x_310 == 0) +x_235 = !lean_is_exclusive(x_208); +if (x_235 == 0) { -return x_283; +return x_208; } else { -lean_object* x_311; lean_object* x_312; lean_object* x_313; -x_311 = lean_ctor_get(x_283, 0); -x_312 = lean_ctor_get(x_283, 1); -lean_inc(x_312); -lean_inc(x_311); -lean_dec(x_283); -x_313 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_313, 0, x_311); -lean_ctor_set(x_313, 1, x_312); -return x_313; +lean_object* x_236; lean_object* x_237; lean_object* x_238; +x_236 = lean_ctor_get(x_208, 0); +x_237 = lean_ctor_get(x_208, 1); +lean_inc(x_237); +lean_inc(x_236); +lean_dec(x_208); +x_238 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_238, 0, x_236); +lean_ctor_set(x_238, 1, x_237); +return x_238; } } } else { -uint8_t x_314; +uint8_t x_239; lean_dec(x_13); lean_dec(x_7); lean_dec(x_5); -x_314 = !lean_is_exclusive(x_280); -if (x_314 == 0) +x_239 = !lean_is_exclusive(x_205); +if (x_239 == 0) { -return x_280; +return x_205; } else { -lean_object* x_315; lean_object* x_316; lean_object* x_317; -x_315 = lean_ctor_get(x_280, 0); -x_316 = lean_ctor_get(x_280, 1); -lean_inc(x_316); -lean_inc(x_315); -lean_dec(x_280); -x_317 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_317, 0, x_315); -lean_ctor_set(x_317, 1, x_316); -return x_317; +lean_object* x_240; lean_object* x_241; lean_object* x_242; +x_240 = lean_ctor_get(x_205, 0); +x_241 = lean_ctor_get(x_205, 1); +lean_inc(x_241); +lean_inc(x_240); +lean_dec(x_205); +x_242 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_242, 0, x_240); +lean_ctor_set(x_242, 1, x_241); +return x_242; } } } else { -lean_object* x_318; lean_object* x_319; lean_object* x_320; lean_object* x_321; lean_object* x_322; lean_object* x_323; lean_object* x_324; lean_object* x_325; lean_object* x_326; lean_object* x_327; -x_318 = lean_ctor_get(x_274, 0); -x_319 = lean_ctor_get(x_274, 1); -x_320 = lean_ctor_get(x_274, 2); -x_321 = lean_ctor_get(x_274, 3); -x_322 = lean_ctor_get(x_274, 4); -x_323 = lean_ctor_get(x_274, 5); -lean_inc(x_323); -lean_inc(x_322); -lean_inc(x_321); -lean_inc(x_320); -lean_inc(x_319); -lean_inc(x_318); -lean_dec(x_274); -x_324 = l_Lean_MetavarContext_assignExpr(x_319, x_4, x_275); -x_325 = lean_alloc_ctor(0, 6, 0); -lean_ctor_set(x_325, 0, x_318); -lean_ctor_set(x_325, 1, x_324); -lean_ctor_set(x_325, 2, x_320); -lean_ctor_set(x_325, 3, x_321); -lean_ctor_set(x_325, 4, x_322); -lean_ctor_set(x_325, 5, x_323); -x_326 = l_Lean_Expr_mvarId_x21(x_271); -lean_dec(x_271); -x_327 = l_Lean_Meta_clear(x_326, x_1, x_13, x_325); -if (lean_obj_tag(x_327) == 0) -{ -lean_object* x_328; lean_object* x_329; lean_object* x_330; -x_328 = lean_ctor_get(x_327, 0); -lean_inc(x_328); -x_329 = lean_ctor_get(x_327, 1); -lean_inc(x_329); -lean_dec(x_327); -x_330 = l_Lean_Meta_clear(x_328, x_5, x_13, x_329); -if (lean_obj_tag(x_330) == 0) -{ -lean_object* x_331; lean_object* x_332; lean_object* x_333; lean_object* x_334; lean_object* x_335; uint8_t x_336; lean_object* x_337; -x_331 = lean_ctor_get(x_330, 0); -lean_inc(x_331); -x_332 = lean_ctor_get(x_330, 1); -lean_inc(x_332); -lean_dec(x_330); -x_333 = lean_array_get_size(x_6); -x_334 = lean_unsigned_to_nat(2u); -x_335 = lean_nat_sub(x_333, x_334); -lean_dec(x_333); -x_336 = 0; -x_337 = l_Lean_Meta_introNCore___at_Lean_Meta_introN___spec__1(x_336, x_331, x_335, x_7, x_13, x_332); -lean_dec(x_13); -if (lean_obj_tag(x_337) == 0) -{ -lean_object* x_338; lean_object* x_339; lean_object* x_340; lean_object* x_341; lean_object* x_342; lean_object* x_343; lean_object* x_344; lean_object* x_345; -x_338 = lean_ctor_get(x_337, 0); -lean_inc(x_338); -x_339 = lean_ctor_get(x_337, 1); -lean_inc(x_339); -if (lean_is_exclusive(x_337)) { - lean_ctor_release(x_337, 0); - lean_ctor_release(x_337, 1); - x_340 = x_337; -} else { - lean_dec_ref(x_337); - x_340 = lean_box(0); -} -x_341 = lean_ctor_get(x_338, 1); -lean_inc(x_341); -if (lean_is_exclusive(x_338)) { - lean_ctor_release(x_338, 0); - lean_ctor_release(x_338, 1); - x_342 = x_338; -} else { - lean_dec_ref(x_338); - x_342 = lean_box(0); -} -x_343 = lean_box(0); -if (lean_is_scalar(x_342)) { - x_344 = lean_alloc_ctor(0, 2, 0); -} else { - x_344 = x_342; -} -lean_ctor_set(x_344, 0, x_343); -lean_ctor_set(x_344, 1, x_341); -if (lean_is_scalar(x_340)) { - x_345 = lean_alloc_ctor(0, 2, 0); -} else { - x_345 = x_340; -} -lean_ctor_set(x_345, 0, x_344); -lean_ctor_set(x_345, 1, x_339); -return x_345; -} -else -{ -lean_object* x_346; lean_object* x_347; lean_object* x_348; lean_object* x_349; -x_346 = lean_ctor_get(x_337, 0); -lean_inc(x_346); -x_347 = lean_ctor_get(x_337, 1); -lean_inc(x_347); -if (lean_is_exclusive(x_337)) { - lean_ctor_release(x_337, 0); - lean_ctor_release(x_337, 1); - x_348 = x_337; -} else { - lean_dec_ref(x_337); - x_348 = lean_box(0); -} -if (lean_is_scalar(x_348)) { - x_349 = lean_alloc_ctor(1, 2, 0); -} else { - x_349 = x_348; -} -lean_ctor_set(x_349, 0, x_346); -lean_ctor_set(x_349, 1, x_347); -return x_349; -} -} -else -{ -lean_object* x_350; lean_object* x_351; lean_object* x_352; lean_object* x_353; -lean_dec(x_13); -lean_dec(x_7); -x_350 = lean_ctor_get(x_330, 0); -lean_inc(x_350); -x_351 = lean_ctor_get(x_330, 1); -lean_inc(x_351); -if (lean_is_exclusive(x_330)) { - lean_ctor_release(x_330, 0); - lean_ctor_release(x_330, 1); - x_352 = x_330; -} else { - lean_dec_ref(x_330); - x_352 = lean_box(0); -} -if (lean_is_scalar(x_352)) { - x_353 = lean_alloc_ctor(1, 2, 0); -} else { - x_353 = x_352; -} -lean_ctor_set(x_353, 0, x_350); -lean_ctor_set(x_353, 1, x_351); -return x_353; -} -} -else -{ -lean_object* x_354; lean_object* x_355; lean_object* x_356; lean_object* x_357; +uint8_t x_243; +lean_dec(x_197); lean_dec(x_13); lean_dec(x_7); lean_dec(x_5); -x_354 = lean_ctor_get(x_327, 0); -lean_inc(x_354); -x_355 = lean_ctor_get(x_327, 1); -lean_inc(x_355); -if (lean_is_exclusive(x_327)) { - lean_ctor_release(x_327, 0); - lean_ctor_release(x_327, 1); - x_356 = x_327; -} else { - lean_dec_ref(x_327); - x_356 = lean_box(0); +lean_dec(x_1); +x_243 = !lean_is_exclusive(x_202); +if (x_243 == 0) +{ +return x_202; } -if (lean_is_scalar(x_356)) { - x_357 = lean_alloc_ctor(1, 2, 0); -} else { - x_357 = x_356; -} -lean_ctor_set(x_357, 0, x_354); -lean_ctor_set(x_357, 1, x_355); -return x_357; +else +{ +lean_object* x_244; lean_object* x_245; lean_object* x_246; +x_244 = lean_ctor_get(x_202, 0); +x_245 = lean_ctor_get(x_202, 1); +lean_inc(x_245); +lean_inc(x_244); +lean_dec(x_202); +x_246 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_246, 0, x_244); +lean_ctor_set(x_246, 1, x_245); +return x_246; } } } else { -uint8_t x_358; -lean_dec(x_271); +uint8_t x_247; +lean_dec(x_197); lean_dec(x_13); lean_dec(x_7); lean_dec(x_5); lean_dec(x_4); lean_dec(x_1); -x_358 = !lean_is_exclusive(x_273); -if (x_358 == 0) +x_247 = !lean_is_exclusive(x_199); +if (x_247 == 0) { -return x_273; +return x_199; } else { -lean_object* x_359; lean_object* x_360; lean_object* x_361; -x_359 = lean_ctor_get(x_273, 0); -x_360 = lean_ctor_get(x_273, 1); -lean_inc(x_360); -lean_inc(x_359); -lean_dec(x_273); -x_361 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_361, 0, x_359); -lean_ctor_set(x_361, 1, x_360); -return x_361; +lean_object* x_248; lean_object* x_249; lean_object* x_250; +x_248 = lean_ctor_get(x_199, 0); +x_249 = lean_ctor_get(x_199, 1); +lean_inc(x_249); +lean_inc(x_248); +lean_dec(x_199); +x_250 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_250, 0, x_248); +lean_ctor_set(x_250, 1, x_249); +return x_250; } } } else { -uint8_t x_362; -lean_dec(x_146); +uint8_t x_251; +lean_dec(x_109); lean_dec(x_13); lean_dec(x_9); lean_dec(x_7); @@ -1760,31 +1322,31 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_1); -x_362 = !lean_is_exclusive(x_266); -if (x_362 == 0) +x_251 = !lean_is_exclusive(x_192); +if (x_251 == 0) { -return x_266; +return x_192; } else { -lean_object* x_363; lean_object* x_364; lean_object* x_365; -x_363 = lean_ctor_get(x_266, 0); -x_364 = lean_ctor_get(x_266, 1); -lean_inc(x_364); -lean_inc(x_363); -lean_dec(x_266); -x_365 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_365, 0, x_363); -lean_ctor_set(x_365, 1, x_364); -return x_365; +lean_object* x_252; lean_object* x_253; lean_object* x_254; +x_252 = lean_ctor_get(x_192, 0); +x_253 = lean_ctor_get(x_192, 1); +lean_inc(x_253); +lean_inc(x_252); +lean_dec(x_192); +x_254 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_254, 0, x_252); +lean_ctor_set(x_254, 1, x_253); +return x_254; } } } } else { -uint8_t x_366; -lean_dec(x_140); +uint8_t x_255; +lean_dec(x_103); lean_dec(x_19); lean_dec(x_15); lean_dec(x_13); @@ -1796,23 +1358,23 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_366 = !lean_is_exclusive(x_141); -if (x_366 == 0) +x_255 = !lean_is_exclusive(x_104); +if (x_255 == 0) { -return x_141; +return x_104; } else { -lean_object* x_367; lean_object* x_368; lean_object* x_369; -x_367 = lean_ctor_get(x_141, 0); -x_368 = lean_ctor_get(x_141, 1); -lean_inc(x_368); -lean_inc(x_367); -lean_dec(x_141); -x_369 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_369, 0, x_367); -lean_ctor_set(x_369, 1, x_368); -return x_369; +lean_object* x_256; lean_object* x_257; lean_object* x_258; +x_256 = lean_ctor_get(x_104, 0); +x_257 = lean_ctor_get(x_104, 1); +lean_inc(x_257); +lean_inc(x_256); +lean_dec(x_104); +x_258 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_258, 0, x_256); +lean_ctor_set(x_258, 1, x_257); +return x_258; } } } @@ -1820,7 +1382,7 @@ return x_369; } else { -uint8_t x_388; +uint8_t x_277; lean_dec(x_15); lean_dec(x_13); lean_dec(x_10); @@ -1831,23 +1393,23 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_388 = !lean_is_exclusive(x_16); -if (x_388 == 0) +x_277 = !lean_is_exclusive(x_16); +if (x_277 == 0) { return x_16; } else { -lean_object* x_389; lean_object* x_390; lean_object* x_391; -x_389 = lean_ctor_get(x_16, 0); -x_390 = lean_ctor_get(x_16, 1); -lean_inc(x_390); -lean_inc(x_389); +lean_object* x_278; lean_object* x_279; lean_object* x_280; +x_278 = lean_ctor_get(x_16, 0); +x_279 = lean_ctor_get(x_16, 1); +lean_inc(x_279); +lean_inc(x_278); lean_dec(x_16); -x_391 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_391, 0, x_389); -lean_ctor_set(x_391, 1, x_390); -return x_391; +x_280 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_280, 0, x_278); +lean_ctor_set(x_280, 1, x_279); +return x_280; } } } diff --git a/stage0/stdlib/Init/Lean/Meta/Tactic/Target.c b/stage0/stdlib/Init/Lean/Meta/Tactic/Target.c new file mode 100644 index 0000000000..7c15b200c2 --- /dev/null +++ b/stage0/stdlib/Init/Lean/Meta/Tactic/Target.c @@ -0,0 +1,742 @@ +// Lean compiler output +// Module: Init.Lean.Meta.Tactic.Target +// Imports: Init.Lean.Meta.AppBuilder Init.Lean.Meta.Tactic.Util +#include "runtime/lean.h" +#if defined(__clang__) +#pragma clang diagnostic ignored "-Wunused-parameter" +#pragma clang diagnostic ignored "-Wunused-label" +#elif defined(__GNUC__) && !defined(__CLANG__) +#pragma GCC diagnostic ignored "-Wunused-parameter" +#pragma GCC diagnostic ignored "-Wunused-label" +#pragma GCC diagnostic ignored "-Wunused-but-set-variable" +#endif +#ifdef __cplusplus +extern "C" { +#endif +lean_object* l_Lean_Meta_replaceTargetDefEq(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Expr_mvarId_x21(lean_object*); +lean_object* l_Lean_Meta_getMVarTag(lean_object*, lean_object*, lean_object*); +lean_object* l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_checkNotAssigned___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetDefEq___closed__2; +lean_object* l_Lean_Meta_replaceTargetDefEq___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetEq(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_getMVarType(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetDefEq___closed__1; +lean_object* l_Lean_Meta_replaceTargetDefEq___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_name_mk_string(lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetEq___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetEq___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +uint8_t lean_expr_eqv(lean_object*, lean_object*); +lean_object* l_Lean_Meta_mkFreshExprMVar(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetDefEq___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_withMVarContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_getLevel(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetEq___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetEq___closed__1; +lean_object* l_Lean_Meta_replaceTargetEq___closed__2; +lean_object* l_Lean_Meta_mkEq(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_replaceTargetEq___lambda__1(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_inc(x_1); +x_6 = l_Lean_Meta_getMVarTag(x_1, x_4, x_5); +if (lean_obj_tag(x_6) == 0) +{ +lean_object* x_7; lean_object* x_8; uint8_t x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; +x_7 = lean_ctor_get(x_6, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_6, 1); +lean_inc(x_8); +lean_dec(x_6); +x_9 = 2; +lean_inc(x_4); +lean_inc(x_2); +x_10 = l_Lean_Meta_mkFreshExprMVar(x_2, x_7, x_9, x_4, x_8); +x_11 = lean_ctor_get(x_10, 0); +lean_inc(x_11); +x_12 = lean_ctor_get(x_10, 1); +lean_inc(x_12); +lean_dec(x_10); +lean_inc(x_1); +x_13 = l_Lean_Meta_getMVarType(x_1, x_4, x_12); +if (lean_obj_tag(x_13) == 0) +{ +lean_object* x_14; lean_object* x_15; lean_object* x_16; +x_14 = lean_ctor_get(x_13, 0); +lean_inc(x_14); +x_15 = lean_ctor_get(x_13, 1); +lean_inc(x_15); +lean_dec(x_13); +lean_inc(x_4); +lean_inc(x_14); +x_16 = l_Lean_Meta_getLevel(x_14, x_4, x_15); +if (lean_obj_tag(x_16) == 0) +{ +lean_object* x_17; lean_object* x_18; +x_17 = lean_ctor_get(x_16, 1); +lean_inc(x_17); +lean_dec(x_16); +lean_inc(x_4); +x_18 = l_Lean_Meta_mkEq(x_14, x_2, x_4, x_17); +if (lean_obj_tag(x_18) == 0) +{ +lean_object* x_19; lean_object* x_20; +x_19 = lean_ctor_get(x_18, 1); +lean_inc(x_19); +lean_dec(x_18); +lean_inc(x_11); +x_20 = l_Lean_Meta_assignExprMVar(x_1, x_11, x_4, x_19); +lean_dec(x_4); +if (lean_obj_tag(x_20) == 0) +{ +uint8_t x_21; +x_21 = !lean_is_exclusive(x_20); +if (x_21 == 0) +{ +lean_object* x_22; lean_object* x_23; +x_22 = lean_ctor_get(x_20, 0); +lean_dec(x_22); +x_23 = l_Lean_Expr_mvarId_x21(x_11); +lean_dec(x_11); +lean_ctor_set(x_20, 0, x_23); +return x_20; +} +else +{ +lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_24 = lean_ctor_get(x_20, 1); +lean_inc(x_24); +lean_dec(x_20); +x_25 = l_Lean_Expr_mvarId_x21(x_11); +lean_dec(x_11); +x_26 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_26, 0, x_25); +lean_ctor_set(x_26, 1, x_24); +return x_26; +} +} +else +{ +uint8_t x_27; +lean_dec(x_11); +x_27 = !lean_is_exclusive(x_20); +if (x_27 == 0) +{ +return x_20; +} +else +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_20, 0); +x_29 = lean_ctor_get(x_20, 1); +lean_inc(x_29); +lean_inc(x_28); +lean_dec(x_20); +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 +{ +uint8_t x_31; +lean_dec(x_11); +lean_dec(x_4); +lean_dec(x_1); +x_31 = !lean_is_exclusive(x_18); +if (x_31 == 0) +{ +return x_18; +} +else +{ +lean_object* x_32; lean_object* x_33; lean_object* x_34; +x_32 = lean_ctor_get(x_18, 0); +x_33 = lean_ctor_get(x_18, 1); +lean_inc(x_33); +lean_inc(x_32); +lean_dec(x_18); +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_14); +lean_dec(x_11); +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_35 = !lean_is_exclusive(x_16); +if (x_35 == 0) +{ +return x_16; +} +else +{ +lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_36 = lean_ctor_get(x_16, 0); +x_37 = lean_ctor_get(x_16, 1); +lean_inc(x_37); +lean_inc(x_36); +lean_dec(x_16); +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; +} +} +} +else +{ +uint8_t x_39; +lean_dec(x_11); +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_39 = !lean_is_exclusive(x_13); +if (x_39 == 0) +{ +return x_13; +} +else +{ +lean_object* x_40; lean_object* x_41; lean_object* x_42; +x_40 = lean_ctor_get(x_13, 0); +x_41 = lean_ctor_get(x_13, 1); +lean_inc(x_41); +lean_inc(x_40); +lean_dec(x_13); +x_42 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_42, 0, x_40); +lean_ctor_set(x_42, 1, x_41); +return x_42; +} +} +} +else +{ +uint8_t x_43; +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_43 = !lean_is_exclusive(x_6); +if (x_43 == 0) +{ +return x_6; +} +else +{ +lean_object* x_44; lean_object* x_45; lean_object* x_46; +x_44 = lean_ctor_get(x_6, 0); +x_45 = lean_ctor_get(x_6, 1); +lean_inc(x_45); +lean_inc(x_44); +lean_dec(x_6); +x_46 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_46, 0, x_44); +lean_ctor_set(x_46, 1, x_45); +return x_46; +} +} +} +} +lean_object* _init_l_Lean_Meta_replaceTargetEq___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("replaceTarget"); +return x_1; +} +} +lean_object* _init_l_Lean_Meta_replaceTargetEq___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = lean_box(0); +x_2 = l_Lean_Meta_replaceTargetEq___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* l_Lean_Meta_replaceTargetEq(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_6 = l_Lean_Meta_replaceTargetEq___closed__2; +lean_inc(x_1); +x_7 = lean_alloc_closure((void*)(l_Lean_Meta_checkNotAssigned___boxed), 4, 2); +lean_closure_set(x_7, 0, x_1); +lean_closure_set(x_7, 1, x_6); +lean_inc(x_1); +x_8 = lean_alloc_closure((void*)(l_Lean_Meta_replaceTargetEq___lambda__1___boxed), 5, 2); +lean_closure_set(x_8, 0, x_1); +lean_closure_set(x_8, 1, x_2); +x_9 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg), 4, 2); +lean_closure_set(x_9, 0, x_7); +lean_closure_set(x_9, 1, x_8); +x_10 = l_Lean_Meta_withMVarContext___rarg(x_1, x_9, x_4, x_5); +return x_10; +} +} +lean_object* l_Lean_Meta_replaceTargetEq___lambda__1___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_Meta_replaceTargetEq___lambda__1(x_1, x_2, x_3, x_4, x_5); +lean_dec(x_3); +return x_6; +} +} +lean_object* l_Lean_Meta_replaceTargetEq___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_Meta_replaceTargetEq(x_1, x_2, x_3, x_4, x_5); +lean_dec(x_4); +lean_dec(x_3); +return x_6; +} +} +lean_object* l_Lean_Meta_replaceTargetDefEq___lambda__1(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_inc(x_1); +x_6 = l_Lean_Meta_getMVarType(x_1, x_4, x_5); +if (lean_obj_tag(x_6) == 0) +{ +uint8_t x_7; +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 = lean_expr_eqv(x_8, x_2); +if (x_10 == 0) +{ +lean_object* x_11; +lean_free_object(x_6); +lean_inc(x_1); +x_11 = l_Lean_Meta_getMVarTag(x_1, x_4, x_9); +if (lean_obj_tag(x_11) == 0) +{ +lean_object* x_12; lean_object* x_13; uint8_t x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_14 = 2; +lean_inc(x_4); +x_15 = l_Lean_Meta_mkFreshExprMVar(x_2, x_12, x_14, x_4, x_13); +x_16 = lean_ctor_get(x_15, 0); +lean_inc(x_16); +x_17 = lean_ctor_get(x_15, 1); +lean_inc(x_17); +lean_dec(x_15); +lean_inc(x_4); +x_18 = l_Lean_Meta_getLevel(x_8, x_4, x_17); +if (lean_obj_tag(x_18) == 0) +{ +lean_object* x_19; lean_object* x_20; +x_19 = lean_ctor_get(x_18, 1); +lean_inc(x_19); +lean_dec(x_18); +lean_inc(x_16); +x_20 = l_Lean_Meta_assignExprMVar(x_1, x_16, x_4, x_19); +lean_dec(x_4); +if (lean_obj_tag(x_20) == 0) +{ +uint8_t x_21; +x_21 = !lean_is_exclusive(x_20); +if (x_21 == 0) +{ +lean_object* x_22; lean_object* x_23; +x_22 = lean_ctor_get(x_20, 0); +lean_dec(x_22); +x_23 = l_Lean_Expr_mvarId_x21(x_16); +lean_dec(x_16); +lean_ctor_set(x_20, 0, x_23); +return x_20; +} +else +{ +lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_24 = lean_ctor_get(x_20, 1); +lean_inc(x_24); +lean_dec(x_20); +x_25 = l_Lean_Expr_mvarId_x21(x_16); +lean_dec(x_16); +x_26 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_26, 0, x_25); +lean_ctor_set(x_26, 1, x_24); +return x_26; +} +} +else +{ +uint8_t x_27; +lean_dec(x_16); +x_27 = !lean_is_exclusive(x_20); +if (x_27 == 0) +{ +return x_20; +} +else +{ +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_20, 0); +x_29 = lean_ctor_get(x_20, 1); +lean_inc(x_29); +lean_inc(x_28); +lean_dec(x_20); +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 +{ +uint8_t x_31; +lean_dec(x_16); +lean_dec(x_4); +lean_dec(x_1); +x_31 = !lean_is_exclusive(x_18); +if (x_31 == 0) +{ +return x_18; +} +else +{ +lean_object* x_32; lean_object* x_33; lean_object* x_34; +x_32 = lean_ctor_get(x_18, 0); +x_33 = lean_ctor_get(x_18, 1); +lean_inc(x_33); +lean_inc(x_32); +lean_dec(x_18); +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_8); +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_35 = !lean_is_exclusive(x_11); +if (x_35 == 0) +{ +return x_11; +} +else +{ +lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_36 = lean_ctor_get(x_11, 0); +x_37 = lean_ctor_get(x_11, 1); +lean_inc(x_37); +lean_inc(x_36); +lean_dec(x_11); +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; +} +} +} +else +{ +lean_dec(x_8); +lean_dec(x_4); +lean_dec(x_2); +lean_ctor_set(x_6, 0, x_1); +return x_6; +} +} +else +{ +lean_object* x_39; lean_object* x_40; uint8_t x_41; +x_39 = lean_ctor_get(x_6, 0); +x_40 = lean_ctor_get(x_6, 1); +lean_inc(x_40); +lean_inc(x_39); +lean_dec(x_6); +x_41 = lean_expr_eqv(x_39, x_2); +if (x_41 == 0) +{ +lean_object* x_42; +lean_inc(x_1); +x_42 = l_Lean_Meta_getMVarTag(x_1, x_4, x_40); +if (lean_obj_tag(x_42) == 0) +{ +lean_object* x_43; lean_object* x_44; uint8_t x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; +x_43 = lean_ctor_get(x_42, 0); +lean_inc(x_43); +x_44 = lean_ctor_get(x_42, 1); +lean_inc(x_44); +lean_dec(x_42); +x_45 = 2; +lean_inc(x_4); +x_46 = l_Lean_Meta_mkFreshExprMVar(x_2, x_43, x_45, x_4, x_44); +x_47 = lean_ctor_get(x_46, 0); +lean_inc(x_47); +x_48 = lean_ctor_get(x_46, 1); +lean_inc(x_48); +lean_dec(x_46); +lean_inc(x_4); +x_49 = l_Lean_Meta_getLevel(x_39, x_4, x_48); +if (lean_obj_tag(x_49) == 0) +{ +lean_object* x_50; lean_object* x_51; +x_50 = lean_ctor_get(x_49, 1); +lean_inc(x_50); +lean_dec(x_49); +lean_inc(x_47); +x_51 = l_Lean_Meta_assignExprMVar(x_1, x_47, x_4, x_50); +lean_dec(x_4); +if (lean_obj_tag(x_51) == 0) +{ +lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; +x_52 = lean_ctor_get(x_51, 1); +lean_inc(x_52); +if (lean_is_exclusive(x_51)) { + lean_ctor_release(x_51, 0); + lean_ctor_release(x_51, 1); + x_53 = x_51; +} else { + lean_dec_ref(x_51); + x_53 = lean_box(0); +} +x_54 = l_Lean_Expr_mvarId_x21(x_47); +lean_dec(x_47); +if (lean_is_scalar(x_53)) { + x_55 = lean_alloc_ctor(0, 2, 0); +} else { + x_55 = x_53; +} +lean_ctor_set(x_55, 0, x_54); +lean_ctor_set(x_55, 1, x_52); +return x_55; +} +else +{ +lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; +lean_dec(x_47); +x_56 = lean_ctor_get(x_51, 0); +lean_inc(x_56); +x_57 = lean_ctor_get(x_51, 1); +lean_inc(x_57); +if (lean_is_exclusive(x_51)) { + lean_ctor_release(x_51, 0); + lean_ctor_release(x_51, 1); + x_58 = x_51; +} else { + lean_dec_ref(x_51); + x_58 = lean_box(0); +} +if (lean_is_scalar(x_58)) { + x_59 = lean_alloc_ctor(1, 2, 0); +} else { + x_59 = x_58; +} +lean_ctor_set(x_59, 0, x_56); +lean_ctor_set(x_59, 1, x_57); +return x_59; +} +} +else +{ +lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; +lean_dec(x_47); +lean_dec(x_4); +lean_dec(x_1); +x_60 = lean_ctor_get(x_49, 0); +lean_inc(x_60); +x_61 = lean_ctor_get(x_49, 1); +lean_inc(x_61); +if (lean_is_exclusive(x_49)) { + lean_ctor_release(x_49, 0); + lean_ctor_release(x_49, 1); + x_62 = x_49; +} else { + lean_dec_ref(x_49); + x_62 = lean_box(0); +} +if (lean_is_scalar(x_62)) { + x_63 = lean_alloc_ctor(1, 2, 0); +} else { + x_63 = x_62; +} +lean_ctor_set(x_63, 0, x_60); +lean_ctor_set(x_63, 1, x_61); +return x_63; +} +} +else +{ +lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; +lean_dec(x_39); +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_64 = lean_ctor_get(x_42, 0); +lean_inc(x_64); +x_65 = lean_ctor_get(x_42, 1); +lean_inc(x_65); +if (lean_is_exclusive(x_42)) { + lean_ctor_release(x_42, 0); + lean_ctor_release(x_42, 1); + x_66 = x_42; +} else { + lean_dec_ref(x_42); + x_66 = lean_box(0); +} +if (lean_is_scalar(x_66)) { + x_67 = lean_alloc_ctor(1, 2, 0); +} else { + x_67 = x_66; +} +lean_ctor_set(x_67, 0, x_64); +lean_ctor_set(x_67, 1, x_65); +return x_67; +} +} +else +{ +lean_object* x_68; +lean_dec(x_39); +lean_dec(x_4); +lean_dec(x_2); +x_68 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_68, 0, x_1); +lean_ctor_set(x_68, 1, x_40); +return x_68; +} +} +} +else +{ +uint8_t x_69; +lean_dec(x_4); +lean_dec(x_2); +lean_dec(x_1); +x_69 = !lean_is_exclusive(x_6); +if (x_69 == 0) +{ +return x_6; +} +else +{ +lean_object* x_70; lean_object* x_71; lean_object* x_72; +x_70 = lean_ctor_get(x_6, 0); +x_71 = lean_ctor_get(x_6, 1); +lean_inc(x_71); +lean_inc(x_70); +lean_dec(x_6); +x_72 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_72, 0, x_70); +lean_ctor_set(x_72, 1, x_71); +return x_72; +} +} +} +} +lean_object* _init_l_Lean_Meta_replaceTargetDefEq___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("change"); +return x_1; +} +} +lean_object* _init_l_Lean_Meta_replaceTargetDefEq___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = lean_box(0); +x_2 = l_Lean_Meta_replaceTargetDefEq___closed__1; +x_3 = lean_name_mk_string(x_1, x_2); +return x_3; +} +} +lean_object* l_Lean_Meta_replaceTargetDefEq(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_5 = l_Lean_Meta_replaceTargetDefEq___closed__2; +lean_inc(x_1); +x_6 = lean_alloc_closure((void*)(l_Lean_Meta_checkNotAssigned___boxed), 4, 2); +lean_closure_set(x_6, 0, x_1); +lean_closure_set(x_6, 1, x_5); +lean_inc(x_1); +x_7 = lean_alloc_closure((void*)(l_Lean_Meta_replaceTargetDefEq___lambda__1___boxed), 5, 2); +lean_closure_set(x_7, 0, x_1); +lean_closure_set(x_7, 1, x_2); +x_8 = lean_alloc_closure((void*)(l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg), 4, 2); +lean_closure_set(x_8, 0, x_6); +lean_closure_set(x_8, 1, x_7); +x_9 = l_Lean_Meta_withMVarContext___rarg(x_1, x_8, x_3, x_4); +return x_9; +} +} +lean_object* l_Lean_Meta_replaceTargetDefEq___lambda__1___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_Meta_replaceTargetDefEq___lambda__1(x_1, x_2, x_3, x_4, x_5); +lean_dec(x_3); +return x_6; +} +} +lean_object* l_Lean_Meta_replaceTargetDefEq___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_Meta_replaceTargetDefEq(x_1, x_2, x_3, x_4); +lean_dec(x_3); +return x_5; +} +} +lean_object* initialize_Init_Lean_Meta_AppBuilder(lean_object*); +lean_object* initialize_Init_Lean_Meta_Tactic_Util(lean_object*); +static bool _G_initialized = false; +lean_object* initialize_Init_Lean_Meta_Tactic_Target(lean_object* w) { +lean_object * res; +if (_G_initialized) return lean_mk_io_result(lean_box(0)); +_G_initialized = true; +res = initialize_Init_Lean_Meta_AppBuilder(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +res = initialize_Init_Lean_Meta_Tactic_Util(lean_io_mk_world()); +if (lean_io_result_is_error(res)) return res; +lean_dec_ref(res); +l_Lean_Meta_replaceTargetEq___closed__1 = _init_l_Lean_Meta_replaceTargetEq___closed__1(); +lean_mark_persistent(l_Lean_Meta_replaceTargetEq___closed__1); +l_Lean_Meta_replaceTargetEq___closed__2 = _init_l_Lean_Meta_replaceTargetEq___closed__2(); +lean_mark_persistent(l_Lean_Meta_replaceTargetEq___closed__2); +l_Lean_Meta_replaceTargetDefEq___closed__1 = _init_l_Lean_Meta_replaceTargetDefEq___closed__1(); +lean_mark_persistent(l_Lean_Meta_replaceTargetDefEq___closed__1); +l_Lean_Meta_replaceTargetDefEq___closed__2 = _init_l_Lean_Meta_replaceTargetDefEq___closed__2(); +lean_mark_persistent(l_Lean_Meta_replaceTargetDefEq___closed__2); +return lean_mk_io_result(lean_box(0)); +} +#ifdef __cplusplus +} +#endif