-
Notifications
You must be signed in to change notification settings - Fork 5
Tracking object changes in programs #95
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
Conversation
d9d21ff to
9d8334c
Compare
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 implements tracking of changes to objects resulting from method calls inside programs, enabling correct compilation of programs with multiple method calls on the same object. The implementation introduces an intermediate Tasks type that represents a sequence of tasks with intervening object fetches and random value generations, which mimics more closely the structure of AVM programs than a single Task.
- Introduces the
Taskstype as an intermediate representation betweenAVM.ProgramandTask - Implements object change tracking through adjustment functions that apply modifications from program execution
- Replaces the previous list-based task composition with a more structured approach that properly handles object state changes
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Apps/KudosBank.lean | Adds Inhabited derivation to data structures |
| AVM/Tasks.lean | Introduces new Tasks type and composition functions |
| AVM/Task.lean | Simplifies Task by removing list composition methods and adding helper functions |
| AVM/Program/Translation.lean | Updates compilation to use new Tasks-based approach |
| AVM/Program/Parameters.lean | Replaces genId with rand, adds Inhabited instance and helper functions |
| AVM/Program.lean | Renames returnValue to value and improves documentation |
| AVM/Object/Created.lean | Adds rand field to CreatedObject and updates constructor |
| AVM/Object.lean | Adds Inhabited instance for ObjectData and Object |
| AVM/Class/Translation/Tasks.lean | Implements task creation with object change tracking |
| AVM/Class/Translation/Messages.lean | Extracts message creation functions |
| AVM/Class/Translation/Logics.lean | Extracts logic creation functions |
| AVM/Class/Translation.lean | Simplifies by importing modularized components |
| AVM/Class/Label.lean | Adds Inhabited constraint for private fields |
| AVM/Action.lean | Adds object conversion methods and updates balance functions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- I forgot to change this in #95
Taskstype which represents a sequence of tasks with intervening object fetches and random value generations. TheTaskstype mimics more closely the structure of AVM programs than a singleTask.AVM.Programis compiled toTaskswhich are then composed into a singleTask. The composition ofTaskscollects and lifts out the parameters of all subtasks.