Skip to content

Commit fe82430

Browse files
committed
polish
1 parent 71dc233 commit fe82430

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

CaseStudies/Velvet/VelvetExamples/Demo/IsNonPrime.lean

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff 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]
4344
def 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+
132136
prove_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)

0 commit comments

Comments
 (0)