首页> 外文会议>3rd ACM SIGPLAN workshop on programming languages meets program verification 2009 >Language-Agnostic Specification and Verification Invited Talk
【24h】

Language-Agnostic Specification and Verification Invited Talk

机译:与语言无关的规范和验证邀请的演讲

获取原文
获取原文并翻译 | 示例
获取外文期刊封面目录资料

摘要

Over the last few years we have been working on bringing simple and pragmatic program specification and verification to programming languages targeting the Microsoft .NET platform. In this talk I will discuss the motivation and trade-offs influencing our design. The specifications and static verification are targeted at the general developer, not the verification enthusiast. It is thus important to us to use a single form of specifications that meets three simultaneous goals:rn1. Specifications serve as documentation. They must be as readable as possible.rn2. Specifications should be executable. This motivates writing specifications for testing and immediate perceived benefit, without consideration of static verification.rn3. Specifications should be usable in static verification.rnOur specification approach is language-agnostic in that we use idiomatic code written in the developer's source language to express preconditions and postconditions. Preconditions and postcondi-rntions are expressed as calls to the static methods Contract. Requires and Contract. Ensures. Special dummy methods are used to refer to the method result value as well as referring to the old value of an expression, meaning the value of the expression on method entry. The conditions in the example in Figure 1 are written in C# expression syntax. The same specification written in Visual Basic is shown in Figure 2.rnSuch a language-agnostic approach has numerous advantages:rn1. The developer need not learn a new language for writing specifications. Predicates are boolean conditions expressed in the source language.rn2. No new front-ends or compilers need to be written or used. The original language compilers are used to compile the contractsrninto .NET intermediate language (MSIL). As a side-effect, the compilers check the syntax and types, thus avoiding errors in specifications, such as unresolved names etc, that would arise if the specifications were written in comments or attributes.rn3. The source language development environment helps writing specifications in that it provides all the features to specification writing it already provides for code writing such as highlighting, intellisense, completion, etc.rn4. The generated intermediate code for the conditions has a fixed interpretation provided by MSIL. No new semantics for the specifications needs to be defined. Furthermore, the compiled code acts as a persisted format of specifications consumable by a variety of tools.rnThe language independence extends from the specification language to the verification tool itself since the verification is performed on the generated MSIL rather than on the source.rnDue to our target audience, it is also important that the static verification is highly automated. In particular, we wish to avoid the need for programmer written loop invariants whenever possible. As a result, rather than building our verifier on standard techniques such as proof obligation generation discharged by an SMT solver, our verifier is based on abstract interpretation. It thus computes loop invariants and strongest postconditions automatically for a variety of abstract domains.rnAlthough we use modular verification that in principle requires specifications at all method boundaries, we use techniques to infer pre- and postconditions whenever possible.
机译:在过去的几年中,我们一直在努力为基于Microsoft .NET平台的编程语言带来简单实用的程序规范和验证。在本演讲中,我将讨论影响我们设计的动机和取舍。规范和静态验证针对的是一般开发人员,而不是验证爱好者。因此,对于我们而言,使用满足三个同时目标的单一规范形式很重要:rn1。规格作为文档。它们必须尽可能可读。规范应该是可执行的。这可以激发编写测试规范并立即获得预期收益,而无需考虑静态验证。规范应可用于静态验证。我们的规范方法与语言无关,因为我们使用以开发人员的源语言编写的惯用代码来表达前提条件和后置条件。前提条件和后置条件表示为对静态方法Contract的调用。要求和合同。确保。特殊的伪方法用于引用方法结果值以及表达式的旧值,这表示方法条目中表达式的值。图1中示例中的条件用C#表达式语法编写。图2显示了用Visual Basic编写的相同规范。rn这种与语言无关的方法具有许多优点:rn1。开发人员无需学习用于编写规范的新语言。谓词是用源语言表示的布尔条件。无需编写或使用新的前端或编译器。原始语言编译器用于将合同编译为.NET中间语言(MSIL)。副作用是,编译器检查语法和类型,从而避免了规范中的错误(例如,未解析的名称等),如果将规范写在注释或属性中会引起错误。源语言开发环境可以帮助编写规范,因为它为规范编写提供了所有功能,而规范编写已经为代码编写提供了规范,例如突出显示,智能,完成等。为条件生成的中间代码具有MSIL提供的固定解释。无需为规范定义新的语义。此外,编译后的代码可作为各种工具消耗的规范的持久格式.rn语言的独立性从规范语言扩展到验证工具本身,因为验证是在生成的MSIL而非源上执行的.rn目标受众,静态验证高度自动化也很重要。特别是,我们希望尽可能避免程序员编写循环不变式。因此,我们的验证程序不是基于SMT求解程序所产生的证明义务生成之类的标准技术,而是基于抽象解释。因此,它可以为各种抽象域自动计算循环不变式和最强后置条件。尽管我们使用原则上要求在所有方法边界都指定规格的模块化验证,但在可能的情况下,我们使用技术来推断前置条件和后置条件。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号