Skip to main content Accessibility help
×
Home

Pure iso-type systems

  • YANPENG YANG (a1) and BRUNO C. D. S. OLIVEIRA (a1)

Abstract

Traditional designs for functional languages (such as Haskell or ML) have separate sorts of syntax for terms and types. In contrast, many dependently typed languages use a unified syntax that accounts for both terms and types. Unified syntax has some interesting advantages over separate syntax, including less duplication of concepts, and added expressiveness. However, integrating unrestricted general recursion in calculi with unified syntax is challenging when some level of type-level computation is present, since properties such as decidable type-checking are easily lost. This paper presents a family of calculi called pure iso-type systems (PITSs), which employs unified syntax, supports general recursion and preserves decidable type-checking. PITS is comparable in simplicity to pure type systems (PTSs), and is useful to serve as a foundation for functional languages that stand in-between traditional ML-like languages and fully blown dependently typed languages. In PITS, recursion and recursive types are completely unrestricted and type equality is simply based on alpha-equality, just like traditional ML-style languages. However, like most dependently typed languages, PITS uses unified syntax, naturally supporting many advanced type system features. Instead of implicit type conversion, PITS provides a generalization of iso-recursive types called iso-types. Iso-types replace the conversion rule typically used in dependently typed calculus and make every type-level computation explicit via cast operators. Iso-types avoid the complexity of explicit equality proofs employed in other approaches with casts. We study three variants of PITS that differ on the reduction strategy employed by the cast operators: call-by-name, call-by-value and parallel reduction. One key finding is that while using call-by-value or call-by-name reduction in casts loses some expressive power, it allows those variants of PITS to have simple and direct operational semantics and proofs. In contrast, the variant of PITS with parallel reduction retains the expressive power of PTS conversion, at the cost of a more complex metatheory.

Copyright

References

