Skip to main content

Bringing Effortless Refinement of Data Layouts to Cogent

  • Conference paper
  • First Online:
Book cover Leveraging Applications of Formal Methods, Verification and Validation. Modeling (ISoLA 2018)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 11244))

Included in the following conference series:

Abstract

The language Cogent allows low-level operating system components to be modelled as pure mathematical functions operating on algebraic data types, which makes it highly suitable for verification in an interactive theorem prover. Furthermore, the Cogent compiler translates these models into imperative C programs, and provides a proof that this compilation is a refinement of the functional model. There remains a gap, however, between the C data structures used in the operating system, and the algebraic data types used by Cogent. This forces the programmer to write a large amount of boilerplate marshalling code to connect the two, which can lead to a significant runtime performance overhead due to excessive copying.

In this paper, we outline our design for a data description language and data refinement framework, called Dargent, which provides the programmer with a means to specify how Cogent represents its algebraic data types. From this specification, the compiler can then generate the C code which manipulates the C data structures directly. Once fully realised, this extension will enable more code to be automatically verified by Cogent, smoother interoperability with C, and substantially improved performance of the generated code.

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

Access this chapter

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

Institutional subscriptions

Notes

  1. 1.

    The seL4 microkernel: https://sel4.systems (accessed on August 31, 2018).

  2. 2.

    The Rust programming language: https://www.rust-lang.org (accessed on August 31, 2018).

References

  1. Amani, S., et al.: Cogent: verifying high-assurance file system implementations. In: International Conference on Architectural Support for Programming Languages and Operating Systems, Atlanta, GA, USA, pp. 175–188, April 2016

    Google Scholar 

  2. Back, G.: DataScript- a specification and scripting language for binary data. In: Batory, D., Consel, C., Taha, W. (eds.) GPCE 2002. LNCS, vol. 2487, pp. 66–77. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45821-2_4

    Chapter  MATH  Google Scholar 

  3. Bangert, J., Zeldovich, N.: Nail: a practical tool for parsing and generating data formats. In: Proceedings of the 11th USENIX Symposium on Operating Systems Design and Implementation, pp. 615–628. USENIX Association, Broomfield (2014). https://www.usenix.org/conference/osdi14/technical-sessions/ presentation/bangert

  4. Chen, Z.: Cogent\(^{\Uparrow }\): giving systems engineers a stepping stone (extended abstract). In: The 2017 ACM SIGPLAN Workshop on Type-driven Development (ICFP TyDe 2017) (2017). https://www.cse.unsw.edu.au/~zilinc/tyde17.pdf

  5. Cock, D.: Bitfields and tagged unions in C – verification through automatic generation. In: Proceedings of the 5th International Verification Workshop, Sydney, pp. 44–55, August 2008

    Google Scholar 

  6. Fisher, K., Gruber, R.: PADS: a domain-specific language for processing ad hoc data. In: Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 295–304. ACM, New York (2005). http://doi.acm.org/10.1145/1065010.1065046

  7. Fisher, K., Mandelbaum, Y., Walker, D.: The next 700 data description languages. J. ACM 57(2), 10:1–10:51. http://doi.acm.org/10.1145/1667053.1667059

  8. Fisher, K., Walker, D.: The PADS project: an overview. In: Proceedings of the 14th International Conference on Database Theory, pp. 11–17. ACM, New York (2011). http://doi.acm.org/10.1145/1938551.1938556

  9. Keller, G., et al.: File systems deserve verification too! In: Workshop on Programming Languages and Operating Systems (PLOS), Farmington, Pennsylvania, USA, pp. 1–7, November 2013

    Google Scholar 

  10. Klein, G., et al.: seL4: formal verification of an OS kernel. In: ACM Symposium on Operating Systems Principles, pp. 207–220. ACM, Big Sky, October 2009

    Google Scholar 

  11. Klein, G., Sewell, T., Winwood, S.: Refinement in the formal verification of the seL4 microkernel. In: Hardin, D. (ed.) Design and Verification of Microprocessor Systems for High-Assurance Applications, pp. 323–339. Springer, Boston (2010). https://doi.org/10.1007/978-1-4419-1539-9_11

  12. McCann, P.J., Chandra, S.: PacketTypes: abstract specification of network protocol messages. In: Proceedings of the ACM Conference on Communications, pp. 321–333. ACM, New York (2000). http://doi.acm.org/10.1145/347059.347563

  13. O’Connor, L., et al.: Refinement through restraint: bringing down the cost of verification. In: International Conference on Functional Programming, Nara, Japan, September 2016

    Google Scholar 

  14. Rizkallah, C., et al.: A framework for the automatic formal verification of refinement from Cogent to C. In: Blanchette, J.C., Merz, S. (eds.) ITP 2016. LNCS, vol. 9807, pp. 323–340. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-43144-4_20

    Chapter  Google Scholar 

  15. de Roever, W.P., Engelhardt, K.: Data Refinement: Model-Oriented Proof Methods and their Comparison. No. 47 in Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, Cambridge (1998)

    Google Scholar 

  16. Schirmer, N.: Verification of sequential imperative programs in Isabelle/HOL. Ph.D. thesis, Technische Universität München (2006)

    Google Scholar 

  17. Tuch, H.: Formal memory models for verifying C systems code. Ph.D. thesis, UNSW, Sydney, Australia, August 2008

    Google Scholar 

  18. Tuch, H., Klein, G., Norrish, M.: Types, bytes, and separation logic. In: ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Nice, France, pp. 97–108. ACM, January 2007

    Google Scholar 

  19. Wang, Y., Gaspes, V.: An embedded language for programming protocol stacks in embedded systems. In: Proceedings of the 20th ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, pp. 63–72. ACM, New York (2011). http://doi.acm.org/10.1145/1929501.1929511

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Liam O’Connor .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

O’Connor, L., Chen, Z., Susarla, P., Rizkallah, C., Klein, G., Keller, G. (2018). Bringing Effortless Refinement of Data Layouts to Cogent. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. Modeling. ISoLA 2018. Lecture Notes in Computer Science(), vol 11244. Springer, Cham. https://doi.org/10.1007/978-3-030-03418-4_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-03418-4_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-03417-7

  • Online ISBN: 978-3-030-03418-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics