Hostname: page-component-76fb5796d-5g6vh Total loading time: 0 Render date: 2024-04-25T14:59:00.623Z Has data issue: false hasContentIssue false

Functional Pearl

Back to basics: Deriving representation changers functionally

Published online by Cambridge University Press:  07 November 2008

Erik Meijer
Affiliation:
Department of Computer Science, University of Utrecht, PO Box 80.089, 3508 TB Utrecht, The Netherlands
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.

A representation changer is a function that converts a concrete representation of an abstract value into a different concrete representation of that value. Many useful functions can be recognised as representation changers; examples include compilers and arithmetic functions such as addition and multiplication. Functions that can be specified as the right inverse of other functions are special cases of representation changers. In recent years, a number of authors have used a relational calculus to derive representation changers from their specifications. In this paper, we show that the generality of relations is not essential, and representation changers can be derived within the more basic setting of functional programming. We illustrate our point by deriving a carry-save adder and a base-converter, two functions which have previously been derived relationally.

Type
Articles
Copyright
Copyright © Cambridge University Press 1996

References

Davio, M., Deschamps, J.-P. and Thayse, A. (1983) Digital Systems, with Algorithm Implementation. Wiley.Google Scholar
Hutton, G. (1992) Between Functions and Relations in Calculating Programs. PhD thesis, University of Glasgow. (Available as Research Report FP-93-5.)Google Scholar
Jones, G. and Sheeran, M. (1990) Circuit design in Ruby. In Staunstrup, , editor, Formal Methods for VLSI Design. Elsevier.Google Scholar
Jones, G. and Sheeran, M. (1991) Relations and refinement in circuit design. In Morgan, , editor, Proc. BCS FACS Workshop on Refinement: Workshops in Computing. Springer-Verlag.Google Scholar
Jones, G. and Sheeran, M. (1992) Designing arithmetic circuits by refinement in Ruby. In Proc. 2nd Int. Conf. on Mathematics of Program Construction: Lecture Notes in Computer Science. Springer-Verlag.Google Scholar
Ross, K. A. and Wright, C. R. B. (1992) Discrete Mathematics. Prentice-Hall.Google Scholar
Runciman, C. and Jagger, N. (1990) Relative specification and transformational re-use of functional programs. lLisp and Symbolic Computation, 3: 2137.CrossRefGoogle Scholar
Sheeran, M. (1986) Describing and reasoning about circuits using relations. In Tucker, et al. , editors, Proc. Workshop in Theoretical Aspects of VLSI. Leeds, UK.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.