Remove floating-point check for +/-Inf#3162
Remove floating-point check for +/-Inf#3162feliperodri wants to merge 1 commit intomodel-checking:mainfrom
Conversation
Kani included by default the flag `--float-overflow-check`, which reports overflow for arithmetic operations over floating-point numbers that result in +/-Inf. This doesn't panic in Rust and it shouldn't be consider a verification failure by default. Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
|
You might want to add |
celinval
left a comment
There was a problem hiding this comment.
I was about to ask for a test, but I see that our regression already has one, and that is failing now.
|
Here are the operations that CBMC currently creates checks for with
Looking at https://doc.rust-lang.org/std/primitive.f32.html, it seems the last two cases are well defined in Rust. For type casts, however, I don't know whether these have firmly defined behaviour? Furthermore: should we enable users to insert such checks? It might not be undefined behaviour in Rust, but it might still be undesired behaviour? |
Yes, I think we should add a switch (default off) to insert those checks. This is possible through passing |
But also please also add tests that cover that overflow scenarios behavior is correct |
Kani included by default the flag
--float-overflow-check, which reports overflow for arithmetic operations over floating-point numbers that result in +/-Inf. This doesn't panic in Rust and it shouldn't be consider a verification failure by default.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.