Incremental SMT2: Lazy array instantiation for array_of expressions#8899
Draft
tautschnig wants to merge 1 commit intodiffblue:developfrom
Draft
Incremental SMT2: Lazy array instantiation for array_of expressions#8899tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
Replace the universal quantifier (forall) encoding for array_of_exprt with targeted index-specific assertions. Instead of asserting that every element equals the fill value upfront, track which indices are actually accessed and only assert the fill value for those specific indices. This eliminates smt_forall_termt usage for array_of, improving SMT solver performance (especially with 64-bit indices) and avoiding potential 'unknown' results from solvers that struggle with quantifiers combined with arrays and bit vectors. New data structures: - array_of_fill_values: maps array identifier to its fill value term - array_of_instantiated_indices: tracks which indices have been asserted New methods: - instantiate_array_of_for_index: sends a single select=fill assertion - instantiate_lazy_array_of_indices: scans expressions for index_exprt nodes accessing array_of arrays and triggers lazy instantiation The lazy instantiation is called from both set_to and ensure_handle_for_expr_defined after define_dependent_functions. Fixes: diffblue#8061
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #8899 +/- ##
========================================
Coverage 80.41% 80.42%
========================================
Files 1703 1703
Lines 188398 188489 +91
Branches 73 73
========================================
+ Hits 151502 151590 +88
- Misses 36896 36899 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Replace the universal quantifier (forall) encoding for array_of_exprt with targeted index-specific assertions. Instead of asserting that every element equals the fill value upfront, track which indices are actually accessed and only assert the fill value for those specific indices.
This eliminates smt_forall_termt usage for array_of, improving SMT solver performance (especially with 64-bit indices) and avoiding potential 'unknown' results from solvers that struggle with quantifiers combined with arrays and bit vectors.
New data structures:
New methods:
The lazy instantiation is called from both set_to and ensure_handle_for_expr_defined after define_dependent_functions.
Fixes: #8061