From 027fec76da55ad5fefea21f4bfb38b2910f1cf36 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Sat, 9 Apr 2022 12:25:43 -0700 Subject: [PATCH] chore: update stage0 --- stage0/src/Init/Data/Nat/Div.lean | 2 +- stage0/src/Init/Data/String/Extra.lean | 2 +- stage0/src/Lean/Meta/Tactic/Refl.lean | 21 +- .../stdlib/Lean/Elab/Tactic/BuiltinTactic.c | 133 ++- stage0/stdlib/Lean/Meta/Tactic/Refl.c | 864 +++++++++--------- 5 files changed, 483 insertions(+), 539 deletions(-) diff --git a/stage0/src/Init/Data/Nat/Div.lean b/stage0/src/Init/Data/Nat/Div.lean index 421dd67983..bf4ff6d8d5 100644 --- a/stage0/src/Init/Data/Nat/Div.lean +++ b/stage0/src/Init/Data/Nat/Div.lean @@ -119,7 +119,7 @@ theorem mod_one (x : Nat) : x % 1 = 0 := by have : (y : Nat) → y < 1 → y = 0 := by intro y cases y with - | zero => intro h; exact rfl -- TODO remove exact + | zero => intro h; rfl | succ y => intro h; apply absurd (Nat.lt_of_succ_lt_succ h) (Nat.not_lt_zero y) exact this _ h diff --git a/stage0/src/Init/Data/String/Extra.lean b/stage0/src/Init/Data/String/Extra.lean index 37506468df..707337ed2d 100644 --- a/stage0/src/Init/Data/String/Extra.lean +++ b/stage0/src/Init/Data/String/Extra.lean @@ -38,7 +38,7 @@ theorem one_le_csize (c : Char) : 1 ≤ csize c := by theorem eq_empty_of_bsize_eq_zero (h : s.endPos = {}) : s = "" := by match s with - | ⟨[]⟩ => exact rfl -- TODO: remove exact + | ⟨[]⟩ => rfl | ⟨c::cs⟩ => injection h with h simp [endPos, utf8ByteSize, utf8ByteSize.go] at h diff --git a/stage0/src/Lean/Meta/Tactic/Refl.lean b/stage0/src/Lean/Meta/Tactic/Refl.lean index 44811ffaaa..5695f3f342 100644 --- a/stage0/src/Lean/Meta/Tactic/Refl.lean +++ b/stage0/src/Lean/Meta/Tactic/Refl.lean @@ -8,7 +8,7 @@ import Lean.Meta.Tactic.Util namespace Lean.Meta -def refl (mvarId : MVarId) (reduceIfGround := true) : MetaM Unit := do +def refl (mvarId : MVarId) : MetaM Unit := do withMVarContext mvarId do checkNotAssigned mvarId `apply let targetType ← getMVarType' mvarId @@ -17,14 +17,8 @@ def refl (mvarId : MVarId) (reduceIfGround := true) : MetaM Unit := do let lhs ← instantiateMVars targetType.appFn!.appArg! let rhs ← instantiateMVars targetType.appArg! let success ← - if (← useReduceAll lhs rhs) then - let lhs' ← reduceAll lhs - let rhs' ← reduceAll rhs - if lhs' == rhs' then - pure true - else - -- Catch corner cases such as `Nat.zero` and the `0` literal - isDefEq lhs' rhs' + if (← useKernel lhs rhs) then + pure (Kernel.isDefEq (← getEnv) {} lhs rhs) else isDefEq lhs rhs unless success do @@ -33,9 +27,10 @@ def refl (mvarId : MVarId) (reduceIfGround := true) : MetaM Unit := do let α := targetType.appFn!.appFn!.appArg! assignExprMVar mvarId (mkApp2 (mkConst ``Eq.refl us) α lhs) where - useReduceAll (lhs rhs : Expr) : MetaM Bool := do - if !reduceIfGround then return false - else if lhs.hasFVar || lhs.hasMVar || lhs.hasFVar || lhs.hasMVar then return false - else return (← getTransparency) matches TransparencyMode.default | TransparencyMode.all + useKernel (lhs rhs : Expr) : MetaM Bool := do + if lhs.hasFVar || lhs.hasMVar || rhs.hasFVar || rhs.hasMVar then + return false + else + return (← getTransparency) matches TransparencyMode.default | TransparencyMode.all end Lean.Meta diff --git a/stage0/stdlib/Lean/Elab/Tactic/BuiltinTactic.c b/stage0/stdlib/Lean/Elab/Tactic/BuiltinTactic.c index 8fd87f6c15..7944661e55 100644 --- a/stage0/stdlib/Lean/Elab/Tactic/BuiltinTactic.c +++ b/stage0/stdlib/Lean/Elab/Tactic/BuiltinTactic.c @@ -281,7 +281,7 @@ LEAN_EXPORT lean_object* l_Lean_Elab_throwUnsupportedSyntax___at_Lean_Elab_Tacti LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Tactic_evalTacticSeqBracketed_declRange(lean_object*); static lean_object* l_Lean_Elab_OpenDecl_elabOpenDecl___at_Lean_Elab_Tactic_evalOpen___spec__3___closed__7; static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalRenameInaccessibles_declRange___closed__6; -lean_object* l_Lean_Meta_refl(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Meta_refl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_maxRecDepth; LEAN_EXPORT lean_object* l___regBuiltin_Lean_Elab_Tactic_evalClear(lean_object*); static lean_object* l___regBuiltin_Lean_Elab_Tactic_evalOpen_declRange___closed__5; @@ -12643,78 +12643,77 @@ lean_inc(x_1); x_10 = l_Lean_Elab_Tactic_getMainGoal(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); if (lean_obj_tag(x_10) == 0) { -lean_object* x_11; lean_object* x_12; uint8_t x_13; lean_object* x_14; +lean_object* x_11; lean_object* x_12; lean_object* x_13; x_11 = lean_ctor_get(x_10, 0); lean_inc(x_11); x_12 = lean_ctor_get(x_10, 1); lean_inc(x_12); lean_dec(x_10); -x_13 = 1; lean_inc(x_8); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); -x_14 = l_Lean_Meta_refl(x_11, x_13, x_5, x_6, x_7, x_8, x_12); -if (lean_obj_tag(x_14) == 0) +x_13 = l_Lean_Meta_refl(x_11, x_5, x_6, x_7, x_8, x_12); +if (lean_obj_tag(x_13) == 0) { -lean_object* x_15; lean_object* x_16; lean_object* x_17; -x_15 = lean_ctor_get(x_14, 1); -lean_inc(x_15); -lean_dec(x_14); -x_16 = lean_box(0); -x_17 = l_Lean_Elab_Tactic_replaceMainGoal(x_16, x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_15); -if (lean_obj_tag(x_17) == 0) +lean_object* x_14; lean_object* x_15; lean_object* x_16; +x_14 = lean_ctor_get(x_13, 1); +lean_inc(x_14); +lean_dec(x_13); +x_15 = lean_box(0); +x_16 = l_Lean_Elab_Tactic_replaceMainGoal(x_15, x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_14); +if (lean_obj_tag(x_16) == 0) { -uint8_t x_18; -x_18 = !lean_is_exclusive(x_17); -if (x_18 == 0) +uint8_t x_17; +x_17 = !lean_is_exclusive(x_16); +if (x_17 == 0) { -lean_object* x_19; lean_object* x_20; -x_19 = lean_ctor_get(x_17, 0); -lean_dec(x_19); -x_20 = lean_box(0); -lean_ctor_set(x_17, 0, x_20); -return x_17; +lean_object* x_18; lean_object* x_19; +x_18 = lean_ctor_get(x_16, 0); +lean_dec(x_18); +x_19 = lean_box(0); +lean_ctor_set(x_16, 0, x_19); +return x_16; } else { -lean_object* x_21; lean_object* x_22; lean_object* x_23; -x_21 = lean_ctor_get(x_17, 1); -lean_inc(x_21); -lean_dec(x_17); -x_22 = lean_box(0); -x_23 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_23, 0, x_22); -lean_ctor_set(x_23, 1, x_21); -return x_23; +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_16, 1); +lean_inc(x_20); +lean_dec(x_16); +x_21 = lean_box(0); +x_22 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_22, 0, x_21); +lean_ctor_set(x_22, 1, x_20); +return x_22; } } else { -uint8_t x_24; -x_24 = !lean_is_exclusive(x_17); -if (x_24 == 0) +uint8_t x_23; +x_23 = !lean_is_exclusive(x_16); +if (x_23 == 0) { -return x_17; +return x_16; } else { -lean_object* x_25; lean_object* x_26; lean_object* x_27; -x_25 = lean_ctor_get(x_17, 0); -x_26 = lean_ctor_get(x_17, 1); -lean_inc(x_26); +lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_24 = lean_ctor_get(x_16, 0); +x_25 = lean_ctor_get(x_16, 1); lean_inc(x_25); -lean_dec(x_17); -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_inc(x_24); +lean_dec(x_16); +x_26 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_26, 0, x_24); +lean_ctor_set(x_26, 1, x_25); +return x_26; } } } else { -uint8_t x_28; +uint8_t x_27; lean_dec(x_8); lean_dec(x_7); lean_dec(x_6); @@ -12723,29 +12722,29 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_28 = !lean_is_exclusive(x_14); -if (x_28 == 0) +x_27 = !lean_is_exclusive(x_13); +if (x_27 == 0) { -return x_14; +return x_13; } else { -lean_object* x_29; lean_object* x_30; lean_object* x_31; -x_29 = lean_ctor_get(x_14, 0); -x_30 = lean_ctor_get(x_14, 1); -lean_inc(x_30); +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_13, 0); +x_29 = lean_ctor_get(x_13, 1); lean_inc(x_29); -lean_dec(x_14); -x_31 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_31, 0, x_29); -lean_ctor_set(x_31, 1, x_30); -return x_31; +lean_inc(x_28); +lean_dec(x_13); +x_30 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_30, 0, x_28); +lean_ctor_set(x_30, 1, x_29); +return x_30; } } } else { -uint8_t x_32; +uint8_t x_31; lean_dec(x_8); lean_dec(x_7); lean_dec(x_6); @@ -12754,23 +12753,23 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_32 = !lean_is_exclusive(x_10); -if (x_32 == 0) +x_31 = !lean_is_exclusive(x_10); +if (x_31 == 0) { return x_10; } else { -lean_object* x_33; lean_object* x_34; lean_object* x_35; -x_33 = lean_ctor_get(x_10, 0); -x_34 = lean_ctor_get(x_10, 1); -lean_inc(x_34); +lean_object* x_32; lean_object* x_33; lean_object* x_34; +x_32 = lean_ctor_get(x_10, 0); +x_33 = lean_ctor_get(x_10, 1); lean_inc(x_33); +lean_inc(x_32); lean_dec(x_10); -x_35 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_35, 0, x_33); -lean_ctor_set(x_35, 1, x_34); -return x_35; +x_34 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_34, 0, x_32); +lean_ctor_set(x_34, 1, x_33); +return x_34; } } } diff --git a/stage0/stdlib/Lean/Meta/Tactic/Refl.c b/stage0/stdlib/Lean/Meta/Tactic/Refl.c index 8ef8f937a0..c04becb46d 100644 --- a/stage0/stdlib/Lean/Meta/Tactic/Refl.c +++ b/stage0/stdlib/Lean/Meta/Tactic/Refl.c @@ -14,31 +14,38 @@ extern "C" { #endif lean_object* l_Lean_stringToMessageData(lean_object*); +lean_object* lean_mk_empty_array_with_capacity(lean_object*); LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Meta_refl_useReduceAll(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Meta_refl_useReduceAll___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Meta_refl___lambda__3___closed__7; +lean_object* lean_st_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Expr_appFn_x21(lean_object*); -lean_object* l_Lean_Meta_reduce(lean_object*, uint8_t, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___closed__2; static lean_object* l_Lean_Meta_refl___lambda__4___closed__2; -LEAN_EXPORT lean_object* l_Lean_Meta_refl___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___closed__1; lean_object* l_Lean_Expr_appArg_x21(lean_object*); -LEAN_EXPORT lean_object* l_Lean_Meta_refl(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Meta_refl___lambda__3___closed__3; +static lean_object* l_Lean_Meta_refl___lambda__3___closed__5; +LEAN_EXPORT lean_object* l_Lean_Meta_refl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___lambda__2___closed__5; +LEAN_EXPORT lean_object* l_Lean_Meta_refl_useKernel(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Meta_refl_useKernel___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Expr_constLevels_x21(lean_object*); LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Std_PersistentHashMap_mkEmptyEntriesArray(lean_object*, lean_object*); lean_object* l_Lean_Meta_getMVarType_x27(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Expr_isAppOfArity(lean_object*, lean_object*, lean_object*); -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Meta_refl___lambda__3___closed__1; +uint8_t lean_kernel_is_def_eq(lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Meta_refl___lambda__3___closed__2; lean_object* l_Lean_Meta_withMVarContext___at___private_Lean_Meta_SynthInstance_0__Lean_Meta_synthPendingImp___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_throwTacticEx___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +static lean_object* l_Lean_Meta_refl___lambda__3___closed__4; lean_object* l_Lean_Meta_assignExprMVar(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_checkNotAssigned(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -uint8_t lean_expr_eqv(lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___lambda__1___closed__2; -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__4(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Expr_hasMVar(lean_object*); static lean_object* l_Lean_Meta_refl___lambda__1___closed__1; @@ -48,10 +55,10 @@ static lean_object* l_Lean_Meta_refl___lambda__2___closed__3; static lean_object* l_Lean_Meta_refl___lambda__2___closed__2; lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___lambda__4___closed__1; -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_getTransparency(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___lambda__2___closed__4; +static lean_object* l_Lean_Meta_refl___lambda__3___closed__6; static lean_object* l_Lean_Meta_refl___lambda__2___closed__1; LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___lambda__1___closed__3; @@ -61,162 +68,177 @@ static lean_object* l_Lean_Meta_refl___lambda__4___closed__3; lean_object* l_Lean_mkAppB(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_indentExpr(lean_object*); uint8_t l_Lean_Expr_hasFVar(lean_object*); -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__3(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkConst(lean_object*, lean_object*); static lean_object* l_Lean_Meta_refl___lambda__2___closed__6; -LEAN_EXPORT lean_object* l_Lean_Meta_refl_useReduceAll(uint8_t x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { +LEAN_EXPORT lean_object* l_Lean_Meta_refl_useKernel(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { -if (x_1 == 0) +uint8_t x_8; +x_8 = l_Lean_Expr_hasFVar(x_1); +if (x_8 == 0) { -uint8_t x_9; lean_object* x_10; lean_object* x_11; -x_9 = 0; -x_10 = lean_box(x_9); -x_11 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_11, 0, x_10); -lean_ctor_set(x_11, 1, x_8); -return x_11; -} -else +uint8_t x_9; +x_9 = l_Lean_Expr_hasMVar(x_1); +if (x_9 == 0) { -uint8_t x_12; -x_12 = l_Lean_Expr_hasFVar(x_2); -if (x_12 == 0) +uint8_t x_10; +x_10 = l_Lean_Expr_hasFVar(x_2); +if (x_10 == 0) { -uint8_t x_13; -x_13 = l_Lean_Expr_hasMVar(x_2); -if (x_13 == 0) +uint8_t x_11; +x_11 = l_Lean_Expr_hasMVar(x_2); +if (x_11 == 0) { -lean_object* x_14; lean_object* x_15; -x_14 = l_Lean_Meta_getTransparency(x_4, x_5, x_6, x_7, x_8); -x_15 = lean_ctor_get(x_14, 0); -lean_inc(x_15); -switch (lean_obj_tag(x_15)) { +lean_object* x_12; lean_object* x_13; +x_12 = l_Lean_Meta_getTransparency(x_3, x_4, x_5, x_6, x_7); +x_13 = lean_ctor_get(x_12, 0); +lean_inc(x_13); +switch (lean_obj_tag(x_13)) { case 2: { -uint8_t x_16; -x_16 = !lean_is_exclusive(x_14); -if (x_16 == 0) +uint8_t x_14; +x_14 = !lean_is_exclusive(x_12); +if (x_14 == 0) { -lean_object* x_17; uint8_t x_18; lean_object* x_19; -x_17 = lean_ctor_get(x_14, 0); -lean_dec(x_17); -x_18 = 0; -x_19 = lean_box(x_18); -lean_ctor_set(x_14, 0, x_19); -return x_14; +lean_object* x_15; uint8_t x_16; lean_object* x_17; +x_15 = lean_ctor_get(x_12, 0); +lean_dec(x_15); +x_16 = 0; +x_17 = lean_box(x_16); +lean_ctor_set(x_12, 0, x_17); +return x_12; } else { -lean_object* x_20; uint8_t x_21; lean_object* x_22; lean_object* x_23; -x_20 = lean_ctor_get(x_14, 1); -lean_inc(x_20); -lean_dec(x_14); -x_21 = 0; -x_22 = lean_box(x_21); -x_23 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_23, 0, x_22); -lean_ctor_set(x_23, 1, x_20); -return x_23; +lean_object* x_18; uint8_t x_19; lean_object* x_20; lean_object* x_21; +x_18 = lean_ctor_get(x_12, 1); +lean_inc(x_18); +lean_dec(x_12); +x_19 = 0; +x_20 = lean_box(x_19); +x_21 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_21, 0, x_20); +lean_ctor_set(x_21, 1, x_18); +return x_21; } } case 3: { -uint8_t x_24; -x_24 = !lean_is_exclusive(x_14); -if (x_24 == 0) +uint8_t x_22; +x_22 = !lean_is_exclusive(x_12); +if (x_22 == 0) { -lean_object* x_25; uint8_t x_26; lean_object* x_27; -x_25 = lean_ctor_get(x_14, 0); -lean_dec(x_25); -x_26 = 0; -x_27 = lean_box(x_26); -lean_ctor_set(x_14, 0, x_27); -return x_14; +lean_object* x_23; uint8_t x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_12, 0); +lean_dec(x_23); +x_24 = 0; +x_25 = lean_box(x_24); +lean_ctor_set(x_12, 0, x_25); +return x_12; } else { -lean_object* x_28; uint8_t x_29; lean_object* x_30; lean_object* x_31; -x_28 = lean_ctor_get(x_14, 1); -lean_inc(x_28); -lean_dec(x_14); -x_29 = 0; -x_30 = lean_box(x_29); -x_31 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_31, 0, x_30); -lean_ctor_set(x_31, 1, x_28); -return x_31; +lean_object* x_26; uint8_t x_27; lean_object* x_28; lean_object* x_29; +x_26 = lean_ctor_get(x_12, 1); +lean_inc(x_26); +lean_dec(x_12); +x_27 = 0; +x_28 = lean_box(x_27); +x_29 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_29, 0, x_28); +lean_ctor_set(x_29, 1, x_26); +return x_29; } } default: { -uint8_t x_32; -lean_dec(x_15); -x_32 = !lean_is_exclusive(x_14); -if (x_32 == 0) +uint8_t x_30; +lean_dec(x_13); +x_30 = !lean_is_exclusive(x_12); +if (x_30 == 0) { -lean_object* x_33; uint8_t x_34; lean_object* x_35; -x_33 = lean_ctor_get(x_14, 0); -lean_dec(x_33); -x_34 = 1; -x_35 = lean_box(x_34); -lean_ctor_set(x_14, 0, x_35); -return x_14; +lean_object* x_31; uint8_t x_32; lean_object* x_33; +x_31 = lean_ctor_get(x_12, 0); +lean_dec(x_31); +x_32 = 1; +x_33 = lean_box(x_32); +lean_ctor_set(x_12, 0, x_33); +return x_12; } else { -lean_object* x_36; uint8_t x_37; lean_object* x_38; lean_object* x_39; -x_36 = lean_ctor_get(x_14, 1); -lean_inc(x_36); -lean_dec(x_14); -x_37 = 1; -x_38 = lean_box(x_37); -x_39 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_39, 0, x_38); -lean_ctor_set(x_39, 1, x_36); -return x_39; +lean_object* x_34; uint8_t x_35; lean_object* x_36; lean_object* x_37; +x_34 = lean_ctor_get(x_12, 1); +lean_inc(x_34); +lean_dec(x_12); +x_35 = 1; +x_36 = lean_box(x_35); +x_37 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_37, 0, x_36); +lean_ctor_set(x_37, 1, x_34); +return x_37; } } } } else { -uint8_t x_40; lean_object* x_41; lean_object* x_42; -x_40 = 0; -x_41 = lean_box(x_40); -x_42 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_42, 0, x_41); -lean_ctor_set(x_42, 1, x_8); -return x_42; +uint8_t x_38; lean_object* x_39; lean_object* x_40; +x_38 = 0; +x_39 = lean_box(x_38); +x_40 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_40, 0, x_39); +lean_ctor_set(x_40, 1, x_7); +return x_40; } } else { -uint8_t x_43; lean_object* x_44; lean_object* x_45; -x_43 = 0; -x_44 = lean_box(x_43); -x_45 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_45, 0, x_44); -lean_ctor_set(x_45, 1, x_8); -return x_45; +uint8_t x_41; lean_object* x_42; lean_object* x_43; +x_41 = 0; +x_42 = lean_box(x_41); +x_43 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_43, 0, x_42); +lean_ctor_set(x_43, 1, x_7); +return x_43; +} +} +else +{ +uint8_t x_44; lean_object* x_45; lean_object* x_46; +x_44 = 0; +x_45 = lean_box(x_44); +x_46 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_46, 0, x_45); +lean_ctor_set(x_46, 1, x_7); +return x_46; +} +} +else +{ +uint8_t x_47; lean_object* x_48; lean_object* x_49; +x_47 = 0; +x_48 = lean_box(x_47); +x_49 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_49, 0, x_48); +lean_ctor_set(x_49, 1, x_7); +return x_49; } } } -} -LEAN_EXPORT lean_object* l_Lean_Meta_refl_useReduceAll___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { +LEAN_EXPORT lean_object* l_Lean_Meta_refl_useKernel___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { -uint8_t x_9; lean_object* x_10; -x_9 = lean_unbox(x_1); -lean_dec(x_1); -x_10 = l_Lean_Meta_refl_useReduceAll(x_9, x_2, x_3, x_4, x_5, x_6, x_7, x_8); -lean_dec(x_7); +lean_object* x_8; +x_8 = l_Lean_Meta_refl_useKernel(x_1, x_2, x_3, x_4, x_5, x_6, x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -return x_10; +lean_dec(x_1); +return x_8; } } static lean_object* _init_l_Lean_Meta_refl___lambda__1___closed__1() { @@ -402,253 +424,191 @@ return x_29; } } } -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__3(lean_object* x_1, uint8_t x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { +static lean_object* _init_l_Lean_Meta_refl___lambda__3___closed__1() { _start: { -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; lean_object* x_20; uint8_t x_21; -lean_dec(x_4); -x_10 = l_Lean_Expr_appFn_x21(x_1); -x_11 = l_Lean_Expr_appArg_x21(x_10); -lean_inc(x_6); -x_12 = l_Lean_Meta_instantiateMVars(x_11, x_5, x_6, x_7, x_8, x_9); -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_15 = l_Lean_Expr_appArg_x21(x_1); -lean_inc(x_6); -x_16 = l_Lean_Meta_instantiateMVars(x_15, x_5, x_6, x_7, x_8, x_14); -x_17 = lean_ctor_get(x_16, 0); -lean_inc(x_17); -x_18 = lean_ctor_get(x_16, 1); -lean_inc(x_18); -lean_dec(x_16); -x_19 = l_Lean_Meta_refl_useReduceAll(x_2, x_13, x_17, x_5, x_6, x_7, x_8, x_18); -x_20 = lean_ctor_get(x_19, 0); -lean_inc(x_20); -x_21 = lean_unbox(x_20); -lean_dec(x_20); -if (x_21 == 0) +lean_object* x_1; +x_1 = l_Std_PersistentHashMap_mkEmptyEntriesArray(lean_box(0), lean_box(0)); +return x_1; +} +} +static lean_object* _init_l_Lean_Meta_refl___lambda__3___closed__2() { +_start: { -lean_object* x_22; lean_object* x_23; -x_22 = lean_ctor_get(x_19, 1); -lean_inc(x_22); +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Meta_refl___lambda__3___closed__1; +x_2 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} +static lean_object* _init_l_Lean_Meta_refl___lambda__3___closed__3() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Meta_refl___lambda__3___closed__2; +x_2 = lean_unsigned_to_nat(0u); +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; +} +} +static lean_object* _init_l_Lean_Meta_refl___lambda__3___closed__4() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = lean_unsigned_to_nat(32u); +x_2 = lean_mk_empty_array_with_capacity(x_1); +return x_2; +} +} +static lean_object* _init_l_Lean_Meta_refl___lambda__3___closed__5() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = l_Lean_Meta_refl___lambda__3___closed__4; +x_2 = lean_alloc_ctor(0, 1, 0); +lean_ctor_set(x_2, 0, x_1); +return x_2; +} +} +static lean_object* _init_l_Lean_Meta_refl___lambda__3___closed__6() { +_start: +{ +size_t x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_1 = 5; +x_2 = l_Lean_Meta_refl___lambda__3___closed__5; +x_3 = l_Lean_Meta_refl___lambda__3___closed__4; +x_4 = lean_unsigned_to_nat(0u); +x_5 = lean_alloc_ctor(0, 4, sizeof(size_t)*1); +lean_ctor_set(x_5, 0, x_2); +lean_ctor_set(x_5, 1, x_3); +lean_ctor_set(x_5, 2, x_4); +lean_ctor_set(x_5, 3, x_4); +lean_ctor_set_usize(x_5, 4, x_1); +return x_5; +} +} +static lean_object* _init_l_Lean_Meta_refl___lambda__3___closed__7() { +_start: +{ +lean_object* x_1; lean_object* x_2; lean_object* x_3; +x_1 = l_Lean_Meta_refl___lambda__3___closed__3; +x_2 = l_Lean_Meta_refl___lambda__3___closed__6; +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_EXPORT lean_object* l_Lean_Meta_refl___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { +_start: +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; +lean_dec(x_3); +x_9 = l_Lean_Expr_appFn_x21(x_1); +x_10 = l_Lean_Expr_appArg_x21(x_9); +lean_inc(x_5); +x_11 = l_Lean_Meta_instantiateMVars(x_10, x_4, x_5, x_6, x_7, x_8); +x_12 = lean_ctor_get(x_11, 0); +lean_inc(x_12); +x_13 = lean_ctor_get(x_11, 1); +lean_inc(x_13); +lean_dec(x_11); +x_14 = l_Lean_Expr_appArg_x21(x_1); +lean_inc(x_5); +x_15 = l_Lean_Meta_instantiateMVars(x_14, x_4, x_5, x_6, x_7, x_13); +x_16 = lean_ctor_get(x_15, 0); +lean_inc(x_16); +x_17 = lean_ctor_get(x_15, 1); +lean_inc(x_17); +lean_dec(x_15); +x_18 = l_Lean_Meta_refl_useKernel(x_12, x_16, x_4, x_5, x_6, x_7, x_17); +x_19 = lean_ctor_get(x_18, 0); +lean_inc(x_19); +x_20 = lean_unbox(x_19); lean_dec(x_19); -lean_inc(x_8); +if (x_20 == 0) +{ +lean_object* x_21; lean_object* x_22; +x_21 = lean_ctor_get(x_18, 1); +lean_inc(x_21); +lean_dec(x_18); lean_inc(x_7); lean_inc(x_6); lean_inc(x_5); -lean_inc(x_17); -lean_inc(x_13); -x_23 = l_Lean_Meta_isExprDefEq(x_13, x_17, x_5, x_6, x_7, x_8, x_22); -if (lean_obj_tag(x_23) == 0) +lean_inc(x_4); +lean_inc(x_16); +lean_inc(x_12); +x_22 = l_Lean_Meta_isExprDefEq(x_12, x_16, x_4, x_5, x_6, x_7, x_21); +if (lean_obj_tag(x_22) == 0) { -lean_object* x_24; lean_object* x_25; uint8_t x_26; lean_object* x_27; -x_24 = lean_ctor_get(x_23, 0); +lean_object* x_23; lean_object* x_24; uint8_t x_25; lean_object* x_26; +x_23 = lean_ctor_get(x_22, 0); +lean_inc(x_23); +x_24 = lean_ctor_get(x_22, 1); lean_inc(x_24); -x_25 = lean_ctor_get(x_23, 1); -lean_inc(x_25); +lean_dec(x_22); +x_25 = lean_unbox(x_23); lean_dec(x_23); -x_26 = lean_unbox(x_24); -lean_dec(x_24); -x_27 = l_Lean_Meta_refl___lambda__2(x_1, x_10, x_13, x_3, x_17, x_26, x_5, x_6, x_7, x_8, x_25); -lean_dec(x_10); -return x_27; +x_26 = l_Lean_Meta_refl___lambda__2(x_1, x_9, x_12, x_2, x_16, x_25, x_4, x_5, x_6, x_7, x_24); +lean_dec(x_9); +return x_26; } else { -uint8_t x_28; -lean_dec(x_17); -lean_dec(x_13); -lean_dec(x_10); -lean_dec(x_8); +uint8_t x_27; +lean_dec(x_16); +lean_dec(x_12); +lean_dec(x_9); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); -lean_dec(x_3); -x_28 = !lean_is_exclusive(x_23); -if (x_28 == 0) +lean_dec(x_4); +lean_dec(x_2); +x_27 = !lean_is_exclusive(x_22); +if (x_27 == 0) { -return x_23; +return x_22; } else { -lean_object* x_29; lean_object* x_30; lean_object* x_31; -x_29 = lean_ctor_get(x_23, 0); -x_30 = lean_ctor_get(x_23, 1); -lean_inc(x_30); +lean_object* x_28; lean_object* x_29; lean_object* x_30; +x_28 = lean_ctor_get(x_22, 0); +x_29 = lean_ctor_get(x_22, 1); lean_inc(x_29); -lean_dec(x_23); -x_31 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_31, 0, x_29); -lean_ctor_set(x_31, 1, x_30); -return x_31; +lean_inc(x_28); +lean_dec(x_22); +x_30 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_30, 0, x_28); +lean_ctor_set(x_30, 1, x_29); +return x_30; } } } else { -lean_object* x_32; uint8_t x_33; lean_object* x_34; -x_32 = lean_ctor_get(x_19, 1); -lean_inc(x_32); -lean_dec(x_19); -x_33 = 0; -lean_inc(x_8); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_13); -x_34 = l_Lean_Meta_reduce(x_13, x_33, x_33, x_33, x_5, x_6, x_7, x_8, x_32); -if (lean_obj_tag(x_34) == 0) -{ -lean_object* x_35; lean_object* x_36; lean_object* x_37; -x_35 = lean_ctor_get(x_34, 0); +lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; uint8_t x_37; lean_object* x_38; +x_31 = lean_ctor_get(x_18, 1); +lean_inc(x_31); +lean_dec(x_18); +x_32 = lean_st_ref_get(x_7, x_31); +x_33 = lean_ctor_get(x_32, 0); +lean_inc(x_33); +x_34 = lean_ctor_get(x_32, 1); +lean_inc(x_34); +lean_dec(x_32); +x_35 = lean_ctor_get(x_33, 0); lean_inc(x_35); -x_36 = lean_ctor_get(x_34, 1); -lean_inc(x_36); -lean_dec(x_34); -lean_inc(x_8); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_17); -x_37 = l_Lean_Meta_reduce(x_17, x_33, x_33, x_33, x_5, x_6, x_7, x_8, x_36); -if (lean_obj_tag(x_37) == 0) -{ -lean_object* x_38; lean_object* x_39; uint8_t x_40; -x_38 = lean_ctor_get(x_37, 0); -lean_inc(x_38); -x_39 = lean_ctor_get(x_37, 1); -lean_inc(x_39); -lean_dec(x_37); -x_40 = lean_expr_eqv(x_35, x_38); -if (x_40 == 0) -{ -lean_object* x_41; -lean_inc(x_8); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -x_41 = l_Lean_Meta_isExprDefEq(x_35, x_38, x_5, x_6, x_7, x_8, x_39); -if (lean_obj_tag(x_41) == 0) -{ -lean_object* x_42; lean_object* x_43; uint8_t x_44; lean_object* x_45; -x_42 = lean_ctor_get(x_41, 0); -lean_inc(x_42); -x_43 = lean_ctor_get(x_41, 1); -lean_inc(x_43); -lean_dec(x_41); -x_44 = lean_unbox(x_42); -lean_dec(x_42); -x_45 = l_Lean_Meta_refl___lambda__2(x_1, x_10, x_13, x_3, x_17, x_44, x_5, x_6, x_7, x_8, x_43); -lean_dec(x_10); -return x_45; -} -else -{ -uint8_t x_46; -lean_dec(x_17); -lean_dec(x_13); -lean_dec(x_10); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_3); -x_46 = !lean_is_exclusive(x_41); -if (x_46 == 0) -{ -return x_41; -} -else -{ -lean_object* x_47; lean_object* x_48; lean_object* x_49; -x_47 = lean_ctor_get(x_41, 0); -x_48 = lean_ctor_get(x_41, 1); -lean_inc(x_48); -lean_inc(x_47); -lean_dec(x_41); -x_49 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_49, 0, x_47); -lean_ctor_set(x_49, 1, x_48); -return x_49; -} -} -} -else -{ -uint8_t x_50; lean_object* x_51; -lean_dec(x_38); -lean_dec(x_35); -x_50 = 1; -x_51 = l_Lean_Meta_refl___lambda__2(x_1, x_10, x_13, x_3, x_17, x_50, x_5, x_6, x_7, x_8, x_39); -lean_dec(x_10); -return x_51; -} -} -else -{ -uint8_t x_52; -lean_dec(x_35); -lean_dec(x_17); -lean_dec(x_13); -lean_dec(x_10); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_3); -x_52 = !lean_is_exclusive(x_37); -if (x_52 == 0) -{ -return x_37; -} -else -{ -lean_object* x_53; lean_object* x_54; lean_object* x_55; -x_53 = lean_ctor_get(x_37, 0); -x_54 = lean_ctor_get(x_37, 1); -lean_inc(x_54); -lean_inc(x_53); -lean_dec(x_37); -x_55 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_55, 0, x_53); -lean_ctor_set(x_55, 1, x_54); -return x_55; -} -} -} -else -{ -uint8_t x_56; -lean_dec(x_17); -lean_dec(x_13); -lean_dec(x_10); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_3); -x_56 = !lean_is_exclusive(x_34); -if (x_56 == 0) -{ -return x_34; -} -else -{ -lean_object* x_57; lean_object* x_58; lean_object* x_59; -x_57 = lean_ctor_get(x_34, 0); -x_58 = lean_ctor_get(x_34, 1); -lean_inc(x_58); -lean_inc(x_57); -lean_dec(x_34); -x_59 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_59, 0, x_57); -lean_ctor_set(x_59, 1, x_58); -return x_59; -} -} +lean_dec(x_33); +x_36 = l_Lean_Meta_refl___lambda__3___closed__7; +lean_inc(x_16); +lean_inc(x_12); +x_37 = lean_kernel_is_def_eq(x_35, x_36, x_12, x_16); +x_38 = l_Lean_Meta_refl___lambda__2(x_1, x_9, x_12, x_2, x_16, x_37, x_4, x_5, x_6, x_7, x_34); +lean_dec(x_9); +return x_38; } } } @@ -680,128 +640,128 @@ lean_ctor_set(x_2, 0, x_1); return x_2; } } -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__4(lean_object* x_1, lean_object* x_2, uint8_t x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { +LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__4(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { -lean_object* x_9; -lean_inc(x_5); +lean_object* x_8; +lean_inc(x_4); lean_inc(x_1); -x_9 = l_Lean_Meta_checkNotAssigned(x_1, x_2, x_4, x_5, x_6, x_7, x_8); -if (lean_obj_tag(x_9) == 0) +x_8 = l_Lean_Meta_checkNotAssigned(x_1, x_2, x_3, x_4, x_5, x_6, x_7); +if (lean_obj_tag(x_8) == 0) { -lean_object* x_10; lean_object* x_11; -x_10 = lean_ctor_get(x_9, 1); -lean_inc(x_10); -lean_dec(x_9); -lean_inc(x_7); +lean_object* x_9; lean_object* x_10; +x_9 = lean_ctor_get(x_8, 1); +lean_inc(x_9); +lean_dec(x_8); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); +lean_inc(x_3); lean_inc(x_1); -x_11 = l_Lean_Meta_getMVarType_x27(x_1, x_4, x_5, x_6, x_7, x_10); -if (lean_obj_tag(x_11) == 0) +x_10 = l_Lean_Meta_getMVarType_x27(x_1, x_3, x_4, x_5, x_6, x_9); +if (lean_obj_tag(x_10) == 0) { -lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16; -x_12 = lean_ctor_get(x_11, 0); +lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15; +x_11 = lean_ctor_get(x_10, 0); +lean_inc(x_11); +x_12 = lean_ctor_get(x_10, 1); lean_inc(x_12); -x_13 = lean_ctor_get(x_11, 1); -lean_inc(x_13); +lean_dec(x_10); +x_13 = l_Lean_Meta_refl___lambda__1___closed__2; +x_14 = lean_unsigned_to_nat(3u); +x_15 = l_Lean_Expr_isAppOfArity(x_11, x_13, x_14); +if (x_15 == 0) +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; uint8_t x_20; lean_dec(x_11); -x_14 = l_Lean_Meta_refl___lambda__1___closed__2; -x_15 = lean_unsigned_to_nat(3u); -x_16 = l_Lean_Expr_isAppOfArity(x_12, x_14, x_15); -if (x_16 == 0) -{ -lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; uint8_t x_21; -lean_dec(x_12); -x_17 = l_Lean_Meta_refl___lambda__2___closed__2; -x_18 = l_Lean_Meta_refl___lambda__4___closed__3; -x_19 = lean_box(0); -x_20 = l_Lean_Meta_throwTacticEx___rarg(x_17, x_1, x_18, x_19, x_4, x_5, x_6, x_7, x_13); -lean_dec(x_7); +x_16 = l_Lean_Meta_refl___lambda__2___closed__2; +x_17 = l_Lean_Meta_refl___lambda__4___closed__3; +x_18 = lean_box(0); +x_19 = l_Lean_Meta_throwTacticEx___rarg(x_16, x_1, x_17, x_18, x_3, x_4, x_5, x_6, x_12); lean_dec(x_6); -lean_dec(x_4); -x_21 = !lean_is_exclusive(x_20); -if (x_21 == 0) +lean_dec(x_5); +lean_dec(x_3); +x_20 = !lean_is_exclusive(x_19); +if (x_20 == 0) { -return x_20; +return x_19; } else { -lean_object* x_22; lean_object* x_23; lean_object* x_24; -x_22 = lean_ctor_get(x_20, 0); -x_23 = lean_ctor_get(x_20, 1); -lean_inc(x_23); +lean_object* x_21; lean_object* x_22; lean_object* x_23; +x_21 = lean_ctor_get(x_19, 0); +x_22 = lean_ctor_get(x_19, 1); lean_inc(x_22); -lean_dec(x_20); -x_24 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_24, 0, x_22); -lean_ctor_set(x_24, 1, x_23); -return x_24; +lean_inc(x_21); +lean_dec(x_19); +x_23 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_23, 0, x_21); +lean_ctor_set(x_23, 1, x_22); +return x_23; } } else { -lean_object* x_25; lean_object* x_26; -x_25 = lean_box(0); -x_26 = l_Lean_Meta_refl___lambda__3(x_12, x_3, x_1, x_25, x_4, x_5, x_6, x_7, x_13); -lean_dec(x_12); -return x_26; -} -} -else -{ -uint8_t x_27; -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_1); -x_27 = !lean_is_exclusive(x_11); -if (x_27 == 0) -{ -return x_11; -} -else -{ -lean_object* x_28; lean_object* x_29; lean_object* x_30; -x_28 = lean_ctor_get(x_11, 0); -x_29 = lean_ctor_get(x_11, 1); -lean_inc(x_29); -lean_inc(x_28); +lean_object* x_24; lean_object* x_25; +x_24 = lean_box(0); +x_25 = l_Lean_Meta_refl___lambda__3(x_11, x_1, x_24, x_3, x_4, x_5, x_6, x_12); lean_dec(x_11); -x_30 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_30, 0, x_28); -lean_ctor_set(x_30, 1, x_29); -return x_30; -} +return x_25; } } else { -uint8_t x_31; -lean_dec(x_7); +uint8_t x_26; lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); +lean_dec(x_3); lean_dec(x_1); -x_31 = !lean_is_exclusive(x_9); -if (x_31 == 0) +x_26 = !lean_is_exclusive(x_10); +if (x_26 == 0) { -return x_9; +return x_10; } else { -lean_object* x_32; lean_object* x_33; lean_object* x_34; -x_32 = lean_ctor_get(x_9, 0); -x_33 = lean_ctor_get(x_9, 1); -lean_inc(x_33); +lean_object* x_27; lean_object* x_28; lean_object* x_29; +x_27 = lean_ctor_get(x_10, 0); +x_28 = lean_ctor_get(x_10, 1); +lean_inc(x_28); +lean_inc(x_27); +lean_dec(x_10); +x_29 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_29, 0, x_27); +lean_ctor_set(x_29, 1, x_28); +return x_29; +} +} +} +else +{ +uint8_t x_30; +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_1); +x_30 = !lean_is_exclusive(x_8); +if (x_30 == 0) +{ +return x_8; +} +else +{ +lean_object* x_31; lean_object* x_32; lean_object* x_33; +x_31 = lean_ctor_get(x_8, 0); +x_32 = lean_ctor_get(x_8, 1); lean_inc(x_32); -lean_dec(x_9); -x_34 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_34, 0, x_32); -lean_ctor_set(x_34, 1, x_33); -return x_34; +lean_inc(x_31); +lean_dec(x_8); +x_33 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_33, 0, x_31); +lean_ctor_set(x_33, 1, x_32); +return x_33; } } } @@ -824,19 +784,17 @@ x_3 = lean_name_mk_string(x_1, x_2); return x_3; } } -LEAN_EXPORT lean_object* l_Lean_Meta_refl(lean_object* x_1, uint8_t x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { +LEAN_EXPORT lean_object* l_Lean_Meta_refl(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_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; -x_8 = l_Lean_Meta_refl___closed__2; -x_9 = lean_box(x_2); +lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_7 = l_Lean_Meta_refl___closed__2; lean_inc(x_1); -x_10 = lean_alloc_closure((void*)(l_Lean_Meta_refl___lambda__4___boxed), 8, 3); -lean_closure_set(x_10, 0, x_1); -lean_closure_set(x_10, 1, x_8); -lean_closure_set(x_10, 2, x_9); -x_11 = l_Lean_Meta_withMVarContext___at___private_Lean_Meta_SynthInstance_0__Lean_Meta_synthPendingImp___spec__1___rarg(x_1, x_10, x_3, x_4, x_5, x_6, x_7); -return x_11; +x_8 = lean_alloc_closure((void*)(l_Lean_Meta_refl___lambda__4), 7, 2); +lean_closure_set(x_8, 0, x_1); +lean_closure_set(x_8, 1, x_7); +x_9 = l_Lean_Meta_withMVarContext___at___private_Lean_Meta_SynthInstance_0__Lean_Meta_synthPendingImp___spec__1___rarg(x_1, x_8, x_2, x_3, x_4, x_5, x_6); +return x_9; } } LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) { @@ -866,34 +824,12 @@ lean_dec(x_1); return x_13; } } -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { +LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__3___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { _start: { -uint8_t x_10; lean_object* x_11; -x_10 = lean_unbox(x_2); -lean_dec(x_2); -x_11 = l_Lean_Meta_refl___lambda__3(x_1, x_10, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +lean_object* x_9; +x_9 = l_Lean_Meta_refl___lambda__3(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8); lean_dec(x_1); -return x_11; -} -} -LEAN_EXPORT lean_object* l_Lean_Meta_refl___lambda__4___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: -{ -uint8_t x_9; lean_object* x_10; -x_9 = lean_unbox(x_3); -lean_dec(x_3); -x_10 = l_Lean_Meta_refl___lambda__4(x_1, x_2, x_9, x_4, x_5, x_6, x_7, x_8); -return x_10; -} -} -LEAN_EXPORT lean_object* l_Lean_Meta_refl___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { -_start: -{ -uint8_t x_8; lean_object* x_9; -x_8 = lean_unbox(x_2); -lean_dec(x_2); -x_9 = l_Lean_Meta_refl(x_1, x_8, x_3, x_4, x_5, x_6, x_7); return x_9; } } @@ -938,6 +874,20 @@ l_Lean_Meta_refl___lambda__2___closed__7 = _init_l_Lean_Meta_refl___lambda__2___ lean_mark_persistent(l_Lean_Meta_refl___lambda__2___closed__7); l_Lean_Meta_refl___lambda__2___closed__8 = _init_l_Lean_Meta_refl___lambda__2___closed__8(); lean_mark_persistent(l_Lean_Meta_refl___lambda__2___closed__8); +l_Lean_Meta_refl___lambda__3___closed__1 = _init_l_Lean_Meta_refl___lambda__3___closed__1(); +lean_mark_persistent(l_Lean_Meta_refl___lambda__3___closed__1); +l_Lean_Meta_refl___lambda__3___closed__2 = _init_l_Lean_Meta_refl___lambda__3___closed__2(); +lean_mark_persistent(l_Lean_Meta_refl___lambda__3___closed__2); +l_Lean_Meta_refl___lambda__3___closed__3 = _init_l_Lean_Meta_refl___lambda__3___closed__3(); +lean_mark_persistent(l_Lean_Meta_refl___lambda__3___closed__3); +l_Lean_Meta_refl___lambda__3___closed__4 = _init_l_Lean_Meta_refl___lambda__3___closed__4(); +lean_mark_persistent(l_Lean_Meta_refl___lambda__3___closed__4); +l_Lean_Meta_refl___lambda__3___closed__5 = _init_l_Lean_Meta_refl___lambda__3___closed__5(); +lean_mark_persistent(l_Lean_Meta_refl___lambda__3___closed__5); +l_Lean_Meta_refl___lambda__3___closed__6 = _init_l_Lean_Meta_refl___lambda__3___closed__6(); +lean_mark_persistent(l_Lean_Meta_refl___lambda__3___closed__6); +l_Lean_Meta_refl___lambda__3___closed__7 = _init_l_Lean_Meta_refl___lambda__3___closed__7(); +lean_mark_persistent(l_Lean_Meta_refl___lambda__3___closed__7); l_Lean_Meta_refl___lambda__4___closed__1 = _init_l_Lean_Meta_refl___lambda__4___closed__1(); lean_mark_persistent(l_Lean_Meta_refl___lambda__4___closed__1); l_Lean_Meta_refl___lambda__4___closed__2 = _init_l_Lean_Meta_refl___lambda__4___closed__2();