Partial Evaluation of the Euclidian Algorithm (Extended Version)
DOI:
https://doi.org/10.7146/brics.v4i1.18780Resumé
Some programs are easily amenable to partial evaluation becausetheir control flow clearly depends on one of their parameters. Specializing
such programs with respect to this parameter eliminates the
associated interpretive overhead. Some other programs, however, do
not exhibit this interpreter-like behavior. Each of them presents a challenge
for partial evaluation. The Euclidian algorithm is one of them,
and in this article, we make it amenable to partial evaluation.
We observe that the number of iterations in the Euclidian algorithm
is bounded by a number that can be computed given either of the two
arguments. We thus rephrase this algorithm using bounded recursion.
The resulting program is better suited for automatic unfolding and
thus for partial evaluation. Its specialization is efficient.
Keywords: partial evaluation, scientific computation.
Downloads
Publiceret
1997-01-01
Citation/Eksport
Danvy, O., & Goldberg, M. (1997). Partial Evaluation of the Euclidian Algorithm (Extended Version). BRICS Report Series, 4(1). https://doi.org/10.7146/brics.v4i1.18780
Nummer
Sektion
Artikler
Licens
Authors who publish with this journal agree to the following terms:- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).