We propose an approach for the modular specification and verification of total correctness properties of object-oriented programs. We start from an existing program logic for partial correctness based on separation logic and abstract predicate families. We extend it with call permissions qualified by an arbitrary ordinal number, and we define a specification style that properly hides implementation details, based on the ideas of using methods and bags of methods as ordinals, and exposing the bag of methods reachable from an object as an abstract predicate argument. These enable each method to abstractly request permission to call all methods reachable by it any finite number of times, and to delegate similar permissions to its callees. We illustrate the approach with several examples. We then extend the approach to a concurrent setting, by incorporating an existing approach for verifying deadlock-freedom of channels and locks. Our main contribution here is to achieve information hiding by using method bags for lock ordering. We also show how our approach prevents infinite thread creation and enables verification of termination of fine-grained concurrent algorithms involving compare-and-swap loops. We explain how our approach can be used also to verify liveness properties of non-terminating programs. Modular Termination Verification: Extended Version Bart Jacobs, Dragan Bosnacki, and Ruurd Kuiper 1 iMinds-DistriNet, Department of Computer Science, Leuven, Belgium bart.jacobs@cs.kuleuven.be 2 Eindhoven University of Technology, the Netherlands {d.bosnacki,r.kuiper}@tue.nl Abstract. We propose an approach for the modular specification and verification of total correctness properties of object-oriented programs. We start from an existing program logic for partial correctness based on separation logic and abstract predicate families. We extend it with call permissions qualified by an arbitrary ordinal number, and we define a specification style that properly hides implementation details, based on the ideas of using methods and bags of methods as ordinals, and exposing the bag of methods reachable from an object as an abstract predicate argument. These enable each method to abstractly request permission to call all methods reachable by it any finite number of times, and to delegate similar permissions to its callees. We illustrate the approach with several examples. We then extend the approach to a concurrent setting, by incorporating an existing approach for verifying deadlock-freedom of channels and locks. Our main contribution here is to achieve information hiding by using method bags for lock ordering. We also show how our approach prevents infinite thread creation and enables verification of termination of finegrained concurrent algorithms involving compare-and-swap loops. We explain how our approach can be used also to verify liveness properties of non-terminating programs. We propose an approach for the modular specification and verification of total correctness properties of object-oriented programs. We start from an existing program logic for partial correctness based on separation logic and abstract predicate families. We extend it with call permissions qualified by an arbitrary ordinal number, and we define a specification style that properly hides implementation details, based on the ideas of using methods and bags of methods as ordinals, and exposing the bag of methods reachable from an object as an abstract predicate argument. These enable each method to abstractly request permission to call all methods reachable by it any finite number of times, and to delegate similar permissions to its callees. We illustrate the approach with several examples. We then extend the approach to a concurrent setting, by incorporating an existing approach for verifying deadlock-freedom of channels and locks. Our main contribution here is to achieve information hiding by using method bags for lock ordering. We also show how our approach prevents infinite thread creation and enables verification of termination of finegrained concurrent algorithms involving compare-and-swap loops. We explain how our approach can be used also to verify liveness properties of non-terminating programs.
[1]
Gavin M. Bierman,et al.
Separation logic and abstraction
,
2005,
POPL '05.
[2]
Peter W. O'Hearn,et al.
Local Reasoning about Programs that Alter Data Structures
,
2001,
CSL.
[3]
Peter W. O'Hearn,et al.
BI as an assertion language for mutable data structures
,
2001,
POPL '01.
[4]
John Tang Boyland,et al.
Checking Interference with Fractional Permissions
,
2003,
SAS.
[5]
Peter W. O'Hearn,et al.
BI as an assertion language for mutable data structures
,
2001,
POPL '01.
[6]
Frank Piessens,et al.
Failboxes: Provably Safe Exception Handling
,
2009,
ECOOP.
[7]
Jan Smans,et al.
Deadlock-Free Channels and Locks
,
2010,
ESOP.
[8]
Peter W. O'Hearn,et al.
Permission accounting in separation logic
,
2005,
POPL '05.
[9]
Gavin M. Bierman,et al.
Separation logic, abstraction and inheritance
,
2008,
POPL '08.
[10]
Daan Leijen,et al.
Koka: Programming with Row Polymorphic Effect Types
,
2014,
MSFP.
[11]
K. Rustan M. Leino,et al.
Dafny: An Automatic Program Verifier for Functional Correctness
,
2010,
LPAR.
[12]
Frank Piessens,et al.
Expressive modular fine-grained concurrency specification
,
2011,
POPL '11.
[13]
Peter Müller,et al.
Checking Well-Formedness of Pure-Method Specifications
,
2008,
FM.
[14]
Tarmo Uustalu,et al.
Trace-Based Coinductive Operational Semantics for While
,
2009,
TPHOLs.