Higher-Order and Symbolic Computation

, Volume 23, Issue 3, pp 315–335

Making “stricterness” more relevant

Open Access
Article

Abstract

Adapting a strictness analyser to have it take into account explicit strictness annotations can be a tricky business. Straightforward extensions of analyses based on relevance typing are likely to either be unsafe or fail to pick the fruits of increases in strictness that are introduced through annotations. We propose a more involved adaptation of relevance typing, that can be used to derive strictness analyses that are both safe and effective in the presence of explicit strictness annotations. The resulting type system provides a firm foundation for implementations of type-based strictness analysers in compilers for lazy programming languages such as Haskell and Clean.

Keywords

Lazy evaluation Strictness analysis Relevance typing Explicit strictness annotations Functional languages Type and effect systems 

References

  1. 1.
    Amtoft, T.: Minimal thunkification. In: Cousot, P., Falaschi, M., Filé, G., Rauzy, A. (eds.) Static Analysis, Third International Workshop, WSA’93, Proceedings, Padova, Italy, 22–24 September 1993. Lecture Notes of Computer Science, vol. 724, pp. 218–229. Springer, Berlin (1993) Google Scholar
  2. 2.
    Anderson, A.R., Belnap, N.D. Jr.: Entailment: The Logic of Relevance and Necessity, vol. 1. Princeton University Press, Princeton (1975) MATHGoogle Scholar
  3. 3.
    Anderson, A.R., Belnap, N.D. Jr., Dunn, J.M.: Entailment: The Logic of Relevance and Necessity, vol. 2. Princeton University Press, Princeton (1992) MATHGoogle Scholar
  4. 4.
    Baker-Finch, C.A.: Relevant logic and strictness analysis. In: Billaud, M., Castéran, P., Corsini, M.-M., Musumbu, K., Rauzy, A. (eds.) Actes WSA’92 Workshop on Static Analysis (Bordeaux), Laboratoire Bordelais de Recherche en Informatique (LaBRI), Proceedings, 23–25 September 1992. Series Bigre, vols. 81–82, pp. 221–228. Atelier Irisa, Rennes (1992) Google Scholar
  5. 5.
    Barendregt, H.P., Kennaway, R., Klop, J.W., Sleep, M.R.: Needed reduction and spine strategies for the lambda calculus. Inf. Comput. 75(3), 191–231 (1987) CrossRefMATHMathSciNetGoogle Scholar
  6. 6.
    Benton, N.: Strictness analysis of lazy functional programs. Ph.D. thesis, University of Cambridge (1992) Google Scholar
  7. 7.
    Burn, G.L., Hankin, C., Abramsky, S.: The theory of strictness analysis for higher order functions. In: Ganzinger, H., Jones, N.D. (eds.) Programs as Data Objects, Proceedings of a Workshop, Copenhagen, Denmark, 17–19 October 1985. Lecture Notes in Computer Science, vol. 217, pp. 42–62. Springer, Berlin (1986) Google Scholar
  8. 8.
    Cervesato, I., Pfenning, F.: A linear logical framework. Inf. Comput. 179(1), 19–75 (2002) CrossRefMATHMathSciNetGoogle Scholar
  9. 9.
    Coppo, M., Damiani, F., Giannini, P.: Strictness analysis, totality, and non-standard-type inference. Theor. Comput. Sci. 272(1–2), 69–112 (2002) CrossRefMATHMathSciNetGoogle Scholar
  10. 10.
    Davis, K., Wadler, P.: Backwards strictness analysis: Proved and improved. In: Davis, K., Hughes, J. (eds.) Functional Programming, Proceedings of the 1989 Glasgow Workshop, Workshops in Computing, 21–23 August 1989, Fraserburgh, Scotland, UK, pp. 12–30. Springer, Berlin (1990) Google Scholar
  11. 11.
    van Eekelen, M., de Mol, M.: Proof tool support for explicit strictness. In: Butterfield, A., Grelck, C., Huch, F. (eds.) Implementation and Application of Functional Languages, 17th International Workshop, Revised Selected Papers, IFL 2005, Dublin, Ireland, September 19–21. Lecture Notes in Computer Science, vol. 4015, pp. 37–54. Springer, Berlin (2006) Google Scholar
  12. 12.
    Gill, A., Launchbury, J., Jones, S.P.: A short cut to deforestation. In: FPCA’93 Conference on Functional Programming and Computer Architecture, Copenhagen, Denmark, 9–11 June 1993, pp. 223–232. ACM Press, New York (1993) CrossRefGoogle Scholar
  13. 13.
    Glynn, K., Stuckey, P.J., Sulzmann, M.: Effective strictness analysis with HORN constraints. In: Cousot, P. (ed.) Static Analysis, 8th International Symposium, SAS 2001, Proceedings, Paris, France, 16–18 July 2001. Lecture Notes in Computer Science, vol. 2126, pp. 73–92. Springer, Berlin (2001) Google Scholar
  14. 14.
    Hage, J., Holdermans, S.: Heap recycling for lazy languages. In: Hatcliff, J., Glück, R., de Moor, O. (eds.) Proceedings of the 2008 ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, PEPM’08, San Francisco, California, USA, 7–8 January 2008, pp. 189–197. ACM Press, New York (2008) CrossRefGoogle Scholar
  15. 15.
    Hage, J., Holdermans, S., Middelkoop, A.: A generic usage analysis with subeffect qualifiers. In: Hinze, R., Ramsey, N. (eds.) Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, Freiburg, Germany, 1–3 October 2007, pp. 235–246. ACM Press, New York (2007) Google Scholar
  16. 16.
    Hinze, R.: Projection-based strictness analysis: theoretical and practical aspects. Ph.D. thesis, Bonn University (1995) Google Scholar
  17. 17.
    Holdermans, S., Hage, J.: Making “stricterness” more relevant. In: Gallagher, J.P., Voigtländer, J. (eds.) Proceedings of the 2010 ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, PEPM 2010, Madrid, Spain, 18–19 January 2010, pp. 121–130. ACM Press, New York (2010) CrossRefGoogle Scholar
  18. 18.
    Hudak, P., Hughes, J., Jones, S.P., Wadler, P.: A history of Haskell: Being lazy with class. In: Ryder, B.G., Hailpern, B. (eds.) Proceedings of the Third ACM SIGPLAN History of Programming Languages Conference, HOPL-III, San Diego, California, USA, 9–10 June 2007, pp. 1–55. ACM Press, New York (2007) Google Scholar
  19. 19.
    Hughes, J.: Backwards analysis of functional programs. In: Björner, A., Jones, N.D., Ershov, A.P. (eds.) Partial Evaluation and Mixed Computation: Proceedings of the IFIP TC2 Workshop, Gammel Avernaes, Denmark, 18–24 Oct. 1987, pp. 187–208. North-Holland, Amsterdam (1988) Google Scholar
  20. 20.
    Hughes, J.: Why functional programming matters. Comput. J. 32(2), 98–107 (1989) CrossRefGoogle Scholar
  21. 21.
    Jensen, T.P.: Strictness analysis in logical form. In: Hughes, J. (ed.) Functional Programming Languages and Computer Architecture, 5th ACM Conference, Proceedings, Cambridge, MA, USA, 26–30 August 1991, pp. 352–366. Springer, Berlin (1991) Google Scholar
  22. 22.
    Jensen, T.P.: Inference of polymorphic and conditional strictness properties. In: POPL’98, Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 19–21 January 1998, San Diego, CA, USA, pp. 209–221. ACM Press, New York (1998) CrossRefGoogle Scholar
  23. 23.
    Johann, P., Voigtländer, J.: The impact of seq on free theorems-based program transformations. Fundam. Inform. 69(1–2), 63–102 (2006) MATHGoogle Scholar
  24. 24.
    Kahn, G.: Natural semantics. In: Brandenburg, F.-J., Vidal-Naquet, G., Wirsing, M. (eds.) STACS 87, 4th Annual Symposium on Theoretical Aspects of Computer Science, Proceedings, Passau, Germany, 19–21 February 1987. Lecture Notes in Computer Science, vol. 247, pp. 22–39 (1987) Google Scholar
  25. 25.
    Kuo, T.-M., Mishra, P.: Strictness analysis: A new perspective based on type inference. In: FPCA’89, Conference on Functional Programming Languages and Computer Architecture, Imperial College, London, England, 11–13 September 1989, pp. 260–272. ACM Press, New York (1989) CrossRefGoogle Scholar
  26. 26.
    Morris, J.: Lambda-calculus models of programming languages. Ph.D. thesis, Massachusetts Institute of Technology (1968) Google Scholar
  27. 27.
    Mycroft, A.: The theory and practice of transforming call-by-need into call-by-value. In: Robinet, B. (ed.) International Symposium on Programming, Proceedings of the Fourth ‘Colloque International sur la Programmation’, Paris, France, 22–24 April 1980. Lecture Notes in Computer Science, vol. 83, pp. 269–281. Springer, Berlin (1980) Google Scholar
  28. 28.
    Nielson, F., Nielson, H.R.: Type and effect systems. In: Olderog, E.-R., Steffen, B. (eds.) Correct System Design, Recent Insight and Advances (to Hans Langmaack on the occasion of his retirement from his professorship at the University of Kiel). Lecture Notes in Computer Science, vol. 1710, pp. 114–136. Springer, Berlin (1999) Google Scholar
  29. 29.
    Nöcker, E.: Strictness analysis using abstract reduction. In: FPCA’93 Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, 9–11 June 1993, pp. 255–265. ACM Press, New York (1993) CrossRefGoogle Scholar
  30. 30.
    Orlov, I.E.: Ischislenie sovmestimosti predlozhenii. Mat. Sb. 35(3–4), 263–286 (1928) MATHGoogle Scholar
  31. 31.
    Jones, S.P. (ed.): Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, Cambridge (2003) Google Scholar
  32. 32.
    Plasmeijer, R., van Eekelen, M.: Concurrent Clean language report—version 1.3. Technical Report CSI-R9816, University of Nijmegen (1998) Google Scholar
  33. 33.
    Schmidt-Schauß, M., Sabel, D., Schütz, M.: Safety of Nöcker’s strictness analysis. J. Funct. Program. 18(4), 503–551 (2008) CrossRefMATHGoogle Scholar
  34. 34.
    Seidel, D., Voigtländer, J.: Refined typing to localize the impact of forced strictness on free theorems. Acta Inform. 48(3), 191–211 (2011) CrossRefMathSciNetGoogle Scholar
  35. 35.
    Gasser, K.L.S., Nielson, H.R., Nielson, F.: Strictness and totality analysis. Sci. Comput. Program. 31(1), 113–145 (1998) CrossRefMATHGoogle Scholar
  36. 36.
    Talpin, J.-P., Jouvelot, P.: Polymorphic type, region and effect inference. J. Funct. Program. 2(3), 245–271 (1992) CrossRefMATHMathSciNetGoogle Scholar
  37. 37.
    de Vries, E.: Making uniqueness typing less unique. Ph.D. thesis, Trinity College Dublin (2008) Google Scholar
  38. 38.
    de Vries, E., Plasmeijer, R., Abrahamson, D.: Uniqueness typing simplified. In: Chitil, O., Horváth, Z., Zsók, V. (eds.) Implementation and Application of Functional Languages, 19th International Symposium, Revised Selected Papers, IFL 2007, Freiburg, Germany, September 2007. Lecture Notes in Computer Science, vol. 5083, pp. 201–218. Springer, Berlin (2008) Google Scholar
  39. 39.
    Wadler, P.: Strictness analysis on non-flat domains (by abstract interpretation over finite domains). In: Abramsky, S., Hankin, C. (eds.) Abstract Interpretation of Declarative Languages, pp. 266–275. Ellis Horwood, Chichester (1987) Google Scholar
  40. 40.
    Wadler, P.: Theorems for free! In: FPCA’89 Conference on Functional Programming and Computer Architecture, Imperial College, London, England, 11–13 September 1989, pp. 347–359. ACM Press, New York (1989) CrossRefGoogle Scholar
  41. 41.
    Walker, D.: Substructural type systems. In: Pierce, B.C. (ed.) Advanced Topics in Types and Programming Languages. The MIT Press, Cambridge (2005) Google Scholar
  42. 42.
    Wright, D.A.: A new technique for strictness analysis. In: Abramsky, S., Maibaum, T. (eds.) TAPSOFT’91: Proceedings of the International Joint Conference on Theory and Practice of Software Development. Vol. 2: Advances in Distributed Computing (ADC) and Colloquium on Combining Paradigms for Software Development (CCPSD), Brighton, UK, 8–12 April 1991. Lecture Notes in Computer Science, vol. 494, pp. 235–258. Springer, Berlin (1991) Google Scholar

Copyright information

© The Author(s) 2011

Authors and Affiliations

  1. 1.Vector FabricsEindhovenThe Netherlands
  2. 2.Department of Information and Computing SciencesUtrecht UniversityUtrechtThe Netherlands

Personalised recommendations