Improving Residuation in Declarative Programs

by Michael Hanus

Long version of a paper appeared in Proc. of the 21st International Symposium on Practical Aspects of Declarative Languages (PADL 2019), Springer LNCS 11372, pp. 82-97, 2019

Residuation is an operational principle to evaluate functions in logic-oriented languages. Residuation delays function calls until the arguments are sufficiently instantiated in order to evaluate the function deterministically. It has been proposed as an alternative to the non-deterministic narrowing principle and is useful to connect externally defined operations. Residuation can be implemented in Prolog systems supporting coroutining, but this comes with a price: the coroutining mechanism causes a considerable overhead even if it is not used. To overcome this dilemma, we propose a compile-time analysis which approximates the run-time residuation behavior. Based on the results of this analysis, we improve an existing implementation of residuation and evaluate the potential efficiency gains by a number of benchmarks.

Preprint (PDF) BibTeX-Entry Online