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 条
[31]  
Jacobs B., 1999, STUDIES LOGIC FDN MA, V141
[32]   Type-Based Cost Analysis for Lazy Functional Languages [J].
Jost, Steffen ;
Vasconcelos, Pedro ;
Florido, Mario ;
Hammond, Kevin .
JOURNAL OF AUTOMATED REASONING, 2017, 59 (01) :87-120
[33]   Static Determination of Quantitative Resource Usage for Higher-Order Programs [J].
Jost, Steffen ;
Hammond, Kevin ;
Loidl, Hans-Wolfgang ;
Hofmann, Martin .
POPL'10: PROCEEDINGS OF THE 37TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2010, :223-236
[34]   Contract-Based Resource Verification for Higher-Order Functions with Memoization [J].
Madhavan, Ravichandhran ;
Kulal, Sumith ;
Kuncak, Viktor .
ACM SIGPLAN NOTICES, 2017, 52 (01) :330-343
[35]   NOTIONS OF COMPUTATION AND MONADS [J].
MOGGI, E .
INFORMATION AND COMPUTATION, 1991, 93 (01) :55-92
[36]   Dependent Type Theory for Verification of Information Flow and Access Control Policies [J].
Nanevski, Aleksandar ;
Banerjee, Anindya ;
Garg, Deepak .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2013, 35 (02)
[37]   Hoare type theory, polymorphism and separation [J].
Nanevski, Aleksandar ;
Morrisett, Greg ;
Birkedal, Lars .
JOURNAL OF FUNCTIONAL PROGRAMMING, 2008, 18 :865-911
[38]  
Pfenning F., 2001, Mathematical Structures in Computer Science, V11, P511, DOI 10.1017/S0960129501003322
[39]  
Serrano A., 2013, THEOR PRACT LOG PROG, V13, P1
[40]   Complexity and Resource Bound Analysis of Imperative Programs Using Difference Constraints [J].
Sinn, Moritz ;
Zuleger, Florian ;
Veith, Helmut .
JOURNAL OF AUTOMATED REASONING, 2017, 59 (01) :3-45