Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump toolchain to v4.15.0-rc1 #9

Merged
merged 8 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Plausible/Gen.lean
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def listOf (x : Gen α) : Gen (List α) := do
/-- Given a list of example generators, choose one to create an example. -/
def oneOf (xs : Array (Gen α)) (pos : 0 < xs.size := by decide) : Gen α := do
let ⟨x, _, h2⟩ ← up <| chooseNatLt 0 xs.size pos
xs.get ⟨x, h2⟩
xs[x]

/-- Given a list of examples, choose one to create an example. -/
def elements (xs : List α) (pos : 0 < xs.length) : Gen α := do
Expand Down
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
4 changes: 2 additions & 2 deletions lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "8d6c853f11a5172efa0e96b9f2be1a83d861cdd9",
"rev": "7805acf1864ba1a2e359f86a8f092ccf1438ad83",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "v4.14.0",
"inputRev": "v4.15.0-rc1",
"inherited": false,
"configFile": "lakefile.toml"}],
"name": "plausible",
Expand Down
2 changes: 1 addition & 1 deletion lakefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ name = "Plausible"
[[require]]
name = "batteries"
scope = "leanprover-community"
rev = "v4.14.0"
rev = "v4.15.0-rc1"
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.14.0
leanprover/lean4:v4.15.0-rc1