Off-line and on-line algorithms for deducing equalities

  • Authors:
  • Peter Downey;Hanan Samet;Ravi Sethi

  • Affiliations:
  • The Pennsylvania State University, University Park, Pennsylvania;University of Maryland, College Park, Maryland;Bell Laboratories, Murray Hill, New Jersey

  • Venue:
  • POPL '78 Proceedings of the 5th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
  • Year:
  • 1978

Quantified Score

Hi-index 0.00

Visualization

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.