Abstract
Type rules associate types to expressions given a typing context. As the type checker traverses the expression tree top-down, it extends the typing context with additional context information that becomes available. This way, the typing context coordinates type checking in otherwise independent subexpressions, which inhibits parallelization and incrementalization of type checking. We propose a co-contextual formulation of type rules that only take an expression as input and produce a type and a set of context requirements. Co-contextual type checkers traverse an expression tree bottom-up and merge context requirements of independently checked subexpressions. We describe a method for systematically constructing a co-contextual formulation of type rules from a regular context-based formulation and we show how co-contextual type rules give rise to incremental type checking. Using our method, we derive incremental type checkers for PCF and for extensions that introduce records, parametric polymorphism, and subtyping. Our performance evaluation shows that co-contextual type checking has performance comparable to standard context-based type checking, and incrementalization can improve performance significantly.
- U. A. Acar, G. E. Blelloch, M. Blume, R. Harper, and K. Tangwongsan. An experimental analysis of self-adjusting computation. Transactions on Programming Languages and Systems (TOPLAS), 32(1), 2009. Google Scholar
Digital Library
- S. Aditya and R. S. Nikhil. Incremental polymorphism. In Proceedings of Conference on Functional Programming Languages and Computer Architecture (FPCA), pages 379– 405. ACM, 1991. Google Scholar
Digital Library
- D. Ancona, F. Damiani, S. Drossopoulou, and E. Zucca. Polymorphic bytecode: Compositional compilation for Java-like languages. In Proceedings of Symposium on Principles of Programming Languages (POPL), pages 26–37. ACM, 2005. Google Scholar
Digital Library
- I. Attali, J. Chazarain, and S. Gilette. Incremental evaluation of natural semantics specifications. Logical Foundations of Computer Science, pages 87–104, 1992.Google Scholar
Cross Ref
- R. Bahlke and G. Snelting. The PSG system: From formal language definitions to interactive programming environments. Transactions on Programming Languages and Systems (TOPLAS), 8(4):547–576, 1986. Google Scholar
Digital Library
- L. A. Chamberland, S. F. Lymer, and A. G. Ryman. IBM VisualAge for Java. IBM Systems Journal, 37(3):386–408, 1998. Google Scholar
Digital Library
- O. Chitil. Compositional explanation of types and algorithmic debugging of type errors. In Proceedings of International Conference on Functional Programming (ICFP), pages 193– 204. ACM, 2001. Google Scholar
Digital Library
- A. J. Demers, T. W. Reps, and T. Teitelbaum. Incremental evaluation for attribute grammars with application to syntaxdirected editors. In Proceedings of Symposium on Principles of Programming Languages (POPL), pages 105–116. ACM, 1981. Google Scholar
Digital Library
- T. Despeyroux. Executable specification of static semantics. In Semantics of Data Types, volume 173 of LNCS. Springer, 1984.Google Scholar
Cross Ref
- M. A. Hammer, Y. P. Khoo, M. Hicks, and J. S. Foster. Adapton: composable, demand-driven incremental computation. In Proceedings of Conference on Programming Language Design and Implementation (PLDI), pages 156–166. ACM, 2014. Google Scholar
Digital Library
- T. Jim. What are principal typings and what are they good for? In Proceedings of Symposium on Principles of Programming Languages (POPL), pages 42–53. ACM, 1996. Google Scholar
Digital Library
- G. F. Johnson and J. A. Walz. A maximum-flow approach to anomaly isolation in unification-based incremental type inference. In Proceedings of Symposium on Principles of Programming Languages (POPL), pages 44–57. ACM, 1986. Google Scholar
Digital Library
- G. Kahn. Natural semantics. In Proceedings of Symposium on Theoretical Aspects of Computer Science (STACS), pages 22–39. Springer, 1987. Google Scholar
Digital Library
- A. Kuhn, G. C. Murphy, and C. A. Thompson. An exploratory study of forces and frictions affecting large-scale model-driven development. In Proceedings of Conference on Model Driven Engineering Languages and Systems (MoDELS), volume 7590 of LNCS, pages 352–367. Springer, 2012. Google Scholar
Digital Library
- L. G. L. T. Meertens. Incremental polymorphic type checking in B. In Proceedings of Symposium on Principles of Programming Languages (POPL), pages 265–275. ACM, 1983. Google Scholar
Digital Library
- W. Miao and J. G. Siek. Incremental type-checking for type-reflective metaprograms. In Proceedings of Conference on Generative Programming and Component Engineering (GPCE), pages 167–176. ACM, 2010. Google Scholar
Digital Library
- R. Milner. A theory of type polymorphism in programming. Computer and System Sciences, 17(3):348–375, 1978.Google Scholar
Cross Ref
- R. Mitschke, S. Erdweg, M. Köhler, M. Mezini, and G. Salvaneschi. i3QL: Language-integrated live data views. In Proceedings of Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA), pages 417– 432. ACM, 2014. Google Scholar
Digital Library
- B. C. Pierce. Types and programming languages. MIT press, 2002. Google Scholar
Digital Library
- B. C. Pierce and D. N. Turner. Local type inference. Transactions on Programming Languages and Systems (TOPLAS), 22(1):1–44, 2000. Google Scholar
Digital Library
- F. Pottier. Simplifying subtyping constraints: A theory. Information and Computation, 170(2):153–183, 2001. Google Scholar
Digital Library
- G. Snelting. The calculus of context relations. Acta Informatica, 28(5):411–445, 1991. Google Scholar
Digital Library
- G. Snelting and W. Henhapl. Unification in many-sorted algebras as a device for incremental semantic analysis. In Proceedings of Symposium on Principles of Programming Languages (POPL), pages 229–235. ACM, 1986. Google Scholar
Digital Library
- G. Wachsmuth, G. D. P. Konat, V. A. Vergu, D. M. Groenewegen, and E. Visser. A language independent task engine for incremental name and type analysis. In Proceedings of Conference on Software Language Engineering (SLE), volume 8225 of LNCS, pages 260–280, 2013.Google Scholar
Cross Ref
- J. B. Wells. The essence of principal typings. In Proceedings of International Colloquium on Automata, Languages and Programming (ICALP), volume 2380 of LNCS, pages 913– 925. Springer, 2002. Google Scholar
Digital Library
Index Terms
A co-contextual formulation of type rules and its application to incremental type checking
Recommendations
A co-contextual formulation of type rules and its application to incremental type checking
OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsType rules associate types to expressions given a typing context. As the type checker traverses the expression tree top-down, it extends the typing context with additional context information that becomes available. This way, the typing context ...
Type checking and inference for polymorphic and existential types
CATS '09: Proceedings of the Fifteenth Australasian Symposium on Computing: The Australasian Theory - Volume 94This paper proves undecidability of type checking and type inference problems in some variants of typed lambda calculi with polymorphic and existential types. First, type inference in the domain-free polymorphic lambda calculus is proved to be ...
Toward incremental type checking for Java
SPLASH Companion 2015: Companion Proceedings of the 2015 ACM SIGPLAN International Conference on Systems, Programming, Languages and Applications: Software for HumanityA type system is a set of type rules and with respect to these type rules a type checker has an important role to ensure that programs exhibit a desired behavior. We consider Java type rules and extend the co-contextual formulation of type rules ...






Comments