goto-symex: support struct-keyed arrays (maps) in value materialisation#9065
goto-symex: support struct-keyed arrays (maps) in value materialisation#9065tautschnig wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR updates goto-symex field sensitivity and pointer-analysis value materialisation to support “map-like” arrays keyed by non-integer types (e.g., struct references), avoiding invalid integer-index enumeration and relaxing array type matching to ignore size differences.
Changes:
- Treat arrays with non-scalar index types monolithically (skip element enumeration / field decomposition).
- Relax
value_sett::assignarray type invariant to allow differing array sizes when element types match.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/pointer-analysis/value_set.cpp | Allows assigning arrays with same element type but different sizes (for unbounded heap-map models). |
| src/goto-symex/field_sensitivity.cpp | Prevents field-splitting / enumeration for arrays whose index types can’t be constructed via from_integer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d718733 to
abda365
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #9065 +/- ##
========================================
Coverage 80.68% 80.68%
========================================
Files 1714 1714
Lines 189593 189600 +7
Branches 73 73
========================================
+ Hits 152979 152988 +9
+ Misses 36614 36612 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Field-sensitivity and the value-set assume array indices are integer-typed. For arrays keyed by a struct (used to model heaps as Map Ref Struct), the from_integer-based index construction aborts. Gate get_fields/is_divisible on an enumerable index type (integer/bitvector/enum) via a shared is_enumerable_array_index_type() helper, so the two tightly-coupled predicates cannot drift. Boolean index types are excluded: from_integer(i, bool) collapses every i > 1 to true and would yield duplicate indices on enumeration. Relax the value_sett::assign array type-equality invariant to allow arrays that share an element type but differ in size and index type. Array indices are abstracted to exprt(ID_unknown, c_index_type()) on this path, so the index type does not affect materialisation; the invariant message now states this explicitly. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
abda365 to
c996a37
Compare
Field-sensitivity and the value-set assume array indices are integer-typed. For arrays keyed by a struct (used to model heaps as Map Ref Struct), the from_integer-based index construction aborts. Gate is_divisible/get_fields to integer/bitvector/enum index types, and relax value_sett::assign array type-equality to allow arrays with the same element type but differing size (unbounded heap maps).