If-then-else as a concurrency inhibitor in eager beaver evaluation of recursive programs

Programs described via recursive equations provide many opportunities for concurrent computation. For example, a machine may choose to concurrently initiate the evaluation of all subexpressions within a given expression. This “eager beaver” evaluation strategy has been a highly touted avenue for introducing massive parallelism into computations. However, machines following a strict eager beaver policy will not be acceptable in applications such as process control where certain portions of computations must follow an explicit sequence. In addition, eager beaver evaluation can in some circumstances waste resources on evaluation of expressions that turn out to be irrelevant to the overall goal of a computation. Therefore, programmers need operators for specifying the order of evaluation of subexpressions within a recursive program. We contend that a sequential form of the if-then-else function and a generalization to encompass nondeterminacy may be used as an elegant mechanism for sequencing computations within an eager beaver environment. We illustrate the use of if-then-else for specifying computational sequences by describing three computations: a process control algorithm (the dining philosophers), a nondeterministic function (AMB), and three alternative algorithms for minimax tree search. Finally we discuss the performance of a simulated, eager beaver multiprocessor as it carries out these algorithms.

[1]  Daniel P. Friedman,et al.  A note on conditional expressions , 1978, CACM.

[2]  Allen Newell,et al.  Chess-Playing Programs and the Problem of Complexity , 1958, IBM J. Res. Dev..

[3]  Mitchell Wand,et al.  Continuation-Based Program Transformation Strategies , 1980, JACM.

[4]  Edsger W. Dijkstra,et al.  Guarded commands, nondeterminacy and formal derivation of programs , 1975, Commun. ACM.

[5]  Gianfranco Prini,et al.  Explicit parallelism in LISP-like languages , 1980 .

[6]  Rex L. Page,et al.  Performance of a multiprocessor for Applicative programs , 1980, PERFORMANCE '80.

[7]  A. Davis A data flow evaluation system based on the concept of recursive locality* , 1979, 1979 International Workshop on Managing Requirements Knowledge (MARK).

[8]  Gilles Kahn,et al.  The Semantics of a Simple Language for Parallel Programming , 1974, IFIP Congress.

[9]  Peter Henderson,et al.  A lazy evaluator , 1976, POPL.

[10]  Carl Hewitt,et al.  The incremental garbage collection of processes , 1977, Artificial Intelligence and Programming Languages.

[11]  Zohar Manna,et al.  Introduction to mathematical theory of computation , 1972 .

[12]  Jean Vuillemin,et al.  Correct and optimal implementations of recursion in a simple programming language , 1973, J. Comput. Syst. Sci..

[13]  Wil Plouffe,et al.  An asynchronous programming language and computing machine , 1978 .

[14]  Daniel P. Friedman,et al.  CONS Should Not Evaluate its Arguments , 1976, ICALP.

[15]  Rex L. Page,et al.  Deleting Irrelevant Tasks in an Expression-Oriented Multiprocessor System , 1981, TOPL.

[16]  Mitchell Wand,et al.  Continuation-Based Multiprocessing , 1980, High. Order Symb. Comput..

[17]  Robert M. Keller,et al.  A loosely-coupled applicative multi-processing system* , 1979, 1979 International Workshop on Managing Requirements Knowledge (MARK).

[18]  Daniel Edwards,et al.  The Alpha-Beta Heuristic , 1963 .