Code2Inv: A Deep Learning Framework for Program Verification
2020, Computer Aided Verification
https://doi.org/10.1007/978-3-030-53291-8_9Abstract
We propose a general end-to-end deep learning framework Code2Inv, which takes a verification task and a proof checker as input, and automatically learns a valid proof for the verification task by interacting with the given checker. Code2Inv is parameterized with an embedding module and a grammar: the former encodes the verification task into numeric vectors while the latter describes the format of solutions Code2Inv should produce. We demonstrate the flexibility of Code2Inv by means of two small-scale yet expressive instances: a loop invariant synthesizer for C programs, and a Constrained Horn Clause (CHC) solver.
References (40)
- Allamanis, M., Brockschmidt, M., Khademi, M.: Learning to represent programs with graphs. In: Proceedings of the International Conference on Learning Repre- sentations (ICLR) (2018)
- Alur, R., et al.: Syntax-guided synthesis. In: Proceedings of Formal Methods in Computer-Aided Design (FMCAD) (2013)
- Alur, R., Radhakrishna, A., Udupa, A.: Scaling enumerative program synthesis via divide and conquer. In: Legay, A., Margaria, T. (eds.) TACAS 2017. LNCS, vol. 10205, pp. 319-336. Springer, Heidelberg (2017). https://doi.org/10.1007/978-3- 662-54577-5 18
- Alur, R., Singh, R., Fisman, D., Solar-Lezama, A.: Search-based program synthesis. Commun. ACM 61(12), 84-93 (2018)
- Bahdanau, D., Cho, K., Bengio, Y.: Neural machine translation by jointly learning to align and translate. In: Proceedings of the International Conference on Learning Representations (ICLR) (2015)
- Bjørner, N., Gurfinkel, A., McMillan, K., Rybalchenko, A.: Horn clause solvers for program verification. In: Beklemishev, L.D., Blass, A., Dershowitz, N., Finkbeiner, B., Schulte, W. (eds.) Fields of Logic and Computation II. LNCS, vol. 9300, pp. 24-51.
- Springer, Cham (2015). https://doi.org/10.1007/978-3-319-23534-9 2
- Chung, J., Gülçehre, C ¸., Cho, K., Bengio, Y.: Empirical evaluation of gated recur- rent neural networks on sequence modeling. CoRR abs/1412.3555 (2014)
- Dai, H., Dai, B., Song, L.: Discriminative embeddings of latent variable models for structured data. In: Proceedings of the International Conference on Machine Learning (ICML) (2016)
- Garg, P., Löding, C., Madhusudan, P., Neider, D.: ICE: a robust frame- work for learning invariants. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 69-87. Springer, Cham (2014). https://doi.org/10.1007/978-3-319- 08867-9 5
- Garg, P., Neider, D., Madhusudan, P., Roth, D.: Learning invariants using decision trees and implication counterexamples. In: Proceedings of the ACM Symposium on Principles of Programming Languages (POPL) (2016)
- Gilmer, J., Schoenholz, S.S., Riley, P.F., Vinyals, O., Dahl, G.E.: Neural message passing for quantum chemistry. In: Proceedings of the International Conference on Machine Learning (ICML), pp. 1263-1272 (2017)
- Graves, A., Wayne, G., Danihelka, I.: Neural turing machines. CoRR abs/1410.5401 (2014)
- Grefenstette, E., Hermann, K.M., Suleyman, M., Blunsom, P.: Learning to trans- duce with unbounded memory. In: Proceedings of the Conference on Neural Infor- mation Processing Systems (NIPS), pp. 1828-1836 (2015)
- Gurfinkel, A., Kahsai, T., Komuravelli, A., Navas, J.A.: The SeaHorn verification framework. In: Kroening, D., Pȃsȃreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9206, pp. 343-361. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21690- 4 20
- Heo, K., Raghothaman, M., Si, X., Naik, M.: Continuously reasoning about pro- grams using differential Bayesian inference. In: Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI) (2019)
- Hochreiter, S., Schmidhuber, J.: Long short-term memory. Neural Comput. 9(8), 1735-1780 (1997)
- Jha, S., Gulwani, S., Seshia, S.A., Tiwari, A.: Oracle-guided component-based pro- gram synthesis. In: Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering (2010)
- Komuravelli, A., Gurfinkel, A., Chaki, S.: SMT-based model checking for recursive programs. Formal Methods Syst. Des. 48(3), 175-205 (2016)
- Li, Y., Tarlow, D., Brockschmidt, M., Zemel, R.: Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493 (2015)
- Logozzo, F., Lahiri, S.K., Fähndrich, M., Blackshear, S.: Verification modulo ver- sions: towards usable verification. In: Proceedings of the ACM Conference on Pro- gramming Language Design and Implementation (PLDI) (2014)
- McMillan, K.L., Rybalchenko, A.: Solving constrained horn clauses using interpo- lation. Technical report MSR-TR-2013-6 (2013)
- Mnih, V., et al.: Human-level control through deep reinforcement learning. Nature 518(7540), 529-533 (2015)
- de Moura, L., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337-340. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-78800-3 24
- Necula, G.C., McPeak, S., Rahul, S.P., Weimer, W.: CIL: intermediate language and tools for analysis and transformation of C programs. In: Horspool, R.N. (ed.) CC 2002. LNCS, vol. 2304, pp. 213-228. Springer, Heidelberg (2002). https://doi. org/10.1007/3-540-45937-5 16
- O'Hearn, P.: Continuous reasoning: scaling the impact of formal methods. In: Pro- ceedings of the Annual ACM/IEEE Symposium on Logic in Computer Science (LICS) (2018)
- Padhi, S., Sharma, R., Millstein, T.: Data-driven precondition inference with learned features. In: Proceedings of the ACM Conference on Programming Lan- guage Design and Implementation (PLDI) (2016)
- Ryan, G., Wong, J., Yao, J., Gu, R., Jana, S.: CLN2INV: learning loop invariants with continuous logic networks. In: Proceedings of the International Conference on Learning Representations (ICLR) (2020)
- Scarselli, F., Gori, M., Tsoi, A.C., Hagenbuchner, M., Monfardini, G.: The graph neural network model. IEEE Trans. Neural Networks 20(1), 61-80 (2009)
- Sharma, R., Aiken, A.: From invariant checking to invariant inference using ran- domized search. In: Biere, A., Bloem, R. (eds.) CAV 2014. LNCS, vol. 8559, pp. 88-105.
- Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08867-9 6
- Si, X., Dai, H., Raghothaman, M., Naik, M., Song, L.: Learning loop invariants for program verification. In: Proceedings of the Conference on Neural Information Processing Systems (NIPS) (2018)
- Solar-Lezama, A., Tancau, L., Bodik, R., Saraswat, V., Seshia, S.: Combinatorial sketching for finite programs. In: Proceedings of Architectural Support for Pro- gramming Languages and Operating Systems (ASPLOS) (2006)
- Srivastava, S., Gulwani, S., Foster, J.S.: From program verification to program synthesis. In: Proceedings of the ACM Symposium on Principles of Programming Languages (POPL) (2010)
- Sukhbaatar, S., Weston, J., Fergus, R., et al.: End-to-end memory networks. In: Proceedings of the Conference on Neural Information Processing Systems (NIPS) (2015)
- Sutton, R.S., Barto, A.G.: Reinforcement Learning -An Introduction. MIT Press, Adaptive computation and machine learning (1998)
- Tai, K.S., Socher, R., Manning, C.D.: Improved semantic representations from tree- structured long short-term memory networks. In: Proceedings of the Association for Computational Linguistics (ACL) (2015)
- Xu, K., Hu, W., Leskovec, J., Jegelka, S.: How powerful are graph neural net- works? In: Proceedings of the International Conference on Learning Representa- tions (ICLR) (2019)
- Ying, R., et al.: Hierarchical graph representation learning with differentiable pool- ing. In: Proceedings of the Conference on Neural Information Processing Systems (NIPS) (2018)
- Zhu, H., Magill, S., Jagannathan, S.: A data-driven CHC solver. In: Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI) (2018)