diff --git a/stage0/src/Init/Control/StateRef.lean b/stage0/src/Init/Control/StateRef.lean index 5a0ee426b3..ed2814dfb6 100644 --- a/stage0/src/Init/Control/StateRef.lean +++ b/stage0/src/Init/Control/StateRef.lean @@ -11,13 +11,13 @@ import Init.Control.State def StateRefT (σ : Type) (m : Type → Type) (α : Type) : Type := ReaderT (IO.Ref σ) m α -@[inline] def StateRefT.run {σ : Type} {m : Type → Type} [Monad m] [MonadIO m] {α : Type} (x : StateRefT σ m α) (s : σ) : m (α × σ) := do +@[inline] def StateRefT.run {σ : Type} {m : Type → Type} [Monad m] [HasMonadLiftT (EIO Empty) m] {α : Type} (x : StateRefT σ m α) (s : σ) : m (α × σ) := do ref ← IO.mkRef s; a ← x ref; s ← ref.get; pure (a, s) -@[inline] def StateRefT.run' {σ : Type} {m : Type → Type} [Monad m] [MonadIO m] {α : Type} (x : StateRefT σ m α) (s : σ) : m α := do +@[inline] def StateRefT.run' {σ : Type} {m : Type → Type} [Monad m] [HasMonadLiftT (EIO Empty) m] {α : Type} (x : StateRefT σ m α) (s : σ) : m α := do (a, _) ← x.run s; pure a @@ -28,22 +28,22 @@ variables {σ : Type} {m : Type → Type} {α : Type} fun _ => x instance [Monad m] : Monad (StateRefT σ m) := inferInstanceAs (Monad (ReaderT _ _)) -instance [Monad m] [MonadIO m] : MonadIO (StateRefT σ m) := inferInstanceAs (MonadIO (ReaderT _ _)) instance : HasMonadLift m (StateRefT σ m) := ⟨fun _ => StateRefT.lift⟩ +instance [Monad m] [MonadIO m] : MonadIO (StateRefT σ m) := inferInstanceAs (MonadIO (ReaderT _ _)) instance (σ m m') [Monad m] [Monad m'] : MonadFunctor m m' (StateRefT σ m) (StateRefT σ m') := inferInstanceAs (MonadFunctor m m' (ReaderT _ _) (ReaderT _ _)) -@[inline] protected def get [Monad m] [MonadIO m] : StateRefT σ m σ := +@[inline] protected def get [Monad m] [HasMonadLift (EIO Empty) m] : StateRefT σ m σ := fun ref => ref.get -@[inline] protected def set [Monad m] [MonadIO m] (s : σ) : StateRefT σ m PUnit := +@[inline] protected def set [Monad m] [HasMonadLift (EIO Empty) m] (s : σ) : StateRefT σ m PUnit := fun ref => ref.set s -@[inline] protected def modifyGet [Monad m] [MonadIO m] (f : σ → α × σ) : StateRefT σ m α := +@[inline] protected def modifyGet [Monad m] [HasMonadLift (EIO Empty) m] (f : σ → α × σ) : StateRefT σ m α := fun ref => ref.modifyGet f -instance [Monad m] [MonadIO m] : MonadStateOf σ (StateRefT σ m) := +instance [Monad m] [HasMonadLift (EIO Empty) m] : MonadStateOf σ (StateRefT σ m) := { get := StateRefT.get, set := StateRefT.set, modifyGet := fun α f => StateRefT.modifyGet f } diff --git a/stage0/src/Init/Data/Random.lean b/stage0/src/Init/Data/Random.lean index 6f537bed41..76fe642730 100644 --- a/stage0/src/Init/Data/Random.lean +++ b/stage0/src/Init/Data/Random.lean @@ -32,6 +32,8 @@ class RandomGen (g : Type u) := structure StdGen := (s1 : Nat) (s2 : Nat) +instance StdGen.inhabited : Inhabited StdGen := ⟨{ s1 := 0, s2 := 0 }⟩ + def stdRange := (1, 2147483562) instance : HasRepr StdGen := diff --git a/stage0/src/Init/System/IO.lean b/stage0/src/Init/System/IO.lean index 63a8db44a8..2a7f6b9828 100644 --- a/stage0/src/Init/System/IO.lean +++ b/stage0/src/Init/System/IO.lean @@ -79,7 +79,7 @@ class MonadIO (m : Type → Type) := export MonadIO (liftIO) -instance : MonadIO IO := +instance monadIOSelf : MonadIO IO := { liftIO := fun α => id } /- Omitted instances of MonadIO: OptionT, ExceptT and EStateT. The possibility for @@ -317,71 +317,78 @@ def setAccessRights (filename : String) (mode : FileRight) : IO Unit := Prim.setAccessRights filename mode.flags /- References -/ -constant RefPointed (α : Type) : PointedType := arbitrary _ -def Ref (α : Type) : Type := (RefPointed α).type -instance (α : Type) : Inhabited (Ref α) := ⟨(RefPointed α).val⟩ +constant RefPointed : PointedType.{0} := arbitrary _ + +structure Ref (α : Type) : Type := +(ref : RefPointed.type) (h : Nonempty α) + +instance Ref.inhabited {α} [Inhabited α] : Inhabited (Ref α) := +⟨{ ref := RefPointed.val, h := Nonempty.intro $ arbitrary _}⟩ namespace Prim -@[inline] unsafe def exceptionFreeUnsafe {α} (x : IO α) : IO α := -fun s => match x s with - | r@(EStateM.Result.error _ _) => False.elim lcProof - | r => r +/- Auxiliary definition for showing that `EIO ε α` is inhabited when we have a `Ref α` -/ +private noncomputable def inhabitedFromRef {α} (r : Ref α) : EIO Empty α := +pure $ (Classical.inhabitedOfNonempty r.h).default -/- TODO: add a exceptionFreeBuiltin macro that creates an unsafe definition `using exceptionFreeUnsafe` - and then seals it using `implementedBy`. Then, we can remove the not so safe constant `exceptionFree`. -/ -@[implementedBy exceptionFreeUnsafe] private constant exceptionFree {α} (x : IO α) : IO α := -x @[extern "lean_io_mk_ref"] -constant mkRefCore {α : Type} (a : α) : IO (Ref α) := arbitrary _ -@[inline] def mkRef {α : Type} (a : α) : IO (Ref α) := exceptionFree $ mkRefCore a +constant mkRef {α} (a : α) : EIO Empty (Ref α) := pure { ref := RefPointed.val, h := Nonempty.intro a } @[extern "lean_io_ref_get"] -constant Ref.getCore {α : Type} (r : @& Ref α) : IO α := arbitrary _ -@[inline] def Ref.get {α : Type} (r : Ref α) : IO α := exceptionFree $ Ref.getCore r +constant Ref.get {α} (r : @& Ref α) : EIO Empty α := inhabitedFromRef r @[extern "lean_io_ref_set"] -constant Ref.setCore {α : Type} (r : @& Ref α) (a : α) : IO Unit := arbitrary _ -@[inline] def Ref.set {α : Type} (r : Ref α) (a : α) : IO Unit := exceptionFree $ Ref.setCore r a +constant Ref.set {α} (r : @& Ref α) (a : α) : EIO Empty Unit := arbitrary _ @[extern "lean_io_ref_swap"] -constant Ref.swapCore {α : Type} (r : @& Ref α) (a : α) : IO α := arbitrary _ -@[inline] def Ref.swap {α : Type} (r : Ref α) (a : α) : IO α := exceptionFree $ Ref.swapCore r a +constant Ref.swap {α} (r : @& Ref α) (a : α) : EIO Empty α := inhabitedFromRef r @[extern "lean_io_ref_take"] -unsafe constant Ref.takeCore {α : Type} (r : @& Ref α) : IO α := arbitrary _ -@[inline] unsafe def Ref.take {α : Type} (r : Ref α) : IO α := exceptionFree $ Ref.takeCore r +unsafe constant Ref.take {α} (r : @& Ref α) : EIO Empty α := inhabitedFromRef r @[extern "lean_io_ref_ptr_eq"] -constant Ref.ptrEqCore {α : Type} (r1 r2 : @& Ref α) : IO Bool := arbitrary _ -@[inline] def Ref.ptrEq {α : Type} (r1 r2 : Ref α) : IO Bool := exceptionFree $ Ref.ptrEqCore r1 r2 -end Prim +constant Ref.ptrEq {α} (r1 r2 : @& Ref α) : EIO Empty Bool := arbitrary _ +@[inline] unsafe def Ref.modifyUnsafe {α : Type} (r : Ref α) (f : α → α) : EIO Empty Unit := do +v ← Ref.take r; +Ref.set r (f v) -section -variables {m : Type → Type} [Monad m] [MonadIO m] -@[inline] def mkRef {α : Type} (a : α) : m (Ref α) := liftIO (Prim.mkRef a) -@[inline] def Ref.get {α : Type} (r : Ref α) : m α := liftIO (Prim.Ref.get r) -@[inline] def Ref.set {α : Type} (r : Ref α) (a : α) : m Unit := liftIO (Prim.Ref.set r a) -@[inline] def Ref.swap {α : Type} (r : Ref α) (a : α) : m α := liftIO (Prim.Ref.swap r a) -@[inline] unsafe def Ref.take {α : Type} (r : Ref α) : m α := liftIO (Prim.Ref.take r) -@[inline] def Ref.ptrEq {α : Type} (r1 r2 : Ref α) : m Bool := liftIO (Prim.Ref.ptrEq r1 r2) -@[inline] unsafe def Ref.modifyUnsafe {α : Type} (r : Ref α) (f : α → α) : m Unit := do -v ← r.take; -r.set (f v) -@[inline] unsafe def Ref.modifyGetUnsafe {α : Type} {β : Type} (r : Ref α) (f : α → β × α) : m β := do -v ← r.take; +@[inline] unsafe def Ref.modifyGetUnsafe {α : Type} {β : Type} (r : Ref α) (f : α → β × α) : EIO Empty β := do +v ← Ref.take r; let (b, a) := f v; -r.set a; +Ref.set r a; pure b @[implementedBy Ref.modifyUnsafe] -def Ref.modify {α : Type} (r : Ref α) (f : α → α) : m Unit := do -v ← r.get; -r.set (f v) +def Ref.modify {α : Type} (r : Ref α) (f : α → α) : EIO Empty Unit := do +v ← Ref.get r; +Ref.set r (f v) @[implementedBy Ref.modifyGetUnsafe] -def Ref.modifyGet {α : Type} {β : Type} (r : Ref α) (f : α → β × α) : m β := do -v ← r.get; +def Ref.modifyGet {α : Type} {β : Type} (r : Ref α) (f : α → β × α) : EIO Empty β := do +v ← Ref.get r; let (b, a) := f v; -r.set a; +Ref.set r a; pure b +end Prim + +section + +@[inline] private def fromEmptyEIO {ε α} (x : EIO Empty α) : EIO ε α := +fun s => match x s with + | r@(EStateM.Result.error e _) => Empty.rec _ e + | EStateM.Result.ok a s => EStateM.Result.ok a s + +instance EIOEmpty.monadLift {ε} : HasMonadLift (EIO Empty) (EIO ε) := +{ monadLift := fun α => fromEmptyEIO } + +variables {m : Type → Type} [Monad m] [HasMonadLiftT (EIO Empty) m] + +@[inline] def mkRef {α : Type} (a : α) : m (Ref α) := liftM $ Prim.mkRef a +@[inline] def Ref.get {α : Type} (r : Ref α) : m α := liftM $ Prim.Ref.get r +@[inline] def Ref.set {α : Type} (r : Ref α) (a : α) : m Unit := liftM $ Prim.Ref.set r a +@[inline] def Ref.swap {α : Type} (r : Ref α) (a : α) : m α := liftM $ Prim.Ref.swap r a +@[inline] unsafe def Ref.take {α : Type} (r : Ref α) : m α := liftM $ Prim.Ref.take r +@[inline] def Ref.ptrEq {α : Type} (r1 r2 : Ref α) : m Bool := liftM $ Prim.Ref.ptrEq r1 r2 +@[inline] def Ref.modify {α : Type} (r : Ref α) (f : α → α) : m Unit := liftM $ Prim.Ref.modify r f +@[inline] def Ref.modifyGet {α : Type} {β : Type} (r : Ref α) (f : α → β × α) : m β := liftM $ Prim.Ref.modifyGet r f + end end IO diff --git a/stage0/src/Lean/Data/Options.lean b/stage0/src/Lean/Data/Options.lean index 71ba725e3a..be8a2306eb 100644 --- a/stage0/src/Lean/Data/Options.lean +++ b/stage0/src/Lean/Data/Options.lean @@ -23,6 +23,9 @@ structure OptionDecl := def OptionDecls := NameMap OptionDecl +instance OptionDecls.inhabited : Inhabited OptionDecls := +⟨({} : NameMap OptionDecl)⟩ + private def initOptionDeclsRef : IO (IO.Ref OptionDecls) := IO.mkRef (mkNameMap OptionDecl) diff --git a/stage0/stdlib/Init/Control/StateRef.c b/stage0/stdlib/Init/Control/StateRef.c index d2804a8840..ae24b3b7fb 100644 --- a/stage0/stdlib/Init/Control/StateRef.c +++ b/stage0/stdlib/Init/Control/StateRef.c @@ -13,10 +13,8 @@ #ifdef __cplusplus extern "C" { #endif -lean_object* l_IO_Prim_Ref_get___rarg___boxed(lean_object*, lean_object*); -lean_object* l_StateRefT_MonadStateOf(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_take___rarg___boxed(lean_object*, lean_object*); -lean_object* l_StateRefT_MonadStateOf___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_StateRefT_MonadStateOf(lean_object*, lean_object*, lean_object*); +lean_object* l_StateRefT_MonadStateOf___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_MonadIO___rarg(lean_object*); lean_object* l_StateRefT_set___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_lift___rarg(lean_object*, lean_object*); @@ -26,37 +24,40 @@ lean_object* l_StateRefT_set___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_run___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_ReaderT_Monad___rarg(lean_object*); lean_object* l_StateRefT_run___rarg___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_set___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_MonadExceptOf(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_MonadFunctor___rarg(lean_object*, lean_object*); -lean_object* l_StateRefT_modifyGet(lean_object*, lean_object*, lean_object*); +lean_object* l_StateRefT_modifyGet(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_get___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_run_x27___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_Monad(lean_object*, lean_object*); lean_object* l_StateRefT_get(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_run___rarg___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_run(lean_object*, lean_object*); +lean_object* l_StateRefT_modifyGet___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_get___rarg(lean_object*, lean_object*); -lean_object* l_IO_Ref_modifyGetUnsafe___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_lift___rarg___boxed(lean_object*, lean_object*); lean_object* l_StateRefT_Monad___rarg(lean_object*); lean_object* l_StateRefT_HasMonadLift___rarg(lean_object*, lean_object*); lean_object* l_ReaderT_MonadExceptOf___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_get___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_MonadFunctor(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_MonadIO(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_HasMonadLift(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_MonadExceptOf___rarg(lean_object*); lean_object* l_StateRefT_HasMonadLift___rarg___boxed(lean_object*, lean_object*); lean_object* l_StateRefT_run___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_mkRef___rarg(lean_object*, lean_object*); lean_object* l_StateRefT_lift(lean_object*, lean_object*, lean_object*); lean_object* l_ReaderT_monadIO___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_set___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_ReaderT_MonadExceptOf___rarg___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_StateRefT_MonadStateOf___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_ReaderT_MonadFunctor___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_run_x27___rarg___lambda__1(lean_object*, lean_object*); -lean_object* l_StateRefT_modifyGet___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_mkRef___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_StateRefT_modifyGet___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_StateRefT_MonadIO___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_StateRefT_MonadStateOf___rarg(lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modifyGetUnsafe___rarg___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_StateRefT_MonadStateOf___rarg(lean_object*); lean_object* l_StateRefT_run___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { @@ -78,8 +79,9 @@ lean_object* l_StateRefT_run___rarg___lambda__2(lean_object* x_1, lean_object* x _start: { lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; -x_6 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 1); -lean_closure_set(x_6, 0, x_1); +x_6 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___boxed), 3, 2); +lean_closure_set(x_6, 0, lean_box(0)); +lean_closure_set(x_6, 1, x_1); x_7 = lean_apply_2(x_2, lean_box(0), x_6); x_8 = lean_alloc_closure((void*)(l_StateRefT_run___rarg___lambda__1), 3, 2); lean_closure_set(x_8, 0, x_3); @@ -110,8 +112,9 @@ _start: lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; x_6 = lean_ctor_get(x_1, 1); lean_inc(x_6); -x_7 = lean_alloc_closure((void*)(l_IO_Prim_mkRef___rarg), 2, 1); -lean_closure_set(x_7, 0, x_5); +x_7 = lean_alloc_closure((void*)(l_IO_Prim_mkRef___boxed), 3, 2); +lean_closure_set(x_7, 0, lean_box(0)); +lean_closure_set(x_7, 1, x_5); lean_inc(x_2); x_8 = lean_apply_2(x_2, lean_box(0), x_7); lean_inc(x_6); @@ -155,8 +158,9 @@ _start: lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; x_6 = lean_ctor_get(x_1, 1); lean_inc(x_6); -x_7 = lean_alloc_closure((void*)(l_IO_Prim_mkRef___rarg), 2, 1); -lean_closure_set(x_7, 0, x_5); +x_7 = lean_alloc_closure((void*)(l_IO_Prim_mkRef___boxed), 3, 2); +lean_closure_set(x_7, 0, lean_box(0)); +lean_closure_set(x_7, 1, x_5); lean_inc(x_2); x_8 = lean_apply_2(x_2, lean_box(0), x_7); lean_inc(x_6); @@ -223,6 +227,31 @@ x_3 = lean_alloc_closure((void*)(l_StateRefT_Monad___rarg), 1, 0); return x_3; } } +lean_object* l_StateRefT_HasMonadLift___rarg(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_inc(x_1); +return x_1; +} +} +lean_object* l_StateRefT_HasMonadLift(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = lean_alloc_closure((void*)(l_StateRefT_HasMonadLift___rarg___boxed), 2, 0); +return x_4; +} +} +lean_object* l_StateRefT_HasMonadLift___rarg___boxed(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = l_StateRefT_HasMonadLift___rarg(x_1, x_2); +lean_dec(x_2); +lean_dec(x_1); +return x_3; +} +} lean_object* l_StateRefT_MonadIO___rarg(lean_object* x_1) { _start: { @@ -249,31 +278,6 @@ lean_dec(x_3); return x_4; } } -lean_object* l_StateRefT_HasMonadLift___rarg(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_inc(x_1); -return x_1; -} -} -lean_object* l_StateRefT_HasMonadLift(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = lean_alloc_closure((void*)(l_StateRefT_HasMonadLift___rarg___boxed), 2, 0); -return x_4; -} -} -lean_object* l_StateRefT_HasMonadLift___rarg___boxed(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = l_StateRefT_HasMonadLift___rarg(x_1, x_2); -lean_dec(x_2); -lean_dec(x_1); -return x_3; -} -} lean_object* l_StateRefT_MonadFunctor___rarg(lean_object* x_1, lean_object* x_2) { _start: { @@ -299,8 +303,9 @@ lean_object* l_StateRefT_get___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; lean_object* x_4; -x_3 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 1); -lean_closure_set(x_3, 0, x_2); +x_3 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___boxed), 3, 2); +lean_closure_set(x_3, 0, lean_box(0)); +lean_closure_set(x_3, 1, x_2); x_4 = lean_apply_2(x_1, lean_box(0), x_3); return x_4; } @@ -326,9 +331,10 @@ lean_object* l_StateRefT_set___rarg(lean_object* x_1, lean_object* x_2, lean_obj _start: { lean_object* x_4; lean_object* x_5; -x_4 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___rarg___boxed), 3, 2); -lean_closure_set(x_4, 0, x_3); -lean_closure_set(x_4, 1, x_2); +x_4 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___boxed), 4, 3); +lean_closure_set(x_4, 0, lean_box(0)); +lean_closure_set(x_4, 1, x_3); +lean_closure_set(x_4, 2, x_2); x_5 = lean_apply_2(x_1, lean_box(0), x_4); return x_5; } @@ -350,84 +356,79 @@ lean_dec(x_3); return x_4; } } -lean_object* l_StateRefT_modifyGet___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_StateRefT_modifyGet___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { -lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; -x_5 = lean_ctor_get(x_1, 1); -lean_inc(x_5); -lean_inc(x_4); -x_6 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___rarg___boxed), 2, 1); -lean_closure_set(x_6, 0, x_4); -lean_inc(x_2); -x_7 = lean_apply_2(x_2, lean_box(0), x_6); -lean_inc(x_5); -x_8 = lean_alloc_closure((void*)(l_IO_Ref_modifyGetUnsafe___rarg___lambda__1), 6, 5); -lean_closure_set(x_8, 0, x_3); -lean_closure_set(x_8, 1, x_4); -lean_closure_set(x_8, 2, x_2); -lean_closure_set(x_8, 3, x_1); -lean_closure_set(x_8, 4, x_5); -x_9 = lean_apply_4(x_5, lean_box(0), lean_box(0), x_7, x_8); -return x_9; +lean_object* x_4; lean_object* x_5; +x_4 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modifyGetUnsafe___rarg___boxed), 3, 2); +lean_closure_set(x_4, 0, x_3); +lean_closure_set(x_4, 1, x_2); +x_5 = lean_apply_2(x_1, lean_box(0), x_4); +return x_5; } } -lean_object* l_StateRefT_modifyGet(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_StateRefT_modifyGet(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_4; -x_4 = lean_alloc_closure((void*)(l_StateRefT_modifyGet___rarg), 4, 0); -return x_4; +lean_object* x_5; +x_5 = lean_alloc_closure((void*)(l_StateRefT_modifyGet___rarg), 3, 0); +return x_5; } } -lean_object* l_StateRefT_MonadStateOf___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_StateRefT_modifyGet___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; -x_6 = lean_ctor_get(x_1, 1); -lean_inc(x_6); -lean_inc(x_5); -x_7 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___rarg___boxed), 2, 1); -lean_closure_set(x_7, 0, x_5); -lean_inc(x_2); -x_8 = lean_apply_2(x_2, lean_box(0), x_7); -lean_inc(x_6); -x_9 = lean_alloc_closure((void*)(l_IO_Ref_modifyGetUnsafe___rarg___lambda__1), 6, 5); -lean_closure_set(x_9, 0, x_4); -lean_closure_set(x_9, 1, x_5); -lean_closure_set(x_9, 2, x_2); -lean_closure_set(x_9, 3, x_1); -lean_closure_set(x_9, 4, x_6); -x_10 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_8, x_9); -return x_10; +lean_object* x_5; +x_5 = l_StateRefT_modifyGet(x_1, x_2, x_3, x_4); +lean_dec(x_4); +return x_5; } } -lean_object* l_StateRefT_MonadStateOf___rarg(lean_object* x_1, lean_object* x_2) { +lean_object* l_StateRefT_MonadStateOf___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; -lean_inc(x_2); -x_3 = lean_alloc_closure((void*)(l_StateRefT_get___rarg), 2, 1); -lean_closure_set(x_3, 0, x_2); -lean_inc(x_2); -x_4 = lean_alloc_closure((void*)(l_StateRefT_set___rarg), 3, 1); -lean_closure_set(x_4, 0, x_2); -x_5 = lean_alloc_closure((void*)(l_StateRefT_MonadStateOf___rarg___lambda__1), 5, 2); -lean_closure_set(x_5, 0, x_1); -lean_closure_set(x_5, 1, x_2); -x_6 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_6, 0, x_3); -lean_ctor_set(x_6, 1, x_4); -lean_ctor_set(x_6, 2, x_5); +lean_object* x_5; lean_object* x_6; +x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modifyGetUnsafe___rarg___boxed), 3, 2); +lean_closure_set(x_5, 0, x_4); +lean_closure_set(x_5, 1, x_3); +x_6 = lean_apply_2(x_1, lean_box(0), x_5); return x_6; } } -lean_object* l_StateRefT_MonadStateOf(lean_object* x_1, lean_object* x_2) { +lean_object* l_StateRefT_MonadStateOf___rarg(lean_object* x_1) { _start: { -lean_object* x_3; -x_3 = lean_alloc_closure((void*)(l_StateRefT_MonadStateOf___rarg), 2, 0); -return x_3; +lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; +lean_inc(x_1); +x_2 = lean_alloc_closure((void*)(l_StateRefT_get___rarg), 2, 1); +lean_closure_set(x_2, 0, x_1); +lean_inc(x_1); +x_3 = lean_alloc_closure((void*)(l_StateRefT_set___rarg), 3, 1); +lean_closure_set(x_3, 0, x_1); +x_4 = lean_alloc_closure((void*)(l_StateRefT_MonadStateOf___rarg___lambda__1), 4, 1); +lean_closure_set(x_4, 0, x_1); +x_5 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_5, 0, x_2); +lean_ctor_set(x_5, 1, x_3); +lean_ctor_set(x_5, 2, x_4); +return x_5; +} +} +lean_object* l_StateRefT_MonadStateOf(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = lean_alloc_closure((void*)(l_StateRefT_MonadStateOf___rarg), 1, 0); +return x_4; +} +} +lean_object* l_StateRefT_MonadStateOf___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_StateRefT_MonadStateOf(x_1, x_2, x_3); +lean_dec(x_3); +return x_4; } } lean_object* l_StateRefT_MonadExceptOf___rarg(lean_object* x_1) { diff --git a/stage0/stdlib/Init/Data/Random.c b/stage0/stdlib/Init/Data/Random.c index 60979f48ad..c1e31488ec 100644 --- a/stage0/stdlib/Init/Data/Random.c +++ b/stage0/stdlib/Init/Data/Random.c @@ -21,7 +21,6 @@ lean_object* l___private_Init_Data_Random_1__randNatAux___main___rarg(lean_objec lean_object* l_stdNext___closed__170; lean_object* l_stdNext___closed__96; lean_object* l_StdGen_RandomGen; -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_stdNext___closed__99; lean_object* l_stdNext___closed__72; lean_object* l_mkStdGen___boxed(lean_object*); @@ -33,7 +32,6 @@ lean_object* l___private_Init_Data_Random_1__randNatAux___main(lean_object*); lean_object* l_stdNext___closed__80; lean_object* l_stdNext___closed__6; lean_object* l_stdNext___closed__50; -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_stdNext___closed__86; lean_object* l_stdNext___closed__154; lean_object* l_stdNext___closed__110; @@ -43,7 +41,9 @@ lean_object* l_stdNext___closed__91; lean_object* l_stdNext___closed__29; extern lean_object* l_Sigma_HasRepr___rarg___closed__1; lean_object* l_stdNext___closed__152; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_stdNext___closed__25; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_stdNext___closed__93; lean_object* l_stdNext___closed__22; lean_object* l_IO_mkStdGenRef___closed__1; @@ -90,11 +90,13 @@ lean_object* l_stdNext___closed__83; lean_object* l_stdNext___closed__36; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_stdNext___closed__104; +lean_object* l_StdGen_inhabited___closed__1; lean_object* l_stdNext___closed__122; lean_object* l_stdNext___closed__17; lean_object* l_stdNext___closed__27; lean_object* lean_int_mul(lean_object*, lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); +lean_object* l_StdGen_inhabited; lean_object* l_stdNext___closed__145; lean_object* l___private_Init_Data_Random_1__randNatAux___main___at_IO_rand___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_stdNext___closed__100; @@ -128,7 +130,6 @@ lean_object* l_stdNext___closed__60; lean_object* l_stdNext___closed__64; lean_object* l_stdNext___closed__88; lean_object* l_stdNext___closed__23; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_IO_stdGenRef; lean_object* l_stdNext___closed__144; extern lean_object* l_List_reprAux___main___rarg___closed__1; @@ -197,6 +198,7 @@ lean_object* l_randBool___rarg(lean_object*, lean_object*); lean_object* l_stdNext___closed__15; lean_object* l_stdNext___closed__126; lean_object* l_randNat___at_IO_rand___spec__1___boxed(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_stdNext___closed__30; lean_object* l_stdNext___closed__55; lean_object* l_stdNext___closed__125; @@ -247,6 +249,25 @@ lean_object* l_stdNext___closed__101; lean_object* l_mkStdGen(lean_object*); uint8_t lean_nat_dec_lt(lean_object*, lean_object*); lean_object* l_stdNext___closed__165; +lean_object* _init_l_StdGen_inhabited___closed__1() { +_start: +{ +lean_object* x_1; lean_object* x_2; +x_1 = lean_unsigned_to_nat(0u); +x_2 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_2, 0, x_1); +lean_ctor_set(x_2, 1, x_1); +return x_2; +} +} +lean_object* _init_l_StdGen_inhabited() { +_start: +{ +lean_object* x_1; +x_1 = l_StdGen_inhabited___closed__1; +return x_1; +} +} lean_object* _init_l_stdRange___closed__1() { _start: { @@ -2849,21 +2870,55 @@ return x_2; lean_object* l_IO_mkStdGenRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_IO_mkStdGenRef___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_IO_setRandSeed(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_3; lean_object* x_4; lean_object* x_5; +lean_object* x_3; lean_object* x_4; lean_object* x_5; uint8_t x_6; x_3 = l_mkStdGen(x_1); x_4 = l_IO_stdGenRef; x_5 = lean_io_ref_set(x_4, x_3, x_2); +x_6 = !lean_is_exclusive(x_5); +if (x_6 == 0) +{ return x_5; } +else +{ +lean_object* x_7; lean_object* x_8; lean_object* x_9; +x_7 = lean_ctor_get(x_5, 0); +x_8 = lean_ctor_get(x_5, 1); +lean_inc(x_8); +lean_inc(x_7); +lean_dec(x_5); +x_9 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_9, 0, x_7); +lean_ctor_set(x_9, 1, x_8); +return x_9; +} +} } lean_object* l_IO_setRandSeed___boxed(lean_object* x_1, lean_object* x_2) { _start: @@ -3261,6 +3316,10 @@ lean_dec_ref(res); res = initialize_Init_Data_Int(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; lean_dec_ref(res); +l_StdGen_inhabited___closed__1 = _init_l_StdGen_inhabited___closed__1(); +lean_mark_persistent(l_StdGen_inhabited___closed__1); +l_StdGen_inhabited = _init_l_StdGen_inhabited(); +lean_mark_persistent(l_StdGen_inhabited); l_stdRange___closed__1 = _init_l_stdRange___closed__1(); lean_mark_persistent(l_stdRange___closed__1); l_stdRange = _init_l_stdRange(); diff --git a/stage0/stdlib/Init/System/IO.c b/stage0/stdlib/Init/System/IO.c index 23721bd295..6ba6b83446 100644 --- a/stage0/stdlib/Init/System/IO.c +++ b/stage0/stdlib/Init/System/IO.c @@ -16,14 +16,8 @@ extern "C" { lean_object* l_IO_FS_linesAux___main___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_linesAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_putStrLn___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_get___rarg___boxed(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_set___rarg(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_exceptionFreeUnsafe___rarg(lean_object*, lean_object*); lean_object* l_allocprof___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Ref_modifyUnsafe___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_mkRef___boxed(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_take___rarg___boxed(lean_object*, lean_object*); extern uint8_t l_System_Platform_isWindows; lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2___boxed(lean_object*, lean_object*); lean_object* l_IO_appPath___rarg___closed__1; @@ -31,6 +25,7 @@ lean_object* lean_io_prim_handle_get_line(lean_object*, lean_object*); lean_object* lean_io_timeit(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IO_HasEval___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_io_prim_handle_is_eof(lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modify(lean_object*); lean_object* l_IO_Prim_iterate___main(lean_object*, lean_object*); lean_object* l_IO_Ref_set___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_chmod(lean_object*, uint32_t, lean_object*); @@ -39,7 +34,6 @@ lean_object* l_IO_println(lean_object*); lean_object* l_Lean_Unit_hasEval(lean_object*); lean_object* l_IO_currentDir___rarg___closed__1; lean_object* l_IO_Prim_fopenFlags___closed__12; -lean_object* l_IO_Prim_Ref_takeCore___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_stderr___boxed(lean_object*); lean_object* l_EIO_Monad___closed__1; lean_object* l_IO_FS_Handle_read___boxed(lean_object*, lean_object*); @@ -48,41 +42,42 @@ lean_object* l_IO_FS_withFile___rarg(lean_object*, lean_object*, lean_object*, l lean_object* lean_io_is_dir(lean_object*, lean_object*); lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2(lean_object*, lean_object*); lean_object* l_IO_Prim_stdin___boxed(lean_object*); -lean_object* l_IO_Prim_Ref_setCore___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_putStr___rarg(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_io_prim_handle_put_str(lean_object*, lean_object*, lean_object*); lean_object* l_IO_stdout___rarg(lean_object*); lean_object* l_IO_getEnv___rarg(lean_object*, lean_object*); -lean_object* l___private_Init_System_IO_1__exceptionFree___rarg(lean_object*, lean_object*); lean_object* l_IO_toEIO(lean_object*, lean_object*); +lean_object* l_IO_EIOEmpty_monadLift(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_getLine___rarg(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_mk___boxed(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; +lean_object* l_IO_Ref_inhabited(lean_object*, lean_object*); lean_object* l_IO_Ref_ptrEq___boxed(lean_object*, lean_object*); -lean_object* l_IO_Prim_mkRef(lean_object*); +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_StateT_monadIO___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_MonadIO___rarg(lean_object*, lean_object*); lean_object* l_unsafeIO___rarg(lean_object*); uint32_t l_UInt32_shiftLeft(uint32_t, uint32_t); lean_object* l_IO_FS_Handle_write(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_get(lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_IO_print(lean_object*); lean_object* l_IO_stdin(lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_set___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_flush___rarg(lean_object*, lean_object*); extern lean_object* l_Unit_HasRepr___closed__1; lean_object* l_IO_Prim_withIsolatedStreams___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Ref_get___boxed(lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modify___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_stdout(lean_object*, lean_object*); lean_object* l_IO_Prim_Handle_mk___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_readToEnd(lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); -lean_object* l_IO_Ref_modifyGetUnsafe___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modifyGet___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_IO_fileExists___boxed(lean_object*, lean_object*); lean_object* l_IO_Ref_swap___boxed(lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__6; lean_object* l_IO_FS_Handle_readToEnd___rarg(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_take___boxed(lean_object*, lean_object*, lean_object*); extern lean_object* l_String_splitAux___main___closed__1; lean_object* l_Lean_Unit_hasEval___boxed(lean_object*); lean_object* l_IO_isDir(lean_object*, lean_object*); @@ -91,15 +86,16 @@ lean_object* l_EIO_Inhabited(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_putStr___boxed(lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__11; lean_object* l_IO_print___at_IO_println___spec__1___rarg___lambda__1(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modify___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_lines___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_io_getenv(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_take(lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__13; lean_object* l_IO_setAccessRights(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Ref_get___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_eprintln(lean_object*); -lean_object* l_IO_Prim_Ref_swapCore___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_Handle_isEof___boxed(lean_object*, lean_object*); +lean_object* l_IO_Ref_inhabited___boxed(lean_object*, lean_object*); lean_object* l_Lean_HasRepr_hasEval___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_getLine___boxed(lean_object*, lean_object*); lean_object* l_IO_eprint___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -113,7 +109,6 @@ lean_object* l_IO_Ref_take___boxed(lean_object*, lean_object*); lean_object* l_EStateM_Inhabited___rarg(lean_object*, lean_object*); lean_object* l_IO_FS_linesAux___main(lean_object*); lean_object* l_IO_lazyPure___rarg(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_ptrEq___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_AccessRight_flags___boxed(lean_object*); lean_object* l_IO_Ref_get(lean_object*, lean_object*); lean_object* l_IO_stdin___rarg(lean_object*); @@ -121,17 +116,13 @@ lean_object* l_IO_Prim_realPath___boxed(lean_object*, lean_object*); lean_object* l_IO_appDir(lean_object*); lean_object* l_EIO_toIO___rarg(lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__1; -lean_object* l_IO_Prim_Ref_ptrEqCore___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Ref_modifyGet___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Ref_modifyGet___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__9; lean_object* l_IO_appPath___rarg(lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__2; -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_IO_Ref_set___boxed(lean_object*, lean_object*); -lean_object* lean_io_ref_ptr_eq(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_swap___rarg(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_MonadIO(lean_object*); +lean_object* l_IO_Ref_modifyGet___boxed(lean_object*, lean_object*); lean_object* l_IO_stdout___at_Lean_HasRepr_hasEval___spec__3(lean_object*); lean_object* l_IO_FS_Handle_read___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_stderr___rarg___closed__1; @@ -139,6 +130,7 @@ lean_object* l_IO_println___at_Lean_HasRepr_hasEval___spec__1(lean_object*, lean uint32_t l_IO_AccessRight_flags___closed__4; lean_object* lean_io_current_dir(lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__10; +lean_object* l_IO_Prim_Ref_modifyUnsafe___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_EIO_MonadExceptOf___closed__1; lean_object* l_IO_print___at_IO_println___spec__1(lean_object*); lean_object* l_IO_FS_Handle_write___rarg(lean_object*, lean_object*, lean_object*); @@ -146,17 +138,15 @@ lean_object* l_IO_realPath___boxed(lean_object*, lean_object*); lean_object* l_IO_Ref_take(lean_object*, lean_object*); lean_object* lean_io_realpath(lean_object*, lean_object*); lean_object* l_System_FilePath_dirName(lean_object*); -lean_object* l_IO_Ref_modifyUnsafe___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_stdin___rarg___closed__1; lean_object* l_IO_FS_Handle_readToEndAux___main___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags(uint8_t, uint8_t); lean_object* l_ReaderT_monadIO___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_eprintln___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_linesAux___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Inhabited(lean_object*); lean_object* l_IO_stderr___boxed(lean_object*, lean_object*); lean_object* l_EIO_MonadExceptOf___closed__2; -lean_object* l_IO_Ref_modify___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Ref_modify___rarg(lean_object*, lean_object*, lean_object*, lean_object*); uint32_t l_String_back(lean_object*); lean_object* l_IO_Prim_Handle_write___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_io_allocprof(lean_object*, lean_object*, lean_object*); @@ -166,9 +156,8 @@ lean_object* l_IO_FS_Handle_getLine(lean_object*, lean_object*); lean_object* l_IO_eprint(lean_object*); lean_object* l_IO_FS_Handle_readToEndAux___main___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_appPath___boxed(lean_object*, lean_object*); -lean_object* l_IO_Ref_modifyGetUnsafe___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_monadExceptAdapter___closed__1; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_EIOEmpty_monadLift___rarg(lean_object*, lean_object*); lean_object* l_IO_initializing___boxed(lean_object*); lean_object* l_IO_println___at_Lean_HasRepr_hasEval___spec__1___boxed(lean_object*, lean_object*); lean_object* lean_get_stderr(lean_object*); @@ -177,12 +166,11 @@ lean_object* l_IO_Prim_iterate___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_mk(lean_object*, lean_object*); lean_object* l_EIO_toIO(lean_object*, lean_object*); lean_object* l_IO_FS_linesAux(lean_object*); -lean_object* l_IO_Prim_Ref_ptrEq___rarg(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_exceptionFreeUnsafe(lean_object*); lean_object* l_IO_Prim_Handle_getLine___boxed(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_mk___rarg(lean_object*, lean_object*, uint8_t, uint8_t); lean_object* l_IO_println___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_stdout___rarg___closed__1; +lean_object* l_monadIOSelf___rarg(lean_object*, lean_object*); lean_object* l_IO_Prim_stdout___boxed(lean_object*); lean_object* l_IO_isDir___boxed(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_readToEndAux___rarg(lean_object*, lean_object*, lean_object*, lean_object*); @@ -190,23 +178,24 @@ lean_object* l_IO_fileExists___rarg(lean_object*, lean_object*); lean_object* l_StateT_monadIO(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_isEof(lean_object*, lean_object*); lean_object* l_IO_realPath___rarg(lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_get___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__6; lean_object* l_IO_Prim_appPath___boxed(lean_object*); lean_object* l_IO_FileRight_flags___boxed(lean_object*); uint32_t l_IO_AccessRight_flags___closed__11; lean_object* l_ReaderT_monadIO___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Ref_modify(lean_object*); +lean_object* l_IO_Ref_modify(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_read(lean_object*, lean_object*); lean_object* l_String_dropRight(lean_object*, lean_object*); lean_object* l_EIO_catchExceptions(lean_object*, lean_object*); lean_object* l_IO_setAccessRights___boxed(lean_object*, lean_object*, lean_object*); size_t lean_usize_of_nat(lean_object*); lean_object* l_IO_print___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l___private_Init_System_IO_1__exceptionFree(lean_object*); +lean_object* l_IO_Prim_Ref_modifyUnsafe___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_ofExcept___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fileExists___boxed(lean_object*, lean_object*); lean_object* l_IO_print___at_IO_println___spec__1___rarg(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_getCore___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modifyGetUnsafe___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_readFile___rarg___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_IO_realPath(lean_object*, lean_object*); lean_object* lean_io_prim_handle_write(lean_object*, lean_object*, lean_object*); @@ -226,60 +215,62 @@ lean_object* l_IO_Prim_setAccessRights___boxed(lean_object*, lean_object*, lean_ lean_object* l_IO_isDir___rarg(lean_object*, lean_object*); lean_object* l_IO_getEnv(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_readToEndAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_get___rarg(lean_object*, lean_object*); lean_object* l_IO_Ref_take___rarg(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Ref_modify___boxed(lean_object*, lean_object*); lean_object* l_IO_eprint___at_IO_eprintln___spec__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_lazyPure(lean_object*); lean_object* l_EStateM_Monad(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_mk___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_MonadExcept_orelse___at_EIO_HasOrelse___spec__1___rarg(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_ptrEq(lean_object*); +lean_object* lean_io_ref_ptr_eq(lean_object*, lean_object*, lean_object*); +lean_object* l___private_Init_System_IO_2__fromEmptyEIO___rarg(lean_object*, lean_object*); lean_object* l_IO_Prim_currentDir___boxed(lean_object*); lean_object* l_IO_FS_Handle_write___boxed(lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__5; lean_object* l_IO_FS_Handle_putStr___at_Lean_HasRepr_hasEval___spec__4___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__14; lean_object* l_IO_FS_Handle_readToEndAux___main(lean_object*); -lean_object* l_IO_Prim_mkRef___rarg(lean_object*, lean_object*); lean_object* l_EIO_MonadExceptOf(lean_object*); lean_object* l_IO_FS_readFile___rarg(lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags(lean_object*); lean_object* l_unsafeIO(lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__3; -lean_object* l_IO_Prim_Ref_swap(lean_object*); +lean_object* lean_io_ref_swap(lean_object*, lean_object*, lean_object*); lean_object* l_IO_getEnv___boxed(lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modifyGetUnsafe(lean_object*, lean_object*); +lean_object* l_monadIOSelf(lean_object*); lean_object* l_IO_Ref_swap(lean_object*, lean_object*); lean_object* l_IO_Ref_ptrEq(lean_object*, lean_object*); -lean_object* l_IO_Ref_modifyGetUnsafe(lean_object*); lean_object* l_IO_toEIO___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_Handle_putStrLn(lean_object*); lean_object* l_ReaderT_monadIO___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_lines___rarg___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* lean_get_stdout(lean_object*); lean_object* l_EStateM_MonadExceptOf___rarg(lean_object*); -lean_object* l_IO_Prim_Ref_swap___rarg___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_set(lean_object*); +lean_object* l_IO_Prim_Ref_swap___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_modifyUnsafe(lean_object*); +lean_object* l_IO_Prim_Ref_modifyGet(lean_object*, lean_object*); lean_object* l_IO_eprint___at_IO_eprintln___spec__1(lean_object*); lean_object* l_IO_appDir___rarg___lambda__1(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_read___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_EStateM_monadExceptAdapter(lean_object*, lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__10; lean_object* l_Lean_Unit_hasEval___rarg(uint8_t, lean_object*); +lean_object* l___private_Init_System_IO_2__fromEmptyEIO(lean_object*, lean_object*); lean_object* lean_io_prim_handle_flush(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_set___rarg___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Ref_modifyGet(lean_object*); +lean_object* l_IO_Ref_modifyGet(lean_object*, lean_object*); uint32_t l_UInt32_lor(uint32_t, uint32_t); lean_object* l_IO_Prim_fopenFlags___closed__4; -lean_object* l_IO_Ref_modifyUnsafe(lean_object*); lean_object* l_IO_appPath(lean_object*, lean_object*); lean_object* l_IO_Ref_set(lean_object*, lean_object*); lean_object* lean_io_initializing(lean_object*); -lean_object* l_IO_Prim_mkRefCore___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_monadExceptAdapter(lean_object*, lean_object*); lean_object* l_IO_FS_readFile(lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__9; lean_object* lean_string_length(lean_object*); lean_object* l_IO_mkRef(lean_object*, lean_object*); +lean_object* l_IO_Prim_Ref_ptrEq___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_MonadExcept_orelse___at_EIO_HasOrelse___spec__1(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_isEof___boxed(lean_object*, lean_object*); lean_object* l_IO_Ref_ptrEq___rarg(lean_object*, lean_object*, lean_object*, lean_object*); @@ -297,9 +288,8 @@ lean_object* l_IO_Prim_fopenFlags___boxed(lean_object*, lean_object*); lean_object* l_IO_mkRef___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_HasRepr_hasEval___rarg(lean_object*, lean_object*, uint8_t, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__1; -lean_object* l_ReaderT_Monad___rarg___lambda__4___boxed(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_Prim_mkRef___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_FS_withFile___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_take___rarg(lean_object*, lean_object*); lean_object* lean_io_prim_handle_read(lean_object*, size_t, lean_object*); lean_object* l_IO_FS_lines(lean_object*); lean_object* l_IO_stderr(lean_object*, lean_object*); @@ -307,12 +297,13 @@ lean_object* l_IO_fileExists(lean_object*, lean_object*); lean_object* l_IO_FS_Handle_flush___boxed(lean_object*, lean_object*); lean_object* l_IO_print___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_fopenFlags___closed__2; -lean_object* l_IO_RefPointed(lean_object*); -lean_object* lean_io_ref_swap(lean_object*, lean_object*, lean_object*); +lean_object* l_IO_RefPointed; +lean_object* l_IO_Prim_Ref_modifyGet___rarg___boxed(lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__5; lean_object* lean_io_prim_handle_mk(lean_object*, lean_object*, lean_object*); lean_object* l_IO_appDir___rarg(lean_object*, lean_object*); lean_object* l_IO_currentDir___rarg(lean_object*); +lean_object* l_IO_Prim_Ref_modifyGetUnsafe___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_IO_Prim_iterate___main___rarg(lean_object*, lean_object*, lean_object*); uint32_t l_IO_AccessRight_flags___closed__7; uint32_t l_IO_FileRight_flags(lean_object*); @@ -689,7 +680,7 @@ x_2 = lean_io_initializing(x_1); return x_2; } } -lean_object* l_IO_MonadIO___rarg(lean_object* x_1, lean_object* x_2) { +lean_object* l_monadIOSelf___rarg(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; @@ -697,11 +688,11 @@ x_3 = lean_apply_1(x_1, x_2); return x_3; } } -lean_object* l_IO_MonadIO(lean_object* x_1) { +lean_object* l_monadIOSelf(lean_object* x_1) { _start: { lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_MonadIO___rarg), 2, 0); +x_2 = lean_alloc_closure((void*)(l_monadIOSelf___rarg), 2, 0); return x_2; } } @@ -2640,55 +2631,32 @@ lean_dec(x_1); return x_4; } } -lean_object* l_IO_RefPointed(lean_object* x_1) { +lean_object* _init_l_IO_RefPointed() { _start: { -lean_object* x_2; -x_2 = lean_box(0); -return x_2; +lean_object* x_1; +x_1 = lean_box(0); +return x_1; } } -lean_object* l_IO_Inhabited(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_box(0); -return x_2; -} -} -lean_object* l_IO_Prim_exceptionFreeUnsafe___rarg(lean_object* x_1, lean_object* x_2) { +lean_object* l_IO_Ref_inhabited(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; -x_3 = lean_apply_1(x_1, x_2); +x_3 = lean_box(0); return x_3; } } -lean_object* l_IO_Prim_exceptionFreeUnsafe(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Prim_exceptionFreeUnsafe___rarg), 2, 0); -return x_2; -} -} -lean_object* l___private_Init_System_IO_1__exceptionFree___rarg(lean_object* x_1, lean_object* x_2) { +lean_object* l_IO_Ref_inhabited___boxed(lean_object* x_1, lean_object* x_2) { _start: { lean_object* x_3; -x_3 = lean_apply_1(x_1, x_2); +x_3 = l_IO_Ref_inhabited(x_1, x_2); +lean_dec(x_2); return x_3; } } -lean_object* l___private_Init_System_IO_1__exceptionFree(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l___private_Init_System_IO_1__exceptionFree___rarg), 2, 0); -return x_2; -} -} -lean_object* l_IO_Prim_mkRefCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_Prim_mkRef___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; @@ -2696,23 +2664,7 @@ x_4 = lean_io_mk_ref(x_2, x_3); return x_4; } } -lean_object* l_IO_Prim_mkRef___rarg(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = lean_io_mk_ref(x_1, x_2); -return x_3; -} -} -lean_object* l_IO_Prim_mkRef(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Prim_mkRef___rarg), 2, 0); -return x_2; -} -} -lean_object* l_IO_Prim_Ref_getCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_Prim_Ref_get___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; @@ -2721,32 +2673,7 @@ lean_dec(x_2); return x_4; } } -lean_object* l_IO_Prim_Ref_get___rarg(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = lean_io_ref_get(x_1, x_2); -return x_3; -} -} -lean_object* l_IO_Prim_Ref_get(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 0); -return x_2; -} -} -lean_object* l_IO_Prim_Ref_get___rarg___boxed(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = l_IO_Prim_Ref_get___rarg(x_1, x_2); -lean_dec(x_1); -return x_3; -} -} -lean_object* l_IO_Prim_Ref_setCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_IO_Prim_Ref_set___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; @@ -2755,32 +2682,7 @@ lean_dec(x_2); return x_5; } } -lean_object* l_IO_Prim_Ref_set___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = lean_io_ref_set(x_1, x_2, x_3); -return x_4; -} -} -lean_object* l_IO_Prim_Ref_set(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___rarg___boxed), 3, 0); -return x_2; -} -} -lean_object* l_IO_Prim_Ref_set___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = l_IO_Prim_Ref_set___rarg(x_1, x_2, x_3); -lean_dec(x_1); -return x_4; -} -} -lean_object* l_IO_Prim_Ref_swapCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_IO_Prim_Ref_swap___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; @@ -2789,32 +2691,7 @@ lean_dec(x_2); return x_5; } } -lean_object* l_IO_Prim_Ref_swap___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = lean_io_ref_swap(x_1, x_2, x_3); -return x_4; -} -} -lean_object* l_IO_Prim_Ref_swap(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_swap___rarg___boxed), 3, 0); -return x_2; -} -} -lean_object* l_IO_Prim_Ref_swap___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { -_start: -{ -lean_object* x_4; -x_4 = l_IO_Prim_Ref_swap___rarg(x_1, x_2, x_3); -lean_dec(x_1); -return x_4; -} -} -lean_object* l_IO_Prim_Ref_takeCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_Prim_Ref_take___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; @@ -2823,32 +2700,7 @@ lean_dec(x_2); return x_4; } } -lean_object* l_IO_Prim_Ref_take___rarg(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = lean_io_ref_take(x_1, x_2); -return x_3; -} -} -lean_object* l_IO_Prim_Ref_take(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___rarg___boxed), 2, 0); -return x_2; -} -} -lean_object* l_IO_Prim_Ref_take___rarg___boxed(lean_object* x_1, lean_object* x_2) { -_start: -{ -lean_object* x_3; -x_3 = l_IO_Prim_Ref_take___rarg(x_1, x_2); -lean_dec(x_1); -return x_3; -} -} -lean_object* l_IO_Prim_Ref_ptrEqCore___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_IO_Prim_Ref_ptrEq___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { lean_object* x_5; @@ -2858,38 +2710,417 @@ lean_dec(x_2); return x_5; } } -lean_object* l_IO_Prim_Ref_ptrEq___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_Prim_Ref_modifyUnsafe___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; -x_4 = lean_io_ref_ptr_eq(x_1, x_2, x_3); +x_4 = lean_io_ref_take(x_1, x_3); +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); +lean_dec(x_4); +x_7 = lean_apply_1(x_2, x_5); +x_8 = lean_io_ref_set(x_1, x_7, x_6); +return x_8; +} +else +{ +uint8_t x_9; +lean_dec(x_2); +x_9 = !lean_is_exclusive(x_4); +if (x_9 == 0) +{ return x_4; } +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_4, 0); +x_11 = lean_ctor_get(x_4, 1); +lean_inc(x_11); +lean_inc(x_10); +lean_dec(x_4); +x_12 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +return x_12; } -lean_object* l_IO_Prim_Ref_ptrEq(lean_object* x_1) { +} +} +} +lean_object* l_IO_Prim_Ref_modifyUnsafe(lean_object* x_1) { _start: { lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_ptrEq___rarg___boxed), 3, 0); +x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modifyUnsafe___rarg___boxed), 3, 0); return x_2; } } -lean_object* l_IO_Prim_Ref_ptrEq___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +lean_object* l_IO_Prim_Ref_modifyUnsafe___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; -x_4 = l_IO_Prim_Ref_ptrEq___rarg(x_1, x_2, x_3); -lean_dec(x_2); +x_4 = l_IO_Prim_Ref_modifyUnsafe___rarg(x_1, x_2, x_3); lean_dec(x_1); return x_4; } } +lean_object* l_IO_Prim_Ref_modifyGetUnsafe___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = lean_io_ref_take(x_1, x_3); +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); +lean_dec(x_4); +x_7 = lean_apply_1(x_2, x_5); +x_8 = lean_ctor_get(x_7, 0); +lean_inc(x_8); +x_9 = lean_ctor_get(x_7, 1); +lean_inc(x_9); +lean_dec(x_7); +x_10 = lean_io_ref_set(x_1, x_9, x_6); +if (lean_obj_tag(x_10) == 0) +{ +uint8_t x_11; +x_11 = !lean_is_exclusive(x_10); +if (x_11 == 0) +{ +lean_object* x_12; +x_12 = lean_ctor_get(x_10, 0); +lean_dec(x_12); +lean_ctor_set(x_10, 0, x_8); +return x_10; +} +else +{ +lean_object* x_13; lean_object* x_14; +x_13 = lean_ctor_get(x_10, 1); +lean_inc(x_13); +lean_dec(x_10); +x_14 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_14, 0, x_8); +lean_ctor_set(x_14, 1, x_13); +return x_14; +} +} +else +{ +uint8_t x_15; +lean_dec(x_8); +x_15 = !lean_is_exclusive(x_10); +if (x_15 == 0) +{ +return x_10; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_10, 0); +x_17 = lean_ctor_get(x_10, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_10); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +else +{ +uint8_t x_19; +lean_dec(x_2); +x_19 = !lean_is_exclusive(x_4); +if (x_19 == 0) +{ +return x_4; +} +else +{ +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_4, 0); +x_21 = lean_ctor_get(x_4, 1); +lean_inc(x_21); +lean_inc(x_20); +lean_dec(x_4); +x_22 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_22, 0, x_20); +lean_ctor_set(x_22, 1, x_21); +return x_22; +} +} +} +} +lean_object* l_IO_Prim_Ref_modifyGetUnsafe(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modifyGetUnsafe___rarg___boxed), 3, 0); +return x_3; +} +} +lean_object* l_IO_Prim_Ref_modifyGetUnsafe___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_IO_Prim_Ref_modifyGetUnsafe___rarg(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} +lean_object* l_IO_Prim_Ref_modify___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = lean_io_ref_get(x_1, x_3); +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); +lean_dec(x_4); +x_7 = lean_apply_1(x_2, x_5); +x_8 = lean_io_ref_set(x_1, x_7, x_6); +return x_8; +} +else +{ +uint8_t x_9; +lean_dec(x_2); +x_9 = !lean_is_exclusive(x_4); +if (x_9 == 0) +{ +return x_4; +} +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_4, 0); +x_11 = lean_ctor_get(x_4, 1); +lean_inc(x_11); +lean_inc(x_10); +lean_dec(x_4); +x_12 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +return x_12; +} +} +} +} +lean_object* l_IO_Prim_Ref_modify(lean_object* x_1) { +_start: +{ +lean_object* x_2; +x_2 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modify___rarg___boxed), 3, 0); +return x_2; +} +} +lean_object* l_IO_Prim_Ref_modify___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_IO_Prim_Ref_modify___rarg(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} +lean_object* l_IO_Prim_Ref_modifyGet___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = lean_io_ref_get(x_1, x_3); +if (lean_obj_tag(x_4) == 0) +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_5 = lean_ctor_get(x_4, 0); +lean_inc(x_5); +x_6 = lean_ctor_get(x_4, 1); +lean_inc(x_6); +lean_dec(x_4); +x_7 = lean_apply_1(x_2, x_5); +x_8 = lean_ctor_get(x_7, 0); +lean_inc(x_8); +x_9 = lean_ctor_get(x_7, 1); +lean_inc(x_9); +lean_dec(x_7); +x_10 = lean_io_ref_set(x_1, x_9, x_6); +if (lean_obj_tag(x_10) == 0) +{ +uint8_t x_11; +x_11 = !lean_is_exclusive(x_10); +if (x_11 == 0) +{ +lean_object* x_12; +x_12 = lean_ctor_get(x_10, 0); +lean_dec(x_12); +lean_ctor_set(x_10, 0, x_8); +return x_10; +} +else +{ +lean_object* x_13; lean_object* x_14; +x_13 = lean_ctor_get(x_10, 1); +lean_inc(x_13); +lean_dec(x_10); +x_14 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_14, 0, x_8); +lean_ctor_set(x_14, 1, x_13); +return x_14; +} +} +else +{ +uint8_t x_15; +lean_dec(x_8); +x_15 = !lean_is_exclusive(x_10); +if (x_15 == 0) +{ +return x_10; +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_10, 0); +x_17 = lean_ctor_get(x_10, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_10); +x_18 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +} +else +{ +uint8_t x_19; +lean_dec(x_2); +x_19 = !lean_is_exclusive(x_4); +if (x_19 == 0) +{ +return x_4; +} +else +{ +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_4, 0); +x_21 = lean_ctor_get(x_4, 1); +lean_inc(x_21); +lean_inc(x_20); +lean_dec(x_4); +x_22 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_22, 0, x_20); +lean_ctor_set(x_22, 1, x_21); +return x_22; +} +} +} +} +lean_object* l_IO_Prim_Ref_modifyGet(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modifyGet___rarg___boxed), 3, 0); +return x_3; +} +} +lean_object* l_IO_Prim_Ref_modifyGet___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_IO_Prim_Ref_modifyGet___rarg(x_1, x_2, x_3); +lean_dec(x_1); +return x_4; +} +} +lean_object* l___private_Init_System_IO_2__fromEmptyEIO___rarg(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; uint8_t x_4; +x_3 = lean_apply_1(x_1, x_2); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ +return x_3; +} +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} +} +lean_object* l___private_Init_System_IO_2__fromEmptyEIO(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = lean_alloc_closure((void*)(l___private_Init_System_IO_2__fromEmptyEIO___rarg), 2, 0); +return x_3; +} +} +lean_object* l_IO_EIOEmpty_monadLift___rarg(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; uint8_t x_4; +x_3 = lean_apply_1(x_1, x_2); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ +return x_3; +} +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} +} +lean_object* l_IO_EIOEmpty_monadLift(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = lean_alloc_closure((void*)(l_IO_EIOEmpty_monadLift___rarg), 2, 0); +return x_3; +} +} lean_object* l_IO_mkRef___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { lean_object* x_4; lean_object* x_5; -x_4 = lean_alloc_closure((void*)(l_IO_Prim_mkRef___rarg), 2, 1); -lean_closure_set(x_4, 0, x_3); +x_4 = lean_alloc_closure((void*)(l_IO_Prim_mkRef___boxed), 3, 2); +lean_closure_set(x_4, 0, lean_box(0)); +lean_closure_set(x_4, 1, x_3); x_5 = lean_apply_2(x_1, lean_box(0), x_4); return x_5; } @@ -2915,8 +3146,9 @@ lean_object* l_IO_Ref_get___rarg(lean_object* x_1, lean_object* x_2, lean_object _start: { lean_object* x_4; lean_object* x_5; -x_4 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 1); -lean_closure_set(x_4, 0, x_3); +x_4 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___boxed), 3, 2); +lean_closure_set(x_4, 0, lean_box(0)); +lean_closure_set(x_4, 1, x_3); x_5 = lean_apply_2(x_1, lean_box(0), x_4); return x_5; } @@ -2942,9 +3174,10 @@ lean_object* l_IO_Ref_set___rarg(lean_object* x_1, lean_object* x_2, lean_object _start: { lean_object* x_5; lean_object* x_6; -x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___rarg___boxed), 3, 2); -lean_closure_set(x_5, 0, x_3); -lean_closure_set(x_5, 1, x_4); +x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___boxed), 4, 3); +lean_closure_set(x_5, 0, lean_box(0)); +lean_closure_set(x_5, 1, x_3); +lean_closure_set(x_5, 2, x_4); x_6 = lean_apply_2(x_1, lean_box(0), x_5); return x_6; } @@ -2970,9 +3203,10 @@ lean_object* l_IO_Ref_swap___rarg(lean_object* x_1, lean_object* x_2, lean_objec _start: { lean_object* x_5; lean_object* x_6; -x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_swap___rarg___boxed), 3, 2); -lean_closure_set(x_5, 0, x_3); -lean_closure_set(x_5, 1, x_4); +x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_swap___boxed), 4, 3); +lean_closure_set(x_5, 0, lean_box(0)); +lean_closure_set(x_5, 1, x_3); +lean_closure_set(x_5, 2, x_4); x_6 = lean_apply_2(x_1, lean_box(0), x_5); return x_6; } @@ -2998,8 +3232,9 @@ lean_object* l_IO_Ref_take___rarg(lean_object* x_1, lean_object* x_2, lean_objec _start: { lean_object* x_4; lean_object* x_5; -x_4 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___rarg___boxed), 2, 1); -lean_closure_set(x_4, 0, x_3); +x_4 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___boxed), 3, 2); +lean_closure_set(x_4, 0, lean_box(0)); +lean_closure_set(x_4, 1, x_3); x_5 = lean_apply_2(x_1, lean_box(0), x_4); return x_5; } @@ -3025,9 +3260,10 @@ lean_object* l_IO_Ref_ptrEq___rarg(lean_object* x_1, lean_object* x_2, lean_obje _start: { lean_object* x_5; lean_object* x_6; -x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_ptrEq___rarg___boxed), 3, 2); -lean_closure_set(x_5, 0, x_3); -lean_closure_set(x_5, 1, x_4); +x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_ptrEq___boxed), 4, 3); +lean_closure_set(x_5, 0, lean_box(0)); +lean_closure_set(x_5, 1, x_3); +lean_closure_set(x_5, 2, x_4); x_6 = lean_apply_2(x_1, lean_box(0), x_5); return x_6; } @@ -3049,153 +3285,60 @@ lean_dec(x_2); return x_3; } } -lean_object* l_IO_Ref_modifyUnsafe___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_IO_Ref_modify___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_5; lean_object* x_6; lean_object* x_7; -x_5 = lean_apply_1(x_1, x_4); -x_6 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___rarg___boxed), 3, 2); -lean_closure_set(x_6, 0, x_2); +lean_object* x_5; lean_object* x_6; +x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modifyUnsafe___rarg___boxed), 3, 2); +lean_closure_set(x_5, 0, x_3); +lean_closure_set(x_5, 1, x_4); +x_6 = lean_apply_2(x_1, lean_box(0), x_5); +return x_6; +} +} +lean_object* l_IO_Ref_modify(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = lean_alloc_closure((void*)(l_IO_Ref_modify___rarg), 4, 0); +return x_3; +} +} +lean_object* l_IO_Ref_modify___boxed(lean_object* x_1, lean_object* x_2) { +_start: +{ +lean_object* x_3; +x_3 = l_IO_Ref_modify(x_1, x_2); +lean_dec(x_2); +return x_3; +} +} +lean_object* l_IO_Ref_modifyGet___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +_start: +{ +lean_object* x_6; lean_object* x_7; +x_6 = lean_alloc_closure((void*)(l_IO_Prim_Ref_modifyGetUnsafe___rarg___boxed), 3, 2); +lean_closure_set(x_6, 0, x_4); lean_closure_set(x_6, 1, x_5); -x_7 = lean_apply_2(x_3, lean_box(0), x_6); +x_7 = lean_apply_2(x_1, lean_box(0), x_6); return x_7; } } -lean_object* l_IO_Ref_modifyUnsafe___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_IO_Ref_modifyGet(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; -x_6 = lean_ctor_get(x_1, 1); -lean_inc(x_6); -lean_dec(x_1); -lean_inc(x_4); -x_7 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___rarg___boxed), 2, 1); -lean_closure_set(x_7, 0, x_4); -lean_inc(x_2); -x_8 = lean_apply_2(x_2, lean_box(0), x_7); -x_9 = lean_alloc_closure((void*)(l_IO_Ref_modifyUnsafe___rarg___lambda__1), 4, 3); -lean_closure_set(x_9, 0, x_5); -lean_closure_set(x_9, 1, x_4); -lean_closure_set(x_9, 2, x_2); -x_10 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_8, x_9); -return x_10; +lean_object* x_3; +x_3 = lean_alloc_closure((void*)(l_IO_Ref_modifyGet___rarg), 5, 0); +return x_3; } } -lean_object* l_IO_Ref_modifyUnsafe(lean_object* x_1) { +lean_object* l_IO_Ref_modifyGet___boxed(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Ref_modifyUnsafe___rarg), 5, 0); -return x_2; -} -} -lean_object* l_IO_Ref_modifyGetUnsafe___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { -_start: -{ -lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; -x_7 = lean_apply_1(x_1, x_6); -x_8 = lean_ctor_get(x_7, 0); -lean_inc(x_8); -x_9 = lean_ctor_get(x_7, 1); -lean_inc(x_9); -lean_dec(x_7); -x_10 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___rarg___boxed), 3, 2); -lean_closure_set(x_10, 0, x_2); -lean_closure_set(x_10, 1, x_9); -x_11 = lean_apply_2(x_3, lean_box(0), x_10); -x_12 = lean_alloc_closure((void*)(l_ReaderT_Monad___rarg___lambda__4___boxed), 3, 2); -lean_closure_set(x_12, 0, x_4); -lean_closure_set(x_12, 1, x_8); -x_13 = lean_apply_4(x_5, lean_box(0), lean_box(0), x_11, x_12); -return x_13; -} -} -lean_object* l_IO_Ref_modifyGetUnsafe___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { -_start: -{ -lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; -x_7 = lean_ctor_get(x_1, 1); -lean_inc(x_7); -lean_inc(x_5); -x_8 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___rarg___boxed), 2, 1); -lean_closure_set(x_8, 0, x_5); -lean_inc(x_2); -x_9 = lean_apply_2(x_2, lean_box(0), x_8); -lean_inc(x_7); -x_10 = lean_alloc_closure((void*)(l_IO_Ref_modifyGetUnsafe___rarg___lambda__1), 6, 5); -lean_closure_set(x_10, 0, x_6); -lean_closure_set(x_10, 1, x_5); -lean_closure_set(x_10, 2, x_2); -lean_closure_set(x_10, 3, x_1); -lean_closure_set(x_10, 4, x_7); -x_11 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_9, x_10); -return x_11; -} -} -lean_object* l_IO_Ref_modifyGetUnsafe(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Ref_modifyGetUnsafe___rarg), 6, 0); -return x_2; -} -} -lean_object* l_IO_Ref_modify___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { -_start: -{ -lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; -x_6 = lean_ctor_get(x_1, 1); -lean_inc(x_6); -lean_dec(x_1); -lean_inc(x_4); -x_7 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 1); -lean_closure_set(x_7, 0, x_4); -lean_inc(x_2); -x_8 = lean_apply_2(x_2, lean_box(0), x_7); -x_9 = lean_alloc_closure((void*)(l_IO_Ref_modifyUnsafe___rarg___lambda__1), 4, 3); -lean_closure_set(x_9, 0, x_5); -lean_closure_set(x_9, 1, x_4); -lean_closure_set(x_9, 2, x_2); -x_10 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_8, x_9); -return x_10; -} -} -lean_object* l_IO_Ref_modify(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Ref_modify___rarg), 5, 0); -return x_2; -} -} -lean_object* l_IO_Ref_modifyGet___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) { -_start: -{ -lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; -x_7 = lean_ctor_get(x_1, 1); -lean_inc(x_7); -lean_inc(x_5); -x_8 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 1); -lean_closure_set(x_8, 0, x_5); -lean_inc(x_2); -x_9 = lean_apply_2(x_2, lean_box(0), x_8); -lean_inc(x_7); -x_10 = lean_alloc_closure((void*)(l_IO_Ref_modifyGetUnsafe___rarg___lambda__1), 6, 5); -lean_closure_set(x_10, 0, x_6); -lean_closure_set(x_10, 1, x_5); -lean_closure_set(x_10, 2, x_2); -lean_closure_set(x_10, 3, x_1); -lean_closure_set(x_10, 4, x_7); -x_11 = lean_apply_4(x_7, lean_box(0), lean_box(0), x_9, x_10); -return x_11; -} -} -lean_object* l_IO_Ref_modifyGet(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_IO_Ref_modifyGet___rarg), 6, 0); -return x_2; +lean_object* x_3; +x_3 = l_IO_Ref_modifyGet(x_1, x_2); +lean_dec(x_2); +return x_3; } } lean_object* l_IO_stdout___at_Lean_HasRepr_hasEval___spec__3(lean_object* x_1) { @@ -3551,6 +3694,8 @@ l_IO_AccessRight_flags___closed__10 = _init_l_IO_AccessRight_flags___closed__10( l_IO_AccessRight_flags___closed__11 = _init_l_IO_AccessRight_flags___closed__11(); l_IO_AccessRight_flags___closed__12 = _init_l_IO_AccessRight_flags___closed__12(); l_IO_AccessRight_flags___closed__13 = _init_l_IO_AccessRight_flags___closed__13(); +l_IO_RefPointed = _init_l_IO_RefPointed(); +lean_mark_persistent(l_IO_RefPointed); return lean_mk_io_result(lean_box(0)); } #ifdef __cplusplus diff --git a/stage0/stdlib/Lean/Attributes.c b/stage0/stdlib/Lean/Attributes.c index a40811956a..a3f0ff6f41 100644 --- a/stage0/stdlib/Lean/Attributes.c +++ b/stage0/stdlib/Lean/Attributes.c @@ -22,7 +22,6 @@ lean_object* l_Lean_EnumAttributes_getValue___rarg___boxed(lean_object*, lean_ob lean_object* l_Lean_mkAttributeExtension___closed__1; lean_object* l_Lean_registerEnumAttributes___rarg___lambda__1___boxed(lean_object*, lean_object*); size_t l_USize_add(size_t, size_t); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_attrParamSyntaxToIdentifier___boxed(lean_object*); lean_object* l_Lean_registerTagAttribute___closed__3; lean_object* l_Std_RBNode_fold___main___at_Lean_registerParametricAttribute___spec__1___rarg(lean_object*, lean_object*); @@ -52,7 +51,6 @@ lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerTagAttribute___ uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); uint8_t l_Std_PersistentHashMap_containsAtAux___main___at_Lean_Environment_contains___spec__5(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__7___rarg(lean_object*, lean_object*); lean_object* l_Lean_mkAttributeExtension___closed__8; lean_object* lean_array_uset(lean_object*, size_t, lean_object*); @@ -75,6 +73,8 @@ lean_object* lean_environment_find(lean_object*, lean_object*); lean_object* l_Std_RBNode_fold___main___at_Lean_registerEnumAttributes___spec__1___rarg(lean_object*, lean_object*); lean_object* l_Lean_registerTagAttribute___closed__1; lean_object* l_Std_PersistentHashMap_insertAux___main___at_Lean_registerBuiltinAttribute___spec__4(lean_object*, size_t, size_t, lean_object*, lean_object*); +lean_object* lean_io_mk_ref(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at___private_Lean_Attributes_2__AttributeExtension_addImported___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_registerEnumAttributes___spec__8(lean_object*); lean_object* l_Std_mkHashMap___at_Lean_mkAttributeImplBuilderTable___spec__1(lean_object*); @@ -110,6 +110,7 @@ lean_object* l_Lean_attributeExtension___elambda__2___boxed(lean_object*); lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_registerParametricAttribute___spec__3___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_binSearchAux___main___at_Lean_EnumAttributes_getValue___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_ParametricAttribute_Inhabited___closed__2; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9(lean_object*); uint8_t l_Std_AssocList_contains___main___at_Lean_registerAttributeImplBuilder___spec__2(lean_object*, lean_object*); lean_object* l_Lean_mkAttributeImplOfConstantUnsafe___closed__3; @@ -150,7 +151,6 @@ lean_object* l_Std_PersistentHashMap_insertAtCollisionNodeAux___main___at_Lean_r lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_getBuiltinAttributeImpl___spec__1(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_Std_PersistentArray_forM___at_Lean_Core_runCore___spec__4(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_mkAttributeExtension___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_TagAttribute_Inhabited___closed__1; extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; @@ -201,7 +201,6 @@ lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_ lean_object* l_Array_qsortAux___main___at_Lean_mkTagDeclarationExtension___spec__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_registerEnumAttributes___spec__7(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_ParametricAttribute_setParam(lean_object*); lean_object* l_Lean_attributeExtension___closed__1; extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; @@ -328,6 +327,7 @@ lean_object* l_Std_HashMapImp_expand___at_Lean_registerAttributeImplBuilder___sp lean_object* lean_push_scope(lean_object*, lean_object*, uint8_t, lean_object*); lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); extern lean_object* l_Lean_TraceState_Inhabited___closed__1; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerParametricAttribute___rarg___lambda__3___boxed(lean_object*, lean_object*); lean_object* l___private_Lean_Attributes_1__AttributeExtension_mkInitial(lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; @@ -570,11 +570,28 @@ return x_8; lean_object* l_Lean_mkAttributeMapRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_LocalContext_Inhabited___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } uint8_t l_Std_PersistentHashMap_containsAux___main___at_Lean_registerBuiltinAttribute___spec__2(lean_object* x_1, size_t x_2, lean_object* x_3) { _start: @@ -1211,7 +1228,7 @@ return x_18; } else { -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_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; uint8_t x_25; x_19 = lean_ctor_get(x_10, 1); lean_inc(x_19); lean_dec(x_10); @@ -1223,28 +1240,20 @@ lean_inc(x_22); lean_dec(x_20); x_23 = l_Std_PersistentHashMap_insert___at_Lean_registerBuiltinAttribute___spec__3(x_21, x_8, x_1); x_24 = lean_io_ref_set(x_3, x_23, x_22); -return x_24; -} -} -else -{ -uint8_t x_25; -lean_dec(x_8); -lean_dec(x_1); -x_25 = !lean_is_exclusive(x_10); +x_25 = !lean_is_exclusive(x_24); if (x_25 == 0) { -return x_10; +return x_24; } else { lean_object* x_26; lean_object* x_27; lean_object* x_28; -x_26 = lean_ctor_get(x_10, 0); -x_27 = lean_ctor_get(x_10, 1); +x_26 = lean_ctor_get(x_24, 0); +x_27 = lean_ctor_get(x_24, 1); lean_inc(x_27); lean_inc(x_26); -lean_dec(x_10); -x_28 = lean_alloc_ctor(1, 2, 0); +lean_dec(x_24); +x_28 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_28, 0, x_26); lean_ctor_set(x_28, 1, x_27); return x_28; @@ -1253,133 +1262,177 @@ return x_28; } else { -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_29; +lean_dec(x_8); lean_dec(x_1); -x_29 = l_Lean_Name_toString___closed__1; -x_30 = l_Lean_Name_toStringWithSep___main(x_29, x_8); -x_31 = l_Lean_registerBuiltinAttribute___closed__3; -x_32 = lean_string_append(x_31, x_30); -lean_dec(x_30); -x_33 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__3; -x_34 = lean_string_append(x_32, x_33); -x_35 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_35, 0, x_34); +x_29 = !lean_is_exclusive(x_10); +if (x_29 == 0) +{ +return x_10; +} +else +{ +lean_object* x_30; lean_object* x_31; lean_object* x_32; +x_30 = lean_ctor_get(x_10, 0); +x_31 = lean_ctor_get(x_10, 1); +lean_inc(x_31); +lean_inc(x_30); +lean_dec(x_10); +x_32 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_32, 0, x_30); +lean_ctor_set(x_32, 1, x_31); +return x_32; +} +} +} +else +{ +lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; +lean_dec(x_1); +x_33 = l_Lean_Name_toString___closed__1; +x_34 = l_Lean_Name_toStringWithSep___main(x_33, x_8); +x_35 = l_Lean_registerBuiltinAttribute___closed__3; +x_36 = lean_string_append(x_35, x_34); +lean_dec(x_34); +x_37 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__3; +x_38 = lean_string_append(x_36, x_37); +x_39 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_39, 0, x_38); lean_ctor_set_tag(x_4, 1); -lean_ctor_set(x_4, 0, x_35); +lean_ctor_set(x_4, 0, x_39); return x_4; } } else { -lean_object* x_36; lean_object* x_37; lean_object* x_38; uint8_t x_39; -x_36 = lean_ctor_get(x_4, 0); -x_37 = lean_ctor_get(x_4, 1); -lean_inc(x_37); -lean_inc(x_36); -lean_dec(x_4); -x_38 = lean_ctor_get(x_1, 0); -lean_inc(x_38); -x_39 = l_Std_PersistentHashMap_contains___at_Lean_registerBuiltinAttribute___spec__1(x_36, x_38); -if (x_39 == 0) -{ -lean_object* x_40; -x_40 = lean_io_initializing(x_37); -if (lean_obj_tag(x_40) == 0) -{ -lean_object* x_41; uint8_t x_42; -x_41 = lean_ctor_get(x_40, 0); +lean_object* x_40; lean_object* x_41; lean_object* x_42; uint8_t x_43; +x_40 = lean_ctor_get(x_4, 0); +x_41 = lean_ctor_get(x_4, 1); lean_inc(x_41); -x_42 = lean_unbox(x_41); -lean_dec(x_41); -if (x_42 == 0) +lean_inc(x_40); +lean_dec(x_4); +x_42 = lean_ctor_get(x_1, 0); +lean_inc(x_42); +x_43 = l_Std_PersistentHashMap_contains___at_Lean_registerBuiltinAttribute___spec__1(x_40, x_42); +if (x_43 == 0) { -lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; -lean_dec(x_38); +lean_object* x_44; +x_44 = lean_io_initializing(x_41); +if (lean_obj_tag(x_44) == 0) +{ +lean_object* x_45; uint8_t x_46; +x_45 = lean_ctor_get(x_44, 0); +lean_inc(x_45); +x_46 = lean_unbox(x_45); +lean_dec(x_45); +if (x_46 == 0) +{ +lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; +lean_dec(x_42); lean_dec(x_1); -x_43 = lean_ctor_get(x_40, 1); -lean_inc(x_43); -if (lean_is_exclusive(x_40)) { - lean_ctor_release(x_40, 0); - lean_ctor_release(x_40, 1); - x_44 = x_40; -} else { - lean_dec_ref(x_40); - x_44 = lean_box(0); -} -x_45 = l_Lean_registerBuiltinAttribute___closed__2; -if (lean_is_scalar(x_44)) { - x_46 = lean_alloc_ctor(1, 2, 0); -} else { - x_46 = x_44; - lean_ctor_set_tag(x_46, 1); -} -lean_ctor_set(x_46, 0, x_45); -lean_ctor_set(x_46, 1, x_43); -return x_46; -} -else -{ -lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; lean_object* x_51; lean_object* x_52; -x_47 = lean_ctor_get(x_40, 1); +x_47 = lean_ctor_get(x_44, 1); lean_inc(x_47); -lean_dec(x_40); -x_48 = lean_io_ref_take(x_3, x_47); -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 = l_Std_PersistentHashMap_insert___at_Lean_registerBuiltinAttribute___spec__3(x_49, x_38, x_1); -x_52 = lean_io_ref_set(x_3, x_51, x_50); -return x_52; +if (lean_is_exclusive(x_44)) { + lean_ctor_release(x_44, 0); + lean_ctor_release(x_44, 1); + x_48 = x_44; +} else { + lean_dec_ref(x_44); + x_48 = lean_box(0); } +x_49 = l_Lean_registerBuiltinAttribute___closed__2; +if (lean_is_scalar(x_48)) { + x_50 = lean_alloc_ctor(1, 2, 0); +} else { + x_50 = x_48; + lean_ctor_set_tag(x_50, 1); +} +lean_ctor_set(x_50, 0, x_49); +lean_ctor_set(x_50, 1, x_47); +return x_50; } else { -lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; -lean_dec(x_38); -lean_dec(x_1); -x_53 = lean_ctor_get(x_40, 0); +lean_object* x_51; lean_object* x_52; lean_object* x_53; lean_object* x_54; lean_object* x_55; lean_object* x_56; lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; +x_51 = lean_ctor_get(x_44, 1); +lean_inc(x_51); +lean_dec(x_44); +x_52 = lean_io_ref_take(x_3, x_51); +x_53 = lean_ctor_get(x_52, 0); lean_inc(x_53); -x_54 = lean_ctor_get(x_40, 1); +x_54 = lean_ctor_get(x_52, 1); lean_inc(x_54); -if (lean_is_exclusive(x_40)) { - lean_ctor_release(x_40, 0); - lean_ctor_release(x_40, 1); - x_55 = x_40; +lean_dec(x_52); +x_55 = l_Std_PersistentHashMap_insert___at_Lean_registerBuiltinAttribute___spec__3(x_53, x_42, x_1); +x_56 = lean_io_ref_set(x_3, x_55, x_54); +x_57 = lean_ctor_get(x_56, 0); +lean_inc(x_57); +x_58 = lean_ctor_get(x_56, 1); +lean_inc(x_58); +if (lean_is_exclusive(x_56)) { + lean_ctor_release(x_56, 0); + lean_ctor_release(x_56, 1); + x_59 = x_56; } else { - lean_dec_ref(x_40); - x_55 = lean_box(0); + lean_dec_ref(x_56); + x_59 = lean_box(0); } -if (lean_is_scalar(x_55)) { - x_56 = lean_alloc_ctor(1, 2, 0); +if (lean_is_scalar(x_59)) { + x_60 = lean_alloc_ctor(0, 2, 0); } else { - x_56 = x_55; + x_60 = x_59; } -lean_ctor_set(x_56, 0, x_53); -lean_ctor_set(x_56, 1, x_54); -return x_56; +lean_ctor_set(x_60, 0, x_57); +lean_ctor_set(x_60, 1, x_58); +return x_60; } } else { -lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; +lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64; +lean_dec(x_42); lean_dec(x_1); -x_57 = l_Lean_Name_toString___closed__1; -x_58 = l_Lean_Name_toStringWithSep___main(x_57, x_38); -x_59 = l_Lean_registerBuiltinAttribute___closed__3; -x_60 = lean_string_append(x_59, x_58); -lean_dec(x_58); -x_61 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__3; -x_62 = lean_string_append(x_60, x_61); -x_63 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_63, 0, x_62); -x_64 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_64, 0, x_63); -lean_ctor_set(x_64, 1, x_37); +x_61 = lean_ctor_get(x_44, 0); +lean_inc(x_61); +x_62 = lean_ctor_get(x_44, 1); +lean_inc(x_62); +if (lean_is_exclusive(x_44)) { + lean_ctor_release(x_44, 0); + lean_ctor_release(x_44, 1); + x_63 = x_44; +} else { + lean_dec_ref(x_44); + x_63 = lean_box(0); +} +if (lean_is_scalar(x_63)) { + x_64 = lean_alloc_ctor(1, 2, 0); +} else { + x_64 = x_63; +} +lean_ctor_set(x_64, 0, x_61); +lean_ctor_set(x_64, 1, x_62); return x_64; } } +else +{ +lean_object* x_65; lean_object* x_66; lean_object* x_67; lean_object* x_68; lean_object* x_69; lean_object* x_70; lean_object* x_71; lean_object* x_72; +lean_dec(x_1); +x_65 = l_Lean_Name_toString___closed__1; +x_66 = l_Lean_Name_toStringWithSep___main(x_65, x_42); +x_67 = l_Lean_registerBuiltinAttribute___closed__3; +x_68 = lean_string_append(x_67, x_66); +lean_dec(x_66); +x_69 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__3; +x_70 = lean_string_append(x_68, x_69); +x_71 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_71, 0, x_70); +x_72 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_72, 0, x_71); +lean_ctor_set(x_72, 1, x_41); +return x_72; +} +} } } lean_object* l_Std_PersistentHashMap_containsAux___main___at_Lean_registerBuiltinAttribute___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { @@ -1449,11 +1502,28 @@ return x_2; lean_object* l_Lean_mkAttributeImplBuilderTable(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_mkAttributeImplBuilderTable___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } uint8_t l_Std_AssocList_contains___main___at_Lean_registerAttributeImplBuilder___spec__2(lean_object* x_1, lean_object* x_2) { _start: @@ -1812,7 +1882,7 @@ x_9 = l_Std_HashMapImp_contains___at_Lean_registerAttributeImplBuilder___spec__1 lean_dec(x_7); if (x_9 == 0) { -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; +lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15; lean_free_object(x_5); x_10 = lean_io_ref_take(x_4, x_8); x_11 = lean_ctor_get(x_10, 0); @@ -1822,66 +1892,102 @@ lean_inc(x_12); lean_dec(x_10); x_13 = l_Std_HashMapImp_insert___at_Lean_registerAttributeImplBuilder___spec__3(x_11, x_1, x_2); x_14 = lean_io_ref_set(x_4, x_13, x_12); +x_15 = !lean_is_exclusive(x_14); +if (x_15 == 0) +{ return x_14; } else { -lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_14, 0); +x_17 = lean_ctor_get(x_14, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_14); +x_18 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +else +{ +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_dec(x_2); -x_15 = l_Lean_Name_toString___closed__1; -x_16 = l_Lean_Name_toStringWithSep___main(x_15, x_1); -x_17 = l_Lean_registerAttributeImplBuilder___closed__1; -x_18 = lean_string_append(x_17, x_16); -lean_dec(x_16); -x_19 = l_Lean_registerAttributeImplBuilder___closed__2; -x_20 = lean_string_append(x_18, x_19); -x_21 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_21, 0, x_20); +x_19 = l_Lean_Name_toString___closed__1; +x_20 = l_Lean_Name_toStringWithSep___main(x_19, x_1); +x_21 = l_Lean_registerAttributeImplBuilder___closed__1; +x_22 = lean_string_append(x_21, x_20); +lean_dec(x_20); +x_23 = l_Lean_registerAttributeImplBuilder___closed__2; +x_24 = lean_string_append(x_22, x_23); +x_25 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_25, 0, x_24); lean_ctor_set_tag(x_5, 1); -lean_ctor_set(x_5, 0, x_21); +lean_ctor_set(x_5, 0, x_25); return x_5; } } else { -lean_object* x_22; lean_object* x_23; uint8_t x_24; -x_22 = lean_ctor_get(x_5, 0); -x_23 = lean_ctor_get(x_5, 1); -lean_inc(x_23); -lean_inc(x_22); -lean_dec(x_5); -x_24 = l_Std_HashMapImp_contains___at_Lean_registerAttributeImplBuilder___spec__1(x_22, x_1); -lean_dec(x_22); -if (x_24 == 0) -{ -lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; -x_25 = lean_io_ref_take(x_4, x_23); -x_26 = lean_ctor_get(x_25, 0); -lean_inc(x_26); -x_27 = lean_ctor_get(x_25, 1); +lean_object* x_26; lean_object* x_27; uint8_t x_28; +x_26 = lean_ctor_get(x_5, 0); +x_27 = lean_ctor_get(x_5, 1); lean_inc(x_27); -lean_dec(x_25); -x_28 = l_Std_HashMapImp_insert___at_Lean_registerAttributeImplBuilder___spec__3(x_26, x_1, x_2); -x_29 = lean_io_ref_set(x_4, x_28, x_27); -return x_29; +lean_inc(x_26); +lean_dec(x_5); +x_28 = l_Std_HashMapImp_contains___at_Lean_registerAttributeImplBuilder___spec__1(x_26, x_1); +lean_dec(x_26); +if (x_28 == 0) +{ +lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; +x_29 = lean_io_ref_take(x_4, x_27); +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_29); +x_32 = l_Std_HashMapImp_insert___at_Lean_registerAttributeImplBuilder___spec__3(x_30, x_1, x_2); +x_33 = lean_io_ref_set(x_4, x_32, x_31); +x_34 = lean_ctor_get(x_33, 0); +lean_inc(x_34); +x_35 = lean_ctor_get(x_33, 1); +lean_inc(x_35); +if (lean_is_exclusive(x_33)) { + lean_ctor_release(x_33, 0); + lean_ctor_release(x_33, 1); + x_36 = x_33; +} else { + lean_dec_ref(x_33); + x_36 = lean_box(0); +} +if (lean_is_scalar(x_36)) { + x_37 = lean_alloc_ctor(0, 2, 0); +} else { + x_37 = x_36; +} +lean_ctor_set(x_37, 0, x_34); +lean_ctor_set(x_37, 1, x_35); +return x_37; } else { -lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; +lean_object* x_38; lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_dec(x_2); -x_30 = l_Lean_Name_toString___closed__1; -x_31 = l_Lean_Name_toStringWithSep___main(x_30, x_1); -x_32 = l_Lean_registerAttributeImplBuilder___closed__1; -x_33 = lean_string_append(x_32, x_31); -lean_dec(x_31); -x_34 = l_Lean_registerAttributeImplBuilder___closed__2; -x_35 = lean_string_append(x_33, x_34); -x_36 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_36, 0, x_35); -x_37 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_37, 0, x_36); -lean_ctor_set(x_37, 1, x_23); -return x_37; +x_38 = l_Lean_Name_toString___closed__1; +x_39 = l_Lean_Name_toStringWithSep___main(x_38, x_1); +x_40 = l_Lean_registerAttributeImplBuilder___closed__1; +x_41 = lean_string_append(x_40, x_39); +lean_dec(x_39); +x_42 = l_Lean_registerAttributeImplBuilder___closed__2; +x_43 = lean_string_append(x_41, x_42); +x_44 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_44, 0, x_43); +x_45 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_45, 0, x_44); +lean_ctor_set(x_45, 1, x_27); +return x_45; } } } diff --git a/stage0/stdlib/Lean/Class.c b/stage0/stdlib/Lean/Class.c index da0895f73a..237790edd7 100644 --- a/stage0/stdlib/Lean/Class.c +++ b/stage0/stdlib/Lean/Class.c @@ -42,7 +42,6 @@ uint8_t l_Std_PersistentHashMap_containsAtAux___main___at_Lean_Environment_conta lean_object* l_Lean_SMap_contains___at_Lean_isClass___spec__1___boxed(lean_object*, lean_object*); lean_object* l_Lean_isOutParam___closed__2; lean_object* l_Lean_registerClassAttr___lambda__1___closed__6; -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_insert___at_Lean_ClassState_addEntry___spec__19(lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_ClassState_addEntry___spec__33(size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_uset(lean_object*, size_t, lean_object*); @@ -59,6 +58,7 @@ lean_object* l_Std_PersistentHashMap_insertAux___main___at_Lean_ClassState_addEn lean_object* l___private_Lean_Class_2__consumeNLambdas___main(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_ClassState_addEntry___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkClassExtension___spec__7___closed__2; +lean_object* lean_io_ref_get(lean_object*, lean_object*); uint8_t l_Lean_ClassEntry_lt(lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkClassExtension___spec__7___closed__1; lean_object* l_Lean_SMap_switch___at_Lean_ClassState_switch___spec__1(lean_object*); @@ -80,6 +80,7 @@ lean_object* l_Std_AssocList_foldlM___main___at_Lean_ClassState_addEntry___spec_ lean_object* l_Std_PersistentHashMap_empty___at_Lean_ClassState_Inhabited___spec__3; lean_object* l_Std_mkHashMap___at_Lean_ClassState_Inhabited___spec__5(lean_object*); size_t l_USize_shiftRight(size_t, size_t); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_contains___at_Lean_isClass___spec__3___boxed(lean_object*, lean_object*); lean_object* l_Lean_classExtension___elambda__3___boxed(lean_object*, lean_object*); lean_object* l_Lean_SMap_contains___at_Lean_isInstance___spec__1___boxed(lean_object*, lean_object*); @@ -110,7 +111,6 @@ lean_object* l_Lean_classExtension___closed__6; lean_object* l_Lean_registerClassAttr___lambda__1___closed__1; lean_object* lean_array_fget(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_classExtension___closed__2; lean_object* l_Lean_ClassState_Inhabited___closed__1; lean_object* l_Lean_getClassName___main(lean_object*, lean_object*); @@ -141,7 +141,6 @@ extern lean_object* l_Char_HasRepr___closed__1; lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_hasOutParams___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_insertAtCollisionNodeAux___main___at_Lean_ClassState_addEntry___spec__4(lean_object*, lean_object*, lean_object*, uint8_t); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); uint8_t l_Std_AssocList_contains___main___at_Lean_ClassState_addEntry___spec__35(lean_object*, lean_object*); lean_object* l_Lean_ClassState_Inhabited; lean_object* l_Lean_addClass(lean_object*, lean_object*); @@ -233,6 +232,7 @@ lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_mkClassExtension___spec lean_object* l_Std_AssocList_replace___main___at_Lean_ClassState_addEntry___spec__39(lean_object*, lean_object*, lean_object*); lean_object* l_Std_mkHashMap___at_Lean_ClassState_Inhabited___spec__2(lean_object*); uint8_t l_Array_anyRangeMAux___main___at___private_Lean_Class_1__checkOutParam___main___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_SMap_empty___at_Lean_ClassState_Inhabited___spec__4___closed__2; lean_object* l_Lean_SMap_insert___at_Lean_ClassState_addEntry___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Std_AssocList_contains___main___at_Lean_ClassState_addEntry___spec__35___boxed(lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Compiler/ClosedTermCache.c b/stage0/stdlib/Lean/Compiler/ClosedTermCache.c index 9fa4e21a1e..6e70ff7ca3 100644 --- a/stage0/stdlib/Lean/Compiler/ClosedTermCache.c +++ b/stage0/stdlib/Lean/Compiler/ClosedTermCache.c @@ -27,7 +27,6 @@ lean_object* l_Lean_mkClosedTermCacheExtension___closed__5; lean_object* lean_array_uget(lean_object*, size_t); lean_object* l_Std_PersistentHashMap_insertAtCollisionNodeAux___main___at_Lean_mkClosedTermCacheExtension___spec__4(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_getClosedTermName_x3f___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_uset(lean_object*, size_t, lean_object*); @@ -35,6 +34,7 @@ size_t l_USize_sub(size_t, size_t); extern lean_object* l_Array_empty___closed__1; lean_object* l_Std_AssocList_find_x3f___main___at_Lean_getClosedTermName_x3f___spec__6___boxed(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_getClosedTermName_x3f___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_closedTermCacheExt___elambda__2(lean_object*); lean_object* l_Lean_closedTermCacheExt___closed__7; lean_object* lean_array_push(lean_object*, lean_object*); @@ -45,6 +45,7 @@ lean_object* l_Lean_closedTermCacheExt___closed__5; size_t l_USize_shiftRight(size_t, size_t); lean_object* l_Lean_mkClosedTermCacheExtension___lambda__2___boxed(lean_object*); lean_object* l_Std_PersistentHashMap_findAux___main___at_Lean_getClosedTermName_x3f___spec__3___boxed(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Std_HashMapImp_insert___at_Lean_mkClosedTermCacheExtension___spec__6(lean_object*, lean_object*, lean_object*); lean_object* lean_nat_add(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_mkClosedTermCacheExtension___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -58,7 +59,6 @@ lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___lambda__2(lean lean_object* l_Std_HashMapImp_moveEntries___main___at_Lean_mkClosedTermCacheExtension___spec__9(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerSimplePersistentEnvExtension___at_Lean_mkClosedTermCacheExtension___spec__19(lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_SMap_find_x3f___at_Lean_getClosedTermName_x3f___spec__1(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_mkClosedTermCacheExtension___spec__17(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; @@ -78,7 +78,6 @@ lean_object* l_Std_mkHashMapImp___rarg(lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_mkClosedTermCacheExtension___spec__21___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t l_Lean_Expr_hash(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_insert___at_Lean_mkClosedTermCacheExtension___spec__2(lean_object*, lean_object*, lean_object*); extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkClosedTermCacheExtension___spec__22(lean_object*, lean_object*); @@ -115,6 +114,7 @@ uint8_t l_Std_AssocList_contains___main___at_Lean_mkClosedTermCacheExtension___s lean_object* l_Std_AssocList_replace___main___at_Lean_mkClosedTermCacheExtension___spec__11(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_empty___at_Lean_mkClosedTermCacheExtension___spec__14___closed__1; lean_object* l_Lean_mkClosedTermCacheExtension___closed__2; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_getClosedTermName_x3f___spec__2(lean_object*, lean_object*); lean_object* l_Lean_closedTermCacheExt___closed__2; lean_object* l_Array_iterateMAux___main___at_Lean_mkClosedTermCacheExtension___spec__5(size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Compiler/ExportAttr.c b/stage0/stdlib/Lean/Compiler/ExportAttr.c index 0b6b50e2eb..f9ff639fe8 100644 --- a/stage0/stdlib/Lean/Compiler/ExportAttr.c +++ b/stage0/stdlib/Lean/Compiler/ExportAttr.c @@ -29,12 +29,12 @@ lean_object* l_Lean_mkExportAttr___lambda__1___closed__6; lean_object* l_Lean_mkExportAttr___closed__1; uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_mkExportAttr___spec__4___closed__1; lean_object* l_Lean_mkExportAttr___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_RBNode_fold___main___at_Lean_mkExportAttr___spec__2(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; uint8_t l_Char_isDigit(uint32_t); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkExportAttr___spec__7(lean_object*, lean_object*); lean_object* l_Substring_nextn___main(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkExportAttr___lambda__1___closed__3; @@ -49,6 +49,7 @@ extern lean_object* l_Lean_Name_inhabited; lean_object* l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1___closed__1; lean_object* l_Lean_ParametricAttribute_getParam___at_Lean_getExportNameFor___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_string_utf8_byte_size(lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_mkExportAttr___lambda__1___closed__2; lean_object* lean_nat_add(lean_object*, lean_object*); extern lean_object* l___private_Lean_Environment_8__persistentEnvExtensionsRef; @@ -60,7 +61,6 @@ lean_object* l_Array_qsortAux___main___at_Lean_mkExportAttr___spec__3(lean_objec lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Lean_mkExportAttr___closed__4; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_mkExportAttr___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); @@ -71,7 +71,6 @@ lean_object* l_Lean_isExport___closed__2; lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerParametricAttribute___rarg___lambda__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkExportAttr___lambda__1___closed__4; uint32_t lean_string_utf8_get(lean_object*, lean_object*); lean_object* l_Array_qsortAux___main___at_Lean_mkExportAttr___spec__3___boxed(lean_object*, lean_object*, lean_object*); @@ -97,6 +96,7 @@ extern lean_object* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; lean_object* l___private_Lean_Compiler_ExportAttr_2__isValidCppName___main___boxed(lean_object*); uint8_t l___private_Lean_Compiler_ExportAttr_1__isValidCppId(lean_object*); lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkExportAttr___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; lean_object* l_Lean_mkExportAttr___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Compiler/ExternAttr.c b/stage0/stdlib/Lean/Compiler/ExternAttr.c index 098e86c43d..4163b0ed91 100644 --- a/stage0/stdlib/Lean/Compiler/ExternAttr.c +++ b/stage0/stdlib/Lean/Compiler/ExternAttr.c @@ -26,7 +26,6 @@ lean_object* l_Lean_mkExternAttr(lean_object*); lean_object* l_Lean_getExternNameFor___boxed(lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Lean_mkProjectionFnInfoExtension___closed__3; extern lean_object* l_Prod_HasRepr___rarg___closed__1; lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkExternAttr___spec__9(lean_object*, lean_object*); @@ -36,6 +35,7 @@ extern lean_object* l_Array_empty___closed__1; lean_object* l___private_Lean_Compiler_ExternAttr_2__syntaxToExternAttrData___closed__7; lean_object* l_Lean_expandExternPattern(lean_object*, lean_object*); lean_object* l_Lean_ParametricAttribute_getParam___at_Lean_getExternAttrData___spec__1___boxed(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_mkExternAttr___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_intersperse___main___rarg(lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); @@ -49,6 +49,7 @@ extern lean_object* l_String_splitAux___main___closed__1; lean_object* l_Lean_getExternNameFor(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__3___closed__1; lean_object* l___private_Lean_Compiler_ExternAttr_1__syntaxToExternEntries___main___closed__2; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Core_ofExcept___at_Lean_mkExternAttr___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_RBNode_fold___main___at_Lean_mkExternAttr___spec__4(lean_object*, lean_object*); lean_object* l_Lean_Core_ofExcept___at_Lean_mkExternAttr___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -67,7 +68,6 @@ lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l___private_Lean_Compiler_ExternAttr_2__syntaxToExternAttrData___closed__10; lean_object* l_Lean_ExternAttrData_inhabited; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); uint8_t l_Lean_isExtern(lean_object*, lean_object*); lean_object* lean_add_extern(lean_object*, lean_object*); extern lean_object* l_Lean_numLitKind; @@ -90,7 +90,6 @@ lean_object* l_Lean_mkExternAttr___lambda__1(lean_object*, lean_object*, lean_ob lean_object* l___private_Lean_Compiler_ExternAttr_3__parseOptNum___main(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkExternAttr___closed__2; lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); extern lean_object* l_List_reprAux___main___rarg___closed__1; lean_object* l_Lean_mkExternAttr___closed__1; extern lean_object* l_Lean_registerParametricAttribute___rarg___closed__1; @@ -142,6 +141,7 @@ lean_object* l___private_Lean_Compiler_ExternAttr_2__syntaxToExternAttrData___cl lean_object* l___private_Lean_Compiler_ExternAttr_1__syntaxToExternEntries___main___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__3___lambda__1___boxed(lean_object*); lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Compiler_ExternAttr_2__syntaxToExternAttrData___closed__4; extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; lean_object* l___private_Lean_Compiler_ExternAttr_1__syntaxToExternEntries___main___closed__8; diff --git a/stage0/stdlib/Lean/Compiler/IR/CompilerM.c b/stage0/stdlib/Lean/Compiler/IR/CompilerM.c index cc4fe8aff2..2575862af5 100644 --- a/stage0/stdlib/Lean/Compiler/IR/CompilerM.c +++ b/stage0/stdlib/Lean/Compiler/IR/CompilerM.c @@ -25,7 +25,6 @@ lean_object* l___private_Lean_Compiler_IR_CompilerM_3__logMessageIfAux___rarg(le lean_object* l_Lean_Format_pretty(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); uint8_t l_Std_PersistentHashMap_containsAtAux___main___at_Lean_Environment_contains___spec__5(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* l_Std_PersistentHashMap_insertAux___main___at_Lean_IR_mkDeclMapExtension___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_uset(lean_object*, size_t, lean_object*); @@ -38,6 +37,7 @@ extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_SMap_empty___at_Lean_IR_mkDeclMapExtension___spec__6; lean_object* l_Lean_IR_findDecl_x27___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_KVMap_findCore___main(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_IR_log___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_mkDeclMapExtension(lean_object*); lean_object* l_Array_iterateMAux___main___at___private_Lean_Compiler_IR_CompilerM_4__mkEntryArray___spec__10___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -54,6 +54,7 @@ lean_object* l_Lean_IR_getEnv___rarg(lean_object*); lean_object* l_Lean_IR_logMessageIf___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_LogEntry_fmt(lean_object*); size_t l_USize_shiftRight(size_t, size_t); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_IR_LogEntry_Lean_HasFormat; lean_object* l_Array_iterateMAux___main___at___private_Lean_Compiler_IR_CompilerM_4__mkEntryArray___spec__10(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_forMAux___main___at_Lean_IR_addDecls___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -76,7 +77,6 @@ lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___lambda__2(lean lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Std_AssocList_find_x3f___main___at_Lean_IR_findEnvDecl___spec__6(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_IR_findEnvDecl___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_IR_mkDeclMapExtension___spec__10(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; uint8_t l_Lean_SMap_contains___at_Lean_IR_containsDecl___spec__1(lean_object*, lean_object*); @@ -110,7 +110,6 @@ lean_object* l_Lean_IR_logMessage(lean_object*); lean_object* l_Lean_IR_getDecl___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Lean_IR_findEnvDecl_x27(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_HashMapImp_find_x3f___at_Lean_IR_findEnvDecl___spec__5___boxed(lean_object*, lean_object*); lean_object* l_Lean_IR_declMapExt___closed__5; lean_object* l_Lean_IR_getDecl___closed__1; @@ -189,6 +188,7 @@ lean_object* l_Lean_IR_mkDeclMapExtension___closed__1; lean_object* l___private_Lean_Compiler_IR_CompilerM_2__logDeclsAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_AssocList_replace___main___at___private_Lean_Compiler_IR_CompilerM_4__mkEntryArray___spec__7(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_addDecl(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_LogEntry_Lean_HasFormat___closed__1; lean_object* l_Lean_IR_Log_format___boxed(lean_object*); lean_object* l_Lean_IR_mkDeclMapExtension___lambda__1(lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Compiler/IR/ElimDeadBranches.c b/stage0/stdlib/Lean/Compiler/IR/ElimDeadBranches.c index 171efc9706..f107efb515 100644 --- a/stage0/stdlib/Lean/Compiler/IR/ElimDeadBranches.c +++ b/stage0/stdlib/Lean/Compiler/IR/ElimDeadBranches.c @@ -37,7 +37,6 @@ lean_object* l_Lean_IR_UnreachableBranches_updateJPParamsAssignment___boxed(lean lean_object* l_Array_umapMAux___main___at_Lean_IR_elimDeadBranches___spec__2(lean_object*, lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); extern lean_object* l_Option_get_x21___rarg___closed__3; -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* l_Array_iterateMAux___main___at_Lean_IR_UnreachableBranches_Value_format___main___spec__3(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_mkFunctionSummariesExtension___closed__3; @@ -60,6 +59,7 @@ lean_object* lean_environment_find(lean_object*, lean_object*); lean_object* l___private_Init_Util_1__mkPanicMessage(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_functionSummariesExt___elambda__3___boxed(lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_functionSummariesExt___elambda__2___boxed(lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_Value_format___main___closed__4; lean_object* l_Lean_IR_UnreachableBranches_inferMain___boxed(lean_object*); lean_object* l_Lean_IR_UnreachableBranches_containsCtor___boxed(lean_object*, lean_object*); @@ -86,6 +86,7 @@ lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_IR_UnreachableBranches_ lean_object* l_Lean_IR_UnreachableBranches_inferMain___main(lean_object*); size_t l_USize_shiftRight(size_t, size_t); lean_object* l_Lean_Format_joinSep___main___at_Lean_IR_UnreachableBranches_Value_format___main___spec__5(lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_projValue(lean_object*, lean_object*); extern lean_object* l_Lean_LocalContext_Inhabited___closed__1; lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_IR_UnreachableBranches_getFunctionSummary_x3f___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -118,7 +119,6 @@ lean_object* l_Std_PersistentArray_get_x21___at_Lean_IR_UnreachableBranches_inte lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_Value_format___main___closed__2; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_Value_format(lean_object*); lean_object* l_Array_umapMAux___main___at_Lean_IR_UnreachableBranches_elimDeadAux___main___spec__1___boxed(lean_object*, lean_object*, lean_object*); extern lean_object* l_List_Monad; @@ -163,7 +163,6 @@ lean_object* l_Lean_IR_UnreachableBranches_functionSummariesExt___elambda__1___b extern lean_object* l_Std_PersistentArrayNode_Inhabited___closed__1; lean_object* l_Array_iterateMAux___main___at_Lean_IR_UnreachableBranches_Value_format___main___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentArray_modifyAux___main___at_Lean_IR_UnreachableBranches_updateCurrFnSummary___spec__2(lean_object*, lean_object*, lean_object*, size_t, size_t); lean_object* l_Lean_IR_UnreachableBranches_findArgValue___boxed(lean_object*, lean_object*, lean_object*); extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; @@ -267,6 +266,7 @@ lean_object* l_Lean_SMap_empty___at_Lean_IR_UnreachableBranches_mkFunctionSummar lean_object* l_Std_AssocList_replace___main___at_Lean_IR_UnreachableBranches_mkFunctionSummariesExtension___spec__11(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_IR_UnreachableBranches_elimDead(lean_object*, lean_object*); lean_object* l_Std_HashMapImp_moveEntries___main___at_Lean_IR_UnreachableBranches_updateVarAssignment___spec__5(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_AssocList_contains___main___at_Lean_IR_UnreachableBranches_mkFunctionSummariesExtension___spec__7___boxed(lean_object*, lean_object*); lean_object* l_Lean_SMap_switch___at_Lean_IR_UnreachableBranches_mkFunctionSummariesExtension___spec__18(lean_object*); lean_object* l_Lean_IR_UnreachableBranches_inferMain(lean_object*); diff --git a/stage0/stdlib/Lean/Compiler/ImplementedByAttr.c b/stage0/stdlib/Lean/Compiler/ImplementedByAttr.c index 15c41bee4b..d605ed27ef 100644 --- a/stage0/stdlib/Lean/Compiler/ImplementedByAttr.c +++ b/stage0/stdlib/Lean/Compiler/ImplementedByAttr.c @@ -25,16 +25,17 @@ lean_object* l_Lean_Compiler_mkImplementedByAttr___lambda__1___boxed(lean_object lean_object* l_Lean_Compiler_mkImplementedByAttr___lambda__1___closed__9; uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkImplementedByAttr___lambda__1___closed__4; extern lean_object* l_Array_empty___closed__1; lean_object* l_Array_binSearchAux___main___at_Lean_Compiler_getImplementedBy___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkImplementedByAttr___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Name_inhabited; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_registerParametricAttribute___at_Lean_Compiler_mkImplementedByAttr___spec__1___lambda__1(lean_object*); lean_object* l_Lean_Compiler_implementedByAttr; lean_object* lean_nat_add(lean_object*, lean_object*); @@ -46,7 +47,6 @@ lean_object* l_Lean_registerParametricAttribute___at_Lean_Compiler_mkImplemented lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkImplementedByAttr___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_Compiler_mkImplementedByAttr___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); @@ -59,7 +59,6 @@ lean_object* l_Lean_registerParametricAttribute___rarg___lambda__5___boxed(lean_ lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_Compiler_mkImplementedByAttr___spec__4___closed__1; lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_Compiler_mkImplementedByAttr___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); uint8_t l_Array_anyRangeMAux___main___at_Lean_Compiler_mkImplementedByAttr___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_attrParamSyntaxToIdentifier(lean_object*); extern lean_object* l_Lean_registerParametricAttribute___rarg___closed__1; @@ -88,6 +87,7 @@ lean_object* lean_get_implemented_by(lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkImplementedByAttr___closed__4; extern lean_object* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; lean_object* l_Std_RBNode_find___main___at_Lean_Compiler_getImplementedBy___spec__2___boxed(lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_Compiler_mkImplementedByAttr___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Compiler/InitAttr.c b/stage0/stdlib/Lean/Compiler/InitAttr.c index 8fe0b72570..307639dfe8 100644 --- a/stage0/stdlib/Lean/Compiler/InitAttr.c +++ b/stage0/stdlib/Lean/Compiler/InitAttr.c @@ -22,15 +22,16 @@ lean_object* l_Lean_PersistentEnvExtension_getModuleEntries___rarg(lean_object*, uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_mkInitAttr___lambda__1___closed__11; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Name_inhabited; lean_object* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___lambda__1(lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); uint8_t l_Array_anyRangeMAux___main___at_Lean_mkInitAttr___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_nat_add(lean_object*, lean_object*); lean_object* l_Lean_mkInitAttr___closed__5; @@ -41,7 +42,6 @@ lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_mkInitAttr___ lean_object* l_Array_anyRangeMAux___main___at_Lean_mkInitAttr___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); lean_object* l_Lean_mkInitAttr___lambda__1___closed__2; @@ -54,7 +54,6 @@ lean_object* l___private_Lean_Compiler_InitAttr_2__isUnitType___boxed(lean_objec lean_object* l_Lean_mkInitAttr(lean_object*); lean_object* l_Std_RBNode_fold___main___at_Lean_mkInitAttr___spec__2(lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); uint8_t l___private_Lean_Compiler_InitAttr_2__isUnitType(lean_object*); lean_object* l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_hasInitAttr___boxed(lean_object*, lean_object*); @@ -98,6 +97,7 @@ lean_object* l_Lean_mkInitAttr___lambda__1___closed__15; extern lean_object* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; lean_object* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*); lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* lean_get_init_fn_name_for(lean_object*, lean_object*); lean_object* l_Lean_isIOUnitInitFn___boxed(lean_object*, lean_object*); extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; diff --git a/stage0/stdlib/Lean/Compiler/InlineAttrs.c b/stage0/stdlib/Lean/Compiler/InlineAttrs.c index d86f032701..1b23452b3d 100644 --- a/stage0/stdlib/Lean/Compiler/InlineAttrs.c +++ b/stage0/stdlib/Lean/Compiler/InlineAttrs.c @@ -24,13 +24,13 @@ lean_object* l_List_map___main___at_Lean_Compiler_mkInlineAttrs___spec__9___lamb uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkInlineAttrs___closed__16; -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Std_RBNode_find___main___at___private_Lean_Compiler_InlineAttrs_1__hasInlineAttrAux___main___spec__2(lean_object*, lean_object*); uint8_t lean_has_noinline_attribute(lean_object*, lean_object*); uint8_t l___private_Lean_Compiler_InlineAttrs_1__hasInlineAttrAux(lean_object*, uint8_t, lean_object*); lean_object* l_Lean_Core_getEnv___rarg(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_Compiler_mkInlineAttrs___closed__10; +lean_object* lean_io_ref_get(lean_object*, lean_object*); uint8_t l_Lean_Compiler_InlineAttributeKind_beq(uint8_t, uint8_t); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); @@ -40,6 +40,7 @@ lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_obje extern lean_object* l_Lean_Name_inhabited; lean_object* l_List_map___main___at_Lean_Compiler_mkInlineAttrs___spec__9(lean_object*, uint8_t, lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkInlineAttrs___closed__5; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Array_binSearchAux___main___at___private_Lean_Compiler_InlineAttrs_1__hasInlineAttrAux___main___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkInlineAttrs___closed__18; lean_object* l_Lean_Compiler_mkInlineAttrs___closed__15; @@ -63,7 +64,6 @@ lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_Compiler_mkInlineAttrs___spec__5___closed__1; lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_Compiler_mkInlineAttrs___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); uint8_t l___private_Lean_Compiler_InlineAttrs_1__hasInlineAttrAux___main(lean_object*, uint8_t, lean_object*); lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Array_binSearchAux___main___at___private_Lean_Compiler_InlineAttrs_1__hasInlineAttrAux___main___spec__3(lean_object*, lean_object*, lean_object*, lean_object*); @@ -84,7 +84,6 @@ uint8_t l_Lean_Compiler_isEagerLambdaLiftingName___main(lean_object*); lean_object* l_Lean_Compiler_hasInlineIfReduceAttribute___boxed(lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Array_qsortAux___main___at_Lean_Compiler_mkInlineAttrs___spec__4___boxed(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_RBNode_fold___main___at_Lean_Compiler_mkInlineAttrs___spec__3(lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkInlineAttrs___lambda__1(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkInlineAttrs___closed__21; @@ -126,6 +125,7 @@ extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__9; lean_object* l_Lean_Name_getPrefix(lean_object*); lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); uint8_t lean_has_inline_if_reduce_attribute(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Array_qsortAux___main___at_Lean_Compiler_mkInlineAttrs___spec__4(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; lean_object* l_Lean_PersistentEnvExtension_getState___rarg(lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Compiler/Specialize.c b/stage0/stdlib/Lean/Compiler/Specialize.c index d9899e196a..3f2b3779c4 100644 --- a/stage0/stdlib/Lean/Compiler/Specialize.c +++ b/stage0/stdlib/Lean/Compiler/Specialize.c @@ -37,7 +37,6 @@ lean_object* l_Array_iterateMAux___main___at_Lean_Compiler_SpecState_addEntry___ uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAux___main___at_Lean_Compiler_getSpecializationInfo___spec__3(lean_object*, size_t, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); uint8_t l_Array_anyRangeMAux___main___at_Lean_Compiler_mkSpecExtension___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_AssocList_find_x3f___main___at_Lean_Compiler_getCachedSpecialization___spec__6___boxed(lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; @@ -51,6 +50,7 @@ lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_Compiler_getSpecializati size_t l_USize_sub(size_t, size_t); extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_Compiler_mkSpecExtension___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Std_mkHashMap___at_Lean_Compiler_SpecState_Inhabited___spec__1(lean_object*); lean_object* l_Lean_SMap_find_x3f___at_Lean_Compiler_getSpecializationInfo___spec__1___boxed(lean_object*, lean_object*); lean_object* l_Lean_Compiler_specializeAttrs; @@ -70,6 +70,7 @@ lean_object* l_Lean_Compiler_mkSpecExtension___lambda__1(lean_object*); size_t l_USize_shiftRight(size_t, size_t); lean_object* l_Lean_SMap_switch___at_Lean_Compiler_SpecState_switch___spec__1(lean_object*); lean_object* l_Std_HashMapImp_expand___at_Lean_Compiler_SpecState_addEntry___spec__8(lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_Compiler_mkSpecExtension___spec__1___boxed(lean_object*, lean_object*); lean_object* l_Lean_Compiler_mkSpecializeAttrs___closed__9; lean_object* l_Lean_Compiler_mkSpecializeAttrs___closed__4; @@ -99,7 +100,6 @@ lean_object* l_Lean_Compiler_specExtension; lean_object* l_Array_iterateMAux___main___at_Lean_Compiler_SpecState_addEntry___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_HashMapImp_expand___at_Lean_Compiler_SpecState_addEntry___spec__19(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_Compiler_getCachedSpecialization___spec__2(lean_object*, lean_object*); lean_object* l_Lean_registerEnumAttributes___at_Lean_Compiler_mkSpecializeAttrs___spec__1___lambda__2(lean_object*); lean_object* l_Lean_registerEnumAttributes___at_Lean_Compiler_mkSpecializeAttrs___spec__1___closed__1; @@ -129,7 +129,6 @@ lean_object* l_Lean_Compiler_mkSpecializeAttrs___closed__13; size_t l_Lean_Expr_hash(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_Compiler_SpecState_addEntry___spec__16___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_Compiler_getSpecializationInfo___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Compiler_hasSpecializeAttribute___boxed(lean_object*, lean_object*); extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; @@ -226,6 +225,7 @@ lean_object* l___private_Lean_Compiler_Specialize_1__hasSpecializeAttrAux___main lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); lean_object* l_Std_AssocList_foldlM___main___at_Lean_Compiler_SpecState_addEntry___spec__21(lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_Compiler_mkSpecExtension___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* lean_get_cached_specialization(lean_object*, lean_object*); uint8_t l_Lean_Compiler_SpecializeAttributeKind_beq(uint8_t, uint8_t); extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; diff --git a/stage0/stdlib/Lean/CoreM.c b/stage0/stdlib/Lean/CoreM.c index 0d51421d3d..932d950c8e 100644 --- a/stage0/stdlib/Lean/CoreM.c +++ b/stage0/stdlib/Lean/CoreM.c @@ -15,15 +15,11 @@ extern "C" { #endif lean_object* l_Lean_Core_getConstInfo___closed__5; lean_object* l_Lean_Core_getOptions___rarg(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_get___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Core_compileDecl___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_getTraceState___at_Lean_Core_runCore___spec__1(lean_object*); -lean_object* l_IO_Prim_Ref_take___rarg___boxed(lean_object*, lean_object*); lean_object* lean_io_error_to_string(lean_object*); lean_object* l_Lean_Format_pretty(lean_object*, lean_object*); lean_object* l_IO_print___at_Lean_HasRepr_hasEval___spec__2(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Core_tracer___rarg(lean_object*); extern lean_object* l_Lean_maxRecDepthErrorMessage; lean_object* lean_io_prim_handle_put_str(lean_object*, lean_object*, lean_object*); @@ -32,10 +28,12 @@ lean_object* l_Lean_Core_ECoreM_inhabited(lean_object*, lean_object*); lean_object* l_Lean_Core_getEnv___rarg(lean_object*, lean_object*); lean_object* l_Lean_Core_replaceRef(lean_object*, lean_object*); lean_object* lean_environment_find(lean_object*, lean_object*); -lean_object* l_Lean_Core_addContext(lean_object*); +lean_object* l_Lean_Core_addContext(lean_object*, lean_object*); lean_object* lean_dbg_trace(lean_object*, lean_object*); +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Core_Exception_toMessageData(lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Core_runCore___spec__7(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Core_Context_replaceRef___boxed(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* l_Lean_Core_ECoreM_inhabited___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -43,7 +41,8 @@ lean_object* l_Lean_MessageData_formatAux___main(lean_object*, lean_object*); lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_mkFreshId___boxed(lean_object*); lean_object* l_Lean_Core_addAndCompile___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Core_tracer___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_tracer___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Core_withRef___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_ofExcept(lean_object*, lean_object*); lean_object* lean_nat_add(lean_object*, lean_object*); @@ -54,14 +53,13 @@ lean_object* l_Lean_Core_ofExcept___rarg___boxed(lean_object*, lean_object*, lea extern lean_object* l_IO_FS_Handle_putStrLn___rarg___closed__1; lean_object* l_Lean_Core_getConstInfo___closed__2; extern lean_object* l_Lean_LocalContext_Inhabited___closed__2; -lean_object* l_Lean_Core_getTraceState___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_getTraceState___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Core_withRef___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_Std_PersistentArray_forM___at_Lean_Core_runCore___spec__4(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_dbgTrace(lean_object*); lean_object* l_Lean_Core_getTraceState___at_Lean_Core_runCore___spec__1___boxed(lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Core_mkFreshId___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Core_checkRecDepth___closed__1; lean_object* l_Lean_Core_checkRecDepth___closed__2; @@ -73,6 +71,7 @@ lean_object* l_Lean_Core_checkRecDepth(lean_object*, lean_object*, lean_object*) lean_object* l_Lean_Core_getEnv___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Core_setEnv___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentArray_forM___at_Lean_Core_runCore___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_tracer___rarg___closed__3; lean_object* l___private_Lean_CoreM_1__getTraceState___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Core_modifyEnv___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_checkRecDepth___boxed(lean_object*, lean_object*, lean_object*); @@ -81,7 +80,6 @@ lean_object* l_Lean_Core_getTraceState___at_Lean_Core_runCore___spec__1___rarg(l lean_object* l_Lean_Core_dbgTrace___rarg___closed__1; lean_object* l___private_Lean_CoreM_1__getTraceState___rarg(lean_object*, lean_object*); lean_object* l_Lean_Core_getConstInfo___closed__3; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_replaceRef___boxed(lean_object*, lean_object*); lean_object* l_Lean_Core_runCore(lean_object*); lean_object* l_Std_PersistentArray_forMAux___main___at_Lean_Core_runCore___spec__5(lean_object*, lean_object*, lean_object*, lean_object*); @@ -101,11 +99,12 @@ lean_object* l_Lean_Core_mkFreshId___rarg(lean_object*, lean_object*); lean_object* l_Lean_Core_withRef(lean_object*); lean_object* l_Lean_Core_liftIOCore___rarg(lean_object*, lean_object*); lean_object* l_Lean_Core_withIncRecDepth___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_getTraceState___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_getTraceState___at_Lean_Core_runCore___spec__1___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Core_Exception_hasToString(lean_object*); lean_object* l_Lean_Core_hasEval___rarg(lean_object*); lean_object* l_Lean_Core_dbgTrace___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Core_addContext___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_addContext___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_throwError___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentArray_forMAux___main___at_Lean_Core_runCore___spec__5___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_throwError(lean_object*); @@ -115,10 +114,11 @@ lean_object* l_Lean_getMaxRecDepth(lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Core_runCore___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_MonadIO; lean_object* l_Lean_Core_getOptions___rarg___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Core_getTraceState(lean_object*); +lean_object* l_Lean_Core_getTraceState(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_run___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_getOptions(lean_object*); lean_object* l_Lean_Core_addDecl(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_tracer___rarg___closed__2; lean_object* l_Lean_Core_Exception_inhabited___closed__1; lean_object* l_Lean_Syntax_getPos(lean_object*); lean_object* l_Lean_Core_dbgTrace___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); @@ -126,26 +126,27 @@ lean_object* l_Lean_Core_ECoreM_inhabited___rarg(lean_object*, lean_object*, lea lean_object* l_Lean_Core_hasEval(lean_object*); lean_object* lean_get_stdout(lean_object*); extern lean_object* l_Lean_TraceState_Inhabited___closed__1; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_hasEval___rarg___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Core_runCore___spec__7___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Core_runCore___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* l_IO_Prim_Ref_set___rarg___boxed(lean_object*, lean_object*, lean_object*); -lean_object* l_Lean_Core_addContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_addContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_liftIOCore(lean_object*); extern lean_object* l_Lean_MetavarContext_Inhabited___closed__1; lean_object* l_Lean_Core_getConstInfo___closed__4; lean_object* lean_compile_decl(lean_object*, lean_object*, lean_object*); lean_object* l_IO_println___at_Lean_Core_runCore___spec__2(lean_object*, lean_object*); lean_object* l_Lean_Core_Exception_inhabited; -lean_object* l_Lean_Core_getTraceState___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_getTraceState___rarg(lean_object*, lean_object*); lean_object* l_Lean_Core_MonadIO___closed__1; +lean_object* l_Lean_Core_addContext___boxed(lean_object*, lean_object*); extern lean_object* l_Lean_MessageData_Inhabited___closed__1; lean_object* l_Lean_Core_dbgTrace___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_numeral(lean_object*, lean_object*); lean_object* l_Lean_Core_addAndCompile(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Core_run(lean_object*); lean_object* l___private_Lean_CoreM_1__getTraceState___boxed(lean_object*); -lean_object* l_Lean_Core_tracer___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* l_Lean_Core_tracer___rarg___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_NameGenerator_Inhabited___closed__3; uint8_t lean_nat_dec_lt(lean_object*, lean_object*); lean_object* lean_add_decl(lean_object*, lean_object*); @@ -821,83 +822,65 @@ lean_dec(x_1); return x_4; } } -lean_object* l_Lean_Core_getTraceState___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_Lean_Core_getTraceState___rarg(lean_object* x_1, lean_object* x_2) { _start: { +lean_object* x_3; uint8_t x_4; +x_3 = lean_io_ref_get(x_1, x_2); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ lean_object* x_5; lean_object* x_6; -x_5 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 1); -lean_closure_set(x_5, 0, x_3); -x_6 = lean_apply_3(x_1, lean_box(0), x_5, x_4); -if (lean_obj_tag(x_6) == 0) +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_5, 2); +lean_inc(x_6); +lean_dec(x_5); +lean_ctor_set(x_3, 0, x_6); +return x_3; +} +else { -uint8_t x_7; -x_7 = !lean_is_exclusive(x_6); -if (x_7 == 0) -{ -lean_object* x_8; lean_object* x_9; -x_8 = lean_ctor_get(x_6, 0); -x_9 = lean_ctor_get(x_8, 2); +lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +x_7 = lean_ctor_get(x_3, 0); +x_8 = lean_ctor_get(x_3, 1); +lean_inc(x_8); +lean_inc(x_7); +lean_dec(x_3); +x_9 = lean_ctor_get(x_7, 2); lean_inc(x_9); -lean_dec(x_8); -lean_ctor_set(x_6, 0, x_9); -return x_6; -} -else -{ -lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; -x_10 = lean_ctor_get(x_6, 0); -x_11 = lean_ctor_get(x_6, 1); -lean_inc(x_11); -lean_inc(x_10); -lean_dec(x_6); -x_12 = lean_ctor_get(x_10, 2); -lean_inc(x_12); -lean_dec(x_10); -x_13 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_13, 0, x_12); -lean_ctor_set(x_13, 1, x_11); -return x_13; -} -} -else -{ -uint8_t x_14; -x_14 = !lean_is_exclusive(x_6); -if (x_14 == 0) -{ -return x_6; -} -else -{ -lean_object* x_15; lean_object* x_16; lean_object* x_17; -x_15 = lean_ctor_get(x_6, 0); -x_16 = lean_ctor_get(x_6, 1); -lean_inc(x_16); -lean_inc(x_15); -lean_dec(x_6); -x_17 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_17, 0, x_15); -lean_ctor_set(x_17, 1, x_16); -return x_17; +lean_dec(x_7); +x_10 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_10, 0, x_9); +lean_ctor_set(x_10, 1, x_8); +return x_10; } } } -} -lean_object* l_Lean_Core_getTraceState(lean_object* x_1) { +lean_object* l_Lean_Core_getTraceState(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: { -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_Lean_Core_getTraceState___rarg___boxed), 4, 0); -return x_2; +lean_object* x_4; +x_4 = lean_alloc_closure((void*)(l_Lean_Core_getTraceState___rarg___boxed), 2, 0); +return x_4; } } -lean_object* l_Lean_Core_getTraceState___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +lean_object* l_Lean_Core_getTraceState___rarg___boxed(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_5; -x_5 = l_Lean_Core_getTraceState___rarg(x_1, x_2, x_3, x_4); +lean_object* x_3; +x_3 = l_Lean_Core_getTraceState___rarg(x_1, x_2); +lean_dec(x_1); +return x_3; +} +} +lean_object* l_Lean_Core_getTraceState___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { +_start: +{ +lean_object* x_4; +x_4 = l_Lean_Core_getTraceState(x_1, x_2, x_3); +lean_dec(x_3); lean_dec(x_2); -return x_5; +return x_4; } } lean_object* l_Lean_Core_mkFreshId___rarg(lean_object* x_1, lean_object* x_2) { @@ -1242,280 +1225,168 @@ lean_dec(x_1); return x_2; } } -lean_object* l_Lean_Core_addContext___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Lean_Core_addContext___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_6; lean_object* x_7; -x_6 = lean_alloc_closure((void*)(l_IO_Prim_Ref_get___rarg___boxed), 2, 1); -lean_closure_set(x_6, 0, x_4); -x_7 = lean_apply_3(x_1, lean_box(0), x_6, x_5); -if (lean_obj_tag(x_7) == 0) +lean_object* x_5; uint8_t x_6; +x_5 = lean_io_ref_get(x_3, x_4); +x_6 = !lean_is_exclusive(x_5); +if (x_6 == 0) { -uint8_t x_8; -x_8 = !lean_is_exclusive(x_7); -if (x_8 == 0) -{ -lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; -x_9 = lean_ctor_get(x_7, 0); -x_10 = lean_ctor_get(x_9, 0); -lean_inc(x_10); -lean_dec(x_9); -x_11 = lean_ctor_get(x_3, 0); -x_12 = l_Lean_MetavarContext_Inhabited___closed__1; -x_13 = l_Lean_LocalContext_Inhabited___closed__2; -lean_inc(x_11); -x_14 = lean_alloc_ctor(0, 4, 0); -lean_ctor_set(x_14, 0, x_10); -lean_ctor_set(x_14, 1, x_12); -lean_ctor_set(x_14, 2, x_13); -lean_ctor_set(x_14, 3, x_11); -x_15 = lean_alloc_ctor(6, 2, 0); -lean_ctor_set(x_15, 0, x_14); -lean_ctor_set(x_15, 1, x_2); -lean_ctor_set(x_7, 0, x_15); -return x_7; -} -else -{ -lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; -x_16 = lean_ctor_get(x_7, 0); -x_17 = lean_ctor_get(x_7, 1); -lean_inc(x_17); -lean_inc(x_16); -lean_dec(x_7); -x_18 = lean_ctor_get(x_16, 0); -lean_inc(x_18); -lean_dec(x_16); -x_19 = lean_ctor_get(x_3, 0); -x_20 = l_Lean_MetavarContext_Inhabited___closed__1; -x_21 = l_Lean_LocalContext_Inhabited___closed__2; -lean_inc(x_19); -x_22 = lean_alloc_ctor(0, 4, 0); -lean_ctor_set(x_22, 0, x_18); -lean_ctor_set(x_22, 1, x_20); -lean_ctor_set(x_22, 2, x_21); -lean_ctor_set(x_22, 3, x_19); -x_23 = lean_alloc_ctor(6, 2, 0); -lean_ctor_set(x_23, 0, x_22); -lean_ctor_set(x_23, 1, x_2); -x_24 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_24, 0, x_23); -lean_ctor_set(x_24, 1, x_17); -return x_24; -} -} -else -{ -uint8_t x_25; -lean_dec(x_2); -x_25 = !lean_is_exclusive(x_7); -if (x_25 == 0) -{ -return x_7; -} -else -{ -lean_object* x_26; lean_object* x_27; lean_object* x_28; -x_26 = lean_ctor_get(x_7, 0); -x_27 = lean_ctor_get(x_7, 1); -lean_inc(x_27); -lean_inc(x_26); -lean_dec(x_7); -x_28 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_28, 0, x_26); -lean_ctor_set(x_28, 1, x_27); -return x_28; -} -} -} -} -lean_object* l_Lean_Core_addContext(lean_object* x_1) { -_start: -{ -lean_object* x_2; -x_2 = lean_alloc_closure((void*)(l_Lean_Core_addContext___rarg___boxed), 5, 0); -return x_2; -} -} -lean_object* l_Lean_Core_addContext___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { -_start: -{ -lean_object* x_6; -x_6 = l_Lean_Core_addContext___rarg(x_1, x_2, x_3, x_4, x_5); -lean_dec(x_3); -return x_6; -} -} -lean_object* l_Lean_Core_tracer___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { -_start: -{ -lean_object* x_6; lean_object* x_7; -lean_inc(x_4); -x_6 = lean_alloc_closure((void*)(l_IO_Prim_Ref_take___rarg___boxed), 2, 1); -lean_closure_set(x_6, 0, x_4); -lean_inc(x_1); -x_7 = lean_apply_3(x_1, lean_box(0), x_6, x_5); -if (lean_obj_tag(x_7) == 0) -{ -lean_object* x_8; lean_object* x_9; uint8_t x_10; +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; +x_7 = lean_ctor_get(x_5, 0); x_8 = lean_ctor_get(x_7, 0); lean_inc(x_8); -x_9 = lean_ctor_get(x_7, 1); +lean_dec(x_7); +x_9 = lean_ctor_get(x_2, 0); +x_10 = l_Lean_MetavarContext_Inhabited___closed__1; +x_11 = l_Lean_LocalContext_Inhabited___closed__2; lean_inc(x_9); -lean_dec(x_7); -x_10 = !lean_is_exclusive(x_8); -if (x_10 == 0) +x_12 = lean_alloc_ctor(0, 4, 0); +lean_ctor_set(x_12, 0, x_8); +lean_ctor_set(x_12, 1, x_10); +lean_ctor_set(x_12, 2, x_11); +lean_ctor_set(x_12, 3, x_9); +x_13 = lean_alloc_ctor(6, 2, 0); +lean_ctor_set(x_13, 0, x_12); +lean_ctor_set(x_13, 1, x_1); +lean_ctor_set(x_5, 0, x_13); +return x_5; +} +else { -lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; -x_11 = lean_ctor_get(x_8, 2); -x_12 = lean_apply_1(x_2, x_11); -lean_ctor_set(x_8, 2, x_12); -x_13 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___rarg___boxed), 3, 2); -lean_closure_set(x_13, 0, x_4); -lean_closure_set(x_13, 1, x_8); -x_14 = lean_apply_3(x_1, lean_box(0), x_13, x_9); -if (lean_obj_tag(x_14) == 0) -{ -uint8_t x_15; -x_15 = !lean_is_exclusive(x_14); -if (x_15 == 0) -{ -lean_object* x_16; lean_object* x_17; +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; +x_14 = lean_ctor_get(x_5, 0); +x_15 = lean_ctor_get(x_5, 1); +lean_inc(x_15); +lean_inc(x_14); +lean_dec(x_5); x_16 = lean_ctor_get(x_14, 0); -lean_dec(x_16); -x_17 = lean_box(0); -lean_ctor_set(x_14, 0, x_17); -return x_14; -} -else -{ -lean_object* x_18; lean_object* x_19; lean_object* x_20; -x_18 = lean_ctor_get(x_14, 1); -lean_inc(x_18); +lean_inc(x_16); lean_dec(x_14); -x_19 = lean_box(0); -x_20 = lean_alloc_ctor(0, 2, 0); -lean_ctor_set(x_20, 0, x_19); +x_17 = lean_ctor_get(x_2, 0); +x_18 = l_Lean_MetavarContext_Inhabited___closed__1; +x_19 = l_Lean_LocalContext_Inhabited___closed__2; +lean_inc(x_17); +x_20 = lean_alloc_ctor(0, 4, 0); +lean_ctor_set(x_20, 0, x_16); lean_ctor_set(x_20, 1, x_18); -return x_20; +lean_ctor_set(x_20, 2, x_19); +lean_ctor_set(x_20, 3, x_17); +x_21 = lean_alloc_ctor(6, 2, 0); +lean_ctor_set(x_21, 0, x_20); +lean_ctor_set(x_21, 1, x_1); +x_22 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_22, 0, x_21); +lean_ctor_set(x_22, 1, x_15); +return x_22; } } -else +} +lean_object* l_Lean_Core_addContext(lean_object* x_1, lean_object* x_2) { +_start: { -uint8_t x_21; -x_21 = !lean_is_exclusive(x_14); -if (x_21 == 0) +lean_object* x_3; +x_3 = lean_alloc_closure((void*)(l_Lean_Core_addContext___rarg___boxed), 4, 0); +return x_3; +} +} +lean_object* l_Lean_Core_addContext___rarg___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: { -return x_14; -} -else -{ -lean_object* x_22; lean_object* x_23; lean_object* x_24; -x_22 = lean_ctor_get(x_14, 0); -x_23 = lean_ctor_get(x_14, 1); -lean_inc(x_23); -lean_inc(x_22); -lean_dec(x_14); -x_24 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_24, 0, x_22); -lean_ctor_set(x_24, 1, x_23); -return x_24; -} -} -} -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; -x_25 = lean_ctor_get(x_8, 0); -x_26 = lean_ctor_get(x_8, 1); -x_27 = lean_ctor_get(x_8, 2); -lean_inc(x_27); -lean_inc(x_26); -lean_inc(x_25); -lean_dec(x_8); -x_28 = lean_apply_1(x_2, x_27); -x_29 = lean_alloc_ctor(0, 3, 0); -lean_ctor_set(x_29, 0, x_25); -lean_ctor_set(x_29, 1, x_26); -lean_ctor_set(x_29, 2, x_28); -x_30 = lean_alloc_closure((void*)(l_IO_Prim_Ref_set___rarg___boxed), 3, 2); -lean_closure_set(x_30, 0, x_4); -lean_closure_set(x_30, 1, x_29); -x_31 = lean_apply_3(x_1, lean_box(0), x_30, x_9); -if (lean_obj_tag(x_31) == 0) -{ -lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; -x_32 = lean_ctor_get(x_31, 1); -lean_inc(x_32); -if (lean_is_exclusive(x_31)) { - lean_ctor_release(x_31, 0); - lean_ctor_release(x_31, 1); - x_33 = x_31; -} else { - lean_dec_ref(x_31); - x_33 = lean_box(0); -} -x_34 = lean_box(0); -if (lean_is_scalar(x_33)) { - x_35 = lean_alloc_ctor(0, 2, 0); -} else { - x_35 = x_33; -} -lean_ctor_set(x_35, 0, x_34); -lean_ctor_set(x_35, 1, x_32); -return x_35; -} -else -{ -lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; -x_36 = lean_ctor_get(x_31, 0); -lean_inc(x_36); -x_37 = lean_ctor_get(x_31, 1); -lean_inc(x_37); -if (lean_is_exclusive(x_31)) { - lean_ctor_release(x_31, 0); - lean_ctor_release(x_31, 1); - x_38 = x_31; -} else { - lean_dec_ref(x_31); - x_38 = lean_box(0); -} -if (lean_is_scalar(x_38)) { - x_39 = lean_alloc_ctor(1, 2, 0); -} else { - x_39 = x_38; -} -lean_ctor_set(x_39, 0, x_36); -lean_ctor_set(x_39, 1, x_37); -return x_39; -} -} -} -else -{ -uint8_t x_40; -lean_dec(x_4); +lean_object* x_5; +x_5 = l_Lean_Core_addContext___rarg(x_1, x_2, x_3, x_4); +lean_dec(x_3); lean_dec(x_2); -lean_dec(x_1); -x_40 = !lean_is_exclusive(x_7); -if (x_40 == 0) +return x_5; +} +} +lean_object* l_Lean_Core_addContext___boxed(lean_object* x_1, lean_object* x_2) { +_start: { -return x_7; +lean_object* x_3; +x_3 = l_Lean_Core_addContext(x_1, x_2); +lean_dec(x_2); +return x_3; +} +} +lean_object* l_Lean_Core_tracer___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { +_start: +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; uint8_t x_8; +x_5 = lean_io_ref_take(x_3, x_4); +x_6 = lean_ctor_get(x_5, 0); +lean_inc(x_6); +x_7 = lean_ctor_get(x_5, 1); +lean_inc(x_7); +lean_dec(x_5); +x_8 = !lean_is_exclusive(x_6); +if (x_8 == 0) +{ +lean_object* x_9; lean_object* x_10; lean_object* x_11; uint8_t x_12; +x_9 = lean_ctor_get(x_6, 2); +x_10 = lean_apply_1(x_1, x_9); +lean_ctor_set(x_6, 2, x_10); +x_11 = lean_io_ref_set(x_3, x_6, x_7); +x_12 = !lean_is_exclusive(x_11); +if (x_12 == 0) +{ +lean_object* x_13; lean_object* x_14; +x_13 = lean_ctor_get(x_11, 0); +lean_dec(x_13); +x_14 = lean_box(0); +lean_ctor_set(x_11, 0, x_14); +return x_11; } else { -lean_object* x_41; lean_object* x_42; lean_object* x_43; -x_41 = lean_ctor_get(x_7, 0); -x_42 = lean_ctor_get(x_7, 1); -lean_inc(x_42); -lean_inc(x_41); -lean_dec(x_7); -x_43 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_43, 0, x_41); -lean_ctor_set(x_43, 1, x_42); -return x_43; +lean_object* x_15; lean_object* x_16; lean_object* x_17; +x_15 = lean_ctor_get(x_11, 1); +lean_inc(x_15); +lean_dec(x_11); +x_16 = lean_box(0); +x_17 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_17, 0, x_16); +lean_ctor_set(x_17, 1, x_15); +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_object* x_26; lean_object* x_27; +x_18 = lean_ctor_get(x_6, 0); +x_19 = lean_ctor_get(x_6, 1); +x_20 = lean_ctor_get(x_6, 2); +lean_inc(x_20); +lean_inc(x_19); +lean_inc(x_18); +lean_dec(x_6); +x_21 = lean_apply_1(x_1, x_20); +x_22 = lean_alloc_ctor(0, 3, 0); +lean_ctor_set(x_22, 0, x_18); +lean_ctor_set(x_22, 1, x_19); +lean_ctor_set(x_22, 2, x_21); +x_23 = lean_io_ref_set(x_3, x_22, x_7); +x_24 = lean_ctor_get(x_23, 1); +lean_inc(x_24); +if (lean_is_exclusive(x_23)) { + lean_ctor_release(x_23, 0); + lean_ctor_release(x_23, 1); + x_25 = x_23; +} else { + lean_dec_ref(x_23); + x_25 = lean_box(0); +} +x_26 = lean_box(0); +if (lean_is_scalar(x_25)) { + x_27 = lean_alloc_ctor(0, 2, 0); +} else { + x_27 = x_25; +} +lean_ctor_set(x_27, 0, x_26); +lean_ctor_set(x_27, 1, x_24); +return x_27; +} } } lean_object* _init_l_Lean_Core_tracer___rarg___closed__1() { @@ -1526,24 +1397,37 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Core_getOptions___rarg___boxed), 3, 0); return x_1; } } +lean_object* _init_l_Lean_Core_tracer___rarg___closed__2() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Core_tracer___rarg___lambda__1___boxed), 4, 0); +return x_1; +} +} +lean_object* _init_l_Lean_Core_tracer___rarg___closed__3() { +_start: +{ +lean_object* x_1; +x_1 = lean_alloc_closure((void*)(l_Lean_Core_addContext___rarg___boxed), 4, 0); +return x_1; +} +} lean_object* l_Lean_Core_tracer___rarg(lean_object* x_1) { _start: { lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; -lean_inc(x_1); -x_2 = lean_alloc_closure((void*)(l_Lean_Core_tracer___rarg___lambda__1___boxed), 5, 1); -lean_closure_set(x_2, 0, x_1); -lean_inc(x_1); -x_3 = lean_alloc_closure((void*)(l_Lean_Core_getTraceState___rarg___boxed), 4, 1); -lean_closure_set(x_3, 0, x_1); -x_4 = lean_alloc_closure((void*)(l_Lean_Core_addContext___rarg___boxed), 5, 1); -lean_closure_set(x_4, 0, x_1); -x_5 = l_Lean_Core_tracer___rarg___closed__1; +x_2 = lean_alloc_closure((void*)(l_Lean_Core_getTraceState___boxed), 3, 2); +lean_closure_set(x_2, 0, lean_box(0)); +lean_closure_set(x_2, 1, x_1); +x_3 = l_Lean_Core_tracer___rarg___closed__1; +x_4 = l_Lean_Core_tracer___rarg___closed__2; +x_5 = l_Lean_Core_tracer___rarg___closed__3; x_6 = lean_alloc_ctor(0, 4, 0); -lean_ctor_set(x_6, 0, x_5); -lean_ctor_set(x_6, 1, x_2); -lean_ctor_set(x_6, 2, x_3); -lean_ctor_set(x_6, 3, x_4); +lean_ctor_set(x_6, 0, x_3); +lean_ctor_set(x_6, 1, x_4); +lean_ctor_set(x_6, 2, x_2); +lean_ctor_set(x_6, 3, x_5); return x_6; } } @@ -1555,13 +1439,14 @@ x_2 = lean_alloc_closure((void*)(l_Lean_Core_tracer___rarg), 1, 0); return x_2; } } -lean_object* l_Lean_Core_tracer___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { +lean_object* l_Lean_Core_tracer___rarg___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_6; -x_6 = l_Lean_Core_tracer___rarg___lambda__1(x_1, x_2, x_3, x_4, x_5); +lean_object* x_5; +x_5 = l_Lean_Core_tracer___rarg___lambda__1(x_1, x_2, x_3, x_4); lean_dec(x_3); -return x_6; +lean_dec(x_2); +return x_5; } } lean_object* l_Lean_Core_addDecl(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { @@ -3103,6 +2988,10 @@ l_Lean_Core_checkRecDepth___closed__2 = _init_l_Lean_Core_checkRecDepth___closed lean_mark_persistent(l_Lean_Core_checkRecDepth___closed__2); l_Lean_Core_tracer___rarg___closed__1 = _init_l_Lean_Core_tracer___rarg___closed__1(); lean_mark_persistent(l_Lean_Core_tracer___rarg___closed__1); +l_Lean_Core_tracer___rarg___closed__2 = _init_l_Lean_Core_tracer___rarg___closed__2(); +lean_mark_persistent(l_Lean_Core_tracer___rarg___closed__2); +l_Lean_Core_tracer___rarg___closed__3 = _init_l_Lean_Core_tracer___rarg___closed__3(); +lean_mark_persistent(l_Lean_Core_tracer___rarg___closed__3); l_Lean_Core_dbgTrace___rarg___closed__1 = _init_l_Lean_Core_dbgTrace___rarg___closed__1(); lean_mark_persistent(l_Lean_Core_dbgTrace___rarg___closed__1); l_Lean_Core_getConstInfo___closed__1 = _init_l_Lean_Core_getConstInfo___closed__1(); diff --git a/stage0/stdlib/Lean/Data/Options.c b/stage0/stdlib/Lean/Data/Options.c index 842c3dc796..46cb8e8e19 100644 --- a/stage0/stdlib/Lean/Data/Options.c +++ b/stage0/stdlib/Lean/Data/Options.c @@ -15,14 +15,14 @@ extern "C" { #endif extern lean_object* l_Lean_Name_toString___closed__1; lean_object* l_Lean_KVMap_setBool(lean_object*, lean_object*, uint8_t); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); lean_object* l_Std_RBNode_fold___main___at_Lean_getOptionDeclsArray___spec__1___boxed(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_KVMap_setNat(lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_verboseOption___closed__3; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_KVMap_setString(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_maxMemoryOption(lean_object*); lean_object* l_Lean_getOptionDefaulValue(lean_object*, lean_object*); lean_object* l_Lean_getOptionDecls(lean_object*); @@ -49,7 +49,6 @@ lean_object* l_Lean_Options_HasToString; extern lean_object* l_Char_HasRepr___closed__1; lean_object* lean_get_option_decls_array(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_KVMap_setInt(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_verboseOption___closed__4; lean_object* l_Lean_Options_empty; @@ -71,6 +70,7 @@ lean_object* l_Lean_verboseOption___closed__1; lean_object* l_Lean_timeoutOption___closed__1; lean_object* l_Lean_maxMemoryOption___closed__1; lean_object* l_Std_RBNode_find___main___at_Lean_getOptionDecl___spec__1(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_String_trim(lean_object*); lean_object* l_Lean_maxMemoryOption___closed__2; lean_object* l_Lean_setOptionFromString___closed__2; @@ -78,6 +78,7 @@ lean_object* l_String_toNat_x3f(lean_object*); lean_object* l_Lean_timeoutOption___closed__3; lean_object* l_Lean_Options_HasEmptyc; lean_object* l_Lean_Name_toStringWithSep___main(lean_object*, lean_object*); +lean_object* l_Lean_OptionDecls_inhabited; lean_object* l_Lean_verboseOption___closed__5; lean_object* l_Lean_getOptionDescr(lean_object*, lean_object*); lean_object* l_Lean_timeoutOption(lean_object*); @@ -127,14 +128,39 @@ x_1 = l_Lean_Options_HasToString___closed__1; return x_1; } } +lean_object* _init_l_Lean_OptionDecls_inhabited() { +_start: +{ +lean_object* x_1; +x_1 = lean_box(0); +return x_1; +} +} lean_object* l___private_Lean_Data_Options_1__initOptionDeclsRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = lean_box(0); x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* _init_l_Lean_registerOption___closed__1() { _start: @@ -167,65 +193,101 @@ x_8 = lean_ctor_get(x_5, 1); x_9 = l_Lean_NameMap_contains___rarg(x_7, x_1); if (x_9 == 0) { -lean_object* x_10; lean_object* x_11; +lean_object* x_10; lean_object* x_11; uint8_t x_12; lean_free_object(x_5); x_10 = l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(x_7, x_1, x_2); x_11 = lean_io_ref_set(x_4, x_10, x_8); +x_12 = !lean_is_exclusive(x_11); +if (x_12 == 0) +{ return x_11; } else { -lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; +lean_object* x_13; lean_object* x_14; lean_object* x_15; +x_13 = lean_ctor_get(x_11, 0); +x_14 = lean_ctor_get(x_11, 1); +lean_inc(x_14); +lean_inc(x_13); +lean_dec(x_11); +x_15 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_15, 0, x_13); +lean_ctor_set(x_15, 1, x_14); +return x_15; +} +} +else +{ +lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_dec(x_7); lean_dec(x_2); -x_12 = l_Lean_Name_toString___closed__1; -x_13 = l_Lean_Name_toStringWithSep___main(x_12, x_1); -x_14 = l_Lean_registerOption___closed__1; -x_15 = lean_string_append(x_14, x_13); -lean_dec(x_13); -x_16 = l_Lean_registerOption___closed__2; -x_17 = lean_string_append(x_15, x_16); -x_18 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_18, 0, x_17); +x_16 = l_Lean_Name_toString___closed__1; +x_17 = l_Lean_Name_toStringWithSep___main(x_16, x_1); +x_18 = l_Lean_registerOption___closed__1; +x_19 = lean_string_append(x_18, x_17); +lean_dec(x_17); +x_20 = l_Lean_registerOption___closed__2; +x_21 = lean_string_append(x_19, x_20); +x_22 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_22, 0, x_21); lean_ctor_set_tag(x_5, 1); -lean_ctor_set(x_5, 0, x_18); +lean_ctor_set(x_5, 0, x_22); return x_5; } } else { -lean_object* x_19; lean_object* x_20; uint8_t x_21; -x_19 = lean_ctor_get(x_5, 0); -x_20 = lean_ctor_get(x_5, 1); -lean_inc(x_20); -lean_inc(x_19); +lean_object* x_23; lean_object* x_24; uint8_t x_25; +x_23 = lean_ctor_get(x_5, 0); +x_24 = lean_ctor_get(x_5, 1); +lean_inc(x_24); +lean_inc(x_23); lean_dec(x_5); -x_21 = l_Lean_NameMap_contains___rarg(x_19, x_1); -if (x_21 == 0) +x_25 = l_Lean_NameMap_contains___rarg(x_23, x_1); +if (x_25 == 0) { -lean_object* x_22; lean_object* x_23; -x_22 = l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(x_19, x_1, x_2); -x_23 = lean_io_ref_set(x_4, x_22, x_20); -return x_23; +lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; +x_26 = l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(x_23, x_1, x_2); +x_27 = lean_io_ref_set(x_4, x_26, x_24); +x_28 = lean_ctor_get(x_27, 0); +lean_inc(x_28); +x_29 = lean_ctor_get(x_27, 1); +lean_inc(x_29); +if (lean_is_exclusive(x_27)) { + lean_ctor_release(x_27, 0); + lean_ctor_release(x_27, 1); + x_30 = x_27; +} else { + lean_dec_ref(x_27); + x_30 = lean_box(0); +} +if (lean_is_scalar(x_30)) { + x_31 = lean_alloc_ctor(0, 2, 0); +} else { + x_31 = x_30; +} +lean_ctor_set(x_31, 0, x_28); +lean_ctor_set(x_31, 1, x_29); +return x_31; } else { -lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; -lean_dec(x_19); +lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39; +lean_dec(x_23); lean_dec(x_2); -x_24 = l_Lean_Name_toString___closed__1; -x_25 = l_Lean_Name_toStringWithSep___main(x_24, x_1); -x_26 = l_Lean_registerOption___closed__1; -x_27 = lean_string_append(x_26, x_25); -lean_dec(x_25); -x_28 = l_Lean_registerOption___closed__2; -x_29 = lean_string_append(x_27, x_28); -x_30 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_30, 0, x_29); -x_31 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_31, 0, x_30); -lean_ctor_set(x_31, 1, x_20); -return x_31; +x_32 = l_Lean_Name_toString___closed__1; +x_33 = l_Lean_Name_toStringWithSep___main(x_32, x_1); +x_34 = l_Lean_registerOption___closed__1; +x_35 = lean_string_append(x_34, x_33); +lean_dec(x_33); +x_36 = l_Lean_registerOption___closed__2; +x_37 = lean_string_append(x_35, x_36); +x_38 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_38, 0, x_37); +x_39 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_39, 0, x_38); +lean_ctor_set(x_39, 1, x_24); +return x_39; } } } @@ -233,11 +295,28 @@ return x_31; lean_object* l_Lean_getOptionDecls(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l___private_Lean_Data_Options_2__optionDeclsRef; x_3 = lean_io_ref_get(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Std_RBNode_fold___main___at_Lean_getOptionDeclsArray___spec__1(lean_object* x_1, lean_object* x_2) { _start: @@ -269,11 +348,8 @@ goto _start; lean_object* lean_get_option_decls_array(lean_object* x_1) { _start: { -lean_object* x_2; +lean_object* x_2; uint8_t x_3; x_2 = l_Lean_getOptionDecls(x_1); -if (lean_obj_tag(x_2) == 0) -{ -uint8_t x_3; x_3 = !lean_is_exclusive(x_2); if (x_3 == 0) { @@ -302,29 +378,6 @@ lean_ctor_set(x_11, 1, x_8); return x_11; } } -else -{ -uint8_t x_12; -x_12 = !lean_is_exclusive(x_2); -if (x_12 == 0) -{ -return x_2; -} -else -{ -lean_object* x_13; lean_object* x_14; lean_object* x_15; -x_13 = lean_ctor_get(x_2, 0); -x_14 = lean_ctor_get(x_2, 1); -lean_inc(x_14); -lean_inc(x_13); -lean_dec(x_2); -x_15 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_15, 0, x_13); -lean_ctor_set(x_15, 1, x_14); -return x_15; -} -} -} } lean_object* l_Std_RBNode_fold___main___at_Lean_getOptionDeclsArray___spec__1___boxed(lean_object* x_1, lean_object* x_2) { _start: @@ -389,11 +442,8 @@ return x_1; lean_object* l_Lean_getOptionDecl(lean_object* x_1, lean_object* x_2) { _start: { -lean_object* x_3; +lean_object* x_3; uint8_t x_4; x_3 = l_Lean_getOptionDecls(x_2); -if (lean_obj_tag(x_3) == 0) -{ -uint8_t x_4; x_4 = !lean_is_exclusive(x_3); if (x_4 == 0) { @@ -469,30 +519,6 @@ return x_27; } } } -else -{ -uint8_t x_28; -lean_dec(x_1); -x_28 = !lean_is_exclusive(x_3); -if (x_28 == 0) -{ -return x_3; -} -else -{ -lean_object* x_29; lean_object* x_30; lean_object* x_31; -x_29 = lean_ctor_get(x_3, 0); -x_30 = lean_ctor_get(x_3, 1); -lean_inc(x_30); -lean_inc(x_29); -lean_dec(x_3); -x_31 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_31, 0, x_29); -lean_ctor_set(x_31, 1, x_30); -return x_31; -} -} -} } lean_object* l_Std_RBNode_find___main___at_Lean_getOptionDecl___spec__1___boxed(lean_object* x_1, lean_object* x_2) { _start: @@ -1368,6 +1394,8 @@ l_Lean_Options_HasToString___closed__1 = _init_l_Lean_Options_HasToString___clos lean_mark_persistent(l_Lean_Options_HasToString___closed__1); l_Lean_Options_HasToString = _init_l_Lean_Options_HasToString(); lean_mark_persistent(l_Lean_Options_HasToString); +l_Lean_OptionDecls_inhabited = _init_l_Lean_OptionDecls_inhabited(); +lean_mark_persistent(l_Lean_OptionDecls_inhabited); res = l___private_Lean_Data_Options_1__initOptionDeclsRef(lean_io_mk_world()); if (lean_io_result_is_error(res)) return res; l___private_Lean_Data_Options_2__optionDeclsRef = lean_io_result_get_value(res); diff --git a/stage0/stdlib/Lean/Elab/Alias.c b/stage0/stdlib/Lean/Elab/Alias.c index 9b76484475..c2ec43d440 100644 --- a/stage0/stdlib/Lean/Elab/Alias.c +++ b/stage0/stdlib/Lean/Elab/Alias.c @@ -26,7 +26,6 @@ lean_object* l_Lean_mkAliasExtension___lambda__1(lean_object*); lean_object* l_Lean_aliasExtension___closed__5; lean_object* l_Std_PersistentHashMap_insert___at_Lean_addAliasEntry___spec__8(lean_object*, lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* lean_array_uset(lean_object*, size_t, lean_object*); uint8_t l_List_elem___main___at_Lean_NameHashSet_insert___spec__2(lean_object*, lean_object*); @@ -34,6 +33,7 @@ lean_object* l_Lean_aliasExtension___closed__3; size_t l_USize_sub(size_t, size_t); extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_aliasExtension___elambda__4___boxed(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* l_Std_PersistentHashMap_getCollisionNodeSize___rarg(lean_object*); @@ -46,6 +46,7 @@ lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_mkAliasExtens lean_object* l_Array_iterateMAux___main___at_Lean_mkAliasExtension___spec__5(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_HashMapImp_find_x3f___at_Lean_addAliasEntry___spec__5(lean_object*, lean_object*); lean_object* l_Lean_aliasExtension___closed__7; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_mkAliasExtension___spec__10___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_aliasExtension___elambda__4___rarg(lean_object*); extern lean_object* l_Lean_LocalContext_Inhabited___closed__1; @@ -55,7 +56,6 @@ lean_object* lean_nat_add(lean_object*, lean_object*); extern lean_object* l___private_Lean_Environment_8__persistentEnvExtensionsRef; lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___lambda__2(lean_object*, lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; lean_object* l_Std_HashMapImp_moveEntries___main___at_Lean_addAliasEntry___spec__15(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_mkAliasExtension___spec__4(lean_object*, lean_object*); @@ -74,7 +74,6 @@ lean_object* l_Array_iterateMAux___main___at_Lean_mkAliasExtension___spec__6(lea lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkAliasExtension___spec__11(lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Lean_addAliasEntry(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkAliasExtension___spec__11___closed__1; extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; extern lean_object* l_IO_Error_Inhabited___closed__1; @@ -120,6 +119,7 @@ lean_object* l_Lean_mkAliasExtension___closed__1; lean_object* lean_nat_mul(lean_object*, lean_object*); lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_mkAliasExtension___spec__4___boxed(lean_object*, lean_object*); lean_object* l_Lean_mkAliasExtension___closed__2; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* lean_mk_array(lean_object*, lean_object*); lean_object* lean_io_initializing(lean_object*); lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_addAliasEntry___spec__2(lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Elab/Command.c b/stage0/stdlib/Lean/Elab/Command.c index 8d4c170b9e..7d93491ac7 100644 --- a/stage0/stdlib/Lean/Elab/Command.c +++ b/stage0/stdlib/Lean/Elab/Command.c @@ -71,7 +71,6 @@ lean_object* l_Lean_Elab_log___at_Lean_Elab_Command_logTrace___spec__1___boxed(l extern lean_object* l_Lean_KeyedDeclsAttribute_Def_inhabited___closed__2; lean_object* l_Lean_Elab_Command_liftIO(lean_object*); lean_object* l_ReaderT_lift___at_Lean_Elab_Command_Lean_Elab_MonadMacroAdapter___spec__2___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Syntax_getIdAt(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_commandElabAttribute; lean_object* l_Lean_Elab_Command_getScope___boxed(lean_object*); @@ -107,6 +106,7 @@ lean_object* l_List_append___rarg(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabSetOption(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_logAt___at_Lean_Elab_Command_logTrace___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_getLevelNames___boxed(lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_compileDecl(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_Elab_Command_elabOpenSimple___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabInitQuot___rarg___boxed(lean_object*, lean_object*, lean_object*); @@ -159,6 +159,7 @@ lean_object* l_Lean_Elab_Command_getLevelNames___rarg(lean_object*, lean_object* lean_object* l_Lean_Elab_Command_getScopes___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_MonadIO(lean_object*); lean_object* l___private_Lean_Elab_SyntheticMVars_11__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Exception_inhabited___closed__1; lean_object* l_Lean_Elab_Command_throwErrorAt___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_getRefPos___at_Lean_Elab_Command_throwError___spec__2___boxed(lean_object*, lean_object*, lean_object*); @@ -230,7 +231,6 @@ lean_object* l_Lean_Elab_Command_elabVariables(lean_object*, lean_object*, lean_ lean_object* l_Lean_Elab_Command_getCurrNamespace(lean_object*); lean_object* l_List_foldl___main___at_Lean_Elab_Command_sortDeclLevelParams___spec__1(lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_withoutModifyingEnv___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Command_1__ioErrorToMessage___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabCheck___closed__1; @@ -322,7 +322,6 @@ lean_object* l_Lean_Syntax_prettyPrint(lean_object*); lean_object* l_Lean_Elab_Command_adaptExpander(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_Lean_Elab_MonadMacroAdapter___closed__5; lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_KVMap_insertCore___main(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_Lean_Elab_MonadMacroAdapter___closed__3; @@ -536,6 +535,7 @@ extern lean_object* l_Lean_TraceState_Inhabited___closed__1; lean_object* l___regBuiltin_Lean_Elab_Command_elabNamespace(lean_object*); extern lean_object* l_Lean_Parser_Command_universes___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_elabEnd___closed__3; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabEvalUnsafe___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_mkOptionalNode___closed__1; uint8_t l___private_Lean_Elab_Command_9__checkAnonymousScope(lean_object*); diff --git a/stage0/stdlib/Lean/Elab/DeclModifiers.c b/stage0/stdlib/Lean/Elab/DeclModifiers.c index e17736ea7e..890f578923 100644 --- a/stage0/stdlib/Lean/Elab/DeclModifiers.c +++ b/stage0/stdlib/Lean/Elab/DeclModifiers.c @@ -18,7 +18,6 @@ lean_object* l_Lean_Elab_Command_checkNotAlreadyDeclared(lean_object*, lean_obje extern lean_object* l_Lean_Core_getConstInfo___closed__5; extern lean_object* l_Lean_Name_toString___closed__1; lean_object* l_Lean_Elab_Command_checkNotAlreadyDeclared___closed__4; -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_checkNotAlreadyDeclared___closed__8; extern lean_object* l_Lean_List_format___rarg___closed__4; lean_object* l_Lean_Elab_Command_Modifiers_hasFormat___closed__6; @@ -26,7 +25,6 @@ lean_object* l_Lean_Syntax_getOptional_x3f(lean_object*); lean_object* l_Lean_Format_pretty(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_List_map___main___at_Lean_Elab_Command_Modifiers_hasFormat___spec__2(lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_fmt___at_Lean_Elab_Command_Modifiers_hasFormat___spec__1(lean_object*); lean_object* l_Lean_Elab_Command_Modifiers_hasFormat___closed__8; lean_object* l_Lean_Core_getEnv___rarg(lean_object*, lean_object*); @@ -34,8 +32,10 @@ lean_object* l_Lean_Elab_Command_applyAttributes___boxed(lean_object*, lean_obje extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_Elab_Command_Modifiers_hasFormat___boxed(lean_object*); lean_object* l_Lean_Elab_Command_elabModifiers___closed__6; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_Modifiers_hasFormat___closed__2; lean_object* l_List_append___rarg(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_private_to_user_name(lean_object*); extern lean_object* l_Lean_MessageData_arrayExpr_toMessageData___main___closed__1; lean_object* l_Lean_Elab_Command_Modifiers_hasFormat___closed__1; diff --git a/stage0/stdlib/Lean/Elab/Declaration.c b/stage0/stdlib/Lean/Elab/Declaration.c index 56ca2371db..425e6e39af 100644 --- a/stage0/stdlib/Lean/Elab/Declaration.c +++ b/stage0/stdlib/Lean/Elab/Declaration.c @@ -29,7 +29,6 @@ extern lean_object* l_Lean_nullKind; lean_object* l_Lean_Syntax_getOptional_x3f(lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabConstant___closed__2; -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Syntax_getIdAt(lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Command_commandElabAttribute; lean_object* l_Lean_Elab_Command_elabExample(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -41,6 +40,7 @@ lean_object* l_Lean_Elab_Command_elabConstant___closed__1; extern lean_object* l_Array_empty___closed__1; extern lean_object* l_Lean_Parser_Command_section___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_elabExample___closed__2; +lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_declaration___elambda__1___closed__2; lean_object* l_Lean_mkIdentFrom(lean_object*, lean_object*); lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration(lean_object*); @@ -56,6 +56,7 @@ extern lean_object* l_Lean_Parser_Command_mutual___elambda__1___closed__1; lean_object* lean_string_utf8_byte_size(lean_object*); extern lean_object* l_Lean_Parser_Command_example___elambda__1___closed__2; lean_object* l___private_Lean_Elab_SyntheticMVars_11__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_section___elambda__1___closed__1; lean_object* l___regBuiltin_Lean_Elab_Command_elabDeclaration___closed__1; @@ -74,7 +75,6 @@ lean_object* l_Lean_Elab_Command_mkDeclName(lean_object*, lean_object*, lean_obj lean_object* l___private_Lean_Elab_Declaration_1__inductiveSyntaxToView___lambda__1___boxed(lean_object*, 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*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_levelMVarToParam(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Declaration_7__expandMutualPreamble_x3f___closed__12; lean_object* l___private_Lean_Elab_Declaration_6__splitMutualPreamble(lean_object*, lean_object*); @@ -96,7 +96,6 @@ extern lean_object* l_Lean_Elab_Command_mkDef___lambda__1___closed__1; lean_object* l___private_Lean_Elab_Declaration_7__expandMutualPreamble_x3f___closed__3; lean_object* l_Lean_Elab_Command_elabClassInductive(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_instance___elambda__1___closed__1; extern lean_object* l_Lean_Parser_Command_variable___elambda__1___closed__2; @@ -159,6 +158,7 @@ lean_object* l___private_Lean_Elab_Declaration_7__expandMutualPreamble_x3f___clo uint8_t l_Lean_Syntax_isNone(lean_object*); lean_object* l___private_Lean_Elab_Declaration_7__expandMutualPreamble_x3f___closed__6; extern lean_object* l_Lean_Parser_Command_universes___elambda__1___closed__2; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Elab_Command_applyAttributes___spec__1(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_mkOptionalNode___closed__1; lean_object* l___private_Lean_Elab_Command_5__getVarDecls(lean_object*); diff --git a/stage0/stdlib/Lean/Elab/Definition.c b/stage0/stdlib/Lean/Elab/Definition.c index f5271b34fa..e4d9bbe891 100644 --- a/stage0/stdlib/Lean/Elab/Definition.c +++ b/stage0/stdlib/Lean/Elab/Definition.c @@ -27,7 +27,6 @@ extern lean_object* l_Lean_MessageData_ofList___closed__3; lean_object* l___private_Lean_Elab_Definition_3__withUsedWhen_x27___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDefLike___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_mkDef___lambda__1___closed__4; lean_object* l___private_Lean_Elab_Definition_3__withUsedWhen_x27___rarg___closed__1; lean_object* l_Lean_Elab_Command_withDeclId___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -35,6 +34,7 @@ extern lean_object* l_Array_empty___closed__1; uint8_t l_Lean_checkTraceOption(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDefVal___closed__2; extern lean_object* l_Std_ShareCommon_State_empty; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_compileDecl(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Definition_2__withUsedWhen(lean_object*); lean_object* l_Lean_Elab_Term_mkLambda(lean_object*, lean_object*, lean_object*, lean_object*); @@ -45,6 +45,7 @@ lean_object* l_Lean_Elab_Command_elabDefVal___closed__1; lean_object* l_Lean_Elab_Command_elabDefVal(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_getLevelNames___rarg(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_SyntheticMVars_11__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); uint8_t l_Lean_Elab_Command_DefKind_isExample(uint8_t); lean_object* l_Lean_Elab_Term_ensureHasType(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_mkFreshTypeMVar(uint8_t, lean_object*, lean_object*, lean_object*); @@ -53,7 +54,6 @@ lean_object* l_Lean_Elab_Term_getOptions(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDefLike___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_mkDeclName(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_elabDefLike___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_take(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* l_Lean_Elab_Term_throwUnsupportedSyntax___rarg(lean_object*); @@ -66,7 +66,6 @@ lean_object* l_Lean_Elab_Command_mkDef___lambda__1___closed__1; lean_object* l_Lean_Elab_Term_logTrace(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_mkDef___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_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_iterateMAux___main___at_Lean_ppGoal___spec__6___closed__6; lean_object* l_Lean_getMaxHeight(lean_object*, lean_object*); @@ -95,6 +94,7 @@ lean_object* l___private_Lean_Elab_Definition_1__removeUnused___closed__1; lean_object* l___private_Lean_Elab_Definition_4__regTraceClasses(lean_object*); lean_object* l_Lean_Elab_Command_mkDef___lambda__1___closed__5; lean_object* l_Lean_Elab_Command_mkDef(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Elab_Command_applyAttributes___spec__1(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Command_5__getVarDecls(lean_object*); lean_object* l_Lean_Elab_Command_elabDefLike(lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Elab/Frontend.c b/stage0/stdlib/Lean/Elab/Frontend.c index 7c874ca85d..96339eff95 100644 --- a/stage0/stdlib/Lean/Elab/Frontend.c +++ b/stage0/stdlib/Lean/Elab/Frontend.c @@ -13,31 +13,30 @@ #ifdef __cplusplus extern "C" { #endif -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_unreachable_x21___rarg(lean_object*); lean_object* l_Lean_Parser_parseHeader(lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_runCommandElabM___boxed(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_ModuleParserState_inhabited___closed__1; extern lean_object* l_EIO_Monad___closed__1; lean_object* l_Lean_Elab_IO_processCommands(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Elab_runFrontend(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_processCommandsAux___rarg___boxed(lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_liftIOCore_x21(lean_object*); +lean_object* lean_io_mk_ref(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Parser_mkInputContext(lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_runCommandElabM(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_processCommandsAux___main___rarg(lean_object*, lean_object*); lean_object* l_Lean_Elab_processHeader(lean_object*, lean_object*, lean_object*, uint32_t, lean_object*); extern lean_object* l_Lean_Elab_parseImports___closed__1; lean_object* l_Lean_MessageLog_toList(lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_getInputContext___boxed(lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_setParserState___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_mkState(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_parseCommand___main(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Frontend_1__ioErrorFromEmpty(uint8_t); lean_object* l_Lean_Elab_Frontend_processCommandsAux___boxed(lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Frontend_1__ioErrorFromEmpty___boxed(lean_object*); lean_object* l_Lean_Elab_Frontend_elabCommandAtFrontend(lean_object*, lean_object*, lean_object*); extern lean_object* l___private_Lean_Parser_Module_4__testModuleParserAux___main___closed__1; @@ -62,6 +61,7 @@ lean_object* l_Lean_Elab_Frontend_getParserState(lean_object*, lean_object*); lean_object* lean_process_input(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_processCommandsAux___rarg(lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_setParserState(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Frontend_updateCmdPos___boxed(lean_object*, lean_object*); uint8_t l_Lean_Parser_isEOI(lean_object*); lean_object* l_Lean_Elab_Frontend_setMessages(lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Elab/Inductive.c b/stage0/stdlib/Lean/Elab/Inductive.c index c8847db68a..a2e174775d 100644 --- a/stage0/stdlib/Lean/Elab/Inductive.c +++ b/stage0/stdlib/Lean/Elab/Inductive.c @@ -60,7 +60,6 @@ uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Inductive_33__mkInductiveDecl___lambda__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkForall(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Lean_Elab_Inductive_30__replaceIndFVarsWithConsts___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Lean_Elab_Inductive_30__replaceIndFVarsWithConsts___spec__5___lambda__1(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* lean_array_uset(lean_object*, size_t, lean_object*); @@ -86,6 +85,7 @@ lean_object* l___private_Lean_Elab_Inductive_9__checkParamsAndResultType___main( lean_object* l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Inductive_8__eqvFirstTypeResult___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Inductive_24__traceIndTypes(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_List_forM___main___at___private_Lean_Elab_Inductive_24__traceIndTypes___spec__1___closed__1; lean_object* l___private_Lean_Elab_Inductive_1__elabHeaderAux___main(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Inductive_19__getResultingUniverse(lean_object*, lean_object*, lean_object*); @@ -117,6 +117,7 @@ lean_object* l_List_mapM___main___at___private_Lean_Elab_Inductive_16__elabCtors lean_object* l_Nat_foldAux___main___at___private_Lean_Elab_Inductive_29__mkIndFVar2Const___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_accLevelAtCtor___main___closed__1; lean_object* l___private_Lean_Elab_SyntheticMVars_11__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_checkValidCtorModifier___closed__9; lean_object* l___private_Lean_Elab_Inductive_9__checkParamsAndResultType___main___closed__14; lean_object* l___private_Lean_Elab_Inductive_20__collectUniversesFromCtorTypeAux___main___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -160,7 +161,6 @@ lean_object* lean_expr_instantiate_rev_range(lean_object*, lean_object*, lean_ob extern lean_object* l_Lean_Expr_Inhabited___closed__1; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_List_mapM___main___at___private_Lean_Elab_Inductive_16__elabCtors___spec__1___lambda__1___closed__6; -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Inductive_28__collectLevelParamsInInductive(lean_object*); lean_object* l_Array_forMAux___main___at_Lean_Elab_Command_elabInductiveViews___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Inductive_23__updateResultingUniverse(lean_object*, lean_object*, lean_object*, lean_object*); @@ -220,7 +220,6 @@ lean_object* l___private_Lean_Elab_Inductive_8__eqvFirstTypeResult(lean_object*, lean_object* l_Lean_Elab_Command_shouldInferResultUniverse___closed__3; lean_object* l_Lean_Elab_Command_checkValidInductiveModifier___closed__3; lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withNewLocalInstances___main___at___private_Lean_Elab_Inductive_30__replaceIndFVarsWithConsts___spec__5___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_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Array_forMAux___main___at___private_Lean_Elab_Inductive_34__mkAuxConstructions___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -347,6 +346,7 @@ lean_object* l___private_Lean_Elab_Inductive_12__elabHeader(lean_object*, lean_o lean_object* l_Array_forMAux___main___at___private_Lean_Elab_Inductive_3__checkUnsafe___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Inductive_9__checkParamsAndResultType___main___closed__2; extern lean_object* l_Lean_TraceState_Inhabited___closed__1; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_checkValidInductiveModifier___closed__9; lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_mapM___main___at___private_Lean_Elab_Inductive_17__levelMVarToParamAux___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Elab/Print.c b/stage0/stdlib/Lean/Elab/Print.c index 4a393d6d22..0ddf2fc3a0 100644 --- a/stage0/stdlib/Lean/Elab/Print.c +++ b/stage0/stdlib/Lean/Elab/Print.c @@ -24,7 +24,6 @@ extern lean_object* l___private_Lean_Meta_ExprDefEq_8__checkTypesAndAssign___clo lean_object* l___private_Lean_Elab_Print_8__printIdCore(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Print_2__lparamsToMessageData(lean_object*); extern lean_object* l_Lean_MessageData_ofList___closed__3; -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Lean_Elab_Command_commandElabAttribute; lean_object* l_Lean_Elab_Command_elabPrint___closed__6; lean_object* l_List_forM___main___at___private_Lean_Elab_Print_9__printId___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); @@ -35,6 +34,7 @@ extern lean_object* l_Lean_Elab_Term_resolveName___closed__3; extern lean_object* l_Lean_Parser_Command_private___elambda__1___closed__5; lean_object* l___regBuiltin_Lean_Elab_Command_elabPrint___closed__1; lean_object* l_Lean_Elab_Command_elabPrint___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_private_to_user_name(lean_object*); lean_object* l___private_Lean_Elab_Print_1__throwUnknownId___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___regBuiltin_Lean_Elab_Command_elabPrint(lean_object*); @@ -49,11 +49,11 @@ lean_object* l___private_Lean_Elab_Print_5__printAxiomLike___boxed(lean_object*, lean_object* l___private_Lean_Elab_Print_4__printDefLike___closed__1; lean_object* l___private_Lean_Elab_Print_4__printDefLike___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_Print_5__printAxiomLike(lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Print_4__printDefLike(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_List_filterAux___main___at___private_Lean_Elab_Print_9__printId___spec__1(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Syntax_isStrLit_x3f(lean_object*); lean_object* l_Lean_Elab_Command_elabPrint(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_def___elambda__1___closed__1; @@ -63,7 +63,6 @@ extern lean_object* l_Std_PersistentArray_Stats_toString___closed__4; lean_object* l___private_Lean_Elab_Print_2__lparamsToMessageData___closed__2; lean_object* l___private_Lean_Elab_Print_9__printId___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Syntax_getId(lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Print_2__lparamsToMessageData___closed__1; extern lean_object* l_Lean_protectedExt; @@ -91,6 +90,7 @@ lean_object* l_List_foldl___main___at___private_Lean_Elab_Print_2__lparamsToMess lean_object* l_Lean_Elab_Command_getEnv___rarg(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Print_3__mkHeader___closed__6; lean_object* l___private_Lean_Elab_Print_7__printInduct___closed__2; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Print_6__printQuot(uint8_t); uint8_t l_Lean_TagDeclarationExtension_isTagged(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_resolveGlobalName(lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Elab/StrategyAttrs.c b/stage0/stdlib/Lean/Elab/StrategyAttrs.c index 7c7a9868c4..12041ae04f 100644 --- a/stage0/stdlib/Lean/Elab/StrategyAttrs.c +++ b/stage0/stdlib/Lean/Elab/StrategyAttrs.c @@ -22,7 +22,6 @@ lean_object* l_Lean_EnumAttributes_getValue___at_Lean_getElaboratorStrategy___sp uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_List_map___main___at_Lean_mkElaboratorStrategyAttrs___spec__8(lean_object*, uint8_t, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); uint8_t l_Lean_ElaboratorStrategy_inhabited; lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__12; lean_object* l_Lean_Core_getEnv___rarg(lean_object*, lean_object*); @@ -31,6 +30,7 @@ lean_object* l_Lean_mkElaboratorStrategyAttrs___lambda__1___boxed(lean_object*, lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_mkElaboratorStrategyAttrs___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_mkElaboratorStrategyAttrs___spec__4___closed__1; lean_object* l_Std_RBNode_fold___main___at_Lean_mkElaboratorStrategyAttrs___spec__2___boxed(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__4; lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); @@ -39,6 +39,7 @@ lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Name_inhabited; lean_object* l_Lean_mkElaboratorStrategyAttrs___lambda__1(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_elaboratorStrategyAttrs; lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__21; lean_object* l_Std_RBNode_find___main___at_Lean_getElaboratorStrategy___spec__2___boxed(lean_object*, lean_object*); @@ -50,7 +51,6 @@ extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__3; lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__7; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); lean_object* l_List_forM___main___at_Lean_registerEnumAttributes___spec__11(lean_object*, lean_object*); @@ -64,7 +64,6 @@ lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__11; lean_object* l_Std_RBNode_find___main___at_Lean_getElaboratorStrategy___spec__2(lean_object*, lean_object*); lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__19; lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerParametricAttribute___rarg___closed__1; lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkElaboratorStrategyAttrs___spec__7(lean_object*, lean_object*); extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__6; @@ -94,6 +93,7 @@ lean_object* l_Lean_mkElaboratorStrategyAttrs(lean_object*); lean_object* l_Array_qsortAux___main___at_Lean_mkElaboratorStrategyAttrs___spec__3(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__2; lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__3; extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; lean_object* l_Lean_mkElaboratorStrategyAttrs___closed__15; diff --git a/stage0/stdlib/Lean/Elab/Structure.c b/stage0/stdlib/Lean/Elab/Structure.c index 2c08a57e4f..c571905de8 100644 --- a/stage0/stdlib/Lean/Elab/Structure.c +++ b/stage0/stdlib/Lean/Elab/Structure.c @@ -50,7 +50,6 @@ lean_object* l_Lean_Elab_Command_checkValidFieldModifier___closed__5; uint8_t lean_name_eq(lean_object*, lean_object*); extern lean_object* l_Option_get_x21___rarg___closed__3; lean_object* l___private_Lean_Elab_Structure_13__removeUnused___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Syntax_getIdAt(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_checkValidFieldModifier___closed__3; lean_object* l___private_Lean_Elab_Structure_9__withParents___main___rarg___closed__1; @@ -67,6 +66,7 @@ lean_object* l___private_Lean_Elab_Structure_17__levelMVarToParamAux___boxed(lea lean_object* l___private_Lean_Elab_Structure_15__levelMVarToParamFVar(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Structure_9__withParents___main___rarg___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_Array_filterMAux___main___at___private_Lean_Elab_Structure_26__elabStructureView___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_addInstance(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_mkLambda(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_expr_instantiate1(lean_object*, lean_object*); @@ -85,6 +85,7 @@ lean_object* l_Lean_Elab_Term_withLocalContext___rarg(lean_object*, lean_object* lean_object* l_Lean_Elab_Command_shouldInferResultUniverse(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_getLevelNames___rarg(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_SyntheticMVars_11__synthesizeSyntheticMVarsAux___main(uint8_t, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at___private_Lean_Elab_Structure_3__expandFields___spec__1(lean_object*, lean_object*, uint8_t, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Structure_11__withFields(lean_object*); lean_object* l_Lean_Elab_Term_withLetDecl___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -124,7 +125,6 @@ lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Structure_5__checkParentIsStructure___closed__1; extern lean_object* l_Lean_Expr_Inhabited___closed__1; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Structure_8__processSubfields(lean_object*); extern lean_object* l_Lean_Parser_Term_type___elambda__1___closed__5; uint8_t l_Lean_Elab_Command_StructFieldInfo_isSubobject(lean_object*); @@ -170,7 +170,6 @@ lean_object* l___private_Lean_Elab_Structure_2__expandCtor___boxed(lean_object*, lean_object* l_Lean_Syntax_getId(lean_object*); lean_object* l___private_Lean_Elab_Structure_14__withUsed___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Structure_12__getResultUniverse(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_List_forM___main___at_Lean_Elab_Command_elabStructure___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); @@ -286,6 +285,7 @@ lean_object* l_Array_iterateMAux___main___at___private_Lean_Elab_Structure_3__ex uint8_t l_Lean_Syntax_isNone(lean_object*); lean_object* lean_set_reducibility_status(lean_object*, lean_object*, uint8_t); extern lean_object* l_Lean_TraceState_Inhabited___closed__1; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Elab_Structure_10__elabFieldTypeValue(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Elab_Command_StructFieldInfo_isFromParent(lean_object*); lean_object* l___private_Lean_Elab_Structure_21__collectLevelParamsInFVar(lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Elab/Syntax.c b/stage0/stdlib/Lean/Elab/Syntax.c index 2bc9310b2e..5489733c34 100644 --- a/stage0/stdlib/Lean/Elab/Syntax.c +++ b/stage0/stdlib/Lean/Elab/Syntax.c @@ -87,7 +87,6 @@ lean_object* l_Lean_Elab_Command_expandElab___closed__12; extern lean_object* l_Lean_Parser_Syntax_many1___elambda__1___closed__2; lean_object* l_Lean_Elab_Command_Macro_mkFreshKind(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__104; -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Syntax_getIdAt(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Syntax_paren___elambda__1___closed__3; extern lean_object* l_Lean_Elab_Command_commandElabAttribute; @@ -124,6 +123,7 @@ lean_object* l_Lean_Elab_Command_expandElab___closed__45; extern lean_object* l___private_Lean_Elab_Quotation_4__getHeadInfo___elambda__3___closed__4; extern lean_object* l_Lean_PrettyPrinter_Parenthesizer_term_parenthesizer___lambda__1___closed__6; lean_object* l_Lean_Elab_Command_expandElab___closed__35; +lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Lean_Parser_Command_declaration___elambda__1___closed__2; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__19; lean_object* l_Lean_Elab_Command_expandElab___closed__4; @@ -170,6 +170,7 @@ lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__20; lean_object* l___private_Lean_Elab_Syntax_8__antiquote___main___closed__1; extern lean_object* l_Lean_PrettyPrinter_Parenthesizer_term_parenthesizer___lambda__1___closed__4; lean_object* l_Lean_Elab_Command_strLitToPattern(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_throwErrorAt___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__10; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__32; @@ -244,7 +245,6 @@ lean_object* l_Lean_Elab_Command_elabMixfix___rarg(lean_object*); lean_object* l_Lean_Elab_Command_elabSyntaxAbbrev___closed__7; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__127; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_List_toString___at_Lean_Elab_OpenDecl_HasToString___spec__2(lean_object*); lean_object* l_Lean_Elab_Command_expandElab___closed__49; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__61; @@ -336,7 +336,6 @@ extern lean_object* l_Lean_Parser_mkParserAttributeImpl___closed__1; extern lean_object* l_Lean_Parser_termParser___closed__2; lean_object* lean_name_mk_string(lean_object*, lean_object*); extern lean_object* l_Lean_choiceKind; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at___private_Lean_Elab_Syntax_1__mkParserSeq___spec__1___closed__4; lean_object* l_Lean_Elab_Command_elabNoKindMacroRulesAux___closed__1; lean_object* l_Lean_Elab_Term_throwError___rarg(lean_object*, lean_object*, lean_object*); @@ -577,6 +576,7 @@ uint8_t l_Lean_Syntax_isNone(lean_object*); lean_object* l_Lean_Elab_Command_elabNoKindMacroRulesAux___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Command_expandElab___closed__51; lean_object* l___private_Lean_Elab_Syntax_6__declareSyntaxCatQuotParser___closed__8; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__131; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__27; lean_object* l_Lean_Elab_Term_toParserDescrAux___main___closed__17; diff --git a/stage0/stdlib/Lean/Environment.c b/stage0/stdlib/Lean/Environment.c index 58459eb5c1..a46b0191e5 100644 --- a/stage0/stdlib/Lean/Environment.c +++ b/stage0/stdlib/Lean/Environment.c @@ -23,7 +23,6 @@ lean_object* lean_array_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_isNamespace___boxed(lean_object*, lean_object*); lean_object* l_Lean_importModulesAux___main___closed__1; size_t l_USize_add(size_t, size_t); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerPersistentEnvExtensionUnsafe___spec__2___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Environment_displayStats___closed__2; lean_object* l_Lean_SimplePersistentEnvExtension_setState___rarg(lean_object*, lean_object*, lean_object*); @@ -71,7 +70,6 @@ uint8_t l_Std_PersistentHashMap_containsAtAux___main___at_Lean_Environment_conta lean_object* l_Array_iterateMAux___main___at_Lean_importModules___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_SMap_numBuckets___at_Lean_Environment_displayStats___spec__5___boxed(lean_object*); lean_object* l_Std_HashMapImp_find_x3f___at_Lean_Environment_getModuleIdxFor_x3f___spec__1___boxed(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* l_Lean_EnvExtension_modifyStateUnsafe___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_array_uset(lean_object*, size_t, lean_object*); @@ -89,9 +87,11 @@ lean_object* l_Lean_EnvExtension_setStateUnsafe___rarg___boxed(lean_object*, lea size_t l_USize_sub(size_t, size_t); extern lean_object* l_Array_empty___closed__1; lean_object* lean_environment_find(lean_object*, lean_object*); +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Expr_FindImpl_findM_x3f___main___at_Lean_Environment_hasUnsafe___spec__1(lean_object*, size_t, lean_object*, lean_object*); lean_object* lean_read_module_data(lean_object*, lean_object*); lean_object* l_Lean_TagDeclarationExtension_Inhabited___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_importModules___spec__13(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_ConstantInfo_isUnsafe(lean_object*); lean_object* l_Lean_mkTagDeclarationExtension___closed__2; @@ -138,6 +138,7 @@ lean_object* l_Std_HashMapImp_moveEntries___main___at_Lean_Environment_addAux___ lean_object* l_Lean_namespacesExt___closed__2; lean_object* l_Lean_namespacesExt___elambda__3___boxed(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_empty___at_Lean_Environment_Inhabited___spec__4; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___lambda__4(lean_object*); lean_object* l_Lean_PersistentEnvExtension_inhabited(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_LocalContext_Inhabited___closed__1; @@ -181,7 +182,6 @@ lean_object* l_Lean_SimplePersistentEnvExtension_modifyState___rarg___boxed(lean lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg(lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l___private_Lean_Environment_11__finalizePersistentExtensions(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* lean_environment_add_modification(lean_object*, lean_object*); lean_object* l_Lean_serializeModifications___boxed(lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtension___boxed(lean_object*, lean_object*, lean_object*); @@ -250,7 +250,6 @@ lean_object* l_Array_iterateMAux___main___at_Lean_importModules___spec__7(lean_o lean_object* l_Lean_SimplePersistentEnvExtension_getState___rarg___boxed(lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); extern lean_object* l_List_repr___rarg___closed__2; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_EnvExtension_modifyState___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkTagDeclarationExtension___lambda__2(lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerSimplePersistentEnvExtension___spec__3___rarg(lean_object*, lean_object*, lean_object*); @@ -412,6 +411,7 @@ lean_object* l_Std_HashMapImp_expand___at_Lean_Environment_addAux___spec__8(lean lean_object* l_Lean_SMap_find_x3f_x27___at_Lean_Environment_find_x3f___spec__1___boxed(lean_object*, lean_object*); lean_object* l_Lean_SMap_stageSizes___at_Lean_Environment_displayStats___spec__4___boxed(lean_object*); lean_object* l_List_toStringAux___main___at_Lean_Environment_displayStats___spec__2(uint8_t, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkTagDeclarationExtension(lean_object*, lean_object*); lean_object* l_Std_HashMap_numBuckets___at_Lean_Environment_displayStats___spec__6___boxed(lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_regModListExtension___spec__1(lean_object*, lean_object*); @@ -2871,11 +2871,28 @@ return x_5; lean_object* l___private_Lean_Environment_4__mkEnvExtensionsRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Array_empty___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_EnvExtension_Inhabited___rarg___lambda__1(lean_object* x_1) { _start: @@ -4010,11 +4027,28 @@ return x_4; lean_object* l___private_Lean_Environment_7__mkPersistentEnvExtensionsRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Array_empty___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } uint8_t l_Array_anyRangeMAux___main___at_Lean_registerPersistentEnvExtensionUnsafe___spec__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: diff --git a/stage0/stdlib/Lean/KeyedDeclsAttribute.c b/stage0/stdlib/Lean/KeyedDeclsAttribute.c index 1ac58cf2a8..2b65a3ac3d 100644 --- a/stage0/stdlib/Lean/KeyedDeclsAttribute.c +++ b/stage0/stdlib/Lean/KeyedDeclsAttribute.c @@ -19,7 +19,6 @@ lean_object* l_Lean_KeyedDeclsAttribute_init___rarg___lambda__2___boxed(lean_obj lean_object* l_Std_PersistentHashMap_insertAtCollisionNodeAux___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__23___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_insert___at_Lean_KeyedDeclsAttribute_Table_insert___spec__10___rarg(lean_object*, lean_object*, lean_object*); size_t l_USize_add(size_t, size_t); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_KeyedDeclsAttribute_inhabited___closed__2; lean_object* l_Lean_KeyedDeclsAttribute_declareBuiltin___rarg___closed__3; lean_object* l_Array_iterateMAux___main___at___private_Lean_KeyedDeclsAttribute_2__addImported___spec__2___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -47,7 +46,6 @@ lean_object* l_Std_mkHashMap___at_Lean_KeyedDeclsAttribute_ExtensionState_inhabi uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_Def_inhabited___closed__2; lean_object* l_Lean_KeyedDeclsAttribute_declareBuiltin___rarg___closed__8; -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Std_AssocList_foldlM___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__29(lean_object*); lean_object* l_Std_mkHashMap___at_Lean_KeyedDeclsAttribute_ExtensionState_inhabited___spec__2___rarg(lean_object*); lean_object* l___private_Lean_KeyedDeclsAttribute_2__addImported(lean_object*); @@ -66,9 +64,11 @@ extern lean_object* l_Array_empty___closed__1; lean_object* l_Lean_KeyedDeclsAttribute_getValues(lean_object*); lean_object* l_Lean_SMap_empty___at_Lean_KeyedDeclsAttribute_init___spec__1___closed__1; lean_object* l_Lean_KeyedDeclsAttribute_Def_inhabited___closed__1; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_init___rarg___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_insertAux___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__22___rarg(lean_object*, size_t, size_t, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAux___main___at_Lean_KeyedDeclsAttribute_getValues___spec__3___rarg(lean_object*, size_t, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* l_Std_PersistentHashMap_getCollisionNodeSize___rarg(lean_object*); @@ -85,6 +85,7 @@ size_t l_USize_shiftRight(size_t, size_t); lean_object* l_Std_mkHashMap___at_Lean_KeyedDeclsAttribute_init___spec__2___rarg(lean_object*); lean_object* l_Std_AssocList_replace___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__30___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Std_HashMapImp_moveEntries___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__28(lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Std_AssocList_contains___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__26___rarg___boxed(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAux___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__3___rarg(lean_object*, size_t, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*); @@ -118,7 +119,6 @@ lean_object* l_Std_AssocList_contains___main___at_Lean_KeyedDeclsAttribute_Table lean_object* l_Std_PersistentHashMap_empty___at_Lean_KeyedDeclsAttribute_init___spec__3(lean_object*); lean_object* l_Lean_SMap_find_x3f___at_Lean_KeyedDeclsAttribute_getValues___spec__1___rarg(lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_KeyedDeclsAttribute_getValues___spec__4(lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_Table_insert(lean_object*); lean_object* l_Std_HashMapImp_moveEntries___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__17___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_KeyedDeclsAttribute_init___spec__6___rarg___closed__2; @@ -159,7 +159,6 @@ lean_object* l_Array_anyRangeMAux___main___at_Lean_KeyedDeclsAttribute_init___sp lean_object* l_Lean_Core_ofExcept___at_Lean_KeyedDeclsAttribute_init___spec__11___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_KeyedDeclsAttribute_declareBuiltin___rarg___closed__10; lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_empty___at_Lean_KeyedDeclsAttribute_ExtensionState_inhabited___spec__3(lean_object*); lean_object* l_Std_AssocList_find_x3f___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__6___rarg(lean_object*, lean_object*); lean_object* l_Lean_SMap_empty___at_Lean_KeyedDeclsAttribute_init___spec__1(lean_object*); @@ -261,6 +260,7 @@ lean_object* l_Std_PersistentHashMap_findAtAux___main___at_Lean_KeyedDeclsAttrib lean_object* l_Lean_KeyedDeclsAttribute_init___rarg___lambda__3___closed__2; lean_object* l_Lean_SMap_empty___at_Lean_KeyedDeclsAttribute_KeyedDeclsAttribute_inhabited___spec__1___closed__1; lean_object* l_Std_AssocList_find_x3f___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__8(lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); uint8_t l_Std_AssocList_contains___main___at_Lean_KeyedDeclsAttribute_Table_insert___spec__15___rarg(lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_KeyedDeclsAttribute_init___spec__5___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_empty___at_Lean_KeyedDeclsAttribute_init___spec__9(lean_object*); @@ -3398,7 +3398,7 @@ return x_2; lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: { -lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; uint8_t x_11; x_5 = lean_ctor_get(x_1, 1); x_6 = lean_io_ref_take(x_5, x_4); x_7 = lean_ctor_get(x_6, 0); @@ -3408,8 +3408,25 @@ lean_inc(x_8); lean_dec(x_6); x_9 = l_Lean_KeyedDeclsAttribute_Table_insert___rarg(x_7, x_2, x_3); x_10 = lean_io_ref_set(x_5, x_9, x_8); +x_11 = !lean_is_exclusive(x_10); +if (x_11 == 0) +{ return x_10; } +else +{ +lean_object* x_12; lean_object* x_13; lean_object* x_14; +x_12 = lean_ctor_get(x_10, 0); +x_13 = lean_ctor_get(x_10, 1); +lean_inc(x_13); +lean_inc(x_12); +lean_dec(x_10); +x_14 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_14, 0, x_12); +lean_ctor_set(x_14, 1, x_13); +return x_14; +} +} } lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin(lean_object* x_1) { _start: diff --git a/stage0/stdlib/Lean/Linter.c b/stage0/stdlib/Lean/Linter.c index d737f6a3a5..dcd2be35c0 100644 --- a/stage0/stdlib/Lean/Linter.c +++ b/stage0/stdlib/Lean/Linter.c @@ -13,27 +13,44 @@ #ifdef __cplusplus extern "C" { #endif -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_addLinter(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* lean_linters_ref; lean_object* l_Lean_mkLintersRef(lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkLintersRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Array_empty___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_addLinter(lean_object* x_1, lean_object* x_2) { _start: { -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_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; uint8_t x_9; x_3 = lean_linters_ref; x_4 = lean_io_ref_get(x_3, x_2); x_5 = lean_ctor_get(x_4, 0); @@ -43,8 +60,25 @@ lean_inc(x_6); lean_dec(x_4); x_7 = lean_array_push(x_5, x_1); x_8 = lean_io_ref_set(x_3, x_7, x_6); +x_9 = !lean_is_exclusive(x_8); +if (x_9 == 0) +{ return x_8; } +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_8, 0); +x_11 = lean_ctor_get(x_8, 1); +lean_inc(x_11); +lean_inc(x_10); +lean_dec(x_8); +x_12 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +return x_12; +} +} } lean_object* initialize_Init(lean_object*); lean_object* initialize_Lean_Attributes(lean_object*); diff --git a/stage0/stdlib/Lean/Meta/Basic.c b/stage0/stdlib/Lean/Meta/Basic.c index 0e73d1335a..7123a32020 100644 --- a/stage0/stdlib/Lean/Meta/Basic.c +++ b/stage0/stdlib/Lean/Meta/Basic.c @@ -24,7 +24,6 @@ lean_object* l___private_Lean_Meta_Basic_12__regTraceClasses(lean_object*); lean_object* l_Lean_Meta_MetaExtState_inhabited___closed__4; lean_object* l_List_foldlM___main___at_Lean_Meta_withExistingLocalDecls___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_Basic_6__forallTelescopeReducingAux___at_Lean_Meta_forallTelescopeReducing___spec__1(lean_object*); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Meta_withLocalDecl(lean_object*); extern lean_object* l_Std_PersistentHashMap_empty___rarg___closed__2; lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_isClassExpensive___main___spec__5___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -68,7 +67,6 @@ lean_object* l_Lean_Meta_addContext___boxed(lean_object*, lean_object*, lean_obj lean_object* l_Lean_Meta_mkFreshExprMVarAt___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkForall(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withLocalContext___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_local_ctx_mk_let_decl(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Std_HashMap_inhabited___closed__1; lean_object* l_ReaderT_bind___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -94,12 +92,14 @@ lean_object* l_Lean_MetavarContext_setMVarKind(lean_object*, lean_object*, uint8 lean_object* l_Lean_Meta_getParamNames___closed__1; lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallTelescopeReducing___spec__5___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_dbg_trace(lean_object*, lean_object*); +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Meta_forallTelescope(lean_object*); lean_object* l_Lean_Meta_setMCtx___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallTelescope___spec__3___rarg___lambda__1(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_ReaderT_bind___at_Lean_Meta_isClassExpensive___main___spec__4___rarg(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_Basic_7__lambdaTelescopeAux___main___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkFreshExprMVarWithId___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Meta_fullApproxDefEq(lean_object*); lean_object* l_Std_PersistentArray_forM___at_IO_runMeta___spec__1___boxed(lean_object*, lean_object*); lean_object* l_Option_hash___at_Lean_Meta_InfoCacheKey_Hashable___spec__1___boxed(lean_object*); @@ -130,6 +130,7 @@ lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallTeles lean_object* l_Lean_Meta_mkInferTypeRef___lambda__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_isReadOnlyLevelMVar___boxed(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_Basic_11__instantiateForallAux(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Meta_setInlineAttribute___boxed(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_isReducible(lean_object*, lean_object*); lean_object* l___private_Lean_Meta_Basic_5__forallTelescopeReducingAuxAux___main___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -184,7 +185,6 @@ lean_object* lean_expr_instantiate_rev_range(lean_object*, lean_object*, lean_ob extern lean_object* l_Lean_Expr_Inhabited___closed__1; lean_object* l_List_foldlM___main___at_Lean_Meta_withExistingLocalDecls___spec__2(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); size_t l_Option_hash___at_Lean_Meta_InfoCacheKey_Hashable___spec__1(lean_object*); lean_object* l___private_Lean_Meta_Basic_6__forallTelescopeReducingAux___at_Lean_Meta_forallBoundedTelescope___spec__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_mkSynthPendingRef(lean_object*); @@ -252,7 +252,6 @@ lean_object* l_Lean_Meta_throwEx(lean_object*); size_t l_Lean_Expr_hash(lean_object*); lean_object* l_Lean_Meta_isReadOnlyExprMVar(lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_metaExt___closed__1; lean_object* l_Lean_Meta_run___rarg(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_Basic_9__lambdaMetaTelescopeAux___main(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -415,6 +414,7 @@ lean_object* l_Lean_Meta_getTransparency___boxed(lean_object*, lean_object*); extern lean_object* l_Lean_TraceState_Inhabited___closed__1; lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_instantiateMVars___boxed(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_withNewLocalInstances___main___at_Lean_Meta_forallBoundedTelescope___spec__4(lean_object*); lean_object* l___private_Lean_Meta_Basic_9__lambdaMetaTelescopeAux___main___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_Meta_mkMetaExtension___spec__1(lean_object*, lean_object*); @@ -1337,11 +1337,28 @@ return x_1; lean_object* l_Lean_Meta_mkWHNFRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Meta_mkWHNFRef___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Meta_mkWHNFRef___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: @@ -1415,11 +1432,28 @@ return x_1; lean_object* l_Lean_Meta_mkInferTypeRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Meta_mkInferTypeRef___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Meta_mkInferTypeRef___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: @@ -1493,11 +1527,28 @@ return x_1; lean_object* l_Lean_Meta_mkIsExprDefEqAuxRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Meta_mkIsExprDefEqAuxRef___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Meta_mkIsExprDefEqAuxRef___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: @@ -1533,11 +1584,28 @@ return x_1; lean_object* l_Lean_Meta_mkSynthPendingRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Meta_mkSynthPendingRef___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Meta_mkSynthPendingRef___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: @@ -1809,11 +1877,28 @@ return x_33; lean_object* l_Lean_Meta_mkMetaExtension___lambda__1(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Meta_whnfRef; x_3 = lean_io_ref_get(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Meta_mkMetaExtension___lambda__2(lean_object* x_1, lean_object* x_2) { _start: diff --git a/stage0/stdlib/Lean/Meta/ExprDefEq.c b/stage0/stdlib/Lean/Meta/ExprDefEq.c index b332f52b25..571ba71769 100644 --- a/stage0/stdlib/Lean/Meta/ExprDefEq.c +++ b/stage0/stdlib/Lean/Meta/ExprDefEq.c @@ -196,7 +196,6 @@ lean_object* l_Array_anyRangeMAux___main___at_Lean_Meta_CheckAssignment_check___ lean_object* l___private_Lean_Meta_ExprDefEq_23__isDefEqLeft___closed__4; lean_object* l_Lean_Meta_commitWhen___at___private_Lean_Meta_ExprDefEq_1__isDefEqEta___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, uint64_t, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_ExprDefEq_8__checkTypesAndAssign___closed__8; lean_object* l___private_Lean_Meta_ExprDefEq_23__isDefEqLeft___closed__2; lean_object* l_Array_back___at___private_Lean_Meta_ExprDefEq_14__processAssignmentFOApproxAux___spec__1(lean_object*); @@ -326,6 +325,7 @@ lean_object* lean_expr_update_lambda(lean_object*, uint8_t, lean_object*, lean_o lean_object* l___private_Lean_Meta_ExprDefEq_44__unstuckMVar___at___private_Lean_Meta_ExprDefEq_45__isDefEqOnFailure___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_commitWhenSome_x3f___at_Lean_Meta_isExprDefEqAuxImpl___spec__2___lambda__1(lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* lean_expr_instantiate_rev(lean_object*, lean_object*); uint8_t l_Lean_Meta_TransparencyMode_lt(uint8_t, uint8_t); extern lean_object* l_Lean_prodToExpr___rarg___lambda__1___closed__3; @@ -57125,12 +57125,29 @@ return x_1; lean_object* l_Lean_Meta_setIsExprDefEqAuxRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; lean_object* x_4; +lean_object* x_2; lean_object* x_3; lean_object* x_4; uint8_t x_5; x_2 = l_Lean_Meta_isExprDefEqAuxRef; x_3 = l_Lean_Meta_setIsExprDefEqAuxRef___closed__1; x_4 = lean_io_ref_set(x_2, x_3, x_1); +x_5 = !lean_is_exclusive(x_4); +if (x_5 == 0) +{ return x_4; } +else +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = lean_ctor_get(x_4, 0); +x_7 = lean_ctor_get(x_4, 1); +lean_inc(x_7); +lean_inc(x_6); +lean_dec(x_4); +x_8 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_8, 0, x_6); +lean_ctor_set(x_8, 1, x_7); +return x_8; +} +} } lean_object* l___private_Lean_Meta_ExprDefEq_47__regTraceClasses(lean_object* x_1) { _start: diff --git a/stage0/stdlib/Lean/Meta/InferType.c b/stage0/stdlib/Lean/Meta/InferType.c index 5aff825da8..16d0ac4953 100644 --- a/stage0/stdlib/Lean/Meta/InferType.c +++ b/stage0/stdlib/Lean/Meta/InferType.c @@ -76,7 +76,6 @@ extern lean_object* l_Lean_Meta_inferTypeRef; lean_object* l_Array_iterateMAux___main___at___private_Lean_Meta_InferType_9__checkInferTypeCache___spec__7___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_isPropQuick___main(lean_object*, lean_object*, lean_object*); size_t l_Lean_Expr_hash(lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; lean_object* l___private_Lean_Meta_InferType_8__inferFVarType(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_InferType_4__inferForallType___closed__1; @@ -126,6 +125,7 @@ lean_object* l_Nat_foldMAux___main___at___private_Lean_Meta_InferType_1__inferAp lean_object* l___private_Lean_Meta_InferType_12__isArrowProp(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Expr_2__mkAppRangeAux___main(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Expr_hasLooseBVars(lean_object*); extern lean_object* l_Lean_Expr_Inhabited; lean_object* lean_mk_array(lean_object*, lean_object*); @@ -5099,12 +5099,29 @@ return x_1; lean_object* l_Lean_Meta_setInferTypeRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; lean_object* x_4; +lean_object* x_2; lean_object* x_3; lean_object* x_4; uint8_t x_5; x_2 = l_Lean_Meta_inferTypeRef; x_3 = l_Lean_Meta_setInferTypeRef___closed__1; x_4 = lean_io_ref_set(x_2, x_3, x_1); +x_5 = !lean_is_exclusive(x_4); +if (x_5 == 0) +{ return x_4; } +else +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = lean_ctor_get(x_4, 0); +x_7 = lean_ctor_get(x_4, 1); +lean_inc(x_7); +lean_inc(x_6); +lean_dec(x_4); +x_8 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_8, 0, x_6); +lean_ctor_set(x_8, 1, x_7); +return x_8; +} +} } uint8_t l___private_Lean_Meta_InferType_11__isAlwaysZero___main(lean_object* x_1) { _start: diff --git a/stage0/stdlib/Lean/Meta/Instances.c b/stage0/stdlib/Lean/Meta/Instances.c index e933f59396..5818b3d736 100644 --- a/stage0/stdlib/Lean/Meta/Instances.c +++ b/stage0/stdlib/Lean/Meta/Instances.c @@ -29,7 +29,6 @@ uint8_t l_Array_anyRangeMAux___main___at_Lean_Meta_addInstanceEntry___spec__12(l lean_object* l_Lean_Meta_addInstanceEntry(lean_object*, lean_object*); lean_object* l_Lean_Meta_registerInstanceAttr___closed__5; uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_BinSearch_1__binInsertAux___main___at_Lean_Meta_addInstanceEntry___spec__15___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_DiscrTree_10__insertVal___at_Lean_Meta_addInstanceEntry___spec__10(lean_object*, lean_object*); extern lean_object* l_Lean_Meta_DiscrTree_insertCore___rarg___closed__4; @@ -40,6 +39,7 @@ lean_object* lean_environment_find(lean_object*, lean_object*); lean_object* l_Lean_Meta_getGlobalInstances(lean_object*); extern lean_object* l_Lean_Meta_DiscrTree_Key_inhabited; extern lean_object* l_Lean_Meta_DiscrTree_Trie_inhabited___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_Meta_addInstanceEntry___spec__8(size_t, lean_object*, 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*); @@ -51,6 +51,7 @@ lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_obje lean_object* l_Std_PersistentArray_forM___at_IO_runMeta___spec__1(lean_object*, lean_object*); size_t l_USize_shiftRight(size_t, size_t); lean_object* l_Array_iterateMAux___main___at_Lean_Meta_mkInstanceExtension___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Meta_instanceExtension___elambda__3___boxed(lean_object*, lean_object*); uint8_t l_Lean_Meta_DiscrTree_Key_beq(lean_object*, lean_object*); lean_object* lean_nat_add(lean_object*, lean_object*); @@ -69,7 +70,6 @@ lean_object* l_Lean_Meta_instanceExtension___closed__5; lean_object* lean_array_fget(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_Meta_mkInstanceExtension___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_registerInstanceAttr___lambda__1___closed__3; @@ -93,7 +93,6 @@ lean_object* l_Lean_Meta_registerInstanceAttr___closed__2; lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_Meta_addInstanceEntry___spec__2___boxed(lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l___private_Lean_Meta_Instances_1__mkInstanceKey(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_getGlobalInstances___rarg(lean_object*); extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; lean_object* l_Lean_Meta_instanceExtension___elambda__1(lean_object*); @@ -149,6 +148,7 @@ lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_Meta_mkInstanceExtensio lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_Meta_mkInstanceExtension___spec__1(lean_object*, lean_object*); extern lean_object* l_Lean_TraceState_Inhabited___closed__1; lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); uint8_t l_Array_anyRangeMAux___main___at_Lean_Meta_mkInstanceExtension___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_find_x3f___at_Lean_Meta_addInstanceEntry___spec__2(lean_object*, lean_object*); lean_object* l_Lean_Meta_registerInstanceAttr___closed__3; diff --git a/stage0/stdlib/Lean/Meta/RecursorInfo.c b/stage0/stdlib/Lean/Meta/RecursorInfo.c index 6332b4b10c..260b656157 100644 --- a/stage0/stdlib/Lean/Meta/RecursorInfo.c +++ b/stage0/stdlib/Lean/Meta/RecursorInfo.c @@ -49,7 +49,6 @@ uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); lean_object* l_Lean_Expr_withAppAux___main___at___private_Lean_Meta_RecursorInfo_10__getProduceMotiveAndRecursive___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_RecursorInfo_isMinor___boxed(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l___private_Lean_Meta_RecursorInfo_11__checkMotiveResultType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_uset(lean_object*, size_t, lean_object*); lean_object* l_Std_RBNode_find___main___at_Lean_Meta_getMajorPos_x3f___spec__2___boxed(lean_object*, lean_object*); @@ -63,6 +62,7 @@ lean_object* l_List_toString___at_Lean_Meta_RecursorInfo_HasToString___spec__7(l lean_object* l_Lean_Core_getEnv___rarg(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; lean_object* l___private_Lean_Meta_RecursorInfo_5__getMajorPosDepElim___closed__13; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Expr_withAppAux___main___at___private_Lean_Meta_RecursorInfo_12__mkRecursorInfoAux___spec__1___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Meta_RecursorInfo_isMinor(lean_object*, lean_object*); lean_object* l_Lean_Meta_RecursorInfo_HasToString___closed__14; @@ -91,6 +91,7 @@ lean_object* l_Std_PersistentArray_forM___at_IO_runMeta___spec__1(lean_object*, lean_object* l_Array_binSearchAux___main___at_Lean_Meta_getMajorPos_x3f___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_RecursorInfo_13__syntaxToMajorPos___closed__1; uint8_t l_Array_contains___at_Lean_Meta_CheckAssignment_check___main___spec__2(lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_List_toStringAux___main___at_Lean_Meta_RecursorInfo_HasToString___spec__2___boxed(lean_object*, lean_object*); lean_object* l___private_Lean_Meta_RecursorInfo_11__checkMotiveResultType___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_RecursorInfo_5__getMajorPosDepElim___closed__21; @@ -140,7 +141,6 @@ lean_object* l_Lean_Meta_getMajorPos_x3f(lean_object*, lean_object*); lean_object* l_List_toStringAux___main___at_Lean_Meta_RecursorInfo_HasToString___spec__8(uint8_t, lean_object*); lean_object* l___private_Lean_Meta_RecursorInfo_13__syntaxToMajorPos___closed__3; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Expr_withAppAux___main___at___private_Lean_Meta_RecursorInfo_12__mkRecursorInfoAux___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Nat_foldMAux___main___at___private_Lean_Meta_RecursorInfo_6__getParamsPos___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_RecursorInfo_7__getIndicesPos___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -194,7 +194,6 @@ lean_object* l_List_toStringAux___main___at_Lean_Meta_RecursorInfo_HasToString__ lean_object* l_Lean_Meta_RecursorInfo_numMinors___boxed(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); extern lean_object* l_List_repr___rarg___closed__2; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Nat_foldMAux___main___at___private_Lean_Meta_RecursorInfo_7__getIndicesPos___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_List_toString___at_Lean_Meta_RecursorInfo_HasToString___spec__7___boxed(lean_object*); lean_object* l_Array_back___at___private_Lean_Meta_ExprDefEq_14__processAssignmentFOApproxAux___spec__1(lean_object*); @@ -297,6 +296,7 @@ lean_object* l_List_toStringAux___main___at_Lean_Meta_RecursorInfo_HasToString__ lean_object* l___private_Lean_Meta_RecursorInfo_3__checkMotive___closed__2; extern lean_object* l_Lean_TraceState_Inhabited___closed__1; lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_RecursorInfo_3__checkMotive___closed__8; extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; diff --git a/stage0/stdlib/Lean/Meta/SynthInstance.c b/stage0/stdlib/Lean/Meta/SynthInstance.c index d44996131d..9578f28a0d 100644 --- a/stage0/stdlib/Lean/Meta/SynthInstance.c +++ b/stage0/stdlib/Lean/Meta/SynthInstance.c @@ -175,7 +175,6 @@ lean_object* l_Array_iterateMAux___main___at_Lean_Meta_SynthInstance_getInstance size_t l_Lean_Expr_hash(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); lean_object* l_Std_AssocList_replace___main___at_Lean_Meta_SynthInstance_MkTableKey_normLevel___main___spec__8(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Meta_SynthInstance_4__preprocessArgs___main___closed__2; lean_object* l_Array_iterateMAux___main___at_Lean_Meta_SynthInstance_getInstances___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_GeneratorNode_inhabited; @@ -308,6 +307,7 @@ lean_object* l_Lean_Meta_SynthInstance_MkTableKey_normLevel___main___closed__2; lean_object* l_Std_HashMapImp_expand___at_Lean_Meta_SynthInstance_MkTableKey_normLevel___main___spec__5(lean_object*, lean_object*); lean_object* lean_level_update_succ(lean_object*, lean_object*); lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_openAbstractMVarsResult(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_SynthInstance_modifyTop___boxed(lean_object*, lean_object*, lean_object*); @@ -25278,12 +25278,29 @@ return x_1; lean_object* l_Lean_Meta_setSynthPendingRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; lean_object* x_4; +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_setSynthPendingRef___closed__1; x_4 = lean_io_ref_set(x_2, x_3, x_1); +x_5 = !lean_is_exclusive(x_4); +if (x_5 == 0) +{ return x_4; } +else +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = lean_ctor_get(x_4, 0); +x_7 = lean_ctor_get(x_4, 1); +lean_inc(x_7); +lean_inc(x_6); +lean_dec(x_4); +x_8 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_8, 0, x_6); +lean_ctor_set(x_8, 1, x_7); +return x_8; +} +} } lean_object* l___private_Lean_Meta_SynthInstance_7__regTraceClasses(lean_object* x_1) { _start: diff --git a/stage0/stdlib/Lean/Meta/WHNF.c b/stage0/stdlib/Lean/Meta/WHNF.c index 053d62c0f6..f32be63857 100644 --- a/stage0/stdlib/Lean/Meta/WHNF.c +++ b/stage0/stdlib/Lean/Meta/WHNF.c @@ -132,7 +132,6 @@ lean_object* l_Lean_WHNF_whnfEasyCases___main___at_Lean_Meta_whnfCore___spec__8_ size_t l_Lean_Expr_hash(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); extern lean_object* l_Lean_Literal_type___closed__1; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Util_WHNF_8__deltaBetaDefinition___at_Lean_Meta_unfoldDefinition_x3f___spec__18(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); extern size_t l_Std_PersistentHashMap_insertAux___main___rarg___closed__2; uint8_t l_Lean_ConstantInfo_hasValue(lean_object*); @@ -217,6 +216,7 @@ lean_object* l_Lean_WHNF_whnfEasyCases___main___at_Lean_Meta_whnfImpl___main___s lean_object* l_Std_PersistentHashMap_insertAux___main___at___private_Lean_Meta_WHNF_3__cache___spec__2(lean_object*, size_t, size_t, lean_object*, lean_object*); lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_find_x3f___at___private_Lean_Meta_WHNF_2__cached_x3f___spec__1(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Util_WHNF_1__getFirstCtor___at_Lean_Meta_unfoldDefinition_x3f___spec__11(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Meta_isExprDefEq(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_WHNF_isQuotRecStuck_x3f___at_Lean_Meta_unfoldDefinition_x3f___spec__16(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -18668,12 +18668,29 @@ return x_1; lean_object* l_Lean_Meta_setWHNFRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; lean_object* x_4; +lean_object* x_2; lean_object* x_3; lean_object* x_4; uint8_t x_5; x_2 = l_Lean_Meta_whnfRef; x_3 = l_Lean_Meta_setWHNFRef___closed__1; x_4 = lean_io_ref_set(x_2, x_3, x_1); +x_5 = !lean_is_exclusive(x_4); +if (x_5 == 0) +{ return x_4; } +else +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = lean_ctor_get(x_4, 0); +x_7 = lean_ctor_get(x_4, 1); +lean_inc(x_7); +lean_inc(x_6); +lean_dec(x_4); +x_8 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_8, 0, x_6); +lean_ctor_set(x_8, 1, x_7); +return x_8; +} +} } lean_object* l_Lean_Meta_reduceProj_x3f(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) { _start: diff --git a/stage0/stdlib/Lean/Modifiers.c b/stage0/stdlib/Lean/Modifiers.c index 4e23c3de1b..b10f7c56d9 100644 --- a/stage0/stdlib/Lean/Modifiers.c +++ b/stage0/stdlib/Lean/Modifiers.c @@ -21,10 +21,10 @@ uint8_t l_Lean_isPrivateName___main(lean_object*); lean_object* l_Lean_protectedExt___closed__5; lean_object* l___private_Lean_Modifiers_2__privatePrefixAux___main___boxed(lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_privateHeader; lean_object* lean_mk_private_name(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_private_to_user_name(lean_object*); lean_object* l_Lean_protectedExt___elambda__1___boxed(lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); @@ -34,10 +34,10 @@ lean_object* l___private_Lean_Modifiers_2__privatePrefixAux___boxed(lean_object* uint8_t lean_is_private_name(lean_object*); lean_object* l_Lean_isPrivateName___boxed(lean_object*); lean_object* l_Lean_privateExt___closed__2; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_isPrivateName___main___boxed(lean_object*); uint8_t l_Lean_isPrivateName(lean_object*); lean_object* lean_nat_add(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_EnvExtension_setStateUnsafe___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_protectedExt___elambda__3___boxed(lean_object*, lean_object*); lean_object* l_Lean_privateExt___closed__1; @@ -46,7 +46,6 @@ lean_object* lean_add_protected(lean_object*, lean_object*); lean_object* l___private_Lean_Modifiers_2__privatePrefixAux___main(lean_object*); lean_object* lean_mk_private_prefix(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_protectedExt; extern lean_object* l_IO_Error_Inhabited___closed__1; lean_object* l_Lean_PersistentEnvExtension_addEntry___rarg(lean_object*, lean_object*, lean_object*); @@ -65,6 +64,7 @@ lean_object* l_Lean_protectedExt___elambda__3(lean_object*, lean_object*); lean_object* l_Lean_mkPrivateExtension___closed__1; lean_object* l_Lean_protectedExt___elambda__4___boxed(lean_object*, lean_object*); lean_object* l_Lean_privateExt; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkTagDeclarationExtension(lean_object*, lean_object*); lean_object* l___private_Lean_Modifiers_1__privateToUserNameAux(lean_object*); uint8_t l_Lean_TagDeclarationExtension_isTagged(lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/Parser/Basic.c b/stage0/stdlib/Lean/Parser/Basic.c index dd9d14febf..05079f3f6b 100644 --- a/stage0/stdlib/Lean/Parser/Basic.c +++ b/stage0/stdlib/Lean/Parser/Basic.c @@ -31,7 +31,6 @@ lean_object* l_Lean_Parser_manyAux___main___closed__1; lean_object* l_Lean_Parser_numLit___elambda__1___closed__2; extern lean_object* l_Lean_fieldIdxKind; lean_object* l_Lean_Syntax_forArgsM___rarg(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); uint8_t l_Lean_Parser_checkTailWs(lean_object*); lean_object* l_Lean_Parser_satisfyFn___at_Lean_Parser_hexNumberFn___spec__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_identFn___closed__1; @@ -89,7 +88,6 @@ lean_object* l_Array_foldSepBy___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_numLit___elambda__1___closed__1; lean_object* l_Lean_Parser_longestMatchFn(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_fieldIdx___closed__6; -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Parser_nameLitNoAntiquot; lean_object* l_Lean_Syntax_foldSepArgs___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_nameLitNoAntiquot___closed__2; @@ -133,6 +131,7 @@ extern lean_object* l_Lean_fieldIdxKind___closed__1; lean_object* l_Lean_Parser_antiquotNestedExpr___elambda__1___closed__1; lean_object* l_Lean_Parser_withAntiquotFn(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_categoryParserOfStackFn___closed__2; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Parser_checkColGe(lean_object*, lean_object*); lean_object* l_Lean_Parser_nonReservedSymbolFn(lean_object*, lean_object*, lean_object*); uint8_t l_Char_isDigit(uint32_t); @@ -144,6 +143,7 @@ lean_object* l_Array_iterateMAux___main___at_Lean_Syntax_foldArgsM___spec__1___r lean_object* l_Array_foldlStepMAux___main___at_Array_foldSepByM___spec__1(lean_object*, lean_object*); lean_object* l_Lean_Parser_many1Indent___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_antiquotNestedExpr___elambda__1(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Parser_satisfyFn___boxed(lean_object*, lean_object*, lean_object*, lean_object*); extern uint32_t l_Lean_idEndEscape; lean_object* l_Lean_Parser_mkAntiquot___closed__9; @@ -204,6 +204,7 @@ lean_object* l_Lean_Syntax_forSepArgsM(lean_object*); lean_object* l_Lean_Parser_ParserState_mkErrorsAt(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_Parser_mkCategoryParserFnExtension___spec__1___closed__1; lean_object* l_Lean_Parser_checkStackTopFn___boxed(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Syntax_foldSepRevArgs___rarg___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_leadingParser(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_symbolNoWsInfo___elambda__2(lean_object*, lean_object*); @@ -308,7 +309,6 @@ lean_object* l_Lean_Parser_ident___closed__2; uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_Lean_Parser_Error_HasBeq___closed__1; lean_object* l_Lean_Parser_nonReservedSymbolFnAux(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Std_RBNode_ins___main___at_Lean_Parser_TokenMap_insert___spec__4(lean_object*); lean_object* l_Lean_Syntax_foldSepArgsM___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_Parser_inhabited; @@ -445,7 +445,6 @@ lean_object* l_Lean_Parser_termParser___closed__2; lean_object* lean_name_mk_string(lean_object*, lean_object*); extern lean_object* l_Lean_choiceKind; extern lean_object* l_List_repr___rarg___closed__2; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_charLitKind; extern lean_object* l_List_reprAux___main___rarg___closed__1; lean_object* l_Lean_Parser_takeUntilFn___main___at_Lean_Parser_hexNumberFn___spec__3___boxed(lean_object*, lean_object*); @@ -715,6 +714,7 @@ lean_object* l_Lean_Parser_takeWhile1Fn___boxed(lean_object*, lean_object*, lean lean_object* l_Lean_Parser_identNoAntiquot___closed__3; lean_object* l_Lean_Parser_epsilonInfo___closed__1; lean_object* l_Std_RBNode_ins___main___at_Lean_Parser_TokenMap_insert___spec__7(lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_checkPrec(lean_object*); lean_object* l_Lean_Parser_checkNoImmediateColon___closed__2; extern lean_object* l_Lean_FileMap_Inhabited___closed__1; @@ -23398,11 +23398,28 @@ return x_1; lean_object* l_Lean_Parser_mkCategoryParserFnRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Parser_mkCategoryParserFnRef___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Parser_mkCategoryParserFnRef___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: @@ -23549,11 +23566,28 @@ return x_33; lean_object* l_Lean_Parser_mkCategoryParserFnExtension___lambda__1(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Parser_categoryParserFnRef; x_3 = lean_io_ref_get(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* _init_l_Lean_Parser_mkCategoryParserFnExtension___closed__1() { _start: diff --git a/stage0/stdlib/Lean/Parser/Extension.c b/stage0/stdlib/Lean/Parser/Extension.c index 5e18db43b4..05e23af244 100644 --- a/stage0/stdlib/Lean/Parser/Extension.c +++ b/stage0/stdlib/Lean/Parser/Extension.c @@ -22,7 +22,6 @@ lean_object* l_Lean_Parser_builtinTokenTable; extern lean_object* l_Lean_Name_toString___closed__1; lean_object* l___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); size_t l_USize_add(size_t, size_t); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Parser_declareLeadingBuiltinParser___closed__1; lean_object* l_Lean_Parser_mkParserExtension___closed__1; lean_object* l_Std_PersistentHashMap_findAux___main___at_Lean_Parser_addLeadingParser___spec__2(lean_object*, size_t, lean_object*); @@ -49,7 +48,6 @@ extern lean_object* l_Lean_Parser_charLit; lean_object* l_Lean_Parser_trailingLoop___main(lean_object*, lean_object*, lean_object*); uint8_t l_Std_PersistentHashMap_containsAtAux___main___at_Lean_Environment_contains___spec__5(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserOfConstantAux___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Parser_registerBuiltinParserAttribute___closed__1; lean_object* l_Lean_Parser_parserExtension___elambda__1___boxed(lean_object*); lean_object* l_Lean_Parser_mkParserExtension___closed__4; @@ -71,10 +69,12 @@ lean_object* lean_environment_find(lean_object*, lean_object*); lean_object* l_Lean_Parser_parserExtension; extern lean_object* l_Lean_Parser_ident; lean_object* l_Lean_Parser_parserExtension___closed__2; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_Parser_nonReservedSymbolFn(lean_object*, lean_object*, lean_object*); lean_object* l___private_Lean_Parser_Extension_2__throwParserCategoryAlreadyDefined___rarg___closed__1; lean_object* l_Lean_Parser_mkParserState(lean_object*); lean_object* l_Lean_Parser_mkParserExtension___lambda__2(lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_List_map___main___at_Lean_Parser_addLeadingParser___spec__4(lean_object*); lean_object* l___private_Lean_Parser_Extension_13__registerParserAttributeImplBuilder___closed__1; lean_object* l_Lean_Parser_declareBuiltinParser___closed__3; @@ -112,6 +112,7 @@ lean_object* l_Lean_Parser_isParserCategory___boxed(lean_object*, lean_object*); lean_object* l_Lean_Parser_declareBuiltinParser___closed__2; lean_object* l_Std_PersistentHashMap_forM___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_mkAppStx___closed__4; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l___private_Lean_Parser_Extension_11__BuiltinParserAttribute_add___closed__1; lean_object* l_Lean_Parser_parserExtension___closed__1; lean_object* l_Lean_Parser_declareBuiltinParser___closed__4; @@ -152,7 +153,6 @@ lean_object* l_Lean_Parser_mkParserAttributeImpl___elambda__1(lean_object*, lean lean_object* l_Lean_Parser_mkParserExtension___closed__6; lean_object* lean_array_fget(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_Parser_mkBuiltinParserCategories(lean_object*); lean_object* l_Lean_Parser_lookaheadFn(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; @@ -207,7 +207,6 @@ lean_object* l_Lean_Parser_mkParserAttributeImpl___closed__1; extern lean_object* l_Lean_Parser_termParser___closed__2; lean_object* lean_name_mk_string(lean_object*, lean_object*); extern lean_object* l_Lean_choiceKind; -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_charLitKind; lean_object* l_Lean_Parser_regTermParserAttribute___closed__2; lean_object* l___private_Lean_Parser_Extension_2__throwParserCategoryAlreadyDefined(lean_object*); @@ -307,11 +306,13 @@ lean_object* l_Lean_Parser_builtinSyntaxNodeKindSetRef; lean_object* l_Lean_Parser_registerBuiltinNodeKind(lean_object*, lean_object*); lean_object* l_Lean_Parser_mkParserState___boxed(lean_object*); lean_object* l___private_Lean_Parser_Extension_13__registerParserAttributeImplBuilder___lambda__1___closed__2; +lean_object* lean_io_ref_swap(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__9; lean_object* l___private_Lean_Parser_Extension_5__ParserExtension_mkInitial(lean_object*); lean_object* l___private_Lean_Parser_Extension_13__registerParserAttributeImplBuilder___lambda__1___closed__1; lean_object* l___private_Lean_Parser_Extension_10__ParserExtension_addImported___boxed(lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_4__addBuiltinParserCategory___spec__1___boxed(lean_object*, lean_object*); lean_object* l_String_trim(lean_object*); lean_object* l_Lean_Parser_leadingParserAux(lean_object*, lean_object*, uint8_t, lean_object*, lean_object*); @@ -364,7 +365,6 @@ lean_object* l_List_forM___main___at___private_Lean_Parser_Extension_12__ParserA lean_object* l_Lean_Parser_regBuiltinTermParserAttr___closed__2; lean_object* l_Std_PersistentHashMap_foldlM___at___private_Lean_Parser_Extension_12__ParserAttribute_add___spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_PersistentHashMap_insertAtCollisionNodeAux___main___at___private_Lean_Parser_Extension_3__addParserCategoryCore___spec__5(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_swap(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Parser_compileParserDescr___main___closed__4; lean_object* l___private_Lean_Data_Trie_3__findAux_x3f___main___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__2(lean_object*, lean_object*); @@ -390,11 +390,28 @@ lean_object* l_Lean_Parser_andthenFn(lean_object*, lean_object*, lean_object*, l lean_object* l_Lean_Parser_mkBuiltinTokenTable(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_Parser_Trie_HasEmptyc___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* _init_l_Std_PersistentHashMap_empty___at_Lean_Parser_mkBuiltinSyntaxNodeKindSetRef___spec__1() { _start: @@ -407,16 +424,33 @@ return x_1; lean_object* l_Lean_Parser_mkBuiltinSyntaxNodeKindSetRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Std_PersistentHashMap_empty___at_Lean_Parser_mkBuiltinSyntaxNodeKindSetRef___spec__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Parser_registerBuiltinNodeKind(lean_object* x_1, lean_object* x_2) { _start: { -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_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; uint8_t x_10; x_3 = l_Lean_Parser_builtinSyntaxNodeKindSetRef; x_4 = lean_io_ref_take(x_3, x_2); x_5 = lean_ctor_get(x_4, 0); @@ -427,58 +461,57 @@ lean_dec(x_4); x_7 = lean_box(0); x_8 = l_Std_PersistentHashMap_insert___at_Lean_Parser_SyntaxNodeKindSet_insert___spec__1(x_5, x_1, x_7); x_9 = lean_io_ref_set(x_3, x_8, x_6); +x_10 = !lean_is_exclusive(x_9); +if (x_10 == 0) +{ return x_9; } +else +{ +lean_object* x_11; lean_object* x_12; lean_object* x_13; +x_11 = lean_ctor_get(x_9, 0); +x_12 = lean_ctor_get(x_9, 1); +lean_inc(x_12); +lean_inc(x_11); +lean_dec(x_9); +x_13 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_13, 0, x_11); +lean_ctor_set(x_13, 1, x_12); +return x_13; +} +} } lean_object* l___private_Lean_Parser_Extension_1__registerAuxiliaryNodeKindSets(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +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; lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19; x_2 = l_Lean_choiceKind; x_3 = l_Lean_Parser_registerBuiltinNodeKind(x_2, x_1); -if (lean_obj_tag(x_3) == 0) -{ -lean_object* x_4; lean_object* x_5; lean_object* x_6; x_4 = lean_ctor_get(x_3, 1); lean_inc(x_4); lean_dec(x_3); x_5 = l_Lean_identKind; x_6 = l_Lean_Parser_registerBuiltinNodeKind(x_5, x_4); -if (lean_obj_tag(x_6) == 0) -{ -lean_object* x_7; lean_object* x_8; lean_object* x_9; x_7 = lean_ctor_get(x_6, 1); lean_inc(x_7); lean_dec(x_6); x_8 = l_Lean_strLitKind; x_9 = l_Lean_Parser_registerBuiltinNodeKind(x_8, x_7); -if (lean_obj_tag(x_9) == 0) -{ -lean_object* x_10; lean_object* x_11; lean_object* x_12; x_10 = lean_ctor_get(x_9, 1); lean_inc(x_10); lean_dec(x_9); x_11 = l_Lean_numLitKind; x_12 = l_Lean_Parser_registerBuiltinNodeKind(x_11, x_10); -if (lean_obj_tag(x_12) == 0) -{ -lean_object* x_13; lean_object* x_14; lean_object* x_15; x_13 = lean_ctor_get(x_12, 1); lean_inc(x_13); lean_dec(x_12); x_14 = l_Lean_charLitKind; x_15 = l_Lean_Parser_registerBuiltinNodeKind(x_14, x_13); -if (lean_obj_tag(x_15) == 0) -{ -lean_object* x_16; lean_object* x_17; lean_object* x_18; x_16 = lean_ctor_get(x_15, 1); lean_inc(x_16); lean_dec(x_15); x_17 = l_Lean_nameLitKind; x_18 = l_Lean_Parser_registerBuiltinNodeKind(x_17, x_16); -if (lean_obj_tag(x_18) == 0) -{ -uint8_t x_19; x_19 = !lean_is_exclusive(x_18); if (x_19 == 0) { @@ -502,144 +535,6 @@ lean_ctor_set(x_24, 1, x_22); return x_24; } } -else -{ -uint8_t x_25; -x_25 = !lean_is_exclusive(x_18); -if (x_25 == 0) -{ -return x_18; -} -else -{ -lean_object* x_26; lean_object* x_27; lean_object* x_28; -x_26 = lean_ctor_get(x_18, 0); -x_27 = lean_ctor_get(x_18, 1); -lean_inc(x_27); -lean_inc(x_26); -lean_dec(x_18); -x_28 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_28, 0, x_26); -lean_ctor_set(x_28, 1, x_27); -return x_28; -} -} -} -else -{ -uint8_t x_29; -x_29 = !lean_is_exclusive(x_15); -if (x_29 == 0) -{ -return x_15; -} -else -{ -lean_object* x_30; lean_object* x_31; lean_object* x_32; -x_30 = lean_ctor_get(x_15, 0); -x_31 = lean_ctor_get(x_15, 1); -lean_inc(x_31); -lean_inc(x_30); -lean_dec(x_15); -x_32 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_32, 0, x_30); -lean_ctor_set(x_32, 1, x_31); -return x_32; -} -} -} -else -{ -uint8_t x_33; -x_33 = !lean_is_exclusive(x_12); -if (x_33 == 0) -{ -return x_12; -} -else -{ -lean_object* x_34; lean_object* x_35; lean_object* x_36; -x_34 = lean_ctor_get(x_12, 0); -x_35 = lean_ctor_get(x_12, 1); -lean_inc(x_35); -lean_inc(x_34); -lean_dec(x_12); -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 -{ -uint8_t x_37; -x_37 = !lean_is_exclusive(x_9); -if (x_37 == 0) -{ -return x_9; -} -else -{ -lean_object* x_38; lean_object* x_39; lean_object* x_40; -x_38 = lean_ctor_get(x_9, 0); -x_39 = lean_ctor_get(x_9, 1); -lean_inc(x_39); -lean_inc(x_38); -lean_dec(x_9); -x_40 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_40, 0, x_38); -lean_ctor_set(x_40, 1, x_39); -return x_40; -} -} -} -else -{ -uint8_t x_41; -x_41 = !lean_is_exclusive(x_6); -if (x_41 == 0) -{ -return x_6; -} -else -{ -lean_object* x_42; lean_object* x_43; lean_object* x_44; -x_42 = lean_ctor_get(x_6, 0); -x_43 = lean_ctor_get(x_6, 1); -lean_inc(x_43); -lean_inc(x_42); -lean_dec(x_6); -x_44 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_44, 0, x_42); -lean_ctor_set(x_44, 1, x_43); -return x_44; -} -} -} -else -{ -uint8_t x_45; -x_45 = !lean_is_exclusive(x_3); -if (x_45 == 0) -{ -return x_3; -} -else -{ -lean_object* x_46; lean_object* x_47; lean_object* x_48; -x_46 = lean_ctor_get(x_3, 0); -x_47 = lean_ctor_get(x_3, 1); -lean_inc(x_47); -lean_inc(x_46); -lean_dec(x_3); -x_48 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_48, 0, x_46); -lean_ctor_set(x_48, 1, x_47); -return x_48; -} -} -} } lean_object* _init_l_Std_PersistentHashMap_empty___at_Lean_Parser_mkBuiltinParserCategories___spec__1() { _start: @@ -652,11 +547,28 @@ return x_1; lean_object* l_Lean_Parser_mkBuiltinParserCategories(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Std_PersistentHashMap_empty___at_Lean_Parser_mkBuiltinParserCategories___spec__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* _init_l___private_Lean_Parser_Extension_2__throwParserCategoryAlreadyDefined___rarg___closed__1() { _start: @@ -1367,35 +1279,52 @@ x_11 = l_IO_ofExcept___at___private_Lean_Parser_Extension_4__addBuiltinParserCat lean_dec(x_10); if (lean_obj_tag(x_11) == 0) { -lean_object* x_12; lean_object* x_13; lean_object* x_14; +lean_object* x_12; lean_object* x_13; lean_object* x_14; uint8_t x_15; x_12 = lean_ctor_get(x_11, 0); lean_inc(x_12); x_13 = lean_ctor_get(x_11, 1); lean_inc(x_13); lean_dec(x_11); x_14 = lean_io_ref_set(x_4, x_12, x_13); +x_15 = !lean_is_exclusive(x_14); +if (x_15 == 0) +{ return x_14; } else { -uint8_t x_15; -x_15 = !lean_is_exclusive(x_11); -if (x_15 == 0) +lean_object* x_16; lean_object* x_17; lean_object* x_18; +x_16 = lean_ctor_get(x_14, 0); +x_17 = lean_ctor_get(x_14, 1); +lean_inc(x_17); +lean_inc(x_16); +lean_dec(x_14); +x_18 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_18, 0, x_16); +lean_ctor_set(x_18, 1, x_17); +return x_18; +} +} +else +{ +uint8_t x_19; +x_19 = !lean_is_exclusive(x_11); +if (x_19 == 0) { return x_11; } else { -lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_11, 0); -x_17 = lean_ctor_get(x_11, 1); -lean_inc(x_17); -lean_inc(x_16); +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_11, 0); +x_21 = lean_ctor_get(x_11, 1); +lean_inc(x_21); +lean_inc(x_20); lean_dec(x_11); -x_18 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_18, 0, x_16); -lean_ctor_set(x_18, 1, x_17); -return x_18; +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; } } } @@ -2457,56 +2386,92 @@ return x_6; } else { -lean_object* x_20; lean_object* x_21; +lean_object* x_20; lean_object* x_21; uint8_t x_22; lean_free_object(x_6); lean_dec(x_2); x_20 = lean_ctor_get(x_10, 0); lean_inc(x_20); lean_dec(x_10); x_21 = lean_io_ref_set(x_4, x_20, x_9); +x_22 = !lean_is_exclusive(x_21); +if (x_22 == 0) +{ return x_21; } -} else { -lean_object* x_22; lean_object* x_23; lean_object* x_24; -x_22 = lean_ctor_get(x_6, 0); -x_23 = lean_ctor_get(x_6, 1); +lean_object* x_23; lean_object* x_24; lean_object* x_25; +x_23 = lean_ctor_get(x_21, 0); +x_24 = lean_ctor_get(x_21, 1); +lean_inc(x_24); lean_inc(x_23); -lean_inc(x_22); -lean_dec(x_6); -x_24 = l_Lean_Parser_addParserTokens(x_22, x_1); -if (lean_obj_tag(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; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; -x_25 = lean_ctor_get(x_24, 0); -lean_inc(x_25); -lean_dec(x_24); -x_26 = l_Lean_Name_toString___closed__1; -x_27 = l_Lean_Name_toStringWithSep___main(x_26, x_2); -x_28 = l___private_Lean_Parser_Extension_8__updateBuiltinTokens___closed__1; -x_29 = lean_string_append(x_28, x_27); -lean_dec(x_27); -x_30 = l___private_Lean_Parser_Extension_8__updateBuiltinTokens___closed__2; -x_31 = lean_string_append(x_29, x_30); -x_32 = lean_string_append(x_31, x_25); -lean_dec(x_25); -x_33 = lean_alloc_ctor(18, 1, 0); -lean_ctor_set(x_33, 0, x_32); -x_34 = lean_alloc_ctor(1, 2, 0); -lean_ctor_set(x_34, 0, x_33); -lean_ctor_set(x_34, 1, x_23); -return x_34; +lean_dec(x_21); +x_25 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_25, 0, x_23); +lean_ctor_set(x_25, 1, x_24); +return x_25; +} +} } else { -lean_object* x_35; lean_object* x_36; +lean_object* x_26; lean_object* x_27; lean_object* x_28; +x_26 = lean_ctor_get(x_6, 0); +x_27 = lean_ctor_get(x_6, 1); +lean_inc(x_27); +lean_inc(x_26); +lean_dec(x_6); +x_28 = l_Lean_Parser_addParserTokens(x_26, x_1); +if (lean_obj_tag(x_28) == 0) +{ +lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; +x_29 = lean_ctor_get(x_28, 0); +lean_inc(x_29); +lean_dec(x_28); +x_30 = l_Lean_Name_toString___closed__1; +x_31 = l_Lean_Name_toStringWithSep___main(x_30, x_2); +x_32 = l___private_Lean_Parser_Extension_8__updateBuiltinTokens___closed__1; +x_33 = lean_string_append(x_32, x_31); +lean_dec(x_31); +x_34 = l___private_Lean_Parser_Extension_8__updateBuiltinTokens___closed__2; +x_35 = lean_string_append(x_33, x_34); +x_36 = lean_string_append(x_35, x_29); +lean_dec(x_29); +x_37 = lean_alloc_ctor(18, 1, 0); +lean_ctor_set(x_37, 0, x_36); +x_38 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_38, 0, x_37); +lean_ctor_set(x_38, 1, x_27); +return x_38; +} +else +{ +lean_object* x_39; lean_object* x_40; lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_dec(x_2); -x_35 = lean_ctor_get(x_24, 0); -lean_inc(x_35); -lean_dec(x_24); -x_36 = lean_io_ref_set(x_4, x_35, x_23); -return x_36; +x_39 = lean_ctor_get(x_28, 0); +lean_inc(x_39); +lean_dec(x_28); +x_40 = lean_io_ref_set(x_4, x_39, x_27); +x_41 = lean_ctor_get(x_40, 0); +lean_inc(x_41); +x_42 = lean_ctor_get(x_40, 1); +lean_inc(x_42); +if (lean_is_exclusive(x_40)) { + lean_ctor_release(x_40, 0); + lean_ctor_release(x_40, 1); + x_43 = x_40; +} else { + lean_dec_ref(x_40); + x_43 = lean_box(0); +} +if (lean_is_scalar(x_43)) { + x_44 = lean_alloc_ctor(0, 2, 0); +} else { + x_44 = x_43; +} +lean_ctor_set(x_44, 0, x_41); +lean_ctor_set(x_44, 1, x_42); +return x_44; } } } @@ -4906,16 +4871,33 @@ return x_5; lean_object* l_Lean_Parser_mkParserAttributeHooks(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = lean_box(0); x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_Parser_registerParserAttributeHook(lean_object* x_1, lean_object* x_2) { _start: { -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_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; uint8_t x_9; x_3 = l_Lean_Parser_parserAttributeHooks; x_4 = lean_io_ref_take(x_3, x_2); x_5 = lean_ctor_get(x_4, 0); @@ -4927,8 +4909,25 @@ x_7 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_7, 0, x_1); lean_ctor_set(x_7, 1, x_5); x_8 = lean_io_ref_set(x_3, x_7, x_6); +x_9 = !lean_is_exclusive(x_8); +if (x_9 == 0) +{ return x_8; } +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_8, 0); +x_11 = lean_ctor_get(x_8, 1); +lean_inc(x_11); +lean_inc(x_10); +lean_dec(x_8); +x_12 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +return x_12; +} +} } lean_object* l_IO_ofExcept___at___private_Lean_Parser_Extension_10__ParserExtension_addImported___spec__1(lean_object* x_1, lean_object* x_2) { _start: @@ -6821,12 +6820,29 @@ return x_1; lean_object* l_Lean_Parser_setCategoryParserFnRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; lean_object* x_4; +lean_object* x_2; lean_object* x_3; lean_object* x_4; uint8_t x_5; x_2 = l_Lean_Parser_categoryParserFnRef; x_3 = l_Lean_Parser_setCategoryParserFnRef___closed__1; x_4 = lean_io_ref_set(x_2, x_3, x_1); +x_5 = !lean_is_exclusive(x_4); +if (x_5 == 0) +{ return x_4; } +else +{ +lean_object* x_6; lean_object* x_7; lean_object* x_8; +x_6 = lean_ctor_get(x_4, 0); +x_7 = lean_ctor_get(x_4, 1); +lean_inc(x_7); +lean_inc(x_6); +lean_dec(x_4); +x_8 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_8, 0, x_6); +lean_ctor_set(x_8, 1, x_7); +return x_8; +} +} } lean_object* l_Lean_Parser_addToken(lean_object* x_1, lean_object* x_2) { _start: diff --git a/stage0/stdlib/Lean/ParserCompiler/Attribute.c b/stage0/stdlib/Lean/ParserCompiler/Attribute.c index f048093d88..aec5057d7b 100644 --- a/stage0/stdlib/Lean/ParserCompiler/Attribute.c +++ b/stage0/stdlib/Lean/ParserCompiler/Attribute.c @@ -15,17 +15,18 @@ extern "C" { #endif extern lean_object* l_Lean_Name_toString___closed__1; uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); uint8_t l_Array_anyRangeMAux___main___at_Lean_ParserCompiler_registerCombinatorAttribute___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_ParserCompiler_registerCombinatorAttribute___spec__1___boxed(lean_object*, lean_object*); lean_object* l_Lean_ParserCompiler_registerCombinatorAttribute___lambda__1___closed__1; lean_object* l_Lean_Core_getEnv___rarg(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_ParserCompiler_registerCombinatorAttribute___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); extern lean_object* l_Lean_AttributeImpl_inhabited___closed__2; lean_object* lean_nat_add(lean_object*, lean_object*); lean_object* l_Lean_Core_setEnv(lean_object*, lean_object*, lean_object*, lean_object*); @@ -34,7 +35,6 @@ extern lean_object* l_Lean_PersistentEnvExtension_inhabited___rarg___closed__1; lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___lambda__2(lean_object*, lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Lean_ParserCompiler_CombinatorAttribute_Inhabited; -lean_object* lean_io_ref_take(lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; lean_object* l_Lean_ParserCompiler_CombinatorAttribute_getDeclFor___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); @@ -45,7 +45,6 @@ lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_ParserCompiler_register lean_object* l_Array_iterateMAux___main___at_Lean_ParserCompiler_registerCombinatorAttribute___spec__2(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_ParserCompiler_CombinatorAttribute_getDeclFor(lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_ParserCompiler_registerCombinatorAttribute(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_ParserCompiler_registerCombinatorAttribute___closed__1; lean_object* l_Lean_attrParamSyntaxToIdentifier(lean_object*); @@ -69,6 +68,7 @@ extern lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___closed_ extern lean_object* l_Lean_registerParametricAttribute___rarg___closed__3; extern lean_object* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; lean_object* l_Lean_ParserCompiler_CombinatorAttribute_Inhabited___closed__3; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_ParserCompiler_registerCombinatorAttribute___lambda__1___closed__6; lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_ParserCompiler_registerCombinatorAttribute___spec__7(lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_ParserCompiler_registerCombinatorAttribute___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/PrettyPrinter.c b/stage0/stdlib/Lean/PrettyPrinter.c index be1fee98ef..6c999b2cd8 100644 --- a/stage0/stdlib/Lean/PrettyPrinter.c +++ b/stage0/stdlib/Lean/PrettyPrinter.c @@ -18,9 +18,9 @@ lean_object* l_unreachable_x21___rarg(lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1___closed__2; lean_object* l_Lean_PrettyPrinter_formatTerm(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Array_extract___rarg(lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_Syntax_reprint___main(lean_object*); lean_object* l_Lean_PrettyPrinter_ppExpr(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); @@ -36,7 +36,6 @@ lean_object* l_Lean_PrettyPrinter_ppModule(lean_object*, lean_object*, lean_obje lean_object* l_Lean_PrettyPrinter_ppCommand(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_PrettyPrinter_ppModule___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_ppTerm(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_delab(lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_formatCommand(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Std_PersistentArray_empty___closed__3; @@ -47,6 +46,7 @@ lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__2; lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__1; lean_object* l_Lean_PrettyPrinter_registerPPTerm(lean_object*); extern lean_object* l_Lean_TraceState_Inhabited___closed__1; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_PrettyPrinter_registerPPTerm___lambda__1___closed__3; lean_object* l_Lean_Meta_Exception_toStr(lean_object*); lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*); @@ -443,7 +443,7 @@ return x_27; lean_object* l_Lean_PrettyPrinter_registerPPTerm(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; +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; uint8_t x_9; x_2 = l_Lean_Parser_builtinTokenTable; x_3 = lean_io_ref_get(x_2, x_1); x_4 = lean_ctor_get(x_3, 0); @@ -455,8 +455,25 @@ x_6 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_registerPPTerm___lambda__1 lean_closure_set(x_6, 0, x_4); x_7 = l_Lean_ppExprFnRef; x_8 = lean_io_ref_set(x_7, x_6, x_5); +x_9 = !lean_is_exclusive(x_8); +if (x_9 == 0) +{ return x_8; } +else +{ +lean_object* x_10; lean_object* x_11; lean_object* x_12; +x_10 = lean_ctor_get(x_8, 0); +x_11 = lean_ctor_get(x_8, 1); +lean_inc(x_11); +lean_inc(x_10); +lean_dec(x_8); +x_12 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_12, 0, x_10); +lean_ctor_set(x_12, 1, x_11); +return x_12; +} +} } lean_object* initialize_Init(lean_object*); lean_object* initialize_Lean_Delaborator(lean_object*); diff --git a/stage0/stdlib/Lean/ProjFns.c b/stage0/stdlib/Lean/ProjFns.c index 99e7fae41a..4b1d0f1c59 100644 --- a/stage0/stdlib/Lean/ProjFns.c +++ b/stage0/stdlib/Lean/ProjFns.c @@ -24,17 +24,18 @@ lean_object* l_Lean_mkProjectionFnInfoExtension(lean_object*); lean_object* l_Lean_mkProjectionFnInfoExtension___closed__5; uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_mkProjectionFnInfoExtension___closed__3; lean_object* l_Lean_projectionFnInfoExt___elambda__2___boxed(lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkProjectionFnInfoExtension___spec__6___closed__1; extern lean_object* l_Array_empty___closed__1; lean_object* lean_environment_find(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_mkProjectionFnInfoExtension___closed__1; lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); lean_object* lean_string_append(lean_object*, lean_object*); extern lean_object* l_Lean_Name_inhabited; +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_mkProjectionFnInfoExtension___closed__4; uint8_t l_Lean_NameMap_contains___rarg(lean_object*, lean_object*); uint8_t l_Lean_Environment_isProjectionFn(lean_object*, lean_object*); @@ -53,7 +54,6 @@ lean_object* l_Lean_mkProjectionFnInfoExtension___lambda__1(lean_object*, lean_o lean_object* lean_array_fget(lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); lean_object* l_Lean_mkProjectionFnInfoExtension___closed__2; -lean_object* lean_io_ref_take(lean_object*, lean_object*); uint8_t l_Array_binSearchAux___main___at_Lean_Environment_isProjectionFn___spec__1(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); @@ -65,7 +65,6 @@ lean_object* lean_array_get(lean_object*, lean_object*, lean_object*); lean_object* l_Std_RBNode_insert___at_Lean_NameMap_insert___spec__1___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_addProjectionFnInfo___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_mkProjectionFnInfoExtension___spec__4(lean_object*, lean_object*); lean_object* l_Lean_projectionFnInfoExt___closed__5; uint8_t lean_projection_info_from_class(lean_object*); @@ -96,6 +95,7 @@ lean_object* l_Lean_ProjectionFunctionInfo_inhabited; lean_object* l_Array_qsortAux___main___at_Lean_mkProjectionFnInfoExtension___spec__1(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_projectionFnInfoExt___closed__1; lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_projectionFnInfoExt___elambda__4(lean_object*, lean_object*); lean_object* l___private_Init_Data_Array_QSort_1__partitionAux___main___at_Lean_mkProjectionFnInfoExtension___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_binSearchAux___main___at_Lean_Environment_getProjectionFnInfo_x3f___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); diff --git a/stage0/stdlib/Lean/ReducibilityAttrs.c b/stage0/stdlib/Lean/ReducibilityAttrs.c index d925f316ce..c9ddddb530 100644 --- a/stage0/stdlib/Lean/ReducibilityAttrs.c +++ b/stage0/stdlib/Lean/ReducibilityAttrs.c @@ -20,11 +20,11 @@ lean_object* l_Lean_mkReducibilityAttrs___closed__14; lean_object* l_Array_qsortAux___main___at_Lean_mkReducibilityAttrs___spec__3(lean_object*, lean_object*, lean_object*); uint8_t l_Lean_Name_quickLt(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Std_RBNode_fold___main___at_Lean_mkReducibilityAttrs___spec__2___boxed(lean_object*, lean_object*); lean_object* l_Lean_mkReducibilityAttrs___closed__16; lean_object* l_Lean_Core_getEnv___rarg(lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_EnumAttributes_getValue___at_Lean_getReducibilityStatus___spec__1___boxed(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkReducibilityAttrs___closed__8; lean_object* lean_array_push(lean_object*, lean_object*); @@ -33,6 +33,7 @@ lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_Core_throwError___rarg(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_Name_inhabited; lean_object* l_Std_RBNode_find___main___at_Lean_getReducibilityStatus___spec__2___boxed(lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); uint8_t l_Lean_isReducible(lean_object*, lean_object*); lean_object* l_Lean_isReducible___boxed(lean_object*, lean_object*); lean_object* l_Lean_mkReducibilityAttrs___closed__2; @@ -46,7 +47,6 @@ extern lean_object* l_Lean_registerTagAttribute___lambda__4___closed__3; lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Array_binSearchAux___main___at_Lean_getReducibilityStatus___spec__3(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t lean_nat_dec_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_EStateM_bind___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_List_map___main___at_Lean_mkReducibilityAttrs___spec__8___lambda__1(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*); lean_object* lean_nat_sub(lean_object*, lean_object*); @@ -62,7 +62,6 @@ uint8_t lean_get_reducibility_status(lean_object*, lean_object*); lean_object* l_Std_RBNode_find___main___at_Lean_getReducibilityStatus___spec__2(lean_object*, lean_object*); lean_object* l_Lean_mkReducibilityAttrs___closed__18; lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_mkReducibilityAttrs___closed__5; lean_object* l_Lean_mkReducibilityAttrs___closed__3; lean_object* l_Lean_setReducibilityStatus___boxed(lean_object*, lean_object*, lean_object*); @@ -100,6 +99,7 @@ lean_object* l_Lean_registerEnumAttributes___at_Lean_mkReducibilityAttrs___spec_ lean_object* l_Std_RBNode_fold___main___at_Lean_mkReducibilityAttrs___spec__2(lean_object*, lean_object*); lean_object* l_Lean_Environment_getModuleIdxFor_x3f(lean_object*, lean_object*); lean_object* lean_set_reducibility_status(lean_object*, lean_object*, uint8_t); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkReducibilityAttrs___spec__7(lean_object*, lean_object*); lean_object* l_Lean_mkReducibilityAttrs___closed__10; extern lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_registerParametricAttribute___spec__9___rarg___closed__1; diff --git a/stage0/stdlib/Lean/Scopes.c b/stage0/stdlib/Lean/Scopes.c index 70bfb398a5..33e90bf72d 100644 --- a/stage0/stdlib/Lean/Scopes.c +++ b/stage0/stdlib/Lean/Scopes.c @@ -23,13 +23,13 @@ uint8_t lean_is_namespace(lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_regScopeManagerExtension___spec__7___closed__2; lean_object* l_Lean_Environment_registerNamespace___main(lean_object*, lean_object*); uint8_t lean_name_eq(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_scopeManagerExt___elambda__1(lean_object*); lean_object* l_Array_anyRangeMAux___main___at_Lean_regScopeManagerExtension___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* l_Array_iterateMAux___main___at_Lean_regScopeManagerExtension___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*); extern lean_object* l_Array_empty___closed__1; lean_object* l_Array_iterateMAux___main___at_Lean_regScopeManagerExtension___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*); uint8_t l_Array_anyRangeMAux___main___at_Lean_regScopeManagerExtension___spec__6(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_scopeManagerExt___closed__5; lean_object* lean_get_namespaces(lean_object*); lean_object* l_Lean_Environment_popScopeCore(lean_object*); @@ -39,6 +39,7 @@ lean_object* lean_string_append(lean_object*, lean_object*); lean_object* l_Lean_scopeManagerExt___closed__3; lean_object* lean_to_valid_namespace(lean_object*, lean_object*); lean_object* l_Lean_scopeManagerExt___elambda__2___boxed(lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_regScopeManagerExtension___closed__5; lean_object* l_Lean_regScopeManagerExtension___closed__3; lean_object* lean_nat_add(lean_object*, lean_object*); @@ -53,7 +54,6 @@ lean_object* l_Lean_scopeManagerExt___elambda__4___boxed(lean_object*, lean_obje lean_object* l_Lean_scopeManagerExt___elambda__3___boxed(lean_object*, lean_object*); lean_object* lean_array_fget(lean_object*, lean_object*); lean_object* l_Lean_Environment_pushScopeCore___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*); -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_ScopeManagerState_saveNamespace(lean_object*, lean_object*); lean_object* l_Lean_scopeManagerExt___closed__4; extern lean_object* l_Lean_EnvExtension_Inhabited___rarg___closed__1; @@ -67,7 +67,6 @@ lean_object* l_Lean_registerSimplePersistentEnvExtension___rarg___lambda__3(lean lean_object* l_Lean_scopeManagerExt___elambda__4___rarg(lean_object*); lean_object* l_Lean_Environment_pushScopeCore___boxed(lean_object*, lean_object*, lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_SimplePersistentEnvExtension_modifyState___rarg(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_regScopeManagerExtension___lambda__1(lean_object*, lean_object*); lean_object* l_Lean_regScopeManagerExtension___lambda__2___boxed(lean_object*); @@ -96,6 +95,7 @@ lean_object* l_Lean_mkStateFromImportedEntries___at_Lean_regScopeManagerExtensio extern lean_object* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; lean_object* lean_get_namespace(lean_object*); uint8_t lean_in_section(lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_Environment_getNamespaceSet___boxed(lean_object*); lean_object* lean_io_initializing(lean_object*); extern lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___rarg___closed__2; diff --git a/stage0/stdlib/Lean/Util/PPExt.c b/stage0/stdlib/Lean/Util/PPExt.c index 85f261b5f8..4ca808f07d 100644 --- a/stage0/stdlib/Lean/Util/PPExt.c +++ b/stage0/stdlib/Lean/Util/PPExt.c @@ -14,24 +14,23 @@ extern "C" { #endif lean_object* l_Lean_mkPPExprFnExtension___lambda__1(lean_object*); -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_Lean_MetavarContext_instantiateMVars(lean_object*, lean_object*); -lean_object* lean_io_ref_get(lean_object*, lean_object*); extern lean_object* l_Lean_verboseOption___closed__3; +lean_object* lean_io_mk_ref(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* lean_array_push(lean_object*, lean_object*); lean_object* lean_array_get_size(lean_object*); extern lean_object* l_String_splitAux___main___closed__1; lean_object* l_Lean_ppExprExt___elambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_mkPPExprFnExtension(lean_object*); lean_object* l_Lean_mkPPExprFnExtension___closed__1; lean_object* l_Lean_ppExprFnRef; -lean_object* lean_io_ref_take(lean_object*, lean_object*); lean_object* l_Lean_mkPPExprFnRef___closed__1; uint8_t l_Lean_KVMap_getBool(lean_object*, lean_object*, uint8_t); lean_object* l_Lean_ppExprExt___closed__3; lean_object* l_Lean_ppExprExt___elambda__2(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); extern lean_object* l_IO_Error_Inhabited___closed__1; lean_object* lean_expr_dbg_to_string(lean_object*); lean_object* l_Lean_ppExpr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); @@ -48,6 +47,7 @@ lean_object* lean_register_option(lean_object*, lean_object*, lean_object*); extern lean_object* l_Lean_registerEnvExtensionUnsafe___rarg___closed__2; lean_object* l_Lean_ppExpr___closed__2; lean_object* l_Lean_ppOldOption(lean_object*); +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkPPExprFnExtension___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_pp_expr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*); lean_object* lean_io_initializing(lean_object*); @@ -76,11 +76,28 @@ return x_1; lean_object* l_Lean_mkPPExprFnRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_mkPPExprFnRef___closed__1; x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_registerEnvExtensionUnsafe___at_Lean_mkPPExprFnExtension___spec__1___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) { _start: @@ -218,11 +235,28 @@ return x_33; lean_object* l_Lean_mkPPExprFnExtension___lambda__1(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = l_Lean_ppExprFnRef; x_3 = lean_io_ref_get(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* _init_l_Lean_mkPPExprFnExtension___closed__1() { _start: diff --git a/stage0/stdlib/Lean/Util/Path.c b/stage0/stdlib/Lean/Util/Path.c index f99a97538e..5cd0d74716 100644 --- a/stage0/stdlib/Lean/Util/Path.c +++ b/stage0/stdlib/Lean/Util/Path.c @@ -14,15 +14,15 @@ extern "C" { #endif extern lean_object* l_Lean_Name_toString___closed__1; -lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_IO_isDir___at_Lean_findOLean___spec__1___boxed(lean_object*, lean_object*); lean_object* lean_io_is_dir(lean_object*, lean_object*); lean_object* l_String_revPosOf(lean_object*, uint32_t); -lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l___private_Lean_Util_Path_1__pathSep; lean_object* l_Lean_searchPathRef; lean_object* l___private_Init_Util_1__mkPanicMessage(lean_object*, lean_object*, lean_object*, lean_object*); +lean_object* lean_io_mk_ref(lean_object*, lean_object*); lean_object* l_List_append___rarg(lean_object*, lean_object*); +lean_object* lean_io_ref_get(lean_object*, lean_object*); lean_object* l_Lean_getBuiltinSearchPath(lean_object*); lean_object* l_Lean_mkSearchPathRef(lean_object*); lean_object* l_Lean_parseSearchPath___boxed(lean_object*, lean_object*, lean_object*); @@ -47,7 +47,6 @@ lean_object* l_Lean_moduleNameOfFileName___closed__1; extern lean_object* l_Char_HasRepr___closed__1; lean_object* l_System_FilePath_normalizePath(lean_object*); lean_object* lean_name_mk_string(lean_object*, lean_object*); -lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_findOLean___closed__2; lean_object* l_Lean_modPathToFilePath___boxed(lean_object*); lean_object* l_Lean_modPathToFilePath___main___boxed(lean_object*); @@ -74,6 +73,7 @@ lean_object* lean_panic_fn(lean_object*, lean_object*); lean_object* l_Lean_addSearchPathFromEnv(lean_object*, lean_object*); lean_object* l_Lean_getBuiltinSearchPath___closed__2; extern lean_object* l_System_mkFilePath___closed__1; +lean_object* lean_io_ref_set(lean_object*, lean_object*, lean_object*); lean_object* l_Lean_parseSearchPath(lean_object*, lean_object*, lean_object*); lean_object* l_IO_appPath___at_Lean_getBuiltinSearchPath___spec__2(lean_object*); lean_object* l_Lean_Name_getRoot___main(lean_object*); @@ -161,11 +161,28 @@ return x_14; lean_object* l_Lean_mkSearchPathRef(lean_object* x_1) { _start: { -lean_object* x_2; lean_object* x_3; +lean_object* x_2; lean_object* x_3; uint8_t x_4; x_2 = lean_box(0); x_3 = lean_io_mk_ref(x_2, x_1); +x_4 = !lean_is_exclusive(x_3); +if (x_4 == 0) +{ return x_3; } +else +{ +lean_object* x_5; lean_object* x_6; lean_object* x_7; +x_5 = lean_ctor_get(x_3, 0); +x_6 = lean_ctor_get(x_3, 1); +lean_inc(x_6); +lean_inc(x_5); +lean_dec(x_3); +x_7 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_7, 0, x_5); +lean_ctor_set(x_7, 1, x_6); +return x_7; +} +} } lean_object* l_Lean_parseSearchPath(lean_object* x_1, lean_object* x_2, lean_object* x_3) { _start: @@ -460,7 +477,7 @@ lean_dec(x_3); x_6 = l_Lean_addSearchPathFromEnv(x_4, x_5); if (lean_obj_tag(x_6) == 0) { -lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; +lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; uint8_t x_11; x_7 = lean_ctor_get(x_6, 0); lean_inc(x_7); x_8 = lean_ctor_get(x_6, 1); @@ -468,47 +485,41 @@ lean_inc(x_8); lean_dec(x_6); x_9 = l_Lean_searchPathRef; x_10 = lean_io_ref_set(x_9, x_7, x_8); +x_11 = !lean_is_exclusive(x_10); +if (x_11 == 0) +{ return x_10; } else { -uint8_t x_11; -x_11 = !lean_is_exclusive(x_6); -if (x_11 == 0) -{ -return x_6; -} -else -{ lean_object* x_12; lean_object* x_13; lean_object* x_14; -x_12 = lean_ctor_get(x_6, 0); -x_13 = lean_ctor_get(x_6, 1); +x_12 = lean_ctor_get(x_10, 0); +x_13 = lean_ctor_get(x_10, 1); lean_inc(x_13); lean_inc(x_12); -lean_dec(x_6); -x_14 = lean_alloc_ctor(1, 2, 0); +lean_dec(x_10); +x_14 = lean_alloc_ctor(0, 2, 0); lean_ctor_set(x_14, 0, x_12); lean_ctor_set(x_14, 1, x_13); return x_14; } } -} else { uint8_t x_15; -x_15 = !lean_is_exclusive(x_3); +x_15 = !lean_is_exclusive(x_6); if (x_15 == 0) { -return x_3; +return x_6; } else { lean_object* x_16; lean_object* x_17; lean_object* x_18; -x_16 = lean_ctor_get(x_3, 0); -x_17 = lean_ctor_get(x_3, 1); +x_16 = lean_ctor_get(x_6, 0); +x_17 = lean_ctor_get(x_6, 1); lean_inc(x_17); lean_inc(x_16); -lean_dec(x_3); +lean_dec(x_6); x_18 = lean_alloc_ctor(1, 2, 0); lean_ctor_set(x_18, 0, x_16); lean_ctor_set(x_18, 1, x_17); @@ -518,21 +529,61 @@ return x_18; } else { -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; -x_19 = lean_ctor_get(x_1, 0); -lean_inc(x_19); -lean_dec(x_1); -x_20 = lean_box(0); -x_21 = l_Lean_parseSearchPath(x_19, x_20, x_2); -lean_dec(x_19); -x_22 = lean_ctor_get(x_21, 0); -lean_inc(x_22); -x_23 = lean_ctor_get(x_21, 1); +uint8_t x_19; +x_19 = !lean_is_exclusive(x_3); +if (x_19 == 0) +{ +return x_3; +} +else +{ +lean_object* x_20; lean_object* x_21; lean_object* x_22; +x_20 = lean_ctor_get(x_3, 0); +x_21 = lean_ctor_get(x_3, 1); +lean_inc(x_21); +lean_inc(x_20); +lean_dec(x_3); +x_22 = lean_alloc_ctor(1, 2, 0); +lean_ctor_set(x_22, 0, x_20); +lean_ctor_set(x_22, 1, x_21); +return x_22; +} +} +} +else +{ +lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; uint8_t x_30; +x_23 = lean_ctor_get(x_1, 0); lean_inc(x_23); -lean_dec(x_21); -x_24 = l_Lean_searchPathRef; -x_25 = lean_io_ref_set(x_24, x_22, x_23); -return x_25; +lean_dec(x_1); +x_24 = lean_box(0); +x_25 = l_Lean_parseSearchPath(x_23, x_24, x_2); +lean_dec(x_23); +x_26 = lean_ctor_get(x_25, 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_searchPathRef; +x_29 = lean_io_ref_set(x_28, x_26, x_27); +x_30 = !lean_is_exclusive(x_29); +if (x_30 == 0) +{ +return x_29; +} +else +{ +lean_object* x_31; lean_object* x_32; lean_object* x_33; +x_31 = lean_ctor_get(x_29, 0); +x_32 = lean_ctor_get(x_29, 1); +lean_inc(x_32); +lean_inc(x_31); +lean_dec(x_29); +x_33 = lean_alloc_ctor(0, 2, 0); +lean_ctor_set(x_33, 0, x_31); +lean_ctor_set(x_33, 1, x_32); +return x_33; +} } } }