Tight typings and split bounds, fully developed

Multi types—aka non-idempotent intersection types—have been used to obtain quantitative bounds on higherorder programs, as pioneered by de Carvalho. Notably, they bound at the same time the number of evaluation steps and the size of the result. Recent results show that the number of steps can be taken as a reasonable time complexity measure. At the same time, however, these results suggest that multi types provide quite lax complexity bounds, because the size of the result can be exponentially bigger than the number of steps. Starting from this observation, we refine and generalise a technique introduced by Bernadet & GrahamLengrand to provide exact bounds. Our typing judgements carry counters, one measuring evaluation lengths and the other measuring result sizes. In order to emphasise the modularity of the approach, we provide exact bounds for four evaluation strategies, both in the λ-calculus (head, leftmost-outermost, and maximal evaluation) and in the linear substitution calculus (linear head evaluation). Our work aims at both capturing the results in the literature and extending them with new outcomes. Concerning the literature, it unifies de Carvalho and Bernadet & Graham-Lengrand via a uniform technique and a complexity-based perspective. The two main novelties are exact split bounds for the leftmost strategy— the only known strategy that evaluates terms to full normal forms and provides a reasonable complexity measure—and the observation that the computing device hidden behindmulti types is the notion of substitution at a distance, as implemented by the linear substitution calculus.

[1]  Beniamino Accattoli Proof Nets and the Linear Substitution Calculus , 2018, ICTAC.

[2]  Thomas Ehrhard,et al.  Collapsing non-idempotent intersection types , 2012, CSL.

[3]  Jean-Louis Krivine,et al.  Lambda-calculus, types and models , 1993, Ellis Horwood series in computers and their applications.

[4]  Guy E. Blelloch,et al.  Parallelism in sequential functional languages , 1995, FPCA '95.

[5]  Clemens Grabmayer Modeling Terms by Graphs with Structure Constraints (Two Illustrations) , 2018, TERMGRAPH@FSCD.

[6]  Beniamino Accattoli,et al.  Types of Fireballs , 2018, APLAS.

[7]  Ugo Dal Lago,et al.  Linear Dependent Types and Relative Completeness , 2011, 2011 IEEE 26th Annual Symposium on Logic in Computer Science.

[8]  Ugo Dal Lago,et al.  Linear dependent types in a call-by-value scenario , 2012, Sci. Comput. Program..

[9]  Giulio Guerrieri,et al.  Computing Connected Proof(-Structure)s From Their Taylor Expansion , 2016, FSCD.

[10]  Andrej Dudenhefner,et al.  Intersection type calculi of bounded dimension , 2017, POPL.

[11]  Mário Florido,et al.  Using Intersection Types for Cost-Analysis of Higher-Order Polymorphic Functional Programs , 2006, TYPES.

[12]  Damiano Mazza,et al.  Polyadic approximations, fibrations and intersection types , 2017, Proc. ACM Program. Lang..

[13]  Vincent Danos,et al.  Head Linear Reduction , 2004 .

[14]  Simona Ronchi Della Rocca,et al.  Essential and relational models † , 2015, Mathematical Structures in Computer Science.

[15]  Ugo Dal Lago,et al.  (Leftmost-Outermost) Beta Reduction is Invariant, Indeed , 2016, Log. Methods Comput. Sci..

[16]  Delia Kesner,et al.  A Resource Aware Computational Interpretation for Herbelin's Syntax , 2015, ICTAC.

[17]  Steffen Jost,et al.  Type-Based Cost Analysis for Lazy Functional Languages , 2017, Journal of Automated Reasoning.

[18]  Michele Pagani,et al.  A semantic measure of the execution time in linear logic , 2011, Theor. Comput. Sci..

[19]  Lorenzo Tortora de Falco,et al.  A semantic account of strong normalization in linear logic , 2013, Inf. Comput..

[20]  Thomas Ehrhard,et al.  The Bang Calculus: an untyped lambda-calculus generalizing call-by-name and call-by-value , 2016, PPDP.

[21]  Martin Hofmann,et al.  Amortized Resource Analysis with Polynomial Potential , 2010, ESOP.

[22]  Pawel Urzyczyn,et al.  Inhabitation of Low-Rank Intersection Types , 2009, TLCA.

[23]  Robin Milner,et al.  Local Bigraphs and Confluence: Two Conjectures: (Extended Abstract) , 2007, EXPRESS.

[24]  Hans-Wolfgang Loidl,et al.  Cost Analysis Using Automatic Size and Time Inference , 2002, IFL.

[25]  Alberto Carraro,et al.  A Semantical and Operational Account of Call-by-Value Solvability , 2014, FoSSaCS.

[26]  Mariangiola Dezani-Ciancaglini,et al.  A new type assignment for λ-terms , 1978, Arch. Math. Log..

[27]  Jean-Yves Girard Normal functors, power series and λ-calculus , 1988, Ann. Pure Appl. Log..

[28]  Mariangiola Dezani-Ciancaglini,et al.  An extension of the basic functionality theory for the λ-calculus , 1980, Notre Dame J. Formal Log..

