Bounded verification has proved useful to detect bugs and to increase confidence in the correctness of a program. In contrast to unbounded verification, reasoning about calls via (bounded) inlining and about loops via (bounded) unrolling does not require method specifications and loop invariants and, therefore, reduces the annotation overhead to the bare minimum, namely specifications of the properties to be verified. For verifiers based on traditional program logics, verification via inlining (and unrolling) is verification-preserving: successful unbounded verification of a program w.r.t. some annotation implies successful verification of the inlined program. That is, any error detected in the inlined program reveals a true error in the original program. However, this essential property might not hold for automatic separation logic verifiers such as Caper, GRASShopper, RefinedC, Steel, VeriFast, and verifiers based on Viper. In this setting, inlining generally changes the resources owned by method executions, which may affect automatic proof search algorithms and introduce spurious errors. In this paper, we present the first technique for verification-preserving inlining in automatic separation logic verifiers. We identify a semantic condition on programs and prove in Isabelle/HOL that it ensures verification-preserving inlining for state-of-the-art automatic separation logic verifiers. We also prove a dual result: successful verification of the inlined program ensures that there are method and loop annotations that enable the verification of the original program for bounded executions. To check our semantic condition automatically, we present two approximations that can be checked syntactically and with a program verifier, respectively. We implemented these checks in Viper and demonstrate that they are effective for non-trivial examples from different verifiers.
翻译:运行良好的核查证明有助于检测错误和增强对程序正确性的信心。 与未设限的核查相反,通过( 设限的) 内衬内衬和通过( 设限的) 滚动中环进行呼叫的推理并不要求方法规格和循环变异性,因此,可以将自动分离逻辑验证员的注解降低到最起码的规格,即要核查的属性的规格。 对于基于传统程序逻辑的核查员来说,通过内衬( 开动) ( 和开动) 进行的核查是保存核查: 对程序 w.r. t. 进行成功的无限制的核查。 一些说明意味着对内嵌程序进行成功的核查。 也就是说, 内嵌程序中发现的任何错误都显示原始程序的真正错误。 在自动分离逻辑校验中, 我们的逻辑校验程序可以证明, 以维珀尔为根据的校验程序。 在这种结果中, 我们的逻辑的逻辑校验程序也可以在双向的校定程序中证明, 我们的校验程序可以用一个自动的校正程序。