English

Operational Annotations: A new method for sequential program verification

Software Engineering 2022-01-20 v3

Abstract

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}\{f\}\{P\}\{g\}: if execution is started in any of the states that satisfy assertion ff, then, upon termination, the resulting state will be some state that satisfies assertion gg. There are of course other ways to specify a set of states. I propose to replace assertions by terminating programs: a program AA specifies a set of states as follows: we start AA in any state whatsoever, and all the states that AA may terminate in constitute the specified set. I call this set the post-states of AA. I introduce the operational triple [A]P[B][A]\, P\, [B] to mean: if execution of PP is started in any post-state of AA, then upon termination, the resulting state will be some post-state of BB. Here, AA is the pre-program, and plays the role of a pre-condition, and BB is the post-program, and plays the role of a post-condition.

Keywords

Cite

@article{arxiv.2102.06727,
  title  = {Operational Annotations: A new method for sequential program verification},
  author = {Paul C Attie},
  journal= {arXiv preprint arXiv:2102.06727},
  year   = {2022}
}

Comments

23 pages, one table