Monadic Refinements for Relational Cost Analysis

被引:28
作者
Radicek, Ivan [1 ]
Barthe, Gilles [2 ]
Gaboardi, Marco [3 ]
Garg, Deepak [4 ]
Zuleger, Florian [1 ]
机构
[1] TU Wien, Vienna, Austria
[2] IMDEA Software Inst, Madrid, Spain
[3] Univ Buffalo SUNY, Buffalo, NY USA
[4] Max Planck Inst Software Syst, Saarbrucken, Germany
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2018年 / 2卷 / POPL期
关键词
Cost analysis; monads; relational verification; higher-order logic; refinement types;
D O I
10.1145/3158124
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Formal frameworks for cost analysis of programs have been widely studied in the unary setting and, to a limited extent, in the relational setting. However, many of these frameworks focus only on the cost aspect, largely side-lining functional properties that are often a prerequisite for cost analysis, thus leaving many interesting programs out of their purview. In this paper, we show that elegant, simple, expressive proof systems combining cost analysis and functional properties can be built by combining already known ingredients: higher-order refinements and cost monads. Specifically, we derive two syntax-directed proof systems, U-C and R-C, for unary and relational cost analysis, by adding a cost monad to a (syntax-directed) logic of higher-order programs. We study the metatheory of the systems, show that several nontrivial examples can be verified in them, and prove that existing frameworks for cost analysis (RelCost and RAML) can be embedded in them.
引用
收藏
页数:32
相关论文
共 46 条
[1]   A relational logic for higher-Order programs [J].
Aguirre A. ;
Barthe G. ;
Gaboardi M. ;
Garg D. ;
Strub P.-Y. .
Proceedings of the ACM on Programming Languages, 2017, 1 (ICFP)
[2]  
Aguirre Alejandro, 2017, RELATIONAL REASONING
[3]   Cost analysis of object-oriented bytecode programs [J].
Albert, Elvira ;
Arenas, Puri ;
Genaim, Samir ;
Puebla, German ;
Zanardini, Damiano .
THEORETICAL COMPUTER SCIENCE, 2012, 413 (01) :142-159
[4]  
Alias C, 2010, LECT NOTES COMPUT SC, V6337, P117, DOI 10.1007/978-3-642-15769-1_8
[6]   Automating sized-Type inference for complexity analysis [J].
Avanzini M. ;
Dal Lago U. .
Proceedings of the ACM on Programming Languages, 2017, 1 (ICFP)
[7]  
Avanzini M, 2015, PROCEEDINGS OF THE 20TH ACM SIGPLAN INTERNATIONAL CONFERENCE ON FUNCTIONAL PROGRAMMING (ICFP'15), P152, DOI 10.1145/2784731.2784753
[8]  
Barthe G, 2015, ACM SIGPLAN NOTICES, V50, P55, DOI [10.1145/2775051.2677000, 10.1145/10.1145/2676726.2677000]
[9]   Probabilistic Relational Verification for Cryptographic Implementations [J].
Barthe, Gilles ;
Fournet, Cedric ;
Gregoire, Benjamin ;
Strub, Pierre-Yves ;
Swamy, Nikhil ;
Zanella-Beguelin, Santiago .
ACM SIGPLAN NOTICES, 2014, 49 (01) :193-205
[10]   Quasi-interpretations a way to control resources [J].
Bonfante, G. ;
Marion, J. -Y. ;
Moyen, J-Y .
THEORETICAL COMPUTER SCIENCE, 2011, 412 (25) :2776-2796