Abstract

Department of Computing Science, R~iksuniversiteit Groningen, P.O. Box 800, 9700 d V Groningen, Netherlands Communicated by J. Misra Received 4 January 1991 Keywords: Program correctness, program derivation, proof rules, refinement, repetition Introduction The purpose of this note is to discuss the meaning of repetitions in an imperative programming language with nondeterminacy, and to present some results and examples that are not widely known. We begin with a new form for well-known material. 1. The proof nile for total correctness Imperative languages are characterised by' commands with effect on the state of memory. This effect is described by means of a so-called Hoare triple, that is a judgement of the form {P) S {S). We take this triple to express that if command S is given in a state that satisfies P, then execution of S terminates in a state that satisfies Q. So, for us, a Hoare triple indicates total correcmess. We consider repetitions of the form L: 'while B do S od. We propose to use the following correctness rule for repetition L: (0) Rule. If J is a predicate and of is an integer-valaed state function with, for all integer values n, {JABAof=n} S {JAn>~OAvf I 0 in the posteondition, so that the usual bounding condition [J A B =~ of>_. 0] can be omitted. It is a kind of coding trick, which enables us to present a repetition together with the proof as a single annotated program. Compare [1, Chapter

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.