Almost Correct Invariants: Synthesizing Inductive Invariants by Fuzzing Proofs

被引:12
作者
Lahiri, Surnit [1 ]
Roy, Subhajit [1 ]
机构
[1] Indian Inst Technol Kanpur, Kanpur, Uttar Pradesh, India
来源
PROCEEDINGS OF THE 31ST ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2022 | 2022年
关键词
inductive invariant synthesis; fuzzing; verification; testing; DATA-DRIVEN APPROACH; ADAPTIVE CONCRETIZATION;
D O I
10.1145/3533767.3534381
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Real-life programs contain multiple operations whose semantics are unavailable to verification engines, like third-party library calls, inline assembly and SIMD instructions, special compiler-provided primitives, and queries to uninterpretable machine learning models. Even with the exceptional success story of program verification, synthesis of inductive invariants for such "open" programs has remained a challenge. Currently, this problem is handled by manually "closing" the program-by providing hand-written stubs that attempt to capture the behavior of the unmodelled operations; writing stubs is not only difficult and tedious, but the stubs are often incorrect-raising serious questions on the whole endeavor. In this work, we propose Almost Correct Invariants as an automated strategy for synthesizing inductive invariants for such "open" programs. We adopt an active learning strategy where a data-driven learner proposes candidate invariants. In deviation from prior work that attempt to verify invariants, we attempt to falsify the invariants: we reduce the falsification problem to a set of reachability checks on non-deterministic programs; we ride on the success of modern fuzzers to answer these reachability queries. Our tool, ACHAR, automatically synthesizes inductive invariants that are sufficient to prove the correctness of the target programs. We compare ACHAR with a state-of-the-art invariant synthesis tool that employs theorem proving on formulae built over the program source. Though ACHAR is without strong soundness guarantees, our experiments show that even when we provide almost no access to the program source, ACHAR outperforms the state-of-the-art invariant generator that has complete access to the source. We also evaluate ACHAR on programs that current invariant synthesis engines cannot handle-programs that invoke external library calls, inline assembly, and queries to convolution neural networks; ACHAR successfully infers the necessary inductive invariants within a reasonable time.
引用
收藏
页码:352 / 364
页数:13
相关论文
共 85 条
[1]  
AFL, 2020, american fuzzy lop
[2]  
Albarghouthi A., 2013, Proceedings, ser. Lecture Notes in Computer Science, V8044, P313, DOI 10.1007/978-3-642-39799-822
[3]  
Allamanis M., 2018, P ICLR
[4]   Syntax-Guided Synthesis [J].
Alur, Rajeev ;
Bodik, Rastislav ;
Dallal, Eric ;
Fisman, Dana ;
Garg, Pranav ;
Juniwal, Garvit ;
Kress-Gazit, Hadas ;
Madhusudan, P. ;
Martin, Milo M. K. ;
Raghothaman, Mukund ;
Saha, Shamwaditya ;
Seshia, Sanjit A. ;
Singh, Rishabh ;
Solar-Lezama, Armando ;
Torlak, Emina ;
Udupa, Abhishek .
DEPENDABLE SOFTWARE SYSTEMS ENGINEERING, 2015, 40 :1-25
[5]   Learning Stateful Preconditions Modulo a Test Generator [J].
Astorga, Angello ;
Madhusudan, P. ;
Saha, Shambwaditya ;
Wang, Shiyu ;
Xie, Tao .
PROCEEDINGS OF THE 40TH ACM SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN AND IMPLEMENTATION (PLDI '19), 2019, :775-787
[6]   Efficient path profiling [J].
Ball, T ;
Larus, JR .
PROCEEDINGS OF THE 29TH ANNUAL IEEE/ACM INTERNATIONAL SYMPOSIUM ON MICROARCHITECTURE - MICRO-29, 1996, :46-57
[7]   To Be Precise: Regression Aware Debugging [J].
Bavishi, Rohan ;
Pandey, Awanish ;
Roy, Subhajit .
ACM SIGPLAN NOTICES, 2016, 51 (10) :897-915
[8]   Almost-Correct Specifications A Modular Semantic Framework for Assigning Confidence to Warnings [J].
Blackshear, Sam ;
Lahiri, Shuvendu K. .
ACM SIGPLAN NOTICES, 2013, 48 (06) :209-218
[9]   Learning Shape Analysis [J].
Brockschmidt, Marc ;
Chen, Yuxin ;
Kohli, Pushmeet ;
Krishna, Siddharth ;
Tarlow, Daniel .
STATIC ANALYSIS (SAS 2017), 2017, 10422 :66-87
[10]  
Cadar Cristian, 2008, P USENIX S OP SYST D, V8, P209