Skip to main content

Transformations for Generating Type Refinements

  • Conference paper
  • First Online:
  • 330 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12233))

Abstract

We present transformations for incrementally defining both inductive sum/variant types and coinductive product/record types in a formal refinement setting. Inductive types are built by incrementally accumulating constructors. Coinductive types are built by incrementally accumulating observers. In each case, when the developer decides that the constructor (resp. observer) set is complete, a transformation is applied that generates a canonical definition for the type. It also generates definitions for functions that have been characterized in terms of patterns over the constructors (resp. copatterns over the observers). Functions that input a possibly-recursive sum/variant type are defined inductively via patterns on the input data. Dually, functions that output a possibly-recursive record type are defined coinductively via copatterns on the function’s output. The transformations have been implemented in the Specware system [4] and have been used extensively in the automated synthesis of concurrent garbage collection algorithms [9, 12] and families of protocol-processing codes for distributed vehicle control [5].

This work has been sponsored in part by DARPA under agreements FA8750-10-C-0241 and FA8750-12-C-0257.

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 EPUB and 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

References

  1. Abel, A., Pientka, B., Thibodeau, D., and Setzer, A. Copatterns: programming infinite structures by observations. In: Proceedings of the 40th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2013, pp. 27–38 (2013)

    Google Scholar 

  2. Cook, W.R.: Object-oriented programming versus abstract data types. In: de Bakker, J.W., de Roever, W.P., Rozenberg, G. (eds.) REX 1990. LNCS, vol. 489, pp. 151–178. Springer, Heidelberg (1991). https://doi.org/10.1007/BFb0019443

    Chapter  Google Scholar 

  3. Jacobs, B., Rutten, J.: A tutorial on (co)algebras and (co)induction. Bull. EATCS 62, 222–259 (1996)

    MATH  Google Scholar 

  4. Kestrel Institute: Specware System and documentation (2003). http://www.specware.org/

  5. Kreitz, C., Smith, D.R.: Synthesis of network protocols: final report. Technical report, Kestrel Institute (2016). http://www.kestrel.edu/home/people/smith/pub/HACMS-Final-Report.pdf

  6. Leroy, X., Blazy, S.: Formal verification of a C-like memory model and its uses for verifying program transformations. J. Autom. Reason. 41(1), 1–31 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  7. Liu, Y.: Systematic Program Design: From Clarity to Efficiency. Cambridge University Press, Cambridge (2013)

    Book  Google Scholar 

  8. Paige, R., Koenig, S.: Finite differencing of computable expressions. ACM Trans. Program. Lang. Syst. 4(3), 402–454 (1982)

    Article  MATH  Google Scholar 

  9. Pavlovic, D., Pepper, P., Smith, D.R.: Formal derivation of concurrent garbage collectors. In: Bolduc, C., Desharnais, J., Ktari, B. (eds.) MPC 2010. LNCS, vol. 6120, pp. 353–376. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-13321-3_20. Extended version in http://arxiv.org/abs/1006.4342

  10. Smith, D.R.: Another proof of the modularization theorem. Technical report, Kestrel Institute, February 1993. http://www.kestrel.edu/home/people/smith/pub/modularization.pdf

  11. Smith, D.R.: Generating programs plus proofs by refinement. In: Meyer, B., Woodcock, J. (eds.) VSTTE 2005. LNCS, vol. 4171, pp. 182–188. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-69149-5_20

    Chapter  Google Scholar 

  12. Smith, D.R., Westbrook, E., Westfold, S.J.: Deriving concurrent garbage collectors: final report. Technical report, Kestrel Institute (2015). http://www.kestrel.edu/home/people/smith/pub/CRASH-Final-Report.pdf

  13. Srinivas, Y.V., Jüllig, R.: Specware: formal support for composing software. In: Möller, B. (ed.) MPC 1995. LNCS, vol. 947, pp. 399–422. Springer, Heidelberg (1995). https://doi.org/10.1007/3-540-60117-1_22

    Chapter  Google Scholar 

  14. Tuch, H.: Formal verification of C systems code: structured types, separation logic and theorem proving. J. Autom. Reason. 42(2), 125–187 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  15. Veloso, P.A., Maibaum, T.: On the modularization theorem for logical specification. Inf. Process. Lett. 53(5), 287–293 (1995)

    Article  MATH  Google Scholar 

  16. Wadler, P.: The expression problem. Technical report, Bell Labs, Murray Hill, NJ (1998). http://homepages.inf.ed.ac.uk/wadler/papers/expression/expression.txt

Download references

Acknowledgements

Thanks to Christoph Kreitz, Peter Pepper, Florian Rabe, and the reviewers for helpful discussions and comments on the text.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Douglas R. Smith .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Smith, D.R., Westfold, S.J. (2020). Transformations for Generating Type Refinements. In: Sekerinski, E., et al. Formal Methods. FM 2019 International Workshops. FM 2019. Lecture Notes in Computer Science(), vol 12233. Springer, Cham. https://doi.org/10.1007/978-3-030-54997-8_24

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-54997-8_24

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-54996-1

  • Online ISBN: 978-3-030-54997-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics