-
Notifications
You must be signed in to change notification settings - Fork 274
JBMC: enable model and SSA equation verification #3747
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
249fb3f
eda5f14
c203ef2
738fbde
555ff9a
03277d6
5867785
0f1abe1
d53bf4b
b2fe035
4232b15
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:jbmc>" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
add_test_pl_tests( | ||
"$<TARGET_FILE:jbmc>" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation" | ||
) | ||
|
||
add_test_pl_profile( | ||
"jbmc-generics-symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation --symex-driven-lazy-loading" | ||
"-C;-X;symex-driven-lazy-loading-expected-failure;-s;symex-driven-loading" | ||
"CORE" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
add_test_pl_tests( | ||
"$<TARGET_FILE:jbmc>" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
add_test_pl_tests( | ||
"$<TARGET_FILE:jbmc>" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation" | ||
) | ||
|
||
add_test_pl_profile( | ||
"jbmc-strings-symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation --symex-driven-lazy-loading" | ||
"-C;-X;symex-driven-lazy-loading-expected-failure;-s;symex-driven-loading" | ||
"CORE" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
add_test_pl_tests( | ||
"$<TARGET_FILE:jbmc>" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation" | ||
) | ||
|
||
add_test_pl_profile( | ||
"jbmc-symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation --symex-driven-lazy-loading" | ||
"-C;-X;symex-driven-lazy-loading-expected-failure;-s;symex-driven-loading" | ||
"CORE" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
add_test_pl_tests( | ||
"$<TARGET_FILE:jbmc>" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation" | ||
) | ||
|
||
add_test_pl_profile( | ||
"strings-smoke-tests-symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --symex-driven-lazy-loading" | ||
"$<TARGET_FILE:jbmc> --validate-goto-model --validate-ssa-equation --symex-driven-lazy-loading" | ||
"-C;-X;symex-driven-lazy-loading-expected-failure;-s;symex-driven-loading" | ||
"CORE" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,10 @@ Author: Daniel Kroening, [email protected] | |
#ifndef CPROVER_JBMC_JBMC_PARSE_OPTIONS_H | ||
#define CPROVER_JBMC_JBMC_PARSE_OPTIONS_H | ||
|
||
#include <util/ui_message.h> | ||
#include <util/parse_options.h> | ||
#include <util/timestamper.h> | ||
#include <util/ui_message.h> | ||
#include <util/validation_interface.h> | ||
|
||
#include <langapi/language.h> | ||
|
||
|
@@ -80,6 +81,7 @@ class optionst; | |
"(localize-faults)(localize-faults-method):" \ | ||
"(java-threading)" \ | ||
OPT_GOTO_TRACE \ | ||
OPT_VALIDATE \ | ||
"(symex-driven-lazy-loading)" | ||
// clang-format on | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -296,14 +296,14 @@ class code_assignt:public codet | |
|
||
static void validate( | ||
const codet &code, | ||
const namespacet &, | ||
const namespacet &ns, | ||
const validation_modet vm = validation_modet::INVARIANT) | ||
{ | ||
check(code, vm); | ||
|
||
DATA_CHECK( | ||
vm, | ||
code.op0().type() == code.op1().type(), | ||
base_type_eq(code.op0().type(), code.op1().type(), ns), | ||
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. To be debated with @kroening as this appears to work against the effort going on in other PRs. 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. Fair enough if we want the strict same-level-of-indirection condition in the future, but we certainly don't even try to do that at present. 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. Can this commit be dropped from the PR? I understand that this would mean it doesn't work for Java at the moment, but then we can get all the other improvements in the meantime. 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. Well, my intent was to use this as the means of testing the other improvements, by showing particular programs begin to satisfy this constraint when the fixes are applied, so I'd much prefer to have this statement of our current intended guarantee available, then we can chase after a future attempted standard later? |
||
"lhs and rhs of assignment must have same type"); | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,10 +137,11 @@ bool symbolt::is_well_formed() const | |
// Well-formedness criterion number 2 is for a symbol | ||
// to have it's base name as a suffix to it's more | ||
// general name. | ||
if(!has_suffix(id2string(name), id2string(base_name))) | ||
{ | ||
// Exception: Java symbols' base names do not have type signatures | ||
// (for example, they can have name "someclass.method:(II)V" and base name | ||
// "method") | ||
if(!has_suffix(id2string(name), id2string(base_name)) && mode != ID_java) | ||
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. Can we check that 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. It also differs for field symbols, and generics, and... I'd like to leave (a) setting a convention and (b) enforcing it for a different PR! |
||
return false; | ||
} | ||
|
||
return true; | ||
} | ||
|
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.
We should really remove the single-argument constructor.
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.
In another PR, sure
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.
Sure, that was not meant as a request for work.