Repository navigation
SMT2 back-end: only values under `as const' for cvc5 - #9419
tautschnig wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
dc5db82 to
503d670
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9419 +/- ##
========================================
Coverage 81.02% 81.03%
========================================
Files 1723 1723
Lines 191314 191379 +65
Branches 73 73
========================================
+ Hits 155020 155080 +60
- Misses 36294 36299 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This PR makes cvc5 lose counterexamples for arrays initialised with null pointers. The cause is that Cause. Consequence. cvc5 1.3.4 cannot build a model for that axiom unless int main()
{
void *p[4];
__CPROVER_array_set(p, (void *)0);
unsigned i;
__CPROVER_assume(i < 4);
__CPROVER_assert(p[i] != 0, "fails");
return 0;
}
This matters in practice because the DFCC contracts library zero-initialises its object sets with Fix. Admit pointer constants and correct the comment: - // a literal converts to a value; a pointer constant (an object/offset
- // encoding) or a compound term does not
+ // a literal (including a pointer constant, which convert_constant prints
+ // as a bit-vector literal) converts to a value; a compound term (e.g., an
+ // address_of or a typecast) does not
return what.is_constant() &&
(what.type().id() == ID_bool || what.type().id() == ID_signedbv ||
what.type().id() == ID_unsignedbv || what.type().id() == ID_bv ||
what.type().id() == ID_c_bool || what.type().id() == ID_c_enum_tag ||
- what.type().id() == ID_floatbv);
+ what.type().id() == ID_floatbv || what.type().id() == ID_pointer);I checked this change on top of 503d670:
It would be good to add the reproducer above as a regression test ( Related limitation, not a regression. A non-literal |
cvc5 accepts `((as const (Array I E)) v)' only when v is a value
("invalid argument ... for 'val', expected a value"); z3 accepts any
term. Two places wrote a term there:
- unflatten, turning a bit-vector (e.g. a union member such as the
local buffer of std::string) back into an array, used the array's
element 0 -- an extract of a term -- as the default. For a solver
that requires a value (as_const_requires_value, set for cvc5) the
base array is now all-zero (convert_zero_value builds the value in
the sort unflatten produces) and every element 0..N-1 is stored.
- array_of with a non-literal element; it now takes the quantified
initialisation used without `as const' (as_const_admits).
Test: regression/cbmc/smt2_cvc5_as_const_value (cbmc --cvc5 reported a
parse error; it now verifies, and a wrong assertion fails).
With the FPA theory, the zero value of a float element is a
floating-point zero, (_ +zero e s), as floats then have a
floating-point sort.
Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
503d670 to
c0f846d
Compare
cvc5 accepts `((as const (Array I E)) v)' only when v is a value ("invalid argument ... for 'val', expected a value"); z3 accepts any term. Two places wrote a term there:
Test: regression/cbmc/smt2_cvc5_as_const_value (cbmc --cvc5 reported a parse error; it now verifies, and a wrong assertion fails).