Abstract
We present a light-weight tool called Sloth which assists programmers in identifying unnecessarily strict first order functions. Sloth reports counterexamples in form of a partial value, the corresponding result of the tested function and a recommended result. We present examples where the hints reported by Sloth can be used to improve a function with respect to memory behaviour, non-termination, and performance in the context of functional-logic programming. Furthermore we give an example-driven introduction into the basics of the implementation of Sloth. To improve the results in comparison to an existing approach we use additional constraints to assure that Sloth’s suggestions are implementable without employing parallelism.
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
Antoy, S., Hanus, M.: Overlapping rules and logic variables in functional logic programs. In: Etalle, S., Truszczyński, M. (eds.) ICLP 2006. LNCS, vol. 4079, pp. 87–101. Springer, Heidelberg (2006)
Augustsson, L.: numbers Package, hackage.haskell.org/package/numbers/ (Version 2009.8.9)
Brassel, B., Huch, F.: The Kiel Curry System KiCS. In: WLP 2007 Preproceedings, Technical Report 434 (2007)
Brassel, B., Fischer, S., Huch, F.: Declaring Numbers. In: WFLP 2004 Proceedings (2007)
Chitil, O.: Promoting Non-Strict Programming. In: IFL 2006 Draft Proceedings (2006)
Elliott, C.: Push-pull functional reactive programming. In: Haskell Symposium 2009 Proceedings (2009)
Fischer, D.: Unnecessarily strict implementations. Haskell-Cafe Mailing List (September 2010)
Fischer, D., Kuklewicz, C., Bailey, J.: Sringsearch Package, http://hackage.haskell.org/package/stringsearch/ (Version 0.3.1)
Hanus, M.: Curry: An Integrated Functional Logic Language, Vers. 0.8.2 (2006), curry-language.org
Hughes, J.: Why Functional Programming Matters. Computer Journal (1989)
Runciman, C., Naylor, M., Lindblad, F.: Smallcheck and lazy smallcheck: automatic exhaustive testing for small values. In: Haskell Workshop 2008 Proceedings (2009)
Thielemann, H.: Utility-ht Package, http://hackage.haskell.org/package/utility-ht/ (Version 0.0.5.1)
Vuillemin, J.E.: Proof-techniques for recursive programs. PhD thesis, Stanford University (1974)
Wadler, P.: Theorems for free! In: FPCA 1989 Proceedings (1989)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Christiansen, J. (2011). Sloth – A Tool for Checking Minimal-Strictness. In: Rocha, R., Launchbury, J. (eds) Practical Aspects of Declarative Languages. PADL 2011. Lecture Notes in Computer Science, vol 6539. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-18378-2_14
Download citation
DOI: https://doi.org/10.1007/978-3-642-18378-2_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-18377-5
Online ISBN: 978-3-642-18378-2
eBook Packages: Computer ScienceComputer Science (R0)