Hostname: page-component-7c8c6479df-ph5wq Total loading time: 0 Render date: 2024-03-29T11:07:44.030Z Has data issue: false hasContentIssue false

Pure iso-type systems

Published online by Cambridge University Press:  17 September 2019

YANPENG YANG
Affiliation:
The University of Hong Kong, Pokfulam, Hong Kong (e-mails: ypyang@cs.hku.hk, bruno@cs.hku.hk)
BRUNO C. D. S. OLIVEIRA
Affiliation:
The University of Hong Kong, Pokfulam, Hong Kong (e-mails: ypyang@cs.hku.hk, bruno@cs.hku.hk)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Regular Paper
Copyright
© Cambridge University Press 2019 

References

Accattoli, B. & Guerrieri, G. (2016) Open call-by-value. In Programming Languages and Systems, Igarashi, A. (ed). Cham: Springer International Publishing, pp. 206226.CrossRefGoogle Scholar
Adams, R. (2006) Pure type systems with judgemental equality. J. Funct. program. 16(02), 219246.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Amin, N., Moors, A. & Odersky, M. (2012) Dependent object types. In 19th International Workshop on Foundations of Object-Oriented Languages. FOOL’12.Google Scholar
Amin, N., Rompf, T. & Odersky, M. (2014) Foundations of path-dependent types. In OOPSLA’14. ACM, pp. 233249.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Aspinall, D. & Compagnoni, A. (1996) Subtyping dependent types. In LICS’96, IEEE, pp. 8697.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Barendregt, H. (1991) Introduction to generalized type systems. J. Funct. Program. 1(2), 125154.CrossRefGoogle Scholar
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.Google Scholar
Bird, R. & Meertens, L. (1998) Nested datatypes. In International Conference on Mathematics of Program Construction. Springer, pp. 5267.CrossRefGoogle Scholar
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.Google Scholar
Bruce, K. B., Cardelli, L. & Pierce, B. C. (1999). Comparing object encodings. Inf. Comput. 155(1–2), 108133.CrossRefGoogle Scholar
Cardelli, L. (1986) A polymorphic lambda-calculus with type: Type. Digital Systems Research Center.Google Scholar
Cardelli, L., Martini, S., Mitchell, J.C. & Scedrov, A. (1994) An extension of system F with subtyping. Inf. Comput. 109(1–2), 456.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Castagna, G. & Chen, G. (2001) Dependent types with subtyping and late-bound overloading. Inf. Comput. 168(1), 167.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Cheney, J. & Hinze, R. (2003) First-Class Phantom Types. Technical Report CUCIS TR2003-1901.Google Scholar
Coquand, T. & Huet, G. (1988) The calculus of constructions. Inf. Comput. 76, 95120.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Eisenberg, R. A. (2016) Dependent Types in Haskell: Theory and Practice. PhD thesis, University of Pennsylvania.Google Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Girard, J.-Y. (1972) Interprétation fonctionnelle et élimination des coupures de l’arithmétique d’ordre supérieur. PhD thesis, Université Paris VII.Google Scholar
Gundry, A. M. (2013) Type Inference, Haskell and Dependent Types. PhD thesis, University of Strathclyde.Google Scholar
Hindley, R. (1969) The principal type-scheme of an object in combinatory logic. Trans. Amer. Math. Soc. 146, 2960.Google Scholar
Huet, G. (1973) The undecidability of unification in third order logic. Inf. Control 22(3), 257267.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Jones, M. P. (2000) Type classes with functional dependencies. In Programming Languages and Systems, Smolka, G. (ed). Berlin, Heidelberg: Springer, pp. 230244.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Marlow, S. (2010) Haskell 2010 language report. 2010.Google Scholar
Milner, R. (1978) A theory of type polymorphism in programming. J. Comput. Syst. Sci. 17(3), 348375.CrossRefGoogle Scholar
Mogensen, T. Æ. (1992) Theoretical pearls: Efficient self-interpretation in lambda calculus. J. Funct. Program 2(3), 345364.CrossRefGoogle Scholar
Norell, U. (2007) Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Chalmers University of Technology.Google Scholar
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.Google Scholar
Paolini, L. & Della Rocca, S. R. (1999) Call-by-value solvability. Rairo-Theor. Inf. Appl. 33(6), 507534.CrossRefGoogle Scholar
Peyton Jones, S. & Meijer, E. (1997) Henk: a Typed Intermediate Language. In Types in Compilation Workshop.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
Pierce, B. C. (2002). Types and Programming Languages. MIT.Google Scholar
Pierce, B. C. & Turner, D. N. (1994) Simple type-theoretic foundations for object-oriented programming. J. Funct. Program. 4(02), 207247.CrossRefGoogle Scholar
Reynolds, J. C. (1974) Towards a theory of type structure. In Proceedings of the ‘Colloque sur la Programmation’, Berlin, Heidelberg: Springer-Verlag, pp. 408425.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Siles, V. & Herbelin, H. (2012) Pure type system conversion is always typable. J. Funct. Program 22(2), 153180.CrossRefGoogle Scholar
Sjöberg, V. (2015) A Dependently Typed Language with Nontermination. PhD thesis, University of Pennsylvania.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Swierstra, W. (2008) Data types à la carte. J. Funct. Program. 18(4), 423436.CrossRefGoogle Scholar
The Coq Development Team. (2016) The Coq Proof Assistant Reference Manual. Version 8.6.Google Scholar
van Benthem Jutting, L. S. (1993). Typing in pure type systems. Inf. Comput. 105(1), 3041.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Wadler, P. (1995) Monads for functional programming. In Advanced Functional Programming, Jeuring, J. & Meijer, E. (eds). Berlin, Heidelberg: Springer, pp. 2452.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
Wright, A. K. & Felleisen, M. (1994) A syntactic approach to type soundness. Inf Comput. 115(1), 3894.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Yang, Y. & Oliveira, B. C. d. S. (2017) Unifying typing and subtyping. Proc. ACM Program. Lang. 1(OOPSLA), 47:1–47:26.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.