Dynamic type inference for gradual Hindley–Milner typing

By Yusuke Miyazaki, Taro Sekiyama, Atsushi Igarashi. 2018

24 citations recorded by the source corpus.

Garcia and Cimini study a type inference problem for the ITGL, an implicitly and gradually typed language with let-polymorphism, and develop a sound and complete inference algorithm for it. Soundness and completeness mean that, if the algorithm succeeds, the input term can be translated to a well-typed term of an explicitly typed blame calculus by cast insertion and vice versa. However, in general, there are many possible translations depending on how type variables that were left undecided by static type inference are instantiated with concrete static types. Worse, the translated terms may behave differently—some evaluate to values but others raise blame. In this paper, we propose and formalize a new blame calculus λBDTI that avoids such divergence as an intermediate language for the ITGL. A main idea is to allow a term to contain type variables (that have not been instantiated during static type inference) and defer instantiation of these type variables to run time. We introduce dynamic type inference (DTI) into the semantics of λBDTI so that type variables are instantiated along reduction. The DTI-based semantics not only avoids the divergence described above but also is sound and complete with respect to the semantics of fully instantiated terms in the following sense: if the evaluation of a term succeeds (i.e., terminates with a value) in the DTI-based semantics, then there is a fully instantiated version of the term that also succeeds in the explicitly typed blame calculus and vice versa. Finally, we prove the gradual guarantee, which is an important correctness criterion of a gradually typed language, for the ITGL.

Subfields: Artificial Intelligence, Computational Theory and Mathematics, Program Analysis & Verification

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Ming-Ho Yee
  2. Arjun Guha
  3. Sheng Chen
  4. Jens Palsberg
  5. Martin Erwig
  6. Eric Walkingshaw
  7. John Peter Campora III
  8. Zeina Migeed

In Computational Theory and Mathematics

  1. Sheng Chen
  2. Jens Palsberg
  3. Martin Erwig
  4. Eric Walkingshaw
  5. Arjun Guha
  6. John Peter Campora III
  7. Zeina Migeed
  8. Ming-Ho Yee

In Program Analysis & Verification

  1. Ming-Ho Yee
  2. Arjun Guha
  3. Sheng Chen
  4. Jens Palsberg
  5. Martin Erwig
  6. Eric Walkingshaw
  7. John Peter Campora III
  8. Zeina Migeed

Citations in the corpus