Separation logic, abstraction and inheritance

被引:20
|
作者
Parkinson, Matthew J. [1 ]
Bierman, Gavin M. [1 ]
机构
[1] Univ Cambridge, Cambridge CB2 1TN, England
关键词
languages; theory; verification; separation logic; modularity; classes;
D O I
10.1145/1328897.1328451
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Inheritance is a fundamental concept in object-oriented programming, allowing new classes to be defined in terms of old classes. When used with care, inheritance is an essential tool for object-oriented programmers. Thus, for those interested in developing formal verification techniques, the treatment of inheritance is of paramount importance. Unfortunately, inheritance comes in a number of guises, all requiring subtle techniques. To address these subtleties, most existing verification methodologies typically adopt one of two restrictions to handle inheritance: either (1) they prevent a derived class from restricting the behaviour of its base class (typically by syntactic means) to trivialize the proof obligations; or (2) they allow a derived class to restrict the behaviour of its base class, but require that every inherited method must be reverified. Unfortunately, this means that typical inheritance-rich code either cannot be verified or results in an unreasonable number of proof obligations. In this paper, we develop a separation logic for a core object-oriented language. It allows derived classes which override the behaviour of their base class, yet supports the inheritance of methods without reverification where this is safe. For each method, we require two specifications: a static specification that is used to verify the implementation and direct method calls (in Java this would be with a super call); and a dynamic specification that is used for calls that are dynamically dispatched; along with a simple relationship between the two specifications. Only the dynamic specification is involved with behavioural subtyping. This simple separation of concerns leads to a powerful system that supports all forms of inheritance with low proof-obligation overheads. We both formalize our methodology and demonstrate its power with a series of inheritance examples.
引用
收藏
页码:75 / 86
页数:12
相关论文
共 50 条
  • [1] Separation Logic, Abstraction and Inheritance
    Parkinson, Matthew J.
    Bierman, Gavin M.
    [J]. POPL'08: PROCEEDINGS OF THE 35TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2008, : 75 - 86
  • [2] Separation logic and abstraction
    Parkinson, M
    Bierman, G
    [J]. ACM SIGPLAN NOTICES, 2005, 40 (01) : 247 - 258
  • [3] Separation Logic for Multiple Inheritance
    Luo, Chenguang
    Qin, Shengchao
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2008, 212 : 27 - 40
  • [4] BI-hyperdoctrines, higher-order separation logic, and abstraction
    Biering, Bodil
    Birkedal, Lars
    Torp-Smith, Noah
    [J]. ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2007, 29 (05):
  • [5] Abstraction and Logic of an Explanation
    Novosyolov, M. M.
    [J]. VOPROSY FILOSOFII, 2009, (01) : 75 - 87
  • [6] Abstraction in Algorithmic Logic
    Wayne Aitken
    Jeffrey A. Barrett
    [J]. Journal of Philosophical Logic, 2008, 37 : 23 - 43
  • [7] Abstraction in Fixpoint Logic
    Cranen, Sjoerd
    Gazda, Maciej
    Wesselink, Wieger
    Willemse, Tim A. C.
    [J]. ACM TRANSACTIONS ON COMPUTATIONAL LOGIC, 2015, 16 (04)
  • [8] Abstraction in algorithmic logic
    Aitken, Wayne
    Barrett, Jeffrey A.
    [J]. JOURNAL OF PHILOSOPHICAL LOGIC, 2008, 37 (01) : 23 - 43
  • [9] Algebraic graph transformations with inheritance and abstraction
    Loewe, Michael
    Koenig, Harald
    Schulz, Christoph
    Schultchen, Marius
    [J]. SCIENCE OF COMPUTER PROGRAMMING, 2015, 107 : 2 - 18
  • [10] ABSTRACTION ALGORITHM FOR COMBINATORY LOGIC
    ABDALI, SK
    [J]. JOURNAL OF SYMBOLIC LOGIC, 1976, 41 (01) : 222 - 224