Specifying and Verifying a Transformation of Recursive Functions into Tail-Recursive Functions

Abstract: 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.

Saved in:
Bibliographic Details
Main Authors: Suárez Polo,Axel, Lavalle Martínez,José de Jesús, Molina Rebolledo,Iván
Format: Digital revista
Language:English
Published: Instituto Politécnico Nacional, Centro de Investigación en Computación 2023
Online Access:http://www.scielo.org.mx/scielo.php?script=sci_arttext&pid=S1405-55462023000100333
Tags: Add Tag
No Tags, Be the first to tag this record!