A Formalization of Concepts for Generic Programming

Generic programming is a paradigm for systematic design and classification of software components for optimal reuse. It has been the guiding methodology behind the design of the C++ Standard Template Library and numerous other C++ libraries. Generic programming starts with algorithms, seeking to identify the minimal requirements on types necessary for correct and efficient execution of an algorithm or family of algorithms, leading to generic algorithms that can be applied to arguments of many different types. The term concept is used in this context to mean a set of abstractions (such as types) whose membership is determined by a set of requirements. Despite their importance, concepts are not explicitly represented in traditional programming languages. C++, in particular, lacks any means to express concepts, which has forced all concept development to be done outside the language and thus be unavailable to C++ compilers for static checking or optimization. Several other languages do have features than can approximate certain aspects of concepts, but what is missing is a uniform, language-independent definition of concepts. The definition of concepts in this paper provides a unified framework for realizing concept approximations in existing languages, and we present such descriptions for several popular languages used for generic programming.

[1]  David R. Musser,et al.  Tecton: A Framework for Specifying and Verifying Generic System Components , 1992 .

[2]  Ole Lehrmann Madsen,et al.  Virtual classes: a powerful mechanism in object-oriented programming , 1989, OOPSLA '89.

[3]  Deepak Kapur,et al.  An Overview of the Tecton Proof System , 1994, Theor. Comput. Sci..

[4]  Jeremy G. Siek,et al.  The Boost Graph Library - User Guide and Reference Manual , 2001, C++ in-depth series.

[5]  Sibylle Schupp,et al.  Making the Usage of STL Safe , 2002, Generic Programming.

[6]  Matthew Harold Austern,et al.  Generic programming and the STL , 1998 .

[7]  Sibylle Schupp,et al.  The Tecton Concept Library , 1999 .

[8]  James J. Horning,et al.  Report on the Larch Shared Language , 1986, Sci. Comput. Program..

[9]  Fernando Orejas,et al.  GSBL: An Algebraic Specification Language Based on Inheritance , 1988, ECOOP.

[10]  R. Wille Concept lattices and conceptual knowledge systems , 1992 .

[11]  Jeremy G. Siek,et al.  Caramel: A Concept Representation System for Generic Programming , 2001 .

[12]  Mark P. Jones Qualified Types: Theory and Practice , 1994 .

[13]  Carla Limongelli,et al.  Design and Implementation of Symbolic Computation Systems , 1996, Lecture Notes in Computer Science.

[14]  Jeremy G. Siek,et al.  Concept Checking: Binding Parametric Polymorphism in C++ , 2000 .

[15]  Jaakko Järvi,et al.  A comparative study of language support for generic programming , 2003, OOPSLA '03.

[16]  Wolfram Kahl,et al.  Named Instances for Haskell Type Classes , 2001 .

[17]  Ralf Hinze,et al.  Haskell 98 — A Non−strict‚ Purely Functional Language , 1999 .

[18]  Andrew Kennedy,et al.  Design and implementation of generics for the .NET Common language runtime , 2001, PLDI '01.

[19]  .. I,et al.  OPERATORS AND ALGEBRAIC STRUCTURES , 1981 .

[20]  Robin Milner,et al.  Definition of standard ML , 1990 .

[21]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[22]  Radu Grosu,et al.  Towards a New Way of Parameterization , 1994 .

[23]  M. Lillibridge Translucent Sums: A Foundation for Higher-Order Module Systems , 1997 .

[24]  Anne Elisabeth Haxthausen,et al.  CASL - The CoFI Algebraic Specification Language (Tentative Design, version 0.95) - Language Summary, with annotations concerning the semantics of constructs , 1997 .

[25]  Mark P. Jones A system of constructor classes: overloading and implicit higher-order polymorphism , 1993, FPCA '93.

[26]  Ole Lehrmann Madsen,et al.  Virtual classes: a powerful mechanism in object-oriented programming , 1989, OOPSLA 1989.

[27]  Bjarne Stroustrup,et al.  Concepts – Design choices for template argument checking , 2003 .

[28]  Michel Bidoit,et al.  The Stratified Loose Approach: A Generalization of Initial and Loose Semantics , 1988, ADT.

[29]  Jaakko Järvi,et al.  An Analysis of Constrained Polymorphism for Generic Programming , 2003 .

[30]  Jeremy Gibbons Patterns in Datatype−Generic Programming , 2003 .

[31]  Kresten Krab Thorup Genericity in Java with Virtual Types , 1997, ECOOP.

[32]  Robert Harper,et al.  Compiling polymorphism using intensional type analysis , 1995, POPL '95.

[33]  Gerald Baumgartner,et al.  Signatures: A language extension for improving type abstraction and subtype polymorphism in C++ , 1995, Softw. Pract. Exp..

[34]  Bob Francis,et al.  Silicon Graphics Inc. , 1993 .

[35]  Jim Law,et al.  Review of "The boost graph library: user guide and reference manual by Jeremy G. Siek, Lie-Quan Lee, and Andrew Lumsdaine." Addison-Wesley 2002. , 2003, SOEN.

[36]  Alexander A. Stepanov,et al.  C++ Standard Template Library , 2000 .

[37]  Yannis Smaragdakis,et al.  Static interfaces in C , 2000 .

[38]  James H. Davenport,et al.  Scratchpad's View of Algebra I: Basic Commutative Algebra , 1990, DISCO.

[39]  M. Wenzel Using Axiomatic Type Classes in Isabelle , 2000 .

[40]  Donald Sannella,et al.  The Definition of Extended ML: A Gentle Introduction , 1997, Theor. Comput. Sci..

[41]  James H. Davenport,et al.  Scratchpad's view of algebra II: A categorical view of factorization , 1991, ISSAC '91.

[42]  Jeremy G. Siek,et al.  A Modern Framework for Portable High-Performance Numerical Linear Algebra , 2000 .

[43]  Philip S. Santas A Type System for Computer Algebra , 1995, J. Symb. Comput..

[44]  Stephen J. Garland,et al.  Debugging Larch Shared Language Specifications , 1990, IEEE Trans. Software Eng..

[45]  Craig Chambers,et al.  The cecil language: specification and rationale , 1993 .

[46]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[47]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[48]  Alexander A. Stepanov,et al.  Tecton: A Language for Manipulating Generic Objects , 1981, Program Specification.

[49]  Michael J. Vilot,et al.  Standard template library , 1996 .

[50]  Mark P. Jones,et al.  Type Classes with Functional Dependencies , 2000, ESOP.

[51]  Hans-Jörg Kreowski,et al.  Recent Trends in Data Type Specification , 1985, Informatik-Fachberichte.

[52]  Jaakko Järvi,et al.  Concept-Controlled Polymorphism , 2003, GPCE.

[53]  Xavier Leroy,et al.  Manifest types, modules, and separate compilation , 1994, POPL '94.