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

Remove irrelevant assignments from counterexamples #710

Open
palinatolmach opened this issue Jul 19, 2024 · 2 comments
Open

Remove irrelevant assignments from counterexamples #710

palinatolmach opened this issue Jul 19, 2024 · 2 comments
Labels
enhancement New feature or request ux

Comments

@palinatolmach
Copy link
Collaborator

We generate assignments for some globaly accessible variables, such as ORIGIN_ID and CALLER_ID, by default. To make the counterexample easier to interpret, we can restrict the model to the variables showing up in constraints.

@palinatolmach
Copy link
Collaborator Author

As pointed out by @PetarMax, we generate assignments to CALLER_ID and ORIGIN_ID, because they appear in path conditions (we have checks on them not being precompile addresses, Vm, Test contracts, etc). We could do post-processing on the model and exclude their assignments from the model manually, but there might be other constraints on their values if, e.g., access control checks are involved.

I think we can close it for now, and instead improve the counterexample presentation by translating variable names back to the Solidity representation (VV1_x_... to x) and CALLER_ID to msg.sender, so it's more clear.

@palinatolmach
Copy link
Collaborator Author

Reopened after a discussion with @ehildenb.

Another way to filter our non-informative CALLER_ID and SENDER_ID assignments is to check whether the constraints on these variables all appear in the initial term (or come from the ensures clause of a cheatcode such as freshAddress()), as a post-processing step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ux
Projects
None yet
Development

No branches or pull requests

1 participant