solidity/test/libsolidity/smtCheckerTests/operators
Martin Blicha 12bca24774 [SMTChecker] Use path condition when creating CHC targets
Without path condition, verification targets created inside ternary
operator ignore the condition of the operator inside the branches.
This led to false positives.

Further updates:

- Function calls should consider the conditions under which they are
called, otherwise the analysis may report false positives.
The fix proposed here is to add the current path condition to the edge
that propagates error from a function call.

- Increment error index after function call

This is necessary for the analysis of the ternary operator to work
correctly. No information should leak from a function call inside a
ternary operator in the first branch to the second branch, including
whether or not an error would have occured in the first branch.

However, for the execution that continues after the function call,
we still need to ensure that under the current path condition
the error has not occurred in that function call.

It would be better to isolate the analysis of the branches to separate
clauses, but I do not see an easy way for that now. In this way, even
though the function call in first branch is included in the clause of
the second branch, no information leaks.

- Additonal test for ternary operator

This tests the behaviour of SMTChecker on ternary operator with function
calls inside both branches. Specifically, it tests that SMTChecker
successfully detects a violation of a verification target in the second
branch when the same target is present also in the first branch, but
there it cannot be triggered because of the operator's condition.
2023-04-21 18:56:34 +02:00
..
shifts Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
userDefined Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
assignment_chain_tuple_contract_1.sol Fix internal error in assignment chains that also assign to fully qualified state variables (, for example), where the contract expression is a tuble. 2022-11-28 18:45:50 +01:00
assignment_chain_tuple_contract_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
assignment_chain_tuple_contract_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
assignment_contract_member_variable_array_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
assignment_contract_member_variable_array_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
assignment_contract_member_variable_array.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
assignment_contract_member_variable.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
assignment_module_contract_member_variable.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_and_fixed_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_and_int.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_and_rational.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_and_uint.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_combo.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_not_fixed_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_not_int.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_not_uint.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_operators_do_not_throw_exceptions.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_or_fixed_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_or_int.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_or_uint.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_rational_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_rational_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_xor_fixed_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_xor_int.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bitwise_xor_uint.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
bytes_new.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_add_array_index.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_add_chain.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_add_mapping.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_add.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_assignment_division_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_assignment_division_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_assignment_division_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_assignment_right_shift.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_and_fixed_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_and_int.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_and_uint.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_or_fixed_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_or_int_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_or_int.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_or_uint_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_or_uint_2.sol update smt tests z3 4.8.16 2022-05-03 14:23:27 +02:00
compound_bitwise_or_uint_3.sol Update old tests 2021-04-08 21:03:39 +02:00
compound_bitwise_or_uint.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_string_literal_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_string_literal_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_string_literal.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_xor_fixed_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_xor_int.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_bitwise_xor_uint.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_mul_array_index.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_mul_mapping.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_mul.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_shl_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_shr_1.sol Update old tests 2021-04-08 21:03:39 +02:00
compound_sub_array_index.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_sub_mapping.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
compound_sub.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
conditional_assignment_1.sol Update old tests 2021-04-08 21:03:39 +02:00
conditional_assignment_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
conditional_assignment_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
conditional_assignment_4.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
conditional_assignment_5.sol update smtchecker tests 2021-11-24 20:41:22 +01:00
conditional_assignment_6.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
conditional_assignment_always_false.sol Update old tests 2021-04-08 21:03:39 +02:00
conditional_assignment_always_true.sol Update old tests 2021-04-08 21:03:39 +02:00
conditional_assignment_function_1.sol Update old tests 2021-04-08 21:03:39 +02:00
conditional_assignment_function_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
conditional_assignment_nested_always_true.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
conditional_assignment_nested_unsafe.sol Update old tests 2021-04-08 21:03:39 +02:00
conditional_assignment_statevar_1.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
const_exp_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
constant_propagation_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
constant_propagation_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_array_2d.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_array_index_2d.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_array_index.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_array_push.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_array.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_function_type_1.sol Fix internal error when deleting struct member of function type 2022-11-30 12:47:32 +01:00
delete_function_type_2.sol Fix internal error when deleting struct member of function type 2022-11-30 12:47:32 +01:00
delete_function_type_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_function.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_multid_array.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_struct.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
delete_tuple.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
div_zero.sol Update old tests 2021-04-08 21:03:39 +02:00
division_1.sol Update old tests 2021-04-08 21:03:39 +02:00
division_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_4.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_5.sol Update old tests 2021-04-08 21:03:39 +02:00
division_6.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_7.sol Trivial isoltest updates: missing // ---- at the end 2021-04-20 17:38:29 +02:00
division_truncates_correctly_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_truncates_correctly_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_truncates_correctly_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_truncates_correctly_4.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
division_truncates_correctly_5.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
exp.sol Update SMTChecker tests 2021-08-27 16:25:09 +02:00
fixed_point_add.sol Update old tests 2021-04-08 21:03:39 +02:00
fixed_point_compound_add.sol Update old tests 2021-04-08 21:03:39 +02:00
function_call_named_arguments.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
index_access_for_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
index_access_for_bytesNN.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
index_access_for_string.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
index_access_side_effect.sol update smtchecker tests 2023-03-28 18:23:54 +02:00
integer_new.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
mod_even.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
mod_n_uint16.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
mod_n.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
mod_signed.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
mod.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
named_arguments_in_any_order.sol Update old tests 2021-04-08 21:03:39 +02:00
named_arguments_overload_in_any_order.sol Update old tests 2021-04-08 21:03:39 +02:00
slice_bytes.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
slice_default_end.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
slice_default_start.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
slice.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
slices_1.sol Update old tests 2021-04-08 21:03:39 +02:00
slices_2.sol Trivial isoltest updates: missing // ---- at the end 2021-04-20 17:38:29 +02:00
slices_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
ternary_operator_1.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_2.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_3.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_double_function_call.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_external_code_1.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_nested_1.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_nested_2.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_nested_3.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
ternary_operator_nested_4.sol [SMTChecker] Use path condition when creating CHC targets 2023-04-21 18:56:34 +02:00
tuple_rationals_conditional.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_add_array_push_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_add_array_push_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_add_array.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_add_mapping.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_add_minus_overflow_detected.sol Update old tests 2021-04-08 21:03:39 +02:00
unary_add_overflows_correctly_struct.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_add_overflows_correctly.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_add.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_operators_tuple_1.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_operators_tuple_2.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_operators_tuple_3.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_sub_array.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_sub_mapping.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00
unary_sub.sol Report safe properties in BMC and CHC 2023-03-09 14:59:32 +01:00