Automatically Verifying Typing Constraints for a Data Processing Language

  • Michael Backes
  • Cătălin Hriţcu
  • Thorsten Tarrach
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7086)

Abstract

In this paper we present a new technique for automatically verifying typing constraints in the setting of Dminor, a first-order data processing language with refinement types and dynamic type-tests. We achieve this by translating Dminor programs into a standard while language and then using a general-purpose verification tool. Our translation generates assertions in the while program that faithfully represent the sophisticated typing constraints in the original program. We use a generic verification condition generator together with an SMT solver to prove statically that these assertions succeed in all executions. We formalise our translation algorithm using an interactive theorem prover and provide a machine-checkable proof of its soundness. We provide a prototype implementation using Boogie and Z3 that can already be used to efficiently verify a large number of test programs.

Keywords

Proof Obligation Typing Constraint Type Annotation Loop Invariant Hoare Logic 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Bytecode level specification language and program logic. Mobius Project, Deliverable D3.1 (2006)Google Scholar
  2. 2.
    The Microsoft code name ”M” modeling language specification (October 2009), http://msdn.microsoft.com/en-us/library/dd548667.aspx
  3. 3.
    Barnett, M., Chang, B.-Y.E., DeLine, R., Jacobs, B., Leino, K.R.M.: Boogie: A Modular Reusable Verifier for Object-Oriented Programs. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 364–387. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# Programming System: An Overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  5. 5.
    Barras, B., Boutin, S., Cornes, C., Courant, J., Coscoy, Y., Delahaye, D., de Rauglaudre, D., Filliâtre, J., Giménez, E., Herbelin, H., et al.: The Coq proof assistant reference manual, version 8.2. INRIA (2009)Google Scholar
  6. 6.
    Bengtson, J., Bhargavan, K., Fournet, C., Gordon, A.D., Maffeis, S.: Refinement types for secure implementations. ACM Transactions on Programming Languages and Systems 33(2), 8 (2011)CrossRefGoogle Scholar
  7. 7.
    Bierman, G.M., Gordon, A.D., Hriţcu, C., Langworthy, D.: Semantic subtyping with an SMT solver. In: 15th ACM SIGPLAN International Conference on Functional programming (ICFP 2010), pp. 105–116. ACM Press (2010)Google Scholar
  8. 8.
    Böhme, S., Leino, K.R.M., Wolff, B.: HOL-Boogie — An Interactive Prover for the Boogie Program-Verifier. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 150–166. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  9. 9.
    Cohen, E., Moskal, M., Tobies, S., Schulte, W.: A precise yet efficient memory model for C. Electronic Notes in Theoretical Computer Science 254, 85–103 (2009)CrossRefGoogle Scholar
  10. 10.
    Dahlweid, M., Moskal, M., Santen, T., Tobies, S., Schulte, W.: VCC: Contract-based modular verification of concurrent C. In: 31st International Conference on Software Engineering (ICSE), pp. 429–430. IEEE (2009)Google Scholar
  11. 11.
    DeLine, R., Leino, K.: BoogiePL: A typed procedural language for checking object-oriented programs. Technical Report MSR-TR-2005-70, Microsoft Research (2005)Google Scholar
  12. 12.
    Detlefs, D., Nelson, G., Saxe, J.: Simplify: A theorem prover for program checking. Journal of the ACM (JACM) 52(3), 473 (2005)MathSciNetCrossRefMATHGoogle Scholar
  13. 13.
    Filliâtre, J.-C., Marché, C.: The Why/Krakatoa/Caduceus Platform for Deductive Program Verification. In: Damm, W., Hermanns, H. (eds.) CAV 2007. LNCS, vol. 4590, pp. 173–177. Springer, Heidelberg (2007)CrossRefGoogle Scholar
  14. 14.
    Hosoya, H., Pierce, B.: XDuce: A statically typed XML processing language. ACM Transactions on Internet Technology 3(2), 117–148 (2003)CrossRefGoogle Scholar
  15. 15.
    Jhala, R., Majumdar, R., Rybalchenko, A.: HMC: Verifying Functional Programs Using Abstract Interpreters. In: Gopalakrishnan, G., Qadeer, S. (eds.) CAV 2011. LNCS, vol. 6806, pp. 470–485. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  16. 16.
    Kleymann, T.: Hoare logic and auxiliary variables. Formal Aspects of Computing 11(5), 541–566 (1999)CrossRefMATHGoogle Scholar
  17. 17.
    Knowles, K., Tomb, A., Gronski, J., Freund, S., Flanagan, C.: Sage: Unified hybrid checking for first-class types, general refinement types and Dynamic. Technical report, UCSC (2007)Google Scholar
  18. 18.
    Kobayashi, N., Ong, C.-H.L.: A type system equivalent to the modal mu-calculus model checking of higher-order recursion schemes. In: 24th Annual IEEE Symposium on Logic in Computer Science (LICS), pp. 179–188. IEEE Computer Society (2009)Google Scholar
  19. 19.
    Lehner, H., Müller, P.: Formal translation of bytecode into BoogiePL. Electronic Notes in Theoretical Computer Science 190(1), 35–50 (2007)CrossRefGoogle Scholar
  20. 20.
    Leino, K.R.M.: This is Boogie 2. TechReport (2008)Google Scholar
  21. 21.
    Leino, K.R.M., Millstein, T., Saxe, J.: Generating error traces from verification-condition counterexamples. Science of Computer Programming 55(1-3), 209–226 (2005)MathSciNetCrossRefMATHGoogle Scholar
  22. 22.
    Marinos, C.: An introduction to functional programming for.NET developers. MSDN Magazine (April 2010)Google Scholar
  23. 23.
    Meijer, E., Beckman, B., Bierman, G.M.: LINQ: reconciling object, relations and XML in the .NET framework. In: ACM SIGMOD International Conference on Management of Data (SIGMOD), page 706. ACM (2006)Google Scholar
  24. 24.
    Morris, J.: Comments on ”procedures and parameters”. Undated and unpublishedGoogle Scholar
  25. 25.
    Naik, M., Palsberg, J.: A type system equivalent to a model checker. ACM Transactions on Programming Languages and Systems (TOPLAS) 30(5), 29 (2008)CrossRefMATHGoogle Scholar
  26. 26.
    Nipkow, T.: Hoare logics in Isabelle/HOL. In: Proof and System-Reliability, pp. 341–367. Kluwer (2002)Google Scholar
  27. 27.
    Pierce, B., Casinghino, C., Greenberg, M., Sjöberg, V., Yorgey, B.: Software Foundations (2010), http://www.cis.upenn.edu/~bcpierce/sf/
  28. 28.
    Ranise, S., Tinelli, C.: The satisfiability modulo theories library, SMT-LIB (2006), http://www.SMT-LIB.org
  29. 29.
    Rondon, P.M., Kawaguchi, M., Jhala, R.: Liquid types. In: ACM SIGPLAN 2008 Conference on Programming Language Design and Implementation (PLDI), pp. 159–169 (2008)Google Scholar
  30. 30.
    Swamy, N., Chen, J., Chugh, R.: Enforcing Stateful Authorization and Information Flow Policies in Fine. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 529–549. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  31. 31.
    Tarrach, T.: Automatically verifying “M” modeling language constraints. Master’s thesis, Saarland University (2010)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Michael Backes
    • 1
    • 2
  • Cătălin Hriţcu
    • 1
    • 3
  • Thorsten Tarrach
    • 1
    • 4
    • 5
  1. 1.Saarland UniversitySaarbrückenGermany
  2. 2.MPI-SWSSaarbrückenGermany
  3. 3.University of PennsylvaniaPhiladelphiaUSA
  4. 4.Atomia AB, VästeråsSweden
  5. 5.Troxo DOO, NišSerbia

Personalised recommendations