Observability = Typability + Inhabitation

We define an observability property for a calculus with pattern matching which is inspired by the notion of solvability for the lambda-calculus. We prove that observability can be characterized by means of typability and inhabitation in an intersection type system P based on non-idempotent types. We show first that the system P characterizes the set of terms having canonical form, i.e. that a term is typable if and only if it reduces to a canonical form. But the set of observable terms is properly contained in the set of canonical. Thus, typability alone is not sufficient to characterize observability, in contrast to the solvability case for lambda-calculus. We then prove that typability, together with inhabitation, provides a full characterization of observability, in the sense that a term is observable if and only if it is typable and the types of all its arguments are inhabited. We complete the picture by providing an algorithm for the inhabitation problem of P.

[1]  Delia Kesner,et al.  The Structural lambda-Calculus , 2010, CSL.

[2]  Delia Kesner,et al.  Foundations of strong call by need , 2017, Proc. ACM Program. Lang..

[3]  Dana S. Scott,et al.  Outline of a Mathematical Theory of Computation , 1970 .

[4]  Simon L. Peyton Jones,et al.  The Implementation of Functional Programming Languages , 1987 .

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

[6]  Vincent van Oostrom,et al.  Lambda calculus with patterns , 2008, Theor. Comput. Sci..

[7]  Antonio Bucciarelli,et al.  Inhabitation for Non-idempotent Intersection Types , 2017, Log. Methods Comput. Sci..

[8]  Wolfram Kahl,et al.  Basic Pattern Matching Calculi: a Fresh View on Matching Failure , 2004, FLOPS.

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

[10]  Mariangiola Dezani-Ciancaglini,et al.  Two Behavioural Lambda Models , 2002, TYPES.

[11]  Mariangiola Dezani-Ciancaglini,et al.  A filter lambda model and the completeness of type assignment , 1983, Journal of Symbolic Logic.

[12]  Barbara Petit A Polymorphic Type System for the Lambda-Calculus with Constructors , 2009, TLCA.

[13]  Eduardo Bonelli,et al.  Pattern Matching and Fixed Points: Resource Types and Strong Call-By-Need: Extended Abstract , 2018, PPDP.

[14]  Vincent van Oostrom Confluence by Decreasing Diagrams , 2008, RTA.

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

[16]  J. V. Tucker,et al.  Basic Simple Type Theory , 1997 .

[17]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[18]  Claude Kirchner,et al.  A ρ-calculus of explicit constraint application , 2007, High. Order Symb. Comput..

[19]  Alexis Bernadet,et al.  Types intersections non-idempotents pour raffiner la normalisation forte avec des informations quantitatives. (Non idempotent-intersection types to refine strong normalisation with quantitative information) , 2014 .

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

[21]  Delia Kesner,et al.  Pattern matching as cut elimination , 2004, Theor. Comput. Sci..

[22]  Antonio Bucciarelli,et al.  Observability for Pair Pattern Calculi , 2015, TLCA.

[23]  Thibaut Balabonski,et al.  On the Implementation of Dynamic Patterns , 2011, HOR.

[24]  Claude Kirchner,et al.  A rho-Calculus of Explicit Constraint Application , 2004, WRLA.

[25]  Pablo Nogueira,et al.  No solvable lambda-value term left behind , 2016, Log. Methods Comput. Sci..

[26]  Delia Kesner,et al.  First-class patterns , 2009, Journal of Functional Programming.