Interfacing Concepts: Why Declaration Style Shouldn’t Matter

Anya Helene Bagge and Magne Haveraaen

Citation:

Anya Helene Bagge and Magne Haveraaen. Interfacing Concepts: Why Declaration Style Shouldn’t Matter. In Torbjörn Ekman and Jurgen J. Vinju, editor(s), Proceedings of the Ninth Workshop on Language Descriptions, Tools and Applications (LDTA '09), volume 253 of Electronic Notes in Theoretical Computer Science, pages 37–50. Elsevier, 2010.

Workshop:

Ninth Workshop on Language Descriptions, Tools and Applications (LDTA '09), York, UK, 2009, proceedings pp.37–50

Journal:

Electronic Notes in Theoretical Computer Science 253(7):37–50, 2010

Paper Links:

[doi] [pdf]

Abstract:

A concept (or signature) describes the interface of a set of abstract types by listing the operations that should be supported for those types. When implementing a generic operation, such as sorting, we may then specify requirements such as “elements must be comparable” by requiring that the element type models the Comparable concept. We may also use axioms to describe behaviour that should be common to all models of a concept. However, the operations specified by the concept are not always the ones that are best suited for the implementation. For example, numbers and matrices may both be addable, but adding two numbers is conveniently done by using a return value, whereas adding a sparse and a dense matrix is probably best achieved by modifying the dense matrix. In both cases, though, we may want to pretend we're using a simple function with a return value, as this most closely matches the notation we know from mathematics. This paper presents two simple concepts to break the notational tie between implementation and use of an operation: functionalisation, which derives a set of canonical pure functions from a procedure; and mutification, which translates calls using the functionalised declarations into calls to the implemented procedure.

Related Project:

PhD

BibTeX:

@InProceedings{bagge-haveraaen-ldta09-interfacing,
  title = {Interfacing Concepts: Why Declaration Style Shouldn't Matter},
  author = {Anya Helene Bagge and Magne Haveraaen},
  year = {2010},
  booktitle = {Proceedings of the Ninth Workshop on Language Descriptions, Tools and Applications (LDTA '09)},
  editor = {Torbj{\"o}rn Ekman and Jurgen J. Vinju},
  journal = {Electronic Notes in Theoretical Computer Science},
  volume = {253},
  issue = {7},
  pages = {37--50},
  publisher = {Elsevier},
  doi = {10.1016/j.entcs.2010.08.030},
  issn = {1571-0661},
  location = {York, UK},
  url = {http://www.ii.uib.no/~anya/papers/bagge-haveraaen-ldta09-interfacing.html},
  pdf = {http://www.ii.uib.no/~anya/papers/bagge-haveraaen-ldta09-interfacing.pdf},
}

Copyright:

Copyright © 2010 Elsevier. This is the author’s version of a work that was accepted for publication in Electronic Notes in Theoretical Computer Science. Changes resulting from the publishing process, such as peer review, editing, corrections, structural formatting, and other quality control mechanisms may not be reflected in this document. Changes may have been made to this work since it was submitted for publication. The definitive version can be downloaded from Elsevier.