Polymorphism, Subtyping, Whole Program Analysis and Accurate Data Types in Usage Analysis

  • Tobias Gedell
  • Jörgen Gustavsson
  • Josef Svenningsson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4279)


There are a number of choices to be made in the design of a type based usage analysis. Some of these are: Should the analysis be monomorphic or have some degree of polymorphism? What about subtyping? How should the analysis deal with user defined algebraic data types? Should it be a whole program analysis?

Several researchers have speculated that these features are important but there has been a lack of empirical evidence. In this paper we present a systematic evaluation of each of these features in the context of a full scale implementation of a usage analysis for Haskell.

Our measurements show that all features increase the precision. It is, however, not necessary to have them all to obtain an acceptable precision.


Usage Analysis Program Transformation Context Sensitivity Program Point Call Site 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [And94]
    Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen (DIKU report 94/19) (May 1994)Google Scholar
  2. [Aug93]
    Augustsson, L.: Implementing haskell overloading. In: Functional Programming Languages and Computer Architecture, pp. 65–73 (1993)Google Scholar
  3. [Das00]
    Das, M.: Unification-based pointer analysis with directional assignments. In: PLDI 2000, pp. 35–46. ACM Press, New York (2000)CrossRefGoogle Scholar
  4. [DHM95]
    Dussart, D., Henglein, F., Mossin, C.: Polymorphic recursion and subtype qualifications: Polymorphic binding-time analysis in polynomial time. In: Mycroft, A. (ed.) SAS 1995. LNCS, vol. 983. Springer, Heidelberg (1995)Google Scholar
  5. [DLFR01]
    Das, M., Liblit, B., Fähndrich, M., Rehof, J.: Estimating the impact of scalable pointer analysis on optimization. In: Cousot, P. (ed.) SAS 2001. LNCS, vol. 2126, p. 260. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  6. [Fax95]
    Faxén, K.-F.: Optimizing lazy functional programs using flow inference. In: Mycroft, A. (ed.) SAS 1995. LNCS, vol. 983, pp. 136–153. Springer, Heidelberg (1995)Google Scholar
  7. [FFA00]
    Foster, J.S., Fähndrich, M., Aiken, A.: Polymorphic versus monomorphic flow-insensitive points-to analysis for C. In: Palsberg, J. (ed.) SAS 2000. LNCS, vol. 1824, pp. 175–199. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  8. [FRD00]
    Fähndrich, M., Rehof, J., Das, M.: Scalable Context-Sensitive Flow Analysis using Instantiation Constraints. In: PLDI 2000, Vancouver B.C., Canada (June 2000)Google Scholar
  9. [Ged03]
    Gedell, T.: A Case Study on the Scalability of a Constraint Solving Algorithm: Polymorphic Usage Analysis with Subtyping. Master thesis (October 2003)Google Scholar
  10. [Ged06]
    Gedell, T.: Static analysis and deductive verification of programs. Licentiate thesis (2006)Google Scholar
  11. [GS00]
    Gustavsson, J., Svenningsson, J.: A usage analysis with bounded usage polymorphism and subtyping. In: Mohnen, M., Koopman, P. (eds.) IFL 2000. LNCS, vol. 2011, pp. 140–157. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  12. [GS01]
    Gustavsson, J., Svenningsson, J.: Constraint abstractions. In: Danvy, O., Filinski, A. (eds.) PADO 2001. LNCS, vol. 2053, pp. 63–83. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  13. [Gus98]
    Gustavsson, J.: A type based sharing analysis for update avoidance and optimisation. In: ICFP, ACM SIGPLAN Notices 34(1), pp. 39–50. ACM, New york (1998)Google Scholar
  14. [Hen93]
    Henglein, F.: Type inference with polymorphic recursion. ACM Transactions on Programming Languages and Systems 15(2), 253–289 (1993)CrossRefGoogle Scholar
  15. [HT01]
    Heintze, N., Tardieu, O.: Ultra-fast aliasing analysis using CLA: A million lines of C code in a second. In: PLDI 2001, pp. 254–263. ACM Press, New York (2001)CrossRefGoogle Scholar
  16. [Jon94]
    Jones, M.P.: Dictionary-free overloading by partial evaluation. In: Partial Evaluation and Semantics-Based Program Manipulation, Orlando, Florida (Technical Report 94/9, Department of Computer Science, University of Melbourne), pp. 107–117 (June 1994)Google Scholar
  17. [LGH+92]
    Launchbury, J., Gill, A., Hughes, J., Marlow, S., Peyton Jones, S.L., Wadler, P.: Avoiding Unnecessary Updates. In: Launchbury, J., Sansom, P.M. (eds.) Functional Programming, Workshops in Computing, Glasgow. Springer, Heidelberg (1992)Google Scholar
  18. [Mar93]
    Marlow, S.: Update Avoidance Analysis by Abstract Interpretation. In: Proc. 1993 Glasgow Workshop on Functional Programming, Workshops in Computing. Springer, Heidelberg (1993)Google Scholar
  19. [Myc82]
    Mycroft, A.: Abstract Interpretation and Optimizing Transformations for Applicative Programs. PhD thesis, University of Edinburg (1982)Google Scholar
  20. [Myc84]
    Mycroft, A.: Polymorphic Type Schemes and Recursive Definitions. In: Proceedings 6th International Symposium on Programming, Toulouse, July 1984. LNCS. Springer, Heidelberg (1984)Google Scholar
  21. [Par93]
    Partain, W.: The nofib benchmark suite of haskell programs (1993)Google Scholar
  22. [PJM99]
    Jones, S.P., Marlow, S.: Secrets of the Glasgow Haskell compiler inliner. In: Workshop on Implementing Declarative Languages (1999)Google Scholar
  23. [PJPS96]
    Peyton Jones, S., Partain, W., Santos, A.: Let-floating: moving bindings to give faster programs. In: Proc. of ICFP 1996, ACM SIGPLAN Notices, vol. 31(6), pp. 1–12. ACM, New York (1996)Google Scholar
  24. [Ste96]
    Steensgaard, B.: Points-to analysis in almost linear time. In: POPL 1996, pp. 32–41. ACM Press, New York (1996)CrossRefGoogle Scholar
  25. [TWM95]
    Turner, D.N., Wadler, P., Mossin, C.: Once upon a type. In: Proc. of FPCA, La Jolla. ACM Press, New York (1995)Google Scholar
  26. [Wan02]
    Wansbrough, K.: Simple Polymorphic Usage Analysis. PhD thesis, Computer Laboratory. Cambridge University, England (March 2002)Google Scholar
  27. [WPJ99]
    Wansbrough, K., Jones, S.P.: Once Upon a Polymorphic Type. In: Proc. of POPL 1999. ACM Press, New York (1999)Google Scholar
  28. [WPJ00]
    Wansbrough, K., Jones, S.P.: Simple Usage Polymorphism. In: ACM SIGPLAN Workshop on Types in Compilation. Springer, Heidelberg (2000)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Tobias Gedell
    • 1
  • Jörgen Gustavsson
    • 2
  • Josef Svenningsson
    • 1
  1. 1.Department of Computing ScienceChalmers University of Technology and Göteborg University 
  2. 2.Spotfire, Inc. 

Personalised recommendations