A modular, polyvariant and type-based closure analysis

We observe that the principal typing property of a type system is the enabling technology for modularity and separate compilation [10]. We use this technology to formulate a modular and polyvariant closure analysis, based on the rank 2 intersection types annotated with control-flow information.Modularity manifests itself in a syntax-directed, annotated-type inference algorithm that can analyse program fragments containing free variables: a principal typing property is used to formalise it. Polyvariance manifests itself in the separation of different behaviours of the same function at its different uses: this is formalised via the rank 2 intersection types. As the rank 2 intersection type discipline types at least all (core) ML programs, our analysis can be used in the separate compilation of such programs.

[1]  Prateek Mishra,et al.  Type Inference with Subtypes , 1990, Theor. Comput. Sci..

[2]  Flemming Nielson,et al.  Polymorphic Subtyping for Effect Analysis: The Algorithm , 1996, LOMAPS.

[3]  Christian Mossin,et al.  Flow analysis of typed higher-order programs , 1996, Technical report / University of Copenhagen / Datalogisk institut.

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

[5]  N. Jones Flow Analysis of Lambda Expressions , 1981 .

[6]  Luca Cardelli,et al.  Subtyping recursive types , 1991, POPL '91.

[7]  Nevin Heintze,et al.  Control-Flow Analysis and Type Systems , 1995, SAS.

[8]  Yanmei Tang Tang Systemes d'effet et interpretation abstraite pour l'analyse de flot de controle , 1994 .

[9]  Neil D. Jones,et al.  Flow Analysis of Lambda Expressions (Preliminary Version) , 1981, ICALP.

[10]  Kirsten Lackner Solberg,et al.  Annotated Type Systems for Program Analysis , 1995 .

[11]  Pierre Jouvelot,et al.  The Type and Effect Discipline , 1994, Inf. Comput..

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

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

[14]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[15]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[16]  Luís Damas,et al.  Type assignment in programming languages , 1984 .

[17]  Mads Tofte,et al.  Implementation of the typed call-by-value λ-calculus using a stack of regions , 1994, POPL '94.

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

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

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

[21]  Peter Sestoft,et al.  Analysis and efficient implementation of functional programs , 1991 .

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

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

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