Skip to main content
Erschienen in:
Buchtitelbild

2017 | OriginalPaper | Buchkapitel

Disjoint Polymorphism

verfasst von : João Alpuim, Bruno C. d. S. Oliveira, Zhiyuan Shi

Erschienen in: Programming Languages and Systems

Verlag: Springer Berlin Heidelberg

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

search-config
loading …

Abstract

The combination of intersection types, a merge operator and parametric polymorphism enables important applications for programming. However, such combination makes it hard to achieve the desirable property of a coherent semantics: all valid reductions for the same expression should have the same value. Recent work proposed disjoint intersections types as a means to ensure coherence in a simply typed setting. However, the addition of parametric polymorphism was not studied. This paper presents https://static-content.springer.com/image/chp%3A10.1007%2F978-3-662-54434-1_1/442829_1_En_1_IEq1_HTML.gif : a calculus with disjoint intersection types, a variant of parametric polymorphism and a merge operator. https://static-content.springer.com/image/chp%3A10.1007%2F978-3-662-54434-1_1/442829_1_En_1_IEq2_HTML.gif is both type-safe and coherent. The key difficult occurs in an intersection type, it is not statically known whether the instantiated type will be disjoint to other components of the intersection. To address this problem we propose disjoint polymorphism: a constrained form of parametric polymorphism, which allows disjointness constraints for type variables. With disjoint polymorphism the calculus remains very flexible in terms of programs that can be written, while retaining coherence.

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!

