Papers
Topics
Authors
Recent
Search
2000 character limit reached

Modular Horner Expansion Diagrams (M-HED)

Updated 12 November 2025
  • Modular Horner Expansion Diagrams (M-HED) are graph-based, canonical representations of integer-valued functions over Z_m that incorporate modular arithmetic for efficient datapath verification.
  • They employ reduction rules like eliminating redundant nodes and merging isomorphic nodes to create compact diagrams that support swift arithmetic operations and structural matching.
  • The iterative, segment-based equivalence checking approach of M-HED significantly improves memory usage and runtime performance in verifying complex, pipelined, and nested designs.

A Modular Horner Expansion Diagram (M-HED) is a canonical, compact, and graph-based representation of integer-valued functions of word-level variables over the finite ring Zm\mathbb{Z}_m, where mm is typically 2N2^N for NN-bit datapaths. M-HED extends the Horner Expansion Diagram (HED) by incorporating modular arithmetic, enabling equivalence reasoning for datapath designs, even in the presence of complex pipelining and nested loop behaviors. This construction plays a central role in scalable formal equivalence checking by reducing polynomial functions modulo mm and enforcing reduction rules to maintain a canonical form that efficiently supports arithmetic operations and structural matching.

1. Formal Definition and Structure

The M-HED represents a function F(X1,,Xk)F(X_1,\ldots,X_k) over ordered word-level variables Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\} as a directed acyclic graph G=(V,E)G = (V, E). Each nonterminal node vVv \in V is labeled with:

  • var(v)Varvar(v)\in Var (the variable associated with the expansion),
  • Two outgoing edges mm0 carrying weights mm1,
  • mm2 points to the "0" child (mm3), mm4 to the "1" child (mm5).

Two distinguished terminal nodes ("0" and "1") represent mm6, often merged if mm7. The semantics of a node mm8 are:

mm9

Every M-HED is reduced to canonical form by:

  • Eliminate Redundant Node: If 2N2^N0, 2N2^N1 is replaced by its 0^ child, and 2N2^N2 is multiplied into its incoming weights.
  • Merge Isomorphic Nodes: Nodes 2N2^N3 with identical variable, child pointers (after normalization), and weights are merged.

Through bottom-up application of these rules, the reduced M-HED is unique for each polynomial in 2N2^N4.

2. Horner Expansion and Arithmetic in M-HEDs

Expansion in one variable 2N2^N5 follows:

2N2^N6

For multivariate polynomials, this expansion recurses on the highest-ordered variable. Arithmetic on HEDs is structured by variable alignment and node type, summarized as follows:

Terminals Terminal 2N2^N7 Nonterminal Both Nonterminals
Addition 2N2^N8 new terminal Add value 2N2^N9 into NN0's NN1 ("const" branch) Decompose around top variable NN2, combine
Multiplication NN3 new terminal Multiply NN4's NN5 by NN6 recursively Decompose, cross-product four terms

Boolean bitwise ops are encoded as follows over NN7:

  • NN8
  • NN9
  • mm0

Bitwise shifts correspond to scalar multiplication or division by powers of two, modulo mm1.

3. Construction from Arithmetic or RTL Descriptions

An M-HED is constructed from single-assignment statements produced via symbolic simulation of either high-level C/SystemC or behavioral-synthesized RTL. The standard construction proceeds as follows:

  1. Initialization: Set up a hash table ("nodeCache") for memoization.
  2. Traversal: For each assignment mm2:
    • Recursively traverse mm3.
    • Map leaf variables/0s to terminals.
    • For operators (+, –, ·, mm4, mm5, mm6, mm7, mm8), invoke the appropriate three-way case logic, record and reduce via Rules 1–2, and cache.
    • The traversal yields an M-HED root node for each output variable.
  3. Efficiency: Shared subgraphs represent common subexpressions, minimizing redundancy.
  4. Edge Weights: All operations are over mm9; reductions through vanishing polynomials ensure weights F(X1,,Xk)F(X_1,\ldots,X_k)0.

As a result, every datapath expression, regardless of complexity, is mapped to a unique, minimized M-HED in F(X1,,Xk)F(X_1,\ldots,X_k)1.

4. Segment-Based Equivalence Checking with M-HED

Equivalence checking leverages M-HED by partitioning designs into segments based on dynamic cut-points, thus maintaining resource scalability. The approach involves:

  • Symbolic simulation produces flattened assignment lists for the high-level reference (LAASC) and pipelined RTL (LAPRTL).
  • Each iteration extracts segments of F(X1,,Xk)F(X_1,\ldots,X_k)2 lines and maps them to M-HEDs.
  • Equivalence checking between M-HEDs of the current segments proceeds via pointer equality of their root nodes—indicative of exact polynomial equivalence modulo F(X1,,Xk)F(X_1,\ldots,X_k)3.
  • Matching outputs are removed along with all purely local nodes feeding them, replaced by "trusted" primary inputs. Remaining segments are updated accordingly.
  • If equivalence is blocked, "internal equivalence" is tested by making internal nodes output roots and matching again.
  • Iteration continues until all outputs are matched or a non-equivalence is established.

This iterative reduction ensures that at every stage, only a midsize M-HED need be maintained. Equivalence is reduced to trivial pointer comparisons, circumventing combinatorial explosion typical in nested, pipelined loop verification.

5. Illustrative Example

Consider an unrolled loop body in C:

G=(V,E)G = (V, E)5

Symbolic unrolling for F(X1,,Xk)F(X_1,\ldots,X_k)4 yields assignments:

G=(V,E)G = (V, E)6

Under F(X1,,Xk)F(X_1,\ldots,X_k)5:

  • F(X1,,Xk)F(X_1,\ldots,X_k)6: F(X1,,Xk)F(X_1,\ldots,X_k)7 node with F(X1,,Xk)F(X_1,\ldots,X_k)8, F(X1,,Xk)F(X_1,\ldots,X_k)9, Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}0.
  • Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}1: Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}2 node with Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}3, Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}4, Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}5.
  • Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}6: Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}7 is recursively combined and reduced, representing Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}8 modulo Var={X1<X2<<Xk}Var = \{X_1 < X_2 < \cdots < X_k\}9.

The root nodes of M-HEDs for two equivalent segments from different descriptions (e.g., C and RTL) will be pointer-identical if and only if the functions are equivalent modulo G=(V,E)G = (V, E)0, including any vanishing polynomial factors.

6. Properties, Advantages, and Scalability

  • M-HED extends HEDs with modular arithmetic, ensuring that expressions differing only by a multiple of G=(V,E)G = (V, E)1 reduce to the same canonical graph in G=(V,E)G = (V, E)2.
  • Shared subgraphs enable compact encoding of very large expressions.
  • Segment-based reduction and the iterative scheme allow verification to scale to complex, pipelined, and nested loops.
  • Empirical results show an average of G=(V,E)G = (V, E)3 memory reduction and G=(V,E)G = (V, E)4 runtime improvement compared to SMT- and SAT-based equivalence checking in large synthesized designs.
  • Equivalence checking is reduced to a pointer equality test, in contrast to symbolic simulation or SAT-solving, which typically scale poorly.
  • This methodology accommodates the verification of behaviorally synthesized designs, avoiding the state-space blow-up that can result from direct input/output symbolic comparison.

This suggests that M-HED-based equivalence checking enables formal methods to scale in application areas that are otherwise intractable for classical combinational equivalence or bit-level model checking approaches.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Modular Horner Expansion Diagrams (M-HED).