paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Loop Invariant Inference through SMT Solving Enhanced Reinforcement Learning

通过 SMT 求解增强的强化学习推断循环不变式
ISSTA Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis2023匹配度 4/10 · 论文属于 AI 辅助形式化验证中的循环不变式推断,与“AI→PL”方向有交集,但使用的是强化学习而非 LLM/Agent,且不涉及浮点程序分析、贝叶斯程序分析或 ML/Agent 系统的静态分析,因此不匹配用户画像的核心关注点。引用 29 inbox
Shiwen Yu, Ting Wang, Ji Wang
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 RL 剪枝与 SMT 求解协同的框架,在一般非线性假设空间中高效推断循环不变式。

循环不变式推断是程序验证中最困难的问题之一,人们希望引入机器学习来提升推断能力。本文提出一个强化学习(RL)剪枝框架,用于在一般的非线性假设空间上推断循环不变式。其核心思想是让基于 RL 的剪枝与 SMT 求解协同工作,从而高效地生成候选不变式:RL 负责在庞大的假设空间中进行启发式剪枝,SMT 求解器负责判定候选的有效性。针对学习中奖励稀疏的问题,作者设计了一种新颖的二维奖励机制,使 RL 剪枝器能够识别 SMT 求解器的能力边界,并在很少的轮次内学到剪枝启发式。作者基于 Z3 实现了工具 LIPuS,并在线性与非线性基准上进行了大量实验。结果表明,与 Code2Inv、ICE-DT、GSpacer、SymInfer、ImplCheck 和 Eldarica 等当前最先进的循环不变式推断工具相比,LIPuS 能求解最多数目的实例,尤其非线性基准上优势显著。

问题
在程序验证中,循环不变式的自动推断十分困难,尤其在一般非线性假设空间中搜索空间巨大、候选数量爆炸。
方法
将基于强化学习的假设空间剪枝与 SMT 求解相结合,并设计二维奖励机制以缓解稀疏奖励,使 RL 剪枝器快速识别 SMT 求解器的能力边界并学到剪枝启发式。
评估
基于 Z3 实现工具 LIPuS,并在线性与非线性基准上与 Code2Inv、ICE-DT、GSpacer、SymInfer、ImplCheck、Eldarica 等先进工具进行对比实验。
原文摘要(Abstract)

Inferring loop invariants is one of the most challenging problems in program verification. It is highly desired to incorporate machine learning when inferring. This paper presents a Reinforcement Learning (RL) pruning framework to infer loop invariants over a general nonlinear hypothesis space. The key idea is to synergize the RL-based pruning and SMT solving to generate candidate invariants efficiently. To address the sparse reward problem in learning, we design a novel two-dimensional reward mechanism that enables the RL pruner to recognize the capability boundary of SMT solvers and learn the pruning heuristics in a few rounds. We have implemented our approach with Z3 SMT solver in the tool called LIPuS and conducted extensive experiments over the linear and nonlinear benchmarks. Experiment results show that LIPuS can solve the most cases compared to the state-of-the-art loop invariant inference tools such as Code2Inv, ICE-DT, GSpacer, SymInfer, ImplCheck, and Eldarica. Especially, LIPuS outperforms them significantly on nonlinear benchmarks.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{Yu0023,
  title = {Loop Invariant Inference through SMT Solving Enhanced Reinforcement Learning},
  author = {Shiwen Yu and Ting Wang and Ji Wang},
  booktitle = {ISSTA},
  year = {2023},
  doi = {10.1145/3597926.3598047}
}