Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mir_fresh_expanded_value #1955

Merged
merged 1 commit into from Nov 7, 2023
Merged

mir_fresh_expanded_value #1955

merged 1 commit into from Nov 7, 2023

Conversation

RyanGlScott
Copy link
Contributor

This adds a mir_fresh_expanded_value command, which creates a MIR value populated entirely by fresh symbolic variables. For compound types such as structs or arrays, this will explicitly set each field or element to contain a fresh symbolic variable. This is heavily inspired by the llvm_fresh_expanded_val command in the LLVM backend.

This command will be important for the MIR user story going forward, as we will impose an requirement that all mutable allocations in an override must be explicitly set in the override's postconditions. The mir_fresh_expanded_value command provides a convenient way to quickly generate values to set in the postconditions.

At present, mir_fresh_expanded_value comes with the limitation that it does not support reference types. This is not an inherent limitation, but it is one that will require some additional work to lift. In particular, we will likely need something like a mir_fresh_ref command (similar to LLVM's llvm_fresh_pointer command) to make this work. We leave the task of implementing mir_fresh_ref to a later patch.

This checks off one box in #1859.

@RyanGlScott RyanGlScott added the ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully. label Nov 7, 2023
This adds a `mir_fresh_expanded_value` command, which creates a MIR value
populated entirely by fresh symbolic variables. For compound types such as
structs or arrays, this will explicitly set each field or element to contain a
fresh symbolic variable. This is heavily inspired by the
`llvm_fresh_expanded_val` command in the LLVM backend.

This command will be important for the MIR user story going forward, as we will
impose an requirement that all mutable allocations in an override must be
explicitly set in the override's postconditions. The `mir_fresh_expanded_value`
command provides a convenient way to quickly generate values to set in the
postconditions.

At present, `mir_fresh_expanded_value` comes with the limitation that it does
not support reference types. This is not an inherent limitation, but it is one
that will require some additional work to lift. In particular, we will likely
need something like a `mir_fresh_ref` command (similar to LLVM's
`llvm_fresh_pointer` command) to make this work. We leave the task of
implementing `mir_fresh_ref` to a later patch.

This checks off one box in #1859.
@mergify mergify bot merged commit 8633a59 into master Nov 7, 2023
39 checks passed
@mergify mergify bot deleted the T1859-mir_fresh_expanded_value branch November 7, 2023 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants