Conversation
tautschnig
left a comment
There was a problem hiding this comment.
Looks good to me. (With the minor concern, which is just triggered by the commit, that this code does similar stuff as expr2ct while not actually sharing code.)
src/util/xml_expr.cpp
Outdated
There was a problem hiding this comment.
I would have put the id2string(...) on a new line.
9e6fb6c to
a815869
Compare
src/util/xml_expr.cpp
Outdated
There was a problem hiding this comment.
It is very confusing that an integer can be "FALSE" or "TRUE". Either there has to be a different result.name, or the value has to be 0/1.
There was a problem hiding this comment.
Currently, we have non-1 solutions for "true" in the counterexample, which comes from the fact that we are looking for a non-0 solution when translating the conditional:
// 26 file cover_line_input_boolean.c line 4 function foo
IF !(par != FALSE && a == 1) THEN GOTO 1
However, C99, at least, demands that the values of _Bool are 0 and 1 only. We can output the actual integer value provided that we force "true" to be 1 elsewhere...
This is failing:
void main()
{
int x;
_Bool y;
if(y)
{
x=(int)y;
assert(x==1);
}
}
There was a problem hiding this comment.
Note that the above has undefined behaviour, i.e., it's good that this fails!
If you do y=nondet_bool(), with _Bool nondet_bool(), you get the expected result.
There was a problem hiding this comment.
We have to explicitly initialise all parameters passed to the entry function otherwise the following would still fail:
void foo(_Bool y)
{
int x;
if(y)
{
x=(int)y;
assert(x==1);
}
}
src/util/xml_expr.cpp
Outdated
There was a problem hiding this comment.
The "binary" should be 0/1; the above yields true/false.
There was a problem hiding this comment.
The binary is at least a byte...
There was a problem hiding this comment.
Indeed; will merge once value inconsistency is fixed.
fae71be to
ace620d
Compare
|
@kroening, @tautschnig, updated. |
src/util/json_expr.cpp
Outdated
There was a problem hiding this comment.
The assertion is not guaranteed to hold; e.g., you can wreck this with a union, an uninitialised _Bool, or with a pointer typecast.
src/ansi-c/ansi_c_entry_point.cpp
Outdated
There was a problem hiding this comment.
Use side_effect_expr_nondett(bool_typet()) instead.
d0cdfbd to
aaa5348
Compare
…_traiting_of_models_lib_and_standard_lib Python driver improved traiting of models lib and Java standard lib
No description provided.