Control-flow analysis and type systems

  • Nevin Heintze
Contributed Papers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 983)


We establish a series of equivalences between type systems and control-flow analyses. Specifically, we take four type systems from the literature (involving simple types, subtypes and recursion) and conservatively extend them to reason about control-flow information. Similarly, we take four standard control-flow systems and conservatively extend them to reason about type consistency. Our main result is that we can match up the resulting type and control-flow systems such that we obtain pairs of equivalent systems, where the equivalence is with respect to both type and control-flow information. In essence, type systems and control-flow analysis can be viewed as complementary approaches for addressing questions of type consistency and control-flow.

Recent and independent work by Palsberg and O'Keefe has addressed the same general question. Our work differs from theirs in two respects. First, they only consider what happens when control-flow systems are used to reason about types. In contrast, we also consider the dual question: what happens when type systems are used to reason about control-flow. Hence our results establish a much closer and more symmetric notion of equivalence: Palsberg and O'Keefe's equivalence refers only to typability properties, whereas our equivalences refer to both typability and control-flow. Second, Palsberg and O'Keefe establish only one pair of equivalent systems, whereas we establish four pairs of (stronger) equivalences.


Type System Partial Mapping Simple Type Partial Type Type Inference 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    R. Amadio and L. Cardelli, “Subtyping Recursive types”, ACM-TOPLAS, 15(4):575–631, 1993. (Also in POPL-91, pp. 104–118).Google Scholar
  2. 2.
    A. Bondorf and J. Jorgensen, “Efficient Analysis for Realistic Off-Line Partial Evaluation”, Journal of Function Programming, 3(3), pp. 315–346, 1993.Google Scholar
  3. 3.
    N. Heintze, “Control-Flow Analysis and Type Systems”, Carnegie Mellon University technical report CMU-CS-94-227, 16pp, December 1994.Google Scholar
  4. 4.
    N. Jones, “Flow Analysis of Lambda Expressions”, Symp. on Functional Languages and Computer Architecture, pp. 66–74, 1981.Google Scholar
  5. 5.
    N. Jones, “Flow Analysis of Lazy Higher-Order Functional Programs”, in Abstract Interpretation of Declarative Languages, S. Abramsky and C. Hankin (Eds.), Ellis Horwood, 1987.Google Scholar
  6. 6.
    D. Kozen, J. Palsberg, M. Schwartzbach, “Efficient Recursive Subtyping” POPL-93, pp. 419–428, 1993.Google Scholar
  7. 7.
    R. Milner, “A Theory of Type Polymorphism in Programming”, Journal of Computer System Science, 17, pp. 348–375.Google Scholar
  8. 8.
    J. Palsberg and M. Schwartzbach, “Safety Analysis versus Type Inference for Partial Types” Information Processing Letters, Vol 43, pp. 175–180, North-Holland, September 1992.Google Scholar
  9. 9.
    J. Palsberg and M. Schwartzbach, “Safety Analysis versus Type Inference” Information and Computation, to appear.Google Scholar
  10. 10.
    J. Palsberg and P. O'Keefe, “A Type System Equivalent to Flow Analysis”, POPL-95, pp. 367–378, 1995.Google Scholar
  11. 11.
    O. Shivers, “Control Flow Analysis in Scheme”, Proc. 1988 ACM Conf. on Programming Language Design and Implementation, Atlanta, pp. 164–174, 1988.Google Scholar
  12. 12.
    Y. Tang and P. Jouvelot, “Control-Flow Effects for Escape Analysis”, WSA'92, Bordeaux, France, 1992.Google Scholar
  13. 13.
    Y. Tang and P. Jouvelot, “Separate Abstract Interpretation for Control-Flow Analysis”, TACS-94, LNCS 789, pp. 224–243, 1994.Google Scholar
  14. 14.
    S. Thatte, “Type Inference with Partial Types”, ICALP-88, LNCS 317, pp. 615–629, 1988.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1995

Authors and Affiliations

  • Nevin Heintze
    • 1
    • 2
  1. 1.School of Computer ScienceCarnegie Mellon UniversityUSA
  2. 2.PittsburghUSA

Personalised recommendations