TY - GEN
T1 - Swapping arguments and results of recursive functions
AU - Morihata, Akimasa
AU - Kakehi, Kazuhiko
AU - Hu, Zhenjiang
AU - Takeichi, Masato
PY - 2006/1/1
Y1 - 2006/1/1
N2 - Many useful calculation rules, such as fusion and tupling, rely on well-structured functions, especially in terms of inputs and outputs. For instance, fusion requires that well-produced outputs should be connected to well-consumed inputs, so that unnecessary intermediate data structures can be eliminated. These calculation rules generally fail to work unless functions are well-structured. In this paper, we propose a new calculation rule called 10 swapping. IO swapping exchanges call-time computations (occurring in the arguments) and return-time computations (occurring in the results) of a function, while guaranteeing that the original and resulting function compute the same value. IO swapping enables us to rearrange inputs and outputs so that the existing calculation rules can be applied. We present new systematic derivations of efficient programs for detecting palindromes, and a method of higher-order removal that can be applied to defunctionalize function arguments, as two concrete applications.
AB - Many useful calculation rules, such as fusion and tupling, rely on well-structured functions, especially in terms of inputs and outputs. For instance, fusion requires that well-produced outputs should be connected to well-consumed inputs, so that unnecessary intermediate data structures can be eliminated. These calculation rules generally fail to work unless functions are well-structured. In this paper, we propose a new calculation rule called 10 swapping. IO swapping exchanges call-time computations (occurring in the arguments) and return-time computations (occurring in the results) of a function, while guaranteeing that the original and resulting function compute the same value. IO swapping enables us to rearrange inputs and outputs so that the existing calculation rules can be applied. We present new systematic derivations of efficient programs for detecting palindromes, and a method of higher-order removal that can be applied to defunctionalize function arguments, as two concrete applications.
UR - http://www.scopus.com/inward/record.url?scp=33746074095&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=33746074095&partnerID=8YFLogxK
U2 - 10.1007/11783596_22
DO - 10.1007/11783596_22
M3 - Conference contribution
AN - SCOPUS:33746074095
SN - 3540356312
SN - 9783540356318
T3 - Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
SP - 379
EP - 396
BT - Mathematics of Program Construction - 8th International Conference, MPC 2006, Proceedings
PB - Springer-Verlag
T2 - 8th International Conference on Mathematics of Program Construction, MPC 2006
Y2 - 3 July 2006 through 5 July 2006
ER -