Abstract
Equality-based control-flow analysis has been studied by Henglein, Bondorf and Jørgensen, DeFouw, Grove, and Chambers, and others. It is faster than the subset-based-0-CFA, but also more approximate. Heintze asserted in 1995 that a program can be safety checked with an equality-based control-flow analysis if and only if it can be typed with recursive types. In this article we falsify Heintze's assertion, and we present a type system equivalent to equality-based control-flow analysis. The new type system contains both recursive types and an unusual notion of subtyping. We have s ≤ t if s and t unfold to the same regular tree, and we have ⊥≤t≤⊤ where t is a function type. In particular, there is no nontrivial subtyping between function types.
- AMADIO, R. M. AND CARDELLI, L. 1993. Subtyping recursive types. ACM Trans. Program. Lang. Syst. 15, 4, 575-631. Google ScholarDigital Library
- ASHLEY, J. M. 1996. A practical and flexible flow analysis for higher-order languages. In Proceedings of POPL '96, 23rd Annual SIGPLAN-SIGA CT Symposium on Principles of Programming Languages. ACM, New York, 184-194. Google ScholarDigital Library
- BONDORF, t. AND JORGENSEN, J. 1993. Efficient analyses for realistic off-line partial evaluation. J. of Func. Program. 3, 3, 315-346.Google ScholarCross Ref
- BRUCE, I~. B., CARDELLI, L., CASTAGNA, G., EIFRIG, J., SMITH, S. F., TRIFONOV, V., LEAVENS, G. T., AND PIERCE, B. C. 1995. On binary methods. Theory Pract. Obj. Syst. 1, 3, 221-242. Google ScholarDigital Library
- DEFouw, G., GROVE, D., AND CHAMBERS, C. 1998. Fast interprocedural class analysis. In Proceedings of POPL '98, 25th Annual SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 222-236. Google ScholarDigital Library
- GOSLING, J., JoY, B., AND STEELE, G. 1996. The Java Language Specification. Addison-Wesley, Reading, Mass. Google ScholarDigital Library
- HEINTZE, N. 1995. Control-flow analysis and type systems. In Proceedings of SAS'95, International Static Analysis Symposium. Lecture Notes in Computer Science, vol. 983. Springer-Verlag, Berlin, 189-206. Google ScholarDigital Library
- HEINTZE, N. AND MCALLESTER, D. 1997. Linear-time subtransitive control flow analysis. In Proceedings of ACM SIGPLAN 1997 Conference on Programming Language Design and Iraplementation. ACM, New York, 261-272. Google ScholarDigital Library
- HENGLEIN, F. 1992. Dynamic typing. In Proceedings of ESOP'92, European Symposium on Programming. Lecture Notes in Computer Science, vol. 582. Springer-Verlag, Berlin, 233-253. Google ScholarDigital Library
- MILNER, R., WOFTE, M., AND HARPER, R. 1990. The Definition of Standard ML. MIT Press, Cambridge, Mass. Google ScholarDigital Library
- PALSBERG~ J. 1995. Closure analysis in constraint form. ACM Trans. Program. Lang. Syst. 17, 1 (Jan.), 47-62. Google ScholarDigital Library
- PALSBERG, J. AND O'I~EEFE, P. M. 1995. A type system equivalent to flow analysis. ACM Trans. Program. Lang. Syst. 17, 4 (July), 576-599. Google ScholarDigital Library
- PALSBERG~ J. AND PAVLOPOULOU~ C. 1998. From polyvariant flow information to intersection and union types. In Proceedings of POPL'98, 25th Annual SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 197-208. Google ScholarDigital Library
- PALSBERG~ J. AND SCHWARTZBACH~ M. I. 1994. Object-Oriented Type Systems. John Wiley & Sons, New York. Google ScholarDigital Library
- SHAPIRO~ M. AND HORWITZ~ S. 1997. Fast and accurate flow-insensitive points-to analysis. In Proceedings of POPL '97, 2~th Annual SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 1-14. Google ScholarDigital Library
- SHIVERS~ O. 1991. Control-flow analysis of higher-order languages. Ph.D. thesis, CMU-CS-91-145, Carnegie Mellon Univ., Pittsburgh, Pa. Google ScholarDigital Library
- STEENSGAARD~ B. 1996. Points-to analysis in almost linear time. In Proceedings of POPL'96, 23nd Annual SIGPLAN-SIGA CT Symposium on Principles of Programming Languages. ACM, New York, 32-41. Google ScholarDigital Library
Index Terms
- Equality-based flow analysis versus recursive types
Recommendations
A flow-based approach for variant parametric types
Proceedings of the 2006 OOPSLA ConferenceA promising approach for type-safe generic codes in the object-oriented paradigm is variant parametric type, which allows covariant and contravariant subtyping on fields where appropriate. Previous approaches formalise variant type as a special case of ...
Recursive type generativity
Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingExistential types provide a simple and elegant foundation for understanding generative abstract data types, of the kind supported by the Standard ML module system. However, in attempting to extend ML with support for recursive modules, we have found ...
Recursive type generativity
ICFP '05: Proceedings of the tenth ACM SIGPLAN international conference on Functional programmingExistential types provide a simple and elegant foundation for understanding generative abstract data types, of the kind supported by the Standard ML module system. However, in attempting to extend ML with support for recursive modules, we have found ...
Comments