cprover: state-encoding for uninterpreted functions and member/index lvalues#9069
Open
tautschnig wants to merge 1 commit into
Open
cprover: state-encoding for uninterpreted functions and member/index lvalues#9069tautschnig wants to merge 1 commit into
tautschnig 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.
Updates state encoding to better handle uninterpreted (mathematical) function symbols and lvalue member/index chains, and adjusts SMT2 conversion behavior.
Changes:
- Enable datatype support in the SMT2 state-encoding target.
- Avoid state-encoding pure mathematical-function symbols; refine member/index handling to only use address-based evaluation when the base is addressable.
- Avoid splitting struct-tag assignments when RHS is a computed full-struct value (function application / if-then-else).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/cprover/state_encoding_targets.h | Enables SMT2 datatypes in the state-encoding converter. |
| src/cprover/state_encoding_targets.cpp | Changes pointer-related size conversion to fall back when size_of_expr fails. |
| src/cprover/state_encoding.cpp | Adjusts expression evaluation and struct assignment splitting to accommodate uninterpreted functions / computed structs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
82
to
+87
| auto size_opt = size_of_expr( | ||
| to_pointer_type(to_binary_expr(expr).op1().type()).base_type(), ns); | ||
| CHECK_RETURN(size_opt.has_value()); | ||
| convert_expr(*size_opt); | ||
| if(size_opt.has_value()) | ||
| convert_expr(*size_opt); | ||
| else | ||
| convert_expr(from_integer(1, size_type())); |
| { | ||
| use_array_of_bool = true; | ||
| use_as_const = true; | ||
| use_datatypes = true; |
Comment on lines
+249
to
+251
| const exprt *base = &what.operands()[0]; | ||
| while(base->id() == ID_member || base->id() == ID_index) | ||
| base = &base->operands()[0]; |
Comment on lines
+536
to
+538
| if( | ||
| lhs.type().id() == ID_struct_tag && | ||
| rhs.id() != ID_function_application && rhs.id() != ID_if) |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #9069 +/- ##
===========================================
- Coverage 80.68% 80.68% -0.01%
===========================================
Files 1714 1714
Lines 189501 189515 +14
Branches 73 73
===========================================
+ Hits 152902 152908 +6
- Misses 36599 36607 +8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…lvalues Leave mathematical-function (uninterpreted function) symbols unencoded as state variables, and follow member/index chains to the addressable base expression when state-encoding lvalues. Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
78c4acf to
6dcb7fe
Compare
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.
Leave mathematical-function (uninterpreted function) symbols unencoded as state variables, and follow member/index chains to the addressable base expression when state-encoding lvalues.