Live Verification in an Interactive Proof Assistant

被引:0
|
作者
Gruetter, Samuel [1 ]
Fukala, Viktor [1 ]
Chlipala, Adam [1 ]
机构
[1] MIT, Cambridge, MA 02139 USA
基金
美国国家科学基金会;
关键词
software verification; symbolic execution; interactive proof assistants;
D O I
10.1145/3656439
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We present a prototype for a tool that enables programmers to verify their code as they write it in real-time. After each line of code that the programmer writes, the tool tells the programmer whether it was able to prove absence of undefined behavior so far, and it displays a concise representation of the symbolic state of the program right after the added line. The user can then either write the next line of code, or if needed or desired, write a specially marked comment that provides hints on how to solve side conditions or on how to represent the symbolic state more nicely. Once the programmer has finished writing the program, it is already verified with a mathematical correctness proof. Other tools providing real-time feedback already exist, but ours is the first one that only relies on a small trusted proof checker and that provides a concise summary of the symbolic state at the point in the program currently being edited, as opposed to only indicating whether user-stated assertions or postconditions hold. Program verification requires loop invariants, which are hard to find and tedious to spell out. We explore a middle ground in the design space between the two extremes of requiring users to spell out loop invariants manually and attempting to infer loop invariants automatically: Since a loop invariant often looks quite similar to the symbolic state right before the loop, our tool asks the user to express the desired loop invariant as a diff from the symbolic state before the loop, which has the potential to lead to shorter, more maintainable proofs. We prototyped our technique in the interactive proof assistant Coq, so our framework creates machine-checked proofs that the developed functions satisfy their specifications when executed according to the formal semantics of the source language. Using a verified compiler proven against the same source-language semantics, we can ensure that the behavior of the compiled program matches the program's behavior as represented by the framework during the proof. Additionally, since our polyglot source files can be viewed as Coq or C files at the same time, users willing to accept a larger trusted code base can compile them with GCC.
引用
收藏
页数:24
相关论文
共 50 条
  • [31] PROOFBUDDY: A Proof Assistant for Learning and Monitoring
    Karsten, Nadine
    Jacobsen, Frederik Krogsdal
    Eiken, Kim Jana
    Nestmann, Uwe
    Villadsen, Jorgen
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2023, (382): : 1 - 21
  • [32] User interaction with the matita proof assistant
    Asperti, Andrea
    Coen, Claudio Sacerdoti
    Tassi, Enrico
    Zacchiroli, Stefano
    JOURNAL OF AUTOMATED REASONING, 2007, 39 (02) : 109 - 139
  • [33] A declarative language for the Coq proof assistant
    Corbineau, Pierre
    TYPES FOR PROOFS AND PROGRAMS, 2008, 4941 : 69 - 84
  • [34] The RedPRL Proof Assistant (Invited Paper)
    Angiuli, Carlo
    Cavallo, Evan
    Hou , Kuen-Bang
    Harper, Robert
    Sterling, Jonathan
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2018, (274): : 1 - 10
  • [35] Incorporating a Database of Graphs into a Proof Assistant
    Bauer, Andrej
    Bercic, Katja
    Devillez, Gauvain
    Taslak, Jure
    INTELLIGENT COMPUTER MATHEMATICS, CICM 2024, 2024, 14690 : 146 - 162
  • [36] ANITA: Analytic Tableau Proof Assistant
    Vasconcelos, Davi Romero
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2023, (375): : 38 - 53
  • [37] Natural Deduction and the Isabelle Proof Assistant
    Villadsen, Jorgen
    From, Andreas Halkjaer
    Schlichtkrull, Anders
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2018, (267): : 140 - 155
  • [38] Proof Assistant Based on Didactic Considerations
    Pais, Jorge
    Tasistro, Alvaro
    JOURNAL OF UNIVERSAL COMPUTER SCIENCE, 2013, 19 (11) : 1570 - 1596
  • [39] User Interaction with the Matita Proof Assistant
    Andrea Asperti
    Claudio Sacerdoti Coen
    Enrico Tassi
    Stefano Zacchiroli
    Journal of Automated Reasoning, 2007, 39 : 109 - 139
  • [40] Mathematical libraries as proof assistant environments
    Coen, CS
    MATHEMATICAL KNOWLEDGE MANAGEMENT, PROCEEDINGS, 2004, 3119 : 332 - 346