Verifying stateful programs with substructural state and hoare types

J. Borgström, Juan Chen, N. Swamy
{"title":"Verifying stateful programs with substructural state and hoare types","authors":"J. Borgström, Juan Chen, N. Swamy","doi":"10.1145/1929529.1929532","DOIUrl":null,"url":null,"abstract":"A variety of techniques have been proposed to verify stateful functional programs by developing Hoare logics for the state monad. For better automation, we explore a different point in the design space: we propose using affine types to model state, while relying on refinement type checking to prove assertion safety.\n Our technique is based on verification by translation, starting from FX, an imperative object-based surface language with specifications including object invariants and Hoare triple computation types, and translating into FINE, a functional language with dependent refinements and affine types. The core idea of the translation is the division of a stateful object into a pure value and an affine token whose type mentions the current state of the object. We prove our methodology sound via a simulation between imperative FX programs and their functional FINE translation.\n Our approach enables modular verification of FX programs supported by an SMT solver. We demonstrate its versatility by several examples, including verifying clients of stateful APIs, even in the presence of aliasing, and tracking information flow through side-effecting computations.","PeriodicalId":153056,"journal":{"name":"Programming Languages meets Program Verification","volume":"155 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2011-01-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"16","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Programming Languages meets Program Verification","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1929529.1929532","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 16

Abstract

A variety of techniques have been proposed to verify stateful functional programs by developing Hoare logics for the state monad. For better automation, we explore a different point in the design space: we propose using affine types to model state, while relying on refinement type checking to prove assertion safety. Our technique is based on verification by translation, starting from FX, an imperative object-based surface language with specifications including object invariants and Hoare triple computation types, and translating into FINE, a functional language with dependent refinements and affine types. The core idea of the translation is the division of a stateful object into a pure value and an affine token whose type mentions the current state of the object. We prove our methodology sound via a simulation between imperative FX programs and their functional FINE translation. Our approach enables modular verification of FX programs supported by an SMT solver. We demonstrate its versatility by several examples, including verifying clients of stateful APIs, even in the presence of aliasing, and tracking information flow through side-effecting computations.
验证具有子结构状态和房屋类型的有状态程序
已经提出了各种技术,通过为状态单子开发Hoare逻辑来验证有状态功能程序。为了更好地实现自动化,我们探索了设计空间中的另一个点:我们建议使用仿射类型来为状态建模,同时依靠改进类型检查来证明断言安全性。我们的技术基于翻译验证,从FX(一种命令式的基于对象的表面语言,其规范包括对象不变量和Hoare三重计算类型)开始,转换为FINE(一种具有依赖细化和仿射类型的函数式语言)。转换的核心思想是将有状态对象划分为纯值和仿射令牌,后者的类型提到对象的当前状态。我们通过仿真命令式FX程序和它们的功能性FINE翻译来证明我们的方法是合理的。我们的方法使SMT求解器支持的FX程序的模块化验证成为可能。我们通过几个例子展示了它的多功能性,包括验证有状态api的客户端,甚至在存在混叠的情况下,以及通过副作用计算跟踪信息流。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信