Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lukaszcz
Copy link
Collaborator

@lukaszcz lukaszcz commented Aug 21, 2025

  • Adds Class.Member.Body data structure which represents the body of a class member (constructor, destructor, method). The body is a sequence of statements:
    1. constructor call,
    2. destructor call,
    3. method call,
    4. fetch object by id,
    5. return value.
  • Object changes within a single body are not tracked for fetches in this body, i.e., every fetch retrieves the value of the object at the entrance to the method ignoring subsequent changes performed by method calls in the body.
  • Updates Tasks and the translation to enable translating members with complex bodies. In particular, this enables translating nested calls.
  • Updates Applib and Apps accordingly.
  • Adds a TwoCounter app based on TwoCounter.lean by @janmasrovira. A TwoCounter object has references (ObjectId) to two Counter objects. 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.

@lukaszcz lukaszcz self-assigned this Aug 21, 2025
@lukaszcz lukaszcz marked this pull request as ready for review August 26, 2025 09:14
@lukaszcz lukaszcz requested review from Copilot and janmasrovira and removed request for janmasrovira August 26, 2025 09:14
Copy link
Contributor

Copilot AI left a 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.Body data 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.

@lukaszcz lukaszcz merged commit fb4674a into main Aug 26, 2025
2 checks passed
@lukaszcz lukaszcz deleted the nested-calls branch August 26, 2025 15:58
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.

3 participants