-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Interval Analysis for Floating-point values #734
Comments
Nice, it's about time Goblint gets support for floating point numbers! |
I suppose the current goal is to add this to our base analysis's I'm just wondering, because the other angle to floating-point would be to do it in the apron analysis, since the Apron library also supports floating-point arithmetic (but we currently only use integer portions of it). |
Yes! I also plan to play around with Apron's float support a bit. However, that seemed a bit involved for a practical course, and I am a bit unclear on how one would soundly handle rounding here. Also, I think having some (cheap) float support in the base analysis is crucial, as we quite often don't enable Apron for performance reasons! |
Indeed, having something simple which isn't Apron-based would be useful too. |
The question is if there is a rounding mode that is always sound or whether we have to analyze which C rounding mode is currently set which is annoying. In the thing that we'll be implementing, we are avoiding that by always rounding in the "worse" direction. |
Closed in #761 |
CHANGES: Goblint "lean" release after a lot of cleanup. * Remove unmaintained analyses: OSEK, ARINC, shapes, containment, deadlocksByRaces (goblint/analyzer#460, goblint/analyzer#736, goblint/analyzer#812, goblint/analyzer#474). * Add interactive analysis (goblint/analyzer#391). * Add server mode (goblint/analyzer#522). * Add Compilation Database support (goblint/analyzer#406, goblint/analyzer#448). * Add floating point domain, unrolled array domain and improved struct domains (goblint/analyzer#734, goblint/analyzer#761, goblint/analyzer#577, goblint/analyzer#419). * Add static loop unrolling and heap variable unrolling (goblint/analyzer#563, goblint/analyzer#722). * Improve race detection with may-happen-in-parallel analysis (goblint/analyzer#529, goblint/analyzer#518, goblint/analyzer#595). * Reimplement lockset and deadlock analyses (goblint/analyzer#659, goblint/analyzer#662, goblint/analyzer#650, goblint/analyzer#655). * Add pthread extraction to Promela (goblint/analyzer#220). * Add location spans to output (goblint/analyzer#428, goblint/analyzer#449). * Improve race reporting (goblint/analyzer#550, goblint/analyzer#551). * Improve dead code reporting (goblint/analyzer#94, goblint/analyzer#353, goblint/analyzer#785). * Refactor warnings (goblint/analyzer#55, goblint/analyzer#783). * Add JSON schema for configuration (goblint/analyzer#476, goblint/analyzer#499). * Refactor option names (goblint/analyzer#28, goblint/analyzer#192, goblint/analyzer#516, goblint/analyzer#675). * Add bash completion (goblint/analyzer#669). * Add OCaml 4.13 and 4.14 support, remove OCaml 4.09 support (goblint/analyzer#503, goblint/analyzer#672).
CHANGES: Goblint "lean" release after a lot of cleanup. * Remove unmaintained analyses: OSEK, ARINC, shapes, containment, deadlocksByRaces (goblint/analyzer#460, goblint/analyzer#736, goblint/analyzer#812, goblint/analyzer#474). * Add interactive analysis (goblint/analyzer#391). * Add server mode (goblint/analyzer#522). * Add Compilation Database support (goblint/analyzer#406, goblint/analyzer#448). * Add floating point domain, unrolled array domain and improved struct domains (goblint/analyzer#734, goblint/analyzer#761, goblint/analyzer#577, goblint/analyzer#419). * Add static loop unrolling and heap variable unrolling (goblint/analyzer#563, goblint/analyzer#722). * Improve race detection with may-happen-in-parallel analysis (goblint/analyzer#529, goblint/analyzer#518, goblint/analyzer#595). * Reimplement lockset and deadlock analyses (goblint/analyzer#659, goblint/analyzer#662, goblint/analyzer#650, goblint/analyzer#655). * Add pthread extraction to Promela (goblint/analyzer#220). * Add location spans to output (goblint/analyzer#428, goblint/analyzer#449). * Improve race reporting (goblint/analyzer#550, goblint/analyzer#551). * Improve dead code reporting (goblint/analyzer#94, goblint/analyzer#353, goblint/analyzer#785). * Refactor warnings (goblint/analyzer#55, goblint/analyzer#783). * Add JSON schema for configuration (goblint/analyzer#476, goblint/analyzer#499). * Refactor option names (goblint/analyzer#28, goblint/analyzer#192, goblint/analyzer#516, goblint/analyzer#675). * Add bash completion (goblint/analyzer#669). * Add OCaml 4.13 and 4.14 support, remove OCaml 4.09 support (goblint/analyzer#503, goblint/analyzer#672).
Issue
Current Situation
Currently, Goblint is unable to analyze
double
values (and for that matter,float
values as well - but we will focus ondouble
for now).Motivation
Goal
We aim to implement an interval analysis for
double
values. Therefore, we heavily rely on [1]. As is written there, roundingsand underflows are tolerated, but not overflows, divisions by zero or invalid operations. For these, we want goblint
to generate a warning or an error.
In a first approach, in order to be able to tackle the four different rounding modes and arbitrary precision of
intermediate results, we will implement a worst-case analysis as proposed in [1]. In other words, we won't care about
the given rounding mode and instead work conservatively with the intervals. Like this, we won't necessarily be able to
say that a program is correct, but we will be able to say if might be incorrect.
With this information we aim to provide checking of assertions and dead-branches and warnings for potential usages of invalid
double
values - namely NaN, +/- infinity.Example
[1]: https://www-apr.lip6.fr/~mine/publi/article-mine-esop04.pdf
WIP here
The text was updated successfully, but these errors were encountered: