Abstract
Parametricity, in both operational and denotational forms, has long been a useful tool for reasoning about program correctness. However, there is as yet no comparable technique for reasoning about program improvement, that is, when one program uses fewer resources than another. Existing theories of parametricity cannot be used to address this problem as they are agnostic with regard to resource usage. This article addresses this problem by presenting a new operational theory of parametricity that is sensitive to time costs, which can be used to reason about time improvement properties. We demonstrate the applicability of our theory by showing how it can be used to prove that a number of well-known program fusion techniques are time improvements, including fixed point fusion, map fusion and short cut fusion.
Supplemental Material
- Sascha Böhme. 2007. Free Theorems for Sublanguages of Haskell. Master’s thesis. Technische Universität Dresden.Google Scholar
- Joachim Breitner. 2015. Formally Proving a Compiler Transformation Safe. In Haskell Symposium. Google Scholar
Digital Library
- Aloïs Brunel. 2015. Quantitative Classical Realizability. Information and Computation 241 (2015). Google Scholar
Digital Library
- Aloïs Brunel and Marco Gaboardi. 2015. Realizability Models for a Linear Dependent PCF. Theoretical Computer Science 585 (2015). Google Scholar
Digital Library
- Andrew J. Gill, John Launchbury, and Simon L. Peyton Jones. 1993. A Short Cut to Deforestation. In Functional Programming Languages and Computer Architecture. Google Scholar
Digital Library
- Jörgen Gustavsson and David Sands. 1999. A Foundation for Space-Safe Transformations of Call-by-Need Programs. Electronic Notes on Theoretical Computer Science 26 (1999).Google Scholar
- Jörgen Gustavsson and David Sands. 2001. Possibilities and Limitations of Call-by-Need Space Improvement. In International Conference on Functional Programming. Google Scholar
Digital Library
- Jennifer Hackett and Graham Hutton. 2014. Worker/Wrapper/Makes It/Faster. In International Conference on Functional Programming. Google Scholar
Digital Library
- Jennifer Hackett and Graham Hutton. 2015. Programs for Cheap!. In Logic in Computer Science. Google Scholar
Digital Library
- Jennifer Hackett and Graham Hutton. 2018. A Generic Foundation for Program Improvement. (2018). In preparation.Google Scholar
- Martin Handley and Graham Hutton. 2018. Improving Haskell. In Trends in Functional Programming.Google Scholar
- Graham Hutton and Jennifer Hackett. 2016. Mind the Gap: Unified Reasoning About Program Correctness and Efficiency. (2016). Engineering and Physical Sciences Research Council grant EP/P00587X/1.Google Scholar
- Patricia Johann and Janis Voigtländer. 2004. Free Theorems in the Presence of seq. In Principles of Programming Languages. Google Scholar
Digital Library
- John Launchbury. 1993. A Natural Semantics for Lazy Evaluation. In Principles of Programming Languages. Google Scholar
Digital Library
- Erik Meijer, Maarten M. Fokkinga, and Ross Paterson. 1991. Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In Functional Programming Languages and Computer Architecture ’91 (Lecture Notes in Computer Science), Vol. 523. Springer. Google Scholar
Digital Library
- Andrew Moran and David Sands. 1999a. Improvement in a Lazy Context: An Operational Theory for Call-by-Need. (1999). Extended version of { Moran and Sands 1999b }, available at http://tinyurl.com/ohuv8ox .Google Scholar
- Andrew Moran and David Sands. 1999b. Improvement in a Lazy Context: An Operational Theory for Call-by-Need. In Principles of Programming Languages. Google Scholar
Digital Library
- Andrew M. Pitts. 2000. Parametric Polymorphism and Operational Equivalence. Mathematical Structures in Computer Science 10, 03 (2000). Google Scholar
Digital Library
- Gordon D. Plotkin. 1977. LCF Considered as a Programming Language. Theoretical Computer Science 5, 3 (1977).Google Scholar
- John C. Reynolds. 1983. Types, Abstraction and Parametric Polymorphism. Proceedings of the IFIP 9th World Computer Congress (1983).Google Scholar
- David Sands. 1997. From SOS Rules to Proof Principles: An Operational Metatheory for Functional Languages. In Principles of Programming Languages. Google Scholar
Digital Library
- Manfred Schmidt-Schauß and David Sabel. 2015. Improvements in a Functional Core Language with Call-By-Need Operational Semantics. In Principles and Practice of Declarative Programming. Google Scholar
Digital Library
- Daniel Seidel and Janis Voigtländer. 2011. Improvements for Free. In Quantitative Aspects of Programming Languages.Google Scholar
- Ilya Sergey, Dimitrios Vytiniotis, Simon L Peyton Jones, and Joachim Breitner. 2017. Modular, Higher Order Cardinality Analysis in Theory and Practice. Journal of Functional Programming 27 (2017).Google Scholar
- Peter Sestoft. 1997. Deriving a Lazy Abstract Machine. Journal of Functional Programming 7, 3 (1997). Google Scholar
Digital Library
- Jon Shultis. 1985. On the Complexity of Higher-Order Programs. Technical Report. University of Colorado.Google Scholar
- Hugo Simões, Pedro Vasconcelos, Mário Florido, Steffen Jost, and Kevin Hammond. 2012. Automatic Amortised Analysis of Dynamic Memory Allocation for Lazy Functional Programs. In International Conference on Functional Programming. Google Scholar
Digital Library
- Christopher Strachey. 2000. Fundamental Concepts in Programming Languages. Higher-Order and Symbolic Computation 13, 1-2 (2000). Google Scholar
Digital Library
- Janis Voigtländer and Patricia Johann. 2007. Selective Strictness and Parametricity in Structural Operational Semantics, Inequationally. Theoretical Computer Science 388, 1-3 (2007). Google Scholar
Digital Library
- Philip Wadler. 1989. Theorems for Free!. In Functional Programming Languages and Computer Architecture. Google Scholar
Digital Library
Index Terms
Parametric polymorphism and operational improvement
Recommendations
Relationally-parametric polymorphic contracts
DLS '07: Proceedings of the 2007 symposium on Dynamic languagesThe analogy between types and contracts raises the question of how many features of static type systems can be expressed as dynamic contracts. An important feature missing in prior work on contracts is parametricity, as represented by the polymorphic ...
Parametric quantifiers for dependent type theory
Polymorphic type systems such as System F enjoy the parametricity property: polymorphic functions cannot inspect their type argument and will therefore apply the same algorithm to any type they are instantiated on. This idea is formalized mathematically ...
Set-theoretic foundation of parametric polymorphism and subtyping
ICFP '11We define and study parametric polymorphism for a type system with recursive, product, union, intersection, negation, and function types. We first recall why the definition of such a system was considered hard "when not impossible" and then present the ...






Comments