MALICE: Memory-aware Loop Invariants Generation on Symbolic Execution Traces
Tong Chen, Siyu Liu, Hongyi Zhong, liao zhang, Lixiang Wang, Xiwei Wu, Junchi Yan, Qinxiang Cao
Abstract
Automatic loop invariant generation remains a challenging problem in program verification, particularly for memory-manipulating programs where shape invariants are required to characterize heap-allocated structures and memory layouts. While existing approaches succeed on numerical invariants, they achieve limited accuracy on shape invariants. We hypothesize that this stems from the need to reason about memory state evolution—information that remains implicit in source code. To address this, we ground LLM reasoning in symbolic execution traces that explicitly capture such transitions. We propose Malice, a two-stage framework incorporating these traces: (1) guided multi-step reasoning that predicts invariants via chain-of-thought analysis of traces, and (2) agentic iterative refinement that corrects candidates through verification tool feedback. Evaluated on LIG-MM+, a benchmark featuring common operations on typical memory structures, Malice substantially outperforms existing approaches.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
Lineage
- Enchanting Program Specification Synthesis by Large Language Models Using Static Analysis and Program Verification cites Learning nonlinear loop invariants with gated continuous logic networks
- Inductive Synthesis of Inductive Heap Predicates cites Enchanting Program Specification Synthesis by Large Language Models Using Static Analysis and Program Verification
- Clause2Inv: A Generate-Combine-Check Framework for Loop Invariant Inference cites CLN2INV: Learning Loop Invariants with Continuous Logic Networks
- Clause2Inv: A Generate-Combine-Check Framework for Loop Invariant Inference cites Learning nonlinear loop invariants with gated continuous logic networks
- Learning nonlinear loop invariants with gated continuous logic networks cites CLN2INV: Learning Loop Invariants with Continuous Logic Networks
Builds on5
- CLN2INV: Learning Loop Invariants with Continuous Logic NetworksGabriel Ryan, Justin Wong, Jianan Yao, Ronghui Gu et al.ICLR 2020 · 72 citations
- Enchanting Program Specification Synthesis by Large Language Models Using Static Analysis and Program VerificationCheng Wen, Jialun Cao, Jie Su, Zhiwu Xu et al.CAV 2024 · 60 citations
- Clause2Inv: A Generate-Combine-Check Framework for Loop Invariant InferenceWeining Cao, Guangyuan Wu, Tangzhi Xu, Yuan Yao et al.ISSTA 2025 · 2 citations
- Inductive Synthesis of Inductive Heap PredicatesZiyi Yang, Ilya SergeyOOPSLA 2025 · 1 citation
- Learning nonlinear loop invariants with gated continuous logic networksJianan Yao, Gabriel Ryan, Justin Wong, Suman Jana et al.PLDI 2020 · 1 citation
Related papers
- LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant InferenceGuangyuan Wu, Weining Cao, Yuan Yao, Hengfeng Wei et al.ASE 2024 · 9 citations
- Loop Invariant Inference through SMT Solving Enhanced Reinforcement LearningShiwen Yu, Ting Wang, Ji WangISSTA 2023 · 11 citations
- Agentic Concolic ExecutionZhengxiong Luo, Huan Zhao, Dylan Wolff, Cristian Cadar et al.S&P 2026 · 17 citations
- Learning to Synthesize Relational InvariantsJingbo Wang, Chao WangASE 2022 · 9 citations
- Can Large Language Models Reason about Program Invariants?Kexin Pei, David Bieber, Kensen Shi, Charles Sutton et al.ICML 2023 · 128 citations
