From c19c5e84279d5c6dacce9716734cc9959bf4254e Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Wed, 8 Jul 2020 12:46:56 -0700 Subject: [PATCH] chore: update stage0 --- stage0/src/Init/System/IO.lean | 14 +- stage0/src/Lean/Elab/Declaration.lean | 49 +- stage0/src/Lean/Elab/Inductive.lean | 24 +- stage0/src/kernel/instantiate.cpp | 69 +- stage0/src/kernel/instantiate.h | 5 - stage0/src/library/app_builder.cpp | 107 +- stage0/stdlib/Init/System/IO.c | 190 +- stage0/stdlib/Lean/Elab/Declaration.c | 429 ++- stage0/stdlib/Lean/Elab/Inductive.c | 3900 ++----------------------- stage0/stdlib/Lean/Meta/Basic.c | 50 +- stage0/stdlib/Lean/Parser/Module.c | 104 +- 11 files changed, 956 insertions(+), 3985 deletions(-) diff --git a/stage0/src/Init/System/IO.lean b/stage0/src/Init/System/IO.lean index bfae9e2a10..51507953fa 100644 --- a/stage0/src/Init/System/IO.lean +++ b/stage0/src/Init/System/IO.lean @@ -232,12 +232,18 @@ Prim.liftIO Prim.stdout def stderr : m FS.Handle := Prim.liftIO Prim.stderr -private def putStr (s : String) : m Unit := do +def print {α} [HasToString α] (s : α) : m Unit := do out ← stdout; -out.putStr s +out.putStr $ toString s + +def println {α} [HasToString α] (s : α) : m Unit := print s *> print "\n" + +def eprint {α} [HasToString α] (s : α) : m Unit := do +out ← stderr; +out.putStr $ toString s + +def eprintln {α} [HasToString α] (s : α) : m Unit := eprint s *> eprint "\n" -def print {α} [HasToString α] (s : α) : m Unit := putStr ∘ toString $ s -def println {α} [HasToString α] (s : α) : m Unit := print s *> putStr "\n" def getEnv : String → m (Option String) := Prim.liftIO ∘ Prim.getEnv def realPath : String → m String := Prim.liftIO ∘ Prim.realPath def isDir : String → m Bool := Prim.liftIO ∘ Prim.isDir diff --git a/stage0/src/Lean/Elab/Declaration.lean b/stage0/src/Lean/Elab/Declaration.lean index 51cf60c91b..e8a175c335 100644 --- a/stage0/src/Lean/Elab/Declaration.lean +++ b/stage0/src/Lean/Elab/Declaration.lean @@ -119,18 +119,27 @@ withDeclId declId $ fun name => do /- parser! "inductive " >> declId >> optDeclSig >> many introRule --/ -def elabInductive (modifiers : Modifiers) (stx : Syntax) : CommandElabM Unit := -let (binders, type?) := expandOptDeclSig (stx.getArg 2); -elabInductiveCore stx modifiers (stx.getArg 1) binders type? (stx.getArg 3).getArgs - -/- parser! try ("class " >> "inductive ") >> declId >> optDeclSig >> many introRule + +Remark: numTokens == 1 for regular `inductive` and 2 for `class inductive`. -/ +private def inductiveSyntaxToView (modifiers : Modifiers) (decl : Syntax) (numTokens := 1) : InductiveView := +let (binders, type?) := expandOptDeclSig (decl.getArg (numTokens + 1)); +{ ref := decl, + modifiers := modifiers, + declId := decl.getArg numTokens, + binders := binders, + type? := type?, + introRules := (decl.getArg (numTokens + 2)).getArgs } + +private def classInductiveSyntaxToView (modifiers : Modifiers) (decl : Syntax) : InductiveView := +inductiveSyntaxToView modifiers decl 2 + +def elabInductive (modifiers : Modifiers) (stx : Syntax) : CommandElabM Unit := +elabInductiveCore #[inductiveSyntaxToView modifiers stx] + def elabClassInductive (modifiers : Modifiers) (stx : Syntax) : CommandElabM Unit := -let (binders, type?) := expandOptDeclSig (stx.getArg 3); -let modifiers := modifiers.addAttribute { name := `class }; -elabInductiveCore stx modifiers (stx.getArg 2) binders type? (stx.getArg 4).getArgs +elabInductiveCore #[classInductiveSyntaxToView modifiers stx] def elabStructure (modifiers : Modifiers) (stx : Syntax) : CommandElabM Unit := pure () -- TODO @@ -164,6 +173,28 @@ fun stx => do else throwError stx "unexpected declaration" +/- Return true if all elements of the mutual-block are inductive declarations. -/ +private def isMutualInductive (stx : Syntax) : Bool := +(stx.getArg 1).getArgs.all $ fun elem => + let decl := elem.getArg 1; + let declKind := decl.getKind; + declKind == `Lean.Parser.Command.inductive + +private def elabMutualInductive (elems : Array Syntax) : CommandElabM Unit := do +views ← elems.mapM $ fun stx => do { + modifiers ← elabModifiers (stx.getArg 0); + pure $ inductiveSyntaxToView modifiers (stx.getArg 1) +}; +elabInductiveCore views + +@[builtinCommandElab «mutual»] +def elabMutual : CommandElab := +fun stx => + if isMutualInductive stx then + elabMutualInductive (stx.getArg 1).getArgs + else + throwError stx "not supported" + end Command end Elab end Lean diff --git a/stage0/src/Lean/Elab/Inductive.lean b/stage0/src/Lean/Elab/Inductive.lean index 9484b9e7be..e11c62a7bf 100644 --- a/stage0/src/Lean/Elab/Inductive.lean +++ b/stage0/src/Lean/Elab/Inductive.lean @@ -10,17 +10,26 @@ namespace Lean namespace Elab namespace Command +structure InductiveView := +(ref : Syntax) +(modifiers : Modifiers) +(declId : Syntax) +(binders : Syntax) +(type? : Option Syntax) +(introRules : Array Syntax) + +instance InductiveView.inhabited : Inhabited InductiveView := +⟨{ ref := arbitrary _, modifiers := {}, declId := arbitrary _, binders := arbitrary _, type? := none, introRules := #[] }⟩ + def mkInductive (ref : Syntax) (declName : Name) (explictLevelNames : List Name) (vars : Array Expr) (xs : Array Expr) (type : Expr) (intros : Array Syntax) : TermElabM Declaration := do Term.throwError ref ref -def elabInductiveCore - (ref : Syntax) - (modifiers : Modifiers) - (declId : Syntax) - (binders : Syntax) - (type? : Option Syntax) - (introRules : Array Syntax) : CommandElabM Unit := do +def elabInductiveCore (views : Array InductiveView) : CommandElabM Unit := do +let ref := (views.get! 0).ref; +throwError ref ("WIP\n" ++ toString (views.map (fun (v : InductiveView) => v.ref))) +-- pure () +/- withDeclId declId $ fun name => do declName ← mkDeclName modifiers name; checkNotAlreadyDeclared ref declName; @@ -32,6 +41,7 @@ withDeclId declId $ fun name => do }; throwError ref (ref ++ "\n" ++ toString explictLevelNames) +-/ end Command end Elab diff --git a/stage0/src/kernel/instantiate.cpp b/stage0/src/kernel/instantiate.cpp index d7f1ded2a9..0e19256f71 100644 --- a/stage0/src/kernel/instantiate.cpp +++ b/stage0/src/kernel/instantiate.cpp @@ -6,15 +6,10 @@ Author: Leonardo de Moura */ #include #include -#include #include "kernel/replace_fn.h" #include "kernel/declaration.h" #include "kernel/instantiate.h" -#ifndef LEAN_INST_UNIV_CACHE_SIZE -#define LEAN_INST_UNIV_CACHE_SIZE 1023 -#endif - namespace lean { expr instantiate(expr const & a, unsigned s, unsigned n, expr const * subst) { if (s >= get_loose_bvar_range(a) || n == 0) @@ -233,62 +228,12 @@ expr instantiate_lparams(expr const & e, names const & lps, levels const & ls) { }); } -class instantiate_univ_cache { - typedef std::tuple entry; - unsigned m_capacity; - std::vector> m_cache; -public: - instantiate_univ_cache(unsigned capacity):m_capacity(capacity) { - if (m_capacity == 0) - m_capacity++; - } - - optional is_cached(constant_info const & d, levels const & ls) { - if (m_cache.empty()) - return none_expr(); - lean_assert(m_cache.size() == m_capacity); - unsigned idx = d.get_name().hash() % m_capacity; - if (auto it = m_cache[idx]) { - constant_info info_c; levels ls_c; expr r_c; - std::tie(info_c, ls_c, r_c) = *it; - if (!is_eqp(info_c, d)) - return none_expr(); - if (ls == ls_c) - return some_expr(r_c); - else - return none_expr(); - } - return none_expr(); - } - - void save(constant_info const & d, levels const & ls, expr const & r) { - if (m_cache.empty()) - m_cache.resize(m_capacity); - lean_assert(m_cache.size() == m_capacity); - unsigned idx = d.get_name().hash() % m_cache.size(); - m_cache[idx] = entry(d, ls, r); - } - - void clear() { - m_cache.clear(); - lean_assert(m_cache.empty()); - } -}; - -MK_THREAD_LOCAL_GET(instantiate_univ_cache, get_type_univ_cache, LEAN_INST_UNIV_CACHE_SIZE); -MK_THREAD_LOCAL_GET(instantiate_univ_cache, get_value_univ_cache, LEAN_INST_UNIV_CACHE_SIZE); - expr instantiate_type_lparams(constant_info const & info, levels const & ls) { if (info.get_num_lparams() != length(ls)) lean_panic("#universes mismatch at instantiateTypeLevelParams"); if (is_nil(ls) || !has_param_univ(info.get_type())) return info.get_type(); - instantiate_univ_cache & cache = get_type_univ_cache(); - if (auto r = cache.is_cached(info, ls)) - return *r; - expr r = instantiate_lparams(info.get_type(), info.get_lparams(), ls); - cache.save(info, ls, r); - return r; + return instantiate_lparams(info.get_type(), info.get_lparams(), ls); } expr instantiate_value_lparams(constant_info const & info, levels const & ls) { @@ -298,12 +243,7 @@ expr instantiate_value_lparams(constant_info const & info, levels const & ls) { lean_panic("definition/theorem expected at instantiateValueLevelParams"); if (is_nil(ls) || !has_param_univ(info.get_value())) return info.get_value(); - instantiate_univ_cache & cache = get_value_univ_cache(); - if (auto r = cache.is_cached(info, ls)) - return *r; - expr r = instantiate_lparams(info.get_value(), info.get_lparams(), ls); - cache.save(info, ls, r); - return r; + return instantiate_lparams(info.get_value(), info.get_lparams(), ls); } extern "C" object * lean_instantiate_type_lparams(b_obj_arg info, b_obj_arg ls) { @@ -313,9 +253,4 @@ extern "C" object * lean_instantiate_type_lparams(b_obj_arg info, b_obj_arg ls) extern "C" object * lean_instantiate_value_lparams(b_obj_arg info, b_obj_arg ls) { return instantiate_value_lparams(TO_REF(constant_info, info), TO_REF(levels, ls)).steal(); } - -void clear_instantiate_cache() { - get_type_univ_cache().clear(); - get_value_univ_cache().clear(); -} } diff --git a/stage0/src/kernel/instantiate.h b/stage0/src/kernel/instantiate.h index d00d8347e4..ac07bdde7e 100644 --- a/stage0/src/kernel/instantiate.h +++ b/stage0/src/kernel/instantiate.h @@ -42,9 +42,4 @@ expr instantiate_type_lparams(constant_info const & info, levels const & ls); /** \brief Instantiate the universe level parameters of the value of the given constant. \pre d.get_num_lparams() == length(ls) */ expr instantiate_value_lparams(constant_info const & info, levels const & ls); - -/** \brief Clear thread local caches used by instantiate_value_lparams and instantiate_type_lparams. - We clear the caches whenever we enable expression caching (aka max sharing). - We do that because the cache may still contain expressions that are not maximally shared. */ -void clear_instantiate_cache(); } diff --git a/stage0/src/library/app_builder.cpp b/stage0/src/library/app_builder.cpp index dfec0773fe..78c3ae1513 100644 --- a/stage0/src/library/app_builder.cpp +++ b/stage0/src/library/app_builder.cpp @@ -11,7 +11,6 @@ Author: Leonardo de Moura #include "library/util.h" #include "library/trace.h" #include "library/constants.h" -#include "library/cache_helper.h" #include "library/app_builder.h" namespace lean { @@ -41,86 +40,6 @@ static unsigned get_nargs(unsigned mask_sz, bool const * mask) { return nargs; } -class app_builder_cache { - struct entry { - unsigned m_num_umeta; - unsigned m_num_emeta; - expr m_app; - list> m_inst_args; // "mask" of implicit instance arguments - list m_expl_args; // metavars for explicit arguments - /* - IMPORTANT: for m_inst_args we store the arguments in reverse order. - For example, the first element in the list indicates whether the last argument - is an instance implicit argument or not. If it is not none, then the element - is the associated metavariable - - m_expl_args are also stored in reverse order - */ - }; - - struct key { - name m_name; - unsigned m_num_expl; - unsigned m_hash; - // If nil, then the mask is composed of the last m_num_expl arguments. - // If nonnil, then the mask is NOT of the form [false*, true*] - list m_mask; - - key(name const & c, unsigned n): - m_name(c), m_num_expl(n), - m_hash(::lean::hash(c.hash(), n)) { - } - - key(name const & c, list const & m): - m_name(c), m_num_expl(length(m)) { - m_hash = ::lean::hash(c.hash(), m_num_expl); - m_mask = m; - for (bool b : m) { - if (b) - m_hash = ::lean::hash(m_hash, 17u); - else - m_hash = ::lean::hash(m_hash, 31u); - } - } - - bool check_invariant() const { - lean_assert(empty(m_mask) || length(m_mask) == m_num_expl); - return true; - } - - unsigned hash() const { return m_hash; } - friend bool operator==(key const & k1, key const & k2) { - return k1.m_name == k2.m_name && k1.m_num_expl == k2.m_num_expl && k1.m_mask == k2.m_mask; - } - }; - - struct key_hash_fn { - unsigned operator()(key const & k) const { return k.hash(); } - }; - - typedef std::unordered_map map; - - environment m_env; - map m_map; - friend class app_builder; -public: - app_builder_cache(environment const & env): - m_env(env) { - } - - environment const & env() const { return m_env; } -}; - -typedef cache_compatibility_helper app_builder_cache_helper; - -/* CACHE_RESET: YES */ -MK_THREAD_LOCAL_GET_DEF(app_builder_cache_helper, get_abch); - -/** Return an app_builder_cache for the transparency_mode in ctx, and compatible with the environment. */ -app_builder_cache & get_app_builder_cache_for(type_context_old const & ctx) { - return get_abch().get_cache_for(ctx); -} - static level get_level_ap(type_context_old & ctx, expr const & A) { try { return get_level(ctx, A); @@ -146,9 +65,22 @@ static level get_level_ap(type_context_old & ctx, expr const & A) { */ class app_builder { type_context_old & m_ctx; - app_builder_cache & m_cache; - typedef app_builder_cache::key key; - typedef app_builder_cache::entry entry; + + struct entry { + unsigned m_num_umeta; + unsigned m_num_emeta; + expr m_app; + list> m_inst_args; // "mask" of implicit instance arguments + list m_expl_args; // metavars for explicit arguments + /* + IMPORTANT: for m_inst_args we store the arguments in reverse order. + For example, the first element in the list indicates whether the last argument + is an instance implicit argument or not. If it is not none, then the element + is the associated metavariable + + m_expl_args are also stored in reverse order + */ + }; environment const & env() const { return m_ctx.env(); } @@ -173,8 +105,6 @@ class app_builder { } optional get_entry(name const & c, unsigned nargs) { - key k(c, nargs); - lean_assert(k.check_invariant()); if (optional info = env().find(c)) { buffer mvars; buffer> inst_args; @@ -219,8 +149,6 @@ class app_builder { } optional get_entry(name const & c, unsigned mask_sz, bool const * mask) { - key k(c, to_list(mask, mask+mask_sz)); - lean_assert(k.check_invariant()); if (auto d = env().find(c)) { buffer mvars; buffer> inst_args; @@ -289,7 +217,7 @@ class app_builder { } public: - app_builder(type_context_old & ctx):m_ctx(ctx), m_cache(get_app_builder_cache_for(ctx)) {} + app_builder(type_context_old & ctx):m_ctx(ctx) {} level get_level(expr const & A) { return get_level_ap(m_ctx, A); @@ -1044,7 +972,6 @@ expr mk_iff_mp(type_context_old & ctx, expr const & h1, expr const & h2) { void initialize_app_builder() { register_trace_class("app_builder"); - register_thread_local_reset_fn([]() { get_abch().clear(); }); } void finalize_app_builder() {} } diff --git a/stage0/stdlib/Init/System/IO.c b/stage0/stdlib/Init/System/IO.c index 143a29bf74..80c8d67f35 100644 --- a/stage0/stdlib/Init/System/IO.c +++ b/stage0/stdlib/Init/System/IO.c @@ -16,7 +16,6 @@ extern "C" { lean_object* l_IO_FS_linesAux___main___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_linesAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_putStrLn___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_System_IO_1__putStr(lean_object*); lean_object* l_allocprof___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_mkRef___boxed(lean_object*, lean_object*); extern uint8_t l_System_Platform_isWindows; @@ -46,9 +45,7 @@ lean_object* l_IO_Prim_stdin___boxed(lean_object*); lean_object* l_IO_FS_Handle_putStr___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_io_prim_handle_put_str(lean_object*, lean_object*, lean_object*); lean_object* l_IO_stdout___rarg(lean_object*); -lean_object* l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3___boxed(lean_object*, lean_object*); lean_object* l_IO_getEnv___rarg(lean_object*, lean_object*); -lean_object* l___private_Init_System_IO_1__putStr___rarg___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_getLine___rarg(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_mk___boxed(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; @@ -85,16 +82,18 @@ lean_object* l_EIO_Inhabited(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_putStr___boxed(lean_object*, lean_object*); lean_object* l_EIO_adaptExcept___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__11; +lean_object* l_IO_print___at_IO_println___spec__1___rarg___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_lines___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_io_getenv(lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__13; lean_object* l_IO_setAccessRights(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Ref_get___rarg(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__5___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_eprintln(lean_object*); lean_object* l_IO_Prim_Handle_isEof___boxed(lean_object*, lean_object*); lean_object* l_hasMonadLiftTTrans___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_HasRepr_hasEval___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_getLine___boxed(lean_object*, lean_object*); +lean_object* l_IO_eprint___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_with_isolated_streams(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_readToEndAux(lean_object*); uint32_t l_IO_AccessRight_flags___closed__8; @@ -117,6 +116,7 @@ uint8_t lean_nat_dec_eq(lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__2; lean_object* l_IO_Ref_set___boxed(lean_object*, lean_object*); lean_object* l_IO_MonadIO; +lean_object* l_IO_stdout___at_Lean_HasRepr_hasEval___spec__3(lean_object*); lean_object* l_IO_FS_Handle_read___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_StateT_MonadExcept___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_liftIO___rarg(lean_object*, lean_object*); @@ -128,6 +128,7 @@ lean_object* lean_io_current_dir(lean_object*); lean_object* l_EIO_MonadExcept(lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__10; lean_object* l_IO_Ref_reset___rarg(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_print___at_IO_println___spec__1(lean_object*); lean_object* l_IO_FS_Handle_write___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_realPath___boxed(lean_object*, lean_object*); lean_object* lean_io_realpath(lean_object*, lean_object*); @@ -137,6 +138,7 @@ lean_object* l_IO_Prim_Ref_reset___boxed(lean_object*, lean_object*, lean_object lean_object* l_IO_FS_Handle_readToEndAux___main___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags(uint8_t, uint8_t); lean_object* l_ReaderT_monadIO___rarg(lean_object*, lean_object*); +lean_object* l_IO_eprintln___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_linesAux___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_Inhabited(lean_object*); lean_object* l_IO_stderr___boxed(lean_object*, lean_object*); @@ -147,10 +149,10 @@ lean_object* lean_io_allocprof(lean_object*, lean_object*, lean_object*); lean_object* l_EIO_HasOrelse(lean_object*, lean_object*); lean_object* l_ReaderT_monadIO(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_getLine(lean_object*, lean_object*); +lean_object* l_IO_eprint(lean_object*); lean_object* l_IO_FS_Handle_readToEndAux___main___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_appPath___boxed(lean_object*, lean_object*); lean_object* l_StateT_lift___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_stdout___at_Lean_HasRepr_hasEval___spec__4(lean_object*); lean_object* l_IO_initializing___boxed(lean_object*); lean_object* l_IO_println___at_Lean_HasRepr_hasEval___spec__1___boxed(lean_object*, lean_object*); lean_object* lean_get_stderr(lean_object*); @@ -182,10 +184,11 @@ lean_object* l_String_dropRight(lean_object*, lean_object*); lean_object* l_EIO_catchExceptions(lean_object*, lean_object*); lean_object* l_IO_setAccessRights___boxed(lean_object*, lean_object*, lean_object*); size_t lean_usize_of_nat(lean_object*); +lean_object* l_IO_print___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_MonadIO___closed__2; lean_object* l_IO_ofExcept___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fileExists___boxed(lean_object*, lean_object*); -lean_object* l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(lean_object*, lean_object*); +lean_object* l_IO_print___at_IO_println___spec__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_readFile___rarg___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_IO_realPath(lean_object*, lean_object*); lean_object* lean_io_prim_handle_write(lean_object*, lean_object*, lean_object*); @@ -206,6 +209,7 @@ lean_object* l_IO_isDir___rarg(lean_object*, lean_object*); lean_object* l_IO_getEnv(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_readToEndAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_MonadIO___closed__3; +lean_object* l_IO_eprint___at_IO_eprintln___spec__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_lazyPure(lean_object*); lean_object* l_EStateM_Monad(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_mk___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -214,8 +218,8 @@ lean_object* lean_io_ref_ptr_eq(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_currentDir___boxed(lean_object*); lean_object* l_IO_FS_Handle_write___boxed(lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__5; +lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__4___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__14; -lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__5(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_readToEndAux___main(lean_object*); lean_object* l_IO_FS_readFile___rarg(lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags(lean_object*); @@ -231,6 +235,7 @@ lean_object* l_IO_FS_lines___rarg___lambda__1(lean_object*, lean_object*, lean_o lean_object* lean_get_stdout(lean_object*); lean_object* l_IO_Prim_Ref_swap___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_eprint___at_IO_eprintln___spec__1(lean_object*); lean_object* l_IO_appDir___rarg___lambda__1(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_read___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Ref_reset___boxed(lean_object*, lean_object*); @@ -277,7 +282,6 @@ lean_object* l_IO_print___rarg(lean_object*, lean_object*, lean_object*, lean_ob lean_object* l_ReaderT_lift___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__2; lean_object* l_IO_RefPointed(lean_object*); -lean_object* l___private_Init_System_IO_1__putStr___rarg(lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__5; lean_object* lean_io_prim_handle_mk(lean_object*, lean_object*, lean_object*); lean_object* l_IO_appDir___rarg(lean_object*, lean_object*); @@ -286,6 +290,7 @@ lean_object* l_IO_Prim_iterate___main___rarg(lean_object*, lean_object*, lean_ob uint32_t l_IO_AccessRight_flags___closed__7; uint32_t l_IO_FileRight_flags(lean_object*); lean_object* l_EIO_catchExceptions___rarg(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__4(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_Handle_read___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_stdout___boxed(lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__13; @@ -1938,7 +1943,41 @@ lean_dec(x_2); return x_3; } } -lean_object* l___private_Init_System_IO_1__putStr___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_print___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; lean_object* x_6; +x_5 = lean_apply_1(x_1, x_2); +x_6 = l_IO_FS_Handle_putStr___rarg(x_3, x_4, x_5); +return x_6; +} +} +lean_object* l_IO_print___rarg(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; +x_6 = lean_ctor_get(x_1, 1); +lean_inc(x_6); +lean_dec(x_1); +lean_inc(x_2); +x_7 = l_IO_stdout___rarg(x_2); +x_8 = lean_alloc_closure((void*)(l_IO_print___rarg___lambda__1), 4, 3); +lean_closure_set(x_8, 0, x_4); +lean_closure_set(x_8, 1, x_5); +lean_closure_set(x_8, 2, x_2); +x_9 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_7, x_8); +return x_9; +} +} +lean_object* l_IO_print(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l_IO_print___rarg), 5, 0); +return x_2; +} +} +lean_object* l_IO_print___at_IO_println___spec__1___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; @@ -1946,7 +1985,7 @@ x_4 = l_IO_FS_Handle_putStr___rarg(x_1, x_3, x_2); return x_4; } } -lean_object* l___private_Init_System_IO_1__putStr___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_print___at_IO_println___spec__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; @@ -1955,35 +1994,18 @@ lean_inc(x_4); lean_dec(x_1); lean_inc(x_2); x_5 = l_IO_stdout___rarg(x_2); -x_6 = lean_alloc_closure((void*)(l___private_Init_System_IO_1__putStr___rarg___lambda__1), 3, 2); +x_6 = lean_alloc_closure((void*)(l_IO_print___at_IO_println___spec__1___rarg___lambda__1), 3, 2); lean_closure_set(x_6, 0, x_2); lean_closure_set(x_6, 1, x_3); x_7 = lean_apply_4(x_4, lean_box(0), lean_box(0), x_5, x_6); return x_7; } } -lean_object* l___private_Init_System_IO_1__putStr(lean_object* x_1) { +lean_object* l_IO_print___at_IO_println___spec__1(lean_object* x_1) { _start: { lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l___private_Init_System_IO_1__putStr___rarg), 3, 0); -return x_2; -} -} -lean_object* l_IO_print___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { -_start: -{ -lean_object* x_6; lean_object* x_7; -x_6 = lean_apply_1(x_4, x_5); -x_7 = l___private_Init_System_IO_1__putStr___rarg(x_1, x_2, x_6); -return x_7; -} -} -lean_object* l_IO_print(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_print___rarg), 5, 0); +x_2 = lean_alloc_closure((void*)(l_IO_print___at_IO_println___spec__1___rarg), 3, 0); return x_2; } } @@ -2000,7 +2022,7 @@ lean_inc(x_2); lean_inc(x_1); x_8 = l_IO_print___rarg(x_1, x_2, lean_box(0), x_4, x_5); x_9 = l_IO_FS_Handle_putStrLn___rarg___closed__1; -x_10 = l___private_Init_System_IO_1__putStr___rarg(x_1, x_2, x_9); +x_10 = l_IO_print___at_IO_println___spec__1___rarg(x_1, x_2, x_9); x_11 = lean_apply_3(x_7, lean_box(0), x_8, x_10); return x_11; } @@ -2013,6 +2035,81 @@ x_2 = lean_alloc_closure((void*)(l_IO_println___rarg), 5, 0); return x_2; } } +lean_object* l_IO_eprint___rarg(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; +x_6 = lean_ctor_get(x_1, 1); +lean_inc(x_6); +lean_dec(x_1); +lean_inc(x_2); +x_7 = l_IO_stderr___rarg(x_2); +x_8 = lean_alloc_closure((void*)(l_IO_print___rarg___lambda__1), 4, 3); +lean_closure_set(x_8, 0, x_4); +lean_closure_set(x_8, 1, x_5); +lean_closure_set(x_8, 2, x_2); +x_9 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_7, x_8); +return x_9; +} +} +lean_object* l_IO_eprint(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l_IO_eprint___rarg), 5, 0); +return x_2; +} +} +lean_object* l_IO_eprint___at_IO_eprintln___spec__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_4 = lean_ctor_get(x_1, 1); +lean_inc(x_4); +lean_dec(x_1); +lean_inc(x_2); +x_5 = l_IO_stderr___rarg(x_2); +x_6 = lean_alloc_closure((void*)(l_IO_print___at_IO_println___spec__1___rarg___lambda__1), 3, 2); +lean_closure_set(x_6, 0, x_2); +lean_closure_set(x_6, 1, x_3); +x_7 = lean_apply_4(x_4, lean_box(0), lean_box(0), x_5, x_6); +return x_7; +} +} +lean_object* l_IO_eprint___at_IO_eprintln___spec__1(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l_IO_eprint___at_IO_eprintln___spec__1___rarg), 3, 0); +return x_2; +} +} +lean_object* l_IO_eprintln___rarg(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; lean_object* x_11; +x_6 = lean_ctor_get(x_1, 0); +lean_inc(x_6); +x_7 = lean_ctor_get(x_6, 4); +lean_inc(x_7); +lean_dec(x_6); +lean_inc(x_2); +lean_inc(x_1); +x_8 = l_IO_eprint___rarg(x_1, x_2, lean_box(0), x_4, x_5); +x_9 = l_IO_FS_Handle_putStrLn___rarg___closed__1; +x_10 = l_IO_eprint___at_IO_eprintln___spec__1___rarg(x_1, x_2, x_9); +x_11 = lean_apply_3(x_7, lean_box(0), x_8, x_10); +return x_11; +} +} +lean_object* l_IO_eprintln(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l_IO_eprintln___rarg), 5, 0); +return x_2; +} +} lean_object* l_IO_getEnv___rarg(lean_object* x_1, lean_object* x_2) { _start: { @@ -2839,7 +2936,7 @@ x_2 = lean_alloc_closure((void*)(l_IO_Ref_modify___rarg), 5, 0); return x_2; } } -lean_object* l_IO_stdout___at_Lean_HasRepr_hasEval___spec__4(lean_object* x_1) { +lean_object* l_IO_stdout___at_Lean_HasRepr_hasEval___spec__3(lean_object* x_1) { _start: { lean_object* x_2; @@ -2847,7 +2944,7 @@ x_2 = lean_get_stdout(x_1); return x_2; } } -lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__5(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__4(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; @@ -2855,7 +2952,7 @@ x_4 = lean_io_prim_handle_put_str(x_1, x_2, x_3); return x_4; } } -lean_object* l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(lean_object* x_1, lean_object* x_2) { +lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; @@ -2896,19 +2993,11 @@ return x_10; } } } -lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_1, x_2); -return x_3; -} -} lean_object* l_IO_println___at_Lean_HasRepr_hasEval___spec__1(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; -x_3 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_1, x_2); +x_3 = l_IO_print___at_Lean_HasRepr_hasEval___spec__2(x_1, x_2); if (lean_obj_tag(x_3) == 0) { lean_object* x_4; lean_object* x_5; lean_object* x_6; @@ -2916,7 +3005,7 @@ x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = l_IO_FS_Handle_putStrLn___rarg___closed__1; -x_6 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_5, x_4); +x_6 = l_IO_print___at_Lean_HasRepr_hasEval___spec__2(x_5, x_4); return x_6; } else @@ -2961,25 +3050,16 @@ x_2 = lean_alloc_closure((void*)(l_Lean_HasRepr_hasEval___rarg___boxed), 4, 0); return x_2; } } -lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__5___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__4___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; -x_4 = l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__5(x_1, x_2, x_3); +x_4 = l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__4(x_1, x_2, x_3); lean_dec(x_2); lean_dec(x_1); return x_4; } } -lean_object* l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3___boxed(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_1, x_2); -lean_dec(x_1); -return x_3; -} -} lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2___boxed(lean_object* x_1, lean_object* x_2) { _start: { diff --git a/stage0/stdlib/Lean/Elab/Declaration.c b/stage0/stdlib/Lean/Elab/Declaration.c index d2778d342c..5a1f8606b0 100644 --- a/stage0/stdlib/Lean/Elab/Declaration.c +++ b/stage0/stdlib/Lean/Elab/Declaration.c @@ -33,7 +33,7 @@ uint8_t l_List_elem___main___at_Lean_NameHashSet_insert___spec__2(lean_object*, lean_object* l_Lean_Elab_Command_elabAbbrev(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabExample___closed__1; lean_object* l_Lean_Elab_Command_elabConstant___closed__1; -lean_object* l_Lean_Elab_Command_elabInductiveCore(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Command_elabInductiveCore(lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabAxiom___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Command_6__mkTermContext(lean_object*, lean_object*, lean_object*); @@ -42,10 +42,13 @@ lean_object* l_Lean_Elab_Command_elabExample___closed__2; extern lean_object* l_Lean_Parser_Command_declaration___elambda__1___closed__2; lean_object* l_Lean_mkIdentFrom(lean_object*, lean_object*); lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration(lean_object*); +extern lean_object* l_Lean_Parser_Command_mutual___elambda__1___closed__2; lean_object* l___private_Lean_Elab_Command_3__setState(lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_Declaration_2__classInductiveSyntaxToView(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_Elab_Term_mkForallUsedOnly(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___regBuiltin_Lean_Elab_Command_elabMutual(lean_object*); lean_object* lean_string_utf8_byte_size(lean_object*); extern lean_object* l_Lean_Parser_Command_example___elambda__1___closed__2; lean_object* l___private_Lean_Elab_SyntheticMVars_11__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*); @@ -55,6 +58,7 @@ lean_object* l_Lean_Name_getNumParts___main(lean_object*); lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__1; extern lean_object* l_Lean_mkAppStx___closed__8; lean_object* lean_nat_add(lean_object*, lean_object*); +uint8_t l_Array_anyRangeMAux___main___at___private_Lean_Elab_Declaration_3__isMutualInductive___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l___private_Lean_Elab_Quotation_4__getHeadInfo___elambda__3___closed__3; extern lean_object* l_Lean_Parser_Command_classInductive___elambda__1___closed__2; extern lean_object* l_Lean_mkTermIdFromIdent___closed__2; @@ -73,6 +77,7 @@ extern lean_object* l_Lean_Parser_Command_def___elambda__1___closed__2; extern lean_object* l_Lean_Parser_Command_declValSimple___elambda__1___closed__2; extern lean_object* l_Lean_Meta_registerInstanceAttr___closed__1; lean_object* l_Lean_Elab_Command_elabConstant(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_array_fset(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabAxiom___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_expandOptDeclSig(lean_object*); extern lean_object* l_Lean_Meta_registerInstanceAttr___closed__2; @@ -84,23 +89,28 @@ extern lean_object* l___private_Lean_Elab_Term_5__expandCDot___main___closed__4; extern lean_object* l_Lean_Parser_Command_namespace___elambda__1___closed__1; lean_object* l_Lean_Elab_Command_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_docComment___elambda__1___closed__2; +lean_object* l_Lean_Elab_Command_elabMutual___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_Array_umapMAux___main___at___private_Lean_Elab_Declaration_4__elabMutualInductive___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabAxiom___spec__3(lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_Declaration_3__isMutualInductive___boxed(lean_object*); +lean_object* l_Lean_Elab_Command_elabMutual___closed__2; lean_object* l_Lean_Elab_Command_elabTheorem(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Command_modifyScope___closed__1; lean_object* l_Lean_Elab_Command_elabDef(lean_object*, lean_object*, lean_object*, lean_object*); -extern lean_object* l_Lean_registerClassAttr___closed__2; extern lean_object* l_Lean_Elab_Command_withDeclId___closed__3; lean_object* l_Lean_Elab_Command_elabAxiom___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_sortDeclLevelParams(lean_object*, lean_object*); lean_object* l_Lean_addMacroScope(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Command_2__getState(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_elabClassInductive___closed__1; +uint8_t l___private_Lean_Elab_Declaration_3__isMutualInductive(lean_object*); extern lean_object* l_Lean_mkReducibilityAttrs___closed__4; lean_object* l_Lean_mkAtomFrom(lean_object*, lean_object*); extern lean_object* l___private_Lean_Elab_Quotation_8__letBindRhss___main___closed__11; lean_object* l_List_drop___main___rarg(lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabAbbrev___closed__3; lean_object* l_Lean_Elab_Command_elabStructure___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Command_elabMutual(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabInstance(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Command_7__mkTermState(lean_object*); extern lean_object* l_Lean_Parser_Command_axiom___elambda__1___closed__2; @@ -111,10 +121,11 @@ lean_object* l_Lean_Elab_Command_elabInstance___closed__3; lean_object* l_Lean_Syntax_getArgs(lean_object*); lean_object* l_Lean_Syntax_getKind(lean_object*); lean_object* l_Lean_MacroScopesView_review(lean_object*); -lean_object* l_Lean_Elab_Command_elabInductive___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_anyRangeMAux___main___at___private_Lean_Elab_Declaration_3__isMutualInductive___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabAbbrev___closed__2; lean_object* l_Lean_Elab_Command_elabStructure(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_Modifiers_addAttribute(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Command_elabMutual___closed__3; lean_object* l_Lean_Elab_Term_elabType(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_structure___elambda__1___closed__2; extern lean_object* l_Lean_mkAppStx___closed__9; @@ -132,12 +143,16 @@ lean_object* l_Lean_Elab_Command_elabDefLike(lean_object*, lean_object*, lean_ob lean_object* l_Lean_Elab_Command_expandDeclSig___boxed(lean_object*); lean_object* l_Lean_Elab_Command_elabDeclaration___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_elabBinders___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_Declaration_4__elabMutualInductive(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDeclaration___closed__2; +extern lean_object* l_Lean_mkOptionalNode___closed__2; lean_object* l_Lean_Elab_Command_elabAxiom___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabConstant___closed__5; +lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabInductive(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDeclaration___closed__1; +lean_object* l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDeclaration___closed__3; lean_object* l_Lean_Elab_Command_elabConstant___closed__3; lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabAxiom___spec__2(lean_object*, lean_object*, lean_object*); @@ -146,11 +161,13 @@ lean_object* l___private_Lean_Elab_Command_12__addScopes___main(lean_object*, le lean_object* l_Lean_Elab_Command_elabAbbrev___closed__4; lean_object* l_Lean_CollectLevelParams_main___main(lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Command_liftTermElabM___rarg___closed__1; +lean_object* l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1; lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabAxiom___spec__1(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_constant___elambda__1___closed__2; extern lean_object* l_Lean_Parser_Command_theorem___elambda__1___closed__2; uint8_t lean_nat_dec_lt(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_declId___elambda__1___closed__2; +lean_object* l_Lean_Elab_Command_elabMutual___closed__1; lean_object* l_Lean_Elab_Command_expandOptDeclSig(lean_object* x_1) { _start: { @@ -5234,12 +5251,14 @@ lean_dec(x_2); return x_5; } } -lean_object* l_Lean_Elab_Command_elabInductive(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { -lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; -x_5 = lean_unsigned_to_nat(2u); +lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; +x_4 = lean_unsigned_to_nat(1u); +x_5 = lean_nat_add(x_3, x_4); x_6 = l_Lean_Syntax_getArg(x_2, x_5); +lean_dec(x_5); x_7 = l_Lean_Elab_Command_expandOptDeclSig(x_6); lean_dec(x_6); x_8 = lean_ctor_get(x_7, 0); @@ -5247,67 +5266,63 @@ lean_inc(x_8); x_9 = lean_ctor_get(x_7, 1); lean_inc(x_9); lean_dec(x_7); -x_10 = lean_unsigned_to_nat(1u); -x_11 = l_Lean_Syntax_getArg(x_2, x_10); -x_12 = lean_unsigned_to_nat(3u); +x_10 = l_Lean_Syntax_getArg(x_2, x_3); +x_11 = lean_unsigned_to_nat(2u); +x_12 = lean_nat_add(x_3, x_11); x_13 = l_Lean_Syntax_getArg(x_2, x_12); +lean_dec(x_12); x_14 = l_Lean_Syntax_getArgs(x_13); lean_dec(x_13); -x_15 = l_Lean_Elab_Command_elabInductiveCore(x_2, x_1, x_11, x_8, x_9, x_14, x_3, x_4); -lean_dec(x_14); -lean_dec(x_9); -lean_dec(x_11); +x_15 = lean_alloc_ctor(0, 6, 0); +lean_ctor_set(x_15, 0, x_2); +lean_ctor_set(x_15, 1, x_1); +lean_ctor_set(x_15, 2, x_10); +lean_ctor_set(x_15, 3, x_8); +lean_ctor_set(x_15, 4, x_9); +lean_ctor_set(x_15, 5, x_14); return x_15; } } -lean_object* l_Lean_Elab_Command_elabInductive___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { -lean_object* x_5; -x_5 = l_Lean_Elab_Command_elabInductive(x_1, x_2, x_3, x_4); -lean_dec(x_1); -return x_5; +lean_object* x_4; +x_4 = l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(x_1, x_2, x_3); +lean_dec(x_3); +return x_4; } } -lean_object* _init_l_Lean_Elab_Command_elabClassInductive___closed__1() { +lean_object* l___private_Lean_Elab_Declaration_2__classInductiveSyntaxToView(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_1; lean_object* x_2; lean_object* x_3; -x_1 = l_Lean_registerClassAttr___closed__2; -x_2 = lean_box(0); -x_3 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_3, 0, x_1); -lean_ctor_set(x_3, 1, x_2); -return x_3; +lean_object* x_3; lean_object* x_4; +x_3 = lean_unsigned_to_nat(2u); +x_4 = l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(x_1, x_2, x_3); +return x_4; +} +} +lean_object* l_Lean_Elab_Command_elabInductive(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 = lean_unsigned_to_nat(1u); +x_6 = l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(x_1, x_2, x_5); +x_7 = l_Lean_mkOptionalNode___closed__2; +x_8 = lean_array_push(x_7, x_6); +x_9 = l_Lean_Elab_Command_elabInductiveCore(x_8, x_3, x_4); +return x_9; } } lean_object* l_Lean_Elab_Command_elabClassInductive(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; -x_5 = lean_unsigned_to_nat(3u); -x_6 = l_Lean_Syntax_getArg(x_2, x_5); -x_7 = l_Lean_Elab_Command_expandOptDeclSig(x_6); -lean_dec(x_6); -x_8 = lean_ctor_get(x_7, 0); -lean_inc(x_8); -x_9 = lean_ctor_get(x_7, 1); -lean_inc(x_9); -lean_dec(x_7); -x_10 = l_Lean_Elab_Command_elabClassInductive___closed__1; -x_11 = l_Lean_Elab_Command_Modifiers_addAttribute(x_1, x_10); -x_12 = lean_unsigned_to_nat(2u); -x_13 = l_Lean_Syntax_getArg(x_2, x_12); -x_14 = lean_unsigned_to_nat(4u); -x_15 = l_Lean_Syntax_getArg(x_2, x_14); -x_16 = l_Lean_Syntax_getArgs(x_15); -lean_dec(x_15); -x_17 = l_Lean_Elab_Command_elabInductiveCore(x_2, x_11, x_13, x_8, x_9, x_16, x_3, x_4); -lean_dec(x_16); -lean_dec(x_9); -lean_dec(x_13); -lean_dec(x_11); -return x_17; +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_5 = lean_unsigned_to_nat(2u); +x_6 = l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(x_1, x_2, x_5); +x_7 = l_Lean_mkOptionalNode___closed__2; +x_8 = lean_array_push(x_7, x_6); +x_9 = l_Lean_Elab_Command_elabInductiveCore(x_8, x_3, x_4); +return x_9; } } lean_object* l_Lean_Elab_Command_elabStructure___rarg(lean_object* x_1) { @@ -5482,7 +5497,6 @@ lean_object* x_37; lean_dec(x_12); lean_free_object(x_6); x_37 = l_Lean_Elab_Command_elabInductive(x_8, x_11, x_2, x_9); -lean_dec(x_8); return x_37; } } @@ -5643,7 +5657,6 @@ else lean_object* x_75; lean_dec(x_49); x_75 = l_Lean_Elab_Command_elabInductive(x_45, x_48, x_2, x_46); -lean_dec(x_45); return x_75; } } @@ -5758,6 +5771,303 @@ x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); return x_5; } } +uint8_t l_Array_anyRangeMAux___main___at___private_Lean_Elab_Declaration_3__isMutualInductive___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +uint8_t x_5; +x_5 = lean_nat_dec_lt(x_4, x_3); +if (x_5 == 0) +{ +uint8_t x_6; +lean_dec(x_4); +x_6 = 0; +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; uint8_t x_12; +x_7 = lean_array_fget(x_2, x_4); +x_8 = lean_unsigned_to_nat(1u); +x_9 = l_Lean_Syntax_getArg(x_7, x_8); +lean_dec(x_7); +x_10 = l_Lean_Syntax_getKind(x_9); +x_11 = l_Lean_Parser_Command_inductive___elambda__1___closed__2; +x_12 = lean_name_eq(x_10, x_11); +lean_dec(x_10); +if (x_12 == 0) +{ +uint8_t x_13; +lean_dec(x_4); +x_13 = 1; +return x_13; +} +else +{ +lean_object* x_14; +x_14 = lean_nat_add(x_4, x_8); +lean_dec(x_4); +x_4 = x_14; +goto _start; +} +} +} +} +uint8_t l___private_Lean_Elab_Declaration_3__isMutualInductive(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; uint8_t x_7; +x_2 = lean_unsigned_to_nat(1u); +x_3 = l_Lean_Syntax_getArg(x_1, x_2); +x_4 = l_Lean_Syntax_getArgs(x_3); +lean_dec(x_3); +x_5 = lean_array_get_size(x_4); +x_6 = lean_unsigned_to_nat(0u); +x_7 = l_Array_anyRangeMAux___main___at___private_Lean_Elab_Declaration_3__isMutualInductive___spec__1(x_1, x_4, x_5, x_6); +lean_dec(x_5); +lean_dec(x_4); +if (x_7 == 0) +{ +uint8_t x_8; +x_8 = 1; +return x_8; +} +else +{ +uint8_t x_9; +x_9 = 0; +return x_9; +} +} +} +lean_object* l_Array_anyRangeMAux___main___at___private_Lean_Elab_Declaration_3__isMutualInductive___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +uint8_t x_5; lean_object* x_6; +x_5 = l_Array_anyRangeMAux___main___at___private_Lean_Elab_Declaration_3__isMutualInductive___spec__1(x_1, x_2, x_3, x_4); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_6 = lean_box(x_5); +return x_6; +} +} +lean_object* l___private_Lean_Elab_Declaration_3__isMutualInductive___boxed(lean_object* x_1) { +_start: +{ +uint8_t x_2; lean_object* x_3; +x_2 = l___private_Lean_Elab_Declaration_3__isMutualInductive(x_1); +lean_dec(x_1); +x_3 = lean_box(x_2); +return x_3; +} +} +lean_object* l_Array_umapMAux___main___at___private_Lean_Elab_Declaration_4__elabMutualInductive___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; uint8_t x_6; +x_5 = lean_array_get_size(x_2); +x_6 = lean_nat_dec_lt(x_1, x_5); +lean_dec(x_5); +if (x_6 == 0) +{ +lean_object* x_7; lean_object* x_8; +lean_dec(x_3); +lean_dec(x_1); +x_7 = x_2; +x_8 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_8, 0, x_7); +lean_ctor_set(x_8, 1, x_4); +return x_8; +} +else +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_9 = lean_array_fget(x_2, x_1); +x_10 = lean_unsigned_to_nat(0u); +x_11 = lean_array_fset(x_2, x_1, x_10); +x_12 = x_9; +x_13 = l_Lean_Syntax_getArg(x_12, x_10); +lean_inc(x_3); +x_14 = l_Lean_Elab_Command_elabModifiers(x_13, x_3, x_4); +lean_dec(x_13); +if (lean_obj_tag(x_14) == 0) +{ +lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_15 = lean_ctor_get(x_14, 0); +lean_inc(x_15); +x_16 = lean_ctor_get(x_14, 1); +lean_inc(x_16); +lean_dec(x_14); +x_17 = lean_unsigned_to_nat(1u); +x_18 = l_Lean_Syntax_getArg(x_12, x_17); +lean_dec(x_12); +x_19 = l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView(x_15, x_18, x_17); +x_20 = lean_nat_add(x_1, x_17); +x_21 = x_19; +x_22 = lean_array_fset(x_11, x_1, x_21); +lean_dec(x_1); +x_1 = x_20; +x_2 = x_22; +x_4 = x_16; +goto _start; +} +else +{ +uint8_t x_24; +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_3); +lean_dec(x_1); +x_24 = !lean_is_exclusive(x_14); +if (x_24 == 0) +{ +return x_14; +} +else +{ +lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_25 = lean_ctor_get(x_14, 0); +x_26 = lean_ctor_get(x_14, 1); +lean_inc(x_26); +lean_inc(x_25); +lean_dec(x_14); +x_27 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_27, 0, x_25); +lean_ctor_set(x_27, 1, x_26); +return x_27; +} +} +} +} +} +lean_object* l___private_Lean_Elab_Declaration_4__elabMutualInductive(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_4 = x_1; +x_5 = lean_unsigned_to_nat(0u); +x_6 = lean_alloc_closure((void*)(l_Array_umapMAux___main___at___private_Lean_Elab_Declaration_4__elabMutualInductive___spec__1), 4, 2); +lean_closure_set(x_6, 0, x_5); +lean_closure_set(x_6, 1, x_4); +x_7 = x_6; +lean_inc(x_2); +x_8 = lean_apply_2(x_7, x_2, x_3); +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); +x_11 = l_Lean_Elab_Command_elabInductiveCore(x_9, x_2, x_10); +return x_11; +} +else +{ +uint8_t x_12; +lean_dec(x_2); +x_12 = !lean_is_exclusive(x_8); +if (x_12 == 0) +{ +return x_8; +} +else +{ +lean_object* x_13; lean_object* x_14; lean_object* x_15; +x_13 = lean_ctor_get(x_8, 0); +x_14 = lean_ctor_get(x_8, 1); +lean_inc(x_14); +lean_inc(x_13); +lean_dec(x_8); +x_15 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_15, 0, x_13); +lean_ctor_set(x_15, 1, x_14); +return x_15; +} +} +} +} +lean_object* _init_l_Lean_Elab_Command_elabMutual___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_mk_string("not supported"); +return x_1; +} +} +lean_object* _init_l_Lean_Elab_Command_elabMutual___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Command_elabMutual___closed__1; +x_2 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} +lean_object* _init_l_Lean_Elab_Command_elabMutual___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Command_elabMutual___closed__2; +x_2 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} +lean_object* l_Lean_Elab_Command_elabMutual(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +uint8_t x_4; +x_4 = l___private_Lean_Elab_Declaration_3__isMutualInductive(x_1); +if (x_4 == 0) +{ +lean_object* x_5; lean_object* x_6; +x_5 = l_Lean_Elab_Command_elabMutual___closed__3; +x_6 = l_Lean_Elab_Command_throwError___rarg(x_1, x_5, x_2, x_3); +return x_6; +} +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_7 = lean_unsigned_to_nat(1u); +x_8 = l_Lean_Syntax_getArg(x_1, x_7); +x_9 = l_Lean_Syntax_getArgs(x_8); +lean_dec(x_8); +x_10 = l___private_Lean_Elab_Declaration_4__elabMutualInductive(x_9, x_2, x_3); +return x_10; +} +} +} +lean_object* l_Lean_Elab_Command_elabMutual___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Elab_Command_elabMutual(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} +lean_object* _init_l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabMutual___boxed), 3, 0); +return x_1; +} +} +lean_object* l___regBuiltin_Lean_Elab_Command_elabMutual(lean_object* x_1) { +_start: +{ +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_2 = l_Lean_Elab_Command_commandElabAttribute; +x_3 = l_Lean_Parser_Command_mutual___elambda__1___closed__2; +x_4 = l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1; +x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); +return x_5; +} +} lean_object* initialize_Init(lean_object*); lean_object* initialize_Lean_Util_CollectLevelParams(lean_object*); lean_object* initialize_Lean_Elab_Definition(lean_object*); @@ -5811,8 +6121,6 @@ l_Lean_Elab_Command_elabExample___closed__1 = _init_l_Lean_Elab_Command_elabExam lean_mark_persistent(l_Lean_Elab_Command_elabExample___closed__1); l_Lean_Elab_Command_elabExample___closed__2 = _init_l_Lean_Elab_Command_elabExample___closed__2(); lean_mark_persistent(l_Lean_Elab_Command_elabExample___closed__2); -l_Lean_Elab_Command_elabClassInductive___closed__1 = _init_l_Lean_Elab_Command_elabClassInductive___closed__1(); -lean_mark_persistent(l_Lean_Elab_Command_elabClassInductive___closed__1); l_Lean_Elab_Command_elabDeclaration___closed__1 = _init_l_Lean_Elab_Command_elabDeclaration___closed__1(); lean_mark_persistent(l_Lean_Elab_Command_elabDeclaration___closed__1); l_Lean_Elab_Command_elabDeclaration___closed__2 = _init_l_Lean_Elab_Command_elabDeclaration___closed__2(); @@ -5826,6 +6134,17 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__ res = l___regBuiltin_Lean_Elab_Command_elabDeclaration(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l_Lean_Elab_Command_elabMutual___closed__1 = _init_l_Lean_Elab_Command_elabMutual___closed__1(); +lean_mark_persistent(l_Lean_Elab_Command_elabMutual___closed__1); +l_Lean_Elab_Command_elabMutual___closed__2 = _init_l_Lean_Elab_Command_elabMutual___closed__2(); +lean_mark_persistent(l_Lean_Elab_Command_elabMutual___closed__2); +l_Lean_Elab_Command_elabMutual___closed__3 = _init_l_Lean_Elab_Command_elabMutual___closed__3(); +lean_mark_persistent(l_Lean_Elab_Command_elabMutual___closed__3); +l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1 = _init_l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1(); +lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_elabMutual___closed__1); +res = l___regBuiltin_Lean_Elab_Command_elabMutual(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/Lean/Elab/Inductive.c b/stage0/stdlib/Lean/Elab/Inductive.c index b9ac83cd6b..53b3d6eca1 100644 --- a/stage0/stdlib/Lean/Elab/Inductive.c +++ b/stage0/stdlib/Lean/Elab/Inductive.c @@ -13,57 +13,84 @@ #ifdef __cplusplus extern "C" { #endif -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__4(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_checkNotAlreadyDeclared(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_extractMacroScopes(lean_object*); -lean_object* l_unreachable_x21___rarg(lean_object*); -lean_object* l_Lean_Elab_Command_elabInductiveCore___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); -uint8_t l_List_elem___main___at_Lean_NameHashSet_insert___spec__2(lean_object*, lean_object*); +lean_object* l_List_toString___at_Lean_Elab_Command_elabInductiveCore___spec__2(lean_object*); +extern lean_object* l_List_repr___rarg___closed__1; +lean_object* l_Lean_Elab_Command_InductiveView_inhabited; +lean_object* l_Lean_Format_pretty(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabInductiveCore___closed__1; -lean_object* l_Lean_Elab_Command_elabInductiveCore___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_elabInductiveCore(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__3(lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Command_elabInductiveCore(lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; -lean_object* l___private_Lean_Elab_Command_6__mkTermContext(lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_Command_3__setState(lean_object*, lean_object*, lean_object*); +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__1(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); +lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabInductiveCore___closed__2; -lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +extern lean_object* l_String_splitAux___main___closed__1; +extern lean_object* l_List_repr___rarg___closed__3; lean_object* lean_nat_add(lean_object*, lean_object*); -lean_object* l_Array_foldlStepMAux___main___at_Lean_Elab_Term_elabParen___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); -extern lean_object* l_IO_FS_Handle_putStrLn___rarg___closed__1; -lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_mkDeclName(lean_object*, lean_object*, lean_object*, lean_object*); -extern lean_object* l_Lean_Meta_dbgTrace___rarg___closed__1; +extern lean_object* l_Array_HasRepr___rarg___closed__1; lean_object* lean_array_fget(lean_object*, lean_object*); -lean_object* l_List_toString___at_Lean_Elab_OpenDecl_HasToString___spec__2(lean_object*); -lean_object* l_Lean_Elab_Command_expandDeclId(lean_object*); -lean_object* l_Lean_Syntax_getId(lean_object*); -lean_object* lean_name_mk_string(lean_object*, lean_object*); +lean_object* l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3___boxed(lean_object*, lean_object*); +lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); +lean_object* lean_array_fset(lean_object*, lean_object*, lean_object*); +extern lean_object* l_List_repr___rarg___closed__2; lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -extern lean_object* l_Lean_Parser_Command_namespace___elambda__1___closed__1; +extern lean_object* l_List_reprAux___main___rarg___closed__1; lean_object* l_Lean_Elab_Command_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__1(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__2(lean_object*, lean_object*, lean_object*); -extern lean_object* l_Lean_Elab_Command_modifyScope___closed__1; -extern lean_object* l_Lean_Elab_Command_withDeclId___closed__3; -lean_object* l___private_Lean_Elab_Command_2__getState(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_elabInductiveCore___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_Command_7__mkTermState(lean_object*); -lean_object* l_Lean_Syntax_getArgs(lean_object*); -lean_object* l_Lean_MacroScopesView_review(lean_object*); +extern lean_object* l_Lean_Options_empty; +lean_object* l_Lean_Elab_Command_InductiveView_inhabited___closed__1; +lean_object* l_Lean_Elab_Command_InductiveView_inhabited___closed__2; lean_object* l_Lean_Elab_Command_mkInductive(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_mkInductive___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_Command_9__getVarDecls(lean_object*); -uint8_t l_Lean_Syntax_isNone(lean_object*); -lean_object* l_Array_forMAux___main___at_Lean_Elab_Command_applyAttributes___spec__1(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_getLevelNames(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Command_throwAlreadyDeclaredUniverseLevel___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_elabBinders___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_Command_12__addScopes___main(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); -extern lean_object* l_Lean_Elab_Command_liftTermElabM___rarg___closed__1; +lean_object* l_Array_toList___rarg(lean_object*); +lean_object* l_Lean_Syntax_formatStxAux___main(lean_object*, uint8_t, lean_object*, lean_object*); +lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*); +lean_object* l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3(uint8_t, lean_object*); +lean_object* l_Lean_Elab_Command_elabInductiveCore___closed__3; uint8_t lean_nat_dec_lt(lean_object*, lean_object*); +lean_object* _init_l_Lean_Elab_Command_InductiveView_inhabited___closed__1() { +_start: +{ +lean_object* x_1; uint8_t x_2; uint8_t x_3; lean_object* x_4; lean_object* x_5; +x_1 = lean_box(0); +x_2 = 0; +x_3 = 0; +x_4 = l_Array_empty___closed__1; +x_5 = lean_alloc_ctor(0, 2, 4); +lean_ctor_set(x_5, 0, x_1); +lean_ctor_set(x_5, 1, x_4); +lean_ctor_set_uint8(x_5, sizeof(void*)*2, x_2); +lean_ctor_set_uint8(x_5, sizeof(void*)*2 + 1, x_3); +lean_ctor_set_uint8(x_5, sizeof(void*)*2 + 2, x_3); +lean_ctor_set_uint8(x_5, sizeof(void*)*2 + 3, x_3); +return x_5; +} +} +lean_object* _init_l_Lean_Elab_Command_InductiveView_inhabited___closed__2() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_1 = lean_box(0); +x_2 = lean_box(0); +x_3 = l_Lean_Elab_Command_InductiveView_inhabited___closed__1; +x_4 = l_Array_empty___closed__1; +x_5 = lean_alloc_ctor(0, 6, 0); +lean_ctor_set(x_5, 0, x_2); +lean_ctor_set(x_5, 1, x_3); +lean_ctor_set(x_5, 2, x_2); +lean_ctor_set(x_5, 3, x_2); +lean_ctor_set(x_5, 4, x_1); +lean_ctor_set(x_5, 5, x_4); +return x_5; +} +} +lean_object* _init_l_Lean_Elab_Command_InductiveView_inhabited() { +_start: +{ +lean_object* x_1; +x_1 = l_Lean_Elab_Command_InductiveView_inhabited___closed__2; +return x_1; +} +} lean_object* l_Lean_Elab_Command_mkInductive(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { _start: { @@ -90,2279 +117,134 @@ lean_dec(x_2); return x_10; } } -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_Array_umapMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__1(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_4; -lean_inc(x_2); -x_4 = l___private_Lean_Elab_Command_2__getState(x_2, x_3); -if (lean_obj_tag(x_4) == 0) -{ -lean_object* x_5; lean_object* x_6; -x_5 = lean_ctor_get(x_4, 0); -lean_inc(x_5); -x_6 = lean_ctor_get(x_5, 2); -lean_inc(x_6); -if (lean_obj_tag(x_6) == 0) -{ -lean_object* x_7; uint8_t x_8; -lean_dec(x_1); -x_7 = lean_ctor_get(x_4, 1); -lean_inc(x_7); -lean_dec(x_4); -x_8 = !lean_is_exclusive(x_5); -if (x_8 == 0) -{ -lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; -x_9 = lean_ctor_get(x_5, 2); -lean_dec(x_9); -x_10 = l_Lean_Elab_Command_modifyScope___closed__1; -x_11 = l_unreachable_x21___rarg(x_10); -lean_ctor_set(x_5, 2, x_11); -x_12 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_7); -if (lean_obj_tag(x_12) == 0) -{ -uint8_t x_13; -x_13 = !lean_is_exclusive(x_12); -if (x_13 == 0) -{ -lean_object* x_14; lean_object* x_15; -x_14 = lean_ctor_get(x_12, 0); -lean_dec(x_14); -x_15 = lean_box(0); -lean_ctor_set(x_12, 0, x_15); -return x_12; -} -else -{ -lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_12, 1); -lean_inc(x_16); -lean_dec(x_12); -x_17 = lean_box(0); -x_18 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_18, 0, x_17); -lean_ctor_set(x_18, 1, x_16); -return x_18; -} -} -else -{ -uint8_t x_19; -x_19 = !lean_is_exclusive(x_12); -if (x_19 == 0) -{ -return x_12; -} -else -{ -lean_object* x_20; lean_object* x_21; lean_object* x_22; -x_20 = lean_ctor_get(x_12, 0); -x_21 = lean_ctor_get(x_12, 1); -lean_inc(x_21); -lean_inc(x_20); -lean_dec(x_12); -x_22 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_22, 0, x_20); -lean_ctor_set(x_22, 1, x_21); -return x_22; -} -} -} -else -{ -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_23 = lean_ctor_get(x_5, 0); -x_24 = lean_ctor_get(x_5, 1); -x_25 = lean_ctor_get(x_5, 3); -x_26 = lean_ctor_get(x_5, 4); -lean_inc(x_26); -lean_inc(x_25); -lean_inc(x_24); -lean_inc(x_23); -lean_dec(x_5); -x_27 = l_Lean_Elab_Command_modifyScope___closed__1; -x_28 = l_unreachable_x21___rarg(x_27); -x_29 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_29, 0, x_23); -lean_ctor_set(x_29, 1, x_24); -lean_ctor_set(x_29, 2, x_28); -lean_ctor_set(x_29, 3, x_25); -lean_ctor_set(x_29, 4, x_26); -x_30 = l___private_Lean_Elab_Command_3__setState(x_29, x_2, x_7); -if (lean_obj_tag(x_30) == 0) -{ -lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; -x_31 = lean_ctor_get(x_30, 1); -lean_inc(x_31); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_32 = x_30; -} else { - lean_dec_ref(x_30); - x_32 = lean_box(0); -} -x_33 = lean_box(0); -if (lean_is_scalar(x_32)) { - x_34 = lean_alloc_ctor(0, 2, 0); -} else { - x_34 = x_32; -} -lean_ctor_set(x_34, 0, x_33); -lean_ctor_set(x_34, 1, x_31); -return x_34; -} -else -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; -x_35 = lean_ctor_get(x_30, 0); -lean_inc(x_35); -x_36 = lean_ctor_get(x_30, 1); -lean_inc(x_36); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_37 = x_30; -} else { - lean_dec_ref(x_30); - x_37 = lean_box(0); -} -if (lean_is_scalar(x_37)) { - x_38 = lean_alloc_ctor(1, 2, 0); -} else { - x_38 = x_37; -} -lean_ctor_set(x_38, 0, x_35); -lean_ctor_set(x_38, 1, x_36); -return x_38; -} -} -} -else -{ -lean_object* x_39; lean_object* x_40; uint8_t x_41; -x_39 = lean_ctor_get(x_6, 0); -lean_inc(x_39); -x_40 = lean_ctor_get(x_4, 1); -lean_inc(x_40); -lean_dec(x_4); -x_41 = !lean_is_exclusive(x_5); -if (x_41 == 0) -{ -lean_object* x_42; uint8_t x_43; -x_42 = lean_ctor_get(x_5, 2); -lean_dec(x_42); -x_43 = !lean_is_exclusive(x_6); -if (x_43 == 0) -{ -lean_object* x_44; uint8_t x_45; -x_44 = lean_ctor_get(x_6, 0); -lean_dec(x_44); -x_45 = !lean_is_exclusive(x_39); -if (x_45 == 0) -{ -lean_object* x_46; lean_object* x_47; -x_46 = lean_ctor_get(x_39, 5); -lean_dec(x_46); -lean_ctor_set(x_39, 5, x_1); -x_47 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_47) == 0) -{ -uint8_t x_48; -x_48 = !lean_is_exclusive(x_47); -if (x_48 == 0) -{ -lean_object* x_49; lean_object* x_50; -x_49 = lean_ctor_get(x_47, 0); -lean_dec(x_49); -x_50 = lean_box(0); -lean_ctor_set(x_47, 0, x_50); -return x_47; -} -else -{ -lean_object* x_51; lean_object* x_52; lean_object* x_53; -x_51 = lean_ctor_get(x_47, 1); -lean_inc(x_51); -lean_dec(x_47); -x_52 = lean_box(0); -x_53 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_53, 0, x_52); -lean_ctor_set(x_53, 1, x_51); -return x_53; -} -} -else -{ -uint8_t x_54; -x_54 = !lean_is_exclusive(x_47); -if (x_54 == 0) -{ -return x_47; -} -else -{ -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_47, 0); -x_56 = lean_ctor_get(x_47, 1); -lean_inc(x_56); -lean_inc(x_55); -lean_dec(x_47); -x_57 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_57, 0, x_55); -lean_ctor_set(x_57, 1, x_56); -return x_57; -} -} -} -else -{ -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; -x_58 = lean_ctor_get(x_39, 0); -x_59 = lean_ctor_get(x_39, 1); -x_60 = lean_ctor_get(x_39, 2); -x_61 = lean_ctor_get(x_39, 3); -x_62 = lean_ctor_get(x_39, 4); -x_63 = lean_ctor_get(x_39, 6); -lean_inc(x_63); -lean_inc(x_62); -lean_inc(x_61); -lean_inc(x_60); -lean_inc(x_59); -lean_inc(x_58); -lean_dec(x_39); -x_64 = lean_alloc_ctor(0, 7, 0); -lean_ctor_set(x_64, 0, x_58); -lean_ctor_set(x_64, 1, x_59); -lean_ctor_set(x_64, 2, x_60); -lean_ctor_set(x_64, 3, x_61); -lean_ctor_set(x_64, 4, x_62); -lean_ctor_set(x_64, 5, x_1); -lean_ctor_set(x_64, 6, x_63); -lean_ctor_set(x_6, 0, x_64); -x_65 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_65) == 0) -{ -lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; -x_66 = lean_ctor_get(x_65, 1); -lean_inc(x_66); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_67 = x_65; -} else { - lean_dec_ref(x_65); - x_67 = lean_box(0); -} -x_68 = lean_box(0); -if (lean_is_scalar(x_67)) { - x_69 = lean_alloc_ctor(0, 2, 0); -} else { - x_69 = x_67; -} -lean_ctor_set(x_69, 0, x_68); -lean_ctor_set(x_69, 1, x_66); -return x_69; -} -else -{ -lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; -x_70 = lean_ctor_get(x_65, 0); -lean_inc(x_70); -x_71 = lean_ctor_get(x_65, 1); -lean_inc(x_71); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_72 = x_65; -} else { - lean_dec_ref(x_65); - x_72 = lean_box(0); -} -if (lean_is_scalar(x_72)) { - x_73 = lean_alloc_ctor(1, 2, 0); -} else { - x_73 = x_72; -} -lean_ctor_set(x_73, 0, x_70); -lean_ctor_set(x_73, 1, x_71); -return x_73; -} -} -} -else -{ -lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; -x_74 = lean_ctor_get(x_6, 1); -lean_inc(x_74); -lean_dec(x_6); -x_75 = lean_ctor_get(x_39, 0); -lean_inc(x_75); -x_76 = lean_ctor_get(x_39, 1); -lean_inc(x_76); -x_77 = lean_ctor_get(x_39, 2); -lean_inc(x_77); -x_78 = lean_ctor_get(x_39, 3); -lean_inc(x_78); -x_79 = lean_ctor_get(x_39, 4); -lean_inc(x_79); -x_80 = lean_ctor_get(x_39, 6); -lean_inc(x_80); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_81 = x_39; -} else { - lean_dec_ref(x_39); - x_81 = lean_box(0); -} -if (lean_is_scalar(x_81)) { - x_82 = lean_alloc_ctor(0, 7, 0); -} else { - x_82 = x_81; -} -lean_ctor_set(x_82, 0, x_75); -lean_ctor_set(x_82, 1, x_76); -lean_ctor_set(x_82, 2, x_77); -lean_ctor_set(x_82, 3, x_78); -lean_ctor_set(x_82, 4, x_79); -lean_ctor_set(x_82, 5, x_1); -lean_ctor_set(x_82, 6, x_80); -x_83 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_83, 0, x_82); -lean_ctor_set(x_83, 1, x_74); -lean_ctor_set(x_5, 2, x_83); -x_84 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_84) == 0) -{ -lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; -x_85 = lean_ctor_get(x_84, 1); -lean_inc(x_85); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_86 = x_84; -} else { - lean_dec_ref(x_84); - x_86 = lean_box(0); -} -x_87 = lean_box(0); -if (lean_is_scalar(x_86)) { - x_88 = lean_alloc_ctor(0, 2, 0); -} else { - x_88 = x_86; -} -lean_ctor_set(x_88, 0, x_87); -lean_ctor_set(x_88, 1, x_85); -return x_88; -} -else -{ -lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; -x_89 = lean_ctor_get(x_84, 0); -lean_inc(x_89); -x_90 = lean_ctor_get(x_84, 1); -lean_inc(x_90); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_91 = x_84; -} else { - lean_dec_ref(x_84); - x_91 = lean_box(0); -} -if (lean_is_scalar(x_91)) { - x_92 = lean_alloc_ctor(1, 2, 0); -} else { - x_92 = x_91; -} -lean_ctor_set(x_92, 0, x_89); -lean_ctor_set(x_92, 1, x_90); -return x_92; -} -} -} -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; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; -x_93 = lean_ctor_get(x_5, 0); -x_94 = lean_ctor_get(x_5, 1); -x_95 = lean_ctor_get(x_5, 3); -x_96 = lean_ctor_get(x_5, 4); -lean_inc(x_96); -lean_inc(x_95); -lean_inc(x_94); -lean_inc(x_93); -lean_dec(x_5); -x_97 = lean_ctor_get(x_6, 1); -lean_inc(x_97); -if (lean_is_exclusive(x_6)) { - lean_ctor_release(x_6, 0); - lean_ctor_release(x_6, 1); - x_98 = x_6; -} else { - lean_dec_ref(x_6); - x_98 = lean_box(0); -} -x_99 = lean_ctor_get(x_39, 0); -lean_inc(x_99); -x_100 = lean_ctor_get(x_39, 1); -lean_inc(x_100); -x_101 = lean_ctor_get(x_39, 2); -lean_inc(x_101); -x_102 = lean_ctor_get(x_39, 3); -lean_inc(x_102); -x_103 = lean_ctor_get(x_39, 4); -lean_inc(x_103); -x_104 = lean_ctor_get(x_39, 6); -lean_inc(x_104); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_105 = x_39; -} else { - lean_dec_ref(x_39); - x_105 = lean_box(0); -} -if (lean_is_scalar(x_105)) { - x_106 = lean_alloc_ctor(0, 7, 0); -} else { - x_106 = x_105; -} -lean_ctor_set(x_106, 0, x_99); -lean_ctor_set(x_106, 1, x_100); -lean_ctor_set(x_106, 2, x_101); -lean_ctor_set(x_106, 3, x_102); -lean_ctor_set(x_106, 4, x_103); -lean_ctor_set(x_106, 5, x_1); -lean_ctor_set(x_106, 6, x_104); -if (lean_is_scalar(x_98)) { - x_107 = lean_alloc_ctor(1, 2, 0); -} else { - x_107 = x_98; -} -lean_ctor_set(x_107, 0, x_106); -lean_ctor_set(x_107, 1, x_97); -x_108 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_108, 0, x_93); -lean_ctor_set(x_108, 1, x_94); -lean_ctor_set(x_108, 2, x_107); -lean_ctor_set(x_108, 3, x_95); -lean_ctor_set(x_108, 4, x_96); -x_109 = l___private_Lean_Elab_Command_3__setState(x_108, x_2, x_40); -if (lean_obj_tag(x_109) == 0) -{ -lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; -x_110 = lean_ctor_get(x_109, 1); -lean_inc(x_110); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_111 = x_109; -} else { - lean_dec_ref(x_109); - x_111 = lean_box(0); -} -x_112 = lean_box(0); -if (lean_is_scalar(x_111)) { - x_113 = lean_alloc_ctor(0, 2, 0); -} else { - x_113 = x_111; -} -lean_ctor_set(x_113, 0, x_112); -lean_ctor_set(x_113, 1, x_110); -return x_113; -} -else -{ -lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; -x_114 = lean_ctor_get(x_109, 0); -lean_inc(x_114); -x_115 = lean_ctor_get(x_109, 1); -lean_inc(x_115); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_116 = x_109; -} else { - lean_dec_ref(x_109); - x_116 = lean_box(0); -} -if (lean_is_scalar(x_116)) { - x_117 = lean_alloc_ctor(1, 2, 0); -} else { - x_117 = x_116; -} -lean_ctor_set(x_117, 0, x_114); -lean_ctor_set(x_117, 1, x_115); -return x_117; -} -} -} -} -else -{ -uint8_t x_118; -lean_dec(x_2); -lean_dec(x_1); -x_118 = !lean_is_exclusive(x_4); -if (x_118 == 0) -{ -return x_4; -} -else -{ -lean_object* x_119; lean_object* x_120; lean_object* x_121; -x_119 = lean_ctor_get(x_4, 0); -x_120 = lean_ctor_get(x_4, 1); -lean_inc(x_120); -lean_inc(x_119); -lean_dec(x_4); -x_121 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_121, 0, x_119); -lean_ctor_set(x_121, 1, x_120); -return x_121; -} -} -} -} -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -lean_inc(x_2); -x_4 = l___private_Lean_Elab_Command_2__getState(x_2, x_3); -if (lean_obj_tag(x_4) == 0) -{ -lean_object* x_5; lean_object* x_6; -x_5 = lean_ctor_get(x_4, 0); -lean_inc(x_5); -x_6 = lean_ctor_get(x_5, 2); -lean_inc(x_6); -if (lean_obj_tag(x_6) == 0) -{ -lean_object* x_7; uint8_t x_8; -lean_dec(x_1); -x_7 = lean_ctor_get(x_4, 1); -lean_inc(x_7); -lean_dec(x_4); -x_8 = !lean_is_exclusive(x_5); -if (x_8 == 0) -{ -lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; -x_9 = lean_ctor_get(x_5, 2); -lean_dec(x_9); -x_10 = l_Lean_Elab_Command_modifyScope___closed__1; -x_11 = l_unreachable_x21___rarg(x_10); -lean_ctor_set(x_5, 2, x_11); -x_12 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_7); -if (lean_obj_tag(x_12) == 0) -{ -uint8_t x_13; -x_13 = !lean_is_exclusive(x_12); -if (x_13 == 0) -{ -lean_object* x_14; lean_object* x_15; -x_14 = lean_ctor_get(x_12, 0); -lean_dec(x_14); -x_15 = lean_box(0); -lean_ctor_set(x_12, 0, x_15); -return x_12; -} -else -{ -lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_12, 1); -lean_inc(x_16); -lean_dec(x_12); -x_17 = lean_box(0); -x_18 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_18, 0, x_17); -lean_ctor_set(x_18, 1, x_16); -return x_18; -} -} -else -{ -uint8_t x_19; -x_19 = !lean_is_exclusive(x_12); -if (x_19 == 0) -{ -return x_12; -} -else -{ -lean_object* x_20; lean_object* x_21; lean_object* x_22; -x_20 = lean_ctor_get(x_12, 0); -x_21 = lean_ctor_get(x_12, 1); -lean_inc(x_21); -lean_inc(x_20); -lean_dec(x_12); -x_22 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_22, 0, x_20); -lean_ctor_set(x_22, 1, x_21); -return x_22; -} -} -} -else -{ -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_23 = lean_ctor_get(x_5, 0); -x_24 = lean_ctor_get(x_5, 1); -x_25 = lean_ctor_get(x_5, 3); -x_26 = lean_ctor_get(x_5, 4); -lean_inc(x_26); -lean_inc(x_25); -lean_inc(x_24); -lean_inc(x_23); -lean_dec(x_5); -x_27 = l_Lean_Elab_Command_modifyScope___closed__1; -x_28 = l_unreachable_x21___rarg(x_27); -x_29 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_29, 0, x_23); -lean_ctor_set(x_29, 1, x_24); -lean_ctor_set(x_29, 2, x_28); -lean_ctor_set(x_29, 3, x_25); -lean_ctor_set(x_29, 4, x_26); -x_30 = l___private_Lean_Elab_Command_3__setState(x_29, x_2, x_7); -if (lean_obj_tag(x_30) == 0) -{ -lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; -x_31 = lean_ctor_get(x_30, 1); -lean_inc(x_31); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_32 = x_30; -} else { - lean_dec_ref(x_30); - x_32 = lean_box(0); -} -x_33 = lean_box(0); -if (lean_is_scalar(x_32)) { - x_34 = lean_alloc_ctor(0, 2, 0); -} else { - x_34 = x_32; -} -lean_ctor_set(x_34, 0, x_33); -lean_ctor_set(x_34, 1, x_31); -return x_34; -} -else -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; -x_35 = lean_ctor_get(x_30, 0); -lean_inc(x_35); -x_36 = lean_ctor_get(x_30, 1); -lean_inc(x_36); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_37 = x_30; -} else { - lean_dec_ref(x_30); - x_37 = lean_box(0); -} -if (lean_is_scalar(x_37)) { - x_38 = lean_alloc_ctor(1, 2, 0); -} else { - x_38 = x_37; -} -lean_ctor_set(x_38, 0, x_35); -lean_ctor_set(x_38, 1, x_36); -return x_38; -} -} -} -else -{ -lean_object* x_39; lean_object* x_40; uint8_t x_41; -x_39 = lean_ctor_get(x_6, 0); -lean_inc(x_39); -x_40 = lean_ctor_get(x_4, 1); -lean_inc(x_40); -lean_dec(x_4); -x_41 = !lean_is_exclusive(x_5); -if (x_41 == 0) -{ -lean_object* x_42; uint8_t x_43; -x_42 = lean_ctor_get(x_5, 2); -lean_dec(x_42); -x_43 = !lean_is_exclusive(x_6); -if (x_43 == 0) -{ -lean_object* x_44; uint8_t x_45; -x_44 = lean_ctor_get(x_6, 0); -lean_dec(x_44); -x_45 = !lean_is_exclusive(x_39); -if (x_45 == 0) -{ -lean_object* x_46; lean_object* x_47; -x_46 = lean_ctor_get(x_39, 5); -lean_dec(x_46); -lean_ctor_set(x_39, 5, x_1); -x_47 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_47) == 0) -{ -uint8_t x_48; -x_48 = !lean_is_exclusive(x_47); -if (x_48 == 0) -{ -lean_object* x_49; lean_object* x_50; -x_49 = lean_ctor_get(x_47, 0); -lean_dec(x_49); -x_50 = lean_box(0); -lean_ctor_set(x_47, 0, x_50); -return x_47; -} -else -{ -lean_object* x_51; lean_object* x_52; lean_object* x_53; -x_51 = lean_ctor_get(x_47, 1); -lean_inc(x_51); -lean_dec(x_47); -x_52 = lean_box(0); -x_53 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_53, 0, x_52); -lean_ctor_set(x_53, 1, x_51); -return x_53; -} -} -else -{ -uint8_t x_54; -x_54 = !lean_is_exclusive(x_47); -if (x_54 == 0) -{ -return x_47; -} -else -{ -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_47, 0); -x_56 = lean_ctor_get(x_47, 1); -lean_inc(x_56); -lean_inc(x_55); -lean_dec(x_47); -x_57 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_57, 0, x_55); -lean_ctor_set(x_57, 1, x_56); -return x_57; -} -} -} -else -{ -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; -x_58 = lean_ctor_get(x_39, 0); -x_59 = lean_ctor_get(x_39, 1); -x_60 = lean_ctor_get(x_39, 2); -x_61 = lean_ctor_get(x_39, 3); -x_62 = lean_ctor_get(x_39, 4); -x_63 = lean_ctor_get(x_39, 6); -lean_inc(x_63); -lean_inc(x_62); -lean_inc(x_61); -lean_inc(x_60); -lean_inc(x_59); -lean_inc(x_58); -lean_dec(x_39); -x_64 = lean_alloc_ctor(0, 7, 0); -lean_ctor_set(x_64, 0, x_58); -lean_ctor_set(x_64, 1, x_59); -lean_ctor_set(x_64, 2, x_60); -lean_ctor_set(x_64, 3, x_61); -lean_ctor_set(x_64, 4, x_62); -lean_ctor_set(x_64, 5, x_1); -lean_ctor_set(x_64, 6, x_63); -lean_ctor_set(x_6, 0, x_64); -x_65 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_65) == 0) -{ -lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; -x_66 = lean_ctor_get(x_65, 1); -lean_inc(x_66); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_67 = x_65; -} else { - lean_dec_ref(x_65); - x_67 = lean_box(0); -} -x_68 = lean_box(0); -if (lean_is_scalar(x_67)) { - x_69 = lean_alloc_ctor(0, 2, 0); -} else { - x_69 = x_67; -} -lean_ctor_set(x_69, 0, x_68); -lean_ctor_set(x_69, 1, x_66); -return x_69; -} -else -{ -lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; -x_70 = lean_ctor_get(x_65, 0); -lean_inc(x_70); -x_71 = lean_ctor_get(x_65, 1); -lean_inc(x_71); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_72 = x_65; -} else { - lean_dec_ref(x_65); - x_72 = lean_box(0); -} -if (lean_is_scalar(x_72)) { - x_73 = lean_alloc_ctor(1, 2, 0); -} else { - x_73 = x_72; -} -lean_ctor_set(x_73, 0, x_70); -lean_ctor_set(x_73, 1, x_71); -return x_73; -} -} -} -else -{ -lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; -x_74 = lean_ctor_get(x_6, 1); -lean_inc(x_74); -lean_dec(x_6); -x_75 = lean_ctor_get(x_39, 0); -lean_inc(x_75); -x_76 = lean_ctor_get(x_39, 1); -lean_inc(x_76); -x_77 = lean_ctor_get(x_39, 2); -lean_inc(x_77); -x_78 = lean_ctor_get(x_39, 3); -lean_inc(x_78); -x_79 = lean_ctor_get(x_39, 4); -lean_inc(x_79); -x_80 = lean_ctor_get(x_39, 6); -lean_inc(x_80); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_81 = x_39; -} else { - lean_dec_ref(x_39); - x_81 = lean_box(0); -} -if (lean_is_scalar(x_81)) { - x_82 = lean_alloc_ctor(0, 7, 0); -} else { - x_82 = x_81; -} -lean_ctor_set(x_82, 0, x_75); -lean_ctor_set(x_82, 1, x_76); -lean_ctor_set(x_82, 2, x_77); -lean_ctor_set(x_82, 3, x_78); -lean_ctor_set(x_82, 4, x_79); -lean_ctor_set(x_82, 5, x_1); -lean_ctor_set(x_82, 6, x_80); -x_83 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_83, 0, x_82); -lean_ctor_set(x_83, 1, x_74); -lean_ctor_set(x_5, 2, x_83); -x_84 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_84) == 0) -{ -lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; -x_85 = lean_ctor_get(x_84, 1); -lean_inc(x_85); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_86 = x_84; -} else { - lean_dec_ref(x_84); - x_86 = lean_box(0); -} -x_87 = lean_box(0); -if (lean_is_scalar(x_86)) { - x_88 = lean_alloc_ctor(0, 2, 0); -} else { - x_88 = x_86; -} -lean_ctor_set(x_88, 0, x_87); -lean_ctor_set(x_88, 1, x_85); -return x_88; -} -else -{ -lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; -x_89 = lean_ctor_get(x_84, 0); -lean_inc(x_89); -x_90 = lean_ctor_get(x_84, 1); -lean_inc(x_90); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_91 = x_84; -} else { - lean_dec_ref(x_84); - x_91 = lean_box(0); -} -if (lean_is_scalar(x_91)) { - x_92 = lean_alloc_ctor(1, 2, 0); -} else { - x_92 = x_91; -} -lean_ctor_set(x_92, 0, x_89); -lean_ctor_set(x_92, 1, x_90); -return x_92; -} -} -} -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; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; -x_93 = lean_ctor_get(x_5, 0); -x_94 = lean_ctor_get(x_5, 1); -x_95 = lean_ctor_get(x_5, 3); -x_96 = lean_ctor_get(x_5, 4); -lean_inc(x_96); -lean_inc(x_95); -lean_inc(x_94); -lean_inc(x_93); -lean_dec(x_5); -x_97 = lean_ctor_get(x_6, 1); -lean_inc(x_97); -if (lean_is_exclusive(x_6)) { - lean_ctor_release(x_6, 0); - lean_ctor_release(x_6, 1); - x_98 = x_6; -} else { - lean_dec_ref(x_6); - x_98 = lean_box(0); -} -x_99 = lean_ctor_get(x_39, 0); -lean_inc(x_99); -x_100 = lean_ctor_get(x_39, 1); -lean_inc(x_100); -x_101 = lean_ctor_get(x_39, 2); -lean_inc(x_101); -x_102 = lean_ctor_get(x_39, 3); -lean_inc(x_102); -x_103 = lean_ctor_get(x_39, 4); -lean_inc(x_103); -x_104 = lean_ctor_get(x_39, 6); -lean_inc(x_104); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_105 = x_39; -} else { - lean_dec_ref(x_39); - x_105 = lean_box(0); -} -if (lean_is_scalar(x_105)) { - x_106 = lean_alloc_ctor(0, 7, 0); -} else { - x_106 = x_105; -} -lean_ctor_set(x_106, 0, x_99); -lean_ctor_set(x_106, 1, x_100); -lean_ctor_set(x_106, 2, x_101); -lean_ctor_set(x_106, 3, x_102); -lean_ctor_set(x_106, 4, x_103); -lean_ctor_set(x_106, 5, x_1); -lean_ctor_set(x_106, 6, x_104); -if (lean_is_scalar(x_98)) { - x_107 = lean_alloc_ctor(1, 2, 0); -} else { - x_107 = x_98; -} -lean_ctor_set(x_107, 0, x_106); -lean_ctor_set(x_107, 1, x_97); -x_108 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_108, 0, x_93); -lean_ctor_set(x_108, 1, x_94); -lean_ctor_set(x_108, 2, x_107); -lean_ctor_set(x_108, 3, x_95); -lean_ctor_set(x_108, 4, x_96); -x_109 = l___private_Lean_Elab_Command_3__setState(x_108, x_2, x_40); -if (lean_obj_tag(x_109) == 0) -{ -lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; -x_110 = lean_ctor_get(x_109, 1); -lean_inc(x_110); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_111 = x_109; -} else { - lean_dec_ref(x_109); - x_111 = lean_box(0); -} -x_112 = lean_box(0); -if (lean_is_scalar(x_111)) { - x_113 = lean_alloc_ctor(0, 2, 0); -} else { - x_113 = x_111; -} -lean_ctor_set(x_113, 0, x_112); -lean_ctor_set(x_113, 1, x_110); -return x_113; -} -else -{ -lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; -x_114 = lean_ctor_get(x_109, 0); -lean_inc(x_114); -x_115 = lean_ctor_get(x_109, 1); -lean_inc(x_115); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_116 = x_109; -} else { - lean_dec_ref(x_109); - x_116 = lean_box(0); -} -if (lean_is_scalar(x_116)) { - x_117 = lean_alloc_ctor(1, 2, 0); -} else { - x_117 = x_116; -} -lean_ctor_set(x_117, 0, x_114); -lean_ctor_set(x_117, 1, x_115); -return x_117; -} -} -} -} -else -{ -uint8_t x_118; -lean_dec(x_2); -lean_dec(x_1); -x_118 = !lean_is_exclusive(x_4); -if (x_118 == 0) -{ -return x_4; -} -else -{ -lean_object* x_119; lean_object* x_120; lean_object* x_121; -x_119 = lean_ctor_get(x_4, 0); -x_120 = lean_ctor_get(x_4, 1); -lean_inc(x_120); -lean_inc(x_119); -lean_dec(x_4); -x_121 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_121, 0, x_119); -lean_ctor_set(x_121, 1, x_120); -return x_121; -} -} -} -} -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__3(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -lean_inc(x_2); -x_4 = l___private_Lean_Elab_Command_2__getState(x_2, x_3); -if (lean_obj_tag(x_4) == 0) -{ -lean_object* x_5; lean_object* x_6; -x_5 = lean_ctor_get(x_4, 0); -lean_inc(x_5); -x_6 = lean_ctor_get(x_5, 2); -lean_inc(x_6); -if (lean_obj_tag(x_6) == 0) -{ -lean_object* x_7; uint8_t x_8; -lean_dec(x_1); -x_7 = lean_ctor_get(x_4, 1); -lean_inc(x_7); -lean_dec(x_4); -x_8 = !lean_is_exclusive(x_5); -if (x_8 == 0) -{ -lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; -x_9 = lean_ctor_get(x_5, 2); -lean_dec(x_9); -x_10 = l_Lean_Elab_Command_modifyScope___closed__1; -x_11 = l_unreachable_x21___rarg(x_10); -lean_ctor_set(x_5, 2, x_11); -x_12 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_7); -if (lean_obj_tag(x_12) == 0) -{ -uint8_t x_13; -x_13 = !lean_is_exclusive(x_12); -if (x_13 == 0) -{ -lean_object* x_14; lean_object* x_15; -x_14 = lean_ctor_get(x_12, 0); -lean_dec(x_14); -x_15 = lean_box(0); -lean_ctor_set(x_12, 0, x_15); -return x_12; -} -else -{ -lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_12, 1); -lean_inc(x_16); -lean_dec(x_12); -x_17 = lean_box(0); -x_18 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_18, 0, x_17); -lean_ctor_set(x_18, 1, x_16); -return x_18; -} -} -else -{ -uint8_t x_19; -x_19 = !lean_is_exclusive(x_12); -if (x_19 == 0) -{ -return x_12; -} -else -{ -lean_object* x_20; lean_object* x_21; lean_object* x_22; -x_20 = lean_ctor_get(x_12, 0); -x_21 = lean_ctor_get(x_12, 1); -lean_inc(x_21); -lean_inc(x_20); -lean_dec(x_12); -x_22 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_22, 0, x_20); -lean_ctor_set(x_22, 1, x_21); -return x_22; -} -} -} -else -{ -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_23 = lean_ctor_get(x_5, 0); -x_24 = lean_ctor_get(x_5, 1); -x_25 = lean_ctor_get(x_5, 3); -x_26 = lean_ctor_get(x_5, 4); -lean_inc(x_26); -lean_inc(x_25); -lean_inc(x_24); -lean_inc(x_23); -lean_dec(x_5); -x_27 = l_Lean_Elab_Command_modifyScope___closed__1; -x_28 = l_unreachable_x21___rarg(x_27); -x_29 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_29, 0, x_23); -lean_ctor_set(x_29, 1, x_24); -lean_ctor_set(x_29, 2, x_28); -lean_ctor_set(x_29, 3, x_25); -lean_ctor_set(x_29, 4, x_26); -x_30 = l___private_Lean_Elab_Command_3__setState(x_29, x_2, x_7); -if (lean_obj_tag(x_30) == 0) -{ -lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; -x_31 = lean_ctor_get(x_30, 1); -lean_inc(x_31); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_32 = x_30; -} else { - lean_dec_ref(x_30); - x_32 = lean_box(0); -} -x_33 = lean_box(0); -if (lean_is_scalar(x_32)) { - x_34 = lean_alloc_ctor(0, 2, 0); -} else { - x_34 = x_32; -} -lean_ctor_set(x_34, 0, x_33); -lean_ctor_set(x_34, 1, x_31); -return x_34; -} -else -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; -x_35 = lean_ctor_get(x_30, 0); -lean_inc(x_35); -x_36 = lean_ctor_get(x_30, 1); -lean_inc(x_36); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_37 = x_30; -} else { - lean_dec_ref(x_30); - x_37 = lean_box(0); -} -if (lean_is_scalar(x_37)) { - x_38 = lean_alloc_ctor(1, 2, 0); -} else { - x_38 = x_37; -} -lean_ctor_set(x_38, 0, x_35); -lean_ctor_set(x_38, 1, x_36); -return x_38; -} -} -} -else -{ -lean_object* x_39; lean_object* x_40; uint8_t x_41; -x_39 = lean_ctor_get(x_6, 0); -lean_inc(x_39); -x_40 = lean_ctor_get(x_4, 1); -lean_inc(x_40); -lean_dec(x_4); -x_41 = !lean_is_exclusive(x_5); -if (x_41 == 0) -{ -lean_object* x_42; uint8_t x_43; -x_42 = lean_ctor_get(x_5, 2); -lean_dec(x_42); -x_43 = !lean_is_exclusive(x_6); -if (x_43 == 0) -{ -lean_object* x_44; uint8_t x_45; -x_44 = lean_ctor_get(x_6, 0); -lean_dec(x_44); -x_45 = !lean_is_exclusive(x_39); -if (x_45 == 0) -{ -lean_object* x_46; lean_object* x_47; -x_46 = lean_ctor_get(x_39, 5); -lean_dec(x_46); -lean_ctor_set(x_39, 5, x_1); -x_47 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_47) == 0) -{ -uint8_t x_48; -x_48 = !lean_is_exclusive(x_47); -if (x_48 == 0) -{ -lean_object* x_49; lean_object* x_50; -x_49 = lean_ctor_get(x_47, 0); -lean_dec(x_49); -x_50 = lean_box(0); -lean_ctor_set(x_47, 0, x_50); -return x_47; -} -else -{ -lean_object* x_51; lean_object* x_52; lean_object* x_53; -x_51 = lean_ctor_get(x_47, 1); -lean_inc(x_51); -lean_dec(x_47); -x_52 = lean_box(0); -x_53 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_53, 0, x_52); -lean_ctor_set(x_53, 1, x_51); -return x_53; -} -} -else -{ -uint8_t x_54; -x_54 = !lean_is_exclusive(x_47); -if (x_54 == 0) -{ -return x_47; -} -else -{ -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_47, 0); -x_56 = lean_ctor_get(x_47, 1); -lean_inc(x_56); -lean_inc(x_55); -lean_dec(x_47); -x_57 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_57, 0, x_55); -lean_ctor_set(x_57, 1, x_56); -return x_57; -} -} -} -else -{ -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; -x_58 = lean_ctor_get(x_39, 0); -x_59 = lean_ctor_get(x_39, 1); -x_60 = lean_ctor_get(x_39, 2); -x_61 = lean_ctor_get(x_39, 3); -x_62 = lean_ctor_get(x_39, 4); -x_63 = lean_ctor_get(x_39, 6); -lean_inc(x_63); -lean_inc(x_62); -lean_inc(x_61); -lean_inc(x_60); -lean_inc(x_59); -lean_inc(x_58); -lean_dec(x_39); -x_64 = lean_alloc_ctor(0, 7, 0); -lean_ctor_set(x_64, 0, x_58); -lean_ctor_set(x_64, 1, x_59); -lean_ctor_set(x_64, 2, x_60); -lean_ctor_set(x_64, 3, x_61); -lean_ctor_set(x_64, 4, x_62); -lean_ctor_set(x_64, 5, x_1); -lean_ctor_set(x_64, 6, x_63); -lean_ctor_set(x_6, 0, x_64); -x_65 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_65) == 0) -{ -lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; -x_66 = lean_ctor_get(x_65, 1); -lean_inc(x_66); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_67 = x_65; -} else { - lean_dec_ref(x_65); - x_67 = lean_box(0); -} -x_68 = lean_box(0); -if (lean_is_scalar(x_67)) { - x_69 = lean_alloc_ctor(0, 2, 0); -} else { - x_69 = x_67; -} -lean_ctor_set(x_69, 0, x_68); -lean_ctor_set(x_69, 1, x_66); -return x_69; -} -else -{ -lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; -x_70 = lean_ctor_get(x_65, 0); -lean_inc(x_70); -x_71 = lean_ctor_get(x_65, 1); -lean_inc(x_71); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_72 = x_65; -} else { - lean_dec_ref(x_65); - x_72 = lean_box(0); -} -if (lean_is_scalar(x_72)) { - x_73 = lean_alloc_ctor(1, 2, 0); -} else { - x_73 = x_72; -} -lean_ctor_set(x_73, 0, x_70); -lean_ctor_set(x_73, 1, x_71); -return x_73; -} -} -} -else -{ -lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; -x_74 = lean_ctor_get(x_6, 1); -lean_inc(x_74); -lean_dec(x_6); -x_75 = lean_ctor_get(x_39, 0); -lean_inc(x_75); -x_76 = lean_ctor_get(x_39, 1); -lean_inc(x_76); -x_77 = lean_ctor_get(x_39, 2); -lean_inc(x_77); -x_78 = lean_ctor_get(x_39, 3); -lean_inc(x_78); -x_79 = lean_ctor_get(x_39, 4); -lean_inc(x_79); -x_80 = lean_ctor_get(x_39, 6); -lean_inc(x_80); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_81 = x_39; -} else { - lean_dec_ref(x_39); - x_81 = lean_box(0); -} -if (lean_is_scalar(x_81)) { - x_82 = lean_alloc_ctor(0, 7, 0); -} else { - x_82 = x_81; -} -lean_ctor_set(x_82, 0, x_75); -lean_ctor_set(x_82, 1, x_76); -lean_ctor_set(x_82, 2, x_77); -lean_ctor_set(x_82, 3, x_78); -lean_ctor_set(x_82, 4, x_79); -lean_ctor_set(x_82, 5, x_1); -lean_ctor_set(x_82, 6, x_80); -x_83 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_83, 0, x_82); -lean_ctor_set(x_83, 1, x_74); -lean_ctor_set(x_5, 2, x_83); -x_84 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_84) == 0) -{ -lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; -x_85 = lean_ctor_get(x_84, 1); -lean_inc(x_85); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_86 = x_84; -} else { - lean_dec_ref(x_84); - x_86 = lean_box(0); -} -x_87 = lean_box(0); -if (lean_is_scalar(x_86)) { - x_88 = lean_alloc_ctor(0, 2, 0); -} else { - x_88 = x_86; -} -lean_ctor_set(x_88, 0, x_87); -lean_ctor_set(x_88, 1, x_85); -return x_88; -} -else -{ -lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; -x_89 = lean_ctor_get(x_84, 0); -lean_inc(x_89); -x_90 = lean_ctor_get(x_84, 1); -lean_inc(x_90); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_91 = x_84; -} else { - lean_dec_ref(x_84); - x_91 = lean_box(0); -} -if (lean_is_scalar(x_91)) { - x_92 = lean_alloc_ctor(1, 2, 0); -} else { - x_92 = x_91; -} -lean_ctor_set(x_92, 0, x_89); -lean_ctor_set(x_92, 1, x_90); -return x_92; -} -} -} -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; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; -x_93 = lean_ctor_get(x_5, 0); -x_94 = lean_ctor_get(x_5, 1); -x_95 = lean_ctor_get(x_5, 3); -x_96 = lean_ctor_get(x_5, 4); -lean_inc(x_96); -lean_inc(x_95); -lean_inc(x_94); -lean_inc(x_93); -lean_dec(x_5); -x_97 = lean_ctor_get(x_6, 1); -lean_inc(x_97); -if (lean_is_exclusive(x_6)) { - lean_ctor_release(x_6, 0); - lean_ctor_release(x_6, 1); - x_98 = x_6; -} else { - lean_dec_ref(x_6); - x_98 = lean_box(0); -} -x_99 = lean_ctor_get(x_39, 0); -lean_inc(x_99); -x_100 = lean_ctor_get(x_39, 1); -lean_inc(x_100); -x_101 = lean_ctor_get(x_39, 2); -lean_inc(x_101); -x_102 = lean_ctor_get(x_39, 3); -lean_inc(x_102); -x_103 = lean_ctor_get(x_39, 4); -lean_inc(x_103); -x_104 = lean_ctor_get(x_39, 6); -lean_inc(x_104); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_105 = x_39; -} else { - lean_dec_ref(x_39); - x_105 = lean_box(0); -} -if (lean_is_scalar(x_105)) { - x_106 = lean_alloc_ctor(0, 7, 0); -} else { - x_106 = x_105; -} -lean_ctor_set(x_106, 0, x_99); -lean_ctor_set(x_106, 1, x_100); -lean_ctor_set(x_106, 2, x_101); -lean_ctor_set(x_106, 3, x_102); -lean_ctor_set(x_106, 4, x_103); -lean_ctor_set(x_106, 5, x_1); -lean_ctor_set(x_106, 6, x_104); -if (lean_is_scalar(x_98)) { - x_107 = lean_alloc_ctor(1, 2, 0); -} else { - x_107 = x_98; -} -lean_ctor_set(x_107, 0, x_106); -lean_ctor_set(x_107, 1, x_97); -x_108 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_108, 0, x_93); -lean_ctor_set(x_108, 1, x_94); -lean_ctor_set(x_108, 2, x_107); -lean_ctor_set(x_108, 3, x_95); -lean_ctor_set(x_108, 4, x_96); -x_109 = l___private_Lean_Elab_Command_3__setState(x_108, x_2, x_40); -if (lean_obj_tag(x_109) == 0) -{ -lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; -x_110 = lean_ctor_get(x_109, 1); -lean_inc(x_110); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_111 = x_109; -} else { - lean_dec_ref(x_109); - x_111 = lean_box(0); -} -x_112 = lean_box(0); -if (lean_is_scalar(x_111)) { - x_113 = lean_alloc_ctor(0, 2, 0); -} else { - x_113 = x_111; -} -lean_ctor_set(x_113, 0, x_112); -lean_ctor_set(x_113, 1, x_110); -return x_113; -} -else -{ -lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; -x_114 = lean_ctor_get(x_109, 0); -lean_inc(x_114); -x_115 = lean_ctor_get(x_109, 1); -lean_inc(x_115); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_116 = x_109; -} else { - lean_dec_ref(x_109); - x_116 = lean_box(0); -} -if (lean_is_scalar(x_116)) { - x_117 = lean_alloc_ctor(1, 2, 0); -} else { - x_117 = x_116; -} -lean_ctor_set(x_117, 0, x_114); -lean_ctor_set(x_117, 1, x_115); -return x_117; -} -} -} -} -else -{ -uint8_t x_118; -lean_dec(x_2); -lean_dec(x_1); -x_118 = !lean_is_exclusive(x_4); -if (x_118 == 0) -{ -return x_4; -} -else -{ -lean_object* x_119; lean_object* x_120; lean_object* x_121; -x_119 = lean_ctor_get(x_4, 0); -x_120 = lean_ctor_get(x_4, 1); -lean_inc(x_120); -lean_inc(x_119); -lean_dec(x_4); -x_121 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_121, 0, x_119); -lean_ctor_set(x_121, 1, x_120); -return x_121; -} -} -} -} -lean_object* l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__4(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -lean_inc(x_2); -x_4 = l___private_Lean_Elab_Command_2__getState(x_2, x_3); -if (lean_obj_tag(x_4) == 0) -{ -lean_object* x_5; lean_object* x_6; -x_5 = lean_ctor_get(x_4, 0); -lean_inc(x_5); -x_6 = lean_ctor_get(x_5, 2); -lean_inc(x_6); -if (lean_obj_tag(x_6) == 0) -{ -lean_object* x_7; uint8_t x_8; -lean_dec(x_1); -x_7 = lean_ctor_get(x_4, 1); -lean_inc(x_7); -lean_dec(x_4); -x_8 = !lean_is_exclusive(x_5); -if (x_8 == 0) -{ -lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; -x_9 = lean_ctor_get(x_5, 2); -lean_dec(x_9); -x_10 = l_Lean_Elab_Command_modifyScope___closed__1; -x_11 = l_unreachable_x21___rarg(x_10); -lean_ctor_set(x_5, 2, x_11); -x_12 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_7); -if (lean_obj_tag(x_12) == 0) -{ -uint8_t x_13; -x_13 = !lean_is_exclusive(x_12); -if (x_13 == 0) -{ -lean_object* x_14; lean_object* x_15; -x_14 = lean_ctor_get(x_12, 0); -lean_dec(x_14); -x_15 = lean_box(0); -lean_ctor_set(x_12, 0, x_15); -return x_12; -} -else -{ -lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_12, 1); -lean_inc(x_16); -lean_dec(x_12); -x_17 = lean_box(0); -x_18 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_18, 0, x_17); -lean_ctor_set(x_18, 1, x_16); -return x_18; -} -} -else -{ -uint8_t x_19; -x_19 = !lean_is_exclusive(x_12); -if (x_19 == 0) -{ -return x_12; -} -else -{ -lean_object* x_20; lean_object* x_21; lean_object* x_22; -x_20 = lean_ctor_get(x_12, 0); -x_21 = lean_ctor_get(x_12, 1); -lean_inc(x_21); -lean_inc(x_20); -lean_dec(x_12); -x_22 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_22, 0, x_20); -lean_ctor_set(x_22, 1, x_21); -return x_22; -} -} -} -else -{ -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_23 = lean_ctor_get(x_5, 0); -x_24 = lean_ctor_get(x_5, 1); -x_25 = lean_ctor_get(x_5, 3); -x_26 = lean_ctor_get(x_5, 4); -lean_inc(x_26); -lean_inc(x_25); -lean_inc(x_24); -lean_inc(x_23); -lean_dec(x_5); -x_27 = l_Lean_Elab_Command_modifyScope___closed__1; -x_28 = l_unreachable_x21___rarg(x_27); -x_29 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_29, 0, x_23); -lean_ctor_set(x_29, 1, x_24); -lean_ctor_set(x_29, 2, x_28); -lean_ctor_set(x_29, 3, x_25); -lean_ctor_set(x_29, 4, x_26); -x_30 = l___private_Lean_Elab_Command_3__setState(x_29, x_2, x_7); -if (lean_obj_tag(x_30) == 0) -{ -lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; -x_31 = lean_ctor_get(x_30, 1); -lean_inc(x_31); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_32 = x_30; -} else { - lean_dec_ref(x_30); - x_32 = lean_box(0); -} -x_33 = lean_box(0); -if (lean_is_scalar(x_32)) { - x_34 = lean_alloc_ctor(0, 2, 0); -} else { - x_34 = x_32; -} -lean_ctor_set(x_34, 0, x_33); -lean_ctor_set(x_34, 1, x_31); -return x_34; -} -else -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; -x_35 = lean_ctor_get(x_30, 0); -lean_inc(x_35); -x_36 = lean_ctor_get(x_30, 1); -lean_inc(x_36); -if (lean_is_exclusive(x_30)) { - lean_ctor_release(x_30, 0); - lean_ctor_release(x_30, 1); - x_37 = x_30; -} else { - lean_dec_ref(x_30); - x_37 = lean_box(0); -} -if (lean_is_scalar(x_37)) { - x_38 = lean_alloc_ctor(1, 2, 0); -} else { - x_38 = x_37; -} -lean_ctor_set(x_38, 0, x_35); -lean_ctor_set(x_38, 1, x_36); -return x_38; -} -} -} -else -{ -lean_object* x_39; lean_object* x_40; uint8_t x_41; -x_39 = lean_ctor_get(x_6, 0); -lean_inc(x_39); -x_40 = lean_ctor_get(x_4, 1); -lean_inc(x_40); -lean_dec(x_4); -x_41 = !lean_is_exclusive(x_5); -if (x_41 == 0) -{ -lean_object* x_42; uint8_t x_43; -x_42 = lean_ctor_get(x_5, 2); -lean_dec(x_42); -x_43 = !lean_is_exclusive(x_6); -if (x_43 == 0) -{ -lean_object* x_44; uint8_t x_45; -x_44 = lean_ctor_get(x_6, 0); -lean_dec(x_44); -x_45 = !lean_is_exclusive(x_39); -if (x_45 == 0) -{ -lean_object* x_46; lean_object* x_47; -x_46 = lean_ctor_get(x_39, 5); -lean_dec(x_46); -lean_ctor_set(x_39, 5, x_1); -x_47 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_47) == 0) -{ -uint8_t x_48; -x_48 = !lean_is_exclusive(x_47); -if (x_48 == 0) -{ -lean_object* x_49; lean_object* x_50; -x_49 = lean_ctor_get(x_47, 0); -lean_dec(x_49); -x_50 = lean_box(0); -lean_ctor_set(x_47, 0, x_50); -return x_47; -} -else -{ -lean_object* x_51; lean_object* x_52; lean_object* x_53; -x_51 = lean_ctor_get(x_47, 1); -lean_inc(x_51); -lean_dec(x_47); -x_52 = lean_box(0); -x_53 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_53, 0, x_52); -lean_ctor_set(x_53, 1, x_51); -return x_53; -} -} -else -{ -uint8_t x_54; -x_54 = !lean_is_exclusive(x_47); -if (x_54 == 0) -{ -return x_47; -} -else -{ -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_47, 0); -x_56 = lean_ctor_get(x_47, 1); -lean_inc(x_56); -lean_inc(x_55); -lean_dec(x_47); -x_57 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_57, 0, x_55); -lean_ctor_set(x_57, 1, x_56); -return x_57; -} -} -} -else -{ -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; -x_58 = lean_ctor_get(x_39, 0); -x_59 = lean_ctor_get(x_39, 1); -x_60 = lean_ctor_get(x_39, 2); -x_61 = lean_ctor_get(x_39, 3); -x_62 = lean_ctor_get(x_39, 4); -x_63 = lean_ctor_get(x_39, 6); -lean_inc(x_63); -lean_inc(x_62); -lean_inc(x_61); -lean_inc(x_60); -lean_inc(x_59); -lean_inc(x_58); -lean_dec(x_39); -x_64 = lean_alloc_ctor(0, 7, 0); -lean_ctor_set(x_64, 0, x_58); -lean_ctor_set(x_64, 1, x_59); -lean_ctor_set(x_64, 2, x_60); -lean_ctor_set(x_64, 3, x_61); -lean_ctor_set(x_64, 4, x_62); -lean_ctor_set(x_64, 5, x_1); -lean_ctor_set(x_64, 6, x_63); -lean_ctor_set(x_6, 0, x_64); -x_65 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_65) == 0) -{ -lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; -x_66 = lean_ctor_get(x_65, 1); -lean_inc(x_66); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_67 = x_65; -} else { - lean_dec_ref(x_65); - x_67 = lean_box(0); -} -x_68 = lean_box(0); -if (lean_is_scalar(x_67)) { - x_69 = lean_alloc_ctor(0, 2, 0); -} else { - x_69 = x_67; -} -lean_ctor_set(x_69, 0, x_68); -lean_ctor_set(x_69, 1, x_66); -return x_69; -} -else -{ -lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; -x_70 = lean_ctor_get(x_65, 0); -lean_inc(x_70); -x_71 = lean_ctor_get(x_65, 1); -lean_inc(x_71); -if (lean_is_exclusive(x_65)) { - lean_ctor_release(x_65, 0); - lean_ctor_release(x_65, 1); - x_72 = x_65; -} else { - lean_dec_ref(x_65); - x_72 = lean_box(0); -} -if (lean_is_scalar(x_72)) { - x_73 = lean_alloc_ctor(1, 2, 0); -} else { - x_73 = x_72; -} -lean_ctor_set(x_73, 0, x_70); -lean_ctor_set(x_73, 1, x_71); -return x_73; -} -} -} -else -{ -lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; -x_74 = lean_ctor_get(x_6, 1); -lean_inc(x_74); -lean_dec(x_6); -x_75 = lean_ctor_get(x_39, 0); -lean_inc(x_75); -x_76 = lean_ctor_get(x_39, 1); -lean_inc(x_76); -x_77 = lean_ctor_get(x_39, 2); -lean_inc(x_77); -x_78 = lean_ctor_get(x_39, 3); -lean_inc(x_78); -x_79 = lean_ctor_get(x_39, 4); -lean_inc(x_79); -x_80 = lean_ctor_get(x_39, 6); -lean_inc(x_80); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_81 = x_39; -} else { - lean_dec_ref(x_39); - x_81 = lean_box(0); -} -if (lean_is_scalar(x_81)) { - x_82 = lean_alloc_ctor(0, 7, 0); -} else { - x_82 = x_81; -} -lean_ctor_set(x_82, 0, x_75); -lean_ctor_set(x_82, 1, x_76); -lean_ctor_set(x_82, 2, x_77); -lean_ctor_set(x_82, 3, x_78); -lean_ctor_set(x_82, 4, x_79); -lean_ctor_set(x_82, 5, x_1); -lean_ctor_set(x_82, 6, x_80); -x_83 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_83, 0, x_82); -lean_ctor_set(x_83, 1, x_74); -lean_ctor_set(x_5, 2, x_83); -x_84 = l___private_Lean_Elab_Command_3__setState(x_5, x_2, x_40); -if (lean_obj_tag(x_84) == 0) -{ -lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; -x_85 = lean_ctor_get(x_84, 1); -lean_inc(x_85); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_86 = x_84; -} else { - lean_dec_ref(x_84); - x_86 = lean_box(0); -} -x_87 = lean_box(0); -if (lean_is_scalar(x_86)) { - x_88 = lean_alloc_ctor(0, 2, 0); -} else { - x_88 = x_86; -} -lean_ctor_set(x_88, 0, x_87); -lean_ctor_set(x_88, 1, x_85); -return x_88; -} -else -{ -lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; -x_89 = lean_ctor_get(x_84, 0); -lean_inc(x_89); -x_90 = lean_ctor_get(x_84, 1); -lean_inc(x_90); -if (lean_is_exclusive(x_84)) { - lean_ctor_release(x_84, 0); - lean_ctor_release(x_84, 1); - x_91 = x_84; -} else { - lean_dec_ref(x_84); - x_91 = lean_box(0); -} -if (lean_is_scalar(x_91)) { - x_92 = lean_alloc_ctor(1, 2, 0); -} else { - x_92 = x_91; -} -lean_ctor_set(x_92, 0, x_89); -lean_ctor_set(x_92, 1, x_90); -return x_92; -} -} -} -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; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; -x_93 = lean_ctor_get(x_5, 0); -x_94 = lean_ctor_get(x_5, 1); -x_95 = lean_ctor_get(x_5, 3); -x_96 = lean_ctor_get(x_5, 4); -lean_inc(x_96); -lean_inc(x_95); -lean_inc(x_94); -lean_inc(x_93); -lean_dec(x_5); -x_97 = lean_ctor_get(x_6, 1); -lean_inc(x_97); -if (lean_is_exclusive(x_6)) { - lean_ctor_release(x_6, 0); - lean_ctor_release(x_6, 1); - x_98 = x_6; -} else { - lean_dec_ref(x_6); - x_98 = lean_box(0); -} -x_99 = lean_ctor_get(x_39, 0); -lean_inc(x_99); -x_100 = lean_ctor_get(x_39, 1); -lean_inc(x_100); -x_101 = lean_ctor_get(x_39, 2); -lean_inc(x_101); -x_102 = lean_ctor_get(x_39, 3); -lean_inc(x_102); -x_103 = lean_ctor_get(x_39, 4); -lean_inc(x_103); -x_104 = lean_ctor_get(x_39, 6); -lean_inc(x_104); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - lean_ctor_release(x_39, 2); - lean_ctor_release(x_39, 3); - lean_ctor_release(x_39, 4); - lean_ctor_release(x_39, 5); - lean_ctor_release(x_39, 6); - x_105 = x_39; -} else { - lean_dec_ref(x_39); - x_105 = lean_box(0); -} -if (lean_is_scalar(x_105)) { - x_106 = lean_alloc_ctor(0, 7, 0); -} else { - x_106 = x_105; -} -lean_ctor_set(x_106, 0, x_99); -lean_ctor_set(x_106, 1, x_100); -lean_ctor_set(x_106, 2, x_101); -lean_ctor_set(x_106, 3, x_102); -lean_ctor_set(x_106, 4, x_103); -lean_ctor_set(x_106, 5, x_1); -lean_ctor_set(x_106, 6, x_104); -if (lean_is_scalar(x_98)) { - x_107 = lean_alloc_ctor(1, 2, 0); -} else { - x_107 = x_98; -} -lean_ctor_set(x_107, 0, x_106); -lean_ctor_set(x_107, 1, x_97); -x_108 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_108, 0, x_93); -lean_ctor_set(x_108, 1, x_94); -lean_ctor_set(x_108, 2, x_107); -lean_ctor_set(x_108, 3, x_95); -lean_ctor_set(x_108, 4, x_96); -x_109 = l___private_Lean_Elab_Command_3__setState(x_108, x_2, x_40); -if (lean_obj_tag(x_109) == 0) -{ -lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; -x_110 = lean_ctor_get(x_109, 1); -lean_inc(x_110); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_111 = x_109; -} else { - lean_dec_ref(x_109); - x_111 = lean_box(0); -} -x_112 = lean_box(0); -if (lean_is_scalar(x_111)) { - x_113 = lean_alloc_ctor(0, 2, 0); -} else { - x_113 = x_111; -} -lean_ctor_set(x_113, 0, x_112); -lean_ctor_set(x_113, 1, x_110); -return x_113; -} -else -{ -lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; -x_114 = lean_ctor_get(x_109, 0); -lean_inc(x_114); -x_115 = lean_ctor_get(x_109, 1); -lean_inc(x_115); -if (lean_is_exclusive(x_109)) { - lean_ctor_release(x_109, 0); - lean_ctor_release(x_109, 1); - x_116 = x_109; -} else { - lean_dec_ref(x_109); - x_116 = lean_box(0); -} -if (lean_is_scalar(x_116)) { - x_117 = lean_alloc_ctor(1, 2, 0); -} else { - x_117 = x_116; -} -lean_ctor_set(x_117, 0, x_114); -lean_ctor_set(x_117, 1, x_115); -return x_117; -} -} -} -} -else -{ -uint8_t x_118; -lean_dec(x_2); -lean_dec(x_1); -x_118 = !lean_is_exclusive(x_4); -if (x_118 == 0) -{ -return x_4; -} -else -{ -lean_object* x_119; lean_object* x_120; lean_object* x_121; -x_119 = lean_ctor_get(x_4, 0); -x_120 = lean_ctor_get(x_4, 1); -lean_inc(x_120); -lean_inc(x_119); -lean_dec(x_4); -x_121 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_121, 0, x_119); -lean_ctor_set(x_121, 1, x_120); -return x_121; -} -} -} -} -lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__5(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; -x_7 = lean_array_get_size(x_2); -x_8 = lean_nat_dec_lt(x_3, x_7); -lean_dec(x_7); -if (x_8 == 0) -{ -lean_object* x_9; -lean_dec(x_5); +lean_object* x_3; uint8_t x_4; +x_3 = lean_array_get_size(x_2); +x_4 = lean_nat_dec_lt(x_1, x_3); lean_dec(x_3); -x_9 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_9, 0, x_4); -lean_ctor_set(x_9, 1, x_6); -return x_9; +if (x_4 == 0) +{ +lean_object* x_5; +lean_dec(x_1); +x_5 = x_2; +return x_5; } else { -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14; -x_10 = lean_array_fget(x_2, x_3); +lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_6 = lean_array_fget(x_2, x_1); +x_7 = lean_unsigned_to_nat(0u); +x_8 = lean_array_fset(x_2, x_1, x_7); +x_9 = x_6; +x_10 = lean_ctor_get(x_9, 0); +lean_inc(x_10); +lean_dec(x_9); x_11 = lean_unsigned_to_nat(1u); -x_12 = lean_nat_add(x_3, x_11); -lean_dec(x_3); -x_13 = l_Lean_Syntax_getId(x_10); -x_14 = l_List_elem___main___at_Lean_NameHashSet_insert___spec__2(x_13, x_4); -if (x_14 == 0) -{ -lean_object* x_15; -lean_dec(x_10); -x_15 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_15, 0, x_13); -lean_ctor_set(x_15, 1, x_4); -x_3 = x_12; -x_4 = x_15; +x_12 = lean_nat_add(x_1, x_11); +x_13 = x_10; +x_14 = lean_array_fset(x_8, x_1, x_13); +lean_dec(x_1); +x_1 = x_12; +x_2 = x_14; goto _start; } -else -{ -lean_object* x_17; uint8_t x_18; -lean_dec(x_12); -lean_dec(x_4); -x_17 = l_Lean_Elab_Command_throwAlreadyDeclaredUniverseLevel___rarg(x_10, x_13, x_5, x_6); -lean_dec(x_10); -x_18 = !lean_is_exclusive(x_17); -if (x_18 == 0) -{ -return x_17; -} -else -{ -lean_object* x_19; lean_object* x_20; lean_object* x_21; -x_19 = lean_ctor_get(x_17, 0); -x_20 = lean_ctor_get(x_17, 1); -lean_inc(x_20); -lean_inc(x_19); -lean_dec(x_17); -x_21 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_21, 0, x_19); -lean_ctor_set(x_21, 1, x_20); -return x_21; } } -} -} -} -lean_object* l_Lean_Elab_Command_elabInductiveCore___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3(uint8_t x_1, lean_object* x_2) { _start: { -lean_object* x_5; lean_object* x_6; lean_object* x_7; -x_5 = l_Lean_Syntax_getArgs(x_1); -x_6 = l_Lean_Meta_dbgTrace___rarg___closed__1; -x_7 = l_Lean_Elab_Term_elabBinders___rarg(x_5, x_6, x_3, x_4); -lean_dec(x_5); -return x_7; +if (x_1 == 0) +{ +if (lean_obj_tag(x_2) == 0) +{ +lean_object* x_3; +x_3 = l_String_splitAux___main___closed__1; +return x_3; +} +else +{ +lean_object* x_4; lean_object* x_5; lean_object* x_6; uint8_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; +x_4 = lean_ctor_get(x_2, 0); +lean_inc(x_4); +x_5 = lean_ctor_get(x_2, 1); +lean_inc(x_5); +lean_dec(x_2); +x_6 = lean_box(0); +x_7 = 0; +x_8 = lean_unsigned_to_nat(0u); +x_9 = l_Lean_Syntax_formatStxAux___main(x_6, x_7, x_8, x_4); +x_10 = l_Lean_Options_empty; +x_11 = l_Lean_Format_pretty(x_9, x_10); +x_12 = l_List_reprAux___main___rarg___closed__1; +x_13 = lean_string_append(x_12, x_11); +lean_dec(x_11); +x_14 = l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3(x_1, x_5); +x_15 = lean_string_append(x_13, x_14); +lean_dec(x_14); +return x_15; +} +} +else +{ +if (lean_obj_tag(x_2) == 0) +{ +lean_object* x_16; +x_16 = l_String_splitAux___main___closed__1; +return x_16; +} +else +{ +lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_17 = lean_ctor_get(x_2, 0); +lean_inc(x_17); +x_18 = lean_ctor_get(x_2, 1); +lean_inc(x_18); +lean_dec(x_2); +x_19 = lean_box(0); +x_20 = 0; +x_21 = lean_unsigned_to_nat(0u); +x_22 = l_Lean_Syntax_formatStxAux___main(x_19, x_20, x_21, x_17); +x_23 = l_Lean_Options_empty; +x_24 = l_Lean_Format_pretty(x_22, x_23); +x_25 = l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3(x_20, x_18); +x_26 = lean_string_append(x_24, x_25); +lean_dec(x_25); +return x_26; +} +} +} +} +lean_object* l_List_toString___at_Lean_Elab_Command_elabInductiveCore___spec__2(lean_object* x_1) { +_start: +{ +if (lean_obj_tag(x_1) == 0) +{ +lean_object* x_2; +x_2 = l_List_repr___rarg___closed__1; +return x_2; +} +else +{ +uint8_t x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_3 = 1; +x_4 = l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3(x_3, x_1); +x_5 = l_List_repr___rarg___closed__2; +x_6 = lean_string_append(x_5, x_4); +lean_dec(x_4); +x_7 = l_List_repr___rarg___closed__3; +x_8 = lean_string_append(x_6, x_7); +return x_8; +} } } lean_object* _init_l_Lean_Elab_Command_elabInductiveCore___closed__1() { _start: { -lean_object* x_1; lean_object* x_2; -x_1 = l_IO_FS_Handle_putStrLn___rarg___closed__1; -x_2 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_2, 0, x_1); -return x_2; +lean_object* x_1; +x_1 = lean_mk_string("WIP\n"); +return x_1; } } lean_object* _init_l_Lean_Elab_Command_elabInductiveCore___closed__2() { @@ -2370,1389 +252,61 @@ _start: { lean_object* x_1; lean_object* x_2; x_1 = l_Lean_Elab_Command_elabInductiveCore___closed__1; +x_2 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} +lean_object* _init_l_Lean_Elab_Command_elabInductiveCore___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Elab_Command_elabInductiveCore___closed__2; x_2 = lean_alloc_ctor(0, 1, 0); lean_ctor_set(x_2, 0, x_1); return x_2; } } -lean_object* l_Lean_Elab_Command_elabInductiveCore(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { +lean_object* l_Lean_Elab_Command_elabInductiveCore(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { -lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; -x_9 = l_Lean_Elab_Command_expandDeclId(x_3); -x_10 = lean_ctor_get(x_9, 0); -lean_inc(x_10); -x_11 = lean_ctor_get(x_9, 1); -lean_inc(x_11); -lean_dec(x_9); +lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; +x_4 = l_Lean_Elab_Command_InductiveView_inhabited; +x_5 = lean_unsigned_to_nat(0u); +x_6 = lean_array_get(x_4, x_1, x_5); +x_7 = lean_ctor_get(x_6, 0); lean_inc(x_7); -x_12 = l_Lean_Elab_Command_getLevelNames(x_7, x_8); -if (lean_obj_tag(x_12) == 0) -{ -lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_287; -x_13 = lean_ctor_get(x_12, 0); -lean_inc(x_13); -x_14 = lean_ctor_get(x_12, 1); -lean_inc(x_14); -lean_dec(x_12); -x_287 = l_Lean_Syntax_isNone(x_11); -if (x_287 == 0) -{ -lean_object* x_288; lean_object* x_289; lean_object* x_290; lean_object* x_291; lean_object* x_292; lean_object* x_293; lean_object* x_294; lean_object* x_295; -x_288 = lean_unsigned_to_nat(1u); -x_289 = l_Lean_Syntax_getArg(x_11, x_288); -x_290 = l_Lean_Syntax_getArgs(x_289); -lean_dec(x_289); -x_291 = lean_unsigned_to_nat(2u); -x_292 = lean_unsigned_to_nat(0u); -x_293 = l_Array_empty___closed__1; -x_294 = l_Array_foldlStepMAux___main___at_Lean_Elab_Term_elabParen___spec__1(x_291, x_290, x_292, x_293); -lean_dec(x_290); -lean_inc(x_7); -lean_inc(x_13); -x_295 = l_Array_iterateMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__5(x_11, x_294, x_292, x_13, x_7, x_14); -lean_dec(x_294); -lean_dec(x_11); -if (lean_obj_tag(x_295) == 0) -{ -lean_object* x_296; lean_object* x_297; -x_296 = lean_ctor_get(x_295, 0); -lean_inc(x_296); -x_297 = lean_ctor_get(x_295, 1); -lean_inc(x_297); -lean_dec(x_295); -x_15 = x_296; -x_16 = x_297; -goto block_286; -} -else -{ -uint8_t x_298; -lean_dec(x_13); -lean_dec(x_10); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_1); -x_298 = !lean_is_exclusive(x_295); -if (x_298 == 0) -{ -return x_295; -} -else -{ -lean_object* x_299; lean_object* x_300; lean_object* x_301; -x_299 = lean_ctor_get(x_295, 0); -x_300 = lean_ctor_get(x_295, 1); -lean_inc(x_300); -lean_inc(x_299); -lean_dec(x_295); -x_301 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_301, 0, x_299); -lean_ctor_set(x_301, 1, x_300); -return x_301; -} -} -} -else -{ -lean_dec(x_11); -lean_inc(x_13); -x_15 = x_13; -x_16 = x_14; -goto block_286; -} -block_286: -{ -lean_object* x_17; lean_object* x_18; -x_17 = l_Lean_extractMacroScopes(x_10); -x_18 = lean_ctor_get(x_17, 0); -lean_inc(x_18); -if (lean_obj_tag(x_18) == 1) -{ -uint8_t x_19; -x_19 = !lean_is_exclusive(x_17); -if (x_19 == 0) -{ -lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_38; uint8_t x_39; lean_object* x_40; -x_20 = lean_ctor_get(x_17, 0); -lean_dec(x_20); -x_21 = lean_ctor_get(x_18, 0); -lean_inc(x_21); -x_22 = lean_ctor_get(x_18, 1); -lean_inc(x_22); -lean_dec(x_18); -x_23 = lean_box(0); -x_24 = lean_name_mk_string(x_23, x_22); -lean_ctor_set(x_17, 0, x_24); -x_25 = l_Lean_MacroScopesView_review(x_17); -x_38 = l_Lean_Parser_Command_namespace___elambda__1___closed__1; -x_39 = 1; -lean_inc(x_7); -x_40 = l___private_Lean_Elab_Command_12__addScopes___main(x_3, x_38, x_39, x_21, x_7, x_16); -if (lean_obj_tag(x_40) == 0) -{ -lean_object* x_41; lean_object* x_42; -x_41 = lean_ctor_get(x_40, 1); -lean_inc(x_41); -lean_dec(x_40); -lean_inc(x_7); -x_42 = l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__2(x_15, x_7, x_41); -if (lean_obj_tag(x_42) == 0) -{ -lean_object* x_43; lean_object* x_44; -x_43 = lean_ctor_get(x_42, 1); -lean_inc(x_43); -lean_dec(x_42); -lean_inc(x_7); -x_44 = l_Lean_Elab_Command_mkDeclName(x_2, x_25, x_7, x_43); -if (lean_obj_tag(x_44) == 0) -{ -lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; -x_45 = lean_ctor_get(x_44, 0); -lean_inc(x_45); -x_46 = lean_ctor_get(x_44, 1); -lean_inc(x_46); -lean_dec(x_44); -x_47 = lean_ctor_get(x_2, 1); -lean_inc(x_7); -lean_inc(x_45); -x_48 = l_Lean_Elab_Command_checkNotAlreadyDeclared(x_1, x_45, x_7, x_46); -if (lean_obj_tag(x_48) == 0) -{ -lean_object* x_49; uint8_t x_50; lean_object* x_51; lean_object* x_52; -x_49 = lean_ctor_get(x_48, 1); -lean_inc(x_49); -lean_dec(x_48); -x_50 = 2; -x_51 = lean_unsigned_to_nat(0u); -lean_inc(x_7); -lean_inc(x_45); -x_52 = l_Array_forMAux___main___at_Lean_Elab_Command_applyAttributes___spec__1(x_1, x_45, x_50, x_47, x_51, x_7, x_49); -if (lean_obj_tag(x_52) == 0) -{ -lean_object* x_53; lean_object* x_54; -x_53 = lean_ctor_get(x_52, 1); -lean_inc(x_53); -lean_dec(x_52); -lean_inc(x_7); -x_54 = l_Lean_Elab_Command_getLevelNames(x_7, x_53); -if (lean_obj_tag(x_54) == 0) -{ -lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_69; lean_object* x_70; lean_object* x_71; -x_55 = lean_ctor_get(x_54, 0); -lean_inc(x_55); -x_56 = lean_ctor_get(x_54, 1); -lean_inc(x_56); -lean_dec(x_54); -x_69 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_69, 0, x_45); -x_70 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabInductiveCore___lambda__1___boxed), 4, 1); -lean_closure_set(x_70, 0, x_4); -lean_inc(x_7); -x_71 = l___private_Lean_Elab_Command_2__getState(x_7, x_56); -if (lean_obj_tag(x_71) == 0) -{ -lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; -x_72 = lean_ctor_get(x_71, 0); -lean_inc(x_72); -x_73 = lean_ctor_get(x_71, 1); -lean_inc(x_73); -lean_dec(x_71); -x_74 = l___private_Lean_Elab_Command_9__getVarDecls(x_72); -lean_dec(x_72); -lean_inc(x_7); -x_75 = l___private_Lean_Elab_Command_2__getState(x_7, x_73); -if (lean_obj_tag(x_75) == 0) -{ -lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; -x_76 = lean_ctor_get(x_75, 0); -lean_inc(x_76); -x_77 = lean_ctor_get(x_75, 1); -lean_inc(x_77); -lean_dec(x_75); -x_78 = l___private_Lean_Elab_Command_6__mkTermContext(x_7, x_76, x_69); -x_79 = l___private_Lean_Elab_Command_7__mkTermState(x_76); -lean_dec(x_76); -x_80 = l_Lean_Elab_Term_elabBinders___rarg(x_74, x_70, x_78, x_79); -lean_dec(x_74); -if (lean_obj_tag(x_80) == 0) -{ -lean_object* x_81; lean_object* x_82; -x_81 = lean_ctor_get(x_80, 1); -lean_inc(x_81); -lean_dec(x_80); -lean_inc(x_7); -x_82 = l___private_Lean_Elab_Command_2__getState(x_7, x_77); -if (lean_obj_tag(x_82) == 0) -{ -lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; uint8_t x_88; -x_83 = lean_ctor_get(x_81, 0); -lean_inc(x_83); -x_84 = lean_ctor_get(x_82, 0); -lean_inc(x_84); -x_85 = lean_ctor_get(x_82, 1); -lean_inc(x_85); -lean_dec(x_82); -x_86 = lean_ctor_get(x_83, 0); -lean_inc(x_86); -lean_dec(x_83); -x_87 = lean_ctor_get(x_81, 2); -lean_inc(x_87); -lean_dec(x_81); -x_88 = !lean_is_exclusive(x_84); -if (x_88 == 0) -{ -lean_object* x_89; lean_object* x_90; lean_object* x_91; -x_89 = lean_ctor_get(x_84, 1); -lean_dec(x_89); -x_90 = lean_ctor_get(x_84, 0); -lean_dec(x_90); -lean_ctor_set(x_84, 1, x_87); -lean_ctor_set(x_84, 0, x_86); -lean_inc(x_7); -x_91 = l___private_Lean_Elab_Command_3__setState(x_84, x_7, x_85); -if (lean_obj_tag(x_91) == 0) -{ -lean_object* x_92; -x_92 = lean_ctor_get(x_91, 1); -lean_inc(x_92); -lean_dec(x_91); -x_57 = x_92; -goto block_68; -} -else -{ -lean_object* x_93; lean_object* x_94; -lean_dec(x_55); -lean_dec(x_1); -x_93 = lean_ctor_get(x_91, 0); -lean_inc(x_93); -x_94 = lean_ctor_get(x_91, 1); -lean_inc(x_94); -lean_dec(x_91); -x_26 = x_93; -x_27 = x_94; -goto block_37; -} -} -else -{ -lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; -x_95 = lean_ctor_get(x_84, 2); -x_96 = lean_ctor_get(x_84, 3); -x_97 = lean_ctor_get(x_84, 4); -lean_inc(x_97); -lean_inc(x_96); -lean_inc(x_95); -lean_dec(x_84); -x_98 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_98, 0, x_86); -lean_ctor_set(x_98, 1, x_87); -lean_ctor_set(x_98, 2, x_95); -lean_ctor_set(x_98, 3, x_96); -lean_ctor_set(x_98, 4, x_97); -lean_inc(x_7); -x_99 = l___private_Lean_Elab_Command_3__setState(x_98, x_7, x_85); -if (lean_obj_tag(x_99) == 0) -{ -lean_object* x_100; -x_100 = lean_ctor_get(x_99, 1); -lean_inc(x_100); -lean_dec(x_99); -x_57 = x_100; -goto block_68; -} -else -{ -lean_object* x_101; lean_object* x_102; -lean_dec(x_55); -lean_dec(x_1); -x_101 = lean_ctor_get(x_99, 0); -lean_inc(x_101); -x_102 = lean_ctor_get(x_99, 1); -lean_inc(x_102); -lean_dec(x_99); -x_26 = x_101; -x_27 = x_102; -goto block_37; -} -} -} -else -{ -lean_object* x_103; lean_object* x_104; -lean_dec(x_81); -lean_dec(x_55); -lean_dec(x_1); -x_103 = lean_ctor_get(x_82, 0); -lean_inc(x_103); -x_104 = lean_ctor_get(x_82, 1); -lean_inc(x_104); -lean_dec(x_82); -x_26 = x_103; -x_27 = x_104; -goto block_37; -} -} -else -{ -lean_object* x_105; -x_105 = lean_ctor_get(x_80, 0); -lean_inc(x_105); -if (lean_obj_tag(x_105) == 0) -{ -lean_object* x_106; lean_object* x_107; lean_object* x_108; -lean_dec(x_55); -lean_dec(x_1); -x_106 = lean_ctor_get(x_80, 1); -lean_inc(x_106); -lean_dec(x_80); -x_107 = lean_ctor_get(x_105, 0); -lean_inc(x_107); -lean_dec(x_105); -lean_inc(x_7); -x_108 = l___private_Lean_Elab_Command_2__getState(x_7, x_77); -if (lean_obj_tag(x_108) == 0) -{ -lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; uint8_t x_114; -x_109 = lean_ctor_get(x_106, 0); -lean_inc(x_109); -x_110 = lean_ctor_get(x_108, 0); -lean_inc(x_110); -x_111 = lean_ctor_get(x_108, 1); -lean_inc(x_111); -lean_dec(x_108); -x_112 = lean_ctor_get(x_109, 0); -lean_inc(x_112); -lean_dec(x_109); -x_113 = lean_ctor_get(x_106, 2); -lean_inc(x_113); -lean_dec(x_106); -x_114 = !lean_is_exclusive(x_110); -if (x_114 == 0) -{ -lean_object* x_115; lean_object* x_116; lean_object* x_117; -x_115 = lean_ctor_get(x_110, 1); -lean_dec(x_115); -x_116 = lean_ctor_get(x_110, 0); -lean_dec(x_116); -lean_ctor_set(x_110, 1, x_113); -lean_ctor_set(x_110, 0, x_112); -lean_inc(x_7); -x_117 = l___private_Lean_Elab_Command_3__setState(x_110, x_7, x_111); -if (lean_obj_tag(x_117) == 0) -{ -lean_object* x_118; -x_118 = lean_ctor_get(x_117, 1); -lean_inc(x_118); -lean_dec(x_117); -x_26 = x_107; -x_27 = x_118; -goto block_37; -} -else -{ -lean_object* x_119; lean_object* x_120; -lean_dec(x_107); -x_119 = lean_ctor_get(x_117, 0); -lean_inc(x_119); -x_120 = lean_ctor_get(x_117, 1); -lean_inc(x_120); -lean_dec(x_117); -x_26 = x_119; -x_27 = x_120; -goto block_37; -} -} -else -{ -lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; -x_121 = lean_ctor_get(x_110, 2); -x_122 = lean_ctor_get(x_110, 3); -x_123 = lean_ctor_get(x_110, 4); -lean_inc(x_123); -lean_inc(x_122); -lean_inc(x_121); -lean_dec(x_110); -x_124 = lean_alloc_ctor(0, 5, 0); -lean_ctor_set(x_124, 0, x_112); -lean_ctor_set(x_124, 1, x_113); -lean_ctor_set(x_124, 2, x_121); -lean_ctor_set(x_124, 3, x_122); -lean_ctor_set(x_124, 4, x_123); -lean_inc(x_7); -x_125 = l___private_Lean_Elab_Command_3__setState(x_124, x_7, x_111); -if (lean_obj_tag(x_125) == 0) -{ -lean_object* x_126; -x_126 = lean_ctor_get(x_125, 1); -lean_inc(x_126); -lean_dec(x_125); -x_26 = x_107; -x_27 = x_126; -goto block_37; -} -else -{ -lean_object* x_127; lean_object* x_128; -lean_dec(x_107); -x_127 = lean_ctor_get(x_125, 0); -lean_inc(x_127); -x_128 = lean_ctor_get(x_125, 1); -lean_inc(x_128); -lean_dec(x_125); -x_26 = x_127; -x_27 = x_128; -goto block_37; -} -} -} -else -{ -lean_object* x_129; lean_object* x_130; -lean_dec(x_107); -lean_dec(x_106); -x_129 = lean_ctor_get(x_108, 0); -lean_inc(x_129); -x_130 = lean_ctor_get(x_108, 1); -lean_inc(x_130); -lean_dec(x_108); -x_26 = x_129; -x_27 = x_130; -goto block_37; -} -} -else -{ -lean_object* x_131; lean_object* x_132; lean_object* x_133; -lean_dec(x_80); -x_131 = l_Lean_Elab_Command_liftTermElabM___rarg___closed__1; -x_132 = l_unreachable_x21___rarg(x_131); -lean_inc(x_7); -x_133 = lean_apply_2(x_132, x_7, x_77); -if (lean_obj_tag(x_133) == 0) -{ -lean_object* x_134; -x_134 = lean_ctor_get(x_133, 1); -lean_inc(x_134); -lean_dec(x_133); -x_57 = x_134; -goto block_68; -} -else -{ -lean_object* x_135; lean_object* x_136; -lean_dec(x_55); -lean_dec(x_1); -x_135 = lean_ctor_get(x_133, 0); -lean_inc(x_135); -x_136 = lean_ctor_get(x_133, 1); -lean_inc(x_136); -lean_dec(x_133); -x_26 = x_135; -x_27 = x_136; -goto block_37; -} -} -} -} -else -{ -lean_object* x_137; lean_object* x_138; -lean_dec(x_74); -lean_dec(x_70); -lean_dec(x_69); -lean_dec(x_55); -lean_dec(x_1); -x_137 = lean_ctor_get(x_75, 0); -lean_inc(x_137); -x_138 = lean_ctor_get(x_75, 1); -lean_inc(x_138); -lean_dec(x_75); -x_26 = x_137; -x_27 = x_138; -goto block_37; -} -} -else -{ -lean_object* x_139; lean_object* x_140; -lean_dec(x_70); -lean_dec(x_69); -lean_dec(x_55); -lean_dec(x_1); -x_139 = lean_ctor_get(x_71, 0); -lean_inc(x_139); -x_140 = lean_ctor_get(x_71, 1); -lean_inc(x_140); -lean_dec(x_71); -x_26 = x_139; -x_27 = x_140; -goto block_37; -} -block_68: -{ -lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; -lean_inc(x_1); -x_58 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_58, 0, x_1); -x_59 = l_Lean_Elab_Command_elabInductiveCore___closed__2; -x_60 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_60, 0, x_58); -lean_ctor_set(x_60, 1, x_59); -x_61 = l_List_toString___at_Lean_Elab_OpenDecl_HasToString___spec__2(x_55); -x_62 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_62, 0, x_61); -x_63 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_63, 0, x_62); -x_64 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_64, 0, x_60); -lean_ctor_set(x_64, 1, x_63); -lean_inc(x_7); -x_65 = l_Lean_Elab_Command_throwError___rarg(x_1, x_64, x_7, x_57); -lean_dec(x_1); -x_66 = lean_ctor_get(x_65, 0); -lean_inc(x_66); -x_67 = lean_ctor_get(x_65, 1); -lean_inc(x_67); -lean_dec(x_65); -x_26 = x_66; -x_27 = x_67; -goto block_37; -} -} -else -{ -lean_object* x_141; lean_object* x_142; -lean_dec(x_45); -lean_dec(x_4); -lean_dec(x_1); -x_141 = lean_ctor_get(x_54, 0); -lean_inc(x_141); -x_142 = lean_ctor_get(x_54, 1); -lean_inc(x_142); -lean_dec(x_54); -x_26 = x_141; -x_27 = x_142; -goto block_37; -} -} -else -{ -lean_object* x_143; lean_object* x_144; -lean_dec(x_45); -lean_dec(x_4); -lean_dec(x_1); -x_143 = lean_ctor_get(x_52, 0); -lean_inc(x_143); -x_144 = lean_ctor_get(x_52, 1); -lean_inc(x_144); -lean_dec(x_52); -x_26 = x_143; -x_27 = x_144; -goto block_37; -} -} -else -{ -lean_object* x_145; lean_object* x_146; -lean_dec(x_45); -lean_dec(x_4); -lean_dec(x_1); -x_145 = lean_ctor_get(x_48, 0); -lean_inc(x_145); -x_146 = lean_ctor_get(x_48, 1); -lean_inc(x_146); -lean_dec(x_48); -x_26 = x_145; -x_27 = x_146; -goto block_37; -} -} -else -{ -lean_object* x_147; lean_object* x_148; -lean_dec(x_4); -lean_dec(x_1); -x_147 = lean_ctor_get(x_44, 0); -lean_inc(x_147); -x_148 = lean_ctor_get(x_44, 1); -lean_inc(x_148); -lean_dec(x_44); -x_26 = x_147; -x_27 = x_148; -goto block_37; -} -} -else -{ -uint8_t x_149; -lean_dec(x_25); -lean_dec(x_13); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_1); -x_149 = !lean_is_exclusive(x_42); -if (x_149 == 0) -{ -return x_42; -} -else -{ -lean_object* x_150; lean_object* x_151; lean_object* x_152; -x_150 = lean_ctor_get(x_42, 0); -x_151 = lean_ctor_get(x_42, 1); -lean_inc(x_151); -lean_inc(x_150); -lean_dec(x_42); -x_152 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_152, 0, x_150); -lean_ctor_set(x_152, 1, x_151); -return x_152; -} -} -} -else -{ -uint8_t x_153; -lean_dec(x_25); -lean_dec(x_15); -lean_dec(x_13); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_1); -x_153 = !lean_is_exclusive(x_40); -if (x_153 == 0) -{ -return x_40; -} -else -{ -lean_object* x_154; lean_object* x_155; lean_object* x_156; -x_154 = lean_ctor_get(x_40, 0); -x_155 = lean_ctor_get(x_40, 1); -lean_inc(x_155); -lean_inc(x_154); -lean_dec(x_40); -x_156 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_156, 0, x_154); -lean_ctor_set(x_156, 1, x_155); -return x_156; -} -} -block_37: -{ -lean_object* x_28; -x_28 = l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__1(x_13, x_7, x_27); -if (lean_obj_tag(x_28) == 0) -{ -uint8_t x_29; -x_29 = !lean_is_exclusive(x_28); -if (x_29 == 0) -{ -lean_object* x_30; -x_30 = lean_ctor_get(x_28, 0); -lean_dec(x_30); -lean_ctor_set_tag(x_28, 1); -lean_ctor_set(x_28, 0, x_26); -return x_28; -} -else -{ -lean_object* x_31; lean_object* x_32; -x_31 = lean_ctor_get(x_28, 1); -lean_inc(x_31); -lean_dec(x_28); -x_32 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_32, 0, x_26); -lean_ctor_set(x_32, 1, x_31); -return x_32; -} -} -else -{ -uint8_t x_33; -lean_dec(x_26); -x_33 = !lean_is_exclusive(x_28); -if (x_33 == 0) -{ -return x_28; -} -else -{ -lean_object* x_34; lean_object* x_35; lean_object* x_36; -x_34 = lean_ctor_get(x_28, 0); -x_35 = lean_ctor_get(x_28, 1); -lean_inc(x_35); -lean_inc(x_34); -lean_dec(x_28); -x_36 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_36, 0, x_34); -lean_ctor_set(x_36, 1, x_35); -return x_36; -} -} -} -} -else -{ -lean_object* x_157; lean_object* x_158; lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_177; uint8_t x_178; lean_object* x_179; -x_157 = lean_ctor_get(x_17, 1); -x_158 = lean_ctor_get(x_17, 2); -x_159 = lean_ctor_get(x_17, 3); -lean_inc(x_159); -lean_inc(x_158); -lean_inc(x_157); -lean_dec(x_17); -x_160 = lean_ctor_get(x_18, 0); -lean_inc(x_160); -x_161 = lean_ctor_get(x_18, 1); -lean_inc(x_161); -lean_dec(x_18); -x_162 = lean_box(0); -x_163 = lean_name_mk_string(x_162, x_161); -x_164 = lean_alloc_ctor(0, 4, 0); -lean_ctor_set(x_164, 0, x_163); -lean_ctor_set(x_164, 1, x_157); -lean_ctor_set(x_164, 2, x_158); -lean_ctor_set(x_164, 3, x_159); -x_165 = l_Lean_MacroScopesView_review(x_164); -x_177 = l_Lean_Parser_Command_namespace___elambda__1___closed__1; -x_178 = 1; -lean_inc(x_7); -x_179 = l___private_Lean_Elab_Command_12__addScopes___main(x_3, x_177, x_178, x_160, x_7, x_16); -if (lean_obj_tag(x_179) == 0) -{ -lean_object* x_180; lean_object* x_181; -x_180 = lean_ctor_get(x_179, 1); -lean_inc(x_180); -lean_dec(x_179); -lean_inc(x_7); -x_181 = l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__2(x_15, x_7, x_180); -if (lean_obj_tag(x_181) == 0) -{ -lean_object* x_182; lean_object* x_183; -x_182 = lean_ctor_get(x_181, 1); -lean_inc(x_182); -lean_dec(x_181); -lean_inc(x_7); -x_183 = l_Lean_Elab_Command_mkDeclName(x_2, x_165, x_7, x_182); -if (lean_obj_tag(x_183) == 0) -{ -lean_object* x_184; lean_object* x_185; lean_object* x_186; lean_object* x_187; -x_184 = lean_ctor_get(x_183, 0); -lean_inc(x_184); -x_185 = lean_ctor_get(x_183, 1); -lean_inc(x_185); -lean_dec(x_183); -x_186 = lean_ctor_get(x_2, 1); -lean_inc(x_7); -lean_inc(x_184); -x_187 = l_Lean_Elab_Command_checkNotAlreadyDeclared(x_1, x_184, x_7, x_185); -if (lean_obj_tag(x_187) == 0) -{ -lean_object* x_188; uint8_t x_189; lean_object* x_190; lean_object* x_191; -x_188 = lean_ctor_get(x_187, 1); -lean_inc(x_188); -lean_dec(x_187); -x_189 = 2; -x_190 = lean_unsigned_to_nat(0u); -lean_inc(x_7); -lean_inc(x_184); -x_191 = l_Array_forMAux___main___at_Lean_Elab_Command_applyAttributes___spec__1(x_1, x_184, x_189, x_186, x_190, x_7, x_188); -if (lean_obj_tag(x_191) == 0) -{ -lean_object* x_192; lean_object* x_193; -x_192 = lean_ctor_get(x_191, 1); -lean_inc(x_192); -lean_dec(x_191); -lean_inc(x_7); -x_193 = l_Lean_Elab_Command_getLevelNames(x_7, x_192); -if (lean_obj_tag(x_193) == 0) -{ -lean_object* x_194; lean_object* x_195; lean_object* x_196; lean_object* x_208; lean_object* x_209; lean_object* x_210; -x_194 = lean_ctor_get(x_193, 0); -lean_inc(x_194); -x_195 = lean_ctor_get(x_193, 1); -lean_inc(x_195); -lean_dec(x_193); -x_208 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_208, 0, x_184); -x_209 = lean_alloc_closure((void*)(l_Lean_Elab_Command_elabInductiveCore___lambda__1___boxed), 4, 1); -lean_closure_set(x_209, 0, x_4); -lean_inc(x_7); -x_210 = l___private_Lean_Elab_Command_2__getState(x_7, x_195); -if (lean_obj_tag(x_210) == 0) -{ -lean_object* x_211; lean_object* x_212; lean_object* x_213; lean_object* x_214; -x_211 = lean_ctor_get(x_210, 0); -lean_inc(x_211); -x_212 = lean_ctor_get(x_210, 1); -lean_inc(x_212); -lean_dec(x_210); -x_213 = l___private_Lean_Elab_Command_9__getVarDecls(x_211); -lean_dec(x_211); -lean_inc(x_7); -x_214 = l___private_Lean_Elab_Command_2__getState(x_7, x_212); -if (lean_obj_tag(x_214) == 0) -{ -lean_object* x_215; lean_object* x_216; lean_object* x_217; lean_object* x_218; lean_object* x_219; -x_215 = lean_ctor_get(x_214, 0); -lean_inc(x_215); -x_216 = lean_ctor_get(x_214, 1); -lean_inc(x_216); -lean_dec(x_214); -x_217 = l___private_Lean_Elab_Command_6__mkTermContext(x_7, x_215, x_208); -x_218 = l___private_Lean_Elab_Command_7__mkTermState(x_215); -lean_dec(x_215); -x_219 = l_Lean_Elab_Term_elabBinders___rarg(x_213, x_209, x_217, x_218); -lean_dec(x_213); -if (lean_obj_tag(x_219) == 0) -{ -lean_object* x_220; lean_object* x_221; -x_220 = lean_ctor_get(x_219, 1); -lean_inc(x_220); -lean_dec(x_219); -lean_inc(x_7); -x_221 = l___private_Lean_Elab_Command_2__getState(x_7, x_216); -if (lean_obj_tag(x_221) == 0) -{ -lean_object* x_222; lean_object* x_223; 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; lean_object* x_231; lean_object* x_232; -x_222 = lean_ctor_get(x_220, 0); -lean_inc(x_222); -x_223 = lean_ctor_get(x_221, 0); -lean_inc(x_223); -x_224 = lean_ctor_get(x_221, 1); -lean_inc(x_224); -lean_dec(x_221); -x_225 = lean_ctor_get(x_222, 0); -lean_inc(x_225); -lean_dec(x_222); -x_226 = lean_ctor_get(x_220, 2); -lean_inc(x_226); -lean_dec(x_220); -x_227 = lean_ctor_get(x_223, 2); -lean_inc(x_227); -x_228 = lean_ctor_get(x_223, 3); -lean_inc(x_228); -x_229 = lean_ctor_get(x_223, 4); -lean_inc(x_229); -if (lean_is_exclusive(x_223)) { - lean_ctor_release(x_223, 0); - lean_ctor_release(x_223, 1); - lean_ctor_release(x_223, 2); - lean_ctor_release(x_223, 3); - lean_ctor_release(x_223, 4); - x_230 = x_223; -} else { - lean_dec_ref(x_223); - x_230 = lean_box(0); -} -if (lean_is_scalar(x_230)) { - x_231 = lean_alloc_ctor(0, 5, 0); -} else { - x_231 = x_230; -} -lean_ctor_set(x_231, 0, x_225); -lean_ctor_set(x_231, 1, x_226); -lean_ctor_set(x_231, 2, x_227); -lean_ctor_set(x_231, 3, x_228); -lean_ctor_set(x_231, 4, x_229); -lean_inc(x_7); -x_232 = l___private_Lean_Elab_Command_3__setState(x_231, x_7, x_224); -if (lean_obj_tag(x_232) == 0) -{ -lean_object* x_233; -x_233 = lean_ctor_get(x_232, 1); -lean_inc(x_233); -lean_dec(x_232); -x_196 = x_233; -goto block_207; -} -else -{ -lean_object* x_234; lean_object* x_235; -lean_dec(x_194); -lean_dec(x_1); -x_234 = lean_ctor_get(x_232, 0); -lean_inc(x_234); -x_235 = lean_ctor_get(x_232, 1); -lean_inc(x_235); -lean_dec(x_232); -x_166 = x_234; -x_167 = x_235; -goto block_176; -} -} -else -{ -lean_object* x_236; lean_object* x_237; -lean_dec(x_220); -lean_dec(x_194); -lean_dec(x_1); -x_236 = lean_ctor_get(x_221, 0); -lean_inc(x_236); -x_237 = lean_ctor_get(x_221, 1); -lean_inc(x_237); -lean_dec(x_221); -x_166 = x_236; -x_167 = x_237; -goto block_176; -} -} -else -{ -lean_object* x_238; -x_238 = lean_ctor_get(x_219, 0); -lean_inc(x_238); -if (lean_obj_tag(x_238) == 0) -{ -lean_object* x_239; lean_object* x_240; lean_object* x_241; -lean_dec(x_194); -lean_dec(x_1); -x_239 = lean_ctor_get(x_219, 1); -lean_inc(x_239); -lean_dec(x_219); -x_240 = lean_ctor_get(x_238, 0); -lean_inc(x_240); -lean_dec(x_238); -lean_inc(x_7); -x_241 = l___private_Lean_Elab_Command_2__getState(x_7, x_216); -if (lean_obj_tag(x_241) == 0) -{ -lean_object* x_242; lean_object* x_243; lean_object* x_244; lean_object* x_245; lean_object* x_246; lean_object* x_247; lean_object* x_248; lean_object* x_249; lean_object* x_250; lean_object* x_251; lean_object* x_252; -x_242 = lean_ctor_get(x_239, 0); -lean_inc(x_242); -x_243 = lean_ctor_get(x_241, 0); -lean_inc(x_243); -x_244 = lean_ctor_get(x_241, 1); -lean_inc(x_244); -lean_dec(x_241); -x_245 = lean_ctor_get(x_242, 0); -lean_inc(x_245); -lean_dec(x_242); -x_246 = lean_ctor_get(x_239, 2); -lean_inc(x_246); -lean_dec(x_239); -x_247 = lean_ctor_get(x_243, 2); -lean_inc(x_247); -x_248 = lean_ctor_get(x_243, 3); -lean_inc(x_248); -x_249 = lean_ctor_get(x_243, 4); -lean_inc(x_249); -if (lean_is_exclusive(x_243)) { - lean_ctor_release(x_243, 0); - lean_ctor_release(x_243, 1); - lean_ctor_release(x_243, 2); - lean_ctor_release(x_243, 3); - lean_ctor_release(x_243, 4); - x_250 = x_243; -} else { - lean_dec_ref(x_243); - x_250 = lean_box(0); -} -if (lean_is_scalar(x_250)) { - x_251 = lean_alloc_ctor(0, 5, 0); -} else { - x_251 = x_250; -} -lean_ctor_set(x_251, 0, x_245); -lean_ctor_set(x_251, 1, x_246); -lean_ctor_set(x_251, 2, x_247); -lean_ctor_set(x_251, 3, x_248); -lean_ctor_set(x_251, 4, x_249); -lean_inc(x_7); -x_252 = l___private_Lean_Elab_Command_3__setState(x_251, x_7, x_244); -if (lean_obj_tag(x_252) == 0) -{ -lean_object* x_253; -x_253 = lean_ctor_get(x_252, 1); -lean_inc(x_253); -lean_dec(x_252); -x_166 = x_240; -x_167 = x_253; -goto block_176; -} -else -{ -lean_object* x_254; lean_object* x_255; -lean_dec(x_240); -x_254 = lean_ctor_get(x_252, 0); -lean_inc(x_254); -x_255 = lean_ctor_get(x_252, 1); -lean_inc(x_255); -lean_dec(x_252); -x_166 = x_254; -x_167 = x_255; -goto block_176; -} -} -else -{ -lean_object* x_256; lean_object* x_257; -lean_dec(x_240); -lean_dec(x_239); -x_256 = lean_ctor_get(x_241, 0); -lean_inc(x_256); -x_257 = lean_ctor_get(x_241, 1); -lean_inc(x_257); -lean_dec(x_241); -x_166 = x_256; -x_167 = x_257; -goto block_176; -} -} -else -{ -lean_object* x_258; lean_object* x_259; lean_object* x_260; -lean_dec(x_219); -x_258 = l_Lean_Elab_Command_liftTermElabM___rarg___closed__1; -x_259 = l_unreachable_x21___rarg(x_258); -lean_inc(x_7); -x_260 = lean_apply_2(x_259, x_7, x_216); -if (lean_obj_tag(x_260) == 0) -{ -lean_object* x_261; -x_261 = lean_ctor_get(x_260, 1); -lean_inc(x_261); -lean_dec(x_260); -x_196 = x_261; -goto block_207; -} -else -{ -lean_object* x_262; lean_object* x_263; -lean_dec(x_194); -lean_dec(x_1); -x_262 = lean_ctor_get(x_260, 0); -lean_inc(x_262); -x_263 = lean_ctor_get(x_260, 1); -lean_inc(x_263); -lean_dec(x_260); -x_166 = x_262; -x_167 = x_263; -goto block_176; -} -} -} -} -else -{ -lean_object* x_264; lean_object* x_265; -lean_dec(x_213); -lean_dec(x_209); -lean_dec(x_208); -lean_dec(x_194); -lean_dec(x_1); -x_264 = lean_ctor_get(x_214, 0); -lean_inc(x_264); -x_265 = lean_ctor_get(x_214, 1); -lean_inc(x_265); -lean_dec(x_214); -x_166 = x_264; -x_167 = x_265; -goto block_176; -} -} -else -{ -lean_object* x_266; lean_object* x_267; -lean_dec(x_209); -lean_dec(x_208); -lean_dec(x_194); -lean_dec(x_1); -x_266 = lean_ctor_get(x_210, 0); -lean_inc(x_266); -x_267 = lean_ctor_get(x_210, 1); -lean_inc(x_267); -lean_dec(x_210); -x_166 = x_266; -x_167 = x_267; -goto block_176; -} -block_207: -{ -lean_object* x_197; lean_object* x_198; lean_object* x_199; lean_object* x_200; lean_object* x_201; lean_object* x_202; lean_object* x_203; lean_object* x_204; lean_object* x_205; lean_object* x_206; -lean_inc(x_1); -x_197 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_197, 0, x_1); -x_198 = l_Lean_Elab_Command_elabInductiveCore___closed__2; -x_199 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_199, 0, x_197); -lean_ctor_set(x_199, 1, x_198); -x_200 = l_List_toString___at_Lean_Elab_OpenDecl_HasToString___spec__2(x_194); -x_201 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_201, 0, x_200); -x_202 = lean_alloc_ctor(0, 1, 0); -lean_ctor_set(x_202, 0, x_201); -x_203 = lean_alloc_ctor(9, 2, 0); -lean_ctor_set(x_203, 0, x_199); -lean_ctor_set(x_203, 1, x_202); -lean_inc(x_7); -x_204 = l_Lean_Elab_Command_throwError___rarg(x_1, x_203, x_7, x_196); -lean_dec(x_1); -x_205 = lean_ctor_get(x_204, 0); -lean_inc(x_205); -x_206 = lean_ctor_get(x_204, 1); -lean_inc(x_206); -lean_dec(x_204); -x_166 = x_205; -x_167 = x_206; -goto block_176; -} -} -else -{ -lean_object* x_268; lean_object* x_269; -lean_dec(x_184); -lean_dec(x_4); -lean_dec(x_1); -x_268 = lean_ctor_get(x_193, 0); -lean_inc(x_268); -x_269 = lean_ctor_get(x_193, 1); -lean_inc(x_269); -lean_dec(x_193); -x_166 = x_268; -x_167 = x_269; -goto block_176; -} -} -else -{ -lean_object* x_270; lean_object* x_271; -lean_dec(x_184); -lean_dec(x_4); -lean_dec(x_1); -x_270 = lean_ctor_get(x_191, 0); -lean_inc(x_270); -x_271 = lean_ctor_get(x_191, 1); -lean_inc(x_271); -lean_dec(x_191); -x_166 = x_270; -x_167 = x_271; -goto block_176; -} -} -else -{ -lean_object* x_272; lean_object* x_273; -lean_dec(x_184); -lean_dec(x_4); -lean_dec(x_1); -x_272 = lean_ctor_get(x_187, 0); -lean_inc(x_272); -x_273 = lean_ctor_get(x_187, 1); -lean_inc(x_273); -lean_dec(x_187); -x_166 = x_272; -x_167 = x_273; -goto block_176; -} -} -else -{ -lean_object* x_274; lean_object* x_275; -lean_dec(x_4); -lean_dec(x_1); -x_274 = lean_ctor_get(x_183, 0); -lean_inc(x_274); -x_275 = lean_ctor_get(x_183, 1); -lean_inc(x_275); -lean_dec(x_183); -x_166 = x_274; -x_167 = x_275; -goto block_176; -} -} -else -{ -lean_object* x_276; lean_object* x_277; lean_object* x_278; lean_object* x_279; -lean_dec(x_165); -lean_dec(x_13); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_1); -x_276 = lean_ctor_get(x_181, 0); -lean_inc(x_276); -x_277 = lean_ctor_get(x_181, 1); -lean_inc(x_277); -if (lean_is_exclusive(x_181)) { - lean_ctor_release(x_181, 0); - lean_ctor_release(x_181, 1); - x_278 = x_181; -} else { - lean_dec_ref(x_181); - x_278 = lean_box(0); -} -if (lean_is_scalar(x_278)) { - x_279 = lean_alloc_ctor(1, 2, 0); -} else { - x_279 = x_278; -} -lean_ctor_set(x_279, 0, x_276); -lean_ctor_set(x_279, 1, x_277); -return x_279; -} -} -else -{ -lean_object* x_280; lean_object* x_281; lean_object* x_282; lean_object* x_283; -lean_dec(x_165); -lean_dec(x_15); -lean_dec(x_13); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_1); -x_280 = lean_ctor_get(x_179, 0); -lean_inc(x_280); -x_281 = lean_ctor_get(x_179, 1); -lean_inc(x_281); -if (lean_is_exclusive(x_179)) { - lean_ctor_release(x_179, 0); - lean_ctor_release(x_179, 1); - x_282 = x_179; -} else { - lean_dec_ref(x_179); - x_282 = lean_box(0); -} -if (lean_is_scalar(x_282)) { - x_283 = lean_alloc_ctor(1, 2, 0); -} else { - x_283 = x_282; -} -lean_ctor_set(x_283, 0, x_280); -lean_ctor_set(x_283, 1, x_281); -return x_283; -} -block_176: -{ -lean_object* x_168; -x_168 = l_Lean_Elab_Command_modifyScope___at_Lean_Elab_Command_elabInductiveCore___spec__1(x_13, x_7, x_167); -if (lean_obj_tag(x_168) == 0) -{ -lean_object* x_169; lean_object* x_170; lean_object* x_171; -x_169 = lean_ctor_get(x_168, 1); -lean_inc(x_169); -if (lean_is_exclusive(x_168)) { - lean_ctor_release(x_168, 0); - lean_ctor_release(x_168, 1); - x_170 = x_168; -} else { - lean_dec_ref(x_168); - x_170 = lean_box(0); -} -if (lean_is_scalar(x_170)) { - x_171 = lean_alloc_ctor(1, 2, 0); -} else { - x_171 = x_170; - lean_ctor_set_tag(x_171, 1); -} -lean_ctor_set(x_171, 0, x_166); -lean_ctor_set(x_171, 1, x_169); -return x_171; -} -else -{ -lean_object* x_172; lean_object* x_173; lean_object* x_174; lean_object* x_175; -lean_dec(x_166); -x_172 = lean_ctor_get(x_168, 0); -lean_inc(x_172); -x_173 = lean_ctor_get(x_168, 1); -lean_inc(x_173); -if (lean_is_exclusive(x_168)) { - lean_ctor_release(x_168, 0); - lean_ctor_release(x_168, 1); - x_174 = x_168; -} else { - lean_dec_ref(x_168); - x_174 = lean_box(0); -} -if (lean_is_scalar(x_174)) { - x_175 = lean_alloc_ctor(1, 2, 0); -} else { - x_175 = x_174; -} -lean_ctor_set(x_175, 0, x_172); -lean_ctor_set(x_175, 1, x_173); -return x_175; -} -} -} -} -else -{ -lean_object* x_284; lean_object* x_285; -lean_dec(x_18); -lean_dec(x_17); -lean_dec(x_15); -lean_dec(x_13); -lean_dec(x_4); -lean_dec(x_1); -x_284 = l_Lean_Elab_Command_withDeclId___closed__3; -x_285 = l_Lean_Elab_Command_throwError___rarg(x_3, x_284, x_7, x_16); -return x_285; -} -} -} -else -{ -uint8_t x_302; -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_7); -lean_dec(x_4); -lean_dec(x_1); -x_302 = !lean_is_exclusive(x_12); -if (x_302 == 0) -{ -return x_12; -} -else -{ -lean_object* x_303; lean_object* x_304; lean_object* x_305; -x_303 = lean_ctor_get(x_12, 0); -x_304 = lean_ctor_get(x_12, 1); -lean_inc(x_304); -lean_inc(x_303); -lean_dec(x_12); -x_305 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_305, 0, x_303); -lean_ctor_set(x_305, 1, x_304); -return x_305; -} -} -} -} -lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__5___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_Lean_Elab_Command_elabInductiveCore___spec__5(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_Lean_Elab_Command_elabInductiveCore___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { -_start: -{ -lean_object* x_5; -x_5 = l_Lean_Elab_Command_elabInductiveCore___lambda__1(x_1, x_2, x_3, x_4); -lean_dec(x_2); -lean_dec(x_1); -return x_5; -} -} -lean_object* l_Lean_Elab_Command_elabInductiveCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { -_start: -{ -lean_object* x_9; -x_9 = l_Lean_Elab_Command_elabInductiveCore(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8); lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_3); -lean_dec(x_2); -return x_9; +x_8 = x_1; +x_9 = l_Array_umapMAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__1(x_5, x_8); +x_10 = x_9; +x_11 = l_Array_toList___rarg(x_10); +lean_dec(x_10); +x_12 = l_List_toString___at_Lean_Elab_Command_elabInductiveCore___spec__2(x_11); +x_13 = l_Array_HasRepr___rarg___closed__1; +x_14 = lean_string_append(x_13, x_12); +lean_dec(x_12); +x_15 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_15, 0, x_14); +x_16 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_16, 0, x_15); +x_17 = l_Lean_Elab_Command_elabInductiveCore___closed__3; +x_18 = lean_alloc_ctor(9, 2, 0); +lean_ctor_set(x_18, 0, x_17); +lean_ctor_set(x_18, 1, x_16); +x_19 = l_Lean_Elab_Command_throwError___rarg(x_7, x_18, x_2, x_3); +lean_dec(x_7); +return x_19; +} +} +lean_object* l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3___boxed(lean_object* x_1, lean_object* x_2) { +_start: +{ +uint8_t x_3; lean_object* x_4; +x_3 = lean_unbox(x_1); +lean_dec(x_1); +x_4 = l_List_toStringAux___main___at_Lean_Elab_Command_elabInductiveCore___spec__3(x_3, x_2); +return x_4; } } lean_object* initialize_Init(lean_object*); @@ -3772,10 +326,18 @@ lean_dec_ref(res); res = initialize_Lean_Elab_Definition(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l_Lean_Elab_Command_InductiveView_inhabited___closed__1 = _init_l_Lean_Elab_Command_InductiveView_inhabited___closed__1(); +lean_mark_persistent(l_Lean_Elab_Command_InductiveView_inhabited___closed__1); +l_Lean_Elab_Command_InductiveView_inhabited___closed__2 = _init_l_Lean_Elab_Command_InductiveView_inhabited___closed__2(); +lean_mark_persistent(l_Lean_Elab_Command_InductiveView_inhabited___closed__2); +l_Lean_Elab_Command_InductiveView_inhabited = _init_l_Lean_Elab_Command_InductiveView_inhabited(); +lean_mark_persistent(l_Lean_Elab_Command_InductiveView_inhabited); l_Lean_Elab_Command_elabInductiveCore___closed__1 = _init_l_Lean_Elab_Command_elabInductiveCore___closed__1(); lean_mark_persistent(l_Lean_Elab_Command_elabInductiveCore___closed__1); l_Lean_Elab_Command_elabInductiveCore___closed__2 = _init_l_Lean_Elab_Command_elabInductiveCore___closed__2(); lean_mark_persistent(l_Lean_Elab_Command_elabInductiveCore___closed__2); +l_Lean_Elab_Command_elabInductiveCore___closed__3 = _init_l_Lean_Elab_Command_elabInductiveCore___closed__3(); +lean_mark_persistent(l_Lean_Elab_Command_elabInductiveCore___closed__3); return lean_mk_io_result(lean_box(0)); } #ifdef __cplusplus diff --git a/stage0/stdlib/Lean/Meta/Basic.c b/stage0/stdlib/Lean/Meta/Basic.c index d9b5b1e9fc..57c6f7ec1e 100644 --- a/stage0/stdlib/Lean/Meta/Basic.c +++ b/stage0/stdlib/Lean/Meta/Basic.c @@ -57,6 +57,7 @@ extern lean_object* l_EIO_Monad___closed__1; lean_object* l_Lean_Meta_savingCache(lean_object*); lean_object* l_Lean_Meta_addContext___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkFreshExprMVarAt___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2(lean_object*, lean_object*); lean_object* l_Lean_Meta_mkForall(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withLocalContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_local_ctx_mk_let_decl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -64,6 +65,7 @@ extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* l_ReaderT_bind___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_forallMetaTelescope___boxed(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_maxRecDepthErrorMessage; +lean_object* lean_io_prim_handle_put_str(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_resettingSynthInstanceCache___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_liftStateMCtx(lean_object*); lean_object* lean_metavar_ctx_get_expr_assignment(lean_object*, lean_object*); @@ -294,7 +296,6 @@ lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallBound extern lean_object* l___private_Lean_Environment_5__envExtensionsRef; lean_object* l_Lean_Meta_forallMetaTelescopeReducing(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l_Lean_Meta_isDelayedAssigned___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(lean_object*, lean_object*); lean_object* l_Lean_Meta_approxDefEq(lean_object*); lean_object* l_Lean_Meta_shouldReduceReducibleOnly___boxed(lean_object*, lean_object*); lean_object* l_Lean_Meta_mkIsExprDefEqAuxRef(lean_object*); @@ -375,6 +376,7 @@ lean_object* l_Lean_Meta_dbgTrace(lean_object*); lean_object* l_Lean_Meta_mkFreshId(lean_object*); lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallTelescope___spec__3___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_TransparencyMode_beq___boxed(lean_object*, lean_object*); +lean_object* lean_get_stdout(lean_object*); lean_object* l_Lean_Meta_metaExt___elambda__1(lean_object*); lean_object* l_Lean_Meta_getTransparency___boxed(lean_object*, lean_object*); extern lean_object* l_Lean_TraceState_Inhabited___closed__1; @@ -50202,12 +50204,46 @@ return x_2; lean_object* l_IO_print___at_IO_runMeta___spec__2(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_3; lean_object* x_4; lean_object* x_5; -x_3 = l_Lean_Options_empty; -x_4 = l_Lean_Format_pretty(x_1, x_3); -x_5 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_4, x_2); +lean_object* x_3; +x_3 = lean_get_stdout(x_2); +if (lean_obj_tag(x_3) == 0) +{ +lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_4 = lean_ctor_get(x_3, 0); +lean_inc(x_4); +x_5 = lean_ctor_get(x_3, 1); +lean_inc(x_5); +lean_dec(x_3); +x_6 = l_Lean_Options_empty; +x_7 = l_Lean_Format_pretty(x_1, x_6); +x_8 = lean_io_prim_handle_put_str(x_4, x_7, x_5); +lean_dec(x_7); lean_dec(x_4); -return x_5; +return x_8; +} +else +{ +uint8_t x_9; +lean_dec(x_1); +x_9 = !lean_is_exclusive(x_3); +if (x_9 == 0) +{ +return x_3; +} +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_3, 0); +x_11 = lean_ctor_get(x_3, 1); +lean_inc(x_11); +lean_inc(x_10); +lean_dec(x_3); +x_12 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +return x_12; +} +} } } lean_object* l_IO_println___at_IO_runMeta___spec__1(lean_object* x_1, lean_object* x_2) { @@ -50222,7 +50258,7 @@ x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = l_IO_FS_Handle_putStrLn___rarg___closed__1; -x_6 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_5, x_4); +x_6 = l_IO_print___at_Lean_HasRepr_hasEval___spec__2(x_5, x_4); return x_6; } else diff --git a/stage0/stdlib/Lean/Parser/Module.c b/stage0/stdlib/Lean/Parser/Module.c index b0de44024c..2c24e34dac 100644 --- a/stage0/stdlib/Lean/Parser/Module.c +++ b/stage0/stdlib/Lean/Parser/Module.c @@ -30,6 +30,8 @@ lean_object* l_Lean_Parser_ModuleParserState_inhabited___closed__1; lean_object* l_Lean_Parser_testModuleParser___closed__2; lean_object* l_Lean_Format_pretty(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_regBuiltinCommandParserAttr___closed__4; +lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2(lean_object*, lean_object*); +lean_object* lean_io_prim_handle_put_str(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Module_import___closed__10; lean_object* l_Lean_Parser_Module_prelude; lean_object* l_Lean_Parser_Module_import___elambda__1___closed__12; @@ -128,7 +130,6 @@ lean_object* l_Lean_Parser_Module_header___closed__5; lean_object* l_IO_FS_Handle_getLine___at_Lean_Parser_parseFile___spec__4(lean_object*, lean_object*); lean_object* l_Lean_Parser_Module_prelude___closed__5; lean_object* l_Lean_Parser_Module_import___closed__2; -lean_object* l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(lean_object*, lean_object*); lean_object* l_Lean_Parser_ModuleParserState_inhabited; lean_object* l_Lean_Parser_Module_prelude___elambda__1___closed__5; lean_object* l_Std_PersistentArray_forM___at___private_Lean_Parser_Module_4__testModuleParserAux___main___spec__6(lean_object*, lean_object*, lean_object*); @@ -154,6 +155,7 @@ extern lean_object* l_Lean_Parser_epsilonInfo; lean_object* l_Lean_Parser_Module_prelude___elambda__1___closed__6; lean_object* l_Lean_Parser_categoryParser___elambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Module_prelude___closed__2; +lean_object* lean_get_stdout(lean_object*); lean_object* l_Lean_Parser_manyAux___main___at_Lean_Parser_Module_header___elambda__1___spec__1(lean_object*, lean_object*); lean_object* l_Lean_MessageLog_forM___at___private_Lean_Parser_Module_4__testModuleParserAux___main___spec__5___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Module_import___elambda__1___closed__7; @@ -2509,16 +2511,50 @@ return x_5; lean_object* l_IO_print___at___private_Lean_Parser_Module_4__testModuleParserAux___main___spec__2(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_3; uint8_t x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; -x_3 = lean_box(0); -x_4 = 0; -x_5 = lean_unsigned_to_nat(0u); -x_6 = l_Lean_Syntax_formatStxAux___main(x_3, x_4, x_5, x_1); -x_7 = l_Lean_Options_empty; -x_8 = l_Lean_Format_pretty(x_6, x_7); -x_9 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_8, x_2); -lean_dec(x_8); -return x_9; +lean_object* x_3; +x_3 = lean_get_stdout(x_2); +if (lean_obj_tag(x_3) == 0) +{ +lean_object* x_4; lean_object* x_5; lean_object* x_6; uint8_t x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_4 = lean_ctor_get(x_3, 0); +lean_inc(x_4); +x_5 = lean_ctor_get(x_3, 1); +lean_inc(x_5); +lean_dec(x_3); +x_6 = lean_box(0); +x_7 = 0; +x_8 = lean_unsigned_to_nat(0u); +x_9 = l_Lean_Syntax_formatStxAux___main(x_6, x_7, x_8, x_1); +x_10 = l_Lean_Options_empty; +x_11 = l_Lean_Format_pretty(x_9, x_10); +x_12 = lean_io_prim_handle_put_str(x_4, x_11, x_5); +lean_dec(x_11); +lean_dec(x_4); +return x_12; +} +else +{ +uint8_t x_13; +lean_dec(x_1); +x_13 = !lean_is_exclusive(x_3); +if (x_13 == 0) +{ +return x_3; +} +else +{ +lean_object* x_14; lean_object* x_15; lean_object* x_16; +x_14 = lean_ctor_get(x_3, 0); +x_15 = lean_ctor_get(x_3, 1); +lean_inc(x_15); +lean_inc(x_14); +lean_dec(x_3); +x_16 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_16, 0, x_14); +lean_ctor_set(x_16, 1, x_15); +return x_16; +} +} } } lean_object* l_IO_println___at___private_Lean_Parser_Module_4__testModuleParserAux___main___spec__1(lean_object* x_1, lean_object* x_2) { @@ -2533,7 +2569,7 @@ x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = l_IO_FS_Handle_putStrLn___rarg___closed__1; -x_6 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_5, x_4); +x_6 = l_IO_print___at_Lean_HasRepr_hasEval___spec__2(x_5, x_4); return x_6; } else @@ -2563,11 +2599,45 @@ return x_10; lean_object* l_IO_print___at___private_Lean_Parser_Module_4__testModuleParserAux___main___spec__4(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_3; lean_object* x_4; -x_3 = l_Lean_Message_toString(x_1); -x_4 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_3, x_2); +lean_object* x_3; +x_3 = lean_get_stdout(x_2); +if (lean_obj_tag(x_3) == 0) +{ +lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_4 = lean_ctor_get(x_3, 0); +lean_inc(x_4); +x_5 = lean_ctor_get(x_3, 1); +lean_inc(x_5); lean_dec(x_3); -return x_4; +x_6 = l_Lean_Message_toString(x_1); +x_7 = lean_io_prim_handle_put_str(x_4, x_6, x_5); +lean_dec(x_6); +lean_dec(x_4); +return x_7; +} +else +{ +uint8_t x_8; +lean_dec(x_1); +x_8 = !lean_is_exclusive(x_3); +if (x_8 == 0) +{ +return x_3; +} +else +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; +x_9 = lean_ctor_get(x_3, 0); +x_10 = lean_ctor_get(x_3, 1); +lean_inc(x_10); +lean_inc(x_9); +lean_dec(x_3); +x_11 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_11, 0, x_9); +lean_ctor_set(x_11, 1, x_10); +return x_11; +} +} } } lean_object* l_IO_println___at___private_Lean_Parser_Module_4__testModuleParserAux___main___spec__3(lean_object* x_1, lean_object* x_2) { @@ -2582,7 +2652,7 @@ x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = l_IO_FS_Handle_putStrLn___rarg___closed__1; -x_6 = l___private_Init_System_IO_1__putStr___at_Lean_HasRepr_hasEval___spec__3(x_5, x_4); +x_6 = l_IO_print___at_Lean_HasRepr_hasEval___spec__2(x_5, x_4); return x_6; } else