Fußnoten
Literatur
5.
Zurück zum Zitat Ancona, D., Lagorio, G., Zucca, E.: Jam-designing a Java extension with mixins. ACM Trans. Program. Lang. Syst. 25(5), 641–712 (2003)CrossRef Ancona, D., Lagorio, G., Zucca, E.: Jam-designing a Java extension with mixins. ACM Trans. Program. Lang. Syst. 25(5), 641–712 (2003)CrossRef
6.
7.
Zurück zum Zitat Aydemir, B.E., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: POPL 2008 (2008) Aydemir, B.E., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: POPL 2008 (2008)
8.
Zurück zum Zitat Bettini, L., Bono, V., Likavec, S.: A core calculus of higher-order mixins and classes. In: SAC 2004 (2004) Bettini, L., Bono, V., Likavec, S.: A core calculus of higher-order mixins and classes. In: SAC 2004 (2004)
9.
Zurück zum Zitat Black, A.P., Bruce, K.B., Homer, M., Noble, J.: Grace: the absence of (inessential) difficulty. In: Onward! 2012 (2012) Black, A.P., Bruce, K.B., Homer, M., Noble, J.: Grace: the absence of (inessential) difficulty. In: Onward! 2012 (2012)
10.
Zurück zum Zitat Blume, M., Acar, U.A., Chae, W.: Extensible programming with first-class cases. In: ICFP 2006 (2006) Blume, M., Acar, U.A., Chae, W.: Extensible programming with first-class cases. In: ICFP 2006 (2006)
11.
Zurück zum Zitat Bracha, G., Cook, W.: Mixin-based inheritance. In: OOPSLA/ECOOP 1990 (1990) Bracha, G., Cook, W.: Mixin-based inheritance. In: OOPSLA/ECOOP 1990 (1990)
12.
Zurück zum Zitat Canning, P., Cook, W., Hill, W., Olthoff, W., Mitchell, J.C.: F-bounded polymorphism for object-oriented programming. In: FPCA 1989 (1989) Canning, P., Cook, W., Hill, W., Olthoff, W., Mitchell, J.C.: F-bounded polymorphism for object-oriented programming. In: FPCA 1989 (1989)
13.
Zurück zum Zitat Cardelli, L.: Extensible records in a pure calculus of subtyping. In: Theoretical Aspects of Object-oriented Programming. MIT Press, Cambridge (1994) Cardelli, L.: Extensible records in a pure calculus of subtyping. In: Theoretical Aspects of Object-oriented Programming. MIT Press, Cambridge (1994)
14.
Zurück zum Zitat Cardelli, L., Martini, S., Mitchell, J.C., Scedrov, A.: An extension of system F with subtyping. Inf. Comput. 109(1–2), 4–56 (1994)MathSciNetCrossRef Cardelli, L., Martini, S., Mitchell, J.C., Scedrov, A.: An extension of system F with subtyping. Inf. Comput. 109(1–2), 4–56 (1994)MathSciNetCrossRef
15.
Zurück zum Zitat Cardelli, L., Mitchell, J.C.: Operations on records. In: Main, M., Melton, A., Mislove, M., Schmidt, D. (eds.) MFPS 1989. LNCS, vol. 442, pp. 22–52. Springer, Heidelberg (1990). doi:10.1007/BFb0040253CrossRef Cardelli, L., Mitchell, J.C.: Operations on records. In: Main, M., Melton, A., Mislove, M., Schmidt, D. (eds.) MFPS 1989. LNCS, vol. 442, pp. 22–52. Springer, Heidelberg (1990). doi:10.​1007/​BFb0040253CrossRef
16.
Zurück zum Zitat Cardelli, L., Wegner, P.: On understanding types, data abstraction, and polymorphism. ACM Comput. Surv. 17(4), 471–522 (1985)CrossRef Cardelli, L., Wegner, P.: On understanding types, data abstraction, and polymorphism. ACM Comput. Surv. 17(4), 471–522 (1985)CrossRef
17.
Zurück zum Zitat Castagna, G., Ghelli, G., Longo, G.: A calculus for overloaded functions with subtyping. Inf. Comput. 117(1), 115–135 (1995)MathSciNetCrossRef Castagna, G., Ghelli, G., Longo, G.: A calculus for overloaded functions with subtyping. Inf. Comput. 117(1), 115–135 (1995)MathSciNetCrossRef
18.
Zurück zum Zitat Castagna, G., Nguyen, K., Xu, Z., Im, H., Lenglet, S., Padovani, L.: Polymorphic functions with set-theoretic types: part 1: syntax, semantics, and evaluation. In: POPL 2014 (2014) Castagna, G., Nguyen, K., Xu, Z., Im, H., Lenglet, S., Padovani, L.: Polymorphic functions with set-theoretic types: part 1: syntax, semantics, and evaluation. In: POPL 2014 (2014)
19.
Zurück zum Zitat Compagnoni, A.B., Pierce, B.C.: Higher-order intersection types and multiple inheritance. Math. Struct. Comput. Sci. 6(5), 469–501 (1996)MathSciNetCrossRef Compagnoni, A.B., Pierce, B.C.: Higher-order intersection types and multiple inheritance. Math. Struct. Comput. Sci. 6(5), 469–501 (1996)MathSciNetCrossRef
20.
Zurück zum Zitat Coppo, M., Dezani-Ciancaglini, M., Venneri, B.: Functional characters of solvable terms. Math. Logic Q. 27(2–6), 45–58 (1981)MathSciNetCrossRef Coppo, M., Dezani-Ciancaglini, M., Venneri, B.: Functional characters of solvable terms. Math. Logic Q. 27(2–6), 45–58 (1981)MathSciNetCrossRef
21.
Zurück zum Zitat Crary, K.: Simple, efficient object encoding using intersection types. Technical report, CMU-CS-99-100, Cornell University (1998) Crary, K.: Simple, efficient object encoding using intersection types. Technical report, CMU-CS-99-100, Cornell University (1998)
22.
Zurück zum Zitat Davies, R., Pfenning, F.: Intersection types and computational effects. In: ICFP 2000 (2000) Davies, R., Pfenning, F.: Intersection types and computational effects. In: ICFP 2000 (2000)
23.
Zurück zum Zitat Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., Black, A.P.: Traits: a mechanism for fine-grained reuse. ACM Trans. Program. Lang. Syst. 28(2), 331–388 (2006)CrossRef Ducasse, S., Nierstrasz, O., Schärli, N., Wuyts, R., Black, A.P.: Traits: a mechanism for fine-grained reuse. ACM Trans. Program. Lang. Syst. 28(2), 331–388 (2006)CrossRef
24.
Zurück zum Zitat Dunfield, J.: Elaborating intersection and union types. In: ICFP 2012 (2012) Dunfield, J.: Elaborating intersection and union types. In: ICFP 2012 (2012)
25.
Zurück zum Zitat Findler, R.B., Flatt, M.: Modular object-oriented programming with units and mixins. In: ICFP 1998 (1998) Findler, R.B., Flatt, M.: Modular object-oriented programming with units and mixins. In: ICFP 1998 (1998)
26.
Zurück zum Zitat Fisher, K.: A typed calculus of traits. In: FOOL 2011 (2004) Fisher, K.: A typed calculus of traits. In: FOOL 2011 (2004)
27.
Zurück zum Zitat Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: POPL 1998 (1998) Flatt, M., Krishnamurthi, S., Felleisen, M.: Classes and mixins. In: POPL 1998 (1998)
28.
Zurück zum Zitat Gaster, B.R., Jones, M.P.: A polymorphic type system for extensible records and variants. Technical report, NOTTCS-TR-96-3, University of Nottingham (1996) Gaster, B.R., Jones, M.P.: A polymorphic type system for extensible records and variants. Technical report, NOTTCS-TR-96-3, University of Nottingham (1996)
29.
Zurück zum Zitat Harper, R., Pierce, B.: A record calculus based on symmetric concatenation. In: POPL 1991 (1991) Harper, R., Pierce, B.: A record calculus based on symmetric concatenation. In: POPL 1991 (1991)
30.
Zurück zum Zitat Harper, R.W., Pierce, B.C.: Extensible records without subsumption. Technical report, CMU-C5-90-102 (1990) Harper, R.W., Pierce, B.C.: Extensible records without subsumption. Technical report, CMU-C5-90-102 (1990)
31.
Zurück zum Zitat Jones, M., Jones, S.P.: Lightweight extensible records for Haskell. Technical report, UU-CS-1999-28, Haskell Workshop (1999) Jones, M., Jones, S.P.: Lightweight extensible records for Haskell. Technical report, UU-CS-1999-28, Haskell Workshop (1999)
32.
Zurück zum Zitat Jones, M.P.: Qualified Types: Theory and Practice. Cambridge University Press, Cambridge (1994)CrossRef Jones, M.P.: Qualified Types: Theory and Practice. Cambridge University Press, Cambridge (1994)CrossRef
33.
Zurück zum Zitat Leijen, D.: First-class labels for extensible rows. Technical report, UU-CS-2004-051, Utrecht University (2004) Leijen, D.: First-class labels for extensible rows. Technical report, UU-CS-2004-051, Utrecht University (2004)
34.
Zurück zum Zitat Leijen, D.: Extensible records with scoped labels. In: Trends in Functional Programming (2005) Leijen, D.: Extensible records with scoped labels. In: Trends in Functional Programming (2005)
35.
Zurück zum Zitat Makholm, H., Wells, J.B.: Type inference, principal typings, and let-polymorphism for first-class mixin modules. In: ICFP 2005 (2005) Makholm, H., Wells, J.B.: Type inference, principal typings, and let-polymorphism for first-class mixin modules. In: ICFP 2005 (2005)
36.
Zurück zum Zitat Odersky, M., Zenger, M.: Scalable component abstractions. In: OOPSLA 2005 (2005) Odersky, M., Zenger, M.: Scalable component abstractions. In: OOPSLA 2005 (2005)
37.
Zurück zum Zitat Odersky, M., et al.: An overview of the Scala programming language. Technical report, IC/2004/64, EPFL Lausanne, Switzerland (2004) Odersky, M., et al.: An overview of the Scala programming language. Technical report, IC/2004/64, EPFL Lausanne, Switzerland (2004)
38.
Zurück zum Zitat Oliveira, B.C.S., Shi, Z., Alpuim, J.: Disjoint intersection types. In: ICFP 2016 (2016) Oliveira, B.C.S., Shi, Z., Alpuim, J.: Disjoint intersection types. In: ICFP 2016 (2016)
39.
Zurück zum Zitat Oliveira, B.C.S., Storm, T., Loh, A., Cook, W.R.: Feature-oriented programming with object algebras. In: Castagna, G. (ed.) ECOOP 2013. LNCS, vol. 7920, pp. 27–51. Springer, Heidelberg (2013). doi:10.1007/978-3-642-39038-8_2CrossRef Oliveira, B.C.S., Storm, T., Loh, A., Cook, W.R.: Feature-oriented programming with object algebras. In: Castagna, G. (ed.) ECOOP 2013. LNCS, vol. 7920, pp. 27–51. Springer, Heidelberg (2013). doi:10.​1007/​978-3-642-39038-8_​2CrossRef
40.
Zurück zum Zitat Pierce, B.C.: Programming with intersection types and bounded polymorphism. Ph.D. thesis, Carnegie Mellon University (1991) Pierce, B.C.: Programming with intersection types and bounded polymorphism. Ph.D. thesis, Carnegie Mellon University (1991)
41.
Zurück zum Zitat Pierce, B.C., Turner, D.N.: Simple type-theoretic foundations for object-oriented programming. J. Funct. Program. 4(2), 207–247 (1994)CrossRef Pierce, B.C., Turner, D.N.: Simple type-theoretic foundations for object-oriented programming. J. Funct. Program. 4(2), 207–247 (1994)CrossRef
42.
Zurück zum Zitat Pottier, F.: A constraint-based presentation and generalization of rows. In: LICS 2003 (2003) Pottier, F.: A constraint-based presentation and generalization of rows. In: LICS 2003 (2003)
43.
Zurück zum Zitat Pottinger, G.: A type assignment for the strongly normalizable \(\lambda \)-terms. In: To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism (1980) Pottinger, G.: A type assignment for the strongly normalizable \(\lambda \)-terms. In: To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism (1980)
44.
Zurück zum Zitat Rémy, D.: Typing record concatenation for free. In: POPL 1992 (1992) Rémy, D.: Typing record concatenation for free. In: POPL 1992 (1992)
45.
Zurück zum Zitat Rémy, D.: Type inference for records in natural extension of ML. In: Theoretical Aspects of Object-Oriented Programming. MIT Press, Cambridge (1994) Rémy, D.: Type inference for records in natural extension of ML. In: Theoretical Aspects of Object-Oriented Programming. MIT Press, Cambridge (1994)
46.
Zurück zum Zitat Rendel, T., Brachthäuser, J.I., Ostermann, K.: From object algebras to attribute grammars. In: OOPSLA 2014 (2014) Rendel, T., Brachthäuser, J.I., Ostermann, K.: From object algebras to attribute grammars. In: OOPSLA 2014 (2014)
47.
48.
Zurück zum Zitat Reynolds, J.C.: Design of the programming language Forsythe. In: Algol-like languages, Birkhäuser Boston (1997) Reynolds, J.C.: Design of the programming language Forsythe. In: Algol-like languages, Birkhäuser Boston (1997)
49.
Zurück zum Zitat Rompf, T., Amin, N.: Type soundness for dependent object types. In: OOPSLA 2016 (2016) Rompf, T., Amin, N.: Type soundness for dependent object types. In: OOPSLA 2016 (2016)
50.
51.
Zurück zum Zitat Sulzmann, M.: Designing record systems. Technical report, YALEU/DCS/RR-1128, Yale University (1997) Sulzmann, M.: Designing record systems. Technical report, YALEU/DCS/RR-1128, Yale University (1997)
52.
Zurück zum Zitat Wand, M.: Complete type inference for simple objects. In: LICS 1987 (1987) Wand, M.: Complete type inference for simple objects. In: LICS 1987 (1987)
53.
Zurück zum Zitat Wand, M.: Type inference for record concatenation and multiple inheritance. In: LICS 1989 (1989) Wand, M.: Type inference for record concatenation and multiple inheritance. In: LICS 1989 (1989)
Metadaten
Titel
Disjoint Polymorphism
verfasst von
João Alpuim
Bruno C. d. S. Oliveira
Zhiyuan Shi
Copyright-Jahr
2017
Verlag
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/978-3-662-54434-1_1