Rtl2lean: Automated RTL-to-Lean Translation with Hierarchical Theorem Generation and Lemma Reuse
Hongqin Lyu, Junxing Dong, Yonghao Wang, Zhiteng Chao, Tiancheng Wang, Huawei Li
Abstract
Formal verification with interactive theorem provers can provide strong correctness guarantees for register transfer level designs, but applying it to existing SystemVerilog code requires substantial manual effort in semantic modeling and proof construction. This paper presents Rtl2lean, a framework that automatically translates RTL designs into executable Lean 4 models and builds a hierarchical theorem library for subsequent verification. The generated model represents hardware execution as a pure state transition function, while a four layer theorem framework captures combinational semantics, sequential updates, single cycle behavior, and reachability and invariants. When a high level property cannot be discharged by the existing theorem base, an LLM based proving loop proposes intermediate lemmas from the current proof context and Lean feedback. Only lemmas accepted by the Lean kernel are added to the reusable lemma pool. Experiments on six SystemVerilog designs generate 403 theorems, all of which are successfully checked by Lean. Among 358 foundational lemmas, 287 are available for automatic reuse, yielding a reusable lemma ratio of 80.2 percent. The results demonstrate that Rtl2lean can construct machine checked RTL proof libraries with low checking overhead and substantial cross property lemma reuse.
Create a lesson
Metadata
- Categories
- cs.AR, cs.LO
- Comments
- 6 pages, 2 figures
Related papers
When to Test, Repair, or Regenerate: Decision-Guided Efficient RTL Generation
Shared title terminologycs.ARFeiyang Pan, Shenghe Zheng, Pengfei Xiao et al.
FoldSim: Scaling Cycle-Exact RTL Simulation with Hierarchical Folding and Static Scheduling
Shared title terminologycs.ARChengxuan Wang, Nikhil Rout, Yang-gon Kim et al.
FlashX: Scaling Robotic Experience Reuse for Embodied Agents with CBA-Based NAND Flash
Shared title terminologycs.ARYuseon Choi, Sanghyeon Park, Eunjong Lee et al.
BOOMerang: Autonomous Translation from RTL to Microarchitectural Simulators and Back
Shared title terminologycs.ARFerran Hermida-Rivera, Jack Toubes, Angela Cui et al.
SGLayout: Schema-Guided Closed-Loop Refinement for LLM-Driven Parameterized Layout Generation
Shared title terminologycs.ARSiyang Chen, Yuan Pu, Yuhan Qin et al.
FPGA-GEN: Target-Aware RTL Generation via HLS
Shared title terminologycs.ARLuke Ztz Hu, Zhihan Xiao, Zhe Zhao et al.