Skip to content

Conversation

@keyboardDrummer
Copy link
Contributor

@keyboardDrummer keyboardDrummer commented Feb 9, 2026

Changes

  1. Change the encoding of the Heap to use Map Composite (Field Box) where Box is a datatype that can hold different values. This way, the translation of Laurel remains executable. The previous Heap encoding relied on axioms.
  2. Support modifies clauses

Testing

  • Update T1_MutableFields because change 1 fixed a bug.
  • Add T4_ModifiesClauses

@keyboardDrummer keyboardDrummer marked this pull request as ready for review February 9, 2026 21:27
@keyboardDrummer keyboardDrummer requested a review from a team as a code owner February 9, 2026 21:27
-- Pure field update returns the same type as the target
| .PureFieldUpdate target _ _ => computeExprType env types target
-- Calls — we don't track return types here, so fall back to TVoid
| .StaticCall _ _ => panic "Not supported StaticCall"
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that this function will always need the option to fail (if given an ill-typed input), I'd prefer to prepare for that by making this function return Except ErrorType HighTypeMd, instead of using panic. I'll leave it up to you to choose what ErrorType should be. It could be a string or something more structured.

def compositeTypeDecl : Core.Decl := .type (.con { name := "Composite", numargs := 0 })

/-- The Box datatype with constructors for each Laurel primitive type + Composite -/
def boxDatatype : Lambda.LDatatype Core.Visibility :=
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be great to move this to some sort of prelude file eventually, but that shouldn't block this PR.

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