Faithful Translations between Polyvariant Flows and Polymorphic Types

  • Torben Amtoft
  • Franklyn Turbak
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1782)


Recent work has shown equivalences between various type systems and flow logics. Ideally, the translations upon which such equivalences are based should be faithful in the sense that information is not lost in round-trip translations from flows to types and back or from types to flows and back. Building on the work of Nielson & Nielson and of Palsberg & Pavlopoulou, we present the first faithful translations between a class of finitary polyvariant flow analyses and a type system supporting polymorphism in the form of intersection and union types. Additionally, our flow/type correspondence solves several open problems posed by Palsberg & Pavlopoulou: (1) it expresses call-string based polyvariance (such as k-CFA) as well as argument based polyvariance; (2) it enjoys a subject reduction property for flows as well as for types; and (3) it supports a flow-oriented perspective rather than a type-oriented one.


Type System Intersection Type Union Type Type Derivation Intermediate Language 
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.


  1. AC93.
    R. Amadio and L. Cardelli. Subtyping recursive types. ACM Trans. on Prog. Langs. and Systs., 15(4):575–631, 1993.CrossRefGoogle Scholar
  2. Age95.
    O. Agesen. The cartesian product algorithm. In Proceedings of ECOOP’95, Seventh European Conference on Object-Oriented Programming, vol. 952, pp. 2–26. Springer-Verlag, 1995.Google Scholar
  3. AT00.
    T. Amtoft and F. Turbak. Faithful translations between polyvariant flows and polymorphic types. Technical Report BUCS-TR-2000-01, Comp. Sci. Dept., Boston Univ., 2000.Google Scholar
  4. Ban97.
    A. Banerjee. A modular, polyvariant, and type-based closure analysis. In ICFP’ 97 [ICFP97].Google Scholar
  5. DMTW97.
    A. Dimock, R. Muller, F. Turbak, and J. B. Wells. Strongly typed flow-directed representation transformations. In ICFP’ 97 [ICFP97], pp. 11–24.Google Scholar
  6. GNN97.
    K. L. S. Gasser, F. Nielson, and H. R. Nielson. Systematic realisation of control flow analyses for CML. In ICFP’ 97 [ICFP97], pp. 38–51.Google Scholar
  7. Hei95.
    N. Heintze. Control-flow analysis and type systems. In SAS’ 95 [SAS95], pp. 189–206.Google Scholar
  8. ICFP97.
    Proc. 1997 Int’l Conf. Functional Programming, 1997.Google Scholar
  9. JW95.
    S. Jagannathan and S. Weeks. A unified treatment of flow analysis in higher-order languages. In Conf. Rec. 22nd Ann. ACM Symp. Princ. of Prog. Langs., pp. 393–407, 1995.Google Scholar
  10. JWW97.
    S. Jagannathan, S. Weeks, and A. Wright. Type-directed flow analysis for typed intermediate languages. In Proc. 4th Int’l Static Analysis Symp., vol. 1302 of LNCS. Springer-Verlag, 1997.CrossRefGoogle Scholar
  11. NN97.
    F. Nielson and H. R. Nielson. Infinitary control flow analysis: A collecting semantics for closure analysis. In Conf. Rec. POPL’ 97: 24th ACM Symp. Princ. of Prog. Langs., pp. 332–345, 1997.Google Scholar
  12. NN99.
    F. Nielson and H. R. Nielson. Interprocedural control flow analysis. In Proc. European Symp. on Programming, vol. 1576 of LNCS, pp. 20–39. Springer-Verlag, 1999.Google Scholar
  13. PO95.
    J. Palsberg and P. O’Keefe. A type system equivalent to flow analysis. ACM Trans. on Prog. Langs. and Systs., 17(4):576–599, 1995.CrossRefGoogle Scholar
  14. PP98.
    J. Palsberg and C. Pavlopoulou. From polyvariant flow information to intersection and union types. In Conf. Rec. POPL’ 98: 25th ACM Symp. Princ. of Prog. Langs., pp. 197–208, 1998. Superseded by [PP99].Google Scholar
  15. PP99.
    J. Palsberg and C. Pavlopoulou. From polyvariant flow information to intersection and union types. A substantially revised version of [PP98]. Available at, Feb. 1999.
  16. SAS95.
    Proc. 2nd Int’l Static Analysis Symp., vol. 983 of LNCS, 1995.Google Scholar
  17. Sch95.
    D. Schmidt. Natural-semantics-based abstract interpretation. In SAS’ 95 [SAS95], pp. 1–18.Google Scholar
  18. Shi91.
    O. Shivers. Control Flow Analysis of Higher Order Languages. PhD thesis, Carnegie Mellon University, 1991.Google Scholar
  19. WDMT97.
    J. B. Wells, A. Dimock, R. Muller, and F. Turbak. A typed intermediate language for flow-directed compilation. In Proc. 7th Int’l Joint Conf. Theory & Practice of Software Development, pp. 757–771, 1997.Google Scholar
  20. WJ98.
    A. Wright and S. Jagannathan. Polymorphic splitting: An effective polyvariant flow analysis. ACM Trans. on Prog. Langs. and Systs., 20:166–207, 1998.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Torben Amtoft
    • 1
  • Franklyn Turbak
    • 2
  1. 1.Boston UniversityBostonUSA
  2. 2.Wellesley CollegeWellesleyUSA

Personalised recommendations