def is_prime
import bend-collections-laws-math@1.0.0.0/src/math/number.bend as Numberimport Base
76def is_prime(+n: Nat) -> Bool:
77 match n:
78 case 0n:
79 False{}
80 case 1n:
81 False{}
82 case 2n+ +p:
83 prime_go(2n+p, 2n+p, 2n, Nat.is_lt(2n+p, 4n), Nat.is_eq(Nat.mod(2n+p, 2n), 0n))
Uses (6)
Used by (10)
- bend-collections-laws-math@1.0.0.0/src/math/fixed:u32_next_prime
- bend-collections-laws-math@1.0.0.0/proofs/math/number/prime:is_prime_value
- bend-collections-laws-math@1.0.0.0/src/math/fixed:u32_np
- bend-collections-laws-math@1.0.0.0/proofs/math/number/fixprime:prime_of
- bend-collections-laws-math@1.0.0.0/spec/math/number:IsPrime.value
- …