Fix invalid assumptions and invariants in GraphML witness generation#8802
Fix invalid assumptions and invariants in GraphML witness generation#8802tautschnig merged 1 commit intodiffblue:developfrom
Conversation
f7cc40c to
0392ef7
Compare
There was a problem hiding this comment.
Pull request overview
Adjusts GraphML witness generation to avoid emitting invalid assumptions/invariants by filtering based on scope and excluding init/built-in/extern contexts.
Changes:
- Omits empty
invariant.scopeentries in GraphML output. - Adds filtering to skip assumptions/invariants from
__CPROVER_initialize, built-in/extern functions, and RHS expressions referencing out-of-scope locals. - Infers an “effective scope” for assumptions/invariants based on the assigned symbol name.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/xmllang/graphml.cpp | Avoids writing empty invariant.scope attributes. |
| src/goto-programs/graphml_witness.cpp | Introduces scope/built-in/extern filtering for assumptions and invariants. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove assumptions with `__CPROVER_initialize` scope - Filter out assumptions for internal variables of external functions - Remove assumptions referencing out-of-scope local variables Fixes: diffblue#5264 Co-authored-by: Kiro (autonomous agent) <kiro-agent@users.noreply.github.com>
0392ef7 to
1b78fa1
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8802 +/- ##
===========================================
- Coverage 80.01% 80.00% -0.01%
===========================================
Files 1700 1700
Lines 188345 188377 +32
Branches 73 73
===========================================
+ Hits 150696 150707 +11
- Misses 37649 37670 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// Check if all symbols in an expression are in scope. | ||
| /// Note: scope is determined by the prefix before the first "::". This is | ||
| /// correct for CBMC's C front-end where locals are named "function::N::var" | ||
| /// and function_id is "function". JBMC does not use graphml witnesses. |
There was a problem hiding this comment.
JBMC does not use graphml witnesses.
That's incorrect, but probably doesn't matter because graphml witnesses are deprecated anyway.
__CPROVER_initializescopeCo-authored-by: Kiro autonomous agent
Fixes: #5264