Abstract
The third list-homomorphism theorem states that if a function is both foldr and foldl, it has a divide-and-conquer parallel implementation as well. In this paper, we develop a theory for obtaining such parallelization theorems. The key is a new proof of the third list-homomorphism theorem based on shortcut deforestation. The proof implies that there exists a divide-and-conquer parallel program of the form of h(x 'merge' y) = h1 x odot h2 y, where h is the subject of parallelization, merge is the operation of integrating independent substructures, h1 and h2 are computations applied to substructures, possibly in parallel, and odot merges the results calculated for substructures, if (i) h can be specified by two certain forms of iterative programs, and (ii) merge can be implemented by a function of a certain polymorphic type. Therefore, when requirement (ii) is fulfilled, h has a divide-and-conquer implementation if h has two certain forms of implementations. We show that our approach is applicable to structure-consuming operations by catamorphisms (folds), structure-generating operations by anamorphisms (unfolds), and their generalizations called hylomorphisms.
- R. S. Bird and S. A. Curtis. Functional pearls: Finding celebrities: A lesson in functional programming. J. Funct. Program., 16(1):13--20, 2006. Google Scholar
Digital Library
- R. S. Bird and O. de Moor. Algebra of Programming. Prentice Hall, 1997. Google Scholar
Digital Library
- Y.-Y. Chi and S.-C. Mu. Constructing list homomorphisms from proofs. In Programming Languages and Systems - 9th Asian Symposium, APLAS 2011, Proceedings, volume 7078 of Lecture Notes in Computer Science, pages 74--88. Springer, 2011. Google Scholar
Digital Library
- W.-N. Chin, A. Takano, and Z. Hu. Parallelization via context preservation. In Proceedings of the 1998 International Conference on Computer Languages, ICCL '98, pages 153--162. IEEE, 1998. Google Scholar
Digital Library
- O. Chitil. Type inference builds a short cut to deforestation. In Proceedings of the 4th ACM SIGPLAN International Conference on Functional Programming, ICFP'99, pages 249--260. ACM, 1999. Google Scholar
Digital Library
- M. M. Fokkinga. Tupling and mutumorphisms. Squiggolist, 1(4), 1989.Google Scholar
- A. Geser and S. Gorlatch. Parallelizing functional programs by generalization. J. Funct. Program., 9(6):649--673, 1999. Google Scholar
Digital Library
- N. Ghani and P. Johann. Monadic augment and generalised short cut fusion. J. Funct. Program., 17(6):731--776, 2007. Google Scholar
Digital Library
- J. Gibbons. The third homomorphism theorem. J. Funct. Program., 6(4): 657--665, 1996.Google Scholar
Cross Ref
- J. Gibbons, Computing downwards accumulations on trees quickly. Theor. Comput. Sci., 169(1):67--80, 1996. Google Scholar
Digital Library
- J. Gibbons, G. Hutton, and T. Altenkirch. When is a function a fold or an unfold? Electr. Notes Theor. Comput. Sci., 44(1):146--160, 2001.Google Scholar
Cross Ref
- A. Gill. Cheap Deforestation for Non-strict Functional Languages. PhD thesis, Department of Computing Science, Glasgow University, 1996.Google Scholar
- A. Gill, J. Launchbury, and S. Peyton Jones. A short cut to deforestation. In FPCA'93 Conference on Functional Programming Languages and Computer Architecture, pages 223--232. ACM, 1993. Google Scholar
Digital Library
- S. Gorlatch. Extracting and implementing list homomorphisms in parallel program development. Sci. Comput. Program., 33(1):1--27, 1999. Google Scholar
Digital Library
- R. Hinze. Adjoint folds and unfolds--an extended study. Sci. Comput. Program., 2013. In Press. Google Scholar
Digital Library
- Z. Hu, H. Iwasaki, and M. Takechi. Formal derivation of efficient parallel programs by construction of list homomorphisms. ACMTrans. Program. Lang. Syst., 3(19):444--461, 1997. Google Scholar
Digital Library
- Z. Hu, M. Takeichi, and W.-N. Chin. Parallelization in calculational forms. In POPL '98: Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 316--328. ACM, 1998. Google Scholar
Digital Library
- G. P. Huet. The zipper. J. Funct. Program., 7(5):549--554, 1997. Google Scholar
Digital Library
- P. Johann. A generalization of short-cut fusion and its correctness proof. Higher-Order and Symbolic Computation, 15(4):273--300, 2002. Google Scholar
Digital Library
- S. Katsumata and S. Nishimura. Algebraic fusion of functions with an accumulating parameter and its improvement. J. Funct. Program., 18 (5-6):781--819, 2008. Google Scholar
Digital Library
- G. Keller and M. M. T. Chakravarty. Flattening trees. Euro-Par '98 Parallel Processing, 4th International Euro-Par Conference, Proceedings, volume 1470 of Lecture Notes in Computer Science, pages 709--719. Springer, 1998. Google Scholar
Digital Library
- J. Launchbury and T. Sheard. Warm fusion: Deriving build-catas from recursive definitions. In Conference Record of FPCA'95 SIGPLANSIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture, pages 314--323. ACM, 1995. Google Scholar
Digital Library
- Y. Liu, Z. Hu, and K. Matsuzaki. Towards systematic parallel programming over MapReduce. In Parallel Processing - 17th International Conference, Euro-Par 2011, Proceedings, Part II, volume 6853 of Lecture Notes in Computer Science, pages 39--50. Springer, 2011. Google Scholar
Digital Library
- G. Malcolm. Data structures and program transformation. Sci. Comput. Program., 14(2-3):255--279, 1990. Google Scholar
Digital Library
- K. Matsuzaki, Z. Hu, and M. Takeichi. Towards automatic parallelization of tree reductions in dynamic programming. In SPAA 2006: Proceedings of the 18th Annual ACM Symposium on Parallel Algorithms and Architectures, pages 39--48. ACM, 2006. Google Scholar
Digital Library
- E. Meijer, M. M. Fokkinga, and R. Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In Functional Programming Languages and Computer Architecture, 5th ACM Conference, Proceedings, volume 523 of Lecture Notes in Computer Science, pages 124--144. Springer, 1991. Google Scholar
Digital Library
- J. Misra. Powerlist: A structure for parallel recursion. ACM Trans. Program. Lang. Syst., 16(6):1737--1767, 1994. Google Scholar
Digital Library
- A. Morihata and K. Matsuzaki. Automatic parallelization of recursive functions using quantifier elimination. In Functional and Logic Programming, 10th International Symposium, FLOPS 2010, Proceedings, volume 6009 of Lecture Notes in Computer Science, pages 321--336. Springer, 2010. Google Scholar
Digital Library
- A. Morihata, K. Matsuzaki, Z. Hu, and M. Takeichi. The third homomorphism theorem on trees: Downward & upward lead to divide-andconquer. In Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2009, pages 177--185. ACM, 2009. Google Scholar
Digital Library
- K. Morita, A. Morihata, K. Matsuzaki, Z. Hu, and M. Takeichi. Automatic inversion generates divide-and-conquer parallel programs. In Proceedings of the ACM SIGPLAN 2007 Conference on Programming Language Design and Implementation, pages 146--155. ACM, 2007. Google Scholar
Digital Library
- S.-C. Mu and A. Morihata. Generalising and dualising the third listhomomorphism theorem: functional pearl. In Proceeding of the 16th ACM SIGPLAN International Conference on Functional Programming, ICFP 2011, pages 385--391. ACM, 2011. Google Scholar
Digital Library
- J. H. Reif, editor. Synthesis of Parallel Algorithms. Morgan Kaufmann Publishers, 1993. Google Scholar
Digital Library
- J. C. Reynolds. Types, abstraction and parametric polymorphism. Information Processing, 83:513--523, 1983.Google Scholar
- J. Svenningsson. Shortcut fusion for accumulating parameters & zip-like functions. In Proceedings of the 7th ACM SIGPLAN International Conference on Functional programming, ICFP'02, pages 124--132. ACM, 2002. Google Scholar
Digital Library
- A. Takano and E. Meijer. Shortcut deforestation in calculational form. In Conference Record of FPCA'95 SIGPLAN-SIGARCH-WG2.8 Conference on Functional Programming Languages and Computer Architecture, pages 306--313. ACM, 1995. Google Scholar
Digital Library
- P. Wadler. Deforestation: Transforming programs to eliminate trees. In ESOP'88, 2nd European Symposium on Programming, Proceedings, volume 300 of Lecture Notes in Computer Science, pages 344--358. Springer, 1988. Google Scholar
Digital Library
- P. Wadler. Theorems for free! In FPCA'89 Conference on Functional Programming Languages and Computer Architecture, pages 347--359. ACM, 1989. Google Scholar
Digital Library
- D. N. Xu, S.-C. Khoo, and Z. Hu. PType system: A featherweight parallelizability detector. In Programming Languages and Systems: Second Asian Symposium, APLAS 2004, Proceedings, volume 3302 of Lecture Notes in Computer Science, pages 197--212. Springer, 2004.Google Scholar
Cross Ref
- T. Yokoyama, Z. Hu, and M. Takeichi. Calculation rules for warming-up in fusion transformation. In On-line Pre-Review Processings of the Sixth Symposium on Trends in Functional Programming, TFP 2005, pages 399--412, 2005.Google Scholar
Index Terms
A short cut to parallelization theorems
Recommendations
A short cut to parallelization theorems
ICFP '13: Proceedings of the 18th ACM SIGPLAN international conference on Functional programmingThe third list-homomorphism theorem states that if a function is both foldr and foldl, it has a divide-and-conquer parallel implementation as well. In this paper, we develop a theory for obtaining such parallelization theorems. The key is a new proof of ...
Topological equivalences of $$\mathbf {CUT}$$CUT and $$\mathbf {CUT(Fin)}$$CUT(Fin)
In this note, two well-known topological facts regarding cofinite and cocountable-like topologies over uncountable sets are shown to be equivalent either to the Countable Union Theorem or to the Countable Union Theorem for countable families of finite ...
Reverse mathematics and order theoretic fixed point theorems
The theory of countable partially ordered sets (posets) is developed within a weak subsystem of second order arithmetic. We within $$\mathsf {RCA_0}$$RCA0 give definitions of notions of the countable order theory and present some statements of countable ...







Comments