Skip to content

Conversation

@kroening
Copy link
Collaborator

@kroening kroening commented Jan 26, 2026

Summary

  • Adds aig_simplify() function that simplifies an AIG given a vector of equivalent node pairs
  • Substitutes equivalent nodes (replacing larger variable numbers with smaller ones to maintain topological order)
  • Handles equivalences with constants
  • Computes transitive closure of equivalences
  • Performs constant propagation (a AND false = false, a AND true = a)
  • Simplifies trivial cases (a AND a = a, a AND !a = false)

Test plan

Unit tests added in unit/trans-netlist/aig_simplifier.cpp that cover empty AIGs, variable-only AIGs, AND nodes, equivalent variables, negated equivalences, constant equivalences, transitive equivalences, multi-level AIGs, and constant propagation

🤖 Generated with Claude Code

@kroening kroening marked this pull request as draft January 26, 2026 19:41
@kroening kroening force-pushed the aig-simplifier-equivalences branch 4 times, most recently from 3724d45 to 6244032 Compare January 27, 2026 20:06
@kroening kroening marked this pull request as ready for review January 27, 2026 20:06
@tautschnig
Copy link
Collaborator

Shouldn't we also use this simplifier (beyond just unit tests)?

@kroening kroening force-pushed the aig-simplifier-equivalences branch 2 times, most recently from 2e96a9b to 5493228 Compare January 29, 2026 00:30
Adds the aig_simplify() function that simplifies an AIG using a given
vector of equivalent node pairs. The function:
- Substitutes equivalent nodes (replacing larger var numbers with smaller)
- Handles equivalences with constants
- Computes transitive closure of equivalences
- Performs constant propagation (a AND false = false, a AND true = a)
- Simplifies trivial cases (a AND a = a, a AND !a = false)
- Basic backward propagation from AND output to inputs

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
@kroening kroening force-pushed the aig-simplifier-equivalences branch from 5493228 to 5897658 Compare January 29, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants