## Parallelizing Functional Programs by Term Rewriting (1997)

Citations: | 2 - 2 self |

### BibTeX

@TECHREPORT{Geser97parallelizingfunctional,

author = {Alfons Geser and Sergei Gorlatch},

title = {Parallelizing Functional Programs by Term Rewriting},

institution = {},

year = {1997}

}

### OpenURL

### Abstract

List homomorphisms are functions that can be computed in parallel using the divide-and-conquer paradigm. We study the problem of finding a homomorphic representation of a given function, based on the Bird-Meertens theory of lists. A previous work proved that to each pair of leftward and rightward sequential representations of a function, based on cons- and snoc-lists, respectively, there is also a representation as a homomorphism. Our contribution is a mechanizable method to extract the homomorphism representation from a pair of sequential representations. The method is decomposed to a generalization problem and an inductive claim, both solvable by term rewriting techniques. To solve the former we present a sound generalization procedure which yields the required representation, and terminates under reasonable assumptions. We illustrate the method and the procedure by the parallelization of the scan-function (parallel prefix). The inductive claim is provable automatically. Keywords: P...

### Citations

1311 | Introduction to Functional Programming
- Bird, Wadler
- 1988
(Show Context)
Citation Context ...his paper addresses the problem of deriving correct parallel programs from functional specifications. It builds upon a rich body of research done in the framework of the Bird-Meertens formalism (BMF) =-=[1, 2]-=-. BMF comprises a collection of higher-order functions on arbitrary composite types (trees, arrays, etc.); expressions of the formalism are used for program specification. The program derivation proce... |

566 | Term rewriting systems
- Klop
- 1992
(Show Context)
Citation Context ...m rewriting to speak about a generalization calculus. 6 The Switch to Rewriting Next we describe our approach to generalization using term rewriting within the Bird-Meertens theory of lists. See Klop =-=[20]-=- for a good introductory text on term rewriting. To have a simple technical apparatus, we henceforth restrict ourselves to first-order terms whence we suppress higher order parameters, and consider a ... |

162 |
Solving equations in abstract algebras: a rule-based survey of unification
- Jouannaud, Kirchner
- 1991
(Show Context)
Citation Context ...the special-case relation forms a lattice, i.e. there are most general syntactic unifiers and most special syntactic generalizers. In contrast to unification, an intensively studied subject (see e.g. =-=[15]-=-), properties and methods for generalization for nonempty E are hardly known. A few generalization methods have been exercised for use in inductive theorem proving. As an intriguing example we mention... |

157 | Scan as a primitive parallel operation
- Blelloch
- 1989
(Show Context)
Citation Context ...length of the list, or sum, which, for a list of numbers, yields the sum of all its elements, and also functions that are more complicated and important in practice, such as, e.g., scan (prefix sums) =-=[8]-=-. An important property of homomorphisms is Bird's First Homomorphism Theorem [1]: Theorem 1 (Bird [1]) Function h is a homomorphism iff: h = red (fi ) ffi (map f) (2) where fi is from (1), and f (a) ... |

117 |
Canonical Equational Proofs
- Bachmair
- 1991
(Show Context)
Citation Context ...0 is called a conservative extension of R if every equation s $ t in the inductive theory of R 0 , where s and t are terms over the signature of R, is already in the inductive theory of R. See, e.g., =-=[21]-=- for an introduction to inductive theorem proving based on rewriting. Theorem 6 (Reliability) For every computed solution, t H , of the problem instance t B ; t C ; t S , and term rewriting systems de... |

69 |
Foundations of Parallel Programming
- Skillicorn
- 1994
(Show Context)
Citation Context ...his paper addresses the problem of deriving correct parallel programs from functional specifications. It builds upon a rich body of research done in the framework of the Bird-Meertens formalism (BMF) =-=[1, 2]-=-. BMF comprises a collection of higher-order functions on arbitrary composite types (trees, arrays, etc.); expressions of the formalism are used for program specification. The program derivation proce... |

55 |
Algorithmic skeletons: a structured approach to the management of parallel computation
- Cole
- 1988
(Show Context)
Citation Context ...tatic parallelization are proposed in [3, 4]. The class of homomorphic functions exemplify dataparallelism and enjoy a common way of parallelization, and thus can be viewed as an algorithmic skeleton =-=[5]-=-. To use homomorphisms in the practical parallel programming, two tasks must be solved: ffl Extraction: for a given function which is to be computed, find its representation as a homomorphism or adjus... |

