Advertisement

Collected Size Semantics for Functional Programs over Lists

  • Olha Shkaravska
  • Marko van Eekelen
  • Alejandro Tamalet
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5836)

Abstract

This work introduces collected size semantics of strict functional programs over lists. The collected size semantics of a function definition is a multivalued size function that collects the dependencies between every possible output size and the corresponding input sizes. Such functions annotate standard types and are defined by conditional rewriting rules generated during type inference.

We focus on the connection between the rewriting rules and lower and upper bounds on the multivalued size functions, when the bounds are given by piecewise polynomials. We show how, given a set of conditional rewriting rules, one can infer bounds that define an indexed family of polynomials that approximates the multivalued size function.

Using collected size semantics we are able to infer non-monotonic and non-linear lower and upper polynomial bounds for many functional programs. As a feasibility study, we use the procedure to infer lower and upper polynomial size-bounds on typical functions of a list library.

Keywords

Type System Operational Semantic Size Function Inference Procedure Typing Rule 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Albert, E., Arenas, P., Genaim, S., Puebla, G.: Automatic Inference of Upper Bounds for Recurrence Relations in Cost Analysis. In: Alpuente, M., Vidal, G. (eds.) SAS 2008. LNCS, vol. 5079, pp. 221–237. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  2. 2.
    Albert, E., Arenas, P., Genaim, S., Puebla, G., Zanardini, D.: Cost Analysis of Java Bytecode. In: De Nicola, R. (ed.) ESOP 2007. LNCS, vol. 4421, pp. 157–172. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  3. 3.
    Amadio, R.M.: Synthesis of max-plus quasi-interpretations. Fundamenta Informaticae 65(1-2), 29–60 (2004)MathSciNetzbMATHGoogle Scholar
  4. 4.
    Aspinall, D., MacKenzie, K.: Mobile Resource Guarantees and Policies. In: Barthe, G., Grégoire, B., Huisman, M., Lanet, J.-L. (eds.) CASSIS 2005. LNCS, vol. 3956, pp. 16–36. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  5. 5.
    Atassi, V., Baillot, P., Terui, K.: Verification of Ptime Reducibility for System F Terms: Type Inference in Dual Light Affine Logic. Logical Methods in Computer Science 3(4) (2007)Google Scholar
  6. 6.
    Bonfante, G., Marion, J.-Y., Moyen, J.-Y.: Quasi-interpretations, a way to control resources. Theoretical Computer Science (2005)Google Scholar
  7. 7.
    Campbell, B.: Space Cost Analysis Using Sized Types. PhD thesis, School of Informatics, University of Edinburgh (2008)Google Scholar
  8. 8.
    Chui, C.K., Lai, M.-J.: Vandermonde determinants and lagrange interpolation in R s. Nonlinear and Convex Analysis, 23–35 (1987)Google Scholar
  9. 9.
    Gaboardi, M., Marion, J.-Y., Ronchi Della Rocca, S.: A logical account of PSPACE. In: Proceedingsof the 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages POPL 2008, San Francisco, January 10-12, pp. 121–131 (2008)Google Scholar
  10. 10.
    Hirokawa, N., Middeldorp, A.: Polynomial interpretations with negative coefficients. In: Buchberger, B., Campbell, J. (eds.) AISC 2004. LNCS (LNAI), vol. 3249, pp. 185–198. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  11. 11.
    Hofmann, M., Jost, S.: Static prediction of heap space usage for first-order functional programs. SIGPLAN Not. 38(1), 185–197 (2003)CrossRefzbMATHGoogle Scholar
  12. 12.
    Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)Google Scholar
  13. 13.
    Shkaravska, O., van Eekelen, M., Tamalet, A.: Collected size semantics for functional programs. Technical Report ICIS-R08021, Radboud University Nijmegen (November 2008)Google Scholar
  14. 14.
    Shkaravska, O., van Eekelen, M., Tamalet, A.: Polynomial size complexity analysis with families of piecewise polynomials. Technical Report ICIS-R08020, Radboud University Nijmegen (November 2008)Google Scholar
  15. 15.
    Shkaravska, O., van Kesteren, R., van Eekelen, M.: Polynomial Size Analysis of First-Order Functions. In: Rocca, S.R.D. (ed.) TLCA 2007. LNCS, vol. 4583, pp. 351–366. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  16. 16.
    Tamalet, A., Shkaravska, O., van Eekelen, M.: Size Analysis of Algebraic Data Types. In: Morazán, M. (ed.) Selected Papers of the 9th International Symposium on Trends in Functional Programming (TFP 2008). Intellect Publishers (2008) (to appear)Google Scholar
  17. 17.
    van Eekelen, M., Shkaravska, O., van Kesteren, R., Jacobs, B., Poll, E., Smetsers, S.: AHA: Amortized Heap Space Usage Analysis. In: Morazán, M. (ed.) Selected Papers of the 8th International Symposium on Trends in Functional Programming (TFP 2007), New York, USA, pp. 36–53. Intellect Publishers, UK (2007)Google Scholar
  18. 18.
    van Kesteren, R., Shkaravska, O., van Eekelen, M.: Inferring static non-monotonically sized types through testing. In: Proceedings of 16th International Workshop on Functional and (Constraint) Logic Programming (WFLP 2007), Paris, France. ENTCS, vol. 216C, pp. 45–63 (2007)Google Scholar
  19. 19.
    Vasconcelos, P.B.: Space Cost Analysis Using Sized Types. PhD thesis, School of Computer Science, University of St. Andrews (August 2008)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Olha Shkaravska
    • 1
  • Marko van Eekelen
    • 1
  • Alejandro Tamalet
    • 1
  1. 1.Institute for Computing and Information SciencesRadboud University NijmegenNetherlands

Personalised recommendations