TRANSMISSION // 2604.26578v4
Turning Programs into Graphs for Verification Reuse
Source published
A preprint explores representing code and specifications as graphs to help find reusable verification artefacts across programming languages. Its pipeline is a foundation, not a demonstrated verification-reuse system.

Could a useful program specification or proof from one codebase help with another? This preprint explores a preparatory step: converting programs and their annotations into graph representations, then comparing them with help from language-model embeddings. The results suggest a way to organize code for later reuse, but do not yet show that the approach can reliably transfer proofs or specifications.
Finding a useful specification or proof in an existing codebase can be difficult. Two programs may do similar things while differing in syntax, naming, or programming language; conversely, programs that look alike may behave differently. This paper asks how programs and their formal annotations might be represented so that future tools can search for possible matches across those differences.
The authors’ proposal combines two kinds of information. A program is parsed into a graph: nodes represent elements such as statements or specifications, and edges record relationships between them. The graph is then supplemented with text embeddings—numerical representations generated by models such as SentenceTransformer and CodeBERT. In principle, the graph captures organization while embeddings capture some of the meaning expressed in code and annotations.
The study builds a pipeline around that idea. It starts from a collection of 56 C programs and describes rule-based transformations into other language and specification formats, including C with ACSL annotations, Java with JML, and C# translated into Dafny-oriented programs. The paper reports 168 evaluated instances across three predefined categories of program variants. It uses AST parsing where available, but also relies on regular expressions and pattern-driven extraction in some stages. Graphs are built with Python tools, and program pairs are compared using cosine similarity between embeddings.
The paper’s main result is a feasibility demonstration: its pipeline can produce graph representations containing program structure and specification material across several language and annotation styles. The reported similarity outputs include higher scores for some related or near-duplicate examples and lower scores for some dissimilar ones. These are exploratory observations, not a rigorous demonstration that a high score reliably identifies equivalent behavior, reusable proofs, or correct specifications. The paper does not establish that its system can automatically transfer a verification artefact and preserve its validity.
That distinction matters. Graph construction is not the same as semantic verification. An embedding can make two pieces of text appear similar without showing that their programs behave alike. Likewise, a graph that records syntax and annotations may omit details needed to establish equivalence. The authors themselves note that global embeddings and cosine similarity can flatten richer graph relationships, and that the models were not specifically trained for formal verification.
There are additional limits to the evidence. The dataset is small and derived from a single collection; several language conversions and annotations are generated through rules or heuristics rather than drawn from independently verified, naturally occurring projects. The paper describes specification-generation procedures, but the reported matching results do not independently establish that every generated contract is correct. Parsing and extraction based on regular expressions can also be brittle when code departs from expected patterns. These factors make it difficult to infer how well the approach would work on larger, varied repositories.
The paper’s framing also reaches beyond what it tests. Its long-term goal is reuse of verification artefacts, while the experiments chiefly concern graph construction and embedding-based similarity. Approximate graph matching, adaptation of artefacts, and successful reuse are presented as future work rather than validated outcomes. The manuscript’s descriptions of language coverage are not entirely consistent: the abstract names C with ACSL, Java with JML, and Dafny, while the methods describe C# transformations leading to Dafny programs. That makes the exact scope worth checking against the authors’ repository and any later version.
Overall, this is a preliminary engineering study of how to turn code and specifications into a shared, searchable representation. It offers a plausible starting point for research on cross-language retrieval, but similarity scores should not be treated as evidence of correctness or proof transfer. The source is an arXiv preprint, not a peer-reviewed publication; its claims and implementation should be assessed as work in progress.
- software verification
- program graphs
- formal specifications
- code embeddings
- program analysis
- preprint
Related reading
Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.
Can AI benchmarks keep up with computer-use agents?
Source published
Shared keywords: software verification
Targeted AI repairs improve scientific code translation—but simple tests miss errors
Source published
Shared keywords: software verification
When a frozen AI experiment needs a software repair
Source published
Shared keywords: software verification