Skip to main content

Observable Sharing for Functional Circuit Description

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1742))

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

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Z. Ariola, M. Felleisen, J. Maraist, M. Odersky, and P. Wadler. A call-byneed lambda calculus. In Proc. POPL’95, ACM Press, 1995.

    Google Scholar 

  2. 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.

    Google Scholar 

  3. P. Bjesse, K. Claessen, M. Sheeran, and S. Singh. Lava: Hardware design in Haskell. In ICFP’98. ACM Press, 1998.

    Google Scholar 

  4. B. Cook, J. Launchbury, and J. Matthews. Specifying superscalar microprocessors in Hawk. In Formal Techniques for Hardware and Hardware-like Systems. Marstrand, Sweden, 1998.

    Google Scholar 

  5. Matthias Felleisen and Robert Hieb. The revised report on the syntactic theories of sequential control and state. TCS, 103:235–271, 1992.

    Article  MATH  MathSciNet  Google Scholar 

  6. Paul Hudak. Building domain-specific embedded languages. ACM Computing Surveys, 28(4):196, December 1996.

    Article  Google Scholar 

  7. J. Launchbury. A natural semantics for lazy evaluation. In Proc. POPL’93, pages 144–154. ACM Press, 1993.

    Google Scholar 

  8. R. Milner. Fully abstract models of the typed λcalculus. TCS 4:1–22, 1977.

    Article  MATH  MathSciNet  Google Scholar 

  9. Andrew Moran and David Sands. Improvement in a lazy context: An operational theory for call-by-need. In Proc. POPL’99, ACM Press, 1999.

    Google Scholar 

  10. I. Mason and C. Talcott. Equivalence in functional languages with effects. Journal of Functional Programming, 1(3):287–327, July 1991.

    Article  MATH  MathSciNet  Google Scholar 

  11. 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.

    Google Scholar 

  12. 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.

    Google Scholar 

  13. Martin Odersky. A functional theory of local names. In POPL’94, pages 48–59, ACM Press, 1994.

    Google Scholar 

  14. 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.

    Google Scholar 

  15. 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.

    Google Scholar 

  16. S. Peyton Jones and A. Santos. A transformation-based optimiser for Haskell. Science of Computer Programming, 32(1-3):3–47, 1998.

    Article  MATH  Google Scholar 

  17. 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.

    Google Scholar 

  18. P. Sestoft. Deriving a lazy abstract machine. Journal of Functional Pro-gramming, 7(3:231–264, May 1997.

    Article  MATH  MathSciNet  Google Scholar 

  19. M. Sheeran. Designing regular array architectures using higher order functions. In FPCS’95, LNCS vol 201, Springer Verlag, 1985.

    Google Scholar 

  20. 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.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics