48
Views
0
CrossRef citations to date
0
Altmetric
Original Articles

On the Sethi-Ullman algorithm

Pages 37-55 | Published online: 21 Dec 2010
 

Abstract

A directed acyclic graph (dag) can be used to represent an arithmetic expression consisting of sequences of binary operations on arguments. The Sethi-Ullman algorithm (Journal of the ACM, Vol. 17 No. 4, pp. 715-728) generates optimal object code for a machine with N≧1 registers and unlimited memory capacity when the dag is a binary tree.

We first describe a dag labeling algorithm which gives the minimum number of registers required to evaluate any node without any stores.

We then define a subclass of dags, the 1-load binary dags, employing a tree-like grammar, and modify the Sethi-Ullman algorithm to include this subclass but only when N = 2 registers. The proof of optimality relies on the use of syntax directed translation schemas. Modification of the algorithm to include all dags, or to allow N > 2 registers, appears difficult.

C.R. Categories:

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.