Abstract
Conditional compilation and software product line technologies make it possible to generate a huge number of different programs from a single software project. Typing each of these programs individually is usually impossible due to the sheer number of possible variants. Our previous work has addressed this problem with a type system for variational lambda calculus (VLC), an extension of lambda calculus with basic constructs for introducing and organizing variation. Although our type inference algorithm is more efficient than the brute-force strategy of inferring the types of each variant individually, it is less robust since type inference will fail for the entire variational expression if any one variant contains a type error. In this work, we extend our type system to operate on VLC expressions containing type errors. This extension directly supports locating ill-typed variants and the incremental development of variational programs. It also has many subtle implications for the unification of variational types. We show that our extended type system possesses a principal typing property and that the underlying unification problem is unitary. Our unification algorithm computes partial unifiers that lead to result types that (1) contain errors in as few variants as possible and (2) are most general. Finally, we perform an empirical evaluation to determine the overhead of this extension compared to our previous work, to demonstrate the improvements over the brute-force approach, and to explore the effects of various error distributions on the inference process.
- S. Anantharaman, P. Narendran, and M. Rusinowitch. Unification Modulo ACUI Plus Homomorphisms/Distributivity. Journal of Automated Reasoning, 33:1--28, 2004. Google Scholar
Digital Library
- S. Apel and C. Kästner. An Overview of Feature-Oriented Software Development. Journal of Object Technology, 8(5):49--84, 2009.Google Scholar
Cross Ref
- F. Baader and W. Snyder. Unification Theory. In A. Robinson and A. Voronkov, editors, Handbook of Automated Reasoning, chapter 8, pages 445--533. Elsevier Science Publishers, Amsterdam, NL, 2001.Google Scholar
Cross Ref
- D. Batory, J. N. Sarvela, and A. Rauschmayer. Scaling Step-Wise Refinement. IEEE Trans. on Software Engineering, 30(6):355--371, 2004. Google Scholar
Digital Library
- S. Chen, M. Erwig, and E. Walkingshaw. Extending Type Inference to Variational Programs. Technical Report, School of EECS, Oregon State University, 2012. Available at: http://eecs.oregonstate.edu/~erwig/ToSC/VLC-TypeSystem.pdf.Google Scholar
- L. Damas and R. Milner. Principal Type Schemes for Functional Programming Languages. In 9th ACM Symp. on Principles of Programming Languages, pages 207--208, 1982. Google Scholar
Digital Library
- M. Dezani-Ciancaglini, S. Ghilezan, and B. Venneri. The "Relevance" of Intersection and Union Types. Notre Dame Journal of Formal Logic, 38(2):246--269, 1997.Google Scholar
Cross Ref
- M. Erwig and E. Walkingshaw. The Choice Calculus: A Representation for Software Variation. ACM Trans. on Software Engineering and Methodology, 21(1):6:1--6:27, 2011. Google Scholar
Digital Library
- GHC. The Glasgow Haskell Compiler. http://haskell.org/ghc.Google Scholar
- K. Kagawa. Polymorphic Variants in Haskell. In ACM SIGPLAN Workshop on Haskell, pages 37--47. ACM, 2006. Google Scholar
Digital Library
- C. Kästner, S. Apel, T. Thüm, and G. Saake. Type Checking Annotation-Based Product Lines. ACM Trans. on Software Engineering and Methodology, 2012. To appear. Google Scholar
Digital Library
- A. Kenner, C. Kästner, S. Haase, and T. Leich. TypeChef: Toward Type Checking #ifdef Variability in C. In Int. Workshop on Feature-Oriented Software Development, pages 25--32, 2010. Google Scholar
Digital Library
- C. H. P. Kim, C. Kästner, and D. Batory. On the Modularity of Feature Interactions. In Int. Conf. on Generative Programming and Component Engineering, pages 19--23, 2008. Google Scholar
Digital Library
- D. Kozen, J. Palsberg, and M. I. Schwartzbach. Efficient Inference of Partial Types. In Journal of Computer and System Sciences, pages 363--371, 1992. Google Scholar
Digital Library
- B. S. Lerner, M. Flower, D. Grossman, and C. Chambers. Searching for Type-Error Messages. In ACM Conf. on Programming Language Design and Implementation, pages 425--434, 2007. Google Scholar
Digital Library
- M. Mezini and K. Ostermann. Variability Management with Feature-Oriented Programming and Aspects. ACM SIGSOFT Software Engineering Notes, 29(6):127--136, 2004. Google Scholar
Digital Library
- P. M. O'Keefe and M. Wand. Type Inference for Partial Types is Decidable. In European Symp. on Programming, pages 408--417, 1992. Google Scholar
Digital Library
- B. C. Pierce. Bounded Quantification with Bottom. Technical report, Computer Science Department, Indiana University, 1997.Google Scholar
- B. C. Pierce. Types and Programming Languages. MIT Press, Cambridge, MA, 2002. Google Scholar
Digital Library
- K. Pohl, G. Böckle, and F. van der Linden. Software Product Line Engineering: Foundations, Principles, and Techniques. Springer-Verlang, Berlin Heidelberg, 2005. Google Scholar
Cross Ref
- J. A. Robinson. A Machine-Oriented Logic Based on the Resolution Principle. Journal of the ACM, 12(1):23--41, 1965. Google Scholar
Digital Library
- J. G. Siek and W. Taha. Gradual Typing for Functional Languages. In Scheme and Functional Programming Workshop, pages 81--92, 2006.Google Scholar
- J. G. Siek and M. Vachharajani. Gradual Typing with Unification-Based Inference. In Symp. on Dynamic Languages, pages 7:1--7:12, 2008. Google Scholar
Digital Library
- W. Taha and T. Sheard. MetaML and Multi-Stage Programming with Explicit Annotations. Theoretical Computer Science, 248(1-2):211--242, 2000. Google Scholar
Digital Library
- S. Thaker, D. Batory, D. Kitchin, and W. Cook. Safe Composition of Product Lines. In Int. Conf. on Generative Programming and Component Engineering, pages 95--104, 2007. Google Scholar
Digital Library
- S. Thatte. Type Inference with Partial Types. In Int. Colloq. on Automata, Languages and Programming, pages 615--629, 1988. Google Scholar
Digital Library
- E. Tiden and S. Arnborg. Unification Problems with One-Sided Distributivity. Journal of Symbolic Computation, 3(1-2):183--202, 1987. Google Scholar
Digital Library
- M. Wand. Finding the Source of Type Errors. In ACM Symp. on Principles of Programming Languages, pages 38--43, 1986. Google Scholar
Digital Library
Index Terms
An error-tolerant type system for variational lambda calculus
Recommendations
An error-tolerant type system for variational lambda calculus
ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programmingConditional compilation and software product line technologies make it possible to generate a huge number of different programs from a single software project. Typing each of these programs individually is usually impossible due to the sheer number of ...
Taming type annotations in gradual typing
Gradual typing provides a methodology to integrate static and dynamic typing, harmonizing their often conflicting advantages in a single language. When a user wants to enjoy the advantages of static typing, most gradual languages require that they add ...
Extending Type Inference to Variational Programs
Through the use of conditional compilation and related tools, many software projects can be used to generate a huge number of related programs. The problem of typing such variational software is difficult. The brute-force strategy of generating all ...







Comments