skip to main content
research-article

Experience report: a do-it-yourself high-assurance compiler

Published:09 September 2012Publication History
Skip Abstract Section

Abstract

Embedded domain-specific languages (EDSLs) are an approach for quickly building new languages while maintaining the advantages of a rich metalanguage. We argue in this experience report that the "EDSL approach" can surprisingly ease the task of building a high-assurance compiler. We do not strive to build a fully formally-verified tool-chain, but take a "do-it-yourself" approach to increase our confidence in compiler-correctness without too much effort. Copilot is an EDSL developed by Galois, Inc. and the National Institute of Aerospace under contract to NASA for the purpose of runtime monitoring of flight-critical avionics. We report our experience in using type-checking, QuickCheck, and model-checking "off-the-shelf" to quickly increase confidence in our EDSL tool-chain.

References

  1. E. Axelsson, K. Claessen, M. Sheeran, J. Svenningsson, D. Engdal, and A. Persson. The design and implementation of Feldspar - an embedded language for digital signal processing. In Implementation and Application of Functional Languages, volume 6647 of LNCS, pages 121--136. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. A. I. Baars and S. D. Swierstra. Typing dynamic typing. In Intl. Conference on Functional Programming (ICFP), pages 157--166. ACM, September 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. S. Boyer and J. S. Moore. MJRTY: A fast majority vote algorithm. In Automated Reasoning: Essays in Honor of Woody Bledsoe, pages 105--118, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  4. P. Caspi, D. Pialiud, N. Halbwachs, and J. Plaice. LUSTRE: a declarative language for programming synchronous systems. In 14th Symposium on Principles of Programming Languages, pages 178--188, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. K. Claessen and J. Hughes. QuickCheck: A lightweight tool for random testing of Haskell programs. In ACM SIGPLAN Notices, pages 268--279. ACM, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. E. Clarke, D. Kroening, and F. Lerda. A tool for checking ANSI-C programs. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS), LNCS, pages 168--176. Springer, 2004.Google ScholarGoogle Scholar
  7. P. E. Dagand, A. Baumann, and T. Roscoe. Filet-o-Fish: practical and dependable domain-specific languages for OS development. In Proceedings of the Fifth Workshop on Programming Languages and Operating Systems (PLOS '09), pages 1--5. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Dutertre and L. D. Moura. The Yices SMT solver. Technical report, SRI, 2006.Google ScholarGoogle Scholar
  9. J. Gao, M. Heimdahl, and E. Van Wyk. Flexible and extensible notations for modeling languages. In Fundamental Approaches to Software Engineering (FASE), volume 4422 of LNCS, pages 102--116. Springer Verlag, March 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. A. Gill. Type-safe observable sharing in Haskell. In Proceedings of the 2009 ACM SIGPLAN Haskell Symposium, September 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. A. Goodloe and L. Pike. Monitoring distributed real-time systems: A survey and future directions. Technical Report NASA/CR-2010-216724, NASA Langley Research Center, July 2010.Google ScholarGoogle Scholar
  12. N. Halbwachs and P. Raymond. Validation of synchronous reactive systems: from formal verification to automatic testing. In ASIAN'99, Asian Computing Science Conference. LNCS 1742, Springer, December 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. T. Hawkins. Controlling hybrid vehicles with Haskell. Presentation. Commercial Users of Functional Programming (CUFP), 2008. Available at http://cufp.galois.com/2008/schedule.html.Google ScholarGoogle Scholar
  14. T. Kahsai, Y. Ge, and C. Tinelli. Instantiation-based invariant discovery. In 3rd NASA Formal Methods Symposium, volume 6617 of LNCS, pages 192--207. Springer, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Leijen and E. Meijer. Domain specific embedded compilers. In Domain-Specific Languages Conference. USENIX, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. X. Leroy. Formal verification of a realistic compiler. Communications of the ACM, 52: 107--115, July 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. J. S. Moore, editor. Special Issue on System Verification: Journal of Automated Reasoning, volume 5, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. Pagano, O. Andrieu, T. Moniot, B. Canou, E. Chailloux, P. Wang, P. Manoury, and J.-L. Colao. Experience report: using Objective Caml to develop safety-critical embedded tools in a certification framework. In G. Hutton and A. P. Tolmach, editors, International Conference on Functional Programming (ICFP), pages 215--220. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. L. Pike, M. Shields, and J. Matthews. A verifying core for a cryptographic language compiler. In Proceedings of the 6th Intl. Workshop on the ACL2 Theorem Prover and its Applications, pages 1--10. ACM, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. L. Pike, S. Niller, and N. Wegmann. Runtime verification for ultra-critical systems. In Proceedings of the 2nd Intl. Conference on Runtime Verification, LNCS. Springer, September 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. L. Sassaman, M. L. Patterson, S. Bratus, and A. Shubina. The Halting problems of network stack insecurity. ;login: The USENIX Magazine, 36 (6), December 2011.Google ScholarGoogle Scholar
  22. T. Schrijvers, S. Peyton Jones, M. Sulzmann, and D. Vytiniotis. Complete and decidable type inference for GADTs. In International Conference on Functional Programming (ICFP), ICFP '09, pages 341--352. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. Terei, S. Marlow, S. P. Jones, and D. Mazières. Safe haskell. In Proceedings of the Haskell Symposium, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. X. Yang, Y. Chen, E. Eide, and J. Regehr. Finding and understanding bugs in C compilers. In Programming Language Design and Implementation (PLDI), pages 283--294. ACM, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Experience report: a do-it-yourself high-assurance compiler

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      • Published in

        cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 47, Issue 9
        ICFP '12
        September 2012
        368 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/2398856
        Issue’s Table of Contents
        • cover image ACM Conferences
          ICFP '12: Proceedings of the 17th ACM SIGPLAN international conference on Functional programming
          September 2012
          392 pages
          ISBN:9781450310543
          DOI:10.1145/2364527

        Copyright © 2012 ACM

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 9 September 2012

        Check for updates

        Qualifiers

        • research-article

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!