We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b88541 commit 02dbec9Copy full SHA for 02dbec9
CaseStudies/Velvet/VelvetExamples/Demo/InsertionSort.lean
@@ -33,6 +33,24 @@ prove_correct sqrt by
33
34
-- #eval sqrt 10 |>.extract
35
36
+set_option loom.solver "grind"
37
+
38
+variable [FinEnum α]
39
40
+method Set.toArray (mut s: α -> Bool) return (res: Array α)
41
+ ensures forall x, s x <-> x ∈ res
42
+ do
43
+ let mut res := #[]
44
+ while_some x :| s x
45
+ invariant forall x, sOld x <-> (x ∈ res ∨ s x)
46
+ done_with ∀ x, s x = false
47
48
+ res := res.push x
49
+ return res
50
51
+prove_correct Set.toArray by
52
+ loom_solve
53
54
end squareRoot
55
56
-- (2) Insertion sort
0 commit comments