Faithful Translations between Polyvariant Flows and Polymorphic Types

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.

[1]  Robert Harper,et al.  TIL: a type-directed optimizing compiler for ML , 1996, PLDI '96.

[2]  Peter G. Harrison,et al.  Functional Programming , 1988 .

[3]  Jens Palsberg,et al.  From Polyvariant flow information to intersection and union types , 2001, J. Funct. Program..

[4]  Mitchell Wand,et al.  Constraint systems for useless variable elimination , 1999, POPL '99.

[5]  Suresh Jagannathan,et al.  A unified treatment of flow analysis in higher-order languages , 1995, POPL '95.

[6]  Joe B. Wells,et al.  A Typed Intermediate Language for Flow-Directed Compilation , 1997, TAPSOFT.

[7]  Luca Cardelli,et al.  Subtyping recursive types , 1993 .

[8]  Flemming Nielson,et al.  Interprocedural Control Flow Analysis , 1999, ESOP.

[9]  John Hannan,et al.  Higher-order unCurrying , 1998, POPL '98.

[10]  Flemming Nielson,et al.  Flow Logic and Operational Semantics , 1997, Electron. Notes Theor. Comput. Sci..

[11]  Suresh Jagannathan,et al.  Polymorphic splitting: an effective polyvariant flow analysis , 1998, TOPL.

[12]  Andrew P. Tolmach,et al.  From ML to Ada: Strongly-typed language interoperability via source translation , 1998, Journal of Functional Programming.

[13]  Anindya Banerjee A modular, polyvariant and type-based closure analysis , 1997, ICFP '97.

[14]  Joe B. Wells,et al.  Functioning without closure: type-safe customized function representations for standard ML , 2001, ICFP '01.

[15]  Franklyn Turbak,et al.  Strongly Typed Flow-Directed Representation Transformations. , 1997, ICFP 1997.

[16]  Andrew A. Chien,et al.  Type Directed Cloning for Object-Oriented Programs , 1995, LCPC.

[17]  Guang R. Gao,et al.  Identifying loops using DJ graphs , 1996, TOPL.

[18]  Flemming Nielson,et al.  Systematic realisation of control flow analyses for CML , 1997, ICFP '97.

[19]  Karl Crary,et al.  From system F to typed assembly language , 1999 .

[20]  TurbakFranklyn,et al.  Functioning without closure , 2001 .

[21]  Flemming Nielson,et al.  Infinitary control flow analysis: a collecting semantics for closure analysis , 1997, POPL '97.

[22]  David Grove,et al.  Selective specialization for object-oriented languages , 1995, PLDI '95.

[23]  Nevin Heintze Control-Flow Analysis and Type Systems , 1995, SAS.

[24]  David A. Schmidt Natural-Semantics-Based Abstract Interpretation (Preliminary Version) , 1995, SAS.

[25]  Suresh Jagannathan,et al.  Type-Directed Flow Analysis for Typed Intermediate Languages , 1997, SAS.

[26]  Suresh Jagannathan,et al.  Flow-Directed Closure Conversion for Typed Languages , 2000, ESOP.

[27]  Ole Agesen The Cartesian Product Algorithm: Simple and Precise Type Inference Of Parametric Polymorphism , 1995, ECOOP.

[28]  Mitchell Wand,et al.  Lightweight closure conversion , 1997, TOPL.

[29]  Simon L. Peyton Jones,et al.  Compiling Haskell by Program Transformation: A Report from the Trenches , 1996, ESOP.

[30]  Jens Palsberg,et al.  Efficient recursive subtyping , 1992, POPL '93.

[31]  Olin Shivers,et al.  Control-flow analysis of higher-order languages of taming lambda , 1991 .

[32]  Joe B. Wells,et al.  Strongly typed flow-directed representation transformations (extended abstract) , 1997, ICFP '97.