archives

Ralf Hinze: An algebra of scans

Ralf Hinze. An algebra of scans. Proceedings of the Seventh International Conference on Mathematics of Program Construction (MPC 2004).

In this paper we show that parallel prefix circuits enjoy a very pleasant algebra. Using only two basic building blocks and four combinators all standard designs can be described succinctly and rigorously. The rules of the algebra allow us to prove the circuits correct and to derive circuit designs in a systematic manner.

Parallel prefix computations, or scans if you speak APL, determine the sums of all prefixes of a given sequence. Obviously the term sum is used loosely: scan is a high-order function, and any associative operation can be used. In J talk scan is an adverb.

I wonder when we will be seeing courses called Algebra Design in Computer Science departments around the world...

Ah right, just after all universities offer language design courses ;-)