Skip to content

Unification based typing - #161

Merged
simonspies merged 4 commits into
mainfrom
unification-based-typing
Aug 4, 2026
Merged

Unification based typing#161
simonspies merged 4 commits into
mainfrom
unification-based-typing

Conversation

@simonspies

Copy link
Copy Markdown
Owner

This PR changes the type system from one based on subtyping to one based on unification. This should make it more intuitive going forward (more closely aligned with OCaml), and it also simplifies the verifier itself. Finally, it should make it easier to generalise to polymorphism.

… monad into a new Unification.lean, and name the predicate rule for the syntax it elaborates, so that the machinery elaboration is about to grow has a home below the file holding the rules.
…riables, the solving state, the pending IR and the constraints in Unification.lean, the rules walking the untyped IR in Typing.lean, their erasure proofs in Erasure.lean, and the one-step unfolding a match will need in the verifier.
…tted local type is solved from its uses rather than defaulted and joined, a match unfolds its scrutinee's name where it is compiled rather than through a cast, a return type and a call's arguments are checked by equality, and a raise is typed at whatever result its context expects.
…st node, the subtyping relation with the weight and depth measures bounding it and the logical-relation lemma interpreting it, the join and meet operations, the per-intrinsic scheme matching the elaborator once called to instantiate a primitive, the lawfulness witness for the empty embedding no raise is typed at any more, and the pointwise ordering on typing contexts nothing had asked for in some time.
@simonspies
simonspies merged commit e86cd7e into main Aug 4, 2026
4 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.

1 participant