Repository navigation
DFCC: unwind the inclusion check of an assigns clause to its size - #9577
Open
tautschnig wants to merge 1 commit into
Open
tautschnig wants to merge 1 commit into
tautschnig wants to merge 1 commit into
Conversation
DFCC unwinds the loops of its library that run over a write set as far as the largest assigns clause, but not the one of __CPROVER_contracts_write_set_check_assigns_clause_inclusion, which checks that an assigns clause is included in the write set of the code around it: a loop's (of a loop in a function that a loop calls), or a contract's that replaces a call. --unwind then bounded it, and with fewer unwindings than the clause has targets, its unwinding assertion failed (VERIFICATION FAILED for a correct program at --unwind 2 with 7 targets). The largest assigns clause now counts those of the contracts that replace calls too, as the check of their inclusion in the caller's runs over their targets. Tests: loop_contracts_inclusion_unwind (a loop's clause of 7 targets, in a function that a loop calls) and replace_contract_inclusion_unwind (a replacing contract's clause of 6 targets, larger than the checked contract's) fail before and pass now. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
tautschnig
requested review from
feliperodri,
kroening,
peterschrammel and
remi-delmas-3000
as code owners
November 25, 2026 12:32
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.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #9577 +/- ##
===========================================
- Coverage 81.29% 81.29% -0.01%
===========================================
Files 1725 1725
Lines 191655 191674 +19
Branches 73 73
===========================================
+ Hits 155809 155824 +15
- Misses 35846 35850 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DFCC unwinds the loops of its library that run over a write set as far as the largest assigns clause (
dfcc_libraryt::specialize), but not the loop of__CPROVER_contracts_write_set_check_assigns_clause_inclusion. That function checks that an assigns clause is included in the write set of the code around it: a loop's clause (of a loop in a function that a loop calls), or the clause of a contract that replaces a call.--unwindthen bounds this loop, and with fewer unwindings than the clause has targets its unwinding assertion fails: a correct program gives VERIFICATION FAILED at--unwind 2with 7 targets.The loop is now unwound like the others. The largest assigns clause also counts those of the contracts that replace calls (and of function pointer contracts), as the check of their inclusion in the caller's write set runs over their targets.
Tests:
loop_contracts_inclusion_unwind(a loop's clause of 7 targets, in a function that a loop calls) andreplace_contract_inclusion_unwind(a replacing contract's clause of 6 targets, larger than the clause of the contract being checked) fail before and pass now. contracts, contracts-dfcc (both modes), goto-instrument and cbmc CORE pass.Not covered:
__CPROVER_contracts_write_set_check_frees_clause_inclusionloops over the candidate's frees clause in the same way, and--unwindstill bounds it; unwinding it would need the largest frees clause, which DFCC does not compute yet.