@INPROCEEDINGS{Hanus19PADL, author = "Hanus, M.", title = "Improving Residuation in Declarative Programs", year = "2019", pages = "82-97", booktitle = "Proc. of the 21st International Symposium on Practical Aspects of Declarative Languages (PADL 2019)", publisher = {Springer LNCS 11372}, abstract = { 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. } }