-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Debug/CBMC: Interpret debug-assertions as proof obligations
Previously, runtime assertions via debug_assert_xxx and CBMC assertions via cassert(...) were separate. This commit modifies the implementation of the debug assertion macros so that when CBMC is used, debug assertions are intepreted as proof obligations. This removes some redundancy and non-uniformity in the code, and also reduces the likelihood that debug assertions and CBMC contracts get out of sync. In some case, this actually happened, and the commit fixes this. The commit also adds further bounds assertions in alignment with pre/post conditions. A slight nuisance is that the debug assertions cannot flatten nested structures like polyvec for the bounds check, running into issue diffblue/cbmc#8570. We work around this by introducing a new `xxx_2d` (for 2-dimensional) macro which takes two dimensions and uses a two-step array access, circumventing the above CBMC issue. Signed-off-by: Hanno Becker <[email protected]>
- Loading branch information
1 parent
ab9d84d
commit 79757a2
Showing
12 changed files
with
161 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.