Hoare type theory, polymorphism and separation

被引:78
作者
Nanevski, Aleksandar [1 ]
Morrisett, Greg [1 ]
Birkedal, Lars [2 ]
机构
[1] Harvard Univ, Cambridge, MA 02138 USA
[2] IT Univ Copenhagen, Copenhagen, Denmark
关键词
D O I
10.1017/S0956796808006953
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We consider the problem of reconciling a dependently typed functional language with imperative features Such as mutable higher-order state. pointer aliasing, and nontermination. We propose Hoare type theory (HTT), which incorporates Hoare-style specifications into types. making it possible to statically track and enforce correct use of side effects. The main feature of HTT is the Hoare type),{P}x:A:{Q} specifying computations with precondition P and postcondition Q that return it result Of type A. Hoare types can be nested, combined with other types, and abstracted, leading to a smooth integration with higher-order functions and type polymorphism. We further show that in the presence of type polymorphism, it becomes possible to interpret the Hoare types in the "small footprint" manner, as advocated by separation logic. whereby specifications tightly describe the state required by the computation. We establish that HTT is Sound and compositional. in the sense that separate verifications of individual program components suffice to ensure the correctness of the composite program.
引用
收藏
页码:865 / 911
页数:47
相关论文
共 73 条
[1]  
Abadi M, 2003, LECT NOTES COMPUT SC, V2772, P11
[2]  
AHMED A, 2005, ICFP 05, P78
[3]  
Altenkirch T, 2001, IEEE S LOG, P303, DOI 10.1109/LICS.2001.932506
[4]  
AMTOFT T, 2006, S PRINC PROGR LANG P, P91
[5]  
[Anonymous], 2003, Haskell 98 Language and LibrariesThe Revised Report
[6]  
Augustsson Lennart, 1998, P 3 ACM SIGPLAN INT, P239, DOI DOI 10.1145/289423.289451.
[7]  
Barnes J., 2003, High Integrity Software: The SPARK Approach to Safety and Security
[8]  
BERGER M, 2005, INT C FUNCT PROGR IC, P280
[9]  
BIERING B, 2005, ITUTR200569
[10]  
Birkedal L, 2005, IEEE S LOG, P260