Languages with polymorphic type systems are made convenient to use by employing type inference to avoid redundant type information. Unfortunately, features such as impredicative types and subtyping make complete type inference very challenging or impossible to realize. Thus some partial type inference methods are needed.
This paper presents a form of partial type inference called \emph{elementary type inference}. Elementary type inference adopts the idea of inferring only monotypes from past work on predicative higher-ranked polymorphism. This idea is extended with the addition of explicit type applications that work for any polytypes. Thus easy (predicative) instantiations can be inferred, while all other (impredicative) instantiations are always possible with explicit type applications without any compromise in expressiveness. Our target is a System F extension with top and bottom types, similar to the language employed by Pierce and Turner in their seminal work on local type inference. We show a sound, complete and decidable type system for a calculus called $F_{<:}^e$, that targets that extension of System F. A key design choice in $F_{<:}^e$ is to consider top and bottom types as polytypes only. An important technical challenge is that the combination of predicative implicit instantiation and impredicative explicit type applications, in the presence of standard subtyping rules, is non-trivial. Without some restrictions, key properties, such as subsumption and stability of type substitution lemmas, break. To address this problem we introduce a variant of polymorphic subtyping called \emph{stable subtyping} with some mild restrictions on implicit instantiation. All the results are mechanically formalized in the Abella theorem prover.
Thu 30 JunDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
16:45 - 18:15 | |||
16:45 30mTalk | Maniposynth: Bimodal Tangible Functional ProgrammingVCOOP 2022 Research Papers Pre-print Media Attached | ||
17:15 30mTalk | Elementary Type InferenceVCOOP 2022 Research Papers | ||
17:45 30mTalk | Defining Corecursive Functions in Coq Using ApproximationsVCOOP 2022ECOOP 2022 Research Papers |