Skip to main content

Chasing Bottoms

A Case Study in Program Verification in the Presence of Partial and Infinite Values

  • Conference paper
Mathematics of Program Construction (MPC 2004)

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

Included in the following conference series:

Abstract

This work is a case study in program verification: We have written a simple parser and a corresponding pretty-printer in a non-strict functional programming language with lifted pairs and functions (Haskell). A natural aim is to prove that the programs are, in some sense, each other’s inverses. The presence of partial and infinite values in the domains makes this exercise interesting, and having lifted types adds an extra spice to the task. We have tackled the problem in different ways, and this is a report on the merits of those approaches. More specifically, we first describe a method for testing properties of programs in the presence of partial and infinite values. By testing before proving we avoid wasting time trying to prove statements that are not valid. Then we prove that the programs we have written are in fact (more or less) inverses using first fixpoint induction and then the approximation lemma.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Chakravarty, M., et al.: The Haskell 98 Foreign Function Interface 1.0, An Addendumto the Haskell 98 Report (2003), Available online at http://www.haskell.org/definition/

  2. Claessen, K., Hughes, J.: QuickCheck: A lightweight tool for random testing of Haskell programs. In: Proceedings of the Fifth ACM SIGPLAN International Conference on Functional Programming, pp. 268–279. ACM Press, New York (2000)

    Chapter  Google Scholar 

  3. Faxén, K.-F.: A static semantics for Haskell. Journal of Functional Programming 12(4&5), 295–357 (2002)

    MATH  MathSciNet  Google Scholar 

  4. Gibbons, J., Hutton, G.: Proof methods for corecursive programs. Submitted to Fundamenta Informaticae Special Issue on Program Transformation, Available online at http://www.cs.nott.ac.uk/~gmh/bib.html (March 2004)

  5. Hughes, J.: Why functional programming matters. Computer Journal 32(2), 98–107 (1989)

    Article  Google Scholar 

  6. Hutton, G., Gibbons, J.: The generic approximation lemma. Information Processing Letters 79(4), 197–201 (2001)

    Article  MATH  MathSciNet  Google Scholar 

  7. Jansson, P., Jeuring, J.: Polytypic data conversion programs. Science of Computer Programming 43(1), 35–75 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  8. Johann, P., Voigtländer, J.: Free theorems in the presence of seq. In: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 99–110. ACM Press, New York (2004)

    Chapter  Google Scholar 

  9. Lämmel, R., Jones, S.P.: Scrap your boilerplate: A practical design pattern for generic programming. ACM SIGPLAN Notices 38(3), 26–37 (2003)

    Article  Google Scholar 

  10. Pardo, A.: Monadic corecursion – definition, fusion laws, and applications. In: Jacobs, B., Moss, L., Reichel, H., Rutten, J. (eds.) Electronic Notes in Theoretical Computer Science, vol. 11, Elsevier, Amsterdam (2000)

    Google Scholar 

  11. Jones, S.P.: Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell. In: Engineering Theories of Software Construction. NATO Science Series: Computer & Systems Sciences, vol. 180, pp. 47–96. IOS Press, Amsterdam (2001). Updated version available online at http://research.microsoft.com/~simonpj/

  12. Jones, S.P. (ed.): Haskell 98 Language and Libraries, The Revised Report. Cambridge University Press, Cambridge (2003)

    Google Scholar 

  13. Sands, D.: Total correctness by local improvement in the transformation of functional programs. ACM Transactions on Programming Languages and Systems (TOPLAS) 18(2), 175–234 (1996)

    Article  MathSciNet  Google Scholar 

  14. Schmidt, D.A.: Denotational Semantics: A Methodology for Language Development. W.C. Brown, Dubuque, Iowa (1988)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Danielsson, N.A., Jansson, P. (2004). Chasing Bottoms. In: Kozen, D. (eds) Mathematics of Program Construction. MPC 2004. Lecture Notes in Computer Science, vol 3125. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-27764-4_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-27764-4_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22380-1

  • Online ISBN: 978-3-540-27764-4

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics