Skip to content

Commit

Permalink
Merge pull request #3 from leanprover-community/nightly-testing
Browse files Browse the repository at this point in the history
chore: bump toolchain to v4.14.0-rc1
  • Loading branch information
kim-em authored Nov 4, 2024
2 parents 3b0b954 + 1307193 commit 859caad
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Plausible/Sampleable.lean
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ instance Int.shrinkable : Shrinkable Int where
let converter n :=
let int := Int.ofNat n
[int, -int]
Nat.shrink n.natAbs |>.bind converter
Nat.shrink n.natAbs |>.flatMap converter

instance Bool.shrinkable : Shrinkable Bool := {}
instance Char.shrinkable : Shrinkable Char := {}
Expand Down Expand Up @@ -214,7 +214,7 @@ open Shrinkable
instance List.shrinkable [Shrinkable α] : Shrinkable (List α) where
shrink := fun L =>
(L.mapIdx fun i _ => L.eraseIdx i) ++
(L.mapIdx fun i a => (shrink a).map fun a' => L.modify (fun _ => a') i).join
(L.mapIdx fun i a => (shrink a).map fun a' => L.modify (fun _ => a') i).flatten

instance ULift.shrinkable [Shrinkable α] : Shrinkable (ULift α) where
shrink u := (shrink u.down).map ULift.up
Expand Down
54 changes: 28 additions & 26 deletions Test/Tactic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -150,29 +150,31 @@ theorem testBit_pred :
(Bool.xor ((List.range i).all fun j => ! testBit x j) (testBit x i))) := by
plausible

/--
error:
===================
Found a counter-example!
f := 1
issue: ULift.up 1 = ULift.up 0 does not hold
(0 shrinks)
-------------------
-/
#guard_msgs in
theorem ulift_nat (f : ULift.{1} Nat) : f = ⟨0⟩ := by
plausible

/--
error:
===================
Found a counter-example!
α := "ULift Int"
l := [0]
issue: [ULift.up 0] = [ULift.up 0, ULift.up 0] does not hold
(1 shrinks)
-------------------
-/
#guard_msgs in
theorem type_u (α : Type u) (l : List α) : l = l ++ l := by
plausible
-- FIXME: the following two tests have become non-deterministic.

-- /--
-- error:
-- ===================
-- Found a counter-example!
-- f := 1
-- issue: ULift.up 1 = ULift.up 0 does not hold
-- (1 shrinks)
-- -------------------
-- -/
-- #guard_msgs in
-- theorem ulift_nat (f : ULift.{1} Nat) : f = ⟨0⟩ := by
-- plausible

-- /--
-- error:
-- ===================
-- Found a counter-example!
-- α := "ULift Int"
-- l := [0]
-- issue: [ULift.up 0] = [ULift.up 0, ULift.up 0] does not hold
-- (1 shrinks)
-- -------------------
-- -/
-- #guard_msgs in
-- theorem type_u (α : Type u) (l : List α) : l = l ++ l := by
-- plausible
2 changes: 1 addition & 1 deletion lake-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "git",
"subDir": null,
"scope": "leanprover-community",
"rev": "85f6511d93f9e6a8188ec9985c82f08f65c26cae",
"rev": "76e9ebe4176d29cb9cc89c669ab9f1ce32b33c3d",
"name": "batteries",
"manifestFile": "lake-manifest.json",
"inputRev": "main",
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"
version = "git#main"
rev = "main"
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:v4.13.0-rc3
leanprover/lean4:v4.14.0-rc1

0 comments on commit 859caad

Please sign in to comment.