alt-ergo icon indicating copy to clipboard operation
alt-ergo copied to clipboard

Simplify type variables

Open Halbaroth opened this issue 1 year ago • 0 comments

This PR changes three thing:

  1. We do not need a value field in the type variable of Alt-Ergo. These values were only used by the unification of the types in the legacy typechecker.
  2. Add a proper type of the substitution of types in Ty. I add two different functions in the new module Subst to update a substitution. The function Subst.update updates a substitution without checking if it is compatible with a previous bind in the map. The function Subst.try_bind updates a substitution too but raises TypeClash if a previous bind in the map is incompatible with the new value.
  3. Use directly type variables from Dolmen. Notice that I didn't remove some caches in Translate for type variables but I think we can simplify this part too. I prefer doing it in a separate PR.

Halbaroth avatar Oct 25 '24 13:10 Halbaroth