Menu

#291 better type synthesis for datatype

2.5
closed-fixed
3
2025-06-06
2012-07-18
No

In Rodin 2.5 AST library, type synthesis is implemented only for type constructors (the easy case).

It was not implemented for constructors and destructors, as this would in the general case be as complex as full type check (i.e., one needs to do unification on types).

However, in very simple cases like enumerated types (where the type is constant) and constructor cons of a list (where the type of the constructor is the same as the type of its second parameter), one could implement a very simple type sythesis algorithm.

This would make the AST library more efficient in these cases, without the need to resort to full type unification during type checking.

Discussion

  • Laurent Voisin

    Laurent Voisin - 2025-05-17

    This has been implemented for destructors (where we already have the full type instantiation of the datatype.
    This has also been implemented on constructors when there is no type parameter.

     
  • Guillaume Verdier

    • status: open --> closed-fixed
     
  • Guillaume Verdier

    These changes have been merged in commit [df38cb].

     

    Related

    Commit: [df38cb]


Log in to post a comment.

MongoDB Logo MongoDB