We gratefully acknowledge support from
the Simons Foundation and member institutions.
Full-text links:

Download:

Current browse context:

cs.PL

Change to browse by:

References & Citations

DBLP - CS Bibliography

Bookmark

(what is this?)
CiteULike logo BibSonomy logo Mendeley logo del.icio.us logo Digg logo Reddit logo ScienceWISE logo

Computer Science > Programming Languages

Title: The concept of class invariant in object-oriented programming

Abstract: Class invariants -- consistency constraints preserved by every operation on objects of a given type -- are fundamental to building and understanding object-oriented programs. They should also be a key help in verifying them, but turn out instead to raise major verification challenges which have prompted a significant literature with, until now, no widely accepted solution. The present work introduces a general proof rule meant to address invariant-related issues and allow verification tools benefit from invariants. It first clarifies the notion of invariant and identify the three problems: callbacks, furtive access and reference leak. As an example, the 2016 Ethereum DAO bug, in which \$50 million were stolen, resulted from a callback invalidating an invariant. The discussion starts with a "Simple Model" and an associated proof rule, demonstrating its soundness. It then removes one by one the three assumptions of the Simple Model, each removal bringing up one of the three issues, and introduces the corresponding adaptation to the proof rule. The final version of the rule can tackle tricky examples, including "challenge problems" listed in the literature.
Comments: Minor update (typos, formatting), 9 Oct.2021
Subjects: Programming Languages (cs.PL); Software Engineering (cs.SE)
ACM classes: D.1; D.2; D.3; F.3
Cite as: arXiv:2109.06557 [cs.PL]
  (or arXiv:2109.06557v3 [cs.PL] for this version)

Submission history

From: Bertrand Meyer [view email]
[v1] Tue, 14 Sep 2021 09:59:33 GMT (1318kb,D)
[v2] Wed, 22 Sep 2021 16:19:19 GMT (1318kb,D)
[v3] Sat, 9 Oct 2021 10:33:12 GMT (1318kb,D)

Link back to: arXiv, form interface, contact.