Mingyue Jiang said:
> The reason for this is that b+100 results in an overflow and its value is
> truncated.
I create STP expressions for integer arithmetic expressions and I use
bit vectors to represent the integers, so I run into this problem,
too.
I solve it by collecting additional assertions that will need to be
met, while I'm constructing the expression. So, if I'm constructing
"x+y", I need to also assert that "x+y >= x" (or "x+y >= y", either
will do). I have similar assertions for: underflow of subtraction ("x
>= x-y"), overflow of multiplication ("y == 0 || x*y >= x"), overflow
of base 2 exponentiation ("x == 0 || 2^x >= x").
Jonas Wagner said:
> Finally, you have the option of using mathematical integers instead of bitvectors.
No. I don't use integers because some of the operations that I need
were not available for integers. Instead, I use bit vectors, for
which I can represent all the operators that I need. I implemented
this a while ago, so I don't recall which operators weren't available;
but the set of operations that I represent are: addition, subtraction,
multiplication, base-2 exponentiation, max, min, divison (returning
the integer ceiling), base-2 log (returning the integer ceiling).
J