FormalWeaver: Dependency-Aware Translation of Formal Repositories at Scale
cs.LG, cs.AI, cs.PL
Submitted: 2026-11-30
Updated: 2026-11-30
License: http://creativecommons.org/licenses/by-nc-nd/4.0/
The gist: AI agents are increasingly capable of generating formal code and proofs under given specifications, but repository construction requires coherence of specifications and proofs across dependencies…
Abstract
AI agents are increasingly capable of generating formal code and proofs under given specifications, but repository construction requires coherence of specifications and proofs across dependencies, beyond isolated theorem completion. Existing evaluations largely focus on declaration-level success and therefore do not directly measure whether an agent can preserve source coverage, specification semantics, and proof correctness together while growing an integrated repository. We study this gap through formal repository translation, where the task is to translate formal source repositories into another formal language. We introduce FormalWeaver, a source-grounded pipeline that translates dependency-ready items against frozen upstream representations and interfaces, with compiler-guided repair scoped to the current item. Applied to Flocq, a Coq library for floating-point reasoning, the pipeline produces FloatSpec, a Lean port with 58 core files, 5,075 indexed items, and 194,704 lines of Lean code. We further conduct controlled experiments comparing FormalWeaver with different translation strategies on submodules of the Flocq translation task. We evaluate two aspects in sequence: whether a translation compiles and, for those that compile, whether it is semantically aligned with the source. Their conjunction defines translation accuracy. The results show that FormalWeaver substantially improves translation accuracy over simpler translation strategies.
Related papers
- Biologically Inspired Coordination of Parameter Selection and Update Strength for Language Model Adaptation
- Sketching for First Order Method: Efficient Algorithm for Low-Bandwidth Channel and Vulnerability
- The WMDP Benchmark: Measuring and Reducing Malicious Use With Unlearning
- On the notion of missingness for path attribution explainability methods in medical settings: Guiding the selection of medically meaningful baselines
- Variable-Length Generative Protein Design via Generalized Poisson Flow
- UniCon: Unified Framework for Efficient Contrastive Alignment via Kernels