Table of Contents
Fetching ...

Functional Matching of Logic Subgraphs: Beyond Structural Isomorphism

Ziyang Zheng, Kezhi Li, Zhengyuan Shi, Qiang Xu

TL;DR

This work defines functional subgraph matching to identify logic functions embedded in larger circuits despite synthesis-induced structural changes. It proposes a two-stage, multi-modal framework that (1) learns function-invariant embeddings across AIG and post-mapping nets to detect functional subgraphs and (2) formulates fuzzy boundary identification as graph segmentation for precise localization. Empirical results on ITC99, OpenABCD, and ForgeEDA show substantial gains over structure-based methods, with an average functional-subgraph detection accuracy of $93.8\%$ and boundary Dice score of $91.3\%$, highlighting the approach's potential for robust logic pattern discovery in transformed designs. The method advances EDA applications in optimization, verification, and security by enabling function-centric querying across design stages, improving cross-stage analysis and reliability in circuit engineering.

Abstract

Subgraph matching in logic circuits is foundational for numerous Electronic Design Automation (EDA) applications, including datapath optimization, arithmetic verification, and hardware trojan detection. However, existing techniques rely primarily on structural graph isomorphism and thus fail to identify function-related subgraphs when synthesis transformations substantially alter circuit topology. To overcome this critical limitation, we introduce the concept of functional subgraph matching, a novel approach that identifies whether a given logic function is implicitly present within a larger circuit, irrespective of structural variations induced by synthesis or technology mapping. Specifically, we propose a two-stage multi-modal framework: (1) learning robust functional embeddings across AIG and post-mapping netlists for functional subgraph detection, and (2) identifying fuzzy boundaries using a graph segmentation approach. Evaluations on standard benchmarks (ITC99, OpenABCD, ForgeEDA) demonstrate significant performance improvements over existing structural methods, with average $93.8\%$ accuracy in functional subgraph detection and a dice score of $91.3\%$ in fuzzy boundary identification. The source code and implementation details can be found at https://github.com/zyzheng17/Functional_Subgraph_Matching-Neurips25.

Functional Matching of Logic Subgraphs: Beyond Structural Isomorphism

TL;DR

This work defines functional subgraph matching to identify logic functions embedded in larger circuits despite synthesis-induced structural changes. It proposes a two-stage, multi-modal framework that (1) learns function-invariant embeddings across AIG and post-mapping nets to detect functional subgraphs and (2) formulates fuzzy boundary identification as graph segmentation for precise localization. Empirical results on ITC99, OpenABCD, and ForgeEDA show substantial gains over structure-based methods, with an average functional-subgraph detection accuracy of and boundary Dice score of , highlighting the approach's potential for robust logic pattern discovery in transformed designs. The method advances EDA applications in optimization, verification, and security by enabling function-centric querying across design stages, improving cross-stage analysis and reliability in circuit engineering.

Abstract

Subgraph matching in logic circuits is foundational for numerous Electronic Design Automation (EDA) applications, including datapath optimization, arithmetic verification, and hardware trojan detection. However, existing techniques rely primarily on structural graph isomorphism and thus fail to identify function-related subgraphs when synthesis transformations substantially alter circuit topology. To overcome this critical limitation, we introduce the concept of functional subgraph matching, a novel approach that identifies whether a given logic function is implicitly present within a larger circuit, irrespective of structural variations induced by synthesis or technology mapping. Specifically, we propose a two-stage multi-modal framework: (1) learning robust functional embeddings across AIG and post-mapping netlists for functional subgraph detection, and (2) identifying fuzzy boundaries using a graph segmentation approach. Evaluations on standard benchmarks (ITC99, OpenABCD, ForgeEDA) demonstrate significant performance improvements over existing structural methods, with average accuracy in functional subgraph detection and a dice score of in fuzzy boundary identification. The source code and implementation details can be found at https://github.com/zyzheng17/Functional_Subgraph_Matching-Neurips25.

Paper Structure

This paper contains 41 sections, 6 theorems, 24 equations, 3 figures, 10 tables, 1 algorithm.

Key Result

Proposition 1

If a graph $\mathcal{Q}$ is an equivalent subgraph of $\mathcal{G}$, then $\mathcal{Q}$ is a functional subgraph of $\mathcal{G}$.

Figures (3)

  • Figure 1: We present the query and candidate graphs. Above: 1-bit adder and multiplier. Below: AIG netlist. The query $b+c$ is explicitly contained within the candidate $(b+c) \times a$, making it straightforward to identify the exact subgraph in the candidate. In contrast, the query $b+c$ is implicitly contained within the candidate $a \times b + a \times c$, which implies no subgraph of $a \times b + a \times c$ has the same structure or function as the query graph.
  • Figure 2: The pipeline of Stage #1. Left: Our data processing pipeline. For a given $\mathcal{G}_{aig}$, we first randomly extract a subgraph $\mathcal{G}_{sub}$. Then, we obtain $\mathcal{G}_{syn}$ and $\mathcal{G}_{pm}$ through synthesis and mapping, respectively. Right: Our training pipeline via intra-modal and inter-modal alignments for functional subgraph detection. We first encode the query and target graphs using their respective encoders. Next, we perform intra-modal and inter-modal alignment on the target graph to obtain function-invariant and structure-agnostic embeddings. These embeddings are then sent to a task head to determine whether the query graph is contained within the target graph.
  • Figure 3: The pipeline of Stage #2. Left: Our data processing pipeline. For a given $\mathcal{G}_{pm}$, we replace each node in $\mathcal{G}_{pm}$ with the AIG implementation according to the functionality in the library. Then, we randomly sample a subgraph $\mathcal{G}_{sub}$ from $\mathcal{G}_{aig}$. Finally, we annotate the nodes in $\mathcal{G}_{pm}$ if one of the corresponding AIG nodes still exist in $\mathcal{G}_{sub}$. Right: Our training pipeline for fuzzy boundary identification via graph segmentation. Given the query graph $\mathcal{G}_{sub}$ and the target graph $\mathcal{G}_{pm}$, we first use $Enc_{aig}$ to obtain the graph embedding of $\mathcal{G}_{sub}$ and $Enc_{pm}$ to obtain the node embeddings of $\mathcal{G}_{pm}$. These embeddings are then concatenated and passed to a task head to determine whether a node in $\mathcal{G}_{pm}$ lies within the fuzzy boundary of $\mathcal{G}_{sub}$.

Theorems & Definitions (15)

  • Definition 1: Subgraph Isomorphism
  • Definition 2: Subgraph Equivalence
  • Definition 3: Functional Subgraph
  • Proposition 1
  • Definition 4: Fuzzy Boundary
  • Proposition 2
  • proof
  • Proposition 3: Reflexivity
  • proof
  • Proposition 4: Functional Equivalence Preservation
  • ...and 5 more