Graph Construction and Matching for Imperative Programs using Neural and Structural Methods

arXiv cs.AI / 4/30/2026

💬 OpinionDeveloper Stack & InfrastructureIdeas & Deep AnalysisModels & Research

Key Points

  • The paper proposes a pipeline that turns imperative programs and their formal annotations into typed, attributed graphs to support reuse of verification artifacts.
  • It builds graphs by combining abstract syntax tree (AST) parsing with semantic embeddings from models such as SentenceTransformer and CodeBERT.
  • Experiments on C (ACSL), Java (JML), and Dafny for C# show that consistent graph representations can be produced across different programming languages and annotation styles.
  • The authors position the approach as a practical foundation for later semantic enrichment and approximate graph matching to enable scalable verification-artifact reuse.

Abstract

Reusing verification artefacts requires identifying structural and semantic similarities across programs and their specifications. In this paper, we focus on graph construction as a foundational step toward this goal. We present a pipeline that converts imperative programs and their annotations into typed, attributed graphs. Our experiments cover datasets including C with ACSL, Java with JML, and Dafny for C\#. The pipeline integrates abstract syntax tree parsing with semantic embeddings derived from models such as SentenceTransformer and CodeBERT. This enables the generation of graph representations that capture both structural relationships and semantic context. Our results show that consistent graph representations can be constructed across different languages and annotation styles. This work provides a practical basis for future steps in semantic enrichment and approximate graph matching for scalable verification artefact reuse.