ESOP 2000: Programming Languages and Systems pp 26-40 | Cite as
Faithful Translations between Polyvariant Flows and Polymorphic Types
Abstract
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.
Keywords
Type System Intersection Type Union Type Type Derivation Intermediate LanguageReferences
- AC93.R. Amadio and L. Cardelli. Subtyping recursive types. ACM Trans. on Prog. Langs. and Systs., 15(4):575–631, 1993.CrossRefGoogle Scholar
- 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
- 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
- Ban97.A. Banerjee. A modular, polyvariant, and type-based closure analysis. In ICFP’ 97 [ICFP97].Google Scholar
- 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
- 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
- Hei95.N. Heintze. Control-flow analysis and type systems. In SAS’ 95 [SAS95], pp. 189–206.Google Scholar
- ICFP97.Proc. 1997 Int’l Conf. Functional Programming, 1997.Google Scholar
- 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
- 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
- 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
- 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
- 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
- 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
- PP99.J. Palsberg and C. Pavlopoulou. From polyvariant flow information to intersection and union types. A substantially revised version of [PP98]. Available at http://www.cs.purdue.edu/homes/palsberg/paper/popl98.ps.gz., Feb. 1999.
- SAS95.Proc. 2nd Int’l Static Analysis Symp., vol. 983 of LNCS, 1995.Google Scholar
- Sch95.D. Schmidt. Natural-semantics-based abstract interpretation. In SAS’ 95 [SAS95], pp. 1–18.Google Scholar
- Shi91.O. Shivers. Control Flow Analysis of Higher Order Languages. PhD thesis, Carnegie Mellon University, 1991.Google Scholar
- 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
- 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