-
Notifications
You must be signed in to change notification settings - Fork 277
Fixes for is_threadedt, --is-threaded #1853
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
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,6 +1,11 @@ | ||
|
||
int x; | ||
|
||
void func3() | ||
{ | ||
x = 6; | ||
} | ||
|
||
void func2() | ||
{ | ||
x = 3; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,10 +33,8 @@ class is_threaded_domaint:public ai_domain_baset | |
locationt from, | ||
locationt to) | ||
{ | ||
// assert(src.reachable); | ||
|
||
if(!src.reachable) | ||
return false; | ||
INVARIANT(src.reachable, | ||
"Abstract states are only merged at reachable locations"); | ||
|
||
bool old_reachable=reachable; | ||
bool old_is_threaded=is_threaded; | ||
|
@@ -52,10 +50,8 @@ class is_threaded_domaint:public ai_domain_baset | |
transform(locationt from, locationt to, ai_baset &ai, const namespacet &ns) | ||
final override | ||
{ | ||
// assert(reachable); | ||
|
||
if(!reachable) | ||
return; | ||
INVARIANT(reachable, | ||
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. Ditto about |
||
"Transformers are only applied at reachable locations"); | ||
|
||
if(from->is_start_thread()) | ||
is_threaded=true; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -257,6 +257,8 @@ int goto_instrument_parse_optionst::doit() | |
<< "\n\n"; | ||
} | ||
} | ||
|
||
return CPROVER_EXIT_SUCCESS; | ||
} | ||
|
||
if(cmdline.isset("show-value-sets")) | ||
|
@@ -1493,6 +1495,8 @@ void goto_instrument_parse_optionst::help() | |
// NOLINTNEXTLINE(whitespace/line_length) | ||
" --reachable-call-graph show graph of function calls potentially reachable from main function\n" | ||
" --class-hierarchy show class hierarchy\n" | ||
// NOLINTNEXTLINE(whitespace/line_length) | ||
" --show-threaded show instructions that may be executed by more than one thread\n" | ||
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. This is just documented and undocumented option, right? 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. Yes, it's only documenting a previously undocumented option. |
||
"\n" | ||
"Safety checks:\n" | ||
" --no-assertions ignore user assertions\n" | ||
|
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.
Probably
PRECONDITION
here expresses the intent clearer.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.
@thk123 I'm unsure... my belief is that this is enforced by a property of the AI engine; it's really an invariant of that. Hmmm... maybe it is a precondition...
Uh oh!
There was an error while loading. Please reload this page.
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.
It's both a precondition of the method and a property of the AI engine, thus I used the more general
INVARIANT
. However, thinking about it now, maybePRECONDITION
does indeed suit better, and the fact that the AI engine does not applytransform()
to bottom should be checked by an invariant inait
instead.