Typechecking of Overloading in Programming Languages and Mechanized Mathematics - Inria - Institut national de recherche en sciences et technologies du numérique
Communication Dans Un Congrès Année : 2025

Typechecking of Overloading in Programming Languages and Mechanized Mathematics

Résumé

Overloading consists of using a same symbol (or name) to refer to several functions (or constants). Overloading is ubiquitous in mathematics. It also appears in numerous programming languages that resolve overloading statically, as opposed to languages that rely on dynamic dispatch during program execution. Thus, a key question is how to determine, for every occurrence of an overloaded symbol, which function it refers to. Static resolution of overloading is intrinsically intertwined with typechecking. Indeed, overloading resolution depends on types, but the types of the overloaded symbols depend on how they are resolved. This work presents the first typechecking algorithm for static resolution of overloading that: (1) guides resolution not only by function arguments but also by expected result type, and (2) supports polymorphic types. Moreover, our algorithm supports type inference like traditional ML typecheckers-we only exclude inference of polymorphism. We illustrate the practicality of our algorithm for typechecking conventional mathematical formulae, as well as for typechecking ML code with overloading of literals, functions, constructors, and record field names.

Fichier principal
Vignette du fichier
jfla2025-final30.pdf (347.93 Ko) Télécharger le fichier
Origine Fichiers produits par l'(les) auteur(s)

Dates et versions

hal-04859446 , version 1 (30-12-2024)

Licence

Copyright (Tous droits réservés)

Identifiants

  • HAL Id : hal-04859446 , version 1

Citer

Arthur Charguéraud, Martin Bodin, Louis Riboulet. Typechecking of Overloading in Programming Languages and Mechanized Mathematics. 36es Journées Francophones des Langages Applicatifs (JFLA 2025), Jan 2025, Roiffé, France. ⟨hal-04859446⟩
0 Consultations
0 Téléchargements

Partager

More