|
ABSTRACT
The classical common subexpression problem in program optimization is the detection of identical subexpressions. Suppose we have some extra information and are given pairs of expressions ei1=ei2 which must have the same value, and expressions fj1≠fj2 which must have different values. We ask if as a result, h1=h2, or h1≠h2. This has been called the uniform word problem for finitely presented algebras, and has application in theorem-proving and code optimization. We show that such questions can be answered in O(nlogn) time, where n is the number of nodes in a graph representation of all relevant expressions. A linear time algorithm for detecting common subexpressions is derived. Algorithms which process equalities, inequalities and deductions on-line are discussed.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
{A} W. Ackermann, Solvable Cases of the Decision Problem, North-Holland, Amsterdam (1954).
|
| |
2
|
|
| |
3
|
{AU} A. V. Aho and J. D. Ullman, Optimization of straight line programs, SIAM J. Computing 1, 1 (March 1972) 1-19.
|
 |
4
|
|
 |
5
|
E. Cardoza , R. Lipton , A. R. Meyer, Exponential space complete problems for Petri nets and commutative semigroups (Preliminary Report), Proceedings of the eighth annual ACM symposium on Theory of computing, p.50-54, May 03-05, 1976, Hershey, Pennsylvania, United States
[doi> 10.1145/800113.803630]
|
| |
6
|
{CS} John Cocke and J. T. Schwartz, Programming Languages and Their Compilers Preliminary Notes, Second Revised Version, Courant Institute of Mathematical Sciences, New York, NY (April 1970).
|
| |
7
|
{Cu} Karel Culik, Combinatorial problems in the theory of complexity of algorithmic nets without cycles for simple computers, Aplikace Matematiky 16 (1971) 188-202.
|
| |
8
|
{DS} P. J. Downey and Ravi Sethi, Assignment commands and array structures, Proc. 17th Ann. Symposium on Foundations of Computer Science, (October 1976) 57-66.
|
| |
9
|
{Go} D. I. Good, R. L. London and W. W. Bledsoe, An interactive program verification system, IEEE Trans. on Software Engineering SE-1 (March 1975) 59-67.
|
| |
10
|
{H} J. E. Hopcroft, An n log n algorithm for minimizing states in a finite automaton, in Z. Kohavi and A. Paz (ed.) Theory of Machines and Computations, Academic Press, New York, NY (1971) 189-196.
|
| |
11
|
{HK} J. E. Hopcroft and R. M. Karp, An algorithm for testing equivalence of finite automata, TR-71-114, Dept. of Computer Science, Cornell Univ. (1971); see description in Aho et. al. (1974) 143-145.
|
 |
12
|
|
| |
13
|
|
| |
14
|
{KB} D. E. Knuth and P. B. Bendix, Simple word problems in universal algebras. In J. Leech, Ed., Computational Problems in Abstract Algebra, Pergamon Press, (1970).
|
 |
15
|
|
| |
16
|
{Ko2} D. Kozen, Lower bounds for natural proof systems, Proc. 18th Ann. Symp. on Foundations of Computer Science, (Oct. 1977), 254-266.
|
| |
17
|
{L} D. S. Lankford, Canonical algebraic simplification in computational logic, Department of Mathematics report, Southwestern University, Georgetown, TX (1975).
|
| |
18
|
{NO1} G. Nelson and D. Oppen, Fast decision algorithms based on union and find, Proc. 18th Ann. Symp. on Foundations of Computer Science, (Oct. 1977), 114-119.
|
| |
19
|
{NO2} G. Nelson and D. Oppen, A simplifier for program manipulation, this proceedings.
|
 |
20
|
|
 |
21
|
|
 |
22
|
|
 |
23
|
|
| |
24
|
{Se2} Ravi Sethi, Scheduling graphs on two processors, SIAM J. Computing 5, 1 (March 1976) 73-82.
|
| |
25
|
{Sh} R. E. Shostak, An algorithm for reasoning about equality, Proc. of the Symp. on AI and Programming Languages, SIGPLAN Notices 12 (Aug. 1977), 155-162.
|
| |
26
|
{Tarj1} R. E. Tarjan, Depth first search and linear graph algorithms, SIAM J. Computing 1, 2 (June 1972) 146-160.
|
 |
27
|
|
| |
28
|
{Tarj3} R. E. Tarjan, private communication.
|
| |
29
|
{Tars} A. Tarski, A. Mostowski and R. M. Robinson, Undecidable theories, North-Holland Publishing Co., Amsterdam (1953).
|
|