Analytic variations on the common subexpression problem

  • Philippe Flajolet
  • Paolo Sipala
  • Jean-Marc Steyaert
Conference paper

DOI: 10.1007/BFb0032034

Part of the Lecture Notes in Computer Science book series (LNCS, volume 443)
Cite this paper as:
Flajolet P., Sipala P., Steyaert JM. (1990) Analytic variations on the common subexpression problem. In: Paterson M.S. (eds) Automata, Languages and Programming. ICALP 1990. Lecture Notes in Computer Science, vol 443. Springer, Berlin, Heidelberg


Any tree can be represented in a maximally compact form as a directed acyclic graph where common subtrees are factored and shared, being represented only once. Such a compaction can be effected in linear time. It is used to save storage in implementations of functional programming languages, as well as in symbolic manipulation and computer algebra systems. In compiling, the compaction problem is known as the “common subexpression problem” and it plays a central rôle in register allocation, code generation and optimisation. We establish here that, under a variety of probabilistic models, a tree of size n has a compacted form of expected size asymptotically
$$C\frac{n}{{\sqrt {\log n} }},$$
where the constant C is explicitly related to the type of trees to be compacted and to the statistical model reflecting tree usage. In particular the savings in storage approach 100% on average for large structures, which overperforms the commonly used form of sharing that is restricted to leaves (atoms).


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Springer-Verlag 1990

Authors and Affiliations

  • Philippe Flajolet
    • 1
  • Paolo Sipala
    • 2
  • Jean-Marc Steyaert
    • 3
  1. 1.INRIA, RocquencourtLe ChesnayFrance
  2. 2.Università degli Studi di TriesteTriesteItaly
  3. 3.LIX Ecole PolytechniquePalaiseauFrance

Personalised recommendations