[29]  Delia Kesner,et al.  Tight typings and split bounds , 2018, Proc. ACM Program. Lang..

[30]  Delia Kesner,et al.  Non-idempotent types for classical calculi in natural deduction style , 2018, Log. Methods Comput. Sci..

[31]  Delia Kesner,et al.  Types as Resources for Classical Natural Deduction , 2017, FSCD.

[32]  Martin Hofmann,et al.  Resource Aware ML , 2012, CAV.

[33]  Amr Sabry,et al.  Proving the correctness of reactive systems using sized types , 1996, POPL '96.

[34]  Delia Kesner,et al.  Quantitative Types for the Linear Substitution Calculus , 2014, IFIP TCS.

[35]  Beniamino Accattoli,et al.  An Abstract Factorization Theorem for Explicit Substitutions , 2012, RTA.

[36]  J. Roger Hindley,et al.  To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism , 1980 .

[37]  Alejandro Ríos,et al.  Call-by-need, neededness and all that , 2018, FoSSaCS.

[38]  D. Kesner,et al.  Milner’s Lambda-Calculus with Partial Substitutions , 2008 .

[39]  Gianfranco Mascari,et al.  Head Linear Reduction and Pure Proof Net Extraction , 1992, Theor. Comput. Sci..

[40]  Simona Ronchi Della Rocca,et al.  A type assignment for λ-calculus complete both for FPTIME and strong normalization , 2016, Inf. Comput..

[41]  Ugo Dal Lago,et al.  The geometry of types , 2012, POPL.

[42]  Beniamino Accattoli,et al.  Types by Need , 2019, ESOP.

[43]  Antonio Bucciarelli,et al.  A relational semantics for parallelism and non-determinism in a functional setting , 2012, Ann. Pure Appl. Log..

[44]  Paula Severi,et al.  Perpetual Reductions in Lambda-Calculus , 1999, Inf. Comput..

[45]  D. Carvalho,et al.  Sémantiques de la logique linéaire et temps de calcul , 2007 .

[46]  Ugo Dal Lago,et al.  On the Invariance of the Unitary Cost Model for Head Reduction (Long Version) , 2012, RTA.

[47]  Kevin Hammond,et al.  Inferring Cost Equations for Recursive, Polymorphic and Higher-Order Functional Programs , 2003, IFL.

[48]  Antonio Bucciarelli,et al.  On phase semantics and denotational semantics: the exponentials , 2001, Ann. Pure Appl. Log..

[49]  Delia Kesner,et al.  A Quantitative Understanding of Pattern Matching , 2019, TYPES.

[50]  Daniel de Carvalho The Relational Model Is Injective for Multiplicative Exponential Linear Logic , 2016, CSL.

[51]  C.-H. Luke Ong Quantitative semantics of the lambda calculus: Some generalisations of the relational model , 2017, 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).

[52]  Delia Kesner,et al.  The structural λ-calculus , 2010 .

[53]  Antonio Bucciarelli,et al.  Non-idempotent intersection types for the Lambda-Calculus , 2017, Log. J. IGPL.

[54]  Stéphane Graham-Lengrand,et al.  A big-step operational semantics via non-idempotent intersection types , 2013 .

[55]  Assaf J. Kfoury A linearization of the Lambda-calculus and consequences , 2000, J. Log. Comput..

[56]  Delia Kesner,et al.  A nonstandard standardization theorem , 2014, POPL.

[57]  Harry G. Mairson,et al.  Types, potency, and idempotency: why nonlinearity and amnesia make a type system work , 2004, ICFP '04.

[58]  Stéphane Lengrand,et al.  Non-idempotent intersection types and strong normalisation , 2013, Log. Methods Comput. Sci..

[59]  Giulio Manzonetto,et al.  Call-by-Value Non-determinism in a Linear Logic Type Discipline , 2013, LFCS.

[60]  Beniamino Accattoli (In)Efficiency and Reasonable Cost Models , 2017, LSFA.

[61]  Coppo Mario,et al.  A new type assignment for lambda-terms , 1978 .

[62]  Antonio Bucciarelli,et al.  The Inhabitation Problem for Non-idempotent Intersection Types , 2014, IFIP TCS.

[63]  J. Girard,et al.  Proofs and types , 1989 .

[64]  Martin Hofmann,et al.  Static prediction of heap space usage for first-order functional programs , 2003, POPL '03.

[65]  Daniel de Carvalho,et al.  Execution time of λ-terms via denotational semantics and intersection types , 2009, Mathematical Structures in Computer Science.

[66]  Pawel Urzyczyn The Emptiness Problem for Intersection Types , 1999, J. Symb. Log..

[67]  Ugo Dal Lago,et al.  Automating sized-type inference for complexity analysis , 2017, Proc. ACM Program. Lang..

[68]  Jan Willem Klop,et al.  Combinatory reduction systems , 1980 .

[69]  Philippa Gardner,et al.  Discovering Needed Reductions Using Type Theory , 1994, TACS.