Unintuitive precondition for absence of overflow #1500
jschneider-bensch
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The below precondition leads to a type error in F*, since
a + b
is translated to(a +! b <: usize)
in the precondition, which could also overflow.Interestingly the alternative formulation using subtraction does not lead to an error, so is
-!
saturating? Is there a way to write this as a sum without using F* directly?Open this code snippet in the playground
Beta Was this translation helpful? Give feedback.
All reactions