A Logical Approach to Type Soundness

被引:1
作者
Timany, Amin [1 ]
Krebbers, Robbert [2 ]
Dreyer, Derek [3 ]
Birkedal, Lars [1 ]
机构
[1] Aarhus Univ, Aarhus, Denmark
[2] Radboud Univ Nijmegen, Nijmegen, Netherlands
[3] MPI SWS, Saarland Informatics Campus, Saarbrucken, Germany
基金
荷兰研究理事会; 欧洲研究理事会;
关键词
Type soundness; data abstraction; logical relations; step-indexing; con- current separation logic; Iris; Coq; GENERAL REFERENCES; LAMBDA-CALCULUS; RECURSIVE TYPES; SEMANTICS; MODEL; POLYMORPHISM; STATE;
D O I
10.1145/3676954
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Type soundness, which asserts that "well-typed programs cannot go wrong," is widely viewed as the canonical theorem one must prove to establish that a type system is doing its job. It is commonly proved using the socalled syntactic approach (also known as progress and preservation), which has had a huge impact on the study and teaching of programming language foundations. Unfortunately, syntactic type soundness is a rather weak theorem. It only applies to programs that are well typed in their entirety and thus tells us nothing about the many programs written in "safe" languages that make use of "unsafe" language features. Even worse, it tells us nothing about whether type systems achieve one of their main goals: enforcement of data abstraction. One can easily define a language that enjoys syntactic type soundness and yet fails to support even the most basic modular reasoning principles for abstraction mechanisms like closures, objects, and abstract data types. Given these concerns, we argue that programming languages researchers should no longer be satisfied with proving syntactic type soundness and should instead start proving semantic type soundness, a more useful theorem that captures more accurately what type systems are actually good for. Semantic type soundness is an old idea-Milner's original account of type soundness from 1978 was semantic-but it fell out of favor in the 1990s due to limitations and complexities of denotational models. In the succeeding decades, thanks to a series of technical advances-notably, step-indexed Kripke logical relations constructed over operational semantics and higher-order concurrent separation logic as consolidated in the Iris framework in Coq-we can now build (machine-checked) semantic soundness proofs at a much higher level of abstraction than was previously possible. The resulting "logical" approach to semantic type soundness has already been employed to great effect in a number of recent papers, but those papers typically (a) concern advanced problem scenarios that complicate the presentation, (b) assume significant prior knowledge of the reader, and (c) suppress many details of the proofs. Here, we aim to provide a gentler, more pedagogically motivated introduction to logical type soundness, targeted at a broader audience that may or may not be familiar with logical relations and Iris. As a bonus, we also show how logical type soundness proofs can easily be generalized to establish an even stronger relational property- representation independence-for realistic type systems.
引用
收藏
页数:75
相关论文
共 134 条
  • [41] THE REVISED REPORT ON THE SYNTACTIC THEORIES OF SEQUENTIAL CONTROL AND STATE
    FELLEISEN, M
    HIEB, R
    [J]. THEORETICAL COMPUTER SCIENCE, 1992, 103 (02) : 235 - 271
  • [42] Modular Denotational Semantics for Effects with Guarded Interaction Trees
    Frumin, Dan
    Timany, Amin
    Birkedal, Lars
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (POPL):
  • [43] RELOC RELOADED: A MECHANIZED RELATIONAL LOGIC FOR FINE-GRAINED CONCURRENCY AND LOGICAL ATOMICITY
    Frumin, Dan
    Krebbers, Robbert
    Birkedal, Lars
    [J]. LOGICAL METHODS IN COMPUTER SCIENCE, 2021, 17 (03)
  • [44] ReLoC: A Mechanised Relational Logic for Fine-Grained Concurrency
    Frumin, Dan
    Krebbers, Robbert
    Birkedal, Lars
    [J]. LICS'18: PROCEEDINGS OF THE 33RD ANNUAL ACM/IEEE SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE, 2018, : 442 - 451
  • [45] Frumin Dan, 2021, Compositional non-interference for fine-grained concurrent programs, P1416, DOI [10.1109/SP40001.2021.00003, DOI 10.1109/SP40001.2021.00003]
  • [46] Fu M, 2010, LECT NOTES COMPUT SC, V6269, P388, DOI 10.1007/978-3-642-15375-4_27
  • [47] Garay JA, 2003, LECT NOTES COMPUT SC, V2656, P177
  • [48] Efficient and Provable Local Capability Revocation using Uninitialized Capabilities
    Georges, Aina Linn
    Gueneau, Armael
    Van Strydonck, Thomas
    Timany, Amin
    Trieu, Alix
    Huyghebaert, Sander
    Devriese, Dominique
    Birkedal, Lars
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5 (POPL):
  • [49] Scala Step-by-Step Soundness for DOT with Step-Indexed Logical Relations in Iris
    Giarrusso, Paolo G.
    Stefanesco, Leo
    Timany, Amin
    Birkedal, Lars
    Krebbers, Robbert
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (ICFP):
  • [50] Girard J.-Y., 1972, Interpretation Fonctionnelle Et elimination Des Coupures de l'arithmetique d'ordre Superieur