A Correctness and Incorrectness Program Logic

被引:13
|
作者
Bruni, Roberto [1 ]
Giacobazzi, Roberto [2 ]
Gori, Roberta [1 ]
Ranzato, Francesco [3 ]
机构
[1] Univ Pisa, Pisa, Italy
[2] Univ Verona, Verona, Italy
[3] Univ Padua, Padua, Italy
关键词
Abstract interpretation; abstract domain; program analysis; program verification; program logic; local completeness; best correct approximation; incorrectness logic; ABSTRACT INTERPRETATIONS; DOMAINS;
D O I
10.1145/3582267
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
interpretation is a well-known and extensively used method to extract over-approximate program invariants by a sound program analysis algorithm. Soundness means that no program errors are lost and it is, in principle, guaranteed by construction. Completeness means that the abstract interpreter reports no false alarms for all possible inputs, but this is extremely rare because it needs a very precise analysis. We introduce a weaker notion of completeness, called local completeness, which requires that no false alarms are produced only relatively to some fixed program inputs. Based on this idea, we introduce a program logic, called Local Completeness Logic for an abstract domain A, for proving both the correctness and incorrectness of program specifications. Our proof system, which is parameterized by an abstract domain A, combines over- and under-approximating reasoning. In a provable triple proves(A) [p] c [q], c is a program, q is an under-approximation of the strongest post-condition of c on input p such that their abstractions in A coincide. This means that q is never too coarse, namely, under some mild assumptions, the abstract interpretation of c does not yield false alarms for the input p iff q has no alarm. Therefore, proving proves(A) [p] c [q] not only ensures that all the alarms raised in q are true ones, but also that if q does not raise alarms, then c is correct. We also prove that if A is the straightforward abstraction making all program properties equivalent, then our program logic coincides with O'Hearn's incorrectness logic, while for any other abstraction, contrary to the case of incorrectness logic, our logic can also establish program correctness.
引用
收藏
页数:45
相关论文
共 50 条
  • [1] On Algebra of Program Correctness and Incorrectness
    Moller, Bernhard
    O'Hearn, Peter
    Hoare, Tony
    RELATIONAL AND ALGEBRAIC METHODS IN COMPUTER SCIENCE (RAMICS 2021), 2021, 13027 : 325 - 343
  • [2] Outcome Logic: A Unifying Foundation for Correctness and Incorrectness Reasoning
    Zilberstein, Noam
    Dreyer, Derek
    Silva, Alexandra
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (OOPSLA):
  • [3] Outcome Separation Logic: Local Reasoning for Correctness and Incorrectness with Computational Effects
    Zilberstein, Noam
    Saliling, Angelina
    Silva, Alexandra
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2024, 8 (OOPSLA):
  • [4] Incorrectness Logic
    O'Hearn, Peter W.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2020, 4 (POPL):
  • [5] LOGIC AND SORTAL INCORRECTNESS
    BERGMANN, M
    REVIEW OF METAPHYSICS, 1977, 31 (01): : 61 - 79
  • [6] Automatic correctness proofs for logic program transformations
    Pettorossi, Alberto
    Proietti, Maurizio
    Senni, Valerio
    LOGIC PROGRAMMING, PROCEEDINGS, 2007, 4670 : 364 - +
  • [7] Concurrent incorrectness separation logic
    Raad, Azalea
    Berdine, Josh
    Dreyer, Derek
    O'Hearn, Peter W.
    Proceedings of the ACM on Programming Languages, 2022, 6 (POPL)
  • [8] Rigorous proofs of program correctness without formal logic
    Wadkins, J.R. Jefferson
    SIGCSE Bulletin (Association for Computing Machinery, Special Interest Group on Computer Science Education), 1995, 27 (01):
  • [9] Concurrent Incorrectness Separation Logic
    Raad, Azalea
    Berdine, Josh
    Dreyer, Derek
    O'Hearn, Peter W.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2022, 6
  • [10] Proof of correctness of C++ program by HOARE logic
    Wang, Caifen
    Lanzhou Daxue Xuebao/Journal of Lanzhou University, 2000, 36 (01): : 44 - 47