Skip to content

Commit

Permalink
deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Nov 28, 2024
1 parent 011b21f commit d1fe662
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Plausible/Random.lean
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def randBound (α : Type u) [LE α] [BoundedRandom m α] (lo hi : α) (h : lo
Generate a random `Fin`.
-/
def randFin {n : Nat} [RandomGen g] : RandGT g m (Fin n.succ) :=
fun ⟨g⟩ => return randNat g 0 n |>.map Fin.ofNat ULift.up
fun ⟨g⟩ => return randNat g 0 n |>.map (Fin.ofNat' _) ULift.up

instance {n : Nat} : Random m (Fin n.succ) where
random := randFin
Expand Down
4 changes: 2 additions & 2 deletions Plausible/Sampleable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ instance Nat.shrinkable : Shrinkable Nat where
shrink := Nat.shrink

instance Fin.shrinkable {n : Nat} : Shrinkable (Fin n.succ) where
shrink m := Nat.shrink m |>.map Fin.ofNat
shrink m := Nat.shrink m |>.map (Fin.ofNat' _)

instance BitVec.shrinkable {n : Nat} : Shrinkable (BitVec n) where
shrink m := Nat.shrink m.toNat |>.map (BitVec.ofNat n)
Expand Down Expand Up @@ -269,7 +269,7 @@ instance Nat.sampleableExt : SampleableExt Nat :=
instance Fin.sampleableExt {n : Nat} : SampleableExt (Fin (n.succ)) :=
mkSelfContained do
let m ← choose Nat 0 (min (← getSize) n) (Nat.zero_le _)
return Fin.ofNat m
return (Fin.ofNat' _ m)

instance BitVec.sampleableExt {n : Nat} : SampleableExt (BitVec n) :=
mkSelfContained do
Expand Down

0 comments on commit d1fe662

Please sign in to comment.