Lune

POPL2026Top-tier venue

Local Contextual Type Inference

Xu Xue, Chen Cui, Shengyi Jiang, Bruno C. d. S. Oliveira

2026Year

Abstract

Type inference is essential for programming languages, yet complete and global inference quickly becomes undecidable in the presence of rich type systems like System F. Pierce and Turner proposed local type inference (LTI) as a scalable, partially annotated alternative by relying on information local to applications. While LTI has been widely adopted in practice, there are significant gaps between theory and practice, with its theory being underdeveloped and specifications for LTI being complex and restrictive. We propose Local Contextual Type Inference , a principled redesign of LTI grounded in contextual typing—a recent formalism which captures type information flow. We present Contextual System F ( F c ), a variant of System F with implicit and first-class polymorphism. We formalize F c using a declarative type system, prove soundness, completeness, and decidability, and introduce matching subtyping as a bridge between declarative and algorithmic inference. This work offers the first mechanized treatment of LTI, while at the same time removing important practical restrictions and also demonstrating the power of contextual typing in designing robust, extensible and simple to implement type inference algorithms.

Ask about this paper

Your agent reads all of it.

Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.

Questions to start from

Your agent calls

Luneget_paper_fulltext

Ask in Lune

Free to start. No credit card required.

lune papers fulltext bec9ed9e-5d6e-498a-9a67-508039b75b26

Builds on4

Related papers

Dusk over the sea between two cliffs drawn in fine vertical lines