一句话:提出类型与区间感知公理生成及ILP预检,加速符号执行中的数组约束求解。
数组约束在符号执行中普遍存在,但精确编码复杂导致求解困难。本文提出将符号执行与数组约束求解协同:先基于整数线性规划进行轻量级不可满足性预检;再针对字节级编码引入大量冗余公理的问题,利用符号执行推断的数组变量类型信息和预检计算的区间信息,生成类型与区间感知公理。作者在KLEE及其底层求解器STP上实现该方法,并在75个真实程序上开展大规模实验。结果显示,在相同时间阈值下,平均多求解182.56%的约束、多探索277.56%的路径,有效提升了符号执行效率。
Array constraints are prevalent in analyzing a program with symbolic execution. Solving array constraints is challenging due to the complexity of the precise encoding for arrays. In this work, we propose to synergize symbolic execution and array constraint solving. Our method addresses the difficulties in solving array constraints with novel ideas. First, we propose a lightweight method for pre-checking the unsatisfiability of array constraints based on integer linear programming. Second, observing that encoding arrays at the byte-level introduces many redundant axioms that reduce the effectiveness of constraint solving, we propose type and interval aware axiom generation. Note that the type information of array variables is inferred by symbolic execution, whereas interval information is calculated through the above pre-checking step. We have implemented our methods based on KLEE and its underlying constraint solver STP and conducted large-scale experiments on 75 real-world programs. The experimental results show that our method effectively improves the efficiency of symbolic execution. Our method solves 182.56% more constraints and explores 277.56% more paths on average under the same time threshold.