File tree Expand file tree Collapse file tree 5 files changed +5
-20
lines changed
Expand file tree Collapse file tree 5 files changed +5
-20
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Henrik Böving, Simon Hudon
55-/
66import Plausible.Random
7- import Batteries.Data.List.Perm
87
98/-!
109# `Gen` Monad
@@ -106,7 +105,7 @@ def permutationOf : (xs : List α) → Gen { ys // xs ~ ys }
106105 | x::xs => do
107106 let ⟨ys, h1⟩ ← permutationOf xs
108107 let ⟨n, _, h3⟩ ← up <| choose Nat 0 ys.length (by omega)
109- return ⟨insertIdx n x ys , Perm.trans (Perm.cons _ h1) (List.perm_insertIdx _ _ h3).symm⟩
108+ return ⟨ys. insertIdx n x, Perm.trans (Perm.cons _ h1) (List.perm_insertIdx _ _ h3).symm⟩
110109
111110/-- Given two generators produces a tuple consisting out of the result of both -/
112111def prodOf {α : Type u} {β : Type v} (x : Gen α) (y : Gen β) : Gen (α × β) := do
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44Authors: Henrik Böving, Simon Hudon
55-/
66import Lean.Elab.Command
7+ import Lean.Meta.Eval
78import Plausible.Gen
89
910/-!
@@ -214,7 +215,7 @@ open Shrinkable
214215instance List.shrinkable [Shrinkable α] : Shrinkable (List α) where
215216 shrink := fun L =>
216217 (L.mapIdx fun i _ => L.eraseIdx i) ++
217- (L.mapIdx fun i a => (shrink a).map fun a' => L.modify ( fun _ => a') i ).flatten
218+ (L.mapIdx fun i a => (shrink a).map fun a' => L.modify i fun _ => a').flatten
218219
219220instance ULift.shrinkable [Shrinkable α] : Shrinkable (ULift α) where
220221 shrink u := (shrink u.down).map ULift.up
Original file line number Diff line number Diff line change 11{"version" : " 1.1.0" ,
22 "packagesDir" : " .lake/packages" ,
3- "packages" :
4- [{"url" : " https://github.com/leanprover-community/batteries" ,
5- "type" : " git" ,
6- "subDir" : null ,
7- "scope" : " leanprover-community" ,
8- "rev" : " 092b30de8e7ee78e96b24c235d99e26f2942d77e" ,
9- "name" : " batteries" ,
10- "manifestFile" : " lake-manifest.json" ,
11- "inputRev" : " v4.18.0-rc1" ,
12- "inherited" : false ,
13- "configFile" : " lakefile.toml" }],
3+ "packages" : [],
144 "name" : " plausible" ,
155 "lakeDir" : " .lake" }
Original file line number Diff line number Diff line change @@ -8,8 +8,3 @@ name = "Test"
88
99[[lean_lib ]]
1010name = " Plausible"
11-
12- [[require ]]
13- name = " batteries"
14- scope = " leanprover-community"
15- rev = " v4.18.0-rc1"
Original file line number Diff line number Diff line change 1- leanprover/lean4:v4.18.0
1+ leanprover/lean4:v4.19.0-rc1
You can’t perform that action at this time.
0 commit comments