Skip to main content

2018 | OriginalPaper | Buchkapitel

Formalization of a Polymorphic Subtyping Algorithm

verfasst von : Jinxu Zhao, Bruno C. d. S. Oliveira, Tom Schrijvers

Erschienen in: Interactive Theorem Proving

Verlag: Springer International Publishing

Aktivieren Sie unsere intelligente Suche, um passende Fachinhalte oder Patente zu finden.

search-config
loading …

Abstract

Modern functional programming languages such as Haskell support sophisticated forms of type-inference, even in the presence of higher-order polymorphism. Central to such advanced forms of type-inference is an algorithm for polymorphic subtyping. This paper formalizes an algorithmic specification for polymorphic subtyping in the Abella theorem prover. The algorithmic specification is shown to be decidable, and sound and complete with respect to Odersky and Läufer’s well-known declarative formulation of polymorphic subtyping.
While the meta-theoretical results are not new, as far as we know our work is the first to mechanically formalize them. Moreover, our algorithm differs from those currently in the literature by using a novel approach based on worklist judgements. Worklist judgements simplify the propagation of information required by the unification process during subtyping. Furthermore they enable a simple formulation of the meta-theoretical properties, which can be easily encoded in theorem provers.

Sie haben noch keine Lizenz? Dann Informieren Sie sich jetzt über unsere Produkte:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Literatur
2.
Zurück zum Zitat Aydemir, B., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008 (2008) Aydemir, B., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: Proceedings of the 35th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2008 (2008)
3.
Zurück zum Zitat Aydemir, B.E., Bohannon, A., Fairbairn, M., Foster, J.N., Pierce, B.C., Sewell, P., Vytiniotis, D., Washburn, G., Weirich, S., Zdancewic, S.: Mechanized metatheory for the masses: The POPLmark challenge. In: The 18th International Conference on Theorem Proving in Higher Order Logics (2005) Aydemir, B.E., Bohannon, A., Fairbairn, M., Foster, J.N., Pierce, B.C., Sewell, P., Vytiniotis, D., Washburn, G., Weirich, S., Zdancewic, S.: Mechanized metatheory for the masses: The POPLmark challenge. In: The 18th International Conference on Theorem Proving in Higher Order Logics (2005)
4.
Zurück zum Zitat Chlipala, A.: Parametric higher-order abstract syntax for mechanized semantics. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP 2008 (2008) Chlipala, A.: Parametric higher-order abstract syntax for mechanized semantics. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP 2008 (2008)
5.
Zurück zum Zitat Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1982 (1982) Damas, L., Milner, R.: Principal type-schemes for functional programs. In: Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1982 (1982)
8.
Zurück zum Zitat Dubois, C., Menissier-Morain, V.: Certification of a type inference tool for ML: Damas-Milner within Coq. J. Autom. Reasoning 23(3), 319–346 (1999)MathSciNetCrossRef Dubois, C., Menissier-Morain, V.: Certification of a type inference tool for ML: Damas-Milner within Coq. J. Autom. Reasoning 23(3), 319–346 (1999)MathSciNetCrossRef
9.
Zurück zum Zitat Dunfield, J., Krishnaswami, N.R.: Complete and easy bidirectional typechecking for higher-rank polymorphism. In: Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, ICFP 2013 (2013) Dunfield, J., Krishnaswami, N.R.: Complete and easy bidirectional typechecking for higher-rank polymorphism. In: Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming, ICFP 2013 (2013)
11.
Zurück zum Zitat Garrigue, J.: A certified implementation of ML with structural polymorphism and recursive types. Mathe. Struct. Comput. Sci. 25(4), 867–891 (2015)MathSciNetCrossRef Garrigue, J.: A certified implementation of ML with structural polymorphism and recursive types. Mathe. Struct. Comput. Sci. 25(4), 867–891 (2015)MathSciNetCrossRef
12.
Zurück zum Zitat Gill, A., Launchbury, J., Peyton Jones, S.L.: A short cut to deforestation. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture, FPCA 1993 (1993) Gill, A., Launchbury, J., Peyton Jones, S.L.: A short cut to deforestation. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture, FPCA 1993 (1993)
13.
Zurück zum Zitat Gundry, A., McBride, C., McKinna, J.: Type inference in context. In: Proceedings of the Third ACM SIGPLAN Workshop on Mathematically Structured Functional Programming, MSFP 2010 (2010) Gundry, A., McBride, C., McKinna, J.: Type inference in context. In: Proceedings of the Third ACM SIGPLAN Workshop on Mathematically Structured Functional Programming, MSFP 2010 (2010)
14.
Zurück zum Zitat Hindley, R.: The principal type-scheme of an object in combinatory logic. Trans. Am. Mathe. Soc. 146, 29–60 (1969)MathSciNetMATH Hindley, R.: The principal type-scheme of an object in combinatory logic. Trans. Am. Mathe. Soc. 146, 29–60 (1969)MathSciNetMATH
16.
Zurück zum Zitat Peyton Jones, S., Vytiniotis, D., Weirich, S., Shields, M.: Practical type inference for arbitrary-rank types. J. Funct. Program. 17(1), 1–82 (2007)MathSciNetCrossRef Peyton Jones, S., Vytiniotis, D., Weirich, S., Shields, M.: Practical type inference for arbitrary-rank types. J. Funct. Program. 17(1), 1–82 (2007)MathSciNetCrossRef
17.
Zurück zum Zitat Lämmel, R., Jones, S.P.: Scrap your boilerplate: a practical design pattern for generic programming. In: Proceedings of the 2003 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation, TLDI 2003 (2003) Lämmel, R., Jones, S.P.: Scrap your boilerplate: a practical design pattern for generic programming. In: Proceedings of the 2003 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation, TLDI 2003 (2003)
18.
Zurück zum Zitat Launchbury, J., Peyton Jones, S.L.: State in Haskell. LISP Symbolic Comput. 8(4), 293–341 (1995)CrossRef Launchbury, J., Peyton Jones, S.L.: State in Haskell. LISP Symbolic Comput. 8(4), 293–341 (1995)CrossRef
19.
Zurück zum Zitat Le Botlan, D., Rémy, D.: MLF: raising ML to the power of system F. In: Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming, ICFP 2003 (2003) Le Botlan, D., Rémy, D.: MLF: raising ML to the power of system F. In: Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming, ICFP 2003 (2003)
20.
Zurück zum Zitat Leijen, D.: HMF: Simple type inference for first-class polymorphism. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP 2008 (2008) Leijen, D.: HMF: Simple type inference for first-class polymorphism. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP 2008 (2008)
21.
Zurück zum Zitat Leroy, X., et al.: The CompCert verified compiler. Documentation and user’s manual, INRIA Paris-Rocquencourt (2012) Leroy, X., et al.: The CompCert verified compiler. Documentation and user’s manual, INRIA Paris-Rocquencourt (2012)
23.
24.
Zurück zum Zitat Naraschewski, W., Nipkow, T.: Type inference verified: algorithm W in Isabelle/HOL. J. Autom. Reason. 23(3), 299–318 (1999)MathSciNetCrossRef Naraschewski, W., Nipkow, T.: Type inference verified: algorithm W in Isabelle/HOL. J. Autom. Reason. 23(3), 299–318 (1999)MathSciNetCrossRef
26.
Zurück zum Zitat Odersky, M., Läufer, K.: Putting type annotations to work. In: Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1996 (1996) Odersky, M., Läufer, K.: Putting type annotations to work. In: Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 1996 (1996)
27.
Zurück zum Zitat Reed, J.: Higher-order constraint simplification in dependent type theory. In: Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, LFMTP 2009 (2009) Reed, J.: Higher-order constraint simplification in dependent type theory. In: Proceedings of the Fourth International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, LFMTP 2009 (2009)
28.
Zurück zum Zitat Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: Information Processing, pp. 513–523 (1983) Reynolds, J.C.: Types, abstraction and parametric polymorphism. In: Information Processing, pp. 513–523 (1983)
31.
Zurück zum Zitat Tiuryn, J., Urzyczyn, P.: The subtyping problem for second-order types is undecidable. In: Proceedings 11th Annual IEEE Symposium on Logic in Computer Science (1996) Tiuryn, J., Urzyczyn, P.: The subtyping problem for second-order types is undecidable. In: Proceedings 11th Annual IEEE Symposium on Logic in Computer Science (1996)
33.
Zurück zum Zitat Urban, C., Nipkow, T.: Nominal verification of algorithm W. from semantics to computer science. In: Essays in Honour of Gilles Kahn, pp. 363–382 (2008) Urban, C., Nipkow, T.: Nominal verification of algorithm W. from semantics to computer science. In: Essays in Honour of Gilles Kahn, pp. 363–382 (2008)
34.
Zurück zum Zitat Vytiniotis, D., Weirich, S., Peyton Jones, S.: FPH: first-class polymorphism for Haskell. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP 2008 (2008) Vytiniotis, D., Weirich, S., Peyton Jones, S.: FPH: first-class polymorphism for Haskell. In: Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP 2008 (2008)
35.
Zurück zum Zitat Wells, J.B.: Typability and type checking in system F are equivalent and undecidable. Ann. Pure Appl. Logic 98(1–3), 111–156 (1999)MathSciNetCrossRef Wells, J.B.: Typability and type checking in system F are equivalent and undecidable. Ann. Pure Appl. Logic 98(1–3), 111–156 (1999)MathSciNetCrossRef
Metadaten
Titel
Formalization of a Polymorphic Subtyping Algorithm
verfasst von
Jinxu Zhao
Bruno C. d. S. Oliveira
Tom Schrijvers
Copyright-Jahr
2018
DOI
https://doi.org/10.1007/978-3-319-94821-8_36

Premium Partner