Hostname: page-component-76fb5796d-5g6vh Total loading time: 0 Render date: 2024-04-27T08:56:44.357Z Has data issue: false hasContentIssue false

A focused solution to the avoidance problem

Published online by Cambridge University Press:  06 August 2020

KARL CRARY*
Affiliation:
Carnegie Mellon University, Pittsburgh, PA, 15213, USA, (e-mail: crary@cs.cmu.edu)
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.

In ML-style module type theory, sealing often leads to situations in which type variables must leave scope, and this creates a need for signatures that avoid such variables. Unfortunately, in general, there is no best signature that avoids a variable, so modules do not always enjoy principal signatures. This observation is called the avoidance problem. In the past, the problem has been circumvented using a variety of devices for moving variables so they can remain in scope. These devices work, but have heretofore lacked a logical foundation. They have also lacked a presentation in which the dynamic semantics is given on the same phrases as the static semantics, which limits their applications. We can provide a best supersignature avoiding a variable by fiat, by adding an existential signature that is the least upper bound of its instances. This idea is old, but a workable metatheory has not previously been worked out. This work resolves the metatheoretic issues using ideas borrowed from focused logic. We show that the new theory results in a type discipline very similar to the aforementioned devices used in prior work. In passing, this gives a type-theoretic justification for the generative stamps used in the early days of the static semantics of ML modules. All the proofs are formalized in Coq.

Type
Research Article
Copyright
© The Author(s), 2020. Published by Cambridge University Press

References

