Use a Map from Snap to Snap to represent a magic wand snapshot.#836
Merged
JonasAlaif merged 22 commits intoviperproject:masterfrom Jun 12, 2024
Merged
Use a Map from Snap to Snap to represent a magic wand snapshot.#836JonasAlaif merged 22 commits intoviperproject:masterfrom
JonasAlaif merged 22 commits intoviperproject:masterfrom
Conversation
… own function definitions to replace wand maps.
…ginal approach using MagicWandSnapSingleton.
marcoeilers
previously requested changes
May 7, 2024
… the original approach using MagicWandSnapSingleton." This reverts commit fd87482.
Contributor
Author
|
@marcoeilers Thanks for your code review. I updated my branch accordingly. After performing some benchmarking, Jonas and I decided to revert the second optimization. We compared the mean execution time of all test files that contain a magic wand. In average this version took 2.2% longer than the initial version. The second optimization took slightly longer (+2.72%). |
JonasAlaif
reviewed
May 16, 2024
Contributor
|
@manud99 could you update the PR from the main branch so that I can merge it (don't have access to a pc right now) |
# Conflicts: # silver
auto-merge was automatically disabled
June 12, 2024 11:30
Head branch was pushed to by a user without write access
Contributor
Author
|
@JonasAlaif Done. I updated this branch and the corresponding branch in silver. |
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.
@JonasAlaif and I are working on a different method to generate snapshots for magic wands. The problem with the current approach is that it is potentially unsound when we apply the same magic wand multiple times. This problem has been illustrated in issue #307 and occurs when using
applyingexpressions.To solve that issue we introduce wand maps. These are functions that map a snapshot of the wand's LHS to a corresponding snapshot for the RHS. They make sure that values in the state are preserved when applying a magic wand. In comparison to the initial version they also work when applying a magic wand multiple times in different states. One example for that can be found in the file attached in issue #307 or in this example:
The following changes were made:
MagicWandSnapshotto contain a variable for awandMapof typeMagicWandSnapFunction, short MWSF.wandMapand add its definition to the path conditions.wandMapwhen producing the wand's RHS.MagicWandSnapFunction.Requires viperproject/silver#788 to fully pass the test suite.
Additionally, there is a test suite consisting of 12 files that check the behavior of this PR in viperproject/silver#796.