A safe approach to parallel combinator reduction (extended abstract)
In this paper we present the results of two pieces of work which, when combined, allow us to go from a program text in a functional language to a parallel implementation of that program. We present techniques for discovering sources of parallelism in a program at compile time, and then show how this parallelism is naturally mapped into a parallel combinator set that we will define.
To discover sources of parallelism in a program, we use abstract interpretation. Abstract interpretation is a compile-time technique which is used to gain information about a program that may then be used to optimise the execution of the program. A particular use of abstract interpretation is in strictness analysis of functional programs. In a language that has lazy semantics, the main potential for parallelism arises in the evaluation of operands of strict operators. A function is strict in an argument if its value is undefined whenever the argument is undefined. If we can use strictness analysis to detect which arguments a function is strict in, we then know that these arguments can be safely evaluated in parallel because this will not affect the lazy semantics.
Having identified the sources of parallelism at compile-time it is necessary to communicate these to the run-time system. In the second part of the paper we use an extended set of combinators, including a pair of parallel combinators that achieve this purpose.
KeywordsCombinators Strictness Analysis Functional Languages Parallel Reduction Director Strings
- Abramsky, S., Abstract Interpretation, Logical Relations and Kan Extensions, Draft Manuscript, 1985.Google Scholar
- Burn, G.L., Hankin, C.L., and Abramsky, S., Strictness Analysis for Higher-Order Functions, To appear in Science of Computer Programming Also: Imperial College of Science and Technology, Department of Computing, Research Report DoC 85/6, April 1985.Google Scholar
- Hankin, C.L., Osmon, P.E., and Shute, M.J., COBWEB: A Combinator Reduction Architecture, in: Proceedings of IFIP International Conference on Functional Programming Languages and Computer Architecture, Nancy, France, 16–19 September, 1985, Jouannaud, J.-P. (ed.), Springer-Verlag LNCS 201, pp. 99–112.Google Scholar
- Hughes, J., The Design and Implementation of Programming Languages, PhD Thesis, Oxford University, 1983. (Published as Oxford University Computing Laboratory, Programming Research Group, Technical Monograph PRG-40, September, 1984.)Google Scholar
- Hughes, J., Strictness Detection in Non-Flat Domains Workshop on Programs as Data Objects, Copenhagen, Denmark, 17–19 October, 1985. (Proceedings to be published in Springer Verlag LNCS series.)Google Scholar
- Joy, M.S., Rayward-Smith, V.J. and Burton, F.W., Efficient Combinator Code, Computer Languages 10 3, 1985, pp.211–223.Google Scholar
- Kennaway, J.R., and Sleep, M.R., Director Strings as Combinators, University of East Anglia Report, 1981.Google Scholar
- Maurer, D., Strictness Computation Using Generalised λ-expressions, Workshop on Programs as Data Objects, Copenhagen, Denmark, 17–19 October, 1985. (Proceedings to be published in Springer Verlag LNCS series.)Google Scholar
- Meira, S.R. de L., On the Efficiency of Applicative Algorithms, PhD Thesis, The University of Kent at Canterbury, March 1985.Google Scholar
- Mycroft, A., Abstract Interpretation and Optimising Transformations for Applicative Programs, PhD. Thesis, University of Edinburgh, 1981.Google Scholar
- Oberhauser, H.-G., Wilhelm, R., Flow Analysis in Combinator Implementation of Functional Programming Languages, Technical Report, Universitat des Saarlandes, D-6600 Saarbrucken, 1984.Google Scholar
- Scott, D., Lectures on a Mathematical Theory of Computation, Tech. Monograph PRG-19, Oxford Univ. Computing Lab., Programming Research Group, 1981.Google Scholar
- Turner, D.A., Another Algorithm For Bracket Abstraction, The Journal of Symbolic Logic 44 2, June 1979, pp. 267–270.Google Scholar
- Wadler, P., Strictness Analysis on Non-Flat Domains (by Abstract Interpretation over Finite Domains), Draft Manuscript, 1985.Google Scholar