Andreoli, J.-M. (1992) Logic programming with focusing proofs in linear logic. J. Logic Comput. 2(3), 297347.CrossRefGoogle Scholar
Biswas, S. K. (1995) Higher-order functors with transparent signatures. In Twenty-Second ACM Symposium on Principles of Programming Languages, pp. 154163.CrossRefGoogle Scholar
Crary, K. (2007) Sound and complete elimination of singleton kinds. ACM Trans. Comput. Log. 8(2). An earlier version appeared in 2000 Workshop on Types in Compilation.CrossRefGoogle Scholar
Crary, K. (2009) A syntactic account of singleton types via hereditary substitution. In 2009 Workshop on Logical Frameworks and Meta-Languages: Theory and Practice, pp. 2129.CrossRefGoogle Scholar
Crary, K. (2017, January). Modules, abstraction, and parametric polymorphism. In Forty-Fourth ACM Symposium on Principles of Programming Languages, pp. 100113.CrossRefGoogle Scholar
Crary, K. (2018, July) Strong sums in focused logic. In Thirty-Third IEEE Symposium on Logic in Computer Science, pp. 265274.CrossRefGoogle Scholar
Crary, K. (2019, January). Fully abstract module compilation. In Forty-Sixth ACM Symposium on Principles of Programming Languages.CrossRefGoogle Scholar
Crary, K. & Harper, R. (2009) Mechanized definition of Standard ML. Available at https://www.cs.cmu.edu/~crary/papers/mldef-alpha.tar.gzGoogle Scholar
Dreyer, D. (2005, May). Understanding and evolving the ML module system. Ph.D. thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania.Google Scholar
Dreyer, D., Crary, K. & Harper, R (2003, January). A type system for higher-order modules. In Thirtieth ACM Symposium on Principles of Programming Languages, pp. 236–249.CrossRefGoogle Scholar
Elliott, C. M. (1990, May) Extensions and applications of higher-order unification. Ph.D. thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania.Google Scholar
Fairtlough, M. & Mendler, M. (1997) Propositional lax logic. Inform. Comput. 137(1), 133.CrossRefGoogle Scholar
Ghelli, G., & Pierce, B. (1998) Bounded existentials and minimal typing. Theor. Comput. Sci. 193, 7596.CrossRefGoogle Scholar
Girard, J.-Y. (1993) On the unity of logic. Ann. Pure Appl. Log. 59(3), 210217.CrossRefGoogle Scholar
Goldfarb, W. D. (1981) The undecidability of the second-order unification problem. Theor. Comput. Sci. 13, 225230.CrossRefGoogle Scholar
Harper, R. & Lillibridge, M. (1994, January) A type-theoretic approach to higher-order modules with sharing. In Twenty-First ACM Symposium on Principles of Programming Languages, pp. 123137.CrossRefGoogle Scholar
Harper, R. & Mitchell, J.C. (1993) On the type structure of Standard ML. ACM Trans. Program. Lang. Syst. 15(2), 211252.Google Scholar
Harper, R. & Stone, C. (2000) A type-theoretic interpretation of Standard ML. In Proof, Language and Interaction: Essays in Honour of Robin Milner. MIT. Extended version published as CMU Technical Report CMU-CS-97-147, pp. 341387.Google Scholar
Harper, R., Milner, R. & Tofte, M. (1987) A type discipline for program modules. In TAPSOFT 1987: Proceedings of the International Joint Conference on Theory and Practice of Software Development. Lecture Notes in Computer Science, vol. 250 Springer, pp. 308319.CrossRefGoogle Scholar
Harper, R., Mitchell, J. C. & Moggi, E. (1990, January) Higher-order modules and the phase distinction. In Seventeenth ACM Symposium on Principles of Programming Languages, pp. 341354.CrossRefGoogle Scholar
Harper, R., Honsell, F. & Plotkin, G. (1993). A framework for defining logics. J. ACM 40(1), 143184.CrossRefGoogle Scholar
Huet, G. P. (1975) A unification algorithm for typed λ-calculus. Theor. Comput. Sci. 1(1), 2757.CrossRefGoogle Scholar
Lee, D. K., Crary, K. & Harper, R. (2007, January) Towards a mechanized metatheory of Standard ML. In Thirty-Fourth ACM Symposium on Principles of Programming Languages, pp. 173184.CrossRefGoogle Scholar
Leroy, X. (1994, January). Manifest types, modules and separate compilation. In Twenty-First ACM Symposium on Principles of Programming Languages, pp. 109122.CrossRefGoogle Scholar
Leroy, X. (1995, January) Applicative functors and fully transparent higher-order modules. In Twenty-Second ACM Symposium on Principles of Programming Languages.CrossRefGoogle Scholar
Leroy, X. (1996) A syntactic theory of type generativity and sharing. J. Funct. Program. 6(5), 132.CrossRefGoogle Scholar
Levy, P. B. (1999, April) Call-by-push-value: A subsuming paradigm. In 1999 International Conference on Typed Lambda Calculi and Applications, pp. 228243.CrossRefGoogle Scholar
Licata, D. R., Zeilberger, N. & Harper, R. (2008) Focusing on binding and computation. In Twenty-Third IEEE Symposium on Logic in Computer Science.CrossRefGoogle Scholar
Lillibridge, M. (1997, May). Translucent sums: A foundation for higher-order module systems. Ph.D. thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania.Google Scholar
Milner, R., Tofte, M. & Harper, R. (1990) The Definition of Standard ML. Cambridge, MA: MIT.Google Scholar
Milner, R., Tofte, M., Harper, R. & MacQueen, D. (1997) The Definition of Standard ML (revised). Cambridge, MA: MIT.CrossRefGoogle Scholar
Mitchell, J. C. & Plotkin, G. D. (1988) Abstract types have existential type. ACM Trans. Program. Lang. Syst. 10(3), 470502.Google Scholar
Moggi, E. (1989) Computational lambda-calculus and monads. In Fourth IEEE Symposium on Logic in Computer Science, pp. 1423.CrossRefGoogle Scholar
Plotkin, G. D. (1981) A structural approach to operational semantics. Technical report. DAIMI FN-19. Computer Science Department, Aarhus University.Google Scholar
Reynolds, J. C. (1983) Types, abstraction and parametric polymorphism. In Information Processing 1983, Proceedings of the IFIP 9th World Computer Congress. North-Holland, pp. 513523.Google Scholar
Rossberg, A. (2015) 1ML — core and modules united. In 2015 ACM International Conference on Functional Programming, pp. 3547.Google Scholar
Rossberg, A., Russo, C. & Dreyer, D. (2014) F-ing modules. J. Funct. Program. 24(5), 529607.CrossRefGoogle Scholar
Russo, C. V. (1998, March) Types for modules. Ph.D. thesis, Edinburgh University.Google Scholar
Russo, C. V. (2000) First-class structures for Standard ML. Nord. J. Comput. 7(4), 348374.Google Scholar
Schack-Nielsen, A. (2011, January) Implementing substructural logical frameworks. Ph.D. thesis, IT University of Copenhagen, Copenhagen, Denmark.Google Scholar
Shao, Z. (1999, September). Transparent modules with fully syntactic signatures. In 1999 ACM International Conference on Functional Programming, pp. 220232.CrossRefGoogle Scholar
Simmons, R. J. (2012, November). Substructural logical specifications. Ph.D. thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania.Google Scholar
Simmons, R. J. (2014) Structural focalization. ACM Trans. Comput. Logic, 15(3).CrossRefGoogle Scholar
Stone, C. A. (2000, August). Singleton kinds and singleton types. Ph.D. thesis, Carnegie Mellon University, School of Computer Science, Pittsburgh, Pennsylvania.Google Scholar
Stone, C. A. & Harper, R. (2000, January). Deciding type equivalence in a language with singleton kinds. In Twenty-Seventh ACM Symposium on Principles of Programming Languages. Extended version published as CMU Technical Report CMU-CS-99-155, pp. 214227.Google Scholar
Stone, C. A. & Harper, R. (2006) Extensional equivalence and singleton types. ACM Trans. Computat. Log. 7(4). An earlier version appeared in the 2000 Symposium on Principles of Programming Languages.Google Scholar
Swasey, D., Murphy, T. VII, Crary, K. & Harper, R. (2006) A separate compilation extension to Standard ML. In Workshop on ML.CrossRefGoogle Scholar
VanInwegen, M. (1996, May) The machine-assisted proof of programming language properties. Ph.D. thesis, University of Pennsylvania, Philadelphia, Pennsylvania.Google Scholar
Watkins, K., Cervesato, I., Pfenning, F. & Walker, D. (2002) A concurrent logical framework I: Judgments and properties. Technical report. CMU-CS-02-101. Carnegie Mellon University, School of Computer Science. Revised May 2003.Google Scholar
Watkins, K., Cervesato, I., Pfenning, F. & Walker, D. (2004). A concurrent logical framework: The propositional fragment. In Types for Proofs and Programs, Berardi, S., Coppo, M. & Damiani, F. (eds), Lecture Notes in Computer Science, vol. 3085. Springer, pp. 355377. Papers from the Third International Workshop on Types for Proofs and Programs, April 2003, Torino, Italy.CrossRefGoogle Scholar
Zeilberger, N. (2008) On the unity of duality. Ann. Pure Appl. Log., 153(1–3), 6696.CrossRefGoogle Scholar
Submit a response

Discussions

No Discussions have been published for this article.