Skip to content
Discussion options

You must be logged in to vote

The API supports creating predicates for over-and under-flow conditions.
The SMTLIB2 is extended with the few operations that cannot be easily encoded.
They are:
"bvumul_noovfl"
"bvsmul_noovfl"
"bvumul_noudfl"
they take two arguments.
The semantics is described in the header file for z3_api.h (also in auto-generated documentation).

To specifically address carry bits: for addition you can just 0-extend bit-vector arguments by one. Then check that the most significant bit in the output is 0. SMTLIB2 syntax lets you do all of this and you can also declare functions to perform this using SMTLIB2 if that works better for you.
If you need guidance on implementing the under/overflow conditions u…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fabriceleal
Comment options

@nunoplopes
Comment options

Answer selected by NikolajBjorner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #5137 on March 29, 2021 16:20.