[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
article

Coinductive Axiomatization of Recursive Type Equality and Subtyping

Published: 01 December 1998 Publication History

Abstract

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.

References

[1]
Martín Abadi. Personal communication, September 1996. ACM State of the Art Summer School on Functional and Object-Oriented Programming in Sobotka, Poland, September 8-14, 1996.
[2]
Samson Abramsky. The lazy lambda calculus. In D. Turner, editor, Research Topics in Functional Programming, pages 65-117. Addison-Wesley, 1990. Also available by anonymous ftp from theory.doc.ic.ac.uk.
[3]
R. Amadio and L. Cardelli. Subtyping recursive types. In Proc. 18th Annual ACM Symposium on Principles of Programming Languages (POPL), Orlando, Florida, pages 104-118. ACM Press, January 1991.
[4]
Roberto M. Amadio and Luca Cardelli. Subtyping recursive types. ACM Transactions on Programming Languages and Systems (TOPLAS), 15(4):575-631, September 1993.
[5]
Peter Aczel. An Introduction to Inductive Definitions, chapter C.7. North-Holland, 1977.
[6]
Martín Abadi and Marcelo P. Fiore. Syntactic considerations on recursive types. In Proc. 1996 IEEE 11th Annual Symp. on Logic in Computer Science (LICS), New Brunswick, New Jersey. IEEE Computer Society Press, June 1996.
[7]
Zena M. Ariola and Jan Willem Klop. Equational term graph rewriting. Technical Report CIS-TR-95-16, University of Oregon, 1995. To appear in Acta Informatica.
[8]
A. Aho, R. Sethi, and J. Ullman. Compilers: Principles, Techniques, and Tools. Addison Wesley, 1986.
[9]
Michael Brandt. Recursive subtyping: Axiomatizations and computational interpretations. Master's thesis, DIKU, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen, Denmark, April 1997. TOPPS Technical Report D-352; http://www.diku.dk/research-groups/topps/Bibliography. html.
[10]
V. Breazu-Tannen, T. Coquand, C. Gunter, and A. Scedrov. Inheritance as implicit coercion. Information and Computation, 93(1):172-221, July 1991. Presented at LICS '89.
[11]
Ch. Ben-Yelles. Type Assignment in the Lambda-Calculus: Syntax and Semantics . PhD thesis, Department of Pure Mathematics, University College of Swansea, September 1979. Author's current address: Informatique, I.U.T. Valence, B.P. 29, 26901 Valence, cedex 9, France.
[12]
Luca Cardelli. Algorithm for subtyping recursive types (in Modula-3). URL: http://research.microsoft.com/research/cambridge/luca/Notes/RecSub.txt, 1993. Originally implemented in Quest and released in 1990.
[13]
F. Cardone and M. Coppo. Type inference with recursive types: Syntax and semantics. Information and Computation, 92(1):48-80, May 1991.
[14]
P. Curien and G. Ghelli. Coherence of subsumption. In A. Arnold, editor, Proc. 15th Coll. on Trees in Algebra and Programming (CAAP), Copenhagen, Denmark, volume 431 of Lecture Notes in Computer Science (LNCS), pages 132-146. Springer, May 1990.
[15]
Thierry Coquand. Infinite objects in type theory. In Henk Barendregt and Tobias Nipkow, editors, Proc. Int'l Workshop on Types for Proofs and Programs (TYPES), volume 806 of Lecture Notes in Computer Science (LNCS), pages 62-78. Springer-Verlag, May 1993.
[16]
B. Courcelle. Fundamental properties of infinite trees. Theoretical Computer Science , 25:95-169, 1983.
[17]
Marcelo P. Fiore. A coinduction principle for recursive data types based on bisimulation. Information and Computation, 127:186-198, 1996. Conference version: Proc. 8th Annual IEEE Symp. on Logic in Computer Science (LICS), 1993, pp. 110-119.
[18]
M.J. Fischer and L.E. Ladner. Propositional modal logic of programs. In Proc. 9th Symp. on Theory of Computing (STOC), pages 286-294. ACM, ACM Press, 1977.
[19]
Andrew Gordon. Bisimilarity as a theory of functional programming. In Proceedings of the Eleventh Conference on the Mathematical Foundations of Programming Semantics (MFPS), New Orleans, March 29 to April 1, 1995, Elsevier Electronic Notes in Theoretical Computer Science, volume 1, 1995.
[20]
Carl A. Gunter. Semantics of programming languages: structures and techniques. Foundations of Computing. The MIT Press, 1992. ISBN 0-262-07143-6.
[21]
Fritz Henglein. Dynamic typing: Syntax and proof theory. Science of Computer Programming (SCP), 22(3): 197-230, 1994.
[22]
R. Hindley. The principal type-scheme of an object in combinatory logic. Trans. Amer. Math. Soc., 146:29-60, December 1969.
[23]
J. Hopcroft and R. Karp. An algorithm for testing the equivalence of finite automata. Technical Report TR-71-114, Dept. of Computer Science, Cornell U., 1971.
[24]
Furio Honsell and Marina Lenisa. Final semantics for untyped lambda-calculus. In Mariangiola Dezani-Ciancaglini and Gordon Plotkin, editors, Proc. Int'l Conf. on Typed Lambda Calculi and Applications (TLCA), volume 902 of Lecture Notes in Computer Science (LNCS), pages 249-265. Springer-Verlag, 1995.
[25]
C.A.R. Hoare. Procedures and parameters: An axiomatic approach. In Erwin Engeler, editor, Symposium on Semantics of Algorithmic Languages, volume 188 of Lecture Notes in Mathematics (LNM), pages 102-116. Springer-Verlag, October 1970.
[26]
G. Huet. Résolution d'equations dans des langages d'ordre 1, 2, ..., omega (thèse de Doctorat d'Etat). PhD thesis, Univ. Paris VII, September 1976.
[27]
Gérard Huet. Regular böhm trees. Draft, November 1996.
[28]
Jesper Jørgensen. A Calculus for Boxing Analysis of Polymorphically Typed Languages. PhD thesis, DIKU, University of Copenhagen, October 1995. DIKU Technical Report 96/28 and TOPPS Technical Report D-318; URL: http://www.diku.dk/research-groups/topps/Bibliography.html.
[29]
Dexter Kozen. Results on the propositional µ-calculus. In Mogens Nielsen and Erik Meineke Schmidt, editors, Proc. 9th Int'l Coll. on Automata, Languages and Programming (ICALP), Aarhus, Denmark, volume 140 of Lecture Notes in Computer Science (LNCS), pages 348-359. Springer-Verlag, July 1982.
[30]
Dexter Kozen. A completeness theorem for Kleene algebras and the algebra of regular events. Information and Computation, 110(2):366-390, May 1994.
[31]
Dexter Kozen, Jens Palsberg, and Michael Schwartzbach. Efficient recursive subtyping. Mathematical Structures in Computer Science (MSCS), 5(1), 1995. Conference version presented at the 20th Annual ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages (POPL), 1993.
[32]
Marina Lenisa. Final semantics for a higher order concurrent language. In H. Kirchner, editor, Proc. Coll. on Trees in Algebra and Programming (CAAP), volume 1059 of Lecture Notes in Computer Science (LNCS), pages 102-118. Springer-Verlag, 1996.
[33]
Robin Milner. Fully abstract models of typed ¿-calculi. Theoretical Computer Science (TCS), 4(l):l-22, February 1977.
[34]
Robin Milner. A complete inference system for a class of regular behaviours. Journal of Computer and System Sciences (JCSS), 28:439-466, 1984.
[35]
J. Morris. Lambda-Calculus Models of Programming Languages. PhD thesis, MIT, 1968.
[36]
Robin Milner and Mads Tofte. Co-induction in relational semantics. Theoretical Computer Science, 87(1):209-220, 1991. Note.
[37]
Hanne Riis Nielson. A Hoare-like proof system for total correctness of nested recursive procedures. In M. Arató, I. Kátai, and L. Varga, editors, Proc. 4th Hungarian Computer Science Conference, pages 227-239, 1985.
[38]
J. Rehof. Polymorphic dynamic typing -- aspects of proof theory and inference. Master's thesis, DIKU, University of Copenhagen, March 1995.
[39]
A. Salomaa. Two complete axiom systems for the algebra of regular events. Journal of the Association for Computing Machinery (JACM), 13(1):158-169, 1966.
[40]
Stefan Sokolowski. Total correctness for procedures. In J. Gruska, editor, Proc. 6th Symp. on Mathematical Foundations of Computer Science (MFCS), Tatranska Lomnica, Poland, volume 53 of Lecture Notes in Computer Science (LNCS), pages 475-483. Springer-Verlag, September 1977.

Cited By

View all
  • (2023)Mutually Iso-Recursive SubtypingProceedings of the ACM on Programming Languages10.1145/36228097:OOPSLA2(347-373)Online publication date: 16-Oct-2023
  • (2022)MLstruct: principal type inference in a Boolean algebra of structural typesProceedings of the ACM on Programming Languages10.1145/35633046:OOPSLA2(449-478)Online publication date: 31-Oct-2022
  • (2018)Empowering union and intersection types with integrated subtypingProceedings of the ACM on Programming Languages10.1145/32764822:OOPSLA(1-29)Online publication date: 24-Oct-2018
  • Show More Cited By
  1. Coinductive Axiomatization of Recursive Type Equality and Subtyping

      Recommendations

      Comments

      Please enable JavaScript to view thecomments powered by Disqus.

      Information & Contributors

      Information

      Published In

      cover image Fundamenta Informaticae
      Fundamenta Informaticae  Volume 33, Issue 4
      December 1998
      125 pages

      Publisher

      IOS Press

      Netherlands

      Publication History

      Published: 01 December 1998

      Author Tags

      1. axiomatization
      2. coercion
      3. coinduction
      4. fixpoint
      5. inference rule
      6. inference system
      7. operational interpretation
      8. recursive type
      9. subtyping
      10. type equality

      Qualifiers

      • Article

      Contributors

      Other Metrics

      Bibliometrics & Citations

      Bibliometrics

      Article Metrics

      • Downloads (Last 12 months)0
      • Downloads (Last 6 weeks)0
      Reflects downloads up to 12 Dec 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (2023)Mutually Iso-Recursive SubtypingProceedings of the ACM on Programming Languages10.1145/36228097:OOPSLA2(347-373)Online publication date: 16-Oct-2023
      • (2022)MLstruct: principal type inference in a Boolean algebra of structural typesProceedings of the ACM on Programming Languages10.1145/35633046:OOPSLA2(449-478)Online publication date: 31-Oct-2022
      • (2018)Empowering union and intersection types with integrated subtypingProceedings of the ACM on Programming Languages10.1145/32764822:OOPSLA(1-29)Online publication date: 24-Oct-2018
      • (2017)On Subtyping-Relation Completeness, with an Application to Iso-Recursive TypesACM Transactions on Programming Languages and Systems10.1145/299459639:1(1-36)Online publication date: 6-Mar-2017
      • (2016)System f-omega with equirecursive types for datatype-generic programmingACM SIGPLAN Notices10.1145/2914770.283766051:1(30-43)Online publication date: 11-Jan-2016
      • (2016)System f-omega with equirecursive types for datatype-generic programmingProceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2837614.2837660(30-43)Online publication date: 11-Jan-2016
      • (2016)Type Soundness for Path PolymorphismElectronic Notes in Theoretical Computer Science (ENTCS)10.1016/j.entcs.2016.06.015323:C(235-251)Online publication date: 11-Jul-2016
      • (2016)Reversible client/server interactionsFormal Aspects of Computing10.1007/s00165-016-0358-228:4(697-722)Online publication date: 1-Jul-2016
      • (2016)Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesundefinedOnline publication date: 11-Jan-2016
      • (2014)Sound and Complete Subtyping between Coinductive Types for Object-Oriented LanguagesProceedings of the 28th European Conference on ECOOP 2014 --- Object-Oriented Programming - Volume 858610.1007/978-3-662-44202-9_12(282-307)Online publication date: 1-Aug-2014
      • Show More Cited By

      View Options

      View options

      Login options

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media