File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
CaseStudies/Velvet/VelvetExamples/Demo Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ def countDivisors (n: Nat) : Nat :=
4040-- A number is prime if and only if:
4141-- 1. It is greater than 1
4242-- 2. It has exactly 2 positive divisors (1 and itself)
43+ @[grind]
4344def isPrime (n: Nat) : Prop :=
4445 n > 1 ∧ countDivisors n = 2
4546
@@ -65,7 +66,7 @@ method IsNonPrime (n: Nat)
6566-- Program verification
6667------------------------------------------------
6768
68- theorem goal2
69+ theorem goal
6970(n : ℕ)
7071(i : ℕ)
7172(ret : Bool)
@@ -129,7 +130,9 @@ theorem goal2
129130-- Putting it all together
130131----------------------------------------------------------------
131132
133+ -- macro_rules
134+ -- | `(tactic|loom_solver) => `(tactic|skip)
135+
132136prove_correct IsNonPrime by
133- loom_solve <;> try simp_all
134- · { rw [isPrime]; aesop }
135- · apply (goal2 n i ret i_1 ret_1 if_neg invariant_1 invariant_2 invariant_3 done_1 i_2)
137+ loom_solve; try simp_all
138+ apply (goal n i ret i_1 ret_1 if_neg invariant_1 invariant_2 invariant_3 done_1 i_2)
You can’t perform that action at this time.
0 commit comments