-
Notifications
You must be signed in to change notification settings - Fork 273
What is a safe overapproximation of an OTHER instruction #4323
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
Comments
Thanks a lot for bringing this up. I am wondering whether at some point we should just remove this? Of course |
At the moment I am deeply skeptical that all of the uses of
|
I'd get rid of |
#2548 suggests that we rely on having over approximations for OTHER but I have no idea if they are sound or not. |
To the best of my knowledge, what an OTHER instruction does is not well documented. goto-programs/goto_program.h:132 says:
"Execute the
code
(an instance of codet of kind ID_fence, ID_printf, ID_array_copy, ID_array_set, ID_input, ID_output, ...)."goto-symex/symex_other.cpp:77 seems to have one of the most comprehensive lists of possibilities including
ID_output
(so it can manipulate the external environment),ID_decl
(marked as UNREACHABLE -- no idea what this once was supposed to do),ID_nondet
("like skip"), ID_asm ("we ignore this for now"),ID_array_{copy,replace,set,equal}
,ID_user_specified_{predicate,parameter_predicates,return_predicates}
(???). Elsewhere there are references toID_skip
(???),ID_printf
(not clear why this is different to ID_output),ID_havoc_object
,{set,clear}_{may,must}
,ID_expression
and various fences.Possibly relevant to #3191 maybe we should have an actual explicit list of what it could be?
To get the abstract domains to handle OTHER correctly it would be good to be clear exactly what we can assume about them.
*. It seems likely that they "read" from any variable they include ( analyses/goto_rw.cpp:784 seems to think so ).
*. In some cases they can "write" to some of the variables they include. This does not seem well supported in the various abstract domains.
*. Some instructions can modify the external state of the program so they have to be considered for anything concurrent.
*. I have yet to see that they change the flow of control, although frankly,
ID_asm
makes me nervous.*. I am unsure as to whether they can affect termination or run-time. Are the CPROVER model of fences guaranteed to return? Is ID_output blocking?
Thoughts, opinions, pointers to specific behaviours in the code, historical reminiscences, suggestions, etc. all most welcome.
The text was updated successfully, but these errors were encountered: