From Polyvariant flow information to intersection and union types

Many polyvariant program analyses have been studied in the 1990s, including k-CFA, polymorphic splitting, and the cartesian product algorithm. The idea of polyvariance is to analyze functions more than once and thereby obtain better precision for each call site. In this paper we present an equivalence theorem which relates a co-inductively-defined family of polyvariant flow analyses and a standard type system. The proof embodies a way of understanding polyvariant flow information in terms of union and intersection types, and, conversely, a way of understanding union and intersection types in terms of polyvariant flow information. We use the theorem as basis for a new flow-type system in the spirit of the λCIL-calculus of Wells, Dimock, Muller and Turbak, in which types are annotated with flow information. A flow-type system is useful as an interface between a flow-analysis algorithm and a program optimizer. Derived systematically via our equivalence theorem, our flow-type system should be a good interface to the family of polyvariant analyses that we study.

[1]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[2]  Suresh Jagannathan,et al.  Effective Flow Analysis for Avoiding Run-Time Checks , 1995, SAS.

[3]  Jens Palsberg,et al.  Closure analysis in constraint form , 1995, TOPL.

[4]  Anders Bondorf,et al.  Automatic Autoprojection of Higher Order Recursive Equations , 1990, Sci. Comput. Program..

[5]  Robin Milner,et al.  Co-Induction in Relational Semantics , 1991, Theor. Comput. Sci..

[6]  Barbara G. Ryder,et al.  Data-Flow-Based Virtual Function Resolution , 1996, SAS.

[7]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[8]  Gilles Kahn,et al.  Natural Semantics , 1987, STACS.

[9]  Laurie J. Hendren,et al.  Context-sensitive interprocedural points-to analysis in the presence of function pointers , 1994, PLDI '94.

[10]  Trevor Jim,et al.  Principal typings and type inference , 1996 .

[11]  Charles Consel,et al.  A tour of Schism: a partial evaluation system for higher-order applicative languages , 1993, PEPM '93.

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

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

[14]  Jens Palsberg Equality-based flow analysis versus recursive types , 1998, TOPL.

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

[16]  B. Pierce Programming with intersection types, union types, and polymorphism , 1991 .

[17]  Karl-Filip Faxén Optimizing Lazy Functional Programs Using Flow Inference , 1995, SAS.

[18]  Scott F. Smith,et al.  Type inference for recursively constrained types and its application to OOP , 1995, MFPS.

[19]  Christian Mossin,et al.  Exact flow analysis , 1997, Mathematical Structures in Computer Science.

[20]  S. V. Bakel,et al.  Intersection type disciplines in Lambda Calculus and applicative term rewriting systems , 1993 .

[21]  Trevor Jim What are principal typings and what are they good for? , 1996, POPL '96.

[22]  A. Tarski A LATTICE-THEORETICAL FIXPOINT THEOREM AND ITS APPLICATIONS , 1955 .

[23]  Tsung-Min Kuo,et al.  Strictness analysis: a new perspective based on type inference , 1989, FPCA.

[24]  John C. Mitchell,et al.  Coercion and type inference , 1984, POPL.

[25]  Scott F. Smith,et al.  Sound polymorphic type inference for objects , 1995, OOPSLA.

[26]  Mariangiola Dezani-Ciancaglini,et al.  Intersection and Union Types: Syntax and Semantics , 1995, Inf. Comput..

[27]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[28]  Patrick Cousot,et al.  Types as abstract interpretations , 1997, POPL '97.

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

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

[31]  Neil D. Jones,et al.  A flexible approach to interprocedural data flow analysis and programs with recursive data structures , 1982, POPL '82.

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

[33]  Paola Giannini,et al.  A Complete Type Inference Algorithm for Simple Intersection Types , 1992, CAAP.

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

[35]  David A. McAllester,et al.  Linear-time subtransitive control flow analysis , 1997, PLDI '97.

[36]  Joëlle Despeyroux,et al.  Proof of Translation in Natural Semantics , 1986, LICS.

[37]  Alexander Aiken,et al.  Soft typing with conditional types , 1994, POPL '94.

[38]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[39]  Torben Amtoft Minimal Thunkification , 1993, WSA.

[40]  Dan C. Stefanescu,et al.  An equational framework for the flow analysis of higher order functional programs , 1994, LFP '94.

[41]  Mitchell Wand,et al.  Selective and lightweight closure conversion , 1994, POPL '94.

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

[43]  B. Courcelle Fundamental properties of infinite trees , 1983 .

[44]  David Grove,et al.  Call graph construction in object-oriented languages , 1997, OOPSLA '97.

[45]  David A. Wright,et al.  A New Technique for Strictness Analysis , 1991, TAPSOFT, Vol.2.

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

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

[48]  John C. Mitchell,et al.  Type inference with simple subtypes , 1991, Journal of Functional Programming.

[49]  Ralph E. Johnson,et al.  A type system for Smalltalk , 1989, POPL '90.

[50]  Jens Palsberg,et al.  Safety Analysis versus Type Inference , 1992, Inf. Comput..

[51]  Pierre Jouvelot,et al.  Separate Abstract Interpretation for Control-Flow Analysis , 1994, TACS.

[52]  Mario Coppo,et al.  Principal type-schemes and lambda-calculus semantics , 1980 .

[53]  Flemming Nielson,et al.  The Typed lambda-Calculus with First-Class Processes , 1989, PARLE.

[54]  Kwangkeun Yi Compile-time Detection of Uncaught Exceptions in Standard ML Programs , 1994, SAS.

[55]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

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

[57]  Ole Agesen,et al.  Concrete type inference: delivering object-oriented applications , 1995 .

[58]  Andrew A. Chien,et al.  Obtaining sequential efficiency for concurrent object-oriented languages , 1995, POPL '95.

[59]  David A. McAllester,et al.  On the complexity of set-based analysis , 1997, ICFP '97.

[60]  Jens Palsberg,et al.  Efficient and flexible matching of recursive types , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[61]  Jens Palsberg,et al.  Constrained types and their expressiveness , 1996, TOPL.

[62]  Fritz Henglein,et al.  Polymorphic Binding-Time Analysis , 1994, ESOP.

[63]  Jens Palsberg,et al.  A type system equivalent to flow analysis , 1995, TOPL.

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