2020-05-12 06:10:59 +02:00
|
|
|
# Perform the proofs under the assumption that n is a nonnegative integer input constant
|
2020-05-07 17:19:42 +02:00
|
|
|
input: n -> integer.
|
2020-05-12 06:10:59 +02:00
|
|
|
assume: n >= 0.
|
|
|
|
|
2020-05-28 07:06:19 +02:00
|
|
|
# p/1 is an auxiliary predicate
|
2020-05-12 05:27:51 +02:00
|
|
|
output: q/1.
|
2020-05-06 21:39:04 +02:00
|
|
|
|
2020-05-28 07:06:19 +02:00
|
|
|
# Verify that q computes the floor of the square root of n
|
2020-05-22 18:34:59 +02:00
|
|
|
spec: exists N (forall X (q(X) <-> X = N) and N >= 0 and N * N <= n and (N + 1) * (N + 1) > n).
|