Abstract
The automated synthesis of correct-by-construction Boolean functions from logical specifications is known as the Boolean Functional Synthesis (BFS) problem. BFS has many application areas that range from software engineering to circuit design. In this paper, we introduce a tool BNSynth, that is the first to solve the BFS problem under a given bound on the solution space. Bounding the solution space induces the synthesis of smaller functions that benefit resource-constrained areas such as circuit design. BNSynth uses a counter-example guided, neural approach to solve the bounded BFS problem. Initial results show promise in synthesizing smaller solutions; we observe at least 3.2X (and up to 24X) improvement in the reduction of solution size on average, as compared to state-of-the-art tools on our benchmarks. BNSynth is available on GitHub under an open-source license.
Introduction
Boolean Functional Synthesis (BFS) is the task of automatically generating a Boolean function $F(X)$ that satisfies a given logical specification $H(X, Y)$, where $X$ represents inputs and $Y$ represents outputs. This capability is vital for automated reasoning, software engineering, and particularly circuit repair, where engineers must often "patch" logic errors within the strict physical constraints of a chip's programmable logic, such as Look-Up Tables (LUTs).
A significant limitation of current state-of-the-art BFS tools, like Manthan, is their tendency to produce "bloated" formulas. These tools focus on finding any valid solution, often resulting in massive expressions that are impractical for hardware implementations where space and power are at a premium. Until now, there has been no mechanism to enforce a specific size bound on the synthesized logic.
The Bounded BFS Problem
To address the need for efficiency, we introduce the Bounded Boolean Functional Synthesis (B-BFS) problem. In B-BFS, the synthesizer is tasked with finding a valid function that fits within a user-defined bound $K$, typically representing the number of clauses in a Conjunctive Normal Form (CNF) expression. This constraint forces the tool to find the most compact representation possible.
Methodology: The BNSynth Architecture
BNSynth bridges the gap between discrete Boolean logic and continuous neural optimization by combining Gated Continuous Logic Networks (GCLNs) with a formal verification loop.
Gated Continuous Logic Networks (GCLN)
Traditional neural networks struggle with logic because Boolean operations are discrete and non-differentiable. BNSynth utilizes GCLNs, which employ "fuzzy logic" operators (t-norms and t-conorms) as activation functions. This makes the logic continuous and differentiable, enabling the network to learn the structure of a Boolean formula via standard gradient descent. By fixing the number of gates in the GCLN architecture to the bound $K$, the tool is structurally forced to adhere to the size constraint.
The Synthesis Loop
BNSynth operates through a Counter-Example Guided Inductive Synthesis (CEGIS) loop:
- Sampling: A weighted sampler identifies initial points that satisfy the specification.
- Training: The GCLN learns a candidate formula that fits these samples while staying within the bound $K$.
- Verification: A SAT solver checks the candidate formula against all possible inputs.
- Refinement: If the solver finds a "counter-example" (an input where the formula fails), that point is added to the training set, and the network retrains.
Experimental Evaluation
We evaluated BNSynth against Manthan using custom benchmarks (adders, multiplexers, XOR/XNOR configurations) and standard benchmarks from the EPFL and ISCAS85 suites.
Key Results
BNSynth significantly outperformed the baseline in terms of formula conciseness:
- Custom Benchmarks: Achieved an average 24.2X improvement in clause count and a 35.1X improvement in literal count.
- Standard Benchmarks: Showed a 3.2X improvement in clauses and a 4.2X improvement in literal count.
- Input Sparsity: BNSynth frequently discovered that specifications could be met using fewer input variables than provided, leading to even simpler hardware wiring.
While the iterative training and verification loop makes BNSynth slower than non-bounded tools, the trade-off is a much higher quality, resource-efficient output.
Conclusion
BNSynth is the first tool to successfully address the Bounded BFS problem, offering a powerful solution for resource-constrained logic synthesis. By integrating differentiable logic with formal methods, it provides a path toward more efficient automated hardware design and repair. Future work will focus on enhancing the scalability of the neural architecture to handle larger industrial specifications.
Summary updated