ICE-Based Refinement Type Discovery for Higher-Order Functional Programs

被引:18
作者
Champion, Adrien [1 ,2 ]
Chiba, Tomoya [1 ]
Kobayashi, Naoki [1 ]
Sato, Ryosuke [3 ]
机构
[1] Univ Tokyo, Tokyo, Japan
[2] OCamlPro, Paris, France
[3] Kyushu Univ, Fukuoka, Japan
关键词
Higher-order program verification; Machine learning; Formal verification; Refinement types; VERIFICATION; INVARIANTS; INFERENCE;
D O I
10.1007/s10817-020-09571-y
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
We propose a method for automatically finding refinement types of higher-order function programs. Our method is an extension of theIceframework of Garg et al. for finding invariants. In addition to the usual positive and negative samples in machine learning, theirIceframework usesimplication constraints, which consist of pairs (x, y) such that ifxsatisfies an invariant, so doesy. From these constraints,Iceinfersinductiveinvariants effectively. We observe that the implication constraints in the originalIceframework are not suitable for finding invariants of recursive functions with multiple function calls. We thus generalize the implication constraints to those of the form({x(1),...,x(k)},y), which eans that if all of x(1),...x(k) satisfy an invariant, so doesy. We extend their algorithms for inferring likely invariants from samples, verifying the inferred invariants, and generating new samples. We have implemented our method and confirmed its effectiveness through experiments.
引用
收藏
页码:1393 / 1418
页数:26
相关论文
共 38 条
[1]  
Arora S, 2009, COMPUTATIONAL COMPLEXITY: A MODERN APPROACH, P1, DOI 10.1017/CBO9780511804090
[2]   Satisfiability modulo theories [J].
Barrett, Clark ;
Sebastiani, Roberto ;
Seshia, Sanjit A. ;
Tinelli, Cesare .
Frontiers in Artificial Intelligence and Applications, 2009, 185 (01) :825-885
[3]  
Beyer D, 2012, LECT NOTES COMPUT SC, V7214, P504, DOI 10.1007/978-3-642-28756-5_38
[4]   Horn Clause Solvers for Program Verification [J].
Bjorner, Nikolaj ;
Gurfinkel, Arie ;
McMillan, Ken ;
Rybalchenko, Andrey .
FIELDS OF LOGIC AND COMPUTATION II: ESSAYS DEDICATED TO YURI GUREVICH ON THE OCCASION OF HIS 75TH BIRTHDAY, 2015, 9300 :24-51
[5]  
Bradley AR, 2011, LECT NOTES COMPUT SC, V6538, P70, DOI 10.1007/978-3-642-18275-4_7
[6]   HoIce: An ICE-Based Non-linear Horn Clause Solver [J].
Champion, Adrien ;
Kobayashi, Naoki ;
Sato, Ryosuke .
PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2018, 2018, 11275 :146-156
[7]   ICE-Based Refinement Type Discovery for Higher-Order Functional Programs [J].
Champion, Adrien ;
Chiba, Tomoya ;
Kobayashi, Naoki ;
Sato, Ryosuke .
TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, TACAS 2018, PT I, 2018, 10805 :365-384
[8]   The KIND 2 Model Checker [J].
Champion, Adrien ;
Mebsout, Alain ;
Sticksel, Christoph ;
Tinelli, Cesare .
COMPUTER AIDED VERIFICATION: 28TH INTERNATIONAL CONFERENCE, CAV 2016, PT II, 2016, 9780 :510-517
[9]   Solving Horn Clauses on Inductive Data Types Without Induction [J].
De Angelis, Emanuele ;
Fioravanti, Fabio ;
Pettorossi, Alberto ;
Proietti, Maurizio .
THEORY AND PRACTICE OF LOGIC PROGRAMMING, 2018, 18 (3-4) :452-469
[10]   Z3: An efficient SMT solver [J].
de Moura, Leonardo ;
Bjorner, Nikolaj .
TOOLS AND ALGORITHMS FOR THE CONSTRUCTION AND ANALYSIS OF SYSTEMS, 2008, 4963 :337-340