Abstract
Bounding resource usage is important for a number of areas, notably real-time embedded systems and safety-critical systems. In this paper, we present a fully automatic static type-based analysis for inferring upper bounds on resource usage for programs involving general algebraic datatypes and full recursion. Our method can easily be used to bound any countable resource, without needing to revisit proofs. We apply the analysis to the important metrics of worst-case execution time, stack- and heap-space usage. Our results from several realistic embedded control applications demonstrate good matches between our inferred bounds and measured worst-case costs for heap and stack usage. For time usage we infer good bounds for one application. Where we obtain less tight bounds, this is due to the use of software floating-point libraries.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Albert, E., Genaim, S., Gómez-Zamalloa, M.: Live Heap Space Analysis for Languages with Garbage Collection. In: Proc. ISMM 2009: Intl. Symp. on Memory Management, Dublin, Ireland, June 2009, pp. 129–138. ACM, New York (2009)
Berkelaar, M., Eikland, K., Notebaert, P.: lp_solve: Open source (mixed-integer) linear programming system. GNU LGPL (Lesser General Public Licence), http://lpsolve.sourceforge.net/5.5
Braberman, V., Fernández, F., Garbervetsky, D., Yovine, S.: Parametric Prediction of Heap Memory Requirements. In: Proc. ISMM 2008: Intl. Symp. on Memory Management, Tucson, USA, June 2008, pp. 141–150. ACM, New York (2008)
Campbell, B.: Amortised Memory Analysis Using the Depth of Data Structures. In: Castagna, G. (ed.) ESOP 2009. LNCS, vol. 5502, pp. 190–204. Springer, Heidelberg (2009)
Chin, W.-N., Khoo, S.-C.: Calculating Sized Types. Higher-Order and Symbolic Computing 14(2,3), 261–300 (2001)
Chin, W.-N., Nguyen, H., Popeea, C., Qin, S.: Analysing Memory Resource Bounds for Low-Level Programs. In: Proc. ISMM 2008: Intl. Symp. on Memory Management, Tucson, USA, June 2008, pp. 151–160. ACM, New York (2008)
Crary, K., Weirich, S.: Resource Bound Certification. In: Proc. POPL 2000: ACM Symp. on Principles of Prog. Langs., Boston, USA, January 2000, pp. 184–198. ACM, New York (2000)
Ferdinand, C., Martin, F., Wilhelm, R., Alt, M.: Cache Behavior Prediction by Abstract Interpretation. Science of Comp. Prog. 35(2), 163–189 (1999)
Hammond, K., Michaelson, G.: Hume: a Domain-Specific Language for Real-Time Embedded Systems. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 37–56. Springer, Heidelberg (2003)
Hofmann, M.: A Type System for Bounded Space and Functional In-Place Update. Nordic Journal of Computing 7(4), 258–289 (Winter 2000)
Hofmann, M., Jost, S.: Static Prediction of Heap Space Usage for First-Order Functional Programs. In: Proc. POPL 2003: ACM Symp. on Principles of Prog. Langs., New Orleans, USA, January 2003, pp. 185–197. ACM, New York (2003)
Hofmann, M., Jost, S.: Type-Based Amortised Heap-Space Analysis. In: Sestoft, P. (ed.) ESOP 2006. LNCS, vol. 3924, pp. 22–37. Springer, Heidelberg (2006)
Hughes, R., Pareto, L., Sabry, A.: Proving the Correctness of Reactive Systems Using Sized Types. In: Proc. POPL 1996: ACM Symp. on Principles of Prog. Langs, St. Petersburg Beach, USA, January 1996, pp. 410–423. ACM, New York (1996)
Kuo, S.M., Lee, B.H., Tian, W.: Real-Time Digital Signal Processing: Implementations and Applications, 2nd edn., April 2006. Wiley, Chichester (2006)
Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)
Shkaravska, O., van Kesteren, R., van Eekelen, M.: Polynomial Size Analysis of First-Order Functions. In: Della Rocca, S.R. (ed.) TLCA 2007. LNCS, vol. 4583, pp. 351–365. Springer, Heidelberg (2007)
Tarjan, R.E.: Amortized Computational Complexity. SIAM Journal on Algebraic and Discrete Methods 6(2), 306–318 (1985)
Vasconcelos, P., Hammond, K.: Inferring Cost Equations for Recursive, Polymorphic and Higher-Order Functional Programs. In: Trinder, P., Michaelson, G.J., Peña, R. (eds.) IFL 2003. LNCS, vol. 3145, pp. 86–101. Springer, Heidelberg (2004)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2009 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jost, S., Loidl, HW., Hammond, K., Scaife, N., Hofmann, M. (2009). “Carbon Credits” for Resource-Bounded Computations Using Amortised Analysis. In: Cavalcanti, A., Dams, D.R. (eds) FM 2009: Formal Methods. FM 2009. Lecture Notes in Computer Science, vol 5850. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-05089-3_23
Download citation
DOI: https://doi.org/10.1007/978-3-642-05089-3_23
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-05088-6
Online ISBN: 978-3-642-05089-3
eBook Packages: Computer ScienceComputer Science (R0)