-
Notifications
You must be signed in to change notification settings - Fork 273
SMT2 support for unbounded integers #1779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
698ccdd
12ae728
57ecf15
dea2592
a827c77
1ebec11
897e29e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
add_test_pl_tests( | ||
"$<TARGET_FILE:cbmc>" | ||
"$<TARGET_FILE:cbmc>" -X smt-backend | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
int main() | ||
{ | ||
__CPROVER_integer a, b; | ||
a=0; | ||
b=a; | ||
b++; | ||
b*=100; | ||
__CPROVER_assert(0, ""); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CORE smt-backend | ||
main.c | ||
--trace --smt2 | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^ b=100 | ||
-- |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,12 @@ std::string trace_value_binary( | |
{ | ||
return expr.is_true()?"1":"0"; | ||
} | ||
else if(type.id()==ID_integer) | ||
{ | ||
mp_integer i; | ||
if(!to_integer(expr, i) && i>=0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is it necessary that the result is non-negative? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise it prints a negative binary number, which is at least unusual. Conversion to two's complement (as done for signed int) isn't obvious, as there is no width. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok. |
||
return integer2string(i, 2); | ||
} | ||
} | ||
else if(expr.id()==ID_array) | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a test that tests the property that distinguishes integers from bitvectors: