A Monadic Approach to Modular Verification

被引:0
作者
Michelland, Sebastien [1 ]
Zakowski, Yannick [2 ]
Gonnord, Laure [1 ]
机构
[1] Univ Grenoble Alpes, Grenoble INP, LCIS, Grenoble, France
[2] UCBL1, Inria, ENS Lyon, CNRS,LIP,UMR 5668, Villeurbanne, France
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2024年 / 8卷 / ICFP期
关键词
Monadic Semantics; Abstract Interpretation; Formal Verification;
D O I
10.1145/3674646
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We argue that monadic interpreters built as layers of handlers stacked atop the free monad, as advocated notably by the ITree library, also constitute a promising way to implement and verify abstract interpreters in dependently-typed theories such as the one underlying the Coq proof assistant. The approach enables both code reuse across projects and modular proofs of soundness of the resulting interpreters. We provide generic abstract control flow combinators proven correct once and for all against their concrete counterpart. We demonstrate how to relate concrete handlers implementing effects to abstract variants of these handlers, essentially capturing the traditional soundness of transfer functions in the context of monadic interpreters. Finally, we provide generic results to lift soundness statements via the interpretation of stateful and failure effects. We formalize all the aforementioned combinators and theories into a Coq library, and demonstrate their benefits by implementing and proving correct two illustrative abstract interpreters respectively for a structured imperative language and a toy assembly.
引用
收藏
页数:28
相关论文
共 47 条
[1]   Infinite trees and completely iterative theories:: a coalgebraic view [J].
Aczel, P ;
Adámek, J ;
Milius, S ;
Velebil, J .
THEORETICAL COMPUTER SCIENCE, 2003, 300 (1-3) :1-45
[2]  
Anonymous, 2024, Zenodo, DOI 10.5281/ZENODO.11470739
[3]   Skeletal Semantics and Their Interpretations [J].
Bodin, Martin ;
Gardner, Philippa ;
Jensen, Thomas ;
Schmitt, Alan .
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (POPL)
[4]   Refinement to Certify Abstract Interpretations: Illustrated on Linearization for Polyhedra [J].
Boulme, Sylvain ;
Marechal, Alexandre .
JOURNAL OF AUTOMATED REASONING, 2019, 62 (04) :505-530
[5]   GENERAL RECURSION VIA COINDUCTIVE TYPES [J].
Capretta, Venanzio .
LOGICAL METHODS IN COMPUTER SCIENCE, 2005, 1 (02)
[6]  
Chappe N, 2023, P ACM PROGRAM LANG, V7, DOI 10.1145/3571254
[7]   A Survey on Product Operators in Abstract Interpretation [J].
Cortesi, Agostino ;
Costantini, Giulia ;
Ferrara, Pietro .
ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2013, (129) :325-336
[8]  
Cousot P., 2021, Principles of Abstract Interpretation
[9]  
Cousot P, 2007, LECT NOTES COMPUT SC, V4435, P272
[10]  
Cousot Patrick., 1979, P 6 ACM SIGACT SIGPL, P269, DOI DOI 10.1145/567752.567778