Using Computer Algebra techniques for the specification, verification and synthesis of recursive programs

  • Authors:
  • Nikolaj Popov;Tudor Jebelean

  • Affiliations:
  • Research Institute for Symbolic Computation, Johannes Kepler University, Linz, Austria;Research Institute for Symbolic Computation, Johannes Kepler University, Linz, Austria

  • Venue:
  • Mathematics and Computers in Simulation
  • Year:
  • 2009

Quantified Score

Hi-index 0.00

Visualization

Abstract

We describe an innovative method for proving total correctness of tail recursive programs having a specific structure, namely programs in which an auxiliary tail recursive function is driven by a main nonrecursive function, and only the specification of the main function is provided. The specification of the auxiliary function is obtained almost fully automatically by solving coupled linear recursive sequences with constant coefficients. The process is carried out by means of CA (Computer Algebra) and AC (Algorithmic Combinatorics) and is implemented in the Theorema system (using Mathematica). We demonstrate this method on an example involving polynomial expressions. Furthermore, we develop a method for synthesis of recursive programs for computing polynomial expressions of a fixed degree by means of ''cheap'' operations, e.g., additions, subtractions and multiplications. For a given polynomial expression, we define its recursive program in a schemewise manner. The correctness of the synthesized programs follows from the general correctness of the synthesis method, which is proven once for all, using the verification method presented in the first part of this paper.