Skip to content

Conversation

Stevengre
Copy link
Contributor

  • Updated the #traverseProjection function to accept an additional Int parameter representing the current height of the stack.
  • Adjusted all related rules to accommodate the new parameter, ensuring correct context handling during projection traversals.
  • Enhanced the handling of dereferencing and context management in various projection scenarios.

- Updated the `#traverseProjection` function to accept an additional `Int` parameter representing the current height of the stack.
- Adjusted all related rules to accommodate the new parameter, ensuring correct context handling during projection traversals.
- Enhanced the handling of dereferencing and context management in various projection scenarios.
@Stevengre Stevengre requested a review from jberthold August 13, 2025 07:17
@Stevengre Stevengre self-assigned this Aug 13, 2025
Copy link
Member

@jberthold jberthold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far. And yes, a test would be great.

~> #writeProjection(NEW)
=> #setLocalValue(place(local(I), .ProjectionElems), #buildUpdate(NEW, CONTEXTS))
...
</k>
[preserves-definedness] // valid context ensured upon context construction

rule <k> #traverseProjection(toLocal(I), _ORIGINAL, .ProjectionElems, CONTEXTS)
rule <k> #traverseProjection(toLocal(I), _ORIGINAL, .ProjectionElems, CONTEXTS, _CURH)
~> #writeMoved
=> #forceSetLocal(local(I), #buildUpdate(Moved, CONTEXTS)) // TODO retain Ty and Mutability from _ORIGINAL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just see this outdated comment here...

Suggested change
=> #forceSetLocal(local(I), #buildUpdate(Moved, CONTEXTS)) // TODO retain Ty and Mutability from _ORIGINAL
=> #forceSetLocal(local(I), #buildUpdate(Moved, CONTEXTS))

- Refactored the `render_rules` function to improve edge rule rendering by incorporating NDBranch logic.
- Added logic to select between KCFG edges and NDBranches, ensuring proper rule application display.
- Introduced a divider for better readability in the output.
- Updated the handling of rules to accommodate cases where no edge is found, enhancing robustness.
- Introduced a new test file `deref_chain_calls.rs` to validate dereferencing of multiple layers of pointers to a struct.
- Implemented a sample `Account` struct and functions to demonstrate dereferencing and ensure correct retrieval of balance and flags.
- Added assertions to verify expected outcomes, enhancing test coverage for pointer dereferencing scenarios.
- Created a new .gitignore file in the prove-rs directory to exclude Markdown files and the proof directory from version control.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I checked out the branch to test it locally, I found that this file is in the way for prove_rs tests... the integration test expects all files in the directory to be rust code.
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'll change it.

@jberthold
Copy link
Member

The CI run times out after 6 hours (!) so there are looping proofs.
I tried to debug it locally and found that array_match.rs is one of the proofs. When executing it in smaller steps I found an off-by-one in the stack height, which is not obvious in the code changes. Then I found that #localFromFrame is actually adjusting the offset when it reads references from the stack...
So it seems like we do not actually need to carry the current offset separately ? 🤔

- Added entries to the main .gitignore to exclude specific proof-related files and directories.
- Removed the .gitignore file from the prove-rs directory as it is no longer needed.
@Stevengre
Copy link
Contributor Author

Height is solved by #localFromFrame ( StackFrame, Local, Int ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants