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

Improve CFG's termination condition #32

Open
acuarica opened this issue Apr 24, 2023 · 0 comments
Open

Improve CFG's termination condition #32

acuarica opened this issue Apr 24, 2023 · 0 comments
Milestone

Comments

@acuarica
Copy link
Owner

acuarica commented Apr 24, 2023

Instead of always follow jump destinations (and loop unrolling) determine when to stop symbolic execution. The main issue is when jump destinations are in different basic blocks. That is, when a jump destination is pushed in one basic block, but it's jumped to in a different one.

Some papers that might solve this issue

The main problem that arises when deduplicating basic blocks is the introduction of phi-nodes or equivalent. The introduction of Local expressions represent SSA nodes. For a quick intro to SSA see https://www.cs.cornell.edu/courses/cs6120/2022sp/lesson/6/. When introducing phi-nodes it might require to re-execute already executed states.

As an alternative one can use Basic Block Arguments https://2pi.dk/2022/05/bb-arguments, but I'm not sure how to convert from a stack based execution to BB arguments. Discussion about phi-nodes vs BB arguments might be helpful https://news.ycombinator.com/item?id=22432344 and https://mlir.llvm.org/docs/Rationale/Rationale/#block-arguments-vs-phi-nodes.

For reference, how a similar library handles jumpi and jump instructions

jumpi https://github.com/a16z/halmos/blob/main/src/halmos/sevm.py#L1878
jump https://github.com/a16z/halmos/blob/main/src/halmos/sevm.py#L1949

@acuarica acuarica added this to the Stage 1 milestone Apr 25, 2023
@acuarica acuarica modified the milestones: Stage 1, Stage 2 Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant