Using capabilities for strict runtime invariant checking

Isaac Oscar Gariano, Marco Servetto*, Alex Potanin

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review

Abstract

In this paper we use pre-existing language support for both reference and object capabilities to enable sound runtime verification of representation invariants. Our invariant protocol is stricter than the other protocols, since it guarantees that invariants hold for all objects involved in execution. Any language already offering appropriate support for reference and object capabilities can support our invariant protocol with minimal added complexity. In our protocol, invariants are simply specified as methods whose execution is statically guaranteed to be deterministic and to not access any externally mutable state. We formalise our approach and prove that our protocol is sound, in the context of a language supporting mutation, dynamic dispatch, exceptions, and non-deterministic I/O. We present case studies showing that our system requires a lighter annotation burden compared to Spec#, and performs orders of magnitude less runtime invariant checks compared to the ‘visible state semantics’ protocols of D and Eiffel.

Original languageEnglish
Article number102878
Number of pages57
JournalScience of Computer Programming
Volume224
Early online date27 Sept 2022
DOIs
Publication statusPublished - 1 Dec 2022

Fingerprint

Dive into the research topics of 'Using capabilities for strict runtime invariant checking'. Together they form a unique fingerprint.

Cite this