Advertisement

Refinement Types for Incremental Computational Complexity

  • Ezgi Çiçek
  • Deepak Garg
  • Umut Acar
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9032)

Abstract

With recent advances, programs can be compiled to efficiently respond to incremental input changes. However, there is no language-level support for reasoning about the time complexity of incremental updates. Motivated by this gap, we present CostIt, a higher-order functional language with a lightweight refinement type system for proving asymptotic bounds on incremental computation time. Type refinements specify which parts of inputs and outputs may change, as well as dynamic stability, a measure of time required to propagate changes to a program’s execution trace, given modified inputs. We prove our type system sound using a new step-indexed cost semantics for change propagation and demonstrate the precision and generality of our technique through examples.

Keywords

Type System Dynamic Stability Change Propagation List Length Index Term 
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.

References

  1. 1.
    Acar, U., Blelloch, G., Blume, M., Harper, R., Tangwongsan, K.: A library for self-adjusting computation. Elec. Notes in Theor. Comp. Sci. 148(2), 127–154 (2006)CrossRefGoogle Scholar
  2. 2.
    Acar, U.A., Blelloch, G.E., Blume, M., Harper, R., Tangwongsan, K.: An experimental analysis of self-adjusting computation. ACM Trans. Program. Lang. Syst. 3, 3:1–3:53 (2009)Google Scholar
  3. 3.
    Acar, U.A., Blelloch, G.E., Harper, R.: Adaptive functional programming. ACM Trans. Program. Lang. Syst. 28(6), 990–1034 (2006)CrossRefGoogle Scholar
  4. 4.
    Acar, U.A., Blume, M., Donham, J.: A consistent semantics of self-adjusting computation. The Journal of Functional Programming (2013)Google Scholar
  5. 5.
    Ahmed, A.: Step-indexed syntactic logical relations for recursive and quantified types. In: Sestoft, P. (ed.) ESOP 2006. LNCS, vol. 3924, pp. 69–83. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  6. 6.
    Blanchet, B., Abadi, M., Fournet, C.: Automated verification of selected equivalences for security protocols. The Journal of Logic and Algebraic Programming 75(1), 3–51 (2008)CrossRefzbMATHMathSciNetGoogle Scholar
  7. 7.
    Brodal, G.S., Jacob, R.: Dynamic planar convex hull. In: Proceedings of the 43rd Annual IEEE Symposium on Foundations of Computer Science, pp. 617–626 (2002)Google Scholar
  8. 8.
    Carlsson, M.: Monads for incremental computing. In: Proceedings of the 7th International Conference on Functional Programming, ICFP 2002, pp. 26–35. ACM (2002)Google Scholar
  9. 9.
    Chaudhuri, S., Gulwani, S., Lublinerman, R.: Continuity and robustness of programs. Communications of the ACM 55(8), 107–115 (2012)CrossRefGoogle Scholar
  10. 10.
    Chen, Y., Dunfield, J., Acar, U.A.: Type-directed automatic incrementalization. In: Proceedings of the 33rd Conference on Programming Language Design and Implementation, PLDI 2012, pp. 299–310. ACM (2012)Google Scholar
  11. 11.
    Chen, Y., Dunfield, J., Hammer, M.A., Acar, U.A.: Implicit self-adjusting computation for purely functional programs. In: International Conference on Functional Programming, ICFP 2011, pp. 129–141 (2011)Google Scholar
  12. 12.
    Chin, W.N., Khoo, S.C.: Calculating sized types. In: Proceedings of the Workshop on Partial Evaluation and Semantics-based Program Manipulation, PEPM 2000, pp. 62–72. ACM (1999)Google Scholar
  13. 13.
    Dal Lago, U., Petit, B.: The geometry of types. In: Proceedings of the 40th Annual Symposium on Principles of Programming Languages, POPL 2013, pp. 167–178. ACM (2013)Google Scholar
  14. 14.
    Demers, A., Reps, T., Teitelbaum, T.: Incremental evaluation for attribute grammars with application to syntax-directed editors. In: Proceedings of the 8th Symposium on Principles of Programming Languages, POPL 1981, pp. 105–116. ACM (1981)Google Scholar
  15. 15.
    Field, J.: Incremental Reduction in the Lambda Calculus and Related Reduction Systems. Ph.D. thesis, Department of Computer Science, Cornell University (1991)Google Scholar
  16. 16.
    Gaboardi, M., Haeberlen, A., Hsu, J., Narayan, A., Pierce, B.C.: Linear dependent types for differential privacy. In: Proceedings of the 40th Annual Symposium on Principles of Programming Languages, POPL 2013, pp. 357–370. ACM (2013)Google Scholar
  17. 17.
    Graham, R.L.: An efficient algorithm for determining the convex hull of a finite planar set. Information Processing Letters 1(4), 132–133 (1972)CrossRefzbMATHGoogle Scholar
  18. 18.
    Gulwani, S., Mehra, K.K., Chilimbi, T.: Speed: Precise and efficient static estimation of program computational complexity. In: Proceedings of the 36th Annual Symposium on Principles of Programming Languages, POPL 2009, pp. 127–139. ACM (2009)Google Scholar
  19. 19.
    Hammer, M.A., Acar, U.A., Chen, Y.: Ceal: A C-based language for self-adjusting computation. In: Proceedings of the 2009 Conference on Programming Language Design and Implementation, PLDI 2009, pp. 25–37. ACM (2009)Google Scholar
  20. 20.
    Hammer, M.A., Phang, K.Y., Hicks, M., Foster, J.S.: Adapton: Composable, demand-driven incremental computation. In: Proceedings of the 35th Conference on Programming Language Design and Implementation, PLDI 2014, pp. 156–166. ACM (2014)Google Scholar
  21. 21.
    Heydon, A., Levin, R., Yu, Y.: Caching function calls using precise dependencies. In: Proceedings of the Conference on Programming Language Design and Implementation, PLDI 2000, pp. 311–320. ACM (2000)Google Scholar
  22. 22.
    Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate amortized resource analysis. In: Proceedings of the 38th Annual Symposium on Principles of Programming Languages, POPL 2011, pp. 357–370. ACM (2011)Google Scholar
  23. 23.
    Hoffmann, J., Hofmann, M.: Amortized resource analysis with polynomial potential: A static inference of polynomial bounds for functional programs. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 287–306. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  24. 24.
    Holm, J., de Lichtenberg, K.: Top-trees and dynamic graph algorithms. Tech. Rep. DIKU-TR-98/17, Department of Computer Science, University of Copenhagen (1998)Google Scholar
  25. 25.
    Hughes, J., Pareto, L.: Recursion and dynamic data-structures in bounded space: Towards embedded ML programming. In: Proceedings of the Fourth International Conference on Functional Programming, ICFP 1999, pp. 70–81. ACM (1999)Google Scholar
  26. 26.
    Ley-Wild, R., Acar, U.A., Fluet, M.: A cost semantics for self-adjusting computation. In: Proceedings of the 36th Annual Symposium on Principles of Programming Languages, POPL 2009, pp. 186–199. ACM (2009)Google Scholar
  27. 27.
    Ley-Wild, R., Fluet, M., Acar, U.A.: Compiling self-adjusting programs with continuations. In: Proceedings of the 13th International Conference on Functional Programming, ICFP 2008, pp. 321–334. ACM (2008)Google Scholar
  28. 28.
    Nanevski, A., Pfenning, F.: Staged computation with names and necessity. J. Funct. Program. 15(6), 893–939 (2005)CrossRefzbMATHMathSciNetGoogle Scholar
  29. 29.
    Nielson, F., Riis Nielson, H.: Type and effect systems. In: Olderog, E.-R., Steffen, B. (eds.) Correct System Design. LNCS, vol. 1710, pp. 114–136. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  30. 30.
    Overmars, M.H., van Leeuwen, J.: Maintenance of configurations in the plane. Journal of Computer and System Sciences 23, 166–204 (1981)CrossRefzbMATHMathSciNetGoogle Scholar
  31. 31.
    Pottier, F., Simonet, V.: Information flow inference for ML. ACM Trans. Program. Lang. Syst. 25(1), 117–158 (2003)CrossRefGoogle Scholar
  32. 32.
    Pugh, W., Teitelbaum, T.: Incremental computation via function caching. In: Proceedings of the 16th Annual ACM Symposium on Principles of Programming Languages, POPL 1989, pp. 315–328. ACM (1989)Google Scholar
  33. 33.
    Reed, J., Pierce, B.C.: Distance makes the types grow stronger: A calculus for differential privacy. In: Proceedings of the 15th International Conference on Functional Programming, ICFP 2010, pp. 157–168. ACM (2010)Google Scholar
  34. 34.
    Shankar, A., Bodík, R.: Ditto: Automatic incrementalization of data structure invariant checks (in Java). In: Proceedings of the Conference on Programming Language Design and Implementation, PLDI 2007, pp. 310–319. ACM (2007)Google Scholar
  35. 35.
    Vasconcelos, P.: Space cost analysis using sized types. Ph.D. thesis, School of Computer Science, University of St Andrews (2008)Google Scholar
  36. 36.
    Vasconcelos, P.B., 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 (2005)CrossRefGoogle Scholar
  37. 37.
    Xi, H., Pfenning, F.: Dependent types in practical programming. In: Proceedings of the 26th Symposium on Principles of Programming Languages, POPL 1999, pp. 214–227. ACM (1999)Google Scholar
  38. 38.
    Yellin, D., Strom, R.: Inc: A language for incremental computations. In: Proceedings of the Conference on Programming Language Design and Implementation, PLDI 1988, pp. 115–124. ACM (1988)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2015

Authors and Affiliations

  • Ezgi Çiçek
    • 1
  • Deepak Garg
    • 1
  • Umut Acar
    • 2
  1. 1.Max Planck Institute for Software SystemsKaiserslauternGermany
  2. 2.Carnegie Mellon UniversityPittsburghUSA

Personalised recommendations