The Generation of Optimal Code for Stack Machines

The problem of generating "optimal" programs for the evaluation of arithmetic expressions on a machine with a finite depth stack is studied. Efficient algorithms are given for constructing optimal programs in the case where the expressions are trees, there are no data dependencies, and the o p e r a t o r s have limited algebraic properties.