Have a personal or library account? Click to login
Partial Correctness of a Power Algorithm Cover

Partial Correctness of a Power Algorithm

By: Adrian Jaszczak  
Open Access
|Jul 2019

Abstract

This work continues a formal verification of algorithms written in terms of simple-named complex-valued nominative data [6],[8],[15],[11],[12],[13]. In this paper we present a formalization in the Mizar system [3],[1] of the partial correctness of the algorithm:

i := val.1 j := val.2 b := val.3 n := val.4 s := val.5 while (i <> n) i := i + j s := s * b return s

computing the natural n power of given complex number b, where variables i, b, n, s are located as values of a V-valued Function, loc, as: loc/.1 = i, loc/.3 = b, loc/.4 = n and loc/.5 = s, and the constant 1 is located in the location loc/.2 = j (set V represents simple names of considered nominative data [17]).

The validity of the algorithm is presented in terms of semantic Floyd-Hoare triples over such data [9]. Proofs of the correctness are based on an inference system for an extended Floyd-Hoare logic [2],[4] with partial pre- and post-conditions [14],[16],[7],[5].

DOI: https://doi.org/10.2478/forma-2019-0018 | Journal eISSN: 1898-9934 | Journal ISSN: 1426-2630
Language: English
Page range: 189 - 195
Accepted on: May 27, 2019
Published on: Jul 20, 2019
Published by: University of Białystok
In partnership with: Paradigm Publishing Services
Publication frequency: 1 issue per year

© 2019 Adrian Jaszczak, published by University of Białystok
This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 License.