Hide All
Accattoli, B. & Guerrieri, G. (2016) Open call-by-value. In Programming Languages and Systems, Igarashi, A. (ed). Cham: Springer International Publishing, pp. 206226.
Adams, R. (2006) Pure type systems with judgemental equality. J. Funct. program. 16(02), 219246.
Altenkirch, T., Danielsson, N. A., Löh, A. & Oury, N. (2010) πσ: Dependent types without the sugar. In Functional and Logic Programming, Blume, M., Kobayashi, N. & Vidal, G. (eds). Berlin, Heidelberg: Springer, pp. 4055.
Amin, N., Moors, A. & Odersky, M. (2012) Dependent object types. In 19th International Workshop on Foundations of Object-Oriented Languages. FOOL’12.
Amin, N., Rompf, T. & Odersky, M. (2014) Foundations of path-dependent types. In OOPSLA’14. ACM, pp. 233249.
Amin, N., Grütter, S., Odersky, M., Rompf, T. & Stucki, S. (2016) The essence of dependent object types. In A List of Successes That Can Change the World. Springer, pp. 249272.
Aspinall, D. & Compagnoni, A. (1996) Subtyping dependent types. In LICS’96, IEEE, pp. 8697.
Augustsson, L. (1998) Cayenne — a language with dependent types. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming. ICFP’98. New York, NY, USA: ACM, pp. 239250.
Barendregt, H. (1991) Introduction to generalized type systems. J. Funct. Program. 1(2), 125154.
Barendregt, H. (1992) Lambda calculi with types. In Handbook of Logic in Computer Science, vol. 2, Abramsky, S., Gabbay, D. M., & Maibaum, S. E. (eds). Oxford University Press, Inc., pp. 117309.
Bird, R. & Meertens, L. (1998) Nested datatypes. In International Conference on Mathematics of Program Construction. Springer, pp. 5267.
Brady, E. C. (2011) Idris — systems programming meets full dependent types. In Proceedings of the 5th ACM Workshop on Programming Languages Meets Program Verification. PLPV’11. New York, NY, USA: ACM, pp. 4354.
Bruce, K. B., Cardelli, L. & Pierce, B. C. (1999). Comparing object encodings. Inf. Comput. 155(1–2), 108133.
Cardelli, L. (1986) A polymorphic lambda-calculus with type: Type. Digital Systems Research Center.
Cardelli, L., Martini, S., Mitchell, J.C. & Scedrov, A. (1994) An extension of system F with subtyping. Inf. Comput. 109(1–2), 456.
Casinghino, C., Sjöberg, V. & Weirich, S. (2014) Combining proofs and programs in a dependently typed language. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL’14. New York, NY, USA: ACM, pp. 3345.
Castagna, G. & Chen, G. (2001) Dependent types with subtyping and late-bound overloading. Inf. Comput. 168(1), 167.
Chakravarty, M. M. T., Keller, G. & Jones, S. P. (2005) Associated type synonyms. In ICFP’05: Proceedings of the Tenth ACM SIGPLAN International Conference on Functional Programming. New York, NY, USA: ACM, pp. 241253.
Cheney, J. & Hinze, R. (2002) A lightweight implementation of generics and dynamics. In Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell. Haskell’02. New York, NY, USA: ACM, pp. 90104.
Cheney, J. & Hinze, R. (2003) First-Class Phantom Types. Technical Report CUCIS TR2003-1901.
Coquand, T. & Huet, G. (1988) The calculus of constructions. Inf. Comput. 76, 95120.
Crary, K., Harper, R. & Puri, S. (1999) What is a recursive module? In Proceedings of the ACM SIGPLAN 1999 Conference on Programming Language Design and Implementation. PLDI’99. New York, NY, USA: ACM, pp. 5063.
Damas, L. & Milner, R. (1982) Principal type-schemes for functional programs. In Proceedings of the 9th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL’82. New York, NY, USA: ACM, pp. 207212.
Eisenberg, R. A. (2016) Dependent Types in Haskell: Theory and Practice. PhD thesis, University of Pennsylvania.
Eisenberg, R. A., Vytiniotis, D., Peyton Jones, S. & Weirich, S. (2014) Closed type families with overlapping equations. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL’14. New York, NY, USA: ACM, pp. 671683.
Eisenberg, R. A., Weirich, S. & Ahmed, H. G. (2016) Visible type application. In Programming Languages and Systems, Thiemann, P. (ed). Berlin, Heidelberg: Springer, pp. 229254.
Fegaras, L. & Sheard, T. (1996). Revisiting catamorphisms over datatypes with embedded functions (or, programs from outer space). In Proceedings of the 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL’96. New York, NY, USA: ACM, pp. 284294.
Geuvers, H. (1995) A short and flexible proof of strong normalization for the calculus of constructions. In Types for Proofs and Programs, Dybjer, P., Nordström, B. & Smith, J. (eds). Berlin, Heidelberg: Springer, pp. 1438.
Girard, J.-Y. (1972) Interprétation fonctionnelle et élimination des coupures de l’arithmétique d’ordre supérieur. PhD thesis, Université Paris VII.
Gundry, A. M. (2013) Type Inference, Haskell and Dependent Types. PhD thesis, University of Strathclyde.
Hindley, R. (1969) The principal type-scheme of an object in combinatory logic. Trans. Amer. Math. Soc. 146, 2960.
Huet, G. (1973) The undecidability of unification in third order logic. Inf. Control 22(3), 257267.
Hutchins, D. S. (2010) Pure subtype systems. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL’10. ACM, pp. 287298.
Jones, M. P. (1993) A system of constructor classes: Overloading and implicit higher-order polymorphism. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture. FPCA’93. New York, NY, USA: ACM, pp. 5261.
Jones, M. P. (2000) Type classes with functional dependencies. In Programming Languages and Systems, Smolka, G. (ed). Berlin, Heidelberg: Springer, pp. 230244.
Kimmell, G., Stump, A., Eades, III, H.D., Fu, P., Sheard, T., Weirich, S., Casinghino, C., Sjöberg, V., Collins, N. & Ahn, K. Y. (2012) Equational reasoning about programs with general recursion and call-by-value semantics. In Proceedings of the Sixth Workshop on Programming Languages Meets Program Verification. PLPV’12. New York, NY, USA: ACM, pp. 1526.
Marlow, S. (2010) Haskell 2010 language report. 2010.
Milner, R. (1978) A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17(3), 348375.
Mogensen, T. Æ. (1992) Theoretical pearls: Efficient self-interpretation in lambda calculus. J. Funct. Program 2(3), 345364.
Norell, U. (2007) Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Chalmers University of Technology.
Odersky, M., Altherr, P., Cremet, V., Emir, B., Maneth, S., Micheloud, S., Mihaylov, N., Schinz, M., Stenman, E. & Zenger, M. (2004). An Overview of the Scala Programming Language. Technical Report. IC/2004/64. EPFL Lausanne, Switzerland.
Paolini, L. & Della Rocca, S. R. (1999) Call-by-value solvability. Rairo-Theor. Inf. Appl. 33(6), 507534.
Peyton Jones, S. & Meijer, E. (1997) Henk: a Typed Intermediate Language. In Types in Compilation Workshop.
Peyton Jones, S., Washburn, G. & Weirich, S. (2004) Wobbly Types: Type Inference for Generalised Algebraic Data Types. Technical Report. MS-CIS-05-26. University of Pennsylvania.
Pfenning, F. & Elliott, C. (1988). Higher-order abstract syntax. In Proceedings of the ACM SIGPLAN 1988 Conference on Programming Language Design and Implementation. PLDI’88. New York, NY, USA: ACM, pp. 199208.
Pierce, B. C. (2002). Types and Programming Languages. MIT.
Pierce, B. C. & Turner, D. N. (1994) Simple type-theoretic foundations for object-oriented programming. J. Funct. Program. 4(02), 207247.
Reynolds, J. C. (1974) Towards a theory of type structure. In Proceedings of the ‘Colloque sur la Programmation’, Berlin, Heidelberg: Springer-Verlag, pp. 408425.
Schrijvers, T., Peyton Jones, S., Chakravarty, M. & Sulzmann, M. (2008) Type checking with open type functions. In Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming. ICFP’08. New York, NY, USA: ACM, pp. 5162.
Siles, V. & Herbelin, H. (2012) Pure type system conversion is always typable. J. Funct. Program 22(2), 153180.
Sjöberg, V. (2015) A Dependently Typed Language with Nontermination. PhD thesis, University of Pennsylvania.
Sjöberg, V., Casinghino, C., Ahn, K. Y., Collins, N., Eades, III, H. D., Fu, P., Kimmell, G., Sheard, T., Stump, A. & Weirich, S. (2012). Irrelevance, heterogenous equality, and call-by-value dependent type systems. In Fourth workshop on Mathematically Structured Functional Programming (MSFP’12). MSFP’12, pp. 112162.
Sjöberg, V. & Weirich, S. (2015) Programming up to congruence. In Proceedings of the 42Nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL’15. New York, NY, USA: ACM, 369–382.
Stump, A., Deters, M., Petcher, A., Schiller, T. & Simpson, T. (2008) Verified programming in guru. In Proceedings of the 3rd Workshop on Programming Languages Meets Program Verification. PLPV’09. New York, NY, USA: ACM, pp. 4958.
Sulzmann, M., Chakravarty, M. M. T., Peyton Jones, S. & Donnelly, K. (2007) System F with type equality coercions. In Proceedings of the 2007 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation. TLDI’07. New York, NY, USA: ACM, pp. 5366.
Swamy, N., Chen, J., Fournet, C., Strub, P.-Y., Bhargavan, K. & Yang, J. (2011) Secure distributed programming with value-dependent types. In Proceedings of the 16th ACM SIGPLAN International Conference on Functional Programming. ICFP’11. New York, NY, USA: ACM, pp. 266278.
Swierstra, W. (2008) Data types à la carte. J. Funct. Program. 18(4), 423436.
The Coq Development Team. (2016) The Coq Proof Assistant Reference Manual. Version 8.6.
van Benthem Jutting, L. S. (1993). Typing in pure type systems. Inf. Comput. 105(1), 3041.
van Doorn, F., Geuvers, H. & Wiedijk, F. (2013) Explicit convertibility proofs in pure type systems. In Proceedings of the Eighth ACM SIGPLAN International Workshop on Logical Frameworks & Meta-Languages: Theory & Practice. LFMTP’13. New York, NY, USA: ACM, pp. 2536.
Wadler, P. (1995) Monads for functional programming. In Advanced Functional Programming, Jeuring, J. & Meijer, E. (eds). Berlin, Heidelberg: Springer, pp. 2452.
Weirich, S., Hsu, J. & Eisenberg, R. A. (2013) System fc with explicit kind equality. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming. ICFP’13. New York, NY, USA: ACM, pp. 275286.
Weirich, S., Voizard, A., de Amorim, P. H. A. & Eisenberg, R. A. (2017). A specification for dependent types in Haskell. Proc. ACM Program. Lang. 1(ICFP), 31:1–31:29.
Wright, A. K. & Felleisen, M. (1994) A syntactic approach to type soundness. Inf Comput. 115(1), 3894.
Xi, H., Chen, C. & Chen, G. (2003) Guarded recursive datatype constructors. In Proceedings of the 30th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. POPL’03. New York, NY, USA: ACM, pp. 224235.
Yang, Y., Bi, X. & Oliveira, B. C. d. S. (2016) Unified syntax with iso-types. In Programming Languages and Systems, Igarashi, A. (ed). Cham: Springer International Publishing, pp. 251270.
Yang, Y. & Oliveira, B. C. d. S. (2017) Unifying typing and subtyping. Proc. ACM Program. Lang. 1(OOPSLA), 47:1–47:26.
Yorgey, B. A., Weirich, S., Cretin, J., Peyton Jones, S., Vytiniotis, D. & Magalhães, J. (2012) Giving Haskell a promotion. In Proceedings of the 8th ACM SIGPLAN Workshop on Types in Language Design and Implementation. TLDI ’12. New York, NY, USA: ACM, pp. 5366.

Pure iso-type systems

  • YANPENG YANG (a1) and BRUNO C. D. S. OLIVEIRA (a1)

Metrics

Altmetric attention score

Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed

Pure iso-type systems

  • YANPENG YANG (a1) and BRUNO C. D. S. OLIVEIRA (a1)
Submit a response

Discussions

No Discussions have been published for this article.

×

Reply to: Submit a response


Your details


Conflicting interests

Do you have any conflicting interests? *