anthem-rs/examples/example-2.spec

10 lines
328 B
RPMSpec
Raw Normal View History

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
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
spec: exists N (forall X (q(X) <-> X = N) and N >= 0 and N * N <= n and (N + 1) * (N + 1) > n).