An ex[ension *o the p o w e r o p e r a t o r E.E. McDonnell A, (F A), (F (F A)), ( F (F ( E A ) ) ) . . . . The dyadic power operator, producing a monadic derived function, has been discussed in APL circles for many years. '7[~he earliest published discussion of which i am aware appeared in "General Arrays, Operators and Functions", by Ziad Ghandour and Jorge Mezei, which appeared in IBM Journal of research and development, 17, 4, July 1973. In this paper the operator was denoted by ~. The operator was later discussed in the IBM Technical Report RC 7091, Operators and Functions, by K.E. Iverson, April 1978, pp 2-,3. The NARS system developed by Bob Smith at STSC in 1981 included the power operator, denoted, as Iverson's paper had suggested, by the symbol ;4. T h e STSC Reference Manual Nested Arrays System, by Carl M. Chancy, 1981, pp 44-48, gives several examples of its use. Cheney gives the example of using the power operator with the function so that the n t h element of its result would be equivalent to Iverson's F. n A. T h e y give the definition of W: F l:l A recursively as defining an infinite vector W such that W[O] = A, and in general, W E i + l ] = ( F WE43 ). More importantly, for the purposes of this note, they also define a dyadic derived ease, A ( F I:l) B, to mean A, B, (A F B ) , (B F (A F B ) ) , F (B F (A F B ) ) ) . . . . ( ( A F B) Recursively, they define W: A ( F []) B to naean an infinite vector W such t h a t W[O] is A, WEll is B, and in general, W [ i + 2 ] is W [ i ] F W [ g + l ] . They give the example 1 +1:11 ... Fib: w,+/-2toJ as follows: (Fib ~ 11) the infinite Fibonacci sequence. We can take this dyadic derived case of Tu and Perlis from the infinite realm to currently finite APL, by adding the dyad a f . n to to Iverson's monad c a s e f . n w. The definition o f a f . n tois: CL f . n to yields the thirteen Fibonacci numbers In his recently published "A Dictionary of A P L " , APL Quote Quad 18 1, September 1987, Iverson renews the discussion of this operator, now denoted by the dot (because of the ambiguities that arise from the fact that the dot is used not only as an operator symbol but in forming numbers and names, a space m a y be required to separate the left or right argument from the dot). He gives the definition of f . n, where f is a monadic function and n is an integer, as follows: The function f is applied n times. For example: ®. -~. 2 4 I a W c o . alto tofafoJ (eL f .(n-2)w) f ct f .(n-1)oo 1"'0. '+ ®® 2 '~ - ~ - / - / - / w 3 ~-+ 101010 to For example, the first fifteen Fibonacci numbers are given by 0 + . ( 1 1 5 ) 1. T h e 19th power of the golden mean number ph/=0.6180339887.., is given by 1 - . 19 phi. For the function F a c t : w l+toxa the expression 1 F a c t . n 1 gives the values of In, for any array of nonnegative integers n. E.E. McDonnell I.P. Sharp Associates 425 Sherman Avenue Palo Alto, CA 94306-1827 1988 May 4 I should like to give thanks to Cory Skutt, of IBM Research in Yorktown Heights, NY, for calling the TuPerlis article to my attention, to K.E. Iverson for suggesting the possibility of using nonscalar arrays n as right arguments, and to Bob Smith for his careful reading of an early draft of this note, which led to several useful comments and corrections. In all the prior discussions of this operator, it has been the case t h a t its derived function was monadic. The purpose of this note is to suggest a use for a dyadic derived function. In IEEE Software 3, 1, January, 1986, an article "FAC: A Functional APL Language", by Hai-Chen Tu and Alan J. Perlis, appeared. In it, the authors, in the course of a discussion of infinitely large arrays in APL, introduce an iter operator, which they denote by D. They note that it derives to an ambivalent function. T h e y define ( F 121) A to mean: A P L Q u o t e Q u a d 18 4 June 1988
/lp/association-for-computing-machinery/an-extension-to-the-power-operator-4iZgUY8xGA