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

操作注解:一种新的顺序程序验证方法

Operational Annotations: A new method for sequential program verification

Paul C Attie

摘要:

我提出了一个新的方法来指定和验证顺序程序的部分正确性。关键的观察是,在霍尔逻辑中,断言被用作状态的选择器,也就是说,断言指定满足断言的程序状态集。因此,部分正确性Hoare三元组$\{f\}\{P\}\{g\}$的通常含义是:如果在满足断言$f$的任何状态中开始执行,则在终止时,结果状态将是满足断言$g$的某个状态。当然,还有其他方法来指定一组状态。我建议用终止程序来代替断言:程序$A$指定一组状态如下:我们以任何状态开始$A$,所有$A$可能终止的状态构成指定的集合。我将此集合称为$A$的后置状态。我介绍的操作三元组$[A]\, P\, [B]$的意思是:如果$P$的执行是在$A$的任何后状态中开始的,那么在终止时,结果状态将是$B$的某个后状态。这里,$A$是前程序,并且起前置条件的作用,而$B$是后程序,并且起后置条件的作用。

英文摘要:

I present a new method for specifying and verifying the partial correctness of sequential programs. The key observation is that, in Hoare logic, assertions are used as selectors of states, that is, an assertion specifies the set of program states that satisfy the assertion. Hence, the usual meaning of the partial correctness Hoare triple $\{f\}\{P\}\{g\}$: if execution is started in any of the states that satisfy assertion $f$, then, upon termination, the resulting state will be some state that satisfies assertion $g$. There are of course other ways to specify a set of states. I propose to replace assertions by terminating programs: a program $A$ specifies a set of states as follows: we start $A$ in any state whatsoever, and all the states that $A$ may terminate in constitute the specified set. I call this set the post-states of $A$. I introduce the operational triple $[A]\, P\, [B]$ to mean: if execution of $P$ is started in any post-state of $A$, then upon termination, the resulting state will be some post-state of $B$. Here, $A$ is the pre-program, and plays the role of a pre-condition, and $B$ is the post-program, and plays the role of a post-condition.

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

↑