Academic Journal

A Logical Approach to Type Soundness: A logical approach to type soundness

Bibliographic Details
Title: A Logical Approach to Type Soundness: A logical approach to type soundness
Authors: Amin Timany, Robbert Krebbers, Derek Dreyer, Lars Birkedal
Source: Journal of the Association for Computing Machinery, 71, 6, pp. 1-75
Timany, A, Krebbers, R, Dreyer, D & Birkedal, L 2024, 'A Logical Approach to Type Soundness', Journal of the ACM, vol. 71, no. 6, 40. https://doi.org/10.1145/3676954
Publisher Information: Association for Computing Machinery (ACM), 2024.
Publication Year: 2024
Subject Terms: Logic in computer science, Type soundness, Mathematical aspects of software engineering (specification, verification, metrics, requirements, etc.), Theory of programming languages, Semantics in the theory of computing, Iris, type soundness, 0102 computer and information sciences, 02 engineering and technology, 01 natural sciences, logical relations, Formalization of mathematics in connection with theorem provers, Software Science, data abstraction, 0202 electrical engineering, electronic engineering, information engineering, Coq, step-indexing, concurrent separation logic
Description: 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 so-called 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.
Document Type: Article
File Description: application/xml
Language: English
ISSN: 1557-735X
0004-5411
DOI: 10.1145/3676954
Access URL: https://zbmath.org/8030807
https://doi.org/10.1145/3676954
https://hdl.handle.net/https://repository.ubn.ru.nl/handle/2066/312783
https://doi.org/10.1145/3676954
https://hdl.handle.net/2066/312783
https://repository.ubn.ru.nl//bitstream/handle/2066/312783/312783.pdf
https://pure.au.dk/portal/en/publications/6c1d3054-690e-429f-8d9e-527c436f14b6
http://www.scopus.com/inward/record.url?scp=85212245880&partnerID=8YFLogxK
https://doi.org/10.1145/3676954
Rights: CC BY
Accession Number: edsair.doi.dedup.....c9b7b5432fa61b13de1ea611f1b46dfc
Database: OpenAIRE
Description
ISSN:1557735X
00045411
DOI:10.1145/3676954