Coinductive Axiomatization of Recursive Type Equality and Subtyping

We present new sound and complete axiomatizations of type equality and subtype inequality for a first-order type language with regular recursive types. The rules are motivated by coinductive characterizations of type containment and type equality via simulation and bisimulation, respectively. The main novelty of the axiomatization is the fixpoint rule (or coinduction principle). It states that from A,P $$\vdash$$ P one may deduce A $$\vdash$$ P, where P is either a type equality τ = τ' or type containment τ ≤ τ' and the proof of the premise must be contractive in a sense we define in this paper. In particular, a proof of A, P $$\vdash$$ P using the assumption axiom is not contractive. The fixpoint rule embodies a finitary coinduction principle and thus allows us to capture a coinductive relation in the fundamentally inductive framework of inference systems. The new axiomatizations are more concise than previous axiomatizations, particularly so for type containment since no separate axiomatization of type equality is required, as in Amadio and Cardelli's axiomatization. They give rise to a natural operational interpretation of proofs as coercions. In particular, the fixpoint rule corresponds to definition by recursion. Finally, the axiomatization is closely related to (known) efficient algorithms for deciding type equality and type containment. These can be modified to not only decide type equality and type containment, but also construct proofs in our axiomatizations efficiently. In connection with the operational interpretation of proofs as coercions this gives efficient (O(n 2) time) algorithms for constructing efficient coercions from a type to any of its supertypes or isomorphic types. More generally, we show how adding the fixpoint rule makes it possible to characterize inductively a set that is coinductively defined as the kernel (greatest fixed point) of an inference system.

[1]  Thierry Coquand,et al.  Inheritance as Implicit Coercion , 1991, Inf. Comput..

[2]  Jens Palsbergypalsberg,et al.  Eecient Recursive Subtyping , 1993 .

[3]  Jens Palsberg,et al.  Ecien t Recursive Subtyping , 1995 .

[4]  Luca Cardelli,et al.  Subtyping recursive types , 1991, POPL '91.

[5]  Marcelo P. Fiore,et al.  A coinduction principle for recursive data types based on bisimulation , 1993, [1993] Proceedings Eighth Annual IEEE Symposium on Logic in Computer Science.

[6]  James H. Morris,et al.  Lambda-calculus models of programming languages. , 1969 .

[7]  Marcelo P. Fiore A Coinduction Principle for Recursive Data Types Based on Bisimulation , 1996, Inf. Comput..

[8]  Richard E. Ladner,et al.  Propositional modal logic of programs , 1977, STOC '77.

[9]  C. A. R. Hoare,et al.  Procedures and parameters: An axiomatic approach , 1971, Symposium on Semantics of Algorithmic Languages.

[10]  Andrew M. Pitts,et al.  Relational Properties of Domains , 1996, Inf. Comput..

[11]  Marina Lenisa Final Semantics for a Higher Order Concurrent Language , 1996, CAAP.

[12]  B. Courcelle Fundamental properties of infinite trees , 1983 .

[13]  Arto Salomaa,et al.  Two Complete Axiom Systems for the Algebra of Regular Events , 1966, JACM.

[14]  Gérard P. Huet,et al.  Regular Böhm trees , 1998, Mathematical Structures in Computer Science.

[15]  Thierry Coquand,et al.  Infinite Objects in Type Theory , 1994, TYPES.

[16]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[17]  S. Abramsky The lazy lambda calculus , 1990 .

[18]  Dexter Kozen,et al.  Results on the Propositional µ-Calculus , 1982, ICALP.

[19]  Giorgio Ghelli,et al.  Coherence of Subsumption , 1990, CAAP.

[20]  Stefan Sokolowski Total Correctness for Procedures , 1977, MFCS.

[21]  Zena M. Ariola,et al.  Equational Term Graph Rewriting , 1996, Fundam. Informaticae.

[22]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[23]  Robin Milner,et al.  Co-Induction in Relational Semantics , 1991, Theor. Comput. Sci..

[24]  Andrew M. Pitts,et al.  A co-Induction Principle for Recursively Defined Domains , 1994, Theor. Comput. Sci..

[25]  Luca Cardelli,et al.  Subtyping recursive types , 1993 .

[26]  Fritz Henglein,et al.  Dynamic Typing: Syntax and Proof Theory , 1994, Sci. Comput. Program..

[27]  Mario Coppo,et al.  Type Inference with Recursive Types: Syntax and Semantics , 1991, Inf. Comput..

[28]  Robin Milner,et al.  A Complete Inference System for a Class of Regular Behaviours , 1984, J. Comput. Syst. Sci..

[29]  Jacob Hoeg Jorgensen A calculus for boxing analysis of polymorphically typed languages , 1996 .

[30]  Andrew D. Gordon Bisimilarity as a theory of functional programming , 1995, MFPS.

[31]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theor. Comput. Sci..

[32]  Robin Milner,et al.  Fully Abstract Models of Typed lambda-Calculi , 1977, Theor. Comput. Sci..

[33]  Dexter Kozen A Completeness Theorem for Kleene Algebras and the Algebra of Regular Events , 1994, Inf. Comput..

[34]  Carl A. Gunter Semantics of programming languages: structures and techniques , 1993, Choice Reviews Online.

[35]  Furio Honsell,et al.  Final Semantics for untyped lambda-calculus , 1995, TLCA.

[36]  Hanne Riis Nielson A Hoare-like Proof System for Total Correctness of Nested Recursive Procedures , 1985 .

[37]  V. Rich Personal communication , 1989, Nature.

[38]  Jens Palsberg,et al.  Efficient recursive subtyping , 1992, POPL '93.

[39]  Martín Abadi,et al.  Syntactic considerations on recursive types , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.