Skip to main content

Cost Analysis Using Automatic Size and Time Inference

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2670))

Abstract

Cost information can be exploited in a variety of contexts, including parallelizing compilers, autonomic GRIDs and real-time systems. In this paper, we introduce a novel type and effect system — the sized time system that is capable of determining upper bounds for both time and space costs, and which we initially intend to apply to determining good granularity for parallel tasks. The analysis is defined for a simple, strict, higher-order and polymorphic functional language, \( \mathcal{L} \) , incorporating arbitrarily-sized list data structures. The inference algorithm implementing this analysis constructs cost- and size-terms for \( \mathcal{L} \)-expressions, plus constraints over free size and cost variables in those terms that can be solved to produce information for higher-order functions. The paper presents both the analysis and the inference algorithm, providing examples that illustrate the primary features of the analysis.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Hammond, K., Michaelson, G.: Parallel Functional Programming. Springer (2000)

    Google Scholar 

  2. Nielson, F., Nielson, H.R., Hankin, C.: Principles of Program Analysis. Springer (1999)

    Google Scholar 

  3. Mitchell, J.C.: Subtyping and Related Concepts. In: Foundations for Programming Languages. MIT Press (1996)

    Google Scholar 

  4. Hughes, R., Pareto, L., Sabry, A.: Proving the Correctness of Reactive Systems using Sized Types. In: POPL’96, St Petersburg, FL (1996)

    Google Scholar 

  5. Reistad, B., Gifford, D.: Static Dependent Costs for Estimating Execution Time. In: LFP’94, Orlando, FL (1994) 65–78

    Google Scholar 

  6. Frühwirth, T.: Theory and practice of constraint handling rules. Journal of Logic Programming 37 (1998)

    Google Scholar 

  7. Smolka, G.: The Oz Programming Model. In: Computer Science Today. LNCS 1000. Springer (1995) 324–343

    Chapter  Google Scholar 

  8. Jones, S.P., Hughes, J., Augustsson, L., Barton, D., Boutel, B., Burton, W., Fasel, J., Hammond, K., Hinze, R., Hudak, P., Johnsson, T., Jones, M., Launchbury, J., Meijer, E., Peterson, J., Reid, A., Runciman, C., Wadler, P.: Haskell 98: A Non-Strict, Purely Functional Language. (1999)

    Google Scholar 

  9. Loidl, H.W., Hammond, K.: A Sized Time System for a Parallel Functional Language. In: Glasgow Workshop on Functional Programming, Ullapool (1996)

    Google Scholar 

  10. Loidl, H.W.: Granularity in Large-Scale Parallel Functional Programming. PhD thesis, Department of Computing Science, University of Glasgow (1998)

    Google Scholar 

  11. Dornic, V., Jouvelot, P., Gifford, D.: Polymorphic Time Systems for Estimating Program Complexity. ACM Letters on Prog. Lang. and Systems 1 (1992) 33–45

    Article  Google Scholar 

  12. Grobauer, B.: Cost Recurrences for DML Programs. In: ICFP’01, Florence, Italy, ACM Press (2001)

    Google Scholar 

  13. Chin, W.N., Khoo, S.C.: Calculating sized types. Higher-Order and Symbolic Computing 14 (2001)

    Google Scholar 

  14. Le Métayer, D.: ACE: An Automatic Complexity Evaluator. TOPLAS 10 (1988)

    Google Scholar 

  15. Rosendahl, M.: Automatic Complexity Analysis. In: FPCA’89. (1989) 144–156

    Google Scholar 

  16. Flajolet, P., Salvy, B., Zimmermann, P.: Automatic Average-Case Analysis of Algorithms. Theoretical Computer Science 79 (1991) 37–109

    Article  MATH  MathSciNet  Google Scholar 

  17. Huelsbergen, L., Larus, J., Aiken, A.: Using Run-Time List Sizes to Guide Parallel Thread Creation. In: LFP’94, Orlando, FL (1994) 79–90

    Google Scholar 

  18. Debray, S., Lin, N.W., Hermenegildo, M.: Task Granularity Analysis in Logic Programs. In: PLDI’90. SIGPLAN Notices 25(6), ACM Press (1990) 174–188

    Article  Google Scholar 

  19. Tick, E., Zhong, X.: A Compile-Time Granularity Analysis Algorithm and its Performance Evaluation. New Generation Computing 11 (1993) 271–295

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2003 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Rebón Portillo, Á.J., Hammond, K., Loidl, HW., Vasconcelos, P. (2003). Cost Analysis Using Automatic Size and Time Inference. In: Peña, R., Arts, T. (eds) Implementation of Functional Languages. IFL 2002. Lecture Notes in Computer Science, vol 2670. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44854-3_15

Download citation

  • DOI: https://doi.org/10.1007/3-540-44854-3_15

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-40190-2

  • Online ISBN: 978-3-540-44854-9

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics