Type Inference Logics
Denis Carnier, François Pottier, Steven Keuchel
摘要
Type inference is essential for statically-typed languages such as OCaml and Haskell. It can be decomposed into two (possibly interleaved) phases: a generator converts programs to constraints; a solver decides whether a constraint is satisfiable. Elaboration, the task of decorating a program with explicit type annotations, can also be structured in this way. Unfortunately, most machine-checked implementations of type inference do not follow this phase-separated, constraint-based approach. Those that do are rarely executable, lack effectful abstractions, and do not include elaboration. To close the gap between common practice in real-world implementations and mechanizations inside proof assistants, we propose an approach that enables modular reasoning about monadic constraint generation in the presence of elaboration. Our approach includes a domain-specific base logic for reasoning about metavariables and a program logic that allows us to reason abstractly about the meaning of constraints. To evaluate it, we report on a machine-checked implementation of our techniques inside the Coq proof assistant. As a case study, we verify both soundness and completeness for three elaborating type inferencers for the simply typed λ -calculus with Booleans. Our results are the first demonstration that type inference algorithms can be verified in the same form as they are implemented in practice: in an imperative style, modularly decomposed into constraint generation and solving, and delivering elaborated terms to the remainder of the compiler chain.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper1
问问它们各自怎么用它它引用的顶会 Paper3
- Dijkstra monads forever: termination-sensitive specifications for interaction treesLucas Silver, Steve ZdancewicPOPL 2021 · 被引用 17 次
- Intrinsically-typed definitional interpreters à la carteCas van der Rest, Casper Bach Poulsen, Arjen Rouvoet, Eelco Visser 等OOPSLA 2022 · 被引用 12 次
- PureCake: A Verified Compiler for a Lazy Functional LanguageHrutvik Kanabar, Samuel Vivien, Oskar Abrahamsson, Magnus O. Myreen 等PLDI 2023 · 被引用 7 次
相关 Paper
- Coq Coq correct! verification of type checking and erasure for Coq, in CoqMatthieu Sozeau, Simon Boulier, Yannick Forster, Nicolas Tabareau 等POPL 2020 · 被引用 67 次
- Total Type Error Localization and Recovery with HolesEric Zhao, Raef Maroof, Anand Dukkipati, Andrew Blinn 等POPL 2024 · 被引用 15 次
- Nested Inductive Types: Justified and Usable Nested Inductive Types in Lean and RocqThomas Lamiaux, Yannick Forster, Matthieu Sozeau, Nicolas TabareauPLDI 2026
- Data flow refinement type inferenceZvonimir Pavlinovic, Yusen Su, Thomas WiesPOPL 2021 · 被引用 15 次
- Staging with class: a specification for typed template HaskellNingning Xie, Matthew Pickering, Andres Löh, Nicolas Wu 等POPL 2022 · 被引用 17 次
