From 5cfa9504ca523b4d820dbbcee320f0c34fbda6dd Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Thu, 25 Feb 2021 17:09:12 -0800 Subject: [PATCH] chore: update stage0 --- stage0/src/Init/Control/Lawful.lean | 82 +- stage0/src/Init/Core.lean | 10 +- stage0/src/Lean/Elab/Binders.lean | 38 +- stage0/src/Lean/Elab/Deriving/Repr.lean | 4 +- stage0/src/Lean/Elab/MutualDef.lean | 40 +- stage0/src/Lean/Elab/PreDefinition/Basic.lean | 11 +- stage0/src/Lean/Meta/SynthInstance.lean | 29 +- stage0/stdlib/Lean/Elab/Binders.c | 40 +- stage0/stdlib/Lean/Elab/Declaration.c | 19 +- stage0/stdlib/Lean/Elab/Deriving/Repr.c | 20 +- stage0/stdlib/Lean/Elab/Match.c | 21 +- stage0/stdlib/Lean/Elab/MutualDef.c | 1956 +++++++++++------ stage0/stdlib/Lean/Elab/PreDefinition/Basic.c | 1147 +++++----- stage0/stdlib/Lean/Meta/SynthInstance.c | 954 ++++---- stage0/stdlib/Std/Data/PersistentHashMap.c | 50 - 15 files changed, 2439 insertions(+), 1982 deletions(-) diff --git a/stage0/src/Init/Control/Lawful.lean b/stage0/src/Init/Control/Lawful.lean index 313c9d785c..f15907605d 100644 --- a/stage0/src/Init/Control/Lawful.lean +++ b/stage0/src/Init/Control/Lawful.lean @@ -10,6 +10,9 @@ import Init.Control.StateRef open Function +@[simp] theorem monadLift_self [Monad m] (x : m α) : monadLift x = x := + rfl + class LawfulFunctor (f : Type u → Type v) [Functor f] : Prop where map_const : (Functor.mapConst : α → f β → f α) = Functor.map ∘ const β id_map (x : f α) : id <$> x = x @@ -27,8 +30,8 @@ class LawfulApplicative (f : Type u → Type v) [Applicative f] extends LawfulFu seqRight_eq (x : f α) (y : f β) : x *> y = const α id <$> x <*> y pure_seq (g : α → β) (x : f α) : pure g <*> x = g <$> x map_pure (g : α → β) (x : α) : g <$> (pure x : f α) = pure (g x) - seq_pure (g : f (α → β)) (x : α) : g <*> pure x = (fun h : α → β => h x) <$> g - seq_assoc (x : f α) (g : f (α → β)) (h : f (β → γ)) : h <*> (g <*> x) = (@comp α β γ <$> h) <*> g <*> x + seq_pure (g : f (α → β)) (x : α) : g <*> pure x = (fun h => h x) <$> g + seq_assoc (x : f α) (g : f (α → β)) (h : f (β → γ)) : h <*> (g <*> x) = ((. ∘ .) <$> h) <*> g <*> x comp_map g h x := by repeat rw [← pure_seq] simp [seq_assoc, map_pure, seq_pure] @@ -65,9 +68,19 @@ attribute [simp] pure_bind bind_assoc theorem map_eq_pure_bind [Monad m] [LawfulMonad m] (f : α → β) (x : m α) : f <$> x = x >>= fun a => pure (f a) := by rw [← bind_pure_comp] +theorem seq_eq_bind_map {α β : Type u} [Monad m] [LawfulMonad m] (f : m (α → β)) (x : m α) : f <*> x = f >>= (. <$> x) := by + rw [← bind_map] + theorem bind_congr [Bind m] {x : m α} {f g : α → m β} (h : ∀ a, f a = g a) : x >>= f = x >>= g := by simp [funext h] +@[simp] theorem bind_pure_unit [Monad m] [LawfulMonad m] {x : m PUnit} : (x >>= fun _ => pure ⟨⟩) = x := by + have (x >>= fun _ => pure ⟨⟩) = (x >>= pure) by + apply bind_congr; intro u + cases u; simp + rw [bind_pure] at this + assumption + theorem map_congr [Functor m] {x : m α} {f g : α → β} (h : ∀ a, f a = g a) : (f <$> x : m β) = g <$> x := by simp [funext h] @@ -75,14 +88,10 @@ theorem seq_eq_bind {α β : Type u} [Monad m] [LawfulMonad m] (mf : m (α → rw [bind_map] theorem seqRight_eq_bind [Monad m] [LawfulMonad m] (x : m α) (y : m β) : x *> y = x >>= fun _ => y := by - rw [seqRight_eq, ← bind_map, ← bind_pure_comp] - simp [Function.const] + rw [seqRight_eq]; simp [map_eq_pure_bind, seq_eq_bind_map] theorem seqLeft_eq_bind [Monad m] [LawfulMonad m] (x : m α) (y : m β) : x <* y = x >>= fun a => y >>= fun _ => pure a := by - rw [seqLeft_eq, ← bind_map, ← bind_pure_comp] - simp - apply bind_congr; intro - rw [← bind_pure_comp] + rw [seqLeft_eq]; simp [map_eq_pure_bind, seq_eq_bind_map] /- Id -/ @@ -106,9 +115,18 @@ theorem ext [Monad m] {x y : ExceptT ε m α} (h : x.run = y.run) : x = y := by assumption @[simp] theorem run_pure [Monad m] : run (pure x : ExceptT ε m α) = pure (Except.ok x) := rfl + @[simp] theorem run_lift [Monad m] : run (ExceptT.lift x : ExceptT ε m α) = Except.ok <$> x := rfl + @[simp] theorem run_throw [Monad m] : run (throw e : ExceptT ε m β) = pure (Except.error e) := rfl -@[simp] theorem run_bind [Monad m] (x : ExceptT ε m α) + +@[simp] theorem run_bind_lift [Monad m] [LawfulMonad m] (x : m α) (f : α → ExceptT ε m β) : run (ExceptT.lift x >>= f : ExceptT ε m β) = x >>= fun a => run (f a) := by + simp[ExceptT.run, ExceptT.lift, bind, ExceptT.bind, ExceptT.mk, ExceptT.bindCont, map_eq_pure_bind] + +@[simp] theorem bind_throw [Monad m] [LawfulMonad m] (f : α → ExceptT ε m β) : (throw e >>= f) = throw e := by + simp [throw, throwThe, MonadExceptOf.throw, bind, ExceptT.bind, ExceptT.bindCont, ExceptT.mk] + +theorem run_bind [Monad m] (x : ExceptT ε m α) : run (x >>= f : ExceptT ε m β) = run x >>= fun @@ -121,8 +139,7 @@ theorem ext [Monad m] {x y : ExceptT ε m α} (h : x.run = y.run) : x = y := by @[simp] theorem run_map [Monad m] [LawfulMonad m] (f : α → β) (x : ExceptT ε m α) : (f <$> x).run = Except.map f <$> x.run := by - rw [← bind_pure_comp (m := m)] - simp [Functor.map, ExceptT.map] + simp [Functor.map, ExceptT.map, map_eq_pure_bind] apply bind_congr intro a; cases a <;> simp [Except.map] @@ -136,20 +153,19 @@ protected theorem seqLeft_eq {α β ε : Type u} {m : Type u → Type v} [Monad show (x >>= fun a => y >>= fun _ => pure a) = (const (α := α) β <$> x) >>= fun f => f <$> y rw [← ExceptT.bind_pure_comp] apply ext - simp + simp [run_bind] apply bind_congr - intro a - cases a with - | error => simp - | ok => - simp; rw [← bind_pure_comp]; apply bind_congr; intro b; + intro + | Except.error _ => simp + | Except.ok _ => + simp [map_eq_pure_bind]; apply bind_congr; intro b; cases b <;> simp [comp, Except.map, const] protected theorem seqRight_eq [Monad m] [LawfulMonad m] (x : ExceptT ε m α) (y : ExceptT ε m β) : x *> y = const α id <$> x <*> y := by show (x >>= fun _ => y) = (const α id <$> x) >>= fun f => f <$> y rw [← ExceptT.bind_pure_comp] apply ext - simp + simp [run_bind] apply bind_congr intro a; cases a <;> simp @@ -158,11 +174,11 @@ instance [Monad m] [LawfulMonad m] : LawfulMonad (ExceptT ε m) where map_const := by intros; rfl seqLeft_eq := ExceptT.seqLeft_eq seqRight_eq := ExceptT.seqRight_eq - pure_seq := by intros; apply ext; simp [ExceptT.seq_eq] + pure_seq := by intros; apply ext; simp [ExceptT.seq_eq, run_bind] bind_pure_comp := ExceptT.bind_pure_comp bind_map := by intros; rfl - pure_bind := by intros; apply ext; simp - bind_assoc := by intros; apply ext; simp; apply bind_congr; intro a; cases a <;> simp + pure_bind := by intros; apply ext; simp [run_bind] + bind_assoc := by intros; apply ext; simp [run_bind]; apply bind_congr; intro a; cases a <;> simp end ExceptT @@ -175,19 +191,27 @@ theorem ext [Monad m] {x y : ReaderT ρ m α} (h : ∀ ctx, x.run ctx = y.run ct exact funext h @[simp] theorem run_pure [Monad m] (a : α) (ctx : ρ) : (pure a : ReaderT ρ m α).run ctx = pure a := rfl + @[simp] theorem run_bind [Monad m] (x : ReaderT ρ m α) (f : α → ReaderT ρ m β) (ctx : ρ) : (x >>= f).run ctx = x.run ctx >>= λ a => (f a).run ctx := rfl + @[simp] theorem run_map [Monad m] (f : α → β) (x : ReaderT ρ m α) (ctx : ρ) : (f <$> x).run ctx = f <$> x.run ctx := rfl + @[simp] theorem run_monadLift [MonadLiftT n m] (x : n α) (ctx : ρ) : (monadLift x : ReaderT ρ m α).run ctx = (monadLift x : m α) := rfl + @[simp] theorem run_monadMap [Monad m] [MonadFunctor n m] (f : {β : Type u} → n β → n β) (x : ReaderT ρ m α) (ctx : ρ) : (monadMap @f x : ReaderT ρ m α).run ctx = monadMap @f (x.run ctx) := rfl + @[simp] theorem run_read [Monad m] (ctx : ρ) : (ReaderT.read : ReaderT ρ m ρ).run ctx = pure ctx := rfl + @[simp] theorem run_seq {α β : Type u} [Monad m] [LawfulMonad m] (f : ReaderT ρ m (α → β)) (x : ReaderT ρ m α) (ctx : ρ) : (f <*> x).run ctx = (f.run ctx <*> x.run ctx) := by rw [seq_eq_bind (m := m)]; rfl + @[simp] theorem run_seqRight [Monad m] [LawfulMonad m] (x : ReaderT ρ m α) (y : ReaderT ρ m β) (ctx : ρ) : (x *> y).run ctx = (x.run ctx *> y.run ctx) := by rw [seqRight_eq_bind (m := m)]; rfl + @[simp] theorem run_seqLeft [Monad m] [LawfulMonad m] (x : ReaderT ρ m α) (y : ReaderT ρ m β) (ctx : ρ) : (x <* y).run ctx = (x.run ctx <* y.run ctx) := by rw [seqLeft_eq_bind (m := m)]; rfl @@ -216,6 +240,9 @@ namespace StateT theorem ext {x y : StateT σ m α} (h : ∀ s, x.run s = y.run s) : x = y := funext h +@[simp] theorem run'_eq [Monad m] (x : StateT σ m α) (s : σ) : run' x s = (·.1) <$> run x s := + rfl + @[simp] theorem run_pure [Monad m] (a : α) (s : σ) : (pure a : StateT σ m α).run s = pure (a, s) := rfl @[simp] theorem run_bind [Monad m] (x : StateT σ m α) (f : α → StateT σ m β) (s : σ) @@ -225,8 +252,7 @@ theorem ext {x y : StateT σ m α} (h : ∀ s, x.run s = y.run s) : x = y := intro p; cases p; rfl @[simp] theorem run_map {α β σ : Type u} [Monad m] [LawfulMonad m] (f : α → β) (x : StateT σ m α) (s : σ) : (f <$> x).run s = (fun (p : α × σ) => (f p.1, p.2)) <$> x.run s := by - simp [Functor.map, StateT.map, run] - rw [← bind_pure_comp] + simp [Functor.map, StateT.map, run, map_eq_pure_bind] apply bind_congr intro p; cases p; rfl @@ -234,7 +260,7 @@ theorem ext {x y : StateT σ m α} (h : ∀ s, x.run s = y.run s) : x = y := @[simp] theorem run_set [Monad m] (s s' : σ) : (set s' : StateT σ m PUnit).run s = pure (⟨⟩, s') := rfl -@[simp] theorem run_monadLift [Monad m] [MonadLiftT n m] (x : n α) (s : σ) : (monadLift x : StateT σ m α).run s = (monadLift x : m α) >>= fun a => pure (a, s) := rfl +@[simp] theorem run_monadLift {α σ : Type u} [Monad m] [MonadLiftT n m] (x : n α) (s : σ) : (monadLift x : StateT σ m α).run s = (monadLift x : m α) >>= fun a => pure (a, s) := rfl @[simp] theorem run_monadMap [Monad m] [MonadFunctor n m] (f : {β : Type u} → n β → n β) (x : StateT σ m α) (s : σ) : (monadMap @f x : StateT σ m α).run s = monadMap @f (x.run s) := rfl @@ -253,15 +279,13 @@ theorem ext {x y : StateT σ m α} (h : ∀ s, x.run s = y.run s) : x = y := theorem seqRight_eq [Monad m] [LawfulMonad m] (x : StateT σ m α) (y : StateT σ m β) : x *> y = const α id <$> x <*> y := by apply ext; intro s - simp; rw [← bind_pure_comp]; simp + simp [map_eq_pure_bind] apply bind_congr; intro p; cases p - simp[Prod.ext] + simp [Prod.ext] theorem seqLeft_eq [Monad m] [LawfulMonad m] (x : StateT σ m α) (y : StateT σ m β) : x <* y = const β <$> x <*> y := by apply ext; intro s - simp; rw [← bind_pure_comp]; simp - apply bind_congr; intro p; cases p - simp[Prod.ext, const]; rw [← bind_pure_comp] + simp [map_eq_pure_bind] instance [Monad m] [LawfulMonad m] : LawfulMonad (StateT σ m) where id_map := by intros; apply ext; intros; simp[Prod.ext] diff --git a/stage0/src/Init/Core.lean b/stage0/src/Init/Core.lean index 8eae03ab07..4a1b70c88e 100644 --- a/stage0/src/Init/Core.lean +++ b/stage0/src/Init/Core.lean @@ -603,20 +603,20 @@ protected theorem PSigma.eta {α : Sort u} {β : α → Sort v} {a₁ a₂ : α} /- Universe polymorphic unit -/ -theorem punitEq (a b : PUnit) : a = b := by +theorem PUnit.subsingleton (a b : PUnit) : a = b := by cases a; cases b; exact rfl -theorem punitEqPUnit (a : PUnit) : a = () := - punitEq a () +@[simp] theorem PUnit.eq_punit (a : PUnit) : a = () := + PUnit.subsingleton a () instance : Subsingleton PUnit := - Subsingleton.intro punitEq + Subsingleton.intro PUnit.subsingleton instance : Inhabited PUnit where default := ⟨⟩ instance : DecidableEq PUnit := - fun a b => isTrue (punitEq a b) + fun a b => isTrue (PUnit.subsingleton a b) /- Setoid -/ diff --git a/stage0/src/Lean/Elab/Binders.lean b/stage0/src/Lean/Elab/Binders.lean index 2754bee52e..0da728b456 100644 --- a/stage0/src/Lean/Elab/Binders.lean +++ b/stage0/src/Lean/Elab/Binders.lean @@ -477,23 +477,27 @@ def expandMatchAltsWhereDecls (matchAltsWhereDecls : Syntax) : MacroM Syntax := `(@fun $x => $body) loop (getMatchAltsNumPatterns matchAlts) #[] -@[builtinTermElab «fun»] def elabFun : TermElab := fun stx expectedType? => match stx with - | `(fun $binders* => $body) => do - let (binders, body, expandedPattern) ← expandFunBinders binders body - if expandedPattern then - let newStx ← `(fun $binders* => $body) - withMacroExpansion stx newStx <| elabTerm newStx expectedType? - else - elabFunBinders binders expectedType? fun xs expectedType? => do - /- We ensure the expectedType here since it will force coercions to be applied if needed. - If we just use `elabTerm`, then we will need to a coercion `Coe (α → β) (α → δ)` whenever there is a coercion `Coe β δ`, - and another instance for the dependent version. -/ - let e ← elabTermEnsuringType body expectedType? - mkLambdaFVars xs e - | `(fun $m:matchAlts) => do - let stxNew ← liftMacroM $ expandMatchAltsIntoMatch stx m - withMacroExpansion stx stxNew $ elabTerm stxNew expectedType? - | _ => throwUnsupportedSyntax +@[builtinTermElab «fun»] partial def elabFun : TermElab := + fun stx expectedType? => loop stx expectedType? +where + loop (stx : Syntax) (expectedType? : Option Expr) : TermElabM Expr := + match stx with + | `(fun $binders* => $body) => do + let (binders, body, expandedPattern) ← expandFunBinders binders body + if expandedPattern then + let newStx ← `(fun $binders* => $body) + loop newStx expectedType? + else + elabFunBinders binders expectedType? fun xs expectedType? => do + /- We ensure the expectedType here since it will force coercions to be applied if needed. + If we just use `elabTerm`, then we will need to a coercion `Coe (α → β) (α → δ)` whenever there is a coercion `Coe β δ`, + and another instance for the dependent version. -/ + let e ← elabTermEnsuringType body expectedType? + mkLambdaFVars xs e + | `(fun $m:matchAlts) => do + let stxNew ← liftMacroM $ expandMatchAltsIntoMatch stx m + withMacroExpansion stx stxNew $ elabTerm stxNew expectedType? + | _ => throwUnsupportedSyntax /- If `useLetExpr` is true, then a kernel let-expression `let x : type := val; body` is created. Otherwise, we create a term of the form `(fun (x : type) => body) val` diff --git a/stage0/src/Lean/Elab/Deriving/Repr.lean b/stage0/src/Lean/Elab/Deriving/Repr.lean index e83b60bbb8..3f2a3950ee 100644 --- a/stage0/src/Lean/Elab/Deriving/Repr.lean +++ b/stage0/src/Lean/Elab/Deriving/Repr.lean @@ -60,7 +60,7 @@ where patterns := patterns.push (← `(_)) let mut ctorArgs := #[] let mut rhs := Syntax.mkStrLit (toString ctorInfo.name) - let mut rhs ← `(Format.text $rhs) + rhs ← `(Format.text $rhs) -- add `_` for inductive parameters, they are inaccessible for i in [:indVal.numParams] do ctorArgs := ctorArgs.push (← `(_)) @@ -78,7 +78,7 @@ where return alts def mkBody (ctx : Context) (header : Header) (indVal : InductiveVal) (auxFunName : Name) : TermElabM Syntax := do - if isStructureLike (← getEnv) indVal.name then + if isStructure (← getEnv) indVal.name then mkBodyForStruct ctx header indVal else mkBodyForInduct ctx header indVal auxFunName diff --git a/stage0/src/Lean/Elab/MutualDef.lean b/stage0/src/Lean/Elab/MutualDef.lean index 8bb1147b47..2d6cfe66d7 100644 --- a/stage0/src/Lean/Elab/MutualDef.lean +++ b/stage0/src/Lean/Elab/MutualDef.lean @@ -600,26 +600,40 @@ private def getAllUserLevelNames (headers : Array DefViewElabHeader) : List Name else [] +/-- Eagerly convert universe metavariables occurring in theorem headers to universe parameters. -/ +private def levelMVarToParamHeaders (views : Array DefView) (headers : Array DefViewElabHeader) : TermElabM (Array DefViewElabHeader) := do + let rec process : StateRefT Nat TermElabM (Array DefViewElabHeader) := do + let mut newHeaders := #[] + for view in views, header in headers do + if view.kind.isTheorem then + newHeaders := newHeaders.push { header with type := (← levelMVarToParam' header.type) } + else + newHeaders := newHeaders.push header + return newHeaders + let newHeaders ← process.run' 1 + newHeaders.mapM fun header => return { header with type := (← instantiateMVars header.type) } + def elabMutualDef (vars : Array Expr) (views : Array DefView) : TermElabM Unit := do let scopeLevelNames ← getLevelNames let headers ← elabHeaders views + let headers ← levelMVarToParamHeaders views headers let allUserLevelNames := getAllUserLevelNames headers withFunLocalDecls headers fun funFVars => do let values ← elabFunValues headers Term.synthesizeSyntheticMVarsNoPostponing - if isExample views then - pure () - else - let values ← values.mapM (instantiateMVars ·) - let headers ← headers.mapM instantiateMVarsAtHeader - let letRecsToLift ← getLetRecsToLift - let letRecsToLift ← letRecsToLift.mapM instantiateMVarsAtLetRecToLift - checkLetRecsToLiftTypes funFVars letRecsToLift - withUsed vars headers values letRecsToLift fun vars => do - let preDefs ← MutualClosure.main vars headers funFVars values letRecsToLift - let preDefs ← levelMVarToParamPreDecls preDefs - let preDefs ← instantiateMVarsAtPreDecls preDefs - let preDefs ← fixLevelParams preDefs scopeLevelNames allUserLevelNames + let values ← values.mapM (instantiateMVars ·) + let headers ← headers.mapM instantiateMVarsAtHeader + let letRecsToLift ← getLetRecsToLift + let letRecsToLift ← letRecsToLift.mapM instantiateMVarsAtLetRecToLift + checkLetRecsToLiftTypes funFVars letRecsToLift + withUsed vars headers values letRecsToLift fun vars => do + let preDefs ← MutualClosure.main vars headers funFVars values letRecsToLift + let preDefs ← levelMVarToParamPreDecls preDefs + let preDefs ← instantiateMVarsAtPreDecls preDefs + let preDefs ← fixLevelParams preDefs scopeLevelNames allUserLevelNames + if isExample views then + withoutModifyingEnv <| addPreDefinitions preDefs + else addPreDefinitions preDefs end Term diff --git a/stage0/src/Lean/Elab/PreDefinition/Basic.lean b/stage0/src/Lean/Elab/PreDefinition/Basic.lean index 058565b1c1..398332e37c 100644 --- a/stage0/src/Lean/Elab/PreDefinition/Basic.lean +++ b/stage0/src/Lean/Elab/PreDefinition/Basic.lean @@ -31,15 +31,9 @@ def instantiateMVarsAtPreDecls (preDefs : Array PreDefinition) : TermElabM (Arra preDefs.mapM fun preDef => do pure { preDef with type := (← instantiateMVars preDef.type), value := (← instantiateMVars preDef.value) } -private def levelMVarToParamExpr (e : Expr) : StateRefT Nat TermElabM Expr := do - let nextIdx ← get - let (e, nextIdx) ← levelMVarToParam e nextIdx; - set nextIdx; - pure e - private def levelMVarToParamPreDeclsAux (preDefs : Array PreDefinition) : StateRefT Nat TermElabM (Array PreDefinition) := preDefs.mapM fun preDef => do - pure { preDef with type := (← levelMVarToParamExpr preDef.type), value := (← levelMVarToParamExpr preDef.value) } + pure { preDef with type := (← levelMVarToParam' preDef.type), value := (← levelMVarToParam' preDef.value) } def levelMVarToParamPreDecls (preDefs : Array PreDefinition) : TermElabM (Array PreDefinition) := (levelMVarToParamPreDeclsAux preDefs).run' 1 @@ -98,7 +92,6 @@ private def addNonRecAux (preDef : PreDefinition) (compile : Bool) : TermElabM U let env ← getEnv let decl := match preDef.kind with - | DefKind.«example» => unreachable! | DefKind.«theorem» => Declaration.thmDecl { name := preDef.declName, levelParams := preDef.levelParams, type := preDef.type, value := preDef.value } | DefKind.«opaque» => @@ -108,7 +101,7 @@ private def addNonRecAux (preDef : PreDefinition) (compile : Bool) : TermElabM U Declaration.defnDecl { name := preDef.declName, levelParams := preDef.levelParams, type := preDef.type, value := preDef.value, hints := ReducibilityHints.«abbrev», safety := if preDef.modifiers.isUnsafe then DefinitionSafety.unsafe else DefinitionSafety.safe } - | DefKind.«def» => + | _ => -- definitions and examples Declaration.defnDecl { name := preDef.declName, levelParams := preDef.levelParams, type := preDef.type, value := preDef.value, hints := ReducibilityHints.regular (getMaxHeight env preDef.value + 1), safety := if preDef.modifiers.isUnsafe then DefinitionSafety.unsafe else DefinitionSafety.safe } diff --git a/stage0/src/Lean/Meta/SynthInstance.lean b/stage0/src/Lean/Meta/SynthInstance.lean index c3d4549832..769ea0a840 100644 --- a/stage0/src/Lean/Meta/SynthInstance.lean +++ b/stage0/src/Lean/Meta/SynthInstance.lean @@ -510,15 +510,17 @@ private def preprocess (type : Expr) : MetaM Expr := let type ← whnf type mkForallFVars xs type -private def preprocessLevels (us : List Level) : MetaM (List Level) := do - let mut r := [] +private def preprocessLevels (us : List Level) : MetaM (List Level × Bool) := do + let mut r := #[] + let mut modified := false for u in us do let u ← instantiateLevelMVars u if u.hasMVar then - r := (← mkFreshLevelMVar)::r + r := r.push (← mkFreshLevelMVar) + modified := true else - r := u::r - pure r.reverse + r := r.push u + return (r.toList, modified) private partial def preprocessArgs (type : Expr) (i : Nat) (args : Array Expr) : MetaM (Array Expr) := do if h : i < args.size then @@ -532,7 +534,7 @@ private partial def preprocessArgs (type : Expr) (i : Nat) (args : Array Expr) : | _ => throwError "type class resolution failed, insufficient number of arguments" -- TODO improve error message else - pure args + return args private def preprocessOutParam (type : Expr) : MetaM Expr := forallTelescope type fun xs typeBody => do @@ -540,15 +542,22 @@ private def preprocessOutParam (type : Expr) : MetaM Expr := | c@(Expr.const constName us _) => let env ← getEnv if !hasOutParams env constName then - pure type + /- We treat all universe level parameters as "outParam" -/ + let (us, modified) ← preprocessLevels us + if modified then + let c := mkConst constName us + mkForallFVars xs (mkAppN c typeBody.getAppArgs) + else + return type else do let args := typeBody.getAppArgs - let us ← preprocessLevels us + let (us, _) ← preprocessLevels us let c := mkConst constName us let cType ← inferType c let args ← preprocessArgs cType 0 args mkForallFVars xs (mkAppN c args) - | _ => pure type + | _ => + return type /- Remark: when `maxResultSize? == none`, the configuration option `synthInstance.maxResultSize` is used. @@ -559,7 +568,7 @@ def synthInstance? (type : Expr) (maxResultSize? : Option Nat := none) : MetaM ( let opts ← getOptions let maxResultSize := maxResultSize?.getD (synthInstance.maxSize.get opts) let inputConfig ← getConfig - withConfig (fun config => { config with isDefEqStuckEx := true, transparency := TransparencyMode.reducible, + withConfig (fun config => { config with isDefEqStuckEx := true, transparency := TransparencyMode.instances, foApprox := true, ctxApprox := true, constApprox := false }) do let type ← instantiateMVars type let type ← preprocess type diff --git a/stage0/stdlib/Lean/Elab/Binders.c b/stage0/stdlib/Lean/Elab/Binders.c index b04cd87351..6e77da54b7 100644 --- a/stage0/stdlib/Lean/Elab/Binders.c +++ b/stage0/stdlib/Lean/Elab/Binders.c @@ -182,6 +182,7 @@ lean_object* l_Lean_throwError___at___private_Lean_Elab_Term_0__Lean_Elab_Term_a lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_quoteAutoTactic___spec__5___lambda__1___closed__7; lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Term_quoteAutoTactic___spec__6___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_restoreSynthInstanceCache(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_elabFun_loop(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Meta_withoutPostponingUniverseConstraintsImp___rarg___closed__16; extern lean_object* l_myMacro____x40_Init_Notation___hyg_12938____closed__5; lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_expandBinderIdent(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -239,7 +240,7 @@ lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_addLocalVarInfo(lea lean_object* l_Lean_Meta_mkLambdaFVars(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_getFunBinderIds_x3f___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Syntax_addPrec___closed__5; -lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5383_(lean_object*); +lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5388_(lean_object*); extern lean_object* l_myMacro____x40_Init_Notation___hyg_12938____closed__12; lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_expandBinderModifier___closed__8; lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_registerFailedToInferBinderTypeInfo(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -370,7 +371,6 @@ lean_object* l___private_Lean_Util_Trace_0__Lean_checkTraceOptionM___at___privat extern lean_object* l_myMacro____x40_Init_Notation___hyg_12336____closed__7; lean_object* l_Lean_Meta_withLocalDecl___at_Lean_Elab_Term_elabLetDeclAux___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_myMacro____x40_Init_Notation___hyg_2191____closed__4; -lean_object* l_Lean_Elab_Term_elabFun___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getNumArgs(lean_object*); lean_object* l_Lean_Elab_Term_quoteAutoTactic___lambda__2___closed__6; extern lean_object* l_Array_myMacro____x40_Init_Data_Array_Subarray___hyg_932____closed__3; @@ -463,6 +463,7 @@ lean_object* l_Lean_Elab_Term_quoteAutoTactic___lambda__3___closed__2; lean_object* l_Lean_Elab_Term_elabLetDeclAux___lambda__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Term_mkExplicitBinder___closed__1; uint8_t l_Lean_Syntax_isOfKind(lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_elabFun_loop___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_expandExplicitBindersAux_loop___closed__1; lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_expandMatchAltsIntoMatchAux_match__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Binders_0__Lean_Elab_Term_elabBindersAux_loop___rarg(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -20580,7 +20581,7 @@ lean_dec(x_1); return x_4; } } -lean_object* l_Lean_Elab_Term_elabFun___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) { +lean_object* l_Lean_Elab_Term_elabFun_loop___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) { _start: { lean_object* x_11; uint8_t x_12; lean_object* x_13; @@ -20635,7 +20636,7 @@ return x_21; } } } -lean_object* l_Lean_Elab_Term_elabFun(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* l_Lean_Elab_Term_elabFun_loop(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { _start: { lean_object* x_10; uint8_t x_11; @@ -20796,6 +20797,7 @@ return x_58; else { 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; uint8_t x_68; +lean_dec(x_1); x_59 = lean_unsigned_to_nat(0u); x_60 = l_Lean_Syntax_getArg(x_14, x_59); x_61 = lean_unsigned_to_nat(2u); @@ -20817,7 +20819,6 @@ lean_dec(x_67); if (x_68 == 0) { lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; -lean_dec(x_1); x_69 = lean_ctor_get(x_64, 1); lean_inc(x_69); lean_dec(x_64); @@ -20827,7 +20828,7 @@ lean_dec(x_65); x_71 = lean_ctor_get(x_66, 0); lean_inc(x_71); lean_dec(x_66); -x_72 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabFun___lambda__1), 10, 1); +x_72 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabFun_loop___lambda__1), 10, 1); lean_closure_set(x_72, 0, x_71); x_73 = l_Lean_Elab_Term_elabFunBinders___rarg(x_70, x_2, x_72, x_3, x_4, x_5, x_6, x_7, x_8, x_69); lean_dec(x_70); @@ -20835,7 +20836,7 @@ 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; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; lean_object* x_99; lean_object* x_100; +lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; lean_object* x_96; lean_object* x_97; lean_object* x_98; x_74 = lean_ctor_get(x_64, 1); lean_inc(x_74); lean_dec(x_64); @@ -20886,19 +20887,22 @@ x_97 = lean_array_push(x_87, x_96); x_98 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_98, 0, x_10); lean_ctor_set(x_98, 1, x_97); -lean_inc(x_98); -lean_inc(x_1); -x_99 = lean_alloc_closure((void*)(l_Lean_Elab_Term_adaptExpander___lambda__1), 10, 3); -lean_closure_set(x_99, 0, x_1); -lean_closure_set(x_99, 1, x_98); -lean_closure_set(x_99, 2, x_2); -x_100 = l_Lean_Elab_withMacroExpansionInfo___at___private_Lean_Elab_Term_0__Lean_Elab_Term_elabTermAux___spec__2(x_1, x_98, x_99, x_3, x_4, x_5, x_6, x_7, x_8, x_83); -return x_100; +x_1 = x_98; +x_9 = x_83; +goto _start; } } } } } +lean_object* l_Lean_Elab_Term_elabFun(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { +_start: +{ +lean_object* x_10; +x_10 = l_Lean_Elab_Term_elabFun_loop(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +return x_10; +} +} static lean_object* _init_l___regBuiltin_Lean_Elab_Term_elabFun___closed__1() { _start: { @@ -22444,7 +22448,7 @@ _start: lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; x_1 = l_Lean_Elab_Term_quoteAutoTactic___lambda__4___closed__1; x_2 = l_Lean_Elab_Term_elabLetDeclCore___closed__1; -x_3 = lean_unsigned_to_nat(579u); +x_3 = lean_unsigned_to_nat(583u); x_4 = lean_unsigned_to_nat(24u); x_5 = l_Lean_Name_getString_x21___closed__3; x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); @@ -22949,7 +22953,7 @@ x_5 = l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(x_2, x_3, x_4, x_1); return x_5; } } -lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5383_(lean_object* x_1) { +lean_object* l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5388_(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; @@ -23186,7 +23190,7 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Term_elabLetStarDecl___closed__1); res = l___regBuiltin_Lean_Elab_Term_elabLetStarDecl(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); -res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5383_(lean_io_mk_world()); +res = l_Lean_Elab_Term_initFn____x40_Lean_Elab_Binders___hyg_5388_(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); return lean_io_result_mk_ok(lean_box(0)); diff --git a/stage0/stdlib/Lean/Elab/Declaration.c b/stage0/stdlib/Lean/Elab/Declaration.c index 99f6ed34c8..db7a965349 100644 --- a/stage0/stdlib/Lean/Elab/Declaration.c +++ b/stage0/stdlib/Lean/Elab/Declaration.c @@ -43,6 +43,7 @@ lean_object* l___regBuiltin_Lean_Elab_Command_expandBuiltinInitialize___closed__ lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_expandMutualNamespace_match__1(lean_object*); lean_object* lean_array_uget(lean_object*, size_t); +extern lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1; lean_object* l_Array_append___rarg(lean_object*, lean_object*); lean_object* l_Lean_Elab_getDeclarationRange___at_Lean_Elab_Command_elabAxiom___spec__2(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Elab_Modifiers_isProtected(lean_object*); @@ -196,7 +197,6 @@ lean_object* l___private_Lean_Elab_Declaration_0__Lean_Elab_Command_isMutualIndu lean_object* l_Lean_Elab_addDeclarationRanges___at_Lean_Elab_Command_elabAxiom___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_docStringExt; lean_object* l_Lean_Elab_Command_expandInitCmd___closed__2; -lean_object* l_Lean_Elab_Command_expandMutualElement___closed__1; lean_object* l_Lean_Elab_Command_expandMutualPreamble___boxed(lean_object*, lean_object*, lean_object*); extern lean_object* l_myMacro____x40_Init_System_IO___hyg_2554____closed__5; lean_object* l_Lean_Elab_Command_elabMutual___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -6258,19 +6258,6 @@ return x_54; } } } -static lean_object* _init_l_Lean_Elab_Command_expandMutualElement___closed__1() { -_start: -{ -lean_object* x_1; uint8_t x_2; lean_object* x_3; lean_object* x_4; -x_1 = l_Array_empty___closed__1; -x_2 = 0; -x_3 = lean_box(x_2); -x_4 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_4, 0, x_1); -lean_ctor_set(x_4, 1, x_3); -return x_4; -} -} lean_object* l_Lean_Elab_Command_expandMutualElement(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { @@ -6283,7 +6270,7 @@ x_7 = lean_array_get_size(x_6); x_8 = lean_usize_of_nat(x_7); lean_dec(x_7); x_9 = 0; -x_10 = l_Lean_Elab_Command_expandMutualElement___closed__1; +x_10 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1; x_11 = l_Array_forInUnsafe_loop___at_Lean_Elab_Command_expandMutualElement___spec__1(x_6, x_8, x_9, x_10, x_2, x_3); lean_dec(x_6); if (lean_obj_tag(x_11) == 0) @@ -8111,8 +8098,6 @@ lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_expandMutualNamespace___cl res = l___regBuiltin_Lean_Elab_Command_expandMutualNamespace(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); -l_Lean_Elab_Command_expandMutualElement___closed__1 = _init_l_Lean_Elab_Command_expandMutualElement___closed__1(); -lean_mark_persistent(l_Lean_Elab_Command_expandMutualElement___closed__1); l___regBuiltin_Lean_Elab_Command_expandMutualElement___closed__1 = _init_l___regBuiltin_Lean_Elab_Command_expandMutualElement___closed__1(); lean_mark_persistent(l___regBuiltin_Lean_Elab_Command_expandMutualElement___closed__1); res = l___regBuiltin_Lean_Elab_Command_expandMutualElement(lean_io_mk_world()); diff --git a/stage0/stdlib/Lean/Elab/Deriving/Repr.c b/stage0/stdlib/Lean/Elab/Deriving/Repr.c index 530f7a5fd0..ef45138f1d 100644 --- a/stage0/stdlib/Lean/Elab/Deriving/Repr.c +++ b/stage0/stdlib/Lean/Elab/Deriving/Repr.c @@ -25,7 +25,6 @@ lean_object* l_Array_allM___at_Lean_Elab_Deriving_Repr_mkReprInstanceHandler___s lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*); lean_object* l_Lean_Elab_Deriving_Repr_mkReprInstanceHandler(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_stringToMessageData(lean_object*); -lean_object* l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158____closed__1; lean_object* l_Lean_Elab_Deriving_Repr_mkBodyForStruct___rarg___lambda__2___closed__7; extern lean_object* l_Lean_Elab_Deriving_mkContext___closed__2; lean_object* l_Lean_Elab_Command_liftTermElabM___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -35,6 +34,7 @@ lean_object* lean_array_uget(lean_object*, size_t); lean_object* l_Lean_Elab_Deriving_Repr_mkBodyForInduct_mkAlts(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_myMacro____x40_Init_Data_Array_Subarray___hyg_932____closed__4; lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_Repr_mkBodyForStruct___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164____closed__1; lean_object* l_Lean_Elab_Deriving_Repr_mkReprHeader___rarg___closed__5; lean_object* l_List_forIn_loop___at_Lean_Elab_Deriving_Repr_mkBodyForInduct_mkAlts___spec__4___lambda__1___closed__17; lean_object* l_Array_append___rarg(lean_object*, lean_object*); @@ -262,7 +262,6 @@ lean_object* l_Lean_Elab_Deriving_Repr_mkAuxFunction___lambda__1(lean_object*, l extern lean_object* l_myMacro____x40_Init_Notation___hyg_12938____closed__13; extern lean_object* l_Lean_Parser_Tactic_letrec___closed__3; lean_object* l_Lean_Elab_Deriving_Repr_mkReprHeader___rarg___closed__3; -uint8_t l_Lean_isStructureLike(lean_object*, lean_object*); lean_object* l_Lean_Elab_Deriving_Repr_mkBodyForStruct___rarg___lambda__2___closed__2; lean_object* l_Lean_Meta_forallTelescopeReducing___at_Lean_Elab_Deriving_Repr_mkBodyForInduct_mkAlts___spec__3(lean_object*); lean_object* l_Lean_mkConst(lean_object*, lean_object*); @@ -282,6 +281,7 @@ lean_object* l_List_forIn_loop___at_Lean_Elab_Deriving_Repr_mkBodyForInduct_mkAl lean_object* l_List_forIn_loop___at_Lean_Elab_Deriving_Repr_mkBodyForInduct_mkAlts___spec__4___lambda__1___closed__28; lean_object* l_Lean_Elab_Deriving_Repr_mkReprInstanceHandler___closed__1; lean_object* l_Lean_MonadRef_mkInfoFromRefPos___at_Lean_Elab_Deriving_mkInductiveApp___spec__2___rarg(lean_object*, lean_object*, lean_object*); +uint8_t l_Lean_isStructure(lean_object*, lean_object*); lean_object* l_Lean_Elab_Deriving_Repr_mkReprHeader___rarg___closed__2; lean_object* l_List_forIn_loop___at_Lean_Elab_Deriving_Repr_mkBodyForInduct_mkAlts___spec__4___lambda__1___closed__5; lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_Repr_mkBodyForStruct___spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -289,7 +289,7 @@ lean_object* l_Lean_Elab_getBetterRef(lean_object*, lean_object*); lean_object* l_Array_foldlMUnsafe_fold___at_Lean_Elab_Deriving_Repr_mkReprInstanceHandler___spec__7(lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Std_myMacro____x40_Init_Data_Format_Macro___hyg_26____closed__4; uint8_t lean_nat_dec_lt(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158_(lean_object*); +lean_object* l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164_(lean_object*); static lean_object* _init_l_Lean_Elab_Deriving_Repr_mkReprHeader___rarg___closed__1() { _start: { @@ -4667,7 +4667,7 @@ lean_inc(x_15); x_16 = lean_ctor_get(x_15, 0); lean_inc(x_16); lean_dec(x_15); -x_17 = l_Lean_isStructureLike(x_14, x_16); +x_17 = l_Lean_isStructure(x_14, x_16); if (x_17 == 0) { lean_object* x_18; @@ -7038,7 +7038,7 @@ lean_dec(x_2); return x_8; } } -static lean_object* _init_l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158____closed__1() { +static lean_object* _init_l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164____closed__1() { _start: { lean_object* x_1; @@ -7046,12 +7046,12 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_Repr_mkReprInstanceHandler return x_1; } } -lean_object* l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158_(lean_object* x_1) { +lean_object* l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164_(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; x_2 = l_Lean_Elab_Deriving_Repr_mkReprHeader___rarg___closed__2; -x_3 = l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158____closed__1; +x_3 = l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164____closed__1; x_4 = l_Lean_Elab_registerBuiltinDerivingHandler(x_2, x_3, x_1); if (lean_obj_tag(x_4) == 0) { @@ -7256,9 +7256,9 @@ l___private_Lean_Elab_Deriving_Repr_0__Lean_Elab_Deriving_Repr_mkReprInstanceCmd lean_mark_persistent(l___private_Lean_Elab_Deriving_Repr_0__Lean_Elab_Deriving_Repr_mkReprInstanceCmds___closed__1); l_Lean_Elab_Deriving_Repr_mkReprInstanceHandler___closed__1 = _init_l_Lean_Elab_Deriving_Repr_mkReprInstanceHandler___closed__1(); lean_mark_persistent(l_Lean_Elab_Deriving_Repr_mkReprInstanceHandler___closed__1); -l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158____closed__1 = _init_l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158____closed__1(); -lean_mark_persistent(l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158____closed__1); -res = l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3158_(lean_io_mk_world()); +l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164____closed__1 = _init_l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164____closed__1(); +lean_mark_persistent(l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164____closed__1); +res = l_Lean_Elab_Deriving_Repr_initFn____x40_Lean_Elab_Deriving_Repr___hyg_3164_(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); return lean_io_result_mk_ok(lean_box(0)); diff --git a/stage0/stdlib/Lean/Elab/Match.c b/stage0/stdlib/Lean/Elab/Match.c index 3bbb5db896..44896fca44 100644 --- a/stage0/stdlib/Lean/Elab/Match.c +++ b/stage0/stdlib/Lean/Elab/Match.c @@ -90,6 +90,7 @@ lean_object* l_Lean_addTrace___at_Lean_Elab_Term_CollectPatternVars_main___spec_ lean_object* l___private_Lean_Elab_Match_0__Lean_Elab_Term_CollectPatternVars_nameToPattern___closed__14; lean_object* l_Lean_Elab_Term_CollectPatternVars_CtorApp_processCtorApp_match__1(lean_object*); lean_object* l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabPatterns___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +extern lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1; lean_object* l_Lean_Elab_Term_elabMatch_elabMatchDefault___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_elabNoMatch(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_CollectPatternVars_collect___closed__6; @@ -149,7 +150,6 @@ lean_object* l___private_Lean_Elab_Match_0__Lean_Elab_Term_isMatchUnit_x3f_match extern lean_object* l___private_Lean_Meta_ExprDefEq_0__Lean_Meta_checkTypesAndAssign___closed__7; lean_object* l___private_Lean_Elab_Match_0__Lean_Elab_Term_CollectPatternVars_nameToPattern___closed__8; lean_object* l___private_Lean_Elab_Match_0__Lean_Elab_Term_CollectPatternVars_processVar___lambda__3___closed__3; -lean_object* l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__2; lean_object* l_Lean_Elab_Term_CollectPatternVars_CtorApp_processCtorApp___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_List_forIn_loop___at___private_Lean_Elab_Match_0__Lean_Elab_Term_elabMatchAux___spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_st_ref_get(lean_object*, lean_object*); @@ -1825,22 +1825,9 @@ return x_24; static lean_object* _init_l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__1() { _start: { -lean_object* x_1; uint8_t x_2; lean_object* x_3; lean_object* x_4; -x_1 = l_Array_empty___closed__1; -x_2 = 0; -x_3 = lean_box(x_2); -x_4 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_4, 0, x_1); -lean_ctor_set(x_4, 1, x_3); -return x_4; -} -} -static lean_object* _init_l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__2() { -_start: -{ lean_object* x_1; lean_object* x_2; lean_object* x_3; x_1 = lean_unsigned_to_nat(0u); -x_2 = l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__1; +x_2 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1; x_3 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_3, 0, x_1); lean_ctor_set(x_3, 1, x_2); @@ -1851,7 +1838,7 @@ lean_object* l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchTyp _start: { lean_object* x_11; lean_object* x_12; lean_object* x_13; size_t x_14; size_t x_15; lean_object* x_16; lean_object* x_17; -x_11 = l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__2; +x_11 = l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__1; x_12 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_12, 0, x_2); lean_ctor_set(x_12, 1, x_11); @@ -30832,8 +30819,6 @@ l_Array_forInUnsafe_loop___at___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDi lean_mark_persistent(l_Array_forInUnsafe_loop___at___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___spec__1___lambda__2___closed__7); l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__1 = _init_l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__1(); lean_mark_persistent(l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__1); -l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__2 = _init_l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__2(); -lean_mark_persistent(l___private_Lean_Elab_Match_0__Lean_Elab_Term_elabDiscrsWitMatchType___closed__2); l_Lean_Elab_Term_isAuxDiscrName___closed__1 = _init_l_Lean_Elab_Term_isAuxDiscrName___closed__1(); lean_mark_persistent(l_Lean_Elab_Term_isAuxDiscrName___closed__1); l_Lean_Elab_Term_isAuxDiscrName___closed__2 = _init_l_Lean_Elab_Term_isAuxDiscrName___closed__2(); diff --git a/stage0/stdlib/Lean/Elab/MutualDef.c b/stage0/stdlib/Lean/Elab/MutualDef.c index 6c4f85dae8..2d32c93519 100644 --- a/stage0/stdlib/Lean/Elab/MutualDef.c +++ b/stage0/stdlib/Lean/Elab/MutualDef.c @@ -20,6 +20,7 @@ lean_object* lean_expr_update_forall(lean_object*, uint8_t, lean_object*, lean_o lean_object* l_Lean_throwErrorAt___at_Lean_Elab_Command_elabCommand___spec__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_expandWhereDeclsAsStructInst___spec__1___lambda__2(size_t, lean_object*, lean_object*, lean_object*, size_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_removeUnused(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_extractMacroScopes(lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkModifiers___lambda__2___closed__3; lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -48,6 +49,7 @@ extern lean_object* l_Lean_Elab_elabAttr___rarg___lambda__8___closed__2; lean_object* l_Lean_Elab_Term_getLetRecsToLift___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_withUsed_match__1___rarg(lean_object*, lean_object*); lean_object* l_Lean_LocalDecl_userName(lean_object*); +lean_object* l_Lean_Elab_Term_elabMutualDef___lambda__1___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*, lean_object*); lean_object* l_List_forM___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_collectUsed___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_mapM___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_mkLetRecClosures___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1136____closed__9; @@ -71,6 +73,7 @@ lean_object* lean_expr_update_mdata(lean_object*, lean_object*); lean_object* l_Array_append___rarg(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Term_letEqnsDecl___closed__1; lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_check_match__1___rarg(lean_object*, lean_object*, lean_object*); +lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___spec__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_Elab_Term_MutualClosure_getKindForLetRecs(lean_object*); uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -105,6 +108,7 @@ lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_pus lean_object* l_Array_mapMUnsafe_map___at_myMacro____x40_Init_NotationExtra___hyg_5198____spec__3(size_t, size_t, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_typeHasRecFun_match__2(lean_object*); lean_object* l_Lean_addDeclarationRanges___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__14___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_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_check___closed__3; extern lean_object* l_Array_empty___closed__1; lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkModifiers___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -140,7 +144,9 @@ lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_E lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_expandWhereDeclsAsStructInst___spec__1___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkKinds___closed__1; lean_object* l_Lean_Elab_Term_MutualClosure_getKindForLetRecs___lambda__1___boxed(lean_object*); +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Elab_throwAlreadyDeclaredUniverseLevel___rarg___closed__3; +lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Command_elabMutualDef___spec__6(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); @@ -230,6 +236,7 @@ lean_object* l_Lean_mkAppN(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabMutualDef___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Std_Range_myMacro____x40_Init_Data_Range___hyg_276____closed__5; lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_mkInitialUsedFVarsMap___spec__3___lambda__1___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Term_letPatDecl___closed__1; lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_mkClosureForAux___closed__1; lean_object* l_List_forM___at_Lean_Elab_Term_MutualClosure_main___spec__3___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -237,6 +244,7 @@ lean_object* l_Lean_Elab_expandDeclId___at___private_Lean_Elab_MutualDef_0__Lean lean_object* l_Array_foldlMUnsafe___at_Array_foldl___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_throwError___at___private_Lean_Elab_Term_0__Lean_Elab_Term_applyAttributesCore___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_toAttributeKind___at_Lean_Elab_Command_mkDefViewOfInstance___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__2___rarg(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_mkClosureForAux___closed__2; lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_getFunName___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_MutualDef_0__Lean_Elab_Term_withFunLocalDecls_loop(lean_object*); @@ -250,6 +258,7 @@ lean_object* l_Lean_Elab_applyVisibility___at___private_Lean_Elab_MutualDef_0__L lean_object* l_Lean_Elab_Term_elabTermEnsuringType(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__15___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_MapDeclarationExtension_insert___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_instantiateMVarsAtHeader(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_mkDeclName___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__2___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -350,6 +359,7 @@ lean_object* l_List_foldl___at_Lean_Elab_Term_MutualClosure_pushLetRecs___spec__ lean_object* l_Lean_Elab_Term_synthesizeSyntheticMVars_loop(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_addDeclarationRanges___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__14(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Nat_foldAux___at_Lean_Elab_Term_MutualClosure_insertReplacementForMainFns___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___spec__1___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*); extern lean_object* l_Lean_Elab_Term_expandWhereDecls___closed__2; lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_check___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_mkClosureForAux___closed__3; @@ -372,6 +382,7 @@ lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_mkI lean_object* l_Lean_Elab_Term_getCurrMacroScope(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_check___lambda__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_to_list(lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__1(lean_object*); uint8_t l_Lean_Name_isAtomic(lean_object*); lean_object* l_Lean_Elab_expandDeclId___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__1___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Macro_throwErrorAt___rarg(lean_object*, lean_object*, lean_object*, lean_object*); @@ -379,6 +390,7 @@ uint8_t l_Lean_Environment_contains(lean_object*, lean_object*); uint8_t l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_isExample___lambda__1(lean_object*); extern lean_object* l_Lean_protectedExt; uint8_t l_Lean_Elab_Term_MutualClosure_getModifiersForLetRecs___lambda__3(lean_object*); +lean_object* l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_withFunLocalDecls___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_FixPoint_fixpoint_match__1(lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_check_match__1(lean_object*); @@ -461,6 +473,7 @@ lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_Fix lean_object* l_List_forM___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkLetRecsToLiftTypes___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_expandWhereDeclsAsStructInst___spec__2___lambda__4(size_t, lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_throwErrorAt___at_Lean_Elab_Command_elabMutualDef___spec__9___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_levelMVarToParam_x27(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_check___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_addPreDefinitions(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_typeHasRecFun_match__1___rarg(lean_object*, lean_object*, lean_object*); @@ -490,6 +503,7 @@ lean_object* l_Lean_Syntax_getSepArgs(lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_removeUnusedVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_isAttribute(lean_object*, lean_object*); extern lean_object* l_myMacro____x40_Init_Notation___hyg_12336____closed__7; +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_pickMaxFVar_x3f___boxed(lean_object*, lean_object*); lean_object* l_Lean_mkHole(lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkModifiers___closed__2; @@ -512,7 +526,7 @@ lean_object* l_Lean_Elab_Command_getCurrMacroScope(lean_object*, lean_object*, l lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_isExample___boxed(lean_object*); lean_object* l_Lean_mkPrivateName(lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_MutualClosure_main___spec__5(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_elabMutualDef___lambda__1(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*); +lean_object* l_Lean_Elab_Term_elabMutualDef___lambda__1(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*, lean_object*); lean_object* l_Lean_Elab_elabModifiers___at_Lean_Elab_Command_elabMutualDef___spec__1___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Elab_instInhabitedModifiers___closed__1; lean_object* l_Std_PersistentArray_toArray___rarg(lean_object*); @@ -533,6 +547,7 @@ lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean lean_object* l_Lean_addDocString_x27___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_collectUsed___lambda__1___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_MutualDef_0__Lean_Elab_Term_check___lambda__5___closed__3; +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed__const__1; lean_object* l_Array_appendCore___rarg(lean_object*, lean_object*); extern lean_object* l_Lean_instInhabitedExpr___closed__1; uint8_t l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_isTheorem(lean_object*); @@ -547,6 +562,7 @@ lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_Fix lean_object* l_Lean_Elab_elabModifiers___at_Lean_Elab_Command_elabMutualDef___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_elabModifiers___at_Lean_Elab_Command_elabMutualDef___spec__1___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_declValToTerm(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_MutualClosure_getKindForLetRecs___closed__1; lean_object* l_Lean_Elab_Term_MutualClosure_pushMain(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -631,6 +647,7 @@ extern lean_object* l_Lean_CollectMVars_instInhabitedState___closed__1; lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_MutualClosure_FixPoint_fixpoint(lean_object*); lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_getFunName_match__2(lean_object*); uint8_t l_Lean_NameSet_contains(lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__2(lean_object*); extern lean_object* l_prec_x28___x29___closed__3; lean_object* l_Lean_Elab_Term_addAutoBoundImplicits(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Array_contains___at_Lean_Meta_CheckAssignment_checkFVar___spec__1(lean_object*, lean_object*); @@ -17313,6 +17330,785 @@ lean_dec(x_1); return x_2; } } +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +if (lean_obj_tag(x_1) == 0) +{ +lean_object* x_4; lean_object* x_5; +lean_dec(x_3); +x_4 = lean_box(0); +x_5 = lean_apply_1(x_2, x_4); +return x_5; +} +else +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; +lean_dec(x_2); +x_6 = lean_ctor_get(x_1, 0); +lean_inc(x_6); +lean_dec(x_1); +x_7 = lean_ctor_get(x_6, 0); +lean_inc(x_7); +x_8 = lean_ctor_get(x_6, 1); +lean_inc(x_8); +lean_dec(x_6); +x_9 = lean_apply_2(x_3, x_7, x_8); +return x_9; +} +} +} +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__1(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__1___rarg), 3, 0); +return x_2; +} +} +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__2___rarg(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_3 = lean_ctor_get(x_1, 0); +lean_inc(x_3); +x_4 = lean_ctor_get(x_1, 1); +lean_inc(x_4); +lean_dec(x_1); +x_5 = lean_apply_2(x_2, x_3, x_4); +return x_5; +} +} +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__2(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process_match__2___rarg), 2, 0); +return x_2; +} +} +lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___spec__1(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) { +_start: +{ +uint8_t x_13; +x_13 = x_3 < x_2; +if (x_13 == 0) +{ +lean_object* x_14; +x_14 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_14, 0, x_4); +lean_ctor_set(x_14, 1, x_12); +return x_14; +} +else +{ +lean_object* x_15; uint8_t x_16; +x_15 = lean_array_uget(x_1, x_3); +x_16 = !lean_is_exclusive(x_4); +if (x_16 == 0) +{ +lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; uint8_t x_22; +x_17 = lean_ctor_get(x_4, 1); +x_18 = lean_ctor_get(x_4, 0); +x_19 = lean_ctor_get(x_17, 0); +lean_inc(x_19); +x_20 = lean_ctor_get(x_17, 1); +lean_inc(x_20); +x_21 = lean_ctor_get(x_17, 2); +lean_inc(x_21); +x_22 = lean_nat_dec_lt(x_20, x_21); +if (x_22 == 0) +{ +lean_object* x_23; +lean_dec(x_21); +lean_dec(x_20); +lean_dec(x_19); +lean_dec(x_15); +x_23 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_23, 0, x_4); +lean_ctor_set(x_23, 1, x_12); +return x_23; +} +else +{ +uint8_t x_24; +x_24 = !lean_is_exclusive(x_17); +if (x_24 == 0) +{ +lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31; uint8_t x_32; +x_25 = lean_ctor_get(x_17, 2); +lean_dec(x_25); +x_26 = lean_ctor_get(x_17, 1); +lean_dec(x_26); +x_27 = lean_ctor_get(x_17, 0); +lean_dec(x_27); +x_28 = lean_array_fget(x_19, x_20); +x_29 = lean_unsigned_to_nat(1u); +x_30 = lean_nat_add(x_20, x_29); +lean_dec(x_20); +lean_ctor_set(x_17, 1, x_30); +x_31 = lean_ctor_get_uint8(x_15, sizeof(void*)*6); +lean_dec(x_15); +x_32 = l_Lean_Elab_DefKind_isTheorem(x_31); +if (x_32 == 0) +{ +lean_object* x_33; size_t x_34; size_t x_35; +x_33 = lean_array_push(x_18, x_28); +lean_ctor_set(x_4, 0, x_33); +x_34 = 1; +x_35 = x_3 + x_34; +x_3 = x_35; +goto _start; +} +else +{ +uint8_t x_37; +x_37 = !lean_is_exclusive(x_28); +if (x_37 == 0) +{ +lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; size_t x_43; size_t x_44; +x_38 = lean_ctor_get(x_28, 6); +x_39 = l_Lean_Elab_Term_levelMVarToParam_x27(x_38, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +x_40 = lean_ctor_get(x_39, 0); +lean_inc(x_40); +x_41 = lean_ctor_get(x_39, 1); +lean_inc(x_41); +lean_dec(x_39); +lean_ctor_set(x_28, 6, x_40); +x_42 = lean_array_push(x_18, x_28); +lean_ctor_set(x_4, 0, x_42); +x_43 = 1; +x_44 = x_3 + x_43; +x_3 = x_44; +x_12 = x_41; +goto _start; +} +else +{ +lean_object* x_46; lean_object* x_47; uint8_t x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; size_t x_60; size_t x_61; +x_46 = lean_ctor_get(x_28, 0); +x_47 = lean_ctor_get(x_28, 1); +x_48 = lean_ctor_get_uint8(x_28, sizeof(void*)*8); +x_49 = lean_ctor_get(x_28, 2); +x_50 = lean_ctor_get(x_28, 3); +x_51 = lean_ctor_get(x_28, 4); +x_52 = lean_ctor_get(x_28, 5); +x_53 = lean_ctor_get(x_28, 6); +x_54 = lean_ctor_get(x_28, 7); +lean_inc(x_54); +lean_inc(x_53); +lean_inc(x_52); +lean_inc(x_51); +lean_inc(x_50); +lean_inc(x_49); +lean_inc(x_47); +lean_inc(x_46); +lean_dec(x_28); +x_55 = l_Lean_Elab_Term_levelMVarToParam_x27(x_53, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +x_56 = lean_ctor_get(x_55, 0); +lean_inc(x_56); +x_57 = lean_ctor_get(x_55, 1); +lean_inc(x_57); +lean_dec(x_55); +x_58 = lean_alloc_ctor(0, 8, 1); +lean_ctor_set(x_58, 0, x_46); +lean_ctor_set(x_58, 1, x_47); +lean_ctor_set(x_58, 2, x_49); +lean_ctor_set(x_58, 3, x_50); +lean_ctor_set(x_58, 4, x_51); +lean_ctor_set(x_58, 5, x_52); +lean_ctor_set(x_58, 6, x_56); +lean_ctor_set(x_58, 7, x_54); +lean_ctor_set_uint8(x_58, sizeof(void*)*8, x_48); +x_59 = lean_array_push(x_18, x_58); +lean_ctor_set(x_4, 0, x_59); +x_60 = 1; +x_61 = x_3 + x_60; +x_3 = x_61; +x_12 = x_57; +goto _start; +} +} +} +else +{ +lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; uint8_t x_67; uint8_t x_68; +lean_dec(x_17); +x_63 = lean_array_fget(x_19, x_20); +x_64 = lean_unsigned_to_nat(1u); +x_65 = lean_nat_add(x_20, x_64); +lean_dec(x_20); +x_66 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_66, 0, x_19); +lean_ctor_set(x_66, 1, x_65); +lean_ctor_set(x_66, 2, x_21); +x_67 = lean_ctor_get_uint8(x_15, sizeof(void*)*6); +lean_dec(x_15); +x_68 = l_Lean_Elab_DefKind_isTheorem(x_67); +if (x_68 == 0) +{ +lean_object* x_69; size_t x_70; size_t x_71; +x_69 = lean_array_push(x_18, x_63); +lean_ctor_set(x_4, 1, x_66); +lean_ctor_set(x_4, 0, x_69); +x_70 = 1; +x_71 = x_3 + x_70; +x_3 = x_71; +goto _start; +} +else +{ +lean_object* x_73; lean_object* x_74; uint8_t x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; size_t x_88; size_t x_89; +x_73 = lean_ctor_get(x_63, 0); +lean_inc(x_73); +x_74 = lean_ctor_get(x_63, 1); +lean_inc(x_74); +x_75 = lean_ctor_get_uint8(x_63, sizeof(void*)*8); +x_76 = lean_ctor_get(x_63, 2); +lean_inc(x_76); +x_77 = lean_ctor_get(x_63, 3); +lean_inc(x_77); +x_78 = lean_ctor_get(x_63, 4); +lean_inc(x_78); +x_79 = lean_ctor_get(x_63, 5); +lean_inc(x_79); +x_80 = lean_ctor_get(x_63, 6); +lean_inc(x_80); +x_81 = lean_ctor_get(x_63, 7); +lean_inc(x_81); +if (lean_is_exclusive(x_63)) { + lean_ctor_release(x_63, 0); + lean_ctor_release(x_63, 1); + lean_ctor_release(x_63, 2); + lean_ctor_release(x_63, 3); + lean_ctor_release(x_63, 4); + lean_ctor_release(x_63, 5); + lean_ctor_release(x_63, 6); + lean_ctor_release(x_63, 7); + x_82 = x_63; +} else { + lean_dec_ref(x_63); + x_82 = lean_box(0); +} +x_83 = l_Lean_Elab_Term_levelMVarToParam_x27(x_80, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +x_84 = lean_ctor_get(x_83, 0); +lean_inc(x_84); +x_85 = lean_ctor_get(x_83, 1); +lean_inc(x_85); +lean_dec(x_83); +if (lean_is_scalar(x_82)) { + x_86 = lean_alloc_ctor(0, 8, 1); +} else { + x_86 = x_82; +} +lean_ctor_set(x_86, 0, x_73); +lean_ctor_set(x_86, 1, x_74); +lean_ctor_set(x_86, 2, x_76); +lean_ctor_set(x_86, 3, x_77); +lean_ctor_set(x_86, 4, x_78); +lean_ctor_set(x_86, 5, x_79); +lean_ctor_set(x_86, 6, x_84); +lean_ctor_set(x_86, 7, x_81); +lean_ctor_set_uint8(x_86, sizeof(void*)*8, x_75); +x_87 = lean_array_push(x_18, x_86); +lean_ctor_set(x_4, 1, x_66); +lean_ctor_set(x_4, 0, x_87); +x_88 = 1; +x_89 = x_3 + x_88; +x_3 = x_89; +x_12 = x_85; +goto _start; +} +} +} +} +else +{ +lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; uint8_t x_96; +x_91 = lean_ctor_get(x_4, 1); +x_92 = lean_ctor_get(x_4, 0); +lean_inc(x_91); +lean_inc(x_92); +lean_dec(x_4); +x_93 = lean_ctor_get(x_91, 0); +lean_inc(x_93); +x_94 = lean_ctor_get(x_91, 1); +lean_inc(x_94); +x_95 = lean_ctor_get(x_91, 2); +lean_inc(x_95); +x_96 = lean_nat_dec_lt(x_94, x_95); +if (x_96 == 0) +{ +lean_object* x_97; lean_object* x_98; +lean_dec(x_95); +lean_dec(x_94); +lean_dec(x_93); +lean_dec(x_15); +x_97 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_97, 0, x_92); +lean_ctor_set(x_97, 1, x_91); +x_98 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_98, 0, x_97); +lean_ctor_set(x_98, 1, x_12); +return x_98; +} +else +{ +lean_object* x_99; lean_object* x_100; lean_object* x_101; lean_object* x_102; lean_object* x_103; uint8_t x_104; uint8_t x_105; +if (lean_is_exclusive(x_91)) { + lean_ctor_release(x_91, 0); + lean_ctor_release(x_91, 1); + lean_ctor_release(x_91, 2); + x_99 = x_91; +} else { + lean_dec_ref(x_91); + x_99 = lean_box(0); +} +x_100 = lean_array_fget(x_93, x_94); +x_101 = lean_unsigned_to_nat(1u); +x_102 = lean_nat_add(x_94, x_101); +lean_dec(x_94); +if (lean_is_scalar(x_99)) { + x_103 = lean_alloc_ctor(0, 3, 0); +} else { + x_103 = x_99; +} +lean_ctor_set(x_103, 0, x_93); +lean_ctor_set(x_103, 1, x_102); +lean_ctor_set(x_103, 2, x_95); +x_104 = lean_ctor_get_uint8(x_15, sizeof(void*)*6); +lean_dec(x_15); +x_105 = l_Lean_Elab_DefKind_isTheorem(x_104); +if (x_105 == 0) +{ +lean_object* x_106; lean_object* x_107; size_t x_108; size_t x_109; +x_106 = lean_array_push(x_92, x_100); +x_107 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_107, 0, x_106); +lean_ctor_set(x_107, 1, x_103); +x_108 = 1; +x_109 = x_3 + x_108; +x_3 = x_109; +x_4 = x_107; +goto _start; +} +else +{ +lean_object* x_111; lean_object* x_112; uint8_t x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; size_t x_127; size_t x_128; +x_111 = lean_ctor_get(x_100, 0); +lean_inc(x_111); +x_112 = lean_ctor_get(x_100, 1); +lean_inc(x_112); +x_113 = lean_ctor_get_uint8(x_100, sizeof(void*)*8); +x_114 = lean_ctor_get(x_100, 2); +lean_inc(x_114); +x_115 = lean_ctor_get(x_100, 3); +lean_inc(x_115); +x_116 = lean_ctor_get(x_100, 4); +lean_inc(x_116); +x_117 = lean_ctor_get(x_100, 5); +lean_inc(x_117); +x_118 = lean_ctor_get(x_100, 6); +lean_inc(x_118); +x_119 = lean_ctor_get(x_100, 7); +lean_inc(x_119); +if (lean_is_exclusive(x_100)) { + lean_ctor_release(x_100, 0); + lean_ctor_release(x_100, 1); + lean_ctor_release(x_100, 2); + lean_ctor_release(x_100, 3); + lean_ctor_release(x_100, 4); + lean_ctor_release(x_100, 5); + lean_ctor_release(x_100, 6); + lean_ctor_release(x_100, 7); + x_120 = x_100; +} else { + lean_dec_ref(x_100); + x_120 = lean_box(0); +} +x_121 = l_Lean_Elab_Term_levelMVarToParam_x27(x_118, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +x_122 = lean_ctor_get(x_121, 0); +lean_inc(x_122); +x_123 = lean_ctor_get(x_121, 1); +lean_inc(x_123); +lean_dec(x_121); +if (lean_is_scalar(x_120)) { + x_124 = lean_alloc_ctor(0, 8, 1); +} else { + x_124 = x_120; +} +lean_ctor_set(x_124, 0, x_111); +lean_ctor_set(x_124, 1, x_112); +lean_ctor_set(x_124, 2, x_114); +lean_ctor_set(x_124, 3, x_115); +lean_ctor_set(x_124, 4, x_116); +lean_ctor_set(x_124, 5, x_117); +lean_ctor_set(x_124, 6, x_122); +lean_ctor_set(x_124, 7, x_119); +lean_ctor_set_uint8(x_124, sizeof(void*)*8, x_113); +x_125 = lean_array_push(x_92, x_124); +x_126 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_126, 0, x_125); +lean_ctor_set(x_126, 1, x_103); +x_127 = 1; +x_128 = x_3 + x_127; +x_3 = x_128; +x_4 = x_126; +x_12 = x_123; +goto _start; +} +} +} +} +} +} +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process(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) { +_start: +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; size_t x_17; size_t x_18; lean_object* x_19; uint8_t x_20; +x_11 = lean_array_get_size(x_2); +x_12 = lean_unsigned_to_nat(0u); +x_13 = l_Array_toSubarray___rarg(x_2, x_12, x_11); +x_14 = l_Array_empty___closed__1; +x_15 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_15, 0, x_14); +lean_ctor_set(x_15, 1, x_13); +x_16 = lean_array_get_size(x_1); +x_17 = lean_usize_of_nat(x_16); +lean_dec(x_16); +x_18 = 0; +x_19 = l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___spec__1(x_1, x_17, x_18, x_15, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +x_20 = !lean_is_exclusive(x_19); +if (x_20 == 0) +{ +lean_object* x_21; lean_object* x_22; +x_21 = lean_ctor_get(x_19, 0); +x_22 = lean_ctor_get(x_21, 0); +lean_inc(x_22); +lean_dec(x_21); +lean_ctor_set(x_19, 0, x_22); +return x_19; +} +else +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; +x_23 = lean_ctor_get(x_19, 0); +x_24 = lean_ctor_get(x_19, 1); +lean_inc(x_24); +lean_inc(x_23); +lean_dec(x_19); +x_25 = lean_ctor_get(x_23, 0); +lean_inc(x_25); +lean_dec(x_23); +x_26 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_26, 0, x_25); +lean_ctor_set(x_26, 1, x_24); +return x_26; +} +} +} +lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12) { +_start: +{ +size_t x_13; size_t x_14; lean_object* x_15; +x_13 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_14 = lean_unbox_usize(x_3); +lean_dec(x_3); +x_15 = l_Array_forInUnsafe_loop___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___spec__1(x_1, x_13, x_14, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_1); +return x_15; +} +} +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process___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) { +_start: +{ +lean_object* x_11; +x_11 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_1); +return x_11; +} +} +lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___spec__1(size_t x_1, size_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, lean_object* x_10) { +_start: +{ +uint8_t x_11; +x_11 = x_2 < x_1; +if (x_11 == 0) +{ +lean_object* x_12; lean_object* x_13; +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +x_12 = x_3; +x_13 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_13, 0, x_12); +lean_ctor_set(x_13, 1, x_10); +return x_13; +} +else +{ +lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18; +x_14 = lean_array_uget(x_3, x_2); +x_15 = lean_unsigned_to_nat(0u); +x_16 = lean_array_uset(x_3, x_2, x_15); +x_17 = x_14; +x_18 = !lean_is_exclusive(x_17); +if (x_18 == 0) +{ +lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; +x_19 = lean_ctor_get(x_17, 0); +x_20 = lean_ctor_get(x_17, 1); +x_21 = lean_ctor_get(x_17, 2); +x_22 = lean_ctor_get(x_17, 3); +x_23 = lean_ctor_get(x_17, 4); +x_24 = lean_ctor_get(x_17, 5); +x_25 = lean_ctor_get(x_17, 6); +x_26 = lean_ctor_get(x_17, 7); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +x_27 = l_Lean_Meta_instantiateMVars(x_25, x_6, x_7, x_8, x_9, x_10); +if (lean_obj_tag(x_27) == 0) +{ +lean_object* x_28; lean_object* x_29; size_t x_30; size_t x_31; lean_object* x_32; lean_object* x_33; +x_28 = lean_ctor_get(x_27, 0); +lean_inc(x_28); +x_29 = lean_ctor_get(x_27, 1); +lean_inc(x_29); +lean_dec(x_27); +lean_ctor_set(x_17, 6, x_28); +x_30 = 1; +x_31 = x_2 + x_30; +x_32 = x_17; +x_33 = lean_array_uset(x_16, x_2, x_32); +x_2 = x_31; +x_3 = x_33; +x_10 = x_29; +goto _start; +} +else +{ +uint8_t x_35; +lean_free_object(x_17); +lean_dec(x_26); +lean_dec(x_24); +lean_dec(x_23); +lean_dec(x_22); +lean_dec(x_21); +lean_dec(x_20); +lean_dec(x_19); +lean_dec(x_16); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +x_35 = !lean_is_exclusive(x_27); +if (x_35 == 0) +{ +return x_27; +} +else +{ +lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_36 = lean_ctor_get(x_27, 0); +x_37 = lean_ctor_get(x_27, 1); +lean_inc(x_37); +lean_inc(x_36); +lean_dec(x_27); +x_38 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_38, 0, x_36); +lean_ctor_set(x_38, 1, x_37); +return x_38; +} +} +} +else +{ +lean_object* x_39; lean_object* x_40; uint8_t x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; +x_39 = lean_ctor_get(x_17, 0); +x_40 = lean_ctor_get(x_17, 1); +x_41 = lean_ctor_get_uint8(x_17, sizeof(void*)*8); +x_42 = lean_ctor_get(x_17, 2); +x_43 = lean_ctor_get(x_17, 3); +x_44 = lean_ctor_get(x_17, 4); +x_45 = lean_ctor_get(x_17, 5); +x_46 = lean_ctor_get(x_17, 6); +x_47 = lean_ctor_get(x_17, 7); +lean_inc(x_47); +lean_inc(x_46); +lean_inc(x_45); +lean_inc(x_44); +lean_inc(x_43); +lean_inc(x_42); +lean_inc(x_40); +lean_inc(x_39); +lean_dec(x_17); +lean_inc(x_9); +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +x_48 = l_Lean_Meta_instantiateMVars(x_46, x_6, x_7, x_8, x_9, x_10); +if (lean_obj_tag(x_48) == 0) +{ +lean_object* x_49; lean_object* x_50; lean_object* x_51; size_t x_52; size_t x_53; lean_object* x_54; lean_object* x_55; +x_49 = lean_ctor_get(x_48, 0); +lean_inc(x_49); +x_50 = lean_ctor_get(x_48, 1); +lean_inc(x_50); +lean_dec(x_48); +x_51 = lean_alloc_ctor(0, 8, 1); +lean_ctor_set(x_51, 0, x_39); +lean_ctor_set(x_51, 1, x_40); +lean_ctor_set(x_51, 2, x_42); +lean_ctor_set(x_51, 3, x_43); +lean_ctor_set(x_51, 4, x_44); +lean_ctor_set(x_51, 5, x_45); +lean_ctor_set(x_51, 6, x_49); +lean_ctor_set(x_51, 7, x_47); +lean_ctor_set_uint8(x_51, sizeof(void*)*8, x_41); +x_52 = 1; +x_53 = x_2 + x_52; +x_54 = x_51; +x_55 = lean_array_uset(x_16, x_2, x_54); +x_2 = x_53; +x_3 = x_55; +x_10 = x_50; +goto _start; +} +else +{ +lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; +lean_dec(x_47); +lean_dec(x_45); +lean_dec(x_44); +lean_dec(x_43); +lean_dec(x_42); +lean_dec(x_40); +lean_dec(x_39); +lean_dec(x_16); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +x_57 = lean_ctor_get(x_48, 0); +lean_inc(x_57); +x_58 = lean_ctor_get(x_48, 1); +lean_inc(x_58); +if (lean_is_exclusive(x_48)) { + lean_ctor_release(x_48, 0); + lean_ctor_release(x_48, 1); + x_59 = x_48; +} else { + lean_dec_ref(x_48); + x_59 = lean_box(0); +} +if (lean_is_scalar(x_59)) { + x_60 = lean_alloc_ctor(1, 2, 0); +} else { + x_60 = x_59; +} +lean_ctor_set(x_60, 0, x_57); +lean_ctor_set(x_60, 1, x_58); +return x_60; +} +} +} +} +} +static lean_object* _init_l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed__const__1() { +_start: +{ +size_t x_1; lean_object* x_2; +x_1 = 0; +x_2 = lean_box_usize(x_1); +return x_2; +} +} +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { +_start: +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; size_t 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_10 = lean_st_ref_get(x_8, x_9); +x_11 = lean_ctor_get(x_10, 1); +lean_inc(x_11); +lean_dec(x_10); +x_12 = lean_unsigned_to_nat(1u); +x_13 = lean_st_mk_ref(x_12, x_11); +x_14 = lean_ctor_get(x_13, 0); +lean_inc(x_14); +x_15 = lean_ctor_get(x_13, 1); +lean_inc(x_15); +lean_dec(x_13); +x_16 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders_process(x_1, x_2, x_14, x_3, x_4, x_5, x_6, x_7, x_8, x_15); +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 = lean_st_ref_get(x_8, x_18); +x_20 = lean_ctor_get(x_19, 1); +lean_inc(x_20); +lean_dec(x_19); +x_21 = lean_st_ref_get(x_14, x_20); +lean_dec(x_14); +x_22 = lean_ctor_get(x_21, 1); +lean_inc(x_22); +lean_dec(x_21); +x_23 = lean_array_get_size(x_17); +x_24 = lean_usize_of_nat(x_23); +lean_dec(x_23); +x_25 = x_17; +x_26 = lean_box_usize(x_24); +x_27 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed__const__1; +x_28 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___spec__1___boxed), 10, 3); +lean_closure_set(x_28, 0, x_26); +lean_closure_set(x_28, 1, x_27); +lean_closure_set(x_28, 2, x_25); +x_29 = x_28; +x_30 = lean_apply_7(x_29, x_3, x_4, x_5, x_6, x_7, x_8, x_22); +return x_30; +} +} +lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) { +_start: +{ +size_t x_11; size_t x_12; lean_object* x_13; +x_11 = lean_unbox_usize(x_1); +lean_dec(x_1); +x_12 = lean_unbox_usize(x_2); +lean_dec(x_2); +x_13 = l_Array_mapMUnsafe_map___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___spec__1(x_11, x_12, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10); +lean_dec(x_5); +lean_dec(x_4); +return x_13; +} +} +lean_object* l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { +_start: +{ +lean_object* x_10; +x_10 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); +lean_dec(x_1); +return x_10; +} +} lean_object* l_List_mapM___at_Lean_Elab_Term_elabMutualDef___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8) { _start: { @@ -17543,187 +18339,285 @@ return x_49; } } } -lean_object* l_Lean_Elab_Term_elabMutualDef___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14) { +lean_object* l_Lean_Elab_Term_elabMutualDef___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15) { _start: { -lean_object* x_15; +lean_object* x_16; +lean_inc(x_14); lean_inc(x_13); lean_inc(x_12); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); -lean_inc(x_8); -x_15 = l_Lean_Elab_Term_MutualClosure_main(x_7, x_1, x_2, x_3, x_4, x_8, x_9, x_10, x_11, x_12, x_13, x_14); -if (lean_obj_tag(x_15) == 0) +x_16 = l_Lean_Elab_Term_MutualClosure_main(x_8, x_1, x_2, x_3, x_4, x_9, x_10, x_11, x_12, x_13, x_14, x_15); +if (lean_obj_tag(x_16) == 0) { -lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_15, 0); -lean_inc(x_16); -x_17 = lean_ctor_get(x_15, 1); +lean_object* x_17; lean_object* x_18; lean_object* x_19; +x_17 = lean_ctor_get(x_16, 0); lean_inc(x_17); -lean_dec(x_15); +x_18 = lean_ctor_get(x_16, 1); +lean_inc(x_18); +lean_dec(x_16); +lean_inc(x_14); lean_inc(x_13); lean_inc(x_12); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); -lean_inc(x_8); -x_18 = l_Lean_Elab_levelMVarToParamPreDecls(x_16, x_8, x_9, x_10, x_11, x_12, x_13, x_17); -if (lean_obj_tag(x_18) == 0) +x_19 = l_Lean_Elab_levelMVarToParamPreDecls(x_17, x_9, x_10, x_11, x_12, x_13, x_14, x_18); +if (lean_obj_tag(x_19) == 0) { -lean_object* x_19; lean_object* x_20; lean_object* x_21; -x_19 = lean_ctor_get(x_18, 0); -lean_inc(x_19); -x_20 = lean_ctor_get(x_18, 1); +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_19, 0); lean_inc(x_20); -lean_dec(x_18); +x_21 = lean_ctor_get(x_19, 1); +lean_inc(x_21); +lean_dec(x_19); +lean_inc(x_14); lean_inc(x_13); lean_inc(x_12); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); -lean_inc(x_8); -x_21 = l_Lean_Elab_instantiateMVarsAtPreDecls(x_19, x_8, x_9, x_10, x_11, x_12, x_13, x_20); -if (lean_obj_tag(x_21) == 0) +x_22 = l_Lean_Elab_instantiateMVarsAtPreDecls(x_20, x_9, x_10, x_11, x_12, x_13, x_14, x_21); +if (lean_obj_tag(x_22) == 0) { -lean_object* x_22; lean_object* x_23; lean_object* x_24; -x_22 = lean_ctor_get(x_21, 0); -lean_inc(x_22); -x_23 = lean_ctor_get(x_21, 1); +lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_22, 0); lean_inc(x_23); -lean_dec(x_21); -lean_inc(x_8); -x_24 = l_Lean_Elab_fixLevelParams(x_22, x_5, x_6, x_8, x_9, x_10, x_11, x_12, x_13, x_23); -if (lean_obj_tag(x_24) == 0) +x_24 = lean_ctor_get(x_22, 1); +lean_inc(x_24); +lean_dec(x_22); +lean_inc(x_9); +x_25 = l_Lean_Elab_fixLevelParams(x_23, x_5, x_6, x_9, x_10, x_11, x_12, x_13, x_14, x_24); +if (lean_obj_tag(x_25) == 0) { -lean_object* x_25; lean_object* x_26; lean_object* x_27; -x_25 = lean_ctor_get(x_24, 0); -lean_inc(x_25); -x_26 = lean_ctor_get(x_24, 1); +lean_object* x_26; lean_object* x_27; uint8_t x_28; +x_26 = lean_ctor_get(x_25, 0); lean_inc(x_26); -lean_dec(x_24); -x_27 = l_Lean_Elab_addPreDefinitions(x_25, x_8, x_9, x_10, x_11, x_12, x_13, x_26); -return x_27; -} -else -{ -uint8_t x_28; -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -x_28 = !lean_is_exclusive(x_24); +x_27 = lean_ctor_get(x_25, 1); +lean_inc(x_27); +lean_dec(x_25); +x_28 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_isExample(x_7); if (x_28 == 0) { -return x_24; +lean_object* x_29; +x_29 = l_Lean_Elab_addPreDefinitions(x_26, x_9, x_10, x_11, x_12, x_13, x_14, x_27); +return x_29; } else { -lean_object* x_29; lean_object* x_30; lean_object* x_31; -x_29 = lean_ctor_get(x_24, 0); -x_30 = lean_ctor_get(x_24, 1); -lean_inc(x_30); -lean_inc(x_29); -lean_dec(x_24); -x_31 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_31, 0, x_29); -lean_ctor_set(x_31, 1, x_30); -return x_31; -} -} -} -else -{ -uint8_t x_32; -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_6); -lean_dec(x_5); -x_32 = !lean_is_exclusive(x_21); -if (x_32 == 0) -{ -return x_21; -} -else -{ -lean_object* x_33; lean_object* x_34; lean_object* x_35; -x_33 = lean_ctor_get(x_21, 0); -x_34 = lean_ctor_get(x_21, 1); -lean_inc(x_34); +lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; +x_30 = lean_st_ref_get(x_14, x_27); +x_31 = lean_ctor_get(x_30, 0); +lean_inc(x_31); +x_32 = lean_ctor_get(x_30, 1); +lean_inc(x_32); +lean_dec(x_30); +x_33 = lean_ctor_get(x_31, 0); lean_inc(x_33); -lean_dec(x_21); -x_35 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_35, 0, x_33); -lean_ctor_set(x_35, 1, x_34); -return x_35; -} -} -} -else +lean_dec(x_31); +lean_inc(x_14); +lean_inc(x_13); +lean_inc(x_12); +lean_inc(x_11); +lean_inc(x_10); +lean_inc(x_9); +x_34 = l_Lean_Elab_addPreDefinitions(x_26, x_9, x_10, x_11, x_12, x_13, x_14, x_32); +if (lean_obj_tag(x_34) == 0) { -uint8_t x_36; +lean_object* x_35; lean_object* x_36; lean_object* x_37; uint8_t x_38; +x_35 = lean_ctor_get(x_34, 0); +lean_inc(x_35); +x_36 = lean_ctor_get(x_34, 1); +lean_inc(x_36); +lean_dec(x_34); +x_37 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_33, x_9, x_10, x_11, x_12, x_13, x_14, x_36); +lean_dec(x_14); lean_dec(x_13); lean_dec(x_12); lean_dec(x_11); lean_dec(x_10); lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_6); -lean_dec(x_5); -x_36 = !lean_is_exclusive(x_18); -if (x_36 == 0) +x_38 = !lean_is_exclusive(x_37); +if (x_38 == 0) { -return x_18; +lean_object* x_39; +x_39 = lean_ctor_get(x_37, 0); +lean_dec(x_39); +lean_ctor_set(x_37, 0, x_35); +return x_37; } else { -lean_object* x_37; lean_object* x_38; lean_object* x_39; -x_37 = lean_ctor_get(x_18, 0); -x_38 = lean_ctor_get(x_18, 1); -lean_inc(x_38); -lean_inc(x_37); -lean_dec(x_18); -x_39 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_39, 0, x_37); -lean_ctor_set(x_39, 1, x_38); -return x_39; -} +lean_object* x_40; lean_object* x_41; +x_40 = lean_ctor_get(x_37, 1); +lean_inc(x_40); +lean_dec(x_37); +x_41 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_41, 0, x_35); +lean_ctor_set(x_41, 1, x_40); +return x_41; } } else { -uint8_t x_40; -lean_dec(x_13); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_6); -lean_dec(x_5); -x_40 = !lean_is_exclusive(x_15); -if (x_40 == 0) -{ -return x_15; -} -else -{ -lean_object* x_41; lean_object* x_42; lean_object* x_43; -x_41 = lean_ctor_get(x_15, 0); -x_42 = lean_ctor_get(x_15, 1); +lean_object* x_42; lean_object* x_43; lean_object* x_44; uint8_t x_45; +x_42 = lean_ctor_get(x_34, 0); lean_inc(x_42); -lean_inc(x_41); -lean_dec(x_15); -x_43 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_43, 0, x_41); -lean_ctor_set(x_43, 1, x_42); -return x_43; +x_43 = lean_ctor_get(x_34, 1); +lean_inc(x_43); +lean_dec(x_34); +x_44 = l_Lean_setEnv___at_Lean_Elab_Term_evalExpr___spec__1(x_33, x_9, x_10, x_11, x_12, x_13, x_14, x_43); +lean_dec(x_14); +lean_dec(x_13); +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +x_45 = !lean_is_exclusive(x_44); +if (x_45 == 0) +{ +lean_object* x_46; +x_46 = lean_ctor_get(x_44, 0); +lean_dec(x_46); +lean_ctor_set_tag(x_44, 1); +lean_ctor_set(x_44, 0, x_42); +return x_44; +} +else +{ +lean_object* x_47; lean_object* x_48; +x_47 = lean_ctor_get(x_44, 1); +lean_inc(x_47); +lean_dec(x_44); +x_48 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_48, 0, x_42); +lean_ctor_set(x_48, 1, x_47); +return x_48; +} +} +} +} +else +{ +uint8_t x_49; +lean_dec(x_14); +lean_dec(x_13); +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +x_49 = !lean_is_exclusive(x_25); +if (x_49 == 0) +{ +return x_25; +} +else +{ +lean_object* x_50; lean_object* x_51; lean_object* x_52; +x_50 = lean_ctor_get(x_25, 0); +x_51 = lean_ctor_get(x_25, 1); +lean_inc(x_51); +lean_inc(x_50); +lean_dec(x_25); +x_52 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_52, 0, x_50); +lean_ctor_set(x_52, 1, x_51); +return x_52; +} +} +} +else +{ +uint8_t x_53; +lean_dec(x_14); +lean_dec(x_13); +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_6); +lean_dec(x_5); +x_53 = !lean_is_exclusive(x_22); +if (x_53 == 0) +{ +return x_22; +} +else +{ +lean_object* x_54; lean_object* x_55; lean_object* x_56; +x_54 = lean_ctor_get(x_22, 0); +x_55 = lean_ctor_get(x_22, 1); +lean_inc(x_55); +lean_inc(x_54); +lean_dec(x_22); +x_56 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_56, 0, x_54); +lean_ctor_set(x_56, 1, x_55); +return x_56; +} +} +} +else +{ +uint8_t x_57; +lean_dec(x_14); +lean_dec(x_13); +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_6); +lean_dec(x_5); +x_57 = !lean_is_exclusive(x_19); +if (x_57 == 0) +{ +return x_19; +} +else +{ +lean_object* x_58; lean_object* x_59; lean_object* x_60; +x_58 = lean_ctor_get(x_19, 0); +x_59 = lean_ctor_get(x_19, 1); +lean_inc(x_59); +lean_inc(x_58); +lean_dec(x_19); +x_60 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_60, 0, x_58); +lean_ctor_set(x_60, 1, x_59); +return x_60; +} +} +} +else +{ +uint8_t x_61; +lean_dec(x_14); +lean_dec(x_13); +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_6); +lean_dec(x_5); +x_61 = !lean_is_exclusive(x_16); +if (x_61 == 0) +{ +return x_16; +} +else +{ +lean_object* x_62; lean_object* x_63; lean_object* x_64; +x_62 = lean_ctor_get(x_16, 0); +x_63 = lean_ctor_get(x_16, 1); +lean_inc(x_63); +lean_inc(x_62); +lean_dec(x_16); +x_64 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_64, 0, x_62); +lean_ctor_set(x_64, 1, x_63); +return x_64; } } } @@ -17768,157 +18662,115 @@ lean_inc(x_7); x_19 = l_Lean_Elab_Term_synthesizeSyntheticMVars_loop(x_17, x_18, x_7, x_8, x_9, x_10, x_11, x_12, x_16); if (lean_obj_tag(x_19) == 0) { -uint8_t x_20; -x_20 = !lean_is_exclusive(x_19); -if (x_20 == 0) -{ -lean_object* x_21; lean_object* x_22; uint8_t x_23; -x_21 = lean_ctor_get(x_19, 1); -x_22 = lean_ctor_get(x_19, 0); -lean_dec(x_22); -x_23 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_isExample(x_2); -if (x_23 == 0) -{ -lean_object* x_24; size_t x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; -lean_free_object(x_19); -x_24 = lean_array_get_size(x_15); -x_25 = lean_usize_of_nat(x_24); -lean_dec(x_24); -x_26 = x_15; -x_27 = lean_box_usize(x_25); -x_28 = l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1; -x_29 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Term_MutualClosure_main___spec__4___boxed), 10, 3); -lean_closure_set(x_29, 0, x_27); -lean_closure_set(x_29, 1, x_28); -lean_closure_set(x_29, 2, x_26); -x_30 = x_29; +lean_object* x_20; lean_object* x_21; size_t x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; +x_20 = lean_ctor_get(x_19, 1); +lean_inc(x_20); +lean_dec(x_19); +x_21 = lean_array_get_size(x_15); +x_22 = lean_usize_of_nat(x_21); +lean_dec(x_21); +x_23 = x_15; +x_24 = lean_box_usize(x_22); +x_25 = l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1; +x_26 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Term_MutualClosure_main___spec__4___boxed), 10, 3); +lean_closure_set(x_26, 0, x_24); +lean_closure_set(x_26, 1, x_25); +lean_closure_set(x_26, 2, x_23); +x_27 = x_26; lean_inc(x_12); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); lean_inc(x_8); lean_inc(x_7); -x_31 = lean_apply_7(x_30, x_7, x_8, x_9, x_10, x_11, x_12, x_21); -if (lean_obj_tag(x_31) == 0) +x_28 = lean_apply_7(x_27, x_7, x_8, x_9, x_10, x_11, x_12, x_20); +if (lean_obj_tag(x_28) == 0) { -lean_object* x_32; lean_object* x_33; lean_object* x_34; size_t x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; -x_32 = lean_ctor_get(x_31, 0); -lean_inc(x_32); -x_33 = lean_ctor_get(x_31, 1); -lean_inc(x_33); +lean_object* x_29; lean_object* x_30; lean_object* x_31; size_t x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_29 = lean_ctor_get(x_28, 0); +lean_inc(x_29); +x_30 = lean_ctor_get(x_28, 1); +lean_inc(x_30); +lean_dec(x_28); +x_31 = lean_array_get_size(x_1); +x_32 = lean_usize_of_nat(x_31); lean_dec(x_31); -x_34 = lean_array_get_size(x_1); -x_35 = lean_usize_of_nat(x_34); -lean_dec(x_34); -x_36 = x_1; -x_37 = lean_box_usize(x_35); -x_38 = l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1; -x_39 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Term_MutualClosure_main___spec__5___boxed), 10, 3); -lean_closure_set(x_39, 0, x_37); -lean_closure_set(x_39, 1, x_38); -lean_closure_set(x_39, 2, x_36); -x_40 = x_39; +x_33 = x_1; +x_34 = lean_box_usize(x_32); +x_35 = l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1; +x_36 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Term_MutualClosure_main___spec__5___boxed), 10, 3); +lean_closure_set(x_36, 0, x_34); +lean_closure_set(x_36, 1, x_35); +lean_closure_set(x_36, 2, x_33); +x_37 = x_36; lean_inc(x_12); lean_inc(x_11); lean_inc(x_10); lean_inc(x_9); lean_inc(x_8); lean_inc(x_7); -x_41 = lean_apply_7(x_40, x_7, x_8, x_9, x_10, x_11, x_12, x_33); -if (lean_obj_tag(x_41) == 0) +x_38 = lean_apply_7(x_37, x_7, x_8, x_9, x_10, x_11, x_12, x_30); +if (lean_obj_tag(x_38) == 0) { -lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; +lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; +x_39 = lean_ctor_get(x_38, 0); +lean_inc(x_39); +x_40 = lean_ctor_get(x_38, 1); +lean_inc(x_40); +lean_dec(x_38); +x_41 = l_Lean_Elab_Term_getLetRecsToLift___rarg(x_8, x_9, x_10, x_11, x_12, x_40); 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 = l_Lean_Elab_Term_getLetRecsToLift___rarg(x_8, x_9, x_10, x_11, x_12, x_43); +lean_inc(x_12); +lean_inc(x_11); +lean_inc(x_10); +lean_inc(x_9); +x_44 = l_List_mapM___at_Lean_Elab_Term_elabMutualDef___spec__1(x_42, x_7, x_8, x_9, x_10, x_11, x_12, x_43); +if (lean_obj_tag(x_44) == 0) +{ +lean_object* x_45; lean_object* x_46; lean_object* x_47; 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); -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -lean_inc(x_9); -x_47 = l_List_mapM___at_Lean_Elab_Term_elabMutualDef___spec__1(x_45, x_7, x_8, x_9, x_10, x_11, x_12, x_46); -if (lean_obj_tag(x_47) == 0) -{ -lean_object* x_48; lean_object* x_49; lean_object* x_50; -x_48 = lean_ctor_get(x_47, 0); -lean_inc(x_48); -x_49 = lean_ctor_get(x_47, 1); -lean_inc(x_49); -lean_dec(x_47); lean_inc(x_11); lean_inc(x_9); lean_inc(x_7); -lean_inc_n(x_48, 2); +lean_inc_n(x_45, 2); lean_inc(x_6); -x_50 = l_List_forM___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkLetRecsToLiftTypes___spec__2(x_6, x_48, x_48, x_7, x_8, x_9, x_10, x_11, x_12, x_49); -if (lean_obj_tag(x_50) == 0) +x_47 = l_List_forM___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkLetRecsToLiftTypes___spec__2(x_6, x_45, x_45, x_7, x_8, x_9, x_10, x_11, x_12, x_46); +if (lean_obj_tag(x_47) == 0) { -lean_object* x_51; lean_object* x_52; lean_object* x_53; -x_51 = lean_ctor_get(x_50, 1); -lean_inc(x_51); -lean_dec(x_50); +lean_object* x_48; lean_object* x_49; lean_object* x_50; +x_48 = lean_ctor_get(x_47, 1); lean_inc(x_48); -lean_inc(x_32); -lean_inc(x_42); -x_52 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabMutualDef___lambda__1), 14, 6); -lean_closure_set(x_52, 0, x_42); -lean_closure_set(x_52, 1, x_6); -lean_closure_set(x_52, 2, x_32); -lean_closure_set(x_52, 3, x_48); -lean_closure_set(x_52, 4, x_3); -lean_closure_set(x_52, 5, x_4); -x_53 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_withUsed___rarg(x_5, x_42, x_32, x_48, x_52, x_7, x_8, x_9, x_10, x_11, x_12, x_51); -lean_dec(x_32); -lean_dec(x_42); -return x_53; -} -else -{ -uint8_t x_54; -lean_dec(x_48); -lean_dec(x_42); -lean_dec(x_32); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -x_54 = !lean_is_exclusive(x_50); -if (x_54 == 0) -{ +lean_dec(x_47); +lean_inc(x_45); +lean_inc(x_29); +lean_inc(x_39); +x_49 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabMutualDef___lambda__1___boxed), 15, 7); +lean_closure_set(x_49, 0, x_39); +lean_closure_set(x_49, 1, x_6); +lean_closure_set(x_49, 2, x_29); +lean_closure_set(x_49, 3, x_45); +lean_closure_set(x_49, 4, x_2); +lean_closure_set(x_49, 5, x_3); +lean_closure_set(x_49, 6, x_4); +x_50 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_withUsed___rarg(x_5, x_39, x_29, x_45, x_49, x_7, x_8, x_9, x_10, x_11, x_12, x_48); +lean_dec(x_29); +lean_dec(x_39); return x_50; } else { -lean_object* x_55; lean_object* x_56; lean_object* x_57; -x_55 = lean_ctor_get(x_50, 0); -x_56 = lean_ctor_get(x_50, 1); -lean_inc(x_56); -lean_inc(x_55); -lean_dec(x_50); -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 -{ -uint8_t x_58; -lean_dec(x_42); -lean_dec(x_32); +uint8_t x_51; +lean_dec(x_45); +lean_dec(x_39); +lean_dec(x_29); lean_dec(x_12); lean_dec(x_11); lean_dec(x_10); @@ -17928,30 +18780,32 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_4); lean_dec(x_3); -x_58 = !lean_is_exclusive(x_47); -if (x_58 == 0) +lean_dec(x_2); +x_51 = !lean_is_exclusive(x_47); +if (x_51 == 0) { return x_47; } else { -lean_object* x_59; lean_object* x_60; lean_object* x_61; -x_59 = lean_ctor_get(x_47, 0); -x_60 = lean_ctor_get(x_47, 1); -lean_inc(x_60); -lean_inc(x_59); +lean_object* x_52; lean_object* x_53; lean_object* x_54; +x_52 = lean_ctor_get(x_47, 0); +x_53 = lean_ctor_get(x_47, 1); +lean_inc(x_53); +lean_inc(x_52); lean_dec(x_47); -x_61 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_61, 0, x_59); -lean_ctor_set(x_61, 1, x_60); -return x_61; +x_54 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_54, 0, x_52); +lean_ctor_set(x_54, 1, x_53); +return x_54; } } } else { -uint8_t x_62; -lean_dec(x_32); +uint8_t x_55; +lean_dec(x_39); +lean_dec(x_29); lean_dec(x_12); lean_dec(x_11); lean_dec(x_10); @@ -17961,29 +18815,99 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_4); lean_dec(x_3); -x_62 = !lean_is_exclusive(x_41); -if (x_62 == 0) +lean_dec(x_2); +x_55 = !lean_is_exclusive(x_44); +if (x_55 == 0) { -return x_41; +return x_44; } else { -lean_object* x_63; lean_object* x_64; lean_object* x_65; -x_63 = lean_ctor_get(x_41, 0); -x_64 = lean_ctor_get(x_41, 1); +lean_object* x_56; lean_object* x_57; lean_object* x_58; +x_56 = lean_ctor_get(x_44, 0); +x_57 = lean_ctor_get(x_44, 1); +lean_inc(x_57); +lean_inc(x_56); +lean_dec(x_44); +x_58 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_58, 0, x_56); +lean_ctor_set(x_58, 1, x_57); +return x_58; +} +} +} +else +{ +uint8_t x_59; +lean_dec(x_29); +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +x_59 = !lean_is_exclusive(x_38); +if (x_59 == 0) +{ +return x_38; +} +else +{ +lean_object* x_60; lean_object* x_61; lean_object* x_62; +x_60 = lean_ctor_get(x_38, 0); +x_61 = lean_ctor_get(x_38, 1); +lean_inc(x_61); +lean_inc(x_60); +lean_dec(x_38); +x_62 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_62, 0, x_60); +lean_ctor_set(x_62, 1, x_61); +return x_62; +} +} +} +else +{ +uint8_t x_63; +lean_dec(x_12); +lean_dec(x_11); +lean_dec(x_10); +lean_dec(x_9); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_63 = !lean_is_exclusive(x_28); +if (x_63 == 0) +{ +return x_28; +} +else +{ +lean_object* x_64; lean_object* x_65; lean_object* x_66; +x_64 = lean_ctor_get(x_28, 0); +x_65 = lean_ctor_get(x_28, 1); +lean_inc(x_65); lean_inc(x_64); -lean_inc(x_63); -lean_dec(x_41); -x_65 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_65, 0, x_63); -lean_ctor_set(x_65, 1, x_64); -return x_65; +lean_dec(x_28); +x_66 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_66, 0, x_64); +lean_ctor_set(x_66, 1, x_65); +return x_66; } } } else { -uint8_t x_66; +uint8_t x_67; +lean_dec(x_15); lean_dec(x_12); lean_dec(x_11); lean_dec(x_10); @@ -17993,30 +18917,31 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_4); lean_dec(x_3); +lean_dec(x_2); lean_dec(x_1); -x_66 = !lean_is_exclusive(x_31); -if (x_66 == 0) +x_67 = !lean_is_exclusive(x_19); +if (x_67 == 0) { -return x_31; +return x_19; } else { -lean_object* x_67; lean_object* x_68; lean_object* x_69; -x_67 = lean_ctor_get(x_31, 0); -x_68 = lean_ctor_get(x_31, 1); +lean_object* x_68; lean_object* x_69; lean_object* x_70; +x_68 = lean_ctor_get(x_19, 0); +x_69 = lean_ctor_get(x_19, 1); +lean_inc(x_69); lean_inc(x_68); -lean_inc(x_67); -lean_dec(x_31); -x_69 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_69, 0, x_67); -lean_ctor_set(x_69, 1, x_68); -return x_69; +lean_dec(x_19); +x_70 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_70, 0, x_68); +lean_ctor_set(x_70, 1, x_69); +return x_70; } } } else { -lean_dec(x_15); +uint8_t x_71; lean_dec(x_12); lean_dec(x_11); lean_dec(x_10); @@ -18026,347 +18951,25 @@ lean_dec(x_7); lean_dec(x_6); lean_dec(x_4); lean_dec(x_3); +lean_dec(x_2); lean_dec(x_1); -lean_ctor_set(x_19, 0, x_18); -return x_19; -} -} -else -{ -lean_object* x_70; uint8_t x_71; -x_70 = lean_ctor_get(x_19, 1); -lean_inc(x_70); -lean_dec(x_19); -x_71 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_isExample(x_2); +x_71 = !lean_is_exclusive(x_14); if (x_71 == 0) { -lean_object* x_72; size_t x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; lean_object* x_78; lean_object* x_79; -x_72 = lean_array_get_size(x_15); -x_73 = lean_usize_of_nat(x_72); -lean_dec(x_72); -x_74 = x_15; -x_75 = lean_box_usize(x_73); -x_76 = l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1; -x_77 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Term_MutualClosure_main___spec__4___boxed), 10, 3); -lean_closure_set(x_77, 0, x_75); -lean_closure_set(x_77, 1, x_76); -lean_closure_set(x_77, 2, x_74); -x_78 = x_77; -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -lean_inc(x_9); -lean_inc(x_8); -lean_inc(x_7); -x_79 = lean_apply_7(x_78, x_7, x_8, x_9, x_10, x_11, x_12, x_70); -if (lean_obj_tag(x_79) == 0) -{ -lean_object* x_80; lean_object* x_81; lean_object* x_82; size_t x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; -x_80 = lean_ctor_get(x_79, 0); -lean_inc(x_80); -x_81 = lean_ctor_get(x_79, 1); -lean_inc(x_81); -lean_dec(x_79); -x_82 = lean_array_get_size(x_1); -x_83 = lean_usize_of_nat(x_82); -lean_dec(x_82); -x_84 = x_1; -x_85 = lean_box_usize(x_83); -x_86 = l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1; -x_87 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at_Lean_Elab_Term_MutualClosure_main___spec__5___boxed), 10, 3); -lean_closure_set(x_87, 0, x_85); -lean_closure_set(x_87, 1, x_86); -lean_closure_set(x_87, 2, x_84); -x_88 = x_87; -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -lean_inc(x_9); -lean_inc(x_8); -lean_inc(x_7); -x_89 = lean_apply_7(x_88, x_7, x_8, x_9, x_10, x_11, x_12, x_81); -if (lean_obj_tag(x_89) == 0) -{ -lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; lean_object* x_95; -x_90 = lean_ctor_get(x_89, 0); -lean_inc(x_90); -x_91 = lean_ctor_get(x_89, 1); -lean_inc(x_91); -lean_dec(x_89); -x_92 = l_Lean_Elab_Term_getLetRecsToLift___rarg(x_8, x_9, x_10, x_11, x_12, x_91); -x_93 = lean_ctor_get(x_92, 0); -lean_inc(x_93); -x_94 = lean_ctor_get(x_92, 1); -lean_inc(x_94); -lean_dec(x_92); -lean_inc(x_12); -lean_inc(x_11); -lean_inc(x_10); -lean_inc(x_9); -x_95 = l_List_mapM___at_Lean_Elab_Term_elabMutualDef___spec__1(x_93, x_7, x_8, x_9, x_10, x_11, x_12, x_94); -if (lean_obj_tag(x_95) == 0) -{ -lean_object* x_96; lean_object* x_97; lean_object* x_98; -x_96 = lean_ctor_get(x_95, 0); -lean_inc(x_96); -x_97 = lean_ctor_get(x_95, 1); -lean_inc(x_97); -lean_dec(x_95); -lean_inc(x_11); -lean_inc(x_9); -lean_inc(x_7); -lean_inc_n(x_96, 2); -lean_inc(x_6); -x_98 = l_List_forM___at___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_checkLetRecsToLiftTypes___spec__2(x_6, x_96, x_96, x_7, x_8, x_9, x_10, x_11, x_12, x_97); -if (lean_obj_tag(x_98) == 0) -{ -lean_object* x_99; lean_object* x_100; lean_object* x_101; -x_99 = lean_ctor_get(x_98, 1); -lean_inc(x_99); -lean_dec(x_98); -lean_inc(x_96); -lean_inc(x_80); -lean_inc(x_90); -x_100 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabMutualDef___lambda__1), 14, 6); -lean_closure_set(x_100, 0, x_90); -lean_closure_set(x_100, 1, x_6); -lean_closure_set(x_100, 2, x_80); -lean_closure_set(x_100, 3, x_96); -lean_closure_set(x_100, 4, x_3); -lean_closure_set(x_100, 5, x_4); -x_101 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_withUsed___rarg(x_5, x_90, x_80, x_96, x_100, x_7, x_8, x_9, x_10, x_11, x_12, x_99); -lean_dec(x_80); -lean_dec(x_90); -return x_101; -} -else -{ -lean_object* x_102; lean_object* x_103; lean_object* x_104; lean_object* x_105; -lean_dec(x_96); -lean_dec(x_90); -lean_dec(x_80); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -x_102 = lean_ctor_get(x_98, 0); -lean_inc(x_102); -x_103 = lean_ctor_get(x_98, 1); -lean_inc(x_103); -if (lean_is_exclusive(x_98)) { - lean_ctor_release(x_98, 0); - lean_ctor_release(x_98, 1); - x_104 = x_98; -} else { - lean_dec_ref(x_98); - x_104 = lean_box(0); -} -if (lean_is_scalar(x_104)) { - x_105 = lean_alloc_ctor(1, 2, 0); -} else { - x_105 = x_104; -} -lean_ctor_set(x_105, 0, x_102); -lean_ctor_set(x_105, 1, x_103); -return x_105; -} -} -else -{ -lean_object* x_106; lean_object* x_107; lean_object* x_108; lean_object* x_109; -lean_dec(x_90); -lean_dec(x_80); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -x_106 = lean_ctor_get(x_95, 0); -lean_inc(x_106); -x_107 = lean_ctor_get(x_95, 1); -lean_inc(x_107); -if (lean_is_exclusive(x_95)) { - lean_ctor_release(x_95, 0); - lean_ctor_release(x_95, 1); - x_108 = x_95; -} else { - lean_dec_ref(x_95); - x_108 = lean_box(0); -} -if (lean_is_scalar(x_108)) { - x_109 = lean_alloc_ctor(1, 2, 0); -} else { - x_109 = x_108; -} -lean_ctor_set(x_109, 0, x_106); -lean_ctor_set(x_109, 1, x_107); -return x_109; -} -} -else -{ -lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; -lean_dec(x_80); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -x_110 = lean_ctor_get(x_89, 0); -lean_inc(x_110); -x_111 = lean_ctor_get(x_89, 1); -lean_inc(x_111); -if (lean_is_exclusive(x_89)) { - lean_ctor_release(x_89, 0); - lean_ctor_release(x_89, 1); - x_112 = x_89; -} else { - lean_dec_ref(x_89); - x_112 = lean_box(0); -} -if (lean_is_scalar(x_112)) { - x_113 = lean_alloc_ctor(1, 2, 0); -} else { - x_113 = x_112; -} -lean_ctor_set(x_113, 0, x_110); -lean_ctor_set(x_113, 1, x_111); -return x_113; -} -} -else -{ -lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_1); -x_114 = lean_ctor_get(x_79, 0); -lean_inc(x_114); -x_115 = lean_ctor_get(x_79, 1); -lean_inc(x_115); -if (lean_is_exclusive(x_79)) { - lean_ctor_release(x_79, 0); - lean_ctor_release(x_79, 1); - x_116 = x_79; -} else { - lean_dec_ref(x_79); - 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 -{ -lean_object* x_118; -lean_dec(x_15); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_1); -x_118 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_118, 0, x_18); -lean_ctor_set(x_118, 1, x_70); -return x_118; -} -} -} -else -{ -uint8_t x_119; -lean_dec(x_15); -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_1); -x_119 = !lean_is_exclusive(x_19); -if (x_119 == 0) -{ -return x_19; -} -else -{ -lean_object* x_120; lean_object* x_121; lean_object* x_122; -x_120 = lean_ctor_get(x_19, 0); -x_121 = lean_ctor_get(x_19, 1); -lean_inc(x_121); -lean_inc(x_120); -lean_dec(x_19); -x_122 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_122, 0, x_120); -lean_ctor_set(x_122, 1, x_121); -return x_122; -} -} -} -else -{ -uint8_t x_123; -lean_dec(x_12); -lean_dec(x_11); -lean_dec(x_10); -lean_dec(x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_1); -x_123 = !lean_is_exclusive(x_14); -if (x_123 == 0) -{ return x_14; } else { -lean_object* x_124; lean_object* x_125; lean_object* x_126; -x_124 = lean_ctor_get(x_14, 0); -x_125 = lean_ctor_get(x_14, 1); -lean_inc(x_125); -lean_inc(x_124); +lean_object* x_72; lean_object* x_73; lean_object* x_74; +x_72 = lean_ctor_get(x_14, 0); +x_73 = lean_ctor_get(x_14, 1); +lean_inc(x_73); +lean_inc(x_72); lean_dec(x_14); -x_126 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_126, 0, x_124); -lean_ctor_set(x_126, 1, x_125); -return x_126; +x_74 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_74, 0, x_72); +lean_ctor_set(x_74, 1, x_73); +return x_74; } } } @@ -18390,26 +18993,41 @@ lean_inc(x_3); x_13 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_elabHeaders(x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_12); if (lean_obj_tag(x_13) == 0) { -lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; +lean_object* x_14; lean_object* x_15; lean_object* x_16; x_14 = lean_ctor_get(x_13, 0); lean_inc(x_14); x_15 = lean_ctor_get(x_13, 1); lean_inc(x_15); lean_dec(x_13); -x_16 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_getAllUserLevelNames(x_14); -lean_inc(x_14); -x_17 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed), 13, 5); -lean_closure_set(x_17, 0, x_14); -lean_closure_set(x_17, 1, x_2); -lean_closure_set(x_17, 2, x_11); -lean_closure_set(x_17, 3, x_16); -lean_closure_set(x_17, 4, x_1); -x_18 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_withFunLocalDecls___rarg(x_14, x_17, x_3, x_4, x_5, x_6, x_7, x_8, x_15); -return x_18; +lean_inc(x_8); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_4); +lean_inc(x_3); +x_16 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders(x_2, x_14, x_3, x_4, x_5, x_6, x_7, x_8, x_15); +if (lean_obj_tag(x_16) == 0) +{ +lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; +x_17 = lean_ctor_get(x_16, 0); +lean_inc(x_17); +x_18 = lean_ctor_get(x_16, 1); +lean_inc(x_18); +lean_dec(x_16); +x_19 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_getAllUserLevelNames(x_17); +lean_inc(x_17); +x_20 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed), 13, 5); +lean_closure_set(x_20, 0, x_17); +lean_closure_set(x_20, 1, x_11); +lean_closure_set(x_20, 2, x_19); +lean_closure_set(x_20, 3, x_2); +lean_closure_set(x_20, 4, x_1); +x_21 = l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_withFunLocalDecls___rarg(x_17, x_20, x_3, x_4, x_5, x_6, x_7, x_8, x_18); +return x_21; } else { -uint8_t x_19; +uint8_t x_22; lean_dec(x_11); lean_dec(x_8); lean_dec(x_7); @@ -18419,23 +19037,55 @@ lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); lean_dec(x_1); -x_19 = !lean_is_exclusive(x_13); -if (x_19 == 0) +x_22 = !lean_is_exclusive(x_16); +if (x_22 == 0) +{ +return x_16; +} +else +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_16, 0); +x_24 = lean_ctor_get(x_16, 1); +lean_inc(x_24); +lean_inc(x_23); +lean_dec(x_16); +x_25 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_25, 0, x_23); +lean_ctor_set(x_25, 1, x_24); +return x_25; +} +} +} +else +{ +uint8_t x_26; +lean_dec(x_11); +lean_dec(x_8); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_3); +lean_dec(x_2); +lean_dec(x_1); +x_26 = !lean_is_exclusive(x_13); +if (x_26 == 0) { return x_13; } else { -lean_object* x_20; lean_object* x_21; lean_object* x_22; -x_20 = lean_ctor_get(x_13, 0); -x_21 = lean_ctor_get(x_13, 1); -lean_inc(x_21); -lean_inc(x_20); +lean_object* x_27; lean_object* x_28; lean_object* x_29; +x_27 = lean_ctor_get(x_13, 0); +x_28 = lean_ctor_get(x_13, 1); +lean_inc(x_28); +lean_inc(x_27); lean_dec(x_13); -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; +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; } } } @@ -18450,13 +19100,21 @@ lean_dec(x_2); return x_9; } } +lean_object* l_Lean_Elab_Term_elabMutualDef___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, lean_object* x_11, lean_object* x_12, lean_object* x_13, lean_object* x_14, lean_object* x_15) { +_start: +{ +lean_object* x_16; +x_16 = l_Lean_Elab_Term_elabMutualDef___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13, x_14, x_15); +lean_dec(x_7); +return x_16; +} +} lean_object* l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) { _start: { lean_object* x_14; x_14 = l_Lean_Elab_Term_elabMutualDef___lambda__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13); lean_dec(x_5); -lean_dec(x_2); return x_14; } } @@ -20278,6 +20936,8 @@ l_Lean_Elab_Term_MutualClosure_getModifiersForLetRecs___closed__3 = _init_l_Lean lean_mark_persistent(l_Lean_Elab_Term_MutualClosure_getModifiersForLetRecs___closed__3); l_Lean_Elab_Term_MutualClosure_main___boxed__const__1 = _init_l_Lean_Elab_Term_MutualClosure_main___boxed__const__1(); lean_mark_persistent(l_Lean_Elab_Term_MutualClosure_main___boxed__const__1); +l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed__const__1 = _init_l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed__const__1(); +lean_mark_persistent(l___private_Lean_Elab_MutualDef_0__Lean_Elab_Term_levelMVarToParamHeaders___boxed__const__1); l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1 = _init_l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1(); lean_mark_persistent(l_Lean_Elab_Term_elabMutualDef___lambda__2___boxed__const__1); l_Lean_Elab_Command_elabMutualDef___boxed__const__1 = _init_l_Lean_Elab_Command_elabMutualDef___boxed__const__1(); diff --git a/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c b/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c index 756e91eb67..e105534d62 100644 --- a/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c +++ b/stage0/stdlib/Lean/Elab/PreDefinition/Basic.c @@ -16,7 +16,6 @@ extern "C" { lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelParamsPreDecls_match__1(lean_object*); lean_object* lean_expr_update_forall(lean_object*, uint8_t, lean_object*, lean_object*); size_t l_USize_add(size_t, size_t); -extern lean_object* l_Lean_Name_getString_x21___closed__3; lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamPreDeclsAux___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_addAsAxiom(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_map___at_Lean_Meta_addInstance___spec__1(lean_object*); @@ -58,9 +57,8 @@ lean_object* l_Std_ShareCommonT_withShareCommon___at___private_Lean_Elab_PreDefi lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_addAndCompilePartialRec___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_instantiateMVarsAtPreDecls___spec__1(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompilePartialRec___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_state_sharecommon(lean_object*, lean_object*); -lean_object* l_Lean_Elab_Term_levelMVarToParam(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_levelMVarToParamPreDecls(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_addDecl___at_Lean_Elab_addAsAxiom___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_instInhabitedPreDefinition___closed__1; @@ -76,22 +74,17 @@ lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelPara lean_object* lean_st_mk_ref(lean_object*, lean_object*); lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelParamsPreDecls___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_addMacroStack___at_Lean_Elab_Term_instAddErrorMessageContextTermElabM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__2; lean_object* l_Lean_Elab_instInhabitedPreDefinition; lean_object* lean_array_to_list(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1; lean_object* l_Lean_CollectLevelParams_main(lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_getMaxHeight(lean_object*, lean_object*); lean_object* l_Lean_Elab_abstractNestedProofs(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_Util_0__mkPanicMessageWithDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_sortDeclLevelParams(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_throwKernelException___at_Lean_Elab_addAsAxiom___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_update_let(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Expr_Data_binderInfo(uint64_t); lean_object* l_Lean_Elab_fixLevelParams___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr_match__1(lean_object*); size_t lean_usize_of_nat(lean_object*); uint8_t l_Lean_Elab_DefKind_isTheorem(uint8_t); lean_object* l_Lean_Elab_addAndCompilePartialRec(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -100,10 +93,9 @@ lean_object* lean_expr_update_proj(lean_object*, lean_object*); lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_fixLevelParams___spec__2(lean_object*, lean_object*, size_t, lean_object*, lean_object*); lean_object* l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t l_USize_mod(size_t, size_t); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__3; +lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg(uint8_t, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Elab_Term_levelMVarToParam_x27(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___lambda__1___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_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t lean_ptr_addr(lean_object*); lean_object* l_Lean_Elab_fixLevelParams_match__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_fixLevelParams___spec__3(lean_object*, lean_object*, lean_object*, size_t, size_t, lean_object*); @@ -113,13 +105,11 @@ lean_object* l_Lean_Elab_addNonRec___boxed(lean_object*, lean_object*, lean_obje lean_object* l_Lean_Elab_addAsAxiom___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Elab_instInhabitedModifiers___closed__1; lean_object* l_Lean_Elab_addAndCompileUnsafe___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_panic_fn(lean_object*, lean_object*); extern lean_object* l_Lean_instInhabitedExpr___closed__1; lean_object* l_Lean_Elab_applyAttributesOf___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_throwError___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelParamsPreDecls___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_compileDecl___at_Lean_Elab_Term_evalExpr___spec__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_fixLevelParams_match__1(lean_object*); -lean_object* lean_st_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_addMessageContextFull___at_Lean_Meta_instAddMessageContextMetaM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_fixLevelParams___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_update_lambda(lean_object*, uint8_t, lean_object*, lean_object*); @@ -127,12 +117,10 @@ lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shareCommon_ lean_object* l_Lean_Expr_ReplaceImpl_replaceUnsafeM_visit___at_Lean_Elab_fixLevelParams___spec__1(lean_object*, lean_object*, size_t, lean_object*, lean_object*); uint8_t l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shouldGenCodeFor(lean_object*); lean_object* l_Lean_Meta_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -extern lean_object* l_Lean_instInhabitedDeclaration; lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_getLevelParamsPreDecls___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_addAndCompilePartialRec___spec__2(lean_object*, lean_object*, size_t, size_t, lean_object*); lean_object* l_Lean_Elab_instantiateMVarsAtPreDecls(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr_match__1___rarg(lean_object*, lean_object*); lean_object* l_Lean_Elab_addAndCompilePartialRec___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_mkOptionalNode___closed__2; lean_object* l_Lean_Elab_addAndCompilePartialRec___closed__1; @@ -496,94 +484,6 @@ lean_dec(x_4); return x_13; } } -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr_match__1___rarg(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; lean_object* x_4; lean_object* x_5; -x_3 = lean_ctor_get(x_1, 0); -lean_inc(x_3); -x_4 = lean_ctor_get(x_1, 1); -lean_inc(x_4); -lean_dec(x_1); -x_5 = lean_apply_2(x_2, x_3, x_4); -return x_5; -} -} -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr_match__1(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr_match__1___rarg), 2, 0); -return x_2; -} -} -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { -_start: -{ -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; uint8_t x_23; -x_10 = lean_st_ref_get(x_8, x_9); -x_11 = lean_ctor_get(x_10, 1); -lean_inc(x_11); -lean_dec(x_10); -x_12 = lean_st_ref_get(x_2, x_11); -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_Elab_Term_levelMVarToParam(x_1, x_13, x_3, x_4, x_5, x_6, x_7, x_8, x_14); -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 = lean_ctor_get(x_16, 0); -lean_inc(x_18); -x_19 = lean_ctor_get(x_16, 1); -lean_inc(x_19); -lean_dec(x_16); -x_20 = lean_st_ref_get(x_8, x_17); -x_21 = lean_ctor_get(x_20, 1); -lean_inc(x_21); -lean_dec(x_20); -x_22 = lean_st_ref_set(x_2, x_19, x_21); -x_23 = !lean_is_exclusive(x_22); -if (x_23 == 0) -{ -lean_object* x_24; -x_24 = lean_ctor_get(x_22, 0); -lean_dec(x_24); -lean_ctor_set(x_22, 0, x_18); -return x_22; -} -else -{ -lean_object* x_25; lean_object* x_26; -x_25 = lean_ctor_get(x_22, 1); -lean_inc(x_25); -lean_dec(x_22); -x_26 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_26, 0, x_18); -lean_ctor_set(x_26, 1, x_25); -return x_26; -} -} -} -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { -_start: -{ -lean_object* x_10; -x_10 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9); -lean_dec(x_8); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -lean_dec(x_2); -return x_10; -} -} lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamPreDeclsAux___spec__1(size_t x_1, size_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, lean_object* x_10, lean_object* x_11) { _start: { @@ -611,13 +511,13 @@ 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; size_t x_28; size_t x_29; lean_object* x_30; lean_object* x_31; x_20 = lean_ctor_get(x_18, 4); x_21 = lean_ctor_get(x_18, 5); -x_22 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr(x_20, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11); +x_22 = l_Lean_Elab_Term_levelMVarToParam_x27(x_20, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11); x_23 = lean_ctor_get(x_22, 0); lean_inc(x_23); x_24 = lean_ctor_get(x_22, 1); lean_inc(x_24); lean_dec(x_22); -x_25 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr(x_21, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_24); +x_25 = l_Lean_Elab_Term_levelMVarToParam_x27(x_21, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_24); x_26 = lean_ctor_get(x_25, 0); lean_inc(x_26); x_27 = lean_ctor_get(x_25, 1); @@ -651,13 +551,13 @@ lean_inc(x_36); lean_inc(x_35); lean_inc(x_33); lean_dec(x_18); -x_40 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr(x_38, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11); +x_40 = l_Lean_Elab_Term_levelMVarToParam_x27(x_38, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11); x_41 = lean_ctor_get(x_40, 0); lean_inc(x_41); x_42 = lean_ctor_get(x_40, 1); lean_inc(x_42); lean_dec(x_40); -x_43 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamExpr(x_39, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_42); +x_43 = l_Lean_Elab_Term_levelMVarToParam_x27(x_39, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_42); x_44 = lean_ctor_get(x_43, 0); lean_inc(x_44); x_45 = lean_ctor_get(x_43, 1); @@ -3550,25 +3450,25 @@ x_3 = lean_box(x_2); return x_3; } } -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg(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* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg(uint8_t x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { -switch (x_1) { -case 0: +lean_object* x_6; +x_6 = lean_box(x_1); +switch (lean_obj_tag(x_6)) { +case 1: { lean_object* x_7; lean_object* x_8; lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_2); x_7 = lean_box(0); -x_8 = lean_apply_1(x_6, x_7); +x_8 = lean_apply_1(x_2, x_7); return x_8; } -case 1: +case 3: { lean_object* x_9; lean_object* x_10; -lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_2); @@ -3576,38 +3476,26 @@ x_9 = lean_box(0); x_10 = lean_apply_1(x_3, x_9); return x_10; } -case 2: +case 4: { lean_object* x_11; lean_object* x_12; -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_3); -x_11 = lean_box(0); -x_12 = lean_apply_1(x_2, x_11); -return x_12; -} -case 3: -{ -lean_object* x_13; lean_object* x_14; -lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); lean_dec(x_2); -x_13 = lean_box(0); -x_14 = lean_apply_1(x_4, x_13); -return x_14; +x_11 = lean_box(0); +x_12 = lean_apply_1(x_4, x_11); +return x_12; } default: { -lean_object* x_15; lean_object* x_16; +lean_object* x_13; lean_object* x_14; lean_dec(x_6); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -x_15 = lean_box(0); -x_16 = lean_apply_1(x_5, x_15); -return x_16; +x_13 = lean_box(x_1); +x_14 = lean_apply_1(x_5, x_13); +return x_14; } } } @@ -3616,18 +3504,18 @@ lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux _start: { lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg___boxed), 6, 0); +x_2 = lean_alloc_closure((void*)(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg___boxed), 5, 0); return x_2; } } -lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: { -uint8_t x_7; lean_object* x_8; -x_7 = lean_unbox(x_1); +uint8_t x_6; lean_object* x_7; +x_6 = lean_unbox(x_1); lean_dec(x_1); -x_8 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg(x_7, x_2, x_3, x_4, x_5, x_6); -return x_8; +x_7 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux_match__1___rarg(x_6, x_2, x_3, x_4, x_5); +return x_7; } } lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) { @@ -3639,35 +3527,6 @@ x_11 = l_Lean_Elab_applyAttributesOf(x_1, x_10, x_3, x_4, x_5, x_6, x_7, x_8, x_ return x_11; } } -static lean_object* _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("Lean.Elab.PreDefinition.Basic"); -return x_1; -} -} -static lean_object* _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__2() { -_start: -{ -lean_object* x_1; -x_1 = lean_mk_string("_private.Lean.Elab.PreDefinition.Basic.0.Lean.Elab.addNonRecAux"); -return x_1; -} -} -static lean_object* _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__3() { -_start: -{ -lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; -x_1 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1; -x_2 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__2; -x_3 = lean_unsigned_to_nat(101u); -x_4 = lean_unsigned_to_nat(29u); -x_5 = l_Lean_Name_getString_x21___closed__3; -x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5); -return x_6; -} -} lean_object* l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux(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) { _start: { @@ -3690,7 +3549,7 @@ lean_inc(x_5); x_14 = l_Lean_Elab_abstractNestedProofs(x_1, x_5, x_6, x_7, x_8, x_9); if (lean_obj_tag(x_14) == 0) { -lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; uint8_t x_21; lean_object* x_22; +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_object* x_22; lean_object* x_53; x_15 = lean_ctor_get(x_14, 0); lean_inc(x_15); x_16 = lean_ctor_get(x_14, 1); @@ -3706,155 +3565,150 @@ x_20 = lean_ctor_get(x_18, 0); lean_inc(x_20); lean_dec(x_18); x_21 = lean_ctor_get_uint8(x_15, sizeof(void*)*6); -switch (x_21) { -case 0: -{ -lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; uint32_t x_59; uint32_t x_60; uint32_t x_61; lean_object* x_62; lean_object* x_63; uint8_t x_64; -x_53 = lean_ctor_get(x_15, 3); -lean_inc(x_53); -x_54 = lean_ctor_get(x_15, 1); -lean_inc(x_54); -x_55 = lean_ctor_get(x_15, 4); -lean_inc(x_55); -x_56 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_56, 0, x_53); -lean_ctor_set(x_56, 1, x_54); -lean_ctor_set(x_56, 2, x_55); -x_57 = lean_ctor_get(x_15, 5); -lean_inc(x_57); -lean_inc(x_57); -x_58 = l_Lean_getMaxHeight(x_20, x_57); -x_59 = lean_unbox_uint32(x_58); -lean_dec(x_58); -x_60 = 1; -x_61 = x_59 + x_60; -x_62 = lean_alloc_ctor(2, 0, 4); -lean_ctor_set_uint32(x_62, 0, x_61); -x_63 = lean_ctor_get(x_15, 2); -lean_inc(x_63); -x_64 = lean_ctor_get_uint8(x_63, sizeof(void*)*2 + 3); -lean_dec(x_63); -if (x_64 == 0) -{ -uint8_t x_65; lean_object* x_66; lean_object* x_67; -x_65 = 1; -x_66 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_66, 0, x_56); -lean_ctor_set(x_66, 1, x_57); -lean_ctor_set(x_66, 2, x_62); -lean_ctor_set_uint8(x_66, sizeof(void*)*3, x_65); -x_67 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_67, 0, x_66); -x_22 = x_67; -goto block_52; -} -else -{ -uint8_t x_68; lean_object* x_69; lean_object* x_70; -x_68 = 0; -x_69 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_69, 0, x_56); -lean_ctor_set(x_69, 1, x_57); -lean_ctor_set(x_69, 2, x_62); -lean_ctor_set_uint8(x_69, sizeof(void*)*3, x_68); -x_70 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_70, 0, x_69); -x_22 = x_70; -goto block_52; -} -} +x_53 = lean_box(x_21); +switch (lean_obj_tag(x_53)) { case 1: { -lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; lean_object* x_75; lean_object* x_76; lean_object* x_77; +lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_dec(x_20); -x_71 = lean_ctor_get(x_15, 3); -lean_inc(x_71); -x_72 = lean_ctor_get(x_15, 1); -lean_inc(x_72); -x_73 = lean_ctor_get(x_15, 4); -lean_inc(x_73); -x_74 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_74, 0, x_71); -lean_ctor_set(x_74, 1, x_72); -lean_ctor_set(x_74, 2, x_73); -x_75 = lean_ctor_get(x_15, 5); -lean_inc(x_75); -x_76 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_76, 0, x_74); -lean_ctor_set(x_76, 1, x_75); -x_77 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_77, 0, x_76); -x_22 = x_77; -goto block_52; -} -case 2: -{ -lean_object* x_78; lean_object* x_79; lean_object* x_80; -lean_dec(x_20); -x_78 = l_Lean_instInhabitedDeclaration; -x_79 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__3; -x_80 = lean_panic_fn(x_78, x_79); -x_22 = x_80; +x_54 = lean_ctor_get(x_15, 3); +lean_inc(x_54); +x_55 = lean_ctor_get(x_15, 1); +lean_inc(x_55); +x_56 = lean_ctor_get(x_15, 4); +lean_inc(x_56); +x_57 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_57, 0, x_54); +lean_ctor_set(x_57, 1, x_55); +lean_ctor_set(x_57, 2, x_56); +x_58 = lean_ctor_get(x_15, 5); +lean_inc(x_58); +x_59 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_59, 0, x_57); +lean_ctor_set(x_59, 1, x_58); +x_60 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_60, 0, x_59); +x_22 = x_60; goto block_52; } case 3: { -lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; lean_object* x_85; lean_object* x_86; uint8_t x_87; lean_object* x_88; lean_object* x_89; +lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; lean_object* x_65; lean_object* x_66; uint8_t x_67; lean_object* x_68; lean_object* x_69; lean_dec(x_20); -x_81 = lean_ctor_get(x_15, 3); -lean_inc(x_81); -x_82 = lean_ctor_get(x_15, 1); -lean_inc(x_82); -x_83 = lean_ctor_get(x_15, 4); -lean_inc(x_83); -x_84 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_84, 0, x_81); -lean_ctor_set(x_84, 1, x_82); -lean_ctor_set(x_84, 2, x_83); -x_85 = lean_ctor_get(x_15, 5); -lean_inc(x_85); -x_86 = lean_ctor_get(x_15, 2); -lean_inc(x_86); -x_87 = lean_ctor_get_uint8(x_86, sizeof(void*)*2 + 3); -lean_dec(x_86); -x_88 = lean_alloc_ctor(0, 2, 1); -lean_ctor_set(x_88, 0, x_84); -lean_ctor_set(x_88, 1, x_85); -lean_ctor_set_uint8(x_88, sizeof(void*)*2, x_87); -x_89 = lean_alloc_ctor(3, 1, 0); -lean_ctor_set(x_89, 0, x_88); -x_22 = x_89; +x_61 = lean_ctor_get(x_15, 3); +lean_inc(x_61); +x_62 = lean_ctor_get(x_15, 1); +lean_inc(x_62); +x_63 = lean_ctor_get(x_15, 4); +lean_inc(x_63); +x_64 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_64, 0, x_61); +lean_ctor_set(x_64, 1, x_62); +lean_ctor_set(x_64, 2, x_63); +x_65 = lean_ctor_get(x_15, 5); +lean_inc(x_65); +x_66 = lean_ctor_get(x_15, 2); +lean_inc(x_66); +x_67 = lean_ctor_get_uint8(x_66, sizeof(void*)*2 + 3); +lean_dec(x_66); +x_68 = lean_alloc_ctor(0, 2, 1); +lean_ctor_set(x_68, 0, x_64); +lean_ctor_set(x_68, 1, x_65); +lean_ctor_set_uint8(x_68, sizeof(void*)*2, x_67); +x_69 = lean_alloc_ctor(3, 1, 0); +lean_ctor_set(x_69, 0, x_68); +x_22 = x_69; goto block_52; } +case 4: +{ +lean_object* x_70; lean_object* x_71; lean_object* x_72; lean_object* x_73; lean_object* x_74; uint8_t x_75; +lean_dec(x_20); +x_70 = lean_ctor_get(x_15, 3); +lean_inc(x_70); +x_71 = lean_ctor_get(x_15, 1); +lean_inc(x_71); +x_72 = lean_ctor_get(x_15, 4); +lean_inc(x_72); +x_73 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_73, 0, x_70); +lean_ctor_set(x_73, 1, x_71); +lean_ctor_set(x_73, 2, x_72); +x_74 = lean_ctor_get(x_15, 2); +lean_inc(x_74); +x_75 = lean_ctor_get_uint8(x_74, sizeof(void*)*2 + 3); +lean_dec(x_74); +if (x_75 == 0) +{ +lean_object* x_76; lean_object* x_77; uint8_t x_78; lean_object* x_79; lean_object* x_80; +x_76 = lean_ctor_get(x_15, 5); +lean_inc(x_76); +x_77 = lean_box(1); +x_78 = 1; +x_79 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_79, 0, x_73); +lean_ctor_set(x_79, 1, x_76); +lean_ctor_set(x_79, 2, x_77); +lean_ctor_set_uint8(x_79, sizeof(void*)*3, x_78); +x_80 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_80, 0, x_79); +x_22 = x_80; +goto block_52; +} +else +{ +lean_object* x_81; lean_object* x_82; uint8_t x_83; lean_object* x_84; lean_object* x_85; +x_81 = lean_ctor_get(x_15, 5); +lean_inc(x_81); +x_82 = lean_box(1); +x_83 = 0; +x_84 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_84, 0, x_73); +lean_ctor_set(x_84, 1, x_81); +lean_ctor_set(x_84, 2, x_82); +lean_ctor_set_uint8(x_84, sizeof(void*)*3, x_83); +x_85 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_85, 0, x_84); +x_22 = x_85; +goto block_52; +} +} default: { -lean_object* x_90; lean_object* x_91; lean_object* x_92; lean_object* x_93; lean_object* x_94; uint8_t x_95; -lean_dec(x_20); -x_90 = lean_ctor_get(x_15, 3); +lean_object* x_86; lean_object* x_87; lean_object* x_88; lean_object* x_89; lean_object* x_90; lean_object* x_91; uint32_t x_92; uint32_t x_93; uint32_t x_94; lean_object* x_95; lean_object* x_96; uint8_t x_97; +lean_dec(x_53); +x_86 = lean_ctor_get(x_15, 3); +lean_inc(x_86); +x_87 = lean_ctor_get(x_15, 1); +lean_inc(x_87); +x_88 = lean_ctor_get(x_15, 4); +lean_inc(x_88); +x_89 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_89, 0, x_86); +lean_ctor_set(x_89, 1, x_87); +lean_ctor_set(x_89, 2, x_88); +x_90 = lean_ctor_get(x_15, 5); lean_inc(x_90); -x_91 = lean_ctor_get(x_15, 1); -lean_inc(x_91); -x_92 = lean_ctor_get(x_15, 4); -lean_inc(x_92); -x_93 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_93, 0, x_90); -lean_ctor_set(x_93, 1, x_91); -lean_ctor_set(x_93, 2, x_92); -x_94 = lean_ctor_get(x_15, 2); -lean_inc(x_94); -x_95 = lean_ctor_get_uint8(x_94, sizeof(void*)*2 + 3); -lean_dec(x_94); -if (x_95 == 0) -{ -lean_object* x_96; lean_object* x_97; uint8_t x_98; lean_object* x_99; lean_object* x_100; -x_96 = lean_ctor_get(x_15, 5); +lean_inc(x_90); +x_91 = l_Lean_getMaxHeight(x_20, x_90); +x_92 = lean_unbox_uint32(x_91); +lean_dec(x_91); +x_93 = 1; +x_94 = x_92 + x_93; +x_95 = lean_alloc_ctor(2, 0, 4); +lean_ctor_set_uint32(x_95, 0, x_94); +x_96 = lean_ctor_get(x_15, 2); lean_inc(x_96); -x_97 = lean_box(1); +x_97 = lean_ctor_get_uint8(x_96, sizeof(void*)*2 + 3); +lean_dec(x_96); +if (x_97 == 0) +{ +uint8_t x_98; lean_object* x_99; lean_object* x_100; x_98 = 1; x_99 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_99, 0, x_93); -lean_ctor_set(x_99, 1, x_96); -lean_ctor_set(x_99, 2, x_97); +lean_ctor_set(x_99, 0, x_89); +lean_ctor_set(x_99, 1, x_90); +lean_ctor_set(x_99, 2, x_95); lean_ctor_set_uint8(x_99, sizeof(void*)*3, x_98); x_100 = lean_alloc_ctor(1, 1, 0); lean_ctor_set(x_100, 0, x_99); @@ -3863,19 +3717,16 @@ goto block_52; } else { -lean_object* x_101; lean_object* x_102; uint8_t x_103; lean_object* x_104; lean_object* x_105; -x_101 = lean_ctor_get(x_15, 5); -lean_inc(x_101); -x_102 = lean_box(1); -x_103 = 0; -x_104 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_104, 0, x_93); -lean_ctor_set(x_104, 1, x_101); -lean_ctor_set(x_104, 2, x_102); -lean_ctor_set_uint8(x_104, sizeof(void*)*3, x_103); -x_105 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_105, 0, x_104); -x_22 = x_105; +uint8_t x_101; lean_object* x_102; lean_object* x_103; +x_101 = 0; +x_102 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_102, 0, x_89); +lean_ctor_set(x_102, 1, x_90); +lean_ctor_set(x_102, 2, x_95); +lean_ctor_set_uint8(x_102, sizeof(void*)*3, x_101); +x_103 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_103, 0, x_102); +x_22 = x_103; goto block_52; } } @@ -4050,463 +3901,455 @@ return x_51; } else { -uint8_t x_106; +uint8_t x_104; lean_dec(x_7); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_106 = !lean_is_exclusive(x_14); -if (x_106 == 0) +x_104 = !lean_is_exclusive(x_14); +if (x_104 == 0) { return x_14; } else { -lean_object* x_107; lean_object* x_108; lean_object* x_109; -x_107 = lean_ctor_get(x_14, 0); -x_108 = lean_ctor_get(x_14, 1); -lean_inc(x_108); -lean_inc(x_107); +lean_object* x_105; lean_object* x_106; lean_object* x_107; +x_105 = lean_ctor_get(x_14, 0); +x_106 = lean_ctor_get(x_14, 1); +lean_inc(x_106); +lean_inc(x_105); lean_dec(x_14); -x_109 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_109, 0, x_107); -lean_ctor_set(x_109, 1, x_108); -return x_109; +x_107 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_107, 0, x_105); +lean_ctor_set(x_107, 1, x_106); +return x_107; } } } else { -lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; lean_object* x_119; lean_object* x_120; -x_110 = lean_ctor_get(x_7, 0); -x_111 = lean_ctor_get(x_7, 1); -x_112 = lean_ctor_get(x_7, 2); -x_113 = lean_ctor_get(x_7, 3); -x_114 = lean_ctor_get(x_7, 4); -x_115 = lean_ctor_get(x_7, 5); -x_116 = lean_ctor_get(x_7, 6); -x_117 = lean_ctor_get(x_7, 7); -lean_inc(x_117); -lean_inc(x_116); +lean_object* x_108; lean_object* x_109; lean_object* x_110; lean_object* x_111; lean_object* x_112; lean_object* x_113; lean_object* x_114; lean_object* x_115; lean_object* x_116; lean_object* x_117; lean_object* x_118; +x_108 = lean_ctor_get(x_7, 0); +x_109 = lean_ctor_get(x_7, 1); +x_110 = lean_ctor_get(x_7, 2); +x_111 = lean_ctor_get(x_7, 3); +x_112 = lean_ctor_get(x_7, 4); +x_113 = lean_ctor_get(x_7, 5); +x_114 = lean_ctor_get(x_7, 6); +x_115 = lean_ctor_get(x_7, 7); lean_inc(x_115); lean_inc(x_114); lean_inc(x_113); lean_inc(x_112); lean_inc(x_111); lean_inc(x_110); +lean_inc(x_109); +lean_inc(x_108); lean_dec(x_7); -x_118 = l_Lean_replaceRef(x_10, x_113); -lean_dec(x_113); +x_116 = l_Lean_replaceRef(x_10, x_111); +lean_dec(x_111); lean_dec(x_10); -x_119 = lean_alloc_ctor(0, 8, 0); -lean_ctor_set(x_119, 0, x_110); -lean_ctor_set(x_119, 1, x_111); -lean_ctor_set(x_119, 2, x_112); -lean_ctor_set(x_119, 3, x_118); -lean_ctor_set(x_119, 4, x_114); -lean_ctor_set(x_119, 5, x_115); -lean_ctor_set(x_119, 6, x_116); -lean_ctor_set(x_119, 7, x_117); +x_117 = lean_alloc_ctor(0, 8, 0); +lean_ctor_set(x_117, 0, x_108); +lean_ctor_set(x_117, 1, x_109); +lean_ctor_set(x_117, 2, x_110); +lean_ctor_set(x_117, 3, x_116); +lean_ctor_set(x_117, 4, x_112); +lean_ctor_set(x_117, 5, x_113); +lean_ctor_set(x_117, 6, x_114); +lean_ctor_set(x_117, 7, x_115); lean_inc(x_8); -lean_inc(x_119); +lean_inc(x_117); lean_inc(x_6); lean_inc(x_5); -x_120 = l_Lean_Elab_abstractNestedProofs(x_1, x_5, x_6, x_119, x_8, x_9); -if (lean_obj_tag(x_120) == 0) +x_118 = l_Lean_Elab_abstractNestedProofs(x_1, x_5, x_6, x_117, x_8, x_9); +if (lean_obj_tag(x_118) == 0) { -lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; lean_object* x_125; lean_object* x_126; uint8_t x_127; lean_object* x_128; -x_121 = lean_ctor_get(x_120, 0); -lean_inc(x_121); -x_122 = lean_ctor_get(x_120, 1); +lean_object* x_119; lean_object* x_120; lean_object* x_121; lean_object* x_122; lean_object* x_123; lean_object* x_124; uint8_t x_125; lean_object* x_126; lean_object* x_157; +x_119 = lean_ctor_get(x_118, 0); +lean_inc(x_119); +x_120 = lean_ctor_get(x_118, 1); +lean_inc(x_120); +lean_dec(x_118); +x_121 = lean_st_ref_get(x_8, x_120); +x_122 = lean_ctor_get(x_121, 0); lean_inc(x_122); -lean_dec(x_120); -x_123 = lean_st_ref_get(x_8, x_122); -x_124 = lean_ctor_get(x_123, 0); +x_123 = lean_ctor_get(x_121, 1); +lean_inc(x_123); +lean_dec(x_121); +x_124 = lean_ctor_get(x_122, 0); lean_inc(x_124); -x_125 = lean_ctor_get(x_123, 1); -lean_inc(x_125); -lean_dec(x_123); -x_126 = lean_ctor_get(x_124, 0); -lean_inc(x_126); -lean_dec(x_124); -x_127 = lean_ctor_get_uint8(x_121, sizeof(void*)*6); -switch (x_127) { -case 0: -{ -lean_object* x_159; lean_object* x_160; lean_object* x_161; lean_object* x_162; lean_object* x_163; lean_object* x_164; uint32_t x_165; uint32_t x_166; uint32_t x_167; lean_object* x_168; lean_object* x_169; uint8_t x_170; -x_159 = lean_ctor_get(x_121, 3); -lean_inc(x_159); -x_160 = lean_ctor_get(x_121, 1); -lean_inc(x_160); -x_161 = lean_ctor_get(x_121, 4); -lean_inc(x_161); -x_162 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_162, 0, x_159); -lean_ctor_set(x_162, 1, x_160); -lean_ctor_set(x_162, 2, x_161); -x_163 = lean_ctor_get(x_121, 5); -lean_inc(x_163); -lean_inc(x_163); -x_164 = l_Lean_getMaxHeight(x_126, x_163); -x_165 = lean_unbox_uint32(x_164); -lean_dec(x_164); -x_166 = 1; -x_167 = x_165 + x_166; -x_168 = lean_alloc_ctor(2, 0, 4); -lean_ctor_set_uint32(x_168, 0, x_167); -x_169 = lean_ctor_get(x_121, 2); -lean_inc(x_169); -x_170 = lean_ctor_get_uint8(x_169, sizeof(void*)*2 + 3); -lean_dec(x_169); -if (x_170 == 0) -{ -uint8_t x_171; lean_object* x_172; lean_object* x_173; -x_171 = 1; -x_172 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_172, 0, x_162); -lean_ctor_set(x_172, 1, x_163); -lean_ctor_set(x_172, 2, x_168); -lean_ctor_set_uint8(x_172, sizeof(void*)*3, x_171); -x_173 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_173, 0, x_172); -x_128 = x_173; -goto block_158; -} -else -{ -uint8_t x_174; lean_object* x_175; lean_object* x_176; -x_174 = 0; -x_175 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_175, 0, x_162); -lean_ctor_set(x_175, 1, x_163); -lean_ctor_set(x_175, 2, x_168); -lean_ctor_set_uint8(x_175, sizeof(void*)*3, x_174); -x_176 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_176, 0, x_175); -x_128 = x_176; -goto block_158; -} -} +lean_dec(x_122); +x_125 = lean_ctor_get_uint8(x_119, sizeof(void*)*6); +x_157 = lean_box(x_125); +switch (lean_obj_tag(x_157)) { case 1: { -lean_object* x_177; lean_object* x_178; lean_object* x_179; lean_object* x_180; lean_object* x_181; lean_object* x_182; lean_object* x_183; -lean_dec(x_126); -x_177 = lean_ctor_get(x_121, 3); -lean_inc(x_177); -x_178 = lean_ctor_get(x_121, 1); -lean_inc(x_178); -x_179 = lean_ctor_get(x_121, 4); -lean_inc(x_179); -x_180 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_180, 0, x_177); -lean_ctor_set(x_180, 1, x_178); -lean_ctor_set(x_180, 2, x_179); -x_181 = lean_ctor_get(x_121, 5); -lean_inc(x_181); -x_182 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_182, 0, x_180); -lean_ctor_set(x_182, 1, x_181); -x_183 = lean_alloc_ctor(2, 1, 0); -lean_ctor_set(x_183, 0, x_182); -x_128 = x_183; -goto block_158; -} -case 2: -{ -lean_object* x_184; lean_object* x_185; lean_object* x_186; -lean_dec(x_126); -x_184 = l_Lean_instInhabitedDeclaration; -x_185 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__3; -x_186 = lean_panic_fn(x_184, x_185); -x_128 = x_186; -goto block_158; +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_dec(x_124); +x_158 = lean_ctor_get(x_119, 3); +lean_inc(x_158); +x_159 = lean_ctor_get(x_119, 1); +lean_inc(x_159); +x_160 = lean_ctor_get(x_119, 4); +lean_inc(x_160); +x_161 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_161, 0, x_158); +lean_ctor_set(x_161, 1, x_159); +lean_ctor_set(x_161, 2, x_160); +x_162 = lean_ctor_get(x_119, 5); +lean_inc(x_162); +x_163 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_163, 0, x_161); +lean_ctor_set(x_163, 1, x_162); +x_164 = lean_alloc_ctor(2, 1, 0); +lean_ctor_set(x_164, 0, x_163); +x_126 = x_164; +goto block_156; } case 3: { -lean_object* x_187; lean_object* x_188; lean_object* x_189; lean_object* x_190; lean_object* x_191; lean_object* x_192; uint8_t x_193; lean_object* x_194; lean_object* x_195; -lean_dec(x_126); -x_187 = lean_ctor_get(x_121, 3); -lean_inc(x_187); -x_188 = lean_ctor_get(x_121, 1); -lean_inc(x_188); -x_189 = lean_ctor_get(x_121, 4); -lean_inc(x_189); -x_190 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_190, 0, x_187); -lean_ctor_set(x_190, 1, x_188); -lean_ctor_set(x_190, 2, x_189); -x_191 = lean_ctor_get(x_121, 5); -lean_inc(x_191); -x_192 = lean_ctor_get(x_121, 2); -lean_inc(x_192); -x_193 = lean_ctor_get_uint8(x_192, sizeof(void*)*2 + 3); -lean_dec(x_192); -x_194 = lean_alloc_ctor(0, 2, 1); -lean_ctor_set(x_194, 0, x_190); -lean_ctor_set(x_194, 1, x_191); -lean_ctor_set_uint8(x_194, sizeof(void*)*2, x_193); -x_195 = lean_alloc_ctor(3, 1, 0); -lean_ctor_set(x_195, 0, x_194); -x_128 = x_195; -goto block_158; +lean_object* x_165; lean_object* x_166; lean_object* x_167; lean_object* x_168; lean_object* x_169; lean_object* x_170; uint8_t x_171; lean_object* x_172; lean_object* x_173; +lean_dec(x_124); +x_165 = lean_ctor_get(x_119, 3); +lean_inc(x_165); +x_166 = lean_ctor_get(x_119, 1); +lean_inc(x_166); +x_167 = lean_ctor_get(x_119, 4); +lean_inc(x_167); +x_168 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_168, 0, x_165); +lean_ctor_set(x_168, 1, x_166); +lean_ctor_set(x_168, 2, x_167); +x_169 = lean_ctor_get(x_119, 5); +lean_inc(x_169); +x_170 = lean_ctor_get(x_119, 2); +lean_inc(x_170); +x_171 = lean_ctor_get_uint8(x_170, sizeof(void*)*2 + 3); +lean_dec(x_170); +x_172 = lean_alloc_ctor(0, 2, 1); +lean_ctor_set(x_172, 0, x_168); +lean_ctor_set(x_172, 1, x_169); +lean_ctor_set_uint8(x_172, sizeof(void*)*2, x_171); +x_173 = lean_alloc_ctor(3, 1, 0); +lean_ctor_set(x_173, 0, x_172); +x_126 = x_173; +goto block_156; +} +case 4: +{ +lean_object* x_174; lean_object* x_175; lean_object* x_176; lean_object* x_177; lean_object* x_178; uint8_t x_179; +lean_dec(x_124); +x_174 = lean_ctor_get(x_119, 3); +lean_inc(x_174); +x_175 = lean_ctor_get(x_119, 1); +lean_inc(x_175); +x_176 = lean_ctor_get(x_119, 4); +lean_inc(x_176); +x_177 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_177, 0, x_174); +lean_ctor_set(x_177, 1, x_175); +lean_ctor_set(x_177, 2, x_176); +x_178 = lean_ctor_get(x_119, 2); +lean_inc(x_178); +x_179 = lean_ctor_get_uint8(x_178, sizeof(void*)*2 + 3); +lean_dec(x_178); +if (x_179 == 0) +{ +lean_object* x_180; lean_object* x_181; uint8_t x_182; lean_object* x_183; lean_object* x_184; +x_180 = lean_ctor_get(x_119, 5); +lean_inc(x_180); +x_181 = lean_box(1); +x_182 = 1; +x_183 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_183, 0, x_177); +lean_ctor_set(x_183, 1, x_180); +lean_ctor_set(x_183, 2, x_181); +lean_ctor_set_uint8(x_183, sizeof(void*)*3, x_182); +x_184 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_184, 0, x_183); +x_126 = x_184; +goto block_156; +} +else +{ +lean_object* x_185; lean_object* x_186; uint8_t x_187; lean_object* x_188; lean_object* x_189; +x_185 = lean_ctor_get(x_119, 5); +lean_inc(x_185); +x_186 = lean_box(1); +x_187 = 0; +x_188 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_188, 0, x_177); +lean_ctor_set(x_188, 1, x_185); +lean_ctor_set(x_188, 2, x_186); +lean_ctor_set_uint8(x_188, sizeof(void*)*3, x_187); +x_189 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_189, 0, x_188); +x_126 = x_189; +goto block_156; +} } default: { -lean_object* x_196; lean_object* x_197; lean_object* x_198; lean_object* x_199; lean_object* x_200; uint8_t x_201; -lean_dec(x_126); -x_196 = lean_ctor_get(x_121, 3); -lean_inc(x_196); -x_197 = lean_ctor_get(x_121, 1); -lean_inc(x_197); -x_198 = lean_ctor_get(x_121, 4); -lean_inc(x_198); -x_199 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_199, 0, x_196); -lean_ctor_set(x_199, 1, x_197); -lean_ctor_set(x_199, 2, x_198); -x_200 = lean_ctor_get(x_121, 2); +lean_object* x_190; lean_object* x_191; lean_object* x_192; lean_object* x_193; lean_object* x_194; lean_object* x_195; uint32_t x_196; uint32_t x_197; uint32_t x_198; lean_object* x_199; lean_object* x_200; uint8_t x_201; +lean_dec(x_157); +x_190 = lean_ctor_get(x_119, 3); +lean_inc(x_190); +x_191 = lean_ctor_get(x_119, 1); +lean_inc(x_191); +x_192 = lean_ctor_get(x_119, 4); +lean_inc(x_192); +x_193 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_193, 0, x_190); +lean_ctor_set(x_193, 1, x_191); +lean_ctor_set(x_193, 2, x_192); +x_194 = lean_ctor_get(x_119, 5); +lean_inc(x_194); +lean_inc(x_194); +x_195 = l_Lean_getMaxHeight(x_124, x_194); +x_196 = lean_unbox_uint32(x_195); +lean_dec(x_195); +x_197 = 1; +x_198 = x_196 + x_197; +x_199 = lean_alloc_ctor(2, 0, 4); +lean_ctor_set_uint32(x_199, 0, x_198); +x_200 = lean_ctor_get(x_119, 2); lean_inc(x_200); x_201 = lean_ctor_get_uint8(x_200, sizeof(void*)*2 + 3); lean_dec(x_200); if (x_201 == 0) { -lean_object* x_202; lean_object* x_203; uint8_t x_204; lean_object* x_205; lean_object* x_206; -x_202 = lean_ctor_get(x_121, 5); -lean_inc(x_202); -x_203 = lean_box(1); -x_204 = 1; -x_205 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_205, 0, x_199); -lean_ctor_set(x_205, 1, x_202); -lean_ctor_set(x_205, 2, x_203); -lean_ctor_set_uint8(x_205, sizeof(void*)*3, x_204); -x_206 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_206, 0, x_205); -x_128 = x_206; -goto block_158; +uint8_t x_202; lean_object* x_203; lean_object* x_204; +x_202 = 1; +x_203 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_203, 0, x_193); +lean_ctor_set(x_203, 1, x_194); +lean_ctor_set(x_203, 2, x_199); +lean_ctor_set_uint8(x_203, sizeof(void*)*3, x_202); +x_204 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_204, 0, x_203); +x_126 = x_204; +goto block_156; } else { -lean_object* x_207; lean_object* x_208; uint8_t x_209; lean_object* x_210; lean_object* x_211; -x_207 = lean_ctor_get(x_121, 5); -lean_inc(x_207); -x_208 = lean_box(1); -x_209 = 0; -x_210 = lean_alloc_ctor(0, 3, 1); -lean_ctor_set(x_210, 0, x_199); -lean_ctor_set(x_210, 1, x_207); -lean_ctor_set(x_210, 2, x_208); -lean_ctor_set_uint8(x_210, sizeof(void*)*3, x_209); -x_211 = lean_alloc_ctor(1, 1, 0); -lean_ctor_set(x_211, 0, x_210); -x_128 = x_211; -goto block_158; +uint8_t x_205; lean_object* x_206; lean_object* x_207; +x_205 = 0; +x_206 = lean_alloc_ctor(0, 3, 1); +lean_ctor_set(x_206, 0, x_193); +lean_ctor_set(x_206, 1, x_194); +lean_ctor_set(x_206, 2, x_199); +lean_ctor_set_uint8(x_206, sizeof(void*)*3, x_205); +x_207 = lean_alloc_ctor(1, 1, 0); +lean_ctor_set(x_207, 0, x_206); +x_126 = x_207; +goto block_156; } } } -block_158: +block_156: { -lean_object* x_129; -lean_inc(x_119); +lean_object* x_127; +lean_inc(x_117); lean_inc(x_3); -x_129 = l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(x_128, x_3, x_4, x_5, x_6, x_119, x_8, x_125); -if (lean_obj_tag(x_129) == 0) +x_127 = l_Lean_addDecl___at_Lean_Elab_Term_evalExpr___spec__3(x_126, x_3, x_4, x_5, x_6, x_117, x_8, x_123); +if (lean_obj_tag(x_127) == 0) { -lean_object* x_130; lean_object* x_131; lean_object* x_132; uint8_t x_133; lean_object* x_134; -x_130 = lean_ctor_get(x_129, 1); -lean_inc(x_130); -lean_dec(x_129); -x_131 = l_Lean_mkOptionalNode___closed__2; -lean_inc(x_121); -x_132 = lean_array_push(x_131, x_121); -x_133 = 0; +lean_object* x_128; lean_object* x_129; lean_object* x_130; uint8_t x_131; lean_object* x_132; +x_128 = lean_ctor_get(x_127, 1); +lean_inc(x_128); +lean_dec(x_127); +x_129 = l_Lean_mkOptionalNode___closed__2; +lean_inc(x_119); +x_130 = lean_array_push(x_129, x_119); +x_131 = 0; lean_inc(x_8); -lean_inc(x_119); +lean_inc(x_117); lean_inc(x_3); -x_134 = l_Lean_Elab_applyAttributesOf(x_132, x_133, x_3, x_4, x_5, x_6, x_119, x_8, x_130); -if (lean_obj_tag(x_134) == 0) +x_132 = l_Lean_Elab_applyAttributesOf(x_130, x_131, x_3, x_4, x_5, x_6, x_117, x_8, x_128); +if (lean_obj_tag(x_132) == 0) { if (x_2 == 0) { -lean_object* x_135; uint8_t x_136; lean_object* x_137; -lean_dec(x_128); -lean_dec(x_121); -x_135 = lean_ctor_get(x_134, 1); -lean_inc(x_135); -lean_dec(x_134); -x_136 = 1; -x_137 = l_Lean_Elab_applyAttributesOf(x_132, x_136, x_3, x_4, x_5, x_6, x_119, x_8, x_135); +lean_object* x_133; uint8_t x_134; lean_object* x_135; +lean_dec(x_126); +lean_dec(x_119); +x_133 = lean_ctor_get(x_132, 1); +lean_inc(x_133); +lean_dec(x_132); +x_134 = 1; +x_135 = l_Lean_Elab_applyAttributesOf(x_130, x_134, x_3, x_4, x_5, x_6, x_117, x_8, x_133); lean_dec(x_6); lean_dec(x_5); -lean_dec(x_132); -return x_137; +lean_dec(x_130); +return x_135; } else { -lean_object* x_138; uint8_t x_139; -x_138 = lean_ctor_get(x_134, 1); -lean_inc(x_138); -lean_dec(x_134); -x_139 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shouldGenCodeFor(x_121); -lean_dec(x_121); -if (x_139 == 0) +lean_object* x_136; uint8_t x_137; +x_136 = lean_ctor_get(x_132, 1); +lean_inc(x_136); +lean_dec(x_132); +x_137 = l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shouldGenCodeFor(x_119); +lean_dec(x_119); +if (x_137 == 0) { -uint8_t x_140; lean_object* x_141; -lean_dec(x_128); -x_140 = 1; -x_141 = l_Lean_Elab_applyAttributesOf(x_132, x_140, x_3, x_4, x_5, x_6, x_119, x_8, x_138); +uint8_t x_138; lean_object* x_139; +lean_dec(x_126); +x_138 = 1; +x_139 = l_Lean_Elab_applyAttributesOf(x_130, x_138, x_3, x_4, x_5, x_6, x_117, x_8, x_136); lean_dec(x_6); lean_dec(x_5); -lean_dec(x_132); -return x_141; +lean_dec(x_130); +return x_139; } else { -lean_object* x_142; -lean_inc(x_119); +lean_object* x_140; +lean_inc(x_117); lean_inc(x_3); -x_142 = l_Lean_compileDecl___at_Lean_Elab_Term_evalExpr___spec__7(x_128, x_3, x_4, x_5, x_6, x_119, x_8, x_138); -if (lean_obj_tag(x_142) == 0) +x_140 = l_Lean_compileDecl___at_Lean_Elab_Term_evalExpr___spec__7(x_126, x_3, x_4, x_5, x_6, x_117, x_8, x_136); +if (lean_obj_tag(x_140) == 0) { -lean_object* x_143; uint8_t x_144; lean_object* x_145; -x_143 = lean_ctor_get(x_142, 1); -lean_inc(x_143); -lean_dec(x_142); -x_144 = 1; -x_145 = l_Lean_Elab_applyAttributesOf(x_132, x_144, x_3, x_4, x_5, x_6, x_119, x_8, x_143); +lean_object* x_141; uint8_t x_142; lean_object* x_143; +x_141 = lean_ctor_get(x_140, 1); +lean_inc(x_141); +lean_dec(x_140); +x_142 = 1; +x_143 = l_Lean_Elab_applyAttributesOf(x_130, x_142, x_3, x_4, x_5, x_6, x_117, x_8, x_141); lean_dec(x_6); lean_dec(x_5); -lean_dec(x_132); -return x_145; +lean_dec(x_130); +return x_143; } else { -lean_object* x_146; lean_object* x_147; lean_object* x_148; lean_object* x_149; -lean_dec(x_132); -lean_dec(x_119); +lean_object* x_144; lean_object* x_145; lean_object* x_146; lean_object* x_147; +lean_dec(x_130); +lean_dec(x_117); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_146 = lean_ctor_get(x_142, 0); -lean_inc(x_146); -x_147 = lean_ctor_get(x_142, 1); -lean_inc(x_147); -if (lean_is_exclusive(x_142)) { - lean_ctor_release(x_142, 0); - lean_ctor_release(x_142, 1); - x_148 = x_142; +x_144 = lean_ctor_get(x_140, 0); +lean_inc(x_144); +x_145 = lean_ctor_get(x_140, 1); +lean_inc(x_145); +if (lean_is_exclusive(x_140)) { + lean_ctor_release(x_140, 0); + lean_ctor_release(x_140, 1); + x_146 = x_140; } else { - lean_dec_ref(x_142); - x_148 = lean_box(0); + lean_dec_ref(x_140); + x_146 = lean_box(0); } -if (lean_is_scalar(x_148)) { - x_149 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_146)) { + x_147 = lean_alloc_ctor(1, 2, 0); } else { - x_149 = x_148; + x_147 = x_146; } -lean_ctor_set(x_149, 0, x_146); -lean_ctor_set(x_149, 1, x_147); -return x_149; +lean_ctor_set(x_147, 0, x_144); +lean_ctor_set(x_147, 1, x_145); +return x_147; } } } } else { -lean_object* x_150; lean_object* x_151; lean_object* x_152; lean_object* x_153; -lean_dec(x_132); -lean_dec(x_128); -lean_dec(x_121); +lean_object* x_148; lean_object* x_149; lean_object* x_150; lean_object* x_151; +lean_dec(x_130); +lean_dec(x_126); lean_dec(x_119); +lean_dec(x_117); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_150 = lean_ctor_get(x_134, 0); -lean_inc(x_150); -x_151 = lean_ctor_get(x_134, 1); -lean_inc(x_151); -if (lean_is_exclusive(x_134)) { - lean_ctor_release(x_134, 0); - lean_ctor_release(x_134, 1); - x_152 = x_134; +x_148 = lean_ctor_get(x_132, 0); +lean_inc(x_148); +x_149 = lean_ctor_get(x_132, 1); +lean_inc(x_149); +if (lean_is_exclusive(x_132)) { + lean_ctor_release(x_132, 0); + lean_ctor_release(x_132, 1); + x_150 = x_132; } else { - lean_dec_ref(x_134); - x_152 = lean_box(0); + lean_dec_ref(x_132); + x_150 = lean_box(0); } -if (lean_is_scalar(x_152)) { - x_153 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_150)) { + x_151 = lean_alloc_ctor(1, 2, 0); } else { - x_153 = x_152; + x_151 = x_150; } -lean_ctor_set(x_153, 0, x_150); -lean_ctor_set(x_153, 1, x_151); -return x_153; +lean_ctor_set(x_151, 0, x_148); +lean_ctor_set(x_151, 1, x_149); +return x_151; } } else { -lean_object* x_154; lean_object* x_155; lean_object* x_156; lean_object* x_157; -lean_dec(x_128); -lean_dec(x_121); +lean_object* x_152; lean_object* x_153; lean_object* x_154; lean_object* x_155; +lean_dec(x_126); lean_dec(x_119); +lean_dec(x_117); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_154 = lean_ctor_get(x_129, 0); -lean_inc(x_154); -x_155 = lean_ctor_get(x_129, 1); -lean_inc(x_155); -if (lean_is_exclusive(x_129)) { - lean_ctor_release(x_129, 0); - lean_ctor_release(x_129, 1); - x_156 = x_129; +x_152 = lean_ctor_get(x_127, 0); +lean_inc(x_152); +x_153 = lean_ctor_get(x_127, 1); +lean_inc(x_153); +if (lean_is_exclusive(x_127)) { + lean_ctor_release(x_127, 0); + lean_ctor_release(x_127, 1); + x_154 = x_127; } else { - lean_dec_ref(x_129); - x_156 = lean_box(0); + lean_dec_ref(x_127); + x_154 = lean_box(0); } -if (lean_is_scalar(x_156)) { - x_157 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_154)) { + x_155 = lean_alloc_ctor(1, 2, 0); } else { - x_157 = x_156; + x_155 = x_154; } -lean_ctor_set(x_157, 0, x_154); -lean_ctor_set(x_157, 1, x_155); -return x_157; +lean_ctor_set(x_155, 0, x_152); +lean_ctor_set(x_155, 1, x_153); +return x_155; } } } else { -lean_object* x_212; lean_object* x_213; lean_object* x_214; lean_object* x_215; -lean_dec(x_119); +lean_object* x_208; lean_object* x_209; lean_object* x_210; lean_object* x_211; +lean_dec(x_117); lean_dec(x_8); lean_dec(x_6); lean_dec(x_5); lean_dec(x_3); -x_212 = lean_ctor_get(x_120, 0); -lean_inc(x_212); -x_213 = lean_ctor_get(x_120, 1); -lean_inc(x_213); -if (lean_is_exclusive(x_120)) { - lean_ctor_release(x_120, 0); - lean_ctor_release(x_120, 1); - x_214 = x_120; +x_208 = lean_ctor_get(x_118, 0); +lean_inc(x_208); +x_209 = lean_ctor_get(x_118, 1); +lean_inc(x_209); +if (lean_is_exclusive(x_118)) { + lean_ctor_release(x_118, 0); + lean_ctor_release(x_118, 1); + x_210 = x_118; } else { - lean_dec_ref(x_120); - x_214 = lean_box(0); + lean_dec_ref(x_118); + x_210 = lean_box(0); } -if (lean_is_scalar(x_214)) { - x_215 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_210)) { + x_211 = lean_alloc_ctor(1, 2, 0); } else { - x_215 = x_214; + x_211 = x_210; } -lean_ctor_set(x_215, 0, x_212); -lean_ctor_set(x_215, 1, x_213); -return x_215; +lean_ctor_set(x_211, 0, x_208); +lean_ctor_set(x_211, 1, x_209); +return x_211; } } } @@ -6020,12 +5863,6 @@ l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamPreDeclsA lean_mark_persistent(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_levelMVarToParamPreDeclsAux___boxed__const__1); l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shareCommon___boxed__const__1 = _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shareCommon___boxed__const__1(); lean_mark_persistent(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_shareCommon___boxed__const__1); -l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1 = _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1(); -lean_mark_persistent(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__1); -l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__2 = _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__2(); -lean_mark_persistent(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__2); -l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__3 = _init_l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__3(); -lean_mark_persistent(l___private_Lean_Elab_PreDefinition_Basic_0__Lean_Elab_addNonRecAux___closed__3); l_Lean_Elab_addAndCompilePartialRec___closed__1 = _init_l_Lean_Elab_addAndCompilePartialRec___closed__1(); lean_mark_persistent(l_Lean_Elab_addAndCompilePartialRec___closed__1); return lean_io_result_mk_ok(lean_box(0)); diff --git a/stage0/stdlib/Lean/Meta/SynthInstance.c b/stage0/stdlib/Lean/Meta/SynthInstance.c index 465b9a2954..f6be02335c 100644 --- a/stage0/stdlib/Lean/Meta/SynthInstance.c +++ b/stage0/stdlib/Lean/Meta/SynthInstance.c @@ -34,7 +34,6 @@ lean_object* l_Lean_Meta_SynthInstance_addAnswer(lean_object*, lean_object*, lea lean_object* l_Lean_Meta_SynthInstance_consume___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_newSubgoal___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs_match__1___rarg(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____closed__1; lean_object* l_Lean_Meta_SynthInstance_newSubgoal___lambda__3(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_HashMapImp_find_x3f___at_Lean_Meta_SynthInstance_findEntry_x3f___spec__1(lean_object*, lean_object*); lean_object* l_Lean_registerTraceClass(lean_object*, lean_object*); @@ -43,7 +42,7 @@ lean_object* l_Lean_Meta_SynthInstance_resume_match__1___rarg(lean_object*, lean lean_object* l_Lean_stringToMessageData(lean_object*); lean_object* l_Lean_Meta_SynthInstance_getTop(lean_object*); lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1___rarg(lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1___rarg(lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_MkTableKey_normLevel(lean_object*, lean_object*, lean_object*); lean_object* l_Std_fmt___at_Lean_Position_instToFormatPosition___spec__1(lean_object*); lean_object* l_Lean_Meta_SynthInstance_mkTableKeyFor___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -63,6 +62,7 @@ uint8_t l_Lean_Meta_SynthInstance_isNewAnswer___lambda__1(lean_object*, lean_obj lean_object* l_Lean_Meta_SynthInstance_tryAnswer___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_MkTableKey_State_emap___default; extern lean_object* l_Lean_Expr_instHashableExpr___closed__1; +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1; lean_object* lean_expr_update_mdata(lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_addAnswer___closed__1; lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -285,7 +285,6 @@ lean_object* l_Lean_Meta_SynthInstance_MkTableKey_normExpr_match__1(lean_object* lean_object* l_Array_back___at_Lean_Meta_SynthInstance_getNextToResume___spec__1___closed__1; lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_SynthInstance_getSubgoalsAux_match__1(lean_object*); lean_object* lean_array_to_list(lean_object*, lean_object*); -lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Util_Trace_0__Lean_getResetTraces___at_Lean_Meta_SynthInstance_tryResolve___spec__1___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_getNextToResume___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_initFn____x40_Lean_Meta_SynthInstance___hyg_69____closed__4; @@ -337,10 +336,11 @@ lean_object* l_Lean_Meta_synthInstance_x3f___lambda__2___closed__8; lean_object* l___private_Lean_Util_Trace_0__Lean_getResetTraces___at_Lean_Meta_SynthInstance_tryResolve___spec__1___rarg(lean_object*, lean_object*); size_t lean_usize_of_nat(lean_object*); lean_object* l_Std_AssocList_find_x3f___at_Lean_Meta_SynthInstance_findEntry_x3f___spec__2___boxed(lean_object*, lean_object*); +lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4_(lean_object*); lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_32_(lean_object*); -lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4716_(lean_object*); -lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701_(lean_object*); +lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785_(lean_object*); +lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4800_(lean_object*); lean_object* l_Lean_Meta_SynthInstance_MkTableKey_State_lmap___default___closed__1; lean_object* l_Lean_Meta_SynthInstance_getNextToResume___boxed(lean_object*); lean_object* l_Lean_Meta_SynthInstance_MkTableKey_normExpr_match__2(lean_object*); @@ -378,9 +378,11 @@ lean_object* l_Lean_Core_checkMaxHeartbeatsCore(lean_object*, lean_object*, lean lean_object* lean_level_update_imax(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_synthInstance(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_consume_match__1___rarg(lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels_match__1___rarg(lean_object*, lean_object*); lean_object* l_Std_PersistentArray_push___rarg(lean_object*, lean_object*); lean_object* l_Std_AssocList_foldlM___at_Lean_Meta_SynthInstance_MkTableKey_normLevel___spec__7(lean_object*, lean_object*); lean_object* l_Lean_Meta_synthInstance_x3f___lambda__4___closed__3; +lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____closed__1; lean_object* l_Lean_Meta_SynthInstance_getInstances___lambda__2___closed__6; lean_object* l_Lean_Meta_SynthInstance_State_tableEntries___default; lean_object* l_Lean_Meta_trySynthInstance(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -477,6 +479,8 @@ lean_object* l_Std_HashMapImp_moveEntries___at_Lean_Meta_SynthInstance_MkTableKe lean_object* l_Array_back___at_Lean_Meta_SynthInstance_getNextToResume___spec__1(lean_object*); lean_object* l_Lean_Meta_SynthInstance_generate___closed__2; lean_object* l_Lean_Meta_getMVarDecl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__2(lean_object*); +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__2___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_profileitIOUnsafe___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_generate___closed__1; lean_object* l_Lean_Meta_instantiateMVars(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -510,6 +514,7 @@ lean_object* l_Lean_Meta_synthInstance_x3f___lambda__1(lean_object*, lean_object lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_SynthInstance_mkAnswer___lambda__4___closed__1; lean_object* l_Lean_Meta_SynthInstance_synth___closed__2; lean_object* l_Lean_Meta_SynthInstance_consume(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels_match__1(lean_object*); lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*); lean_object* l_Array_modify___at_Lean_Meta_synthInstance_x3f___spec__8___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_getInstances___lambda__2___closed__7; @@ -15509,6 +15514,27 @@ x_8 = l_Lean_Meta_forallTelescopeReducing___at_Lean_Meta_getParamNames___spec__4 return x_8; } } +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels_match__1___rarg(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_3 = lean_ctor_get(x_1, 0); +lean_inc(x_3); +x_4 = lean_ctor_get(x_1, 1); +lean_inc(x_4); +lean_dec(x_1); +x_5 = lean_apply_2(x_2, x_3, x_4); +return x_5; +} +} +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels_match__1(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels_match__1___rarg), 2, 0); +return x_2; +} +} lean_object* l_List_forIn_loop___at___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) { _start: { @@ -15526,197 +15552,215 @@ return x_8; } else { -uint8_t x_9; -x_9 = !lean_is_exclusive(x_1); -if (x_9 == 0) +lean_object* x_9; lean_object* x_10; uint8_t x_11; +x_9 = lean_ctor_get(x_1, 0); +lean_inc(x_9); +x_10 = lean_ctor_get(x_1, 1); +lean_inc(x_10); +lean_dec(x_1); +x_11 = !lean_is_exclusive(x_2); +if (x_11 == 0) { -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_10 = lean_ctor_get(x_1, 0); -x_11 = lean_ctor_get(x_1, 1); -x_12 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__1; -x_13 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__2; -x_14 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__3; -x_15 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__4; -x_16 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__5; -x_17 = l_Lean_MetavarContext_instantiateLevelMVars_match__2___rarg(x_10, x_12, x_13, x_14, x_15, x_16); +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; +x_12 = lean_ctor_get(x_2, 0); +x_13 = lean_ctor_get(x_2, 1); +x_14 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__1; +x_15 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__2; +x_16 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__3; +x_17 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__4; +x_18 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__5; +x_19 = l_Lean_MetavarContext_instantiateLevelMVars_match__2___rarg(x_9, x_14, x_15, x_16, x_17, x_18); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); lean_inc(x_3); -x_18 = lean_apply_5(x_17, x_3, x_4, x_5, x_6, x_7); -if (lean_obj_tag(x_18) == 0) +x_20 = lean_apply_5(x_19, x_3, x_4, x_5, x_6, x_7); +if (lean_obj_tag(x_20) == 0) { -lean_object* x_19; lean_object* x_20; uint8_t x_21; -x_19 = lean_ctor_get(x_18, 0); -lean_inc(x_19); -x_20 = lean_ctor_get(x_18, 1); -lean_inc(x_20); -lean_dec(x_18); -x_21 = l_Lean_Level_hasMVar(x_19); -if (x_21 == 0) +lean_object* x_21; lean_object* x_22; uint8_t x_23; +x_21 = lean_ctor_get(x_20, 0); +lean_inc(x_21); +x_22 = lean_ctor_get(x_20, 1); +lean_inc(x_22); +lean_dec(x_20); +x_23 = l_Lean_Level_hasMVar(x_21); +if (x_23 == 0) { -lean_ctor_set(x_1, 1, x_2); -lean_ctor_set(x_1, 0, x_19); -{ -lean_object* _tmp_0 = x_11; -lean_object* _tmp_1 = x_1; -lean_object* _tmp_6 = x_20; -x_1 = _tmp_0; -x_2 = _tmp_1; -x_7 = _tmp_6; -} +lean_object* x_24; +x_24 = lean_array_push(x_12, x_21); +lean_ctor_set(x_2, 0, x_24); +x_1 = x_10; +x_7 = x_22; goto _start; } else { -lean_object* x_23; lean_object* x_24; lean_object* x_25; -lean_dec(x_19); -x_23 = l_Lean_Meta_mkFreshLevelMVar___rarg(x_4, x_5, x_6, x_20); -x_24 = lean_ctor_get(x_23, 0); -lean_inc(x_24); -x_25 = lean_ctor_get(x_23, 1); -lean_inc(x_25); -lean_dec(x_23); -lean_ctor_set(x_1, 1, x_2); -lean_ctor_set(x_1, 0, x_24); -{ -lean_object* _tmp_0 = x_11; -lean_object* _tmp_1 = x_1; -lean_object* _tmp_6 = x_25; -x_1 = _tmp_0; -x_2 = _tmp_1; -x_7 = _tmp_6; -} +lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; uint8_t x_30; lean_object* x_31; +lean_dec(x_21); +lean_dec(x_13); +x_26 = l_Lean_Meta_mkFreshLevelMVar___rarg(x_4, x_5, x_6, x_22); +x_27 = lean_ctor_get(x_26, 0); +lean_inc(x_27); +x_28 = lean_ctor_get(x_26, 1); +lean_inc(x_28); +lean_dec(x_26); +x_29 = lean_array_push(x_12, x_27); +x_30 = 1; +x_31 = lean_box(x_30); +lean_ctor_set(x_2, 1, x_31); +lean_ctor_set(x_2, 0, x_29); +x_1 = x_10; +x_7 = x_28; goto _start; } } else { -uint8_t x_27; -lean_free_object(x_1); -lean_dec(x_11); +uint8_t x_33; +lean_free_object(x_2); +lean_dec(x_13); +lean_dec(x_12); +lean_dec(x_10); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); +x_33 = !lean_is_exclusive(x_20); +if (x_33 == 0) +{ +return x_20; +} +else +{ +lean_object* x_34; lean_object* x_35; lean_object* x_36; +x_34 = lean_ctor_get(x_20, 0); +x_35 = lean_ctor_get(x_20, 1); +lean_inc(x_35); +lean_inc(x_34); +lean_dec(x_20); +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_37; lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; +x_37 = lean_ctor_get(x_2, 0); +x_38 = lean_ctor_get(x_2, 1); +lean_inc(x_38); +lean_inc(x_37); lean_dec(x_2); -x_27 = !lean_is_exclusive(x_18); -if (x_27 == 0) -{ -return x_18; -} -else -{ -lean_object* x_28; lean_object* x_29; lean_object* x_30; -x_28 = lean_ctor_get(x_18, 0); -x_29 = lean_ctor_get(x_18, 1); -lean_inc(x_29); -lean_inc(x_28); -lean_dec(x_18); -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_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; -x_31 = lean_ctor_get(x_1, 0); -x_32 = lean_ctor_get(x_1, 1); -lean_inc(x_32); -lean_inc(x_31); -lean_dec(x_1); -x_33 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__1; -x_34 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__2; -x_35 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__3; -x_36 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__4; -x_37 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__5; -x_38 = l_Lean_MetavarContext_instantiateLevelMVars_match__2___rarg(x_31, x_33, x_34, x_35, x_36, x_37); +x_39 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__1; +x_40 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__2; +x_41 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__3; +x_42 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__4; +x_43 = l_Lean_MetavarContext_instantiateLevelMVars___at_Lean_Meta_instantiateLevelMVars___spec__1___closed__5; +x_44 = l_Lean_MetavarContext_instantiateLevelMVars_match__2___rarg(x_9, x_39, x_40, x_41, x_42, x_43); lean_inc(x_6); lean_inc(x_5); lean_inc(x_4); lean_inc(x_3); -x_39 = lean_apply_5(x_38, x_3, x_4, x_5, x_6, x_7); -if (lean_obj_tag(x_39) == 0) +x_45 = lean_apply_5(x_44, x_3, x_4, x_5, x_6, x_7); +if (lean_obj_tag(x_45) == 0) { -lean_object* x_40; lean_object* x_41; uint8_t x_42; -x_40 = lean_ctor_get(x_39, 0); -lean_inc(x_40); -x_41 = lean_ctor_get(x_39, 1); -lean_inc(x_41); -lean_dec(x_39); -x_42 = l_Lean_Level_hasMVar(x_40); -if (x_42 == 0) -{ -lean_object* x_43; -x_43 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_43, 0, x_40); -lean_ctor_set(x_43, 1, x_2); -x_1 = x_32; -x_2 = x_43; -x_7 = x_41; -goto _start; -} -else -{ -lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; -lean_dec(x_40); -x_45 = l_Lean_Meta_mkFreshLevelMVar___rarg(x_4, x_5, x_6, x_41); +lean_object* x_46; lean_object* x_47; uint8_t x_48; x_46 = lean_ctor_get(x_45, 0); lean_inc(x_46); x_47 = lean_ctor_get(x_45, 1); lean_inc(x_47); lean_dec(x_45); -x_48 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_48, 0, x_46); -lean_ctor_set(x_48, 1, x_2); -x_1 = x_32; -x_2 = x_48; +x_48 = l_Lean_Level_hasMVar(x_46); +if (x_48 == 0) +{ +lean_object* x_49; lean_object* x_50; +x_49 = lean_array_push(x_37, x_46); +x_50 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_50, 0, x_49); +lean_ctor_set(x_50, 1, x_38); +x_1 = x_10; +x_2 = x_50; x_7 = x_47; goto _start; } +else +{ +lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; uint8_t x_56; lean_object* x_57; lean_object* x_58; +lean_dec(x_46); +lean_dec(x_38); +x_52 = l_Lean_Meta_mkFreshLevelMVar___rarg(x_4, x_5, x_6, x_47); +x_53 = lean_ctor_get(x_52, 0); +lean_inc(x_53); +x_54 = lean_ctor_get(x_52, 1); +lean_inc(x_54); +lean_dec(x_52); +x_55 = lean_array_push(x_37, x_53); +x_56 = 1; +x_57 = lean_box(x_56); +x_58 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_58, 0, x_55); +lean_ctor_set(x_58, 1, x_57); +x_1 = x_10; +x_2 = x_58; +x_7 = x_54; +goto _start; +} } else { -lean_object* x_50; lean_object* x_51; lean_object* x_52; lean_object* x_53; -lean_dec(x_32); +lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; +lean_dec(x_38); +lean_dec(x_37); +lean_dec(x_10); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); -lean_dec(x_2); -x_50 = lean_ctor_get(x_39, 0); -lean_inc(x_50); -x_51 = lean_ctor_get(x_39, 1); -lean_inc(x_51); -if (lean_is_exclusive(x_39)) { - lean_ctor_release(x_39, 0); - lean_ctor_release(x_39, 1); - x_52 = x_39; +x_60 = lean_ctor_get(x_45, 0); +lean_inc(x_60); +x_61 = lean_ctor_get(x_45, 1); +lean_inc(x_61); +if (lean_is_exclusive(x_45)) { + lean_ctor_release(x_45, 0); + lean_ctor_release(x_45, 1); + x_62 = x_45; } else { - lean_dec_ref(x_39); - x_52 = lean_box(0); + lean_dec_ref(x_45); + x_62 = lean_box(0); } -if (lean_is_scalar(x_52)) { - x_53 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_62)) { + x_63 = lean_alloc_ctor(1, 2, 0); } else { - x_53 = x_52; + x_63 = x_62; } -lean_ctor_set(x_53, 0, x_50); -lean_ctor_set(x_53, 1, x_51); -return x_53; +lean_ctor_set(x_63, 0, x_60); +lean_ctor_set(x_63, 1, x_61); +return x_63; } } } } } +static lean_object* _init_l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1() { +_start: +{ +lean_object* x_1; uint8_t x_2; lean_object* x_3; lean_object* x_4; +x_1 = l_Array_empty___closed__1; +x_2 = 0; +x_3 = lean_box(x_2); +x_4 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_4, 0, x_1); +lean_ctor_set(x_4, 1, x_3); +return x_4; +} +} lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; -x_7 = lean_box(0); +x_7 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1; x_8 = l_List_forIn_loop___at___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___spec__1(x_1, x_7, x_2, x_3, x_4, x_5, x_6); if (lean_obj_tag(x_8) == 0) { @@ -15724,47 +15768,63 @@ uint8_t x_9; x_9 = !lean_is_exclusive(x_8); if (x_9 == 0) { -lean_object* x_10; lean_object* x_11; +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; x_10 = lean_ctor_get(x_8, 0); -x_11 = l_List_reverse___rarg(x_10); -lean_ctor_set(x_8, 0, x_11); -return x_8; -} -else -{ -lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; -x_12 = lean_ctor_get(x_8, 0); -x_13 = lean_ctor_get(x_8, 1); -lean_inc(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 = lean_array_to_list(lean_box(0), x_11); +x_14 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_14, 0, x_13); +lean_ctor_set(x_14, 1, x_12); +lean_ctor_set(x_8, 0, x_14); +return x_8; +} +else +{ +lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; +x_15 = lean_ctor_get(x_8, 0); +x_16 = lean_ctor_get(x_8, 1); +lean_inc(x_16); +lean_inc(x_15); lean_dec(x_8); -x_14 = l_List_reverse___rarg(x_12); -x_15 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_15, 0, x_14); -lean_ctor_set(x_15, 1, x_13); -return x_15; +x_17 = lean_ctor_get(x_15, 0); +lean_inc(x_17); +x_18 = lean_ctor_get(x_15, 1); +lean_inc(x_18); +lean_dec(x_15); +x_19 = lean_array_to_list(lean_box(0), x_17); +x_20 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_20, 0, x_19); +lean_ctor_set(x_20, 1, x_18); +x_21 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_21, 0, x_20); +lean_ctor_set(x_21, 1, x_16); +return x_21; } } else { -uint8_t x_16; -x_16 = !lean_is_exclusive(x_8); -if (x_16 == 0) +uint8_t x_22; +x_22 = !lean_is_exclusive(x_8); +if (x_22 == 0) { return x_8; } else { -lean_object* x_17; lean_object* x_18; lean_object* x_19; -x_17 = lean_ctor_get(x_8, 0); -x_18 = lean_ctor_get(x_8, 1); -lean_inc(x_18); -lean_inc(x_17); +lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_8, 0); +x_24 = lean_ctor_get(x_8, 1); +lean_inc(x_24); +lean_inc(x_23); lean_dec(x_8); -x_19 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_19, 0, x_17); -lean_ctor_set(x_19, 1, x_18); -return x_19; +x_25 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_25, 0, x_23); +lean_ctor_set(x_25, 1, x_24); +return x_25; } } } @@ -15989,7 +16049,28 @@ lean_dec(x_2); return x_9; } } -lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1___rarg(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; lean_object* x_4; lean_object* x_5; +x_3 = lean_ctor_get(x_1, 0); +lean_inc(x_3); +x_4 = lean_ctor_get(x_1, 1); +lean_inc(x_4); +lean_dec(x_1); +x_5 = lean_apply_2(x_2, x_3, x_4); +return x_5; +} +} +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1___rarg), 2, 0); +return x_2; +} +} +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__2___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { if (lean_obj_tag(x_1) == 4) @@ -16014,11 +16095,11 @@ return x_9; } } } -lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1(lean_object* x_1) { +lean_object* l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__2(lean_object* x_1) { _start: { lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__1___rarg), 3, 0); +x_2 = lean_alloc_closure((void*)(l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessOutParam_match__2___rarg), 3, 0); return x_2; } } @@ -16029,27 +16110,44 @@ lean_object* x_9; x_9 = l_Lean_Expr_getAppFn(x_3); if (lean_obj_tag(x_9) == 4) { -lean_object* x_10; lean_object* x_11; lean_object* x_12; uint8_t x_13; +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16; x_10 = lean_ctor_get(x_9, 0); lean_inc(x_10); x_11 = lean_ctor_get(x_9, 1); lean_inc(x_11); lean_dec(x_9); x_12 = lean_st_ref_get(x_7, x_8); -x_13 = !lean_is_exclusive(x_12); -if (x_13 == 0) -{ -lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; -x_14 = lean_ctor_get(x_12, 0); -x_15 = lean_ctor_get(x_12, 1); -x_16 = lean_ctor_get(x_14, 0); -lean_inc(x_16); -lean_dec(x_14); +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 = lean_ctor_get(x_13, 0); +lean_inc(x_15); +lean_dec(x_13); lean_inc(x_10); -x_17 = lean_has_out_params(x_16, x_10); -if (x_17 == 0) +x_16 = lean_has_out_params(x_15, x_10); +if (x_16 == 0) { -lean_dec(x_11); +lean_object* x_17; +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_4); +x_17 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels(x_11, x_4, x_5, x_6, x_7, x_14); +if (lean_obj_tag(x_17) == 0) +{ +lean_object* x_18; lean_object* x_19; uint8_t x_20; +x_18 = lean_ctor_get(x_17, 0); +lean_inc(x_18); +x_19 = lean_ctor_get(x_18, 1); +lean_inc(x_19); +x_20 = lean_unbox(x_19); +lean_dec(x_19); +if (x_20 == 0) +{ +uint8_t x_21; +lean_dec(x_18); lean_dec(x_10); lean_dec(x_7); lean_dec(x_6); @@ -16057,96 +16155,82 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -lean_ctor_set(x_12, 0, x_1); -return x_12; +x_21 = !lean_is_exclusive(x_17); +if (x_21 == 0) +{ +lean_object* x_22; +x_22 = lean_ctor_get(x_17, 0); +lean_dec(x_22); +lean_ctor_set(x_17, 0, x_1); +return x_17; } else { -lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; -lean_free_object(x_12); +lean_object* x_23; lean_object* x_24; +x_23 = lean_ctor_get(x_17, 1); +lean_inc(x_23); +lean_dec(x_17); +x_24 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_24, 0, x_1); +lean_ctor_set(x_24, 1, x_23); +return x_24; +} +} +else +{ +lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36; uint8_t x_37; lean_object* x_38; lean_dec(x_1); -x_18 = lean_unsigned_to_nat(0u); -x_19 = l_Lean_Expr_getAppNumArgsAux(x_3, x_18); -x_20 = l_Lean_Expr_getAppArgs___closed__1; -lean_inc(x_19); -x_21 = lean_mk_array(x_19, x_20); -x_22 = lean_unsigned_to_nat(1u); -x_23 = lean_nat_sub(x_19, x_22); -lean_dec(x_19); -x_24 = l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(x_3, x_21, x_23); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -x_25 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels(x_11, x_4, x_5, x_6, x_7, x_15); -if (lean_obj_tag(x_25) == 0) -{ -lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; -x_26 = lean_ctor_get(x_25, 0); +x_25 = lean_ctor_get(x_17, 1); +lean_inc(x_25); +lean_dec(x_17); +x_26 = lean_ctor_get(x_18, 0); lean_inc(x_26); -x_27 = lean_ctor_get(x_25, 1); -lean_inc(x_27); -lean_dec(x_25); -x_28 = l_Lean_mkConst(x_10, x_26); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -lean_inc(x_28); -x_29 = l_Lean_Meta_inferType(x_28, x_4, x_5, x_6, x_7, x_27); -if (lean_obj_tag(x_29) == 0) -{ -lean_object* x_30; lean_object* x_31; lean_object* x_32; -x_30 = lean_ctor_get(x_29, 0); -lean_inc(x_30); -x_31 = lean_ctor_get(x_29, 1); -lean_inc(x_31); +lean_dec(x_18); +x_27 = l_Lean_mkConst(x_10, x_26); +x_28 = lean_unsigned_to_nat(0u); +x_29 = l_Lean_Expr_getAppNumArgsAux(x_3, x_28); +x_30 = l_Lean_Expr_getAppArgs___closed__1; +lean_inc(x_29); +x_31 = lean_mk_array(x_29, x_30); +x_32 = lean_unsigned_to_nat(1u); +x_33 = lean_nat_sub(x_29, x_32); lean_dec(x_29); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -x_32 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs(x_30, x_18, x_24, x_4, x_5, x_6, x_7, x_31); -if (lean_obj_tag(x_32) == 0) -{ -lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36; uint8_t x_37; lean_object* x_38; -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 = l_Lean_mkAppN(x_28, x_33); -lean_dec(x_33); +x_34 = l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(x_3, x_31, x_33); +x_35 = l_Lean_mkAppN(x_27, x_34); +lean_dec(x_34); x_36 = 0; x_37 = 1; -x_38 = l_Lean_Meta_mkForallFVars(x_2, x_35, x_36, x_37, x_4, x_5, x_6, x_7, x_34); +x_38 = l_Lean_Meta_mkForallFVars(x_2, x_35, x_36, x_37, x_4, x_5, x_6, x_7, x_25); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); return x_38; } +} else { uint8_t x_39; -lean_dec(x_28); +lean_dec(x_10); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); +lean_dec(x_3); lean_dec(x_2); -x_39 = !lean_is_exclusive(x_32); +lean_dec(x_1); +x_39 = !lean_is_exclusive(x_17); if (x_39 == 0) { -return x_32; +return x_17; } else { lean_object* x_40; lean_object* x_41; lean_object* x_42; -x_40 = lean_ctor_get(x_32, 0); -x_41 = lean_ctor_get(x_32, 1); +x_40 = lean_ctor_get(x_17, 0); +x_41 = lean_ctor_get(x_17, 1); lean_inc(x_41); lean_inc(x_40); -lean_dec(x_32); +lean_dec(x_17); x_42 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_42, 0, x_40); lean_ctor_set(x_42, 1, x_41); @@ -16156,258 +16240,164 @@ return x_42; } else { -uint8_t x_43; -lean_dec(x_28); -lean_dec(x_24); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_2); -x_43 = !lean_is_exclusive(x_29); -if (x_43 == 0) -{ -return x_29; -} -else -{ -lean_object* x_44; lean_object* x_45; lean_object* x_46; -x_44 = lean_ctor_get(x_29, 0); -x_45 = lean_ctor_get(x_29, 1); -lean_inc(x_45); +lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; +lean_dec(x_1); +x_43 = lean_unsigned_to_nat(0u); +x_44 = l_Lean_Expr_getAppNumArgsAux(x_3, x_43); +x_45 = l_Lean_Expr_getAppArgs___closed__1; lean_inc(x_44); -lean_dec(x_29); -x_46 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_46, 0, x_44); -lean_ctor_set(x_46, 1, x_45); -return x_46; -} -} -} -else +x_46 = lean_mk_array(x_44, x_45); +x_47 = lean_unsigned_to_nat(1u); +x_48 = lean_nat_sub(x_44, x_47); +lean_dec(x_44); +x_49 = l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(x_3, x_46, x_48); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_4); +x_50 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels(x_11, x_4, x_5, x_6, x_7, x_14); +if (lean_obj_tag(x_50) == 0) { -uint8_t x_47; -lean_dec(x_24); -lean_dec(x_10); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_2); -x_47 = !lean_is_exclusive(x_25); -if (x_47 == 0) -{ -return x_25; -} -else -{ -lean_object* x_48; lean_object* x_49; lean_object* x_50; -x_48 = lean_ctor_get(x_25, 0); -x_49 = lean_ctor_get(x_25, 1); -lean_inc(x_49); -lean_inc(x_48); -lean_dec(x_25); -x_50 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_50, 0, x_48); -lean_ctor_set(x_50, 1, x_49); -return x_50; -} -} -} -} -else -{ -lean_object* x_51; lean_object* x_52; lean_object* x_53; uint8_t x_54; -x_51 = lean_ctor_get(x_12, 0); -x_52 = lean_ctor_get(x_12, 1); -lean_inc(x_52); +lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; +x_51 = lean_ctor_get(x_50, 0); lean_inc(x_51); -lean_dec(x_12); +x_52 = lean_ctor_get(x_50, 1); +lean_inc(x_52); +lean_dec(x_50); x_53 = lean_ctor_get(x_51, 0); lean_inc(x_53); lean_dec(x_51); -lean_inc(x_10); -x_54 = lean_has_out_params(x_53, x_10); -if (x_54 == 0) +x_54 = l_Lean_mkConst(x_10, x_53); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_4); +lean_inc(x_54); +x_55 = l_Lean_Meta_inferType(x_54, x_4, x_5, x_6, x_7, x_52); +if (lean_obj_tag(x_55) == 0) { -lean_object* x_55; -lean_dec(x_11); -lean_dec(x_10); +lean_object* x_56; lean_object* x_57; lean_object* x_58; +x_56 = lean_ctor_get(x_55, 0); +lean_inc(x_56); +x_57 = lean_ctor_get(x_55, 1); +lean_inc(x_57); +lean_dec(x_55); +lean_inc(x_7); +lean_inc(x_6); +lean_inc(x_5); +lean_inc(x_4); +x_58 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs(x_56, x_43, x_49, x_4, x_5, x_6, x_7, x_57); +if (lean_obj_tag(x_58) == 0) +{ +lean_object* x_59; lean_object* x_60; lean_object* x_61; uint8_t x_62; uint8_t x_63; lean_object* x_64; +x_59 = lean_ctor_get(x_58, 0); +lean_inc(x_59); +x_60 = lean_ctor_get(x_58, 1); +lean_inc(x_60); +lean_dec(x_58); +x_61 = l_Lean_mkAppN(x_54, x_59); +lean_dec(x_59); +x_62 = 0; +x_63 = 1; +x_64 = l_Lean_Meta_mkForallFVars(x_2, x_61, x_62, x_63, x_4, x_5, x_6, x_7, x_60); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +return x_64; +} +else +{ +uint8_t x_65; +lean_dec(x_54); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); -lean_dec(x_3); lean_dec(x_2); -x_55 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_55, 0, x_1); -lean_ctor_set(x_55, 1, x_52); +x_65 = !lean_is_exclusive(x_58); +if (x_65 == 0) +{ +return x_58; +} +else +{ +lean_object* x_66; lean_object* x_67; lean_object* x_68; +x_66 = lean_ctor_get(x_58, 0); +x_67 = lean_ctor_get(x_58, 1); +lean_inc(x_67); +lean_inc(x_66); +lean_dec(x_58); +x_68 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_68, 0, x_66); +lean_ctor_set(x_68, 1, x_67); +return x_68; +} +} +} +else +{ +uint8_t x_69; +lean_dec(x_54); +lean_dec(x_49); +lean_dec(x_7); +lean_dec(x_6); +lean_dec(x_5); +lean_dec(x_4); +lean_dec(x_2); +x_69 = !lean_is_exclusive(x_55); +if (x_69 == 0) +{ return x_55; } else { -lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; -lean_dec(x_1); -x_56 = lean_unsigned_to_nat(0u); -x_57 = l_Lean_Expr_getAppNumArgsAux(x_3, x_56); -x_58 = l_Lean_Expr_getAppArgs___closed__1; -lean_inc(x_57); -x_59 = lean_mk_array(x_57, x_58); -x_60 = lean_unsigned_to_nat(1u); -x_61 = lean_nat_sub(x_57, x_60); -lean_dec(x_57); -x_62 = l___private_Lean_Expr_0__Lean_Expr_getAppArgsAux(x_3, x_59, x_61); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -x_63 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels(x_11, x_4, x_5, x_6, x_7, x_52); -if (lean_obj_tag(x_63) == 0) -{ -lean_object* x_64; lean_object* x_65; lean_object* x_66; lean_object* x_67; -x_64 = lean_ctor_get(x_63, 0); -lean_inc(x_64); -x_65 = lean_ctor_get(x_63, 1); -lean_inc(x_65); -lean_dec(x_63); -x_66 = l_Lean_mkConst(x_10, x_64); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -lean_inc(x_66); -x_67 = l_Lean_Meta_inferType(x_66, x_4, x_5, x_6, x_7, x_65); -if (lean_obj_tag(x_67) == 0) -{ -lean_object* x_68; lean_object* x_69; lean_object* x_70; -x_68 = lean_ctor_get(x_67, 0); -lean_inc(x_68); -x_69 = lean_ctor_get(x_67, 1); -lean_inc(x_69); -lean_dec(x_67); -lean_inc(x_7); -lean_inc(x_6); -lean_inc(x_5); -lean_inc(x_4); -x_70 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs(x_68, x_56, x_62, x_4, x_5, x_6, x_7, x_69); -if (lean_obj_tag(x_70) == 0) -{ -lean_object* x_71; lean_object* x_72; lean_object* x_73; uint8_t x_74; uint8_t x_75; lean_object* x_76; -x_71 = lean_ctor_get(x_70, 0); +lean_object* x_70; lean_object* x_71; lean_object* x_72; +x_70 = lean_ctor_get(x_55, 0); +x_71 = lean_ctor_get(x_55, 1); lean_inc(x_71); -x_72 = lean_ctor_get(x_70, 1); -lean_inc(x_72); -lean_dec(x_70); -x_73 = l_Lean_mkAppN(x_66, x_71); -lean_dec(x_71); -x_74 = 0; -x_75 = 1; -x_76 = l_Lean_Meta_mkForallFVars(x_2, x_73, x_74, x_75, x_4, x_5, x_6, x_7, x_72); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -return x_76; +lean_inc(x_70); +lean_dec(x_55); +x_72 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_72, 0, x_70); +lean_ctor_set(x_72, 1, x_71); +return x_72; } -else -{ -lean_object* x_77; lean_object* x_78; lean_object* x_79; lean_object* x_80; -lean_dec(x_66); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_2); -x_77 = lean_ctor_get(x_70, 0); -lean_inc(x_77); -x_78 = lean_ctor_get(x_70, 1); -lean_inc(x_78); -if (lean_is_exclusive(x_70)) { - lean_ctor_release(x_70, 0); - lean_ctor_release(x_70, 1); - x_79 = x_70; -} else { - lean_dec_ref(x_70); - x_79 = lean_box(0); -} -if (lean_is_scalar(x_79)) { - x_80 = lean_alloc_ctor(1, 2, 0); -} else { - x_80 = x_79; -} -lean_ctor_set(x_80, 0, x_77); -lean_ctor_set(x_80, 1, x_78); -return x_80; } } else { -lean_object* x_81; lean_object* x_82; lean_object* x_83; lean_object* x_84; -lean_dec(x_66); -lean_dec(x_62); -lean_dec(x_7); -lean_dec(x_6); -lean_dec(x_5); -lean_dec(x_4); -lean_dec(x_2); -x_81 = lean_ctor_get(x_67, 0); -lean_inc(x_81); -x_82 = lean_ctor_get(x_67, 1); -lean_inc(x_82); -if (lean_is_exclusive(x_67)) { - lean_ctor_release(x_67, 0); - lean_ctor_release(x_67, 1); - x_83 = x_67; -} else { - lean_dec_ref(x_67); - x_83 = lean_box(0); -} -if (lean_is_scalar(x_83)) { - x_84 = lean_alloc_ctor(1, 2, 0); -} else { - x_84 = x_83; -} -lean_ctor_set(x_84, 0, x_81); -lean_ctor_set(x_84, 1, x_82); -return x_84; -} -} -else -{ -lean_object* x_85; lean_object* x_86; lean_object* x_87; lean_object* x_88; -lean_dec(x_62); +uint8_t x_73; +lean_dec(x_49); lean_dec(x_10); lean_dec(x_7); lean_dec(x_6); lean_dec(x_5); lean_dec(x_4); lean_dec(x_2); -x_85 = lean_ctor_get(x_63, 0); -lean_inc(x_85); -x_86 = lean_ctor_get(x_63, 1); -lean_inc(x_86); -if (lean_is_exclusive(x_63)) { - lean_ctor_release(x_63, 0); - lean_ctor_release(x_63, 1); - x_87 = x_63; -} else { - lean_dec_ref(x_63); - x_87 = lean_box(0); +x_73 = !lean_is_exclusive(x_50); +if (x_73 == 0) +{ +return x_50; } -if (lean_is_scalar(x_87)) { - x_88 = lean_alloc_ctor(1, 2, 0); -} else { - x_88 = x_87; -} -lean_ctor_set(x_88, 0, x_85); -lean_ctor_set(x_88, 1, x_86); -return x_88; +else +{ +lean_object* x_74; lean_object* x_75; lean_object* x_76; +x_74 = lean_ctor_get(x_50, 0); +x_75 = lean_ctor_get(x_50, 1); +lean_inc(x_75); +lean_inc(x_74); +lean_dec(x_50); +x_76 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_76, 0, x_74); +lean_ctor_set(x_76, 1, x_75); +return x_76; } } } } else { -lean_object* x_89; +lean_object* x_77; lean_dec(x_9); lean_dec(x_7); lean_dec(x_6); @@ -16415,10 +16405,10 @@ lean_dec(x_5); lean_dec(x_4); lean_dec(x_3); lean_dec(x_2); -x_89 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_89, 0, x_1); -lean_ctor_set(x_89, 1, x_8); -return x_89; +x_77 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_77, 0, x_1); +lean_ctor_set(x_77, 1, x_8); +return x_77; } } } @@ -17951,7 +17941,7 @@ x_15 = lean_ctor_get(x_4, 1); x_16 = lean_ctor_get(x_4, 2); x_17 = 1; x_18 = 0; -x_19 = 2; +x_19 = 3; lean_ctor_set_uint8(x_13, 0, x_17); lean_ctor_set_uint8(x_13, 1, x_17); lean_ctor_set_uint8(x_13, 3, x_18); @@ -19109,7 +19099,7 @@ x_279 = lean_ctor_get_uint8(x_13, 8); lean_dec(x_13); x_280 = 1; x_281 = 0; -x_282 = 2; +x_282 = 3; x_283 = lean_alloc_ctor(0, 0, 9); lean_ctor_set_uint8(x_283, 0, x_280); lean_ctor_set_uint8(x_283, 1, x_280); @@ -19784,7 +19774,7 @@ if (lean_is_exclusive(x_421)) { } x_429 = 1; x_430 = 0; -x_431 = 2; +x_431 = 3; if (lean_is_scalar(x_428)) { x_432 = lean_alloc_ctor(0, 0, 9); } else { @@ -21625,7 +21615,7 @@ return x_135; } } } -lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { +lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { _start: { lean_object* x_7; lean_object* x_8; @@ -21634,20 +21624,20 @@ x_8 = l___private_Lean_Meta_SynthInstance_0__Lean_Meta_synthPendingImp(x_1, x_7, return x_8; } } -static lean_object* _init_l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____closed__1() { +static lean_object* _init_l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____closed__1() { _start: { lean_object* x_1; -x_1 = lean_alloc_closure((void*)(l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____lambda__1), 6, 0); +x_1 = lean_alloc_closure((void*)(l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____lambda__1), 6, 0); return x_1; } } -lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701_(lean_object* x_1) { +lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785_(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; uint8_t x_5; x_2 = l_Lean_Meta_synthPendingRef; -x_3 = l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____closed__1; +x_3 = l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____closed__1; x_4 = lean_st_ref_set(x_2, x_3, x_1); x_5 = !lean_is_exclusive(x_4); if (x_5 == 0) @@ -21669,7 +21659,7 @@ return x_8; } } } -lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4716_(lean_object* x_1) { +lean_object* l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4800_(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; @@ -22071,6 +22061,8 @@ l_Lean_Meta_SynthInstance_main___closed__2 = _init_l_Lean_Meta_SynthInstance_mai lean_mark_persistent(l_Lean_Meta_SynthInstance_main___closed__2); l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocess___closed__1 = _init_l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocess___closed__1(); lean_mark_persistent(l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocess___closed__1); +l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1 = _init_l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1(); +lean_mark_persistent(l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessLevels___closed__1); l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs___closed__1 = _init_l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs___closed__1(); lean_mark_persistent(l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs___closed__1); l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs___closed__2 = _init_l___private_Lean_Meta_SynthInstance_0__Lean_Meta_preprocessArgs___closed__2(); @@ -22117,12 +22109,12 @@ l_Lean_Meta_synthInstance___closed__1 = _init_l_Lean_Meta_synthInstance___closed lean_mark_persistent(l_Lean_Meta_synthInstance___closed__1); l_Lean_Meta_synthInstance___closed__2 = _init_l_Lean_Meta_synthInstance___closed__2(); lean_mark_persistent(l_Lean_Meta_synthInstance___closed__2); -l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____closed__1 = _init_l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____closed__1(); -lean_mark_persistent(l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701____closed__1); -res = l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4701_(lean_io_mk_world()); +l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____closed__1 = _init_l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____closed__1(); +lean_mark_persistent(l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785____closed__1); +res = l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4785_(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); -res = l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4716_(lean_io_mk_world()); +res = l_Lean_Meta_initFn____x40_Lean_Meta_SynthInstance___hyg_4800_(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); return lean_io_result_mk_ok(lean_box(0)); diff --git a/stage0/stdlib/Std/Data/PersistentHashMap.c b/stage0/stdlib/Std/Data/PersistentHashMap.c index 44b7178ea6..ac45a121eb 100644 --- a/stage0/stdlib/Std/Data/PersistentHashMap.c +++ b/stage0/stdlib/Std/Data/PersistentHashMap.c @@ -80,7 +80,6 @@ lean_object* l_Std_PersistentHashMap_collectStats___rarg___boxed(lean_object*, l lean_object* l_Std_PersistentHashMap_foldlMAux___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_foldlM(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findEntryAtAux(lean_object*, lean_object*); -lean_object* l_Std_PersistentHashMap_isUnaryEntries_match__2(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_find_x3f_match__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_toList___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_stats___rarg___closed__1; @@ -234,7 +233,6 @@ lean_object* l_Std_PersistentHashMap_instInhabitedPersistentHashMap___rarg___box lean_object* l_Array_modifyM___at_Std_PersistentHashMap_insertAux___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_eraseAux___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_foldl___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Std_PersistentHashMap_isUnaryEntries_match__2___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_insert_match__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_eraseAux_match__5(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_eraseAux_match__4(lean_object*, lean_object*, lean_object*); @@ -2331,54 +2329,6 @@ x_4 = lean_alloc_closure((void*)(l_Std_PersistentHashMap_isUnaryEntries_match__1 return x_4; } } -lean_object* l_Std_PersistentHashMap_isUnaryEntries_match__2___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { -_start: -{ -switch (lean_obj_tag(x_1)) { -case 0: -{ -lean_object* x_5; lean_object* x_6; lean_object* x_7; -lean_dec(x_3); -lean_dec(x_2); -x_5 = lean_ctor_get(x_1, 0); -lean_inc(x_5); -x_6 = lean_ctor_get(x_1, 1); -lean_inc(x_6); -lean_dec(x_1); -x_7 = lean_apply_2(x_4, x_5, x_6); -return x_7; -} -case 1: -{ -lean_object* x_8; lean_object* x_9; -lean_dec(x_4); -lean_dec(x_2); -x_8 = lean_ctor_get(x_1, 0); -lean_inc(x_8); -lean_dec(x_1); -x_9 = lean_apply_1(x_3, x_8); -return x_9; -} -default: -{ -lean_object* x_10; lean_object* x_11; -lean_dec(x_4); -lean_dec(x_3); -x_10 = lean_box(0); -x_11 = lean_apply_1(x_2, x_10); -return x_11; -} -} -} -} -lean_object* l_Std_PersistentHashMap_isUnaryEntries_match__2(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = lean_alloc_closure((void*)(l_Std_PersistentHashMap_isUnaryEntries_match__2___rarg), 4, 0); -return x_4; -} -} lean_object* l_Std_PersistentHashMap_isUnaryEntries___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: {