skip to main content
research-article
Free Access

Modular Termination Verification of Single-Threaded and Multithreaded Programs

Published:05 July 2018Publication History
Skip Abstract Section

Abstract

We propose an approach for the modular specification and verification of total correctness properties of object-oriented programs. The core of our approach is a specification style that prescribes a way to assign a level expression to each method such that each callee’s level is below the caller’s, even in the presence of dynamic binding. The specification style yields specifications that properly hide implementation details. The main idea is to use multisets of method names as levels, and to associate with each object levels that abstractly reflect the way the object is built from other objects. A method’s level is then defined in terms of the method’s own name and the levels associated with the objects passed as arguments.

We first present the specification style in the context of programs that do not modify object fields. We then combine it with separation logic and abstract predicate families to obtain an approach for programs with heap mutation. In a third step, we address concurrency, by incorporating an existing approach for verifying deadlock freedom of channels and locks. Our main contribution here is to achieve information hiding by using the proposed termination levels for lock ordering as well. Also, we introduce call permissions to enable elegant verification of termination of programs where threads cause work in other threads, such as in thread pools or fine-grained concurrent algorithms involving compare-and-swap loops.

We explain how our approach can be used also to verify the liveness of nonterminating programs.

References

  1. Robert Atkey. 2011. Amortised resource analysis with separation logic. Logical Methods in Computer Science 7, 2 (2011), 1--33.Google ScholarGoogle ScholarCross RefCross Ref
  2. Richard Bornat, Cristiano Calcagno, Peter W. O’Hearn, and Matthew J. Parkinson. 2005. Permission accounting in separation logic. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. http://dblp.uni-trier.de/. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Pontus Boström and Peter Müller. 2015. Modular verification of finite blocking in non-terminating programs. In 29th European Conference on Object-Oriented Programming.Google ScholarGoogle Scholar
  4. John Boyland. 2003. Checking interference with fractional permissions. In 10th International Symposium on Static Analysis. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Arthur Charguéraud. 2011. Characteristic formulae for the verification of imperative programs. In Proceeding of the 16th ACM SIGPLAN International Conference on Functional Programming. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Arthur Charguéraud and Fran cois Pottier. 2011. Machine-checked verification of the correctness and amortized complexity of an efficient union-find implementation. In Second International Conference on Interactive Theorem Proving .Google ScholarGoogle Scholar
  7. Pedro da Rocha Pinto, Thomas Dinsdale-Young, Philippa Gardner, and Julian Sutherland. 2016. Modular termination verification for non-blocking concurrency. In 25th European Symposium on Programming (ESOP).Google ScholarGoogle ScholarCross RefCross Ref
  8. Ádám Darvas and Peter Müller. 2006. Reasoning about method calls in interface specifications. J. Object Technol. 5, 5 (2006), 59--85.Google ScholarGoogle ScholarCross RefCross Ref
  9. Nachum Dershowitz and Zohar Manna. 1979. Proving termination with multiset orderings. Commun. ACM 22, 8 (Aug. 1979), 465--476. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jan Hoffmann, Michael Marmar, and Zhong Shao. 2013. Quantitative reasoning for proving lock-freedom. In 28th Annual ACM/IEEE Symposium on Logic in Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. 2001. Featherweight Java: A minimal core calculus for Java and GJ. ACM TOPLAS 23, 3 (May 2001), 396--450. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Bart Jacobs. 2015. Provably live exception handling. In Proceedings of the 17th Workshop on Formal Techniques for Java-like Programs. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Bart Jacobs. 2018. Modular Termination Verification: Machine-Checked Proofs. Zenodo. Record 1248801.Google ScholarGoogle Scholar
  14. Bart Jacobs (Ed.). 2018. VeriFast 18.02. Zenodo. Record 1182724.Google ScholarGoogle Scholar
  15. Bart Jacobs, Dragan Bosnacki, and Ruurd Kuiper. 2015a. Modular termination verification. In 23rd European Conference on Object-Oriented Programming (ECOOP'09).Google ScholarGoogle Scholar
  16. Bart Jacobs, Dragan Bosnacki, and Ruurd Kuiper. 2015b. Modular Termination Verification: Extended Version. Technical Report CW 680. Dept. Comp. Sci., KU Leuven.Google ScholarGoogle Scholar
  17. Bart Jacobs and Frank Piessens. 2009. Failboxes: Provably safe exception handling. In 23rd European Conference on Object-Oriented Programming (ECOOP'09). Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Daan Leijen. 2014. Koka: Programming with row polymorphic effect types. In Proceedings 5th Workshop on Mathematically Structured Functional Programming.Google ScholarGoogle ScholarCross RefCross Ref
  19. K. Rustan M. Leino. 2010. Dafny: An automatic program verifier for functional correctness. In 17th International Conference on Logic for Programming, Artificial Intelligence, and Reasoning. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. K. Rustan M. Leino Leino, and Middelkoop. 2009. Proving consistency of pure methods and model fields. In 12th International Conference on Fundamental Approaches to Software Engineering. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. K. Rustan M. Leino, Peter Müller, and Jan Smans. 2010. Deadlock-free channels and locks. In 19th European Symposium on Programming (ESPO). Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Keiko Nakata and Tarmo Uustalu. 2009. Trace-based coinductive operational semantics for while. In 22nd International Conference on Theorem Proving in Higher Order Logics. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Peter W. O’Hearn, John C. Reynolds, and Hongseok Yang. 2001. Local reasoning about programs that alter data structures. In 15th International Workshop Computer Science Logic. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Matthew J. Parkinson and Gavin M. Bierman. 2005. Separation logic and abstraction. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Willem Penninckx, Bart Jacobs, and Frank Piessens. 2015. Sound, modular and compositional verification of the input/output behavior of programs. In 24th European Symposium on Programming (ESPO).Google ScholarGoogle ScholarCross RefCross Ref
  26. John C. Reynolds. 2002. Separation logic: A logic for shared mutable data structures. In 17th IEEE Symposium on Logic in Computer Science. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Arsenii Rudich, Ádám Darvas, and Peter Müller. 2008. Checking well-formedness of pure-method specifications. In 15th International Symposium on Formal Methods (FM'08). Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Viktor Vafeiadis. 2011. Concurrent separation logic and operational semantics. In Twenty-seventh Conference on the Mathematical Foundations of Programming Semantics.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Frédéric Vogels, Bart Jacobs, and Frank Piessens. 2015. Featherweight VeriFast. Logical Methods in Computer Science 11, 3 (2015), 1--57.Google ScholarGoogle Scholar

Index Terms

  1. Modular Termination Verification of Single-Threaded and Multithreaded Programs

        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

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader

        HTML Format

        View this article in HTML Format .

        View HTML Format
        About Cookies On This Site

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

        Learn more

        Got it!