SciELO - Scientific Electronic Library Online

 
vol.27 issue1The Subalgebra Lattice of A Finite Diagonal–Free Two–Dimensional Cylindric Algebra author indexsubject indexsearch form
Home Pagealphabetic serial listing  

Services on Demand

Journal

Article

Indicators

Related links

  • Have no similar articlesSimilars in SciELO

Share


Computación y Sistemas

On-line version ISSN 2007-9737Print version ISSN 1405-5546

Abstract

SUAREZ POLO, Axel; LAVALLE MARTINEZ, José de Jesús  and  MOLINA REBOLLEDO, Iván. Specifying and Verifying a Transformation of Recursive Functions into Tail-Recursive Functions. Comp. y Sist. [online]. 2023, vol.27, n.1, pp.333-340.  Epub June 16, 2023. ISSN 2007-9737.  https://doi.org/10.13053/cys-27-1-4529.

It is well known that some recursive functions admit a tail recursive counterpart which have a more efficient time-complexity behavior. This paper presents a formal specification and verification of such process. A monoid is used to generate a recursive function and its tail-recursive counterpart. Also, the monoid properties are used to prove extensional equality of both functions. In order to achieve this goal, the Agda programming language and proof assistant is used to generate a parametrized module with a monoid, via dependent types. This technique is exemplified with the length, reverse, and indices functions over lists.

Keywords : Dependent types; formal specification and verification; tail recursion; accumulation; program transformation.

        · text in English     · English ( pdf )