Abtract
Pure functional programming languages have been proposed as a vehicle to describe, simulate and manipulate circuit specifications. We propose an extension to Haskell to solve a standard problem when manipulating data types representing circuits in a lazy functional language. The problem is that circuits are finite graphs but viewing them as an algebraic (lazy) datatype makes them indistinguishable from potentially infinite regular trees. However, implementations of Haskell do indeed represent cyclic structures by graphs. The problem is that the sharing of nodes that creates such cycles is not observable by any function which traverses such a structure. In this paper we propose an extension to call-by-need languages which makes graph sharing observable. The extension is based on non updatable reference cells and an equality test (sharing detection) on this type. We show that this simple and practical extension has well-behaved semantic properties, which means that many typical source-to-source program transformations, such as might be performed by a compiler, are still valid in the presence of this extension.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Z. Ariola, M. Felleisen, J. Maraist, M. Odersky, and P. Wadler. A call-byneed lambda calculus. In Proc. POPL’95, ACM Press, 1995.
Z. M. Ariola and A. Sabry. Correctness of monadic state: An imperative call-by-need calculus. In Proc. POPL’98, pages 62–74. ACM Press, 1998.
P. Bjesse, K. Claessen, M. Sheeran, and S. Singh. Lava: Hardware design in Haskell. In ICFP’98. ACM Press, 1998.
B. Cook, J. Launchbury, and J. Matthews. Specifying superscalar microprocessors in Hawk. In Formal Techniques for Hardware and Hardware-like Systems. Marstrand, Sweden, 1998.
Matthias Felleisen and Robert Hieb. The revised report on the syntactic theories of sequential control and state. TCS, 103:235–271, 1992.
Paul Hudak. Building domain-specific embedded languages. ACM Computing Surveys, 28(4):196, December 1996.
J. Launchbury. A natural semantics for lazy evaluation. In Proc. POPL’93, pages 144–154. ACM Press, 1993.
R. Milner. Fully abstract models of the typed λcalculus. TCS 4:1–22, 1977.
Andrew Moran and David Sands. Improvement in a lazy context: An operational theory for call-by-need. In Proc. POPL’99, ACM Press, 1999.
I. Mason and C. Talcott. Equivalence in functional languages with effects. Journal of Functional Programming, 1(3):287–327, July 1991.
J. O’Donnell. Generating netlists from executable circuit specifications in a pure functional language. In Functional Programming Glasgow, Springer-Verlag Workshops in Computing, pages 178–194, 1993.
J. O’ Donnell. From transistors to computer architecture: Teaching functional circuit specification in Hydra. In Functional Programming Languagues in Education, LNCS vol 1125, pages 221–234. Springer Verlag, 1996.
Martin Odersky. A functional theory of local names. In POPL’94, pages 48–59, ACM Press, 1994.
A. M. Pitts. Reasoning about local variables with operationally-based logical relations. In 11th Annual Symposium on Logic in Computer Science, pages 152–163. IEEE Computer Society Press, 1996.
S. Peyton Jones, W. Partain, and A. Santos. Let-floating: moving bindings to give faster programs. In Proc. ICFP’96, pages 1–12. ACM Press, 1996.
S. Peyton Jones and A. Santos. A transformation-based optimiser for Haskell. Science of Computer Programming, 32(1-3):3–47, 1998.
A. M. Pitts and I. D. B. Stark. Observable properties of higher order functions that create local names, or: What’s new? In MFCS’93, LNCS vol 711, pages 122–141, Springer-Verlag, 1993.
P. Sestoft. Deriving a lazy abstract machine. Journal of Functional Pro-gramming, 7(3:231–264, May 1997.
M. Sheeran. Designing regular array architectures using higher order functions. In FPCS’95, LNCS vol 201, Springer Verlag, 1985.
P. Wadler. Monads for Functional Programming. In Lecture notes for Marktoberdorf Summer School on Program Design Calculi, NATO ASI Series F: Computer and systems sciences. Springer Verlag, August 1992.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1999 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Claessen, K., Sands, D. (1999). Observable Sharing for Functional Circuit Description. In: Thiagarajan, P.S., Yap, R. (eds) Advances in Computing Science — ASIAN’99. ASIAN 1999. Lecture Notes in Computer Science, vol 1742. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46674-6_7
Download citation
DOI: https://doi.org/10.1007/3-540-46674-6_7
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66856-5
Online ISBN: 978-3-540-46674-1
eBook Packages: Springer Book Archive