Abstract
The aim of the Platform-Independent Approach to Formal Specification and Verification of Standard Mathematical Functions project is the development of an incremental combined approach to specification and verification of standard mathematical functions like sqrt, cos, sin, etc. The term “platform-independence” means that we attempt to design a relatively simple axiomatization of computer arithmetic in terms of real arithmetic (i.e., the arithmetic of the field ℝ of real numbers), but do not specify either the base of the computer arithmetic or the format of the representation of numbers. The incrementality means that we start with the most straightforward specification of the simplest algorithm in real numbers and finish with a realistic specification and a verification of the algorithm in computer arithmetic. We call our approach combined because we start with consideration of a “basic” case, the manual (pen-and-paper) verification of the algorithm in real numbers, then use this verification as proof-outlines for the manual verification of the algorithm in computer arithmetic, and finish with a computer-aided validation of the manual proofs with a proof-assistant system to avoid appeals to “obviousness” that are common in human-carried proofs. In the paper, we apply our platform-independent incremental combined approach to specification and verification of the standard mathematical square root function. By now, the computer-aided validation of the developed algorithms has been carried out only partially to prove, using the ACL2 system, the correctness (consistency) of our fixed-point arithmetic and the existence of a look-up table with the initial approximations of the square roots for fixed-point numbers.
Similar content being viewed by others
Notes
Here and below, \(\lambda \,\,z \in \mathbb{R}.\left\lceil z \right\rceil \) is the rounding up to the nearest integer.
REFERENCES
Kuliamin, V.V., Standardization and testing of implementations of mathematical functions in floating point numbers, Program. Comput. Software, 2007, vol. 33, no. 3, pp. 154–173.
Nikitin, V.F., A variant for calculating the square root (Newton’s algorithm). http://algolist.manual.ru/ maths/count_fast/sqrt.php.
Shelekhov, V.I., Verification and synthesis of effective programs of standard functions floor, isqrt, and ilog2 in predicate programming technology, Problemy upravleniya i modelirovaniya v slozhnykh sistemakh, Trudy 12-i mezhd. konf. (Problems of Control and Modeling in Complex Systems, Proc. 12th Int. Conf.), Samara, 2010, pp. 622–630.
Ayad, A. and Marché, C., Multi-prover verification of floating-point programs, Perspectives of System Informatics. PSI 2014; Lect. Notes Artif. Intell., 2010, vol. 6173, pp. 127–141.
Barret, G., Formal methods applied to a floating-point number system, IEEE Trans. Software Eng., 1989, vol. 15, no. 5, pp. 611–621.
Brain, M., et al., An automatable formal semantics for IEEE-754 floating-point arithmetic, Computer Arithmetic (ARITH ‘15), Proc. of the 2015 IEEE 22nd Symposium (IEEE Computer Society), 2015, pp. 160–167.
El-Magdoub, M.H., Best Square Root Method–Algorithm–Function (Precision VS Speed). https://www. codeproject.com/Articles/69941/Best-Square-Root-Method-Algorithm-Function-Precisi.
Ferguson, W.E., et al., Digit serial methods with applications to division and square root (with mechanically checked correctness proofs), arXiv: arXiv:1708.00140, 2017, pp. 102–114.
Gamboa, R.A., Square Roots in Acl2: A Study in Sonata Form, Technical Report, University of Texas at Austin, 1997.
Gries, D., The Science of Programming, New York: Springer-Verlag, 1981.
Grohoski, G., Verifying Oracle’s SPARC processors with ACL2 (slides of the invited talk), The ACL2 Theorem Prover and Its Applications, Proc. Int. Workshop, 2017. http://www.cs.utexas.edu/users/moore/acl2/workshop-2017/slides-accepted/grohoski-ACL2_talk.pdf.
Gutowski, M.W., Power and beauty of interval methods, arXiv: arXiv:physics/0302034.
Harrison, J., A machine-checked theory of floating point arithmetic, Lect. Notes Comput. Sci., 1999, vol. 1690, pp. 113–130.
Harrison, J., Formal verification of floating point trigonometric functions, Lect. Notes Comput. Sci., 2000, vol. 1954, pp. 217–251.
Harrison, J., Formal verification of IA-64 division algorithms, Lect. Notes Comput. Sci., 2000, vol. 1869, pp. 233–251.
Harrison, J., Floating point verification in HOL light: The exponential function, Formal Methods Syst. Des., 2000, vol. 16, no. 3, pp. 271–305.
Harrison, J., Formal verification of square root algorithms, Formal Methods Syst. Des., 2003, vol. 22, no. 2, pp. 143–153.
Hoare, C.A.R., The verifying compiler: A grand challenge for computing research, Lect. Notes Comput. Sci., 2003, vol. 2890, pp. 1–12.
Kuliamin, V.V., Standardization and testing of mathematical functions in floating point numbers, Lect. Notes Comput. Sci., 2010, vol. 5947, pp. 257–268.
Monniaux, D., The pitfalls of verifying floating-point computations, ACM Trans. Program. Languages Syst., 2008, vol. 30, no. 3, pp. 1–41.
Muller, J.-M., Elementary Functions: Algorithms and Implementation, Birkhäuser, 2005.
Muller, J.-M., et al., Handbook of Floating-Point Arithmetic, Birkhäuser, 2018, 2nd ed.
Sawada, J. and Gamboa, R., Mechanical verification of a square root algorithm using Taylor’s theorem, Lect. Notes Comput. Sci., 2002, vol. 2517, pp. 274–291.
Shilov, N.V., On the need to specify and verify standard functions, Bull. Novosib. Comput. Center (Ser.: Comput. Sci.), 2015, vol. 38, pp. 105–119.
Shilov, N.V. and Promsky, A.V., On specification and verification of standard mathematical functions, Humanit. Sci. Univ. J., 2016, vol. 19, pp. 57–68.
Shilov, N.V., et al., Towards platform-independent verification of the standard mathematical functions: The square root function, arXiv: arXiv:abs/1801.00969.
Siddique, U. and Hasan, O., On the formalization of gamma function in HOL, J. Autom. Reason., 2014, vol. 53, no. 4, pp. 407–429.
C reference. Sqrt, sqrtf, sqrtl. http://en.cppreference.com/w/c/numeric/math/sqrt.
IEEE 754-2008. http://ieeexplore.ieee.org/document/4610935.
ISO/IEC/IEEE 60559:2011. Information Technology – Microprocessor Systems – Floating-Point arithmetic. http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=57469.
nth root algorithm. https://en.wikipedia.org/wiki/Nth_root_algorithm.
Roskosmos named reason for failured launch from space center Vostochny. https://www.rbc.ru/politics/ 12/12/2017/5a2ebcd59a79479d29667115.
ACKNOWLEDGMENTS
The authors are grateful to D.Yu. Nadezhin for the very helpful consultations on ACL2 proof-assistant system and participation in discussing the content of preprint [26].
Funding
This work was supported by the Russian Foundation for Basic Research, project no. 17-01-00789.
Author information
Authors and Affiliations
Corresponding authors
Ethics declarations
The authors declare that they have no conflicts of interest.
Additional information
Translated by O. Lotova
About this article
Cite this article
Shilov, N.V., Kondratyev, D.A., Anureev, I.S. et al. Platform-Independent Specification and Verification of the Standard Mathematical Square Root Function. Aut. Control Comp. Sci. 53, 595–616 (2019). https://doi.org/10.3103/S0146411619070186
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.3103/S0146411619070186