27 | Systematic efficient parallelization of scan and other list homomorphisms
- Gorlatch
- 1996
(Show Context)
Citation Context ...plementing them on parallel architectures. For both tasks, we aim at a systematic approach which would lead to a practically relevant parallel programming methodology. Recent results are presented in =-=[3, 6, 7]. A system-=-atic extraction method, proposed in [7], proceeds by generalizing two sequential representations of the function: on the cons and snoc lists. This so-called CS-method (CS for "Cons and Snoc"... |

24 | The third homomorphism theorem
- Gibbons
- 1996
(Show Context)
Citation Context ...o-called second and third homomorphism theorems considered folk theorems in the BMF community. The former is simple to prove; the latter was proved by Meertens and presented systematically by Gibbons =-=[9]-=-; its importance for deriving parallel algorithms was first demonstrated in [10]. Theorem 2 A function on lists is a homomorphism iff it is both leftwards and rightwards. Unfortunately, as pointed out... |

17 | Systematic extraction and implementation of divide-and-conquer parallelism
- Gorlatch
- 1996
(Show Context)
Citation Context ...plementing them on parallel architectures. For both tasks, we aim at a systematic approach which would lead to a practically relevant parallel programming methodology. Recent results are presented in =-=[3, 6, 7]. A system-=-atic extraction method, proposed in [7], proceeds by generalizing two sequential representations of the function: on the cons and snoc lists. This so-called CS-method (CS for "Cons and Snoc"... |

14 |
Deriving associative operators for language recognition
- Barnard, Schmeiser, et al.
- 1991
(Show Context)
Citation Context ... BMF community. The former is simple to prove; the latter was proved by Meertens and presented systematically by Gibbons [9]; its importance for deriving parallel algorithms was first demonstrated in =-=[10]-=-. Theorem 2 A function on lists is a homomorphism iff it is both leftwards and rightwards. Unfortunately, as pointed out in [9, 10], the theorem does not provide a method to construct the homomorphic ... |

13 | Parallelization of divide-and-conquer by translation to nested loops
- Herrmann, Lengauer
- 1999
(Show Context)
Citation Context ...e notion of homomorphism which can be viewed as a specific form of the well-known divide-and-conquer (DC) paradigm. Classifications of the DC forms suitable for static parallelization are proposed in =-=[3, 4]-=-. The class of homomorphic functions exemplify dataparallelism and enjoy a common way of parallelization, and thus can be viewed as an algorithmic skeleton [5]. To use homomorphisms in the practical p... |

12 |
Constructing list homomorphisms
- Gorlatch
- 1995
(Show Context)
Citation Context ... Theorem 3 If h = hom (f; fi ), then h is both lh and rh, moreover h = lh (f; fi ) = rh (f; fi ). Vice versa, if h = lh (f; fi ) or h = rh (f; fi ), where fi is associative, then h = hom (f; fi ). In =-=[11]-=-, we prove a slightly stronger proposition. Theorem 3 suggests a possible way to find a homomorphic representation: construct a cons definition of the function in the lh format (or, dually, find an rh... |

12 |
A correctness proof of parallel scan
- O’Donnell
- 1994
(Show Context)
Citation Context ...e believe to have shown that the problem to extract a homomorphism is nontrivial. For the scan function, it even led to errors in published parallel algorithms and required a formal correctness proof =-=[12]-=-. Now let us explain our plan to solve the problem. 4 Generalization We intend to apply the framework of generalization to extract homomorphisms. First let us explain what generalization means. A subs... |

10 |
shallow theories
- Syntacticness
- 1994
(Show Context)
Citation Context ...e can do simpler. There is no need to adapt the given equational theory, nor to introduce new functions. For our generalization method we start from Jouannaud [18] and Comon, Haberstrau and Jouannaud =-=[19]-=- who use a resolvant presentation of the equational theory to get a generalization algorithm. Our generalization calculus differs from theirs basically by the use of rewrite derivations instead of con... |

8 |
Lemma discovery by anti-unification of regular sorts
- Heinz
- 1994
(Show Context)
Citation Context ...s respect, generalization is the dual to unification where, modulo conversion, a most general common special case is wanted. For this reason, generalization is sometimes also called "anti-unifica=-=tion"[13]-=-. Plotkin has closely studied the special-case relation between terms [14]. In the case where E is empty, the special-case relation forms a lattice, i.e. there are most general syntactic unifiers and ... |

7 |
Solving divergence in Knuth-Bendix completion by enriching signatures
- Thomas, Watson
- 1993
(Show Context)
Citation Context ...use in inductive theorem proving. As an intriguing example we mention the systematic construction of a term rewriting system of counting functions on the basis of an effective enumeration of elements =-=[16, 17]-=-. For our purpose to extract homomorphisms one can do simpler. There is no need to adapt the given equational theory, nor to introduce new functions. For our generalization method we start from Jouann... |

5 | Formal Derivation of Divide-and-Conquer Programs: A Case Study in the Multidimensional FFT’s
- Gorlatch, Bischof
- 1997
(Show Context)
Citation Context ...e notion of homomorphism which can be viewed as a specific form of the well-known divide-and-conquer (DC) paradigm. Classifications of the DC forms suitable for static parallelization are proposed in =-=[3, 4]-=-. The class of homomorphic functions exemplify dataparallelism and enjoy a common way of parallelization, and thus can be viewed as an algorithmic skeleton [5]. To use homomorphisms in the practical p... |

5 |
Lattice-Theoretic Properties of Subsumption. Memo MIP-R-77
- Plotkin
- 1970
(Show Context)
Citation Context ...ion, a most general common special case is wanted. For this reason, generalization is sometimes also called "anti-unification"[13]. Plotkin has closely studied the special-case relation betw=-=een terms [14]-=-. In the case where E is empty, the special-case relation forms a lattice, i.e. there are most general syntactic unifiers and most special syntactic generalizers. In contrast to unification, an intens... |

5 |
Towards a set of inference rules for solving divergence in Knuth-Bendix completion
- Lange
- 1989
(Show Context)
Citation Context ...use in inductive theorem proving. As an intriguing example we mention the systematic construction of a term rewriting system of counting functions on the basis of an effective enumeration of elements =-=[16, 17]-=-. For our purpose to extract homomorphisms one can do simpler. There is no need to adapt the given equational theory, nor to introduce new functions. For our generalization method we start from Jouann... |

5 |
Syntactic theories
- Jouannaud
- 1990
(Show Context)
Citation Context ...r our purpose to extract homomorphisms one can do simpler. There is no need to adapt the given equational theory, nor to introduce new functions. For our generalization method we start from Jouannaud =-=[18]-=- and Comon, Haberstrau and Jouannaud [19] who use a resolvant presentation of the equational theory to get a generalization algorithm. Our generalization calculus differs from theirs basically by the ... |

3 |
Term induction proofs by a generalization of narrowing
- Fraus, Humann
- 1992
(Show Context)
Citation Context ...ld the computed solution. An inductive theorem prover may finally be used to prove associativity of fi . Example 1 (Continued) In our scn example, we have used the semi-automatic inductive prover TiP =-=[22, 23]-=- to produce a proof of associativity of fi based on the lemmas last(mp(a; x)) ! a fi last x mp(a; mp(b; x)) ! mp(a fi b; x) and, in turn, a proof of each lemma. The three proofs are obtained by rewrit... |

2 |
Mechanized inductive proof of properties of a simple code optimizer
- Geser
- 1995
(Show Context)
Citation Context ...ld the computed solution. An inductive theorem prover may finally be used to prove associativity of fi . Example 1 (Continued) In our scn example, we have used the semi-automatic inductive prover TiP =-=[22, 23]-=- to produce a proof of associativity of fi based on the lemmas last(mp(a; x)) ! a fi last x mp(a; mp(b; x)) ! mp(a fi b; x) and, in turn, a proof of each lemma. The three proofs are obtained by rewrit... |

1 |
Parallelizing functinal programs by term rewriting
- Geser, Gorlatch
- 1997
(Show Context)
Citation Context ...ends the component-wise subterm order. If R is reversely guarded by ? then the restricted generalization calculus admits no infinite derivations. A rigorous proof can be found in the technical report =-=[24]-=-. A term rewriting system that contains rules l ! r where l contains a variable not in r is not reversely guarded. For instance, Rule (13) has x on its left, but not on its right hand side. The term r... |