Type Inference Logics

被引:0
|
作者
Carnier, Denis [1 ]
Pottier, Francois [2 ]
Keuchel, Steven [3 ]
机构
[1] Katholieke Univ Leuven, Leuven, Belgium
[2] Inria, Paris, France
[3] Vrije Univ Brussel, Brussels, Belgium
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2024年 / 8卷 / OOPSLA2期
基金
欧洲研究理事会;
关键词
program verification; type inference; elaboration; UNIFICATION; PROGRAMS;
D O I
10.1145/3689786
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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 lambda-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.
引用
收藏
页数:31
相关论文
共 50 条
  • [1] DERIVING INFERENCE RULES FOR TERMINOLOGICAL LOGICS
    ROYER, V
    QUANTZ, JJ
    LECTURE NOTES IN ARTIFICIAL INTELLIGENCE, 1992, 633 : 84 - 105
  • [2] Semantics and inference for probabilistic description logics
    Zese, Riccardo
    Bellodi, Elena
    Lamma, Evelina
    Riguzzi, Fabrizio
    Aguiari, Fabiano
    Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics), 2014, 8816 : 79 - 99
  • [3] Inference and Learning for Probabilistic Description Logics
    Zese, Riccardo
    PROCEEDINGS OF THE TWENTY-FOURTH INTERNATIONAL JOINT CONFERENCE ON ARTIFICIAL INTELLIGENCE (IJCAI), 2015, : 4411 - 4412
  • [4] On probabilistic inference in relational conditional logics
    Thimm, Matthias
    Kern-Isberner, Gabriele
    LOGIC JOURNAL OF THE IGPL, 2012, 20 (05) : 872 - 908
  • [5] A Modular Inference System for Probabilistic Description Logics
    Cota, Giuseppe
    Riguzzi, Fabrizio
    Zese, Riccardo
    Bellodi, Elena
    Lamma, Evelina
    SCALABLE UNCERTAINTY MANAGEMENT (SUM 2018), 2018, 11142 : 78 - 92
  • [6] Case studies: Types, designs, and logics of inference
    Levy, Jack S.
    CONFLICT MANAGEMENT AND PEACE SCIENCE, 2008, 25 (01) : 1 - 18
  • [7] Tabular logics with no finite bases for inference rules
    Rybakov, V.
    LOGIC JOURNAL OF THE IGPL, 2004, 12 (04) : 301 - 311
  • [8] Inference for annotated logics over distributive lattices
    Lu, JJ
    Murray, NV
    Radjavi, H
    Rosenthal, E
    Rosenthal, P
    FOUNDATIONS OF INTELLIGENT SYSTEMS, PROCEEDINGS, 2002, 2366 : 285 - 293
  • [9] Default description logics with reversing inference rules
    Sun, Yu
    Sui, Yuefei
    PROCEEDINGS OF THE FIFTH IEEE INTERNATIONAL CONFERENCE ON COGNITIVE INFORMATICS, VOLS 1 AND 2, 2006, : 280 - 285
  • [10] Type logics and pregroups
    Buszkowski W.
    Studia Logica, 2007, 87 (2-3) : 145 - 169