-
Notifications
You must be signed in to change notification settings - Fork 5
Nested calls #81
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
Nested calls #81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for nested calls in the AVM system by adding complex method bodies that can contain sequences of operations including constructor calls, destructor calls, method calls, and object fetches. The changes enable method bodies to perform multiple operations rather than just returning a single result. Object fetches within a body retrieve the value at method entrance rather than tracking intermediate changes.
Key changes:
- Introduces
Class.Member.Bodydata structure representing sequences of operations in class member bodies - Refactors class definitions and translation to support complex bodies instead of simple return values
- Updates the Task system to handle object fetching and object ID generation
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| AVM/Class/Member/Body.lean | Defines the new inductive type for representing method body sequences |
| AVM/Task/Parameters.lean | New parameter system supporting both object fetching and ID generation |
| Apps/TwoCounter.lean | New example app demonstrating nested calls with mutual counter increment |
| AVM/Ecosystem.lean, AVM/Ecosystem/Label.lean | New ecosystem abstraction for managing collections of classes |
| AVM/Class.lean, AVM/Class/Member.lean | Updated class and member definitions to use ecosystem labels and complex bodies |
| AVM/Class/Translation.lean | Major refactoring to handle complex body translation |
| Apps/*.lean | Updated existing apps to work with new ecosystem-based structure |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Jan Mas Rovira <[email protected]>
Class.Member.Bodydata structure which represents the body of a class member (constructor, destructor, method). The body is a sequence of statements:TwoCounterobject has references (ObjectId) to twoCounterobjects. There is a mutual increment (incrementBoth) method which fetches the values of counters and calls Counter.increment on the counter ids with increment value dependent on counter values.