Abstract
We show that time complexity analysis of higher-order functional programs can be effectively reduced to an arguably simpler (although computationally equivalent) verification problem, namely checking first-order inequalities for validity. This is done by giving an efficient inference algorithm for linear dependent types which, given a PCF term, produces in output both a linear dependent type and a cost expression for the term, together with a set of proof obligations. Actually, the output type judgement is derivable iff all proof obligations are valid. This, coupled with the already known relative completeness of linear dependent types, ensures that no information is lost, i.e., that there are no false positives or negatives. Moreover, the procedure reflects the difficulty of the original problem: simple PCF terms give rise to sets of proof obligations which are easy to solve. The latter can then be put in a format suitable for automatic or semi-automatic verification by external solvers. Ongoing experimental evaluation has produced encouraging results, which are briefly presented in the paper.
Supplemental Material
- Abramsky, S., Jagadeesan, R., Malacaria, P.: Full abstraction for PCF. I & C 163(2), 409--470 (2000) Google Scholar
Digital Library
- Amadio, R.M., Regis-Gianas, Y.: Certifying and reasoning on cost annotations of functional programs. CoRR abs/1110.2350 (2011)Google Scholar
- de Bakker, J.W.: Mathematical Theory of Program Correctness. Prentice-Hall (1980) Google Scholar
Digital Library
- Barthe, G., Grégoire, B., Riba, C.: Type-based termination with sized products. In: CSL 2008. LNCS, vol. 5213, pp. 493--507. Springer (2008) Google Scholar
Digital Library
- Benzinger, R.: Automated higher-order complexity analysis. Theor. Comput. Sci. 318(1-2), 79--103 (2004) Google Scholar
Digital Library
- Bobot, F., Filliatre, J.C., Marché, C., Paskevich, A.: Why3: Shepherd your herd of provers. In: First InternationalWorkshop on Intermediate Verification Languages. pp. 53--64 (2011)Google Scholar
- Clarke, E.M.: Programming language constructs for which it is impossible to obtain good hoare axiom systems. J. ACM 26(1), 129--147 (1979) Google Scholar
Digital Library
- Clavel, M., Durán, F., Eker, S., Lincoln, P., Martí-Oliet, N., Meseguer, J., Talcott, C.: The Maude 2.0 system. In: RTA 2003. LNCS, vol. 2706, pp. 76--87 (2003) Google Scholar
Digital Library
- Cook, S.A.: Soundness and completeness of an axiom system for program verification. SIAM J. on Computing 7, 70--90 (1978)Google Scholar
Cross Ref
- Dal Lago, U.: Context semantics, linear logic and computational complexity. In: LICS 2006. pp. 169--178 (2006) Google Scholar
Digital Library
- Dal Lago, U., Gaboardi, M.: Linear dependent types and relative completeness. In: LICS 2011. pp. 133--142 (2011) Google Scholar
Digital Library
- Dal Lago, U., Petit, B.: The geometry of types (long version) (2012), available at http://arxiv.org/abs/1210.6857 Google Scholar
Digital Library
- Dal Lago, U., Petit, B.: Linear dependent types in a call-by-value scenario. In: ACM PPDP 2012. pp. 115--126 (2012) Google Scholar
Digital Library
- Danos, V., Regnier, L.: Reversible, irreversible and optimal lambdamachines. Theor. Comput. Sci. 227(1-2), 79--97 (1999) Google Scholar
Digital Library
- Denney, E.: Refinement types for specification. In: IFIP-PROCOMET. pp. 148--166 (1998) Google Scholar
Digital Library
- Felleisen, M., Friedman, D.P.: Control operators, the SECD-machine and the _-calculus. Tech. Rep. 197, Computer Science Department, Indiana University (1986)Google Scholar
- Ghica, D.R.: Slot games: a quantitative model of computation. In: ACM POPL 2005. pp. 85--97 (2005) Google Scholar
Digital Library
- Ghica, D.R., Smith, A.: Geometry of synthesis III: resource management through type inference. In: ACM POPL 2011. pp. 345--356 (2011) Google Scholar
Digital Library
- Girard, J.Y., Scedrov, A., Scott, P.: Bounded linear logic. Theor. Comp. Sci. 97(1), 1--66 (1992) Google Scholar
Digital Library
- Gulwani, S.: Speed: Symbolic complexity bound analysis. In: CAV. pp. 51--62 (2009) Google Scholar
Digital Library
- Hoffmann, J., Aehlig, K., Hofmann, M.: Multivariate Amortized Resource Analysis. In: ACM POPL 2011. pp. 357--370 (2011) Google Scholar
Digital Library
- Hughes, J., Pareto, L., Sabry, A.: Proving the correctness of reactive systems using sized types. In: ACM POPL 1996. pp. 410--423 (1996) Google Scholar
Digital Library
- Jost, S., Hammond, K., Loidl, H.W., Hofmann, M.: Static determination of quantitative resource usage for higher-order programs. In: ACM POPL 2010. Madrid, Spain (2010) Google Scholar
Digital Library
- Krivine, J.L.: A call-by-name lambda-calculus machine. Higher-Order and Symbolic Computation 20(3), 199--207 (2007) Google Scholar
Digital Library
- Maraist, J., Odersky, M., Turner, D.N.,Wadler, P.: Call-by-name, callby- value, call-by-need and the linear lambda calculus. Electr. Notes Theor. Comput. Sci. 1, 370--392 (1995)Google Scholar
Cross Ref
- Plotkin, G.D.: LCF considerd as a programming language. Theor. Comp. Sci. 5, 225--255 (1977)Google Scholar
Cross Ref
- Sands, D.: Complexity analysis for a lazy higher-order language. In: ESOP 1990. LNCS, vol. 432, pp. 361--376 (1990) Google Scholar
Digital Library
- Sands, D.: Operational theories of improvement in functional languages (extended abstract). In: Functional Programming. pp. 298--311 (1991) Google Scholar
Digital Library
- Wilhelm, R., Engblom, J., Ermedahl, A., Holsti, N., Thesing, S., Whalley, D., Bernat, G., Ferdinand, C., Heckmann, R., Mitra, T., Mueller, F., Puaut, I., Puschner, P., Staschulat, J., Stenstrom, P.: The worst case execution time problem - overview of methods and survey of tools. ACM Trans. Embed. Comput. Syst. (2008) Google Scholar
Digital Library
Index Terms
The geometry of types
Recommendations
The geometry of types
POPL '13: Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesWe show that time complexity analysis of higher-order functional programs can be effectively reduced to an arguably simpler (although computationally equivalent) verification problem, namely checking first-order inequalities for validity. This is done ...
Linear dependent types in a call-by-value scenario
Linear dependent types were introduced recently (Dal Lago and Gaboardi, 2012) [26] as a formal system that allows to precisely capture both the extensional behavior and the time complexity of @l-terms, when the latter are evaluated by Krivine's abstract ...
Linear dependent types in a call-by-value scenario
PPDP '12: Proceedings of the 14th symposium on Principles and practice of declarative programmingLinear dependent types [11] allow to precisely capture both the extensional behavior and the time complexity of λ-terms, when the latter are evaluated by Krivine's abstract machine. In this work, we show that the same paradigm can be applied to call-by-...







Comments