Abstract
The well-known third list homomorphism theorem states that if a function h is both an instance of foldr and foldl, it is a list homomorphism. Plenty of previous works devoted to constructing list homomorphisms, however, overlook the fact that proving h is both a foldr and a foldl is often the hardest part which, once done, already provides a useful hint about what the resulting list homomorphism could be. In this paper we propose a new approach: to construct a possible candidate of the associative operator and, at the same time, to transform a proof that h is both a foldr and a foldl to a proof that h is a list homomorphism. The effort constructing the proof is thus not wasted, and the resulting program is guaranteed to be correct.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Bird, R.S.: An introduction to the theory of lists. In: Broy, M. (ed.) Logic of Programming and Calculi of Discrete Design. NATO ASI Series F, vol. 36, pp. 3–42. Springer, Heidelberg (1987)
Bird, R.S.: Introduction to Functional Programming using Haskell. Prentice-Hall (1998)
Bird, R.S., de Moor, O.: Algebra of Programming. International Series in Computer Science. Prentice-Hall (1997)
Cole, M.: Parallel programming, list homomorphisms and the maximum segment sum problems. Tech. Rep. CSR-25-93, Department of Computer Science, University of Edinburgh (1993)
Dijkstra, E.W.: The next fifty years. Tech. Rep. EWD1243, Eindhoven University of Technology (2004)
Geser, A., Gorlatch, S.: Parallelizing functional programs by generalization. Journal of Functional Programming 9(6), 649–673 (1999)
Gibbons, J.: The third homomorphism theorem. Journal of Functional Programming 6(4), 657–665 (1996)
Hu, Z., Iwasaki, H., Takeichi, M.: Construction of List Homomorphisms Via Tupling and Fusion. In: Penczek, W., Szałas, A. (eds.) MFCS 1996. LNCS, vol. 1113, pp. 407–418. Springer, Heidelberg (1996)
Morihata, A., Matsuzaki, K., Hu, Z., Takeichi, M.: The third homomorphism theorem on trees: downward & upward lead to divide-and-conquer. In: Shao, Z., Pierce, B.C. (eds.) Symposium on Principles of Programming Languages, pp. 177–185. ACM Press, Savannah (2009)
Morita, K., Morihata, A., Matsuzaki, K., Hu, Z., Takeichi, M.: Automatic inversion generates divide-and-conquer parallel programs. In: Ferrante, J., McKinley, K.S. (eds.) Programming Language Design and Implementation, pp. 146–155. ACM Press (2007)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chi, YY., Mu, SC. (2011). Constructing List Homomorphisms from Proofs. In: Yang, H. (eds) Programming Languages and Systems. APLAS 2011. Lecture Notes in Computer Science, vol 7078. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-25318-8_9
Download citation
DOI: https://doi.org/10.1007/978-3-642-25318-8_9
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-25317-1
Online ISBN: 978-3-642-25318-8
eBook Packages: Computer ScienceComputer Science (R0)