arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1902.09685cs.PL
收藏

迭代组合静态验证的特质

Iteratively Composing Statically Verified Traits

Isaac Oscar Gariano, Marco Servetto, Alex Potanin, Hrshikesh Arora

摘要:

依赖于自动定理证明器的静态验证可能非常缓慢和脆弱:由于静态验证是不可判定的,正确的代码可能无法通过特定的静态验证器。在这项工作中,我们使用元编程生成的代码是正确的建设。定理证明器只用于验证初始“特征”:可以用来组成更大程序的代码单元。在我们的工作中,元编程是通过特征组合来完成的,从正确的代码开始,保证产生正确的代码。我们通过为方法扩展带有前置和后置条件的传统特征来做到这一点;我们还扩展了传统的特征组合(+)运算符来检查合同的兼容性。这样,就不需要重新验证生成的代码。我们展示了我们的方法可以应用于标准的“功率”函数的例子,元编程生成优化,正确的,版本时,指数是已知的。

英文摘要:

Static verification relying on an automated theorem prover can be very slow and brittle: since static verification is undecidable, correct code may not pass a particular static verifier. In this work we use metaprogramming to generate code that is correct by construction. A theorem prover is used only to verify initial "traits": units of code that can be used to compose bigger programs. In our work, meta-programming is done by trait composition, which starting from correct code, is guaranteed to produce correct code. We do this by extending conventional traits with pre- and post-conditions for the methods; we also extend the traditional trait composition (+) operator to check the compatibility of contracts. In this way, there is no need to re-verify the produced code. We show how our approach can be applied to the standard "power" function example, where metaprogramming generates optimised, and correct, versions when the exponent is known in advance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