Skip to content

Renaming and refactorinng in the ASTs and typing #198

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

Merged
merged 45 commits into from
Jul 18, 2025
Merged

Renaming and refactorinng in the ASTs and typing #198

merged 45 commits into from
Jul 18, 2025

Conversation

zoep
Copy link
Collaborator

@zoep zoep commented Jul 14, 2025

This PR refactors the Act AST and typing pass to improve clarity and maintainability.

File name changes

  • Change name of TimeAgnostic.hs to Typed.hs
    Rationale: This file defines the core typed AST. Expressions may be either implicitly or explicitly timed,

  • Change name of Typed.hs to TypedImplicit.hs
    Rationale: Represents the typed AST where timing annotations are may still be implicit in some places.

  • Change name of Annotated.hs to TypedExplicit.hs
    Rationale: Represents the typed AST with all timing annotations made explicit.

  • Change name of Enrich.hs to Bounds.hs
    Rationale: This file implements a pass that adds integer bounds (derived from types) as preconditions and postconditions for calldata, storage, and environment variables. The new name better reflects its purpose.

Renaming of AST nodes

Renamed several AST nodes to better reflect their purpose:

  • Untyped AST (Untyped.hs):

    • DefinitionConstructor
    • DefnMapping
    • AssignManyAssignMapping
  • Typed AST (Typed.hs):

    • TEntryVarRef
    • Change the definition of InavariantPred to get rid of type families

    Code refactoring

  • Refactored the code in Type.hs so that it does proper type inference instead of trying to type an expression with all possible types in order to infer its type. This lead to more efficient code and better error messages.

  • defaultStore renamed to globalEnv in Type.hs

Miscellaneous

  • Improved comments
  • Regenerated test outputs
  • Updated tests where needed

@zoep zoep requested review from d-xo and lefterislazar July 14, 2025 13:52
Copy link
Collaborator

@lefterislazar lefterislazar left a comment

Choose a reason for hiding this comment

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

Just a mix of typo corrections and aesthetic modifications, some may be worth committing.

zoep and others added 7 commits July 17, 2025 11:42
Co-authored-by: lefterislazar <[email protected]>
Co-authored-by: lefterislazar <[email protected]>
Co-authored-by: lefterislazar <[email protected]>
Co-authored-by: lefterislazar <[email protected]>
Co-authored-by: lefterislazar <[email protected]>
Co-authored-by: lefterislazar <[email protected]>
@zoep zoep merged commit 1476033 into main Jul 18, 2025
7 of 9 checks passed
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