From: Christoph Fuerst Date: Wed, 19 Apr 2017 19:24:41 +0000 (+0200) Subject: Update after Review Wolfgang X-Git-Url: http://git.risc.jku.at/gitweb/?a=commitdiff_plain;h=d876a66b15b4cc82e51bc58fe808565c20428fd4;p=cfuerst%2Fformal-numbers.git Update after Review Wolfgang --- diff --git a/discrete_log.txt b/discrete_log.txt index 2db452e..b66aa0c 100644 --- a/discrete_log.txt +++ b/discrete_log.txt @@ -9,11 +9,11 @@ type prime = ℕ[K]; type res = ℕ[L]; pred divides(m:prime,n:prime) ⇔ ∃p:prime. m⋅p = n; -pred isPrime(m:prime) ⇔ ∀n:prime. divides(n,m) ⇒ (n ≤ 1 ∨ n = m); +pred isPrime(m:prime) ⇔ m > 1 ∧ ∀n:prime. n>1 ∧ divides(n,m) ⇒ (n = m); pred isComposite(m:prime) ⇔ ¬isPrime(m); proc InvModP(a:ℕ[K^2],p:prime): prime - requires p>1 ∧ isPrime(p) ∧ + requires isPrime(p) ∧ 0 < a ∧ a < p; ensures (a*result) % p = 1; { @@ -21,6 +21,7 @@ proc InvModP(a:ℕ[K^2],p:prime): prime var i:prime; for i=1;i