Advertisement

NewSpeak: a reliable programming language

  • I. F. Currie
Part of the Software Science and Engineering book series (SSEN)

Abstract

Consider the following fragment of Pascal program for evaluating factorials:
$$ \begin{array}{*{20}c} {i: = 0;x: = 1;} \\ {while\;i < n} \\ \begin{gathered} begin\;i: = i + 1 \hfill \\ x:i*x \hfill \\ \end{gathered} \\ {end} \\ \end{array} $$
One could prove that this program does indeed implement n! by the following reasoning. A useful invariant of the while-statement is x=i!. This is trivially proved by observing that x= 1 =0! initially and applying induction on i. Provided n is a positive integer, the loop will terminate with i = n and hence the final value of x is n!. This proof could be formalized and even produced automatically by any one of a variety of program-proving systems.

Keywords

Actual Parameter Floating Point Float Point Number Concrete Syntax Proof Rule 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Reference

  1. [Cullyer 1987]
    Cullyer J., “Implementing safety-critical systems: the Viper microprocessor”, Proc. Hardware Verification Workshop, University of Calgary (Jan. 1987).Google Scholar

Copyright information

© Crown Copyright 1989

Authors and Affiliations

  • I. F. Currie
    • 1
  1. 1.Royal Signals and Radar EstablishmentUK

Personalised recommendations