Loop invariant generation method and device based on large language model
By generating and verifying loop invariants using a large language model, the problem of generating complex loop invariants in existing technologies is solved, achieving efficient and automated loop invariant generation and improving the quality of program analysis and verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PEKING UNIV
- Filing Date
- 2026-01-22
- Publication Date
- 2026-06-19
AI Technical Summary
Existing methods for generating loop invariants struggle to handle complex or non-standard loop structures, and learning-based methods rely on large amounts of high-quality labeled data, resulting in insufficient generalization ability and interpretability.
A method based on a large language model is adopted to generate candidate loop invariants. The correctness verification and logical validity check are performed, and the feedback mechanism adjusts the generation strategy to ensure the correctness of the loop invariants.
It enables the efficient and automated generation of high-quality loop invariants, improving the efficiency and accuracy of program analysis and verification.
Smart Images

Figure CN122240443A_ABST