Reasoning about External Calls
Sophia Drossopoulou, Julian Mackay, Susan Eisenbach, James Noble
TL;DR
This work tackles reasoning about external calls in an object-capability setting by introducing protection assertions, a specification language for limited effects, and a Hoare-quadruple verification framework. Central ideas include scoped invariants that hold within a method's dynamic execution and an adaptation mechanism to transfer assertions across call boundaries, enabling sound reasoning about untrusted external code. The authors prove the soundness of their Hoare quadruples, provide a mechanised Coq proof for a running Shop example, and demonstrate how internal modules can guarantee safety properties despite arbitrary external interactions. The approach supports modular verification in open-world settings, offering concrete guarantees about preventing unwanted effects while enabling safe interactions via public interfaces. This work thus advances defensive consistency for multi-component systems by formalizing protection, scoped reasoning, and external-call adherence within a unified verification framework.
Abstract
In today's complex software, internal trusted code is tightly intertwined with external untrusted code. To reason about internal code, programmers must reason about the potential effects of calls to external code, even though that code is not trusted and may not even be available. The effects of external calls can be limited, if internal code is programmed defensively, limiting potential effects by limiting access to the capabilities necessary to cause those effects. This paper addresses the specification and verification of internal code that relies on encapsulation and object capabilities to limit the effects of external calls. We propose new assertions for access to capabilities, new specifications for limiting effects, and a Hoare logic to verify that a module satisfies its specification, even while making external calls. We illustrate the approach though a running example with mechanised proofs, and prove soundness of the Hoare logic.
