$ show lsils/mockturtle
mockturtle is a header-only C++17 library for logic network synthesis and optimization. It provides a generic framework for multiple logic network representations (AIG, MIG, XAG, XMG, k-LUT, etc.) and a wide range of algorithms including cut enumeration, rewriting, balancing, resubstitution, decomposition, technology mapping, and equivalence checking. The library uses template metaprogramming and static polymorphism to achieve flexibility and performance, with a decorator pattern for views that add functionality (depth, fanout, mapping) without modifying base networks. Bundled external libraries (kitty, lorina, percy, bill) handle truth tables, file parsing, exact synthesis, and SAT solving. The codebase is well-tested (Catch2) and includes experimental research flows for emerging technologies like AQFP superconducting logic.
The LLM identified 3 files worth highlighting for reuse:
Provides `node_map`, `unordered_node_map`, and `incomplete_node_map` template classes that map network nodes (identified by integer indices) to arbitrary values. Uses `std::vector` with sparse storage and supports range-based iteration over all mapped entries. The implementation handles special node IDs (constant, primary inputs) and integrates with network traversal. This utility is self-contained, depends only on standard C++ and basic network traits, and can be extracted for any project needing efficient node-to-value mapping in a DAG.
A simple cache for Boolean truth tables (from kitty). Stores computed truth tables indexed by a 64-bit hash for fast lookup. Provides insertion and retrieval with optional ownership semantics. The cache is used across many algorithms to avoid recomputing truth tables for identical functions. Could be reused in any project that performs repeated truth table manipulations, requiring only the kitty library.
An RAII timer that records elapsed time using `std::chrono::high_resolution_clock`. Provides `to_seconds()` and `to_milliseconds()` methods. The implementation is minimal, has no internal dependencies, and can be directly copied into any C++ project for performance measurement.