Parallel Algorithm Decomposing
Parallel Algorithm Decomposing
Victor Kondratiev(B)[0000−0003−0356−5149] ,
Irina Gribanova[0000−0001−7155−4455] , and
Alexander Semenov[0000−0001−6172−4801]
vikseko@[Link]
1 Introduction
Digital circuits form the foundation of the modern world, from microprocessors
to specialized electronics (e.g., FPGA, ASIC). As a mathematical model of com-
binational digital circuits, Boolean circuits are particularly convenient because
they capture most logical and structural properties. They enable the study of
mathematical and combinatorial characteristics of digital circuits and facilitate
the development of testing and verification algorithms. Due to the high com-
plexity of modern circuits, they are typically designed using specialized tools in
the field of electronic design automation (EDA).
The Logical Equivalence Checking (LEC) problem [31] is critically impor-
tant in EDA. Modern EDA tools typically employ complete SAT solvers [5] to
address LEC. The applications of SAT solvers have expanded significantly over
the past 25 years, particularly since the introduction of the conflict-driven clause
learning (CDCL) algorithm [26–28]. Today, CDCL-based SAT solvers are widely
used in verification and software analysis [3, 23], cryptography [1, 39, 40], plan-
ning [33], combinatorics [48], and as sub-engines in solvers from satisfiability
modulo theories (SMT) [32].
2 V. Kondratiev et al.
However, reducing LEC to SAT often produces instances that are extremely
challenging for state-of-the-art SAT solvers, motivating the development of parallel-
solving methods. Several strategies exist for parallel SAT solving. In this paper,
we employ the partitioning strategy [19], specifically a variant tailored to SAT
instances derived from Boolean circuits.
The main contributions of our work are as follows:
2 Preliminaries
Boolean circuits are directed graphs that specify discrete functions of the form
f : {0, 1}n → {0, 1}m . Let Gf be such a graph with a set of vertices V and a set
of arcs A. The set V contains two subsets: (1) a set of n parentless vertices called
the circuit inputs, and (2) a set of m vertices called the circuit outputs. Each
vertex that does not belong to the set of inputs is associated with an element of
a complete basis [44], representing an elementary Boolean function. These basis
elements are called gates. If the basis {¬, ∧} is used, the resulting graph is called
an And-Inverter Graph (AIG) [24]. We refer to Gf , labeled in this way, as a
Boolean circuit and denote it by Sf .
Given an input vector α ∈ {0, 1}n , the interpretation of Sf on α is the
sequence of computations of the elementary Boolean functions at each gate. The
output of this interpretation is the vector formed by the values at the output
gates. Thus, Sf defines a total function f : {0, 1}n → {0, 1}m .
One of the central problems in EDA is Logical Equivalence Checking (LEC),
which verifies whether two Boolean circuits Sf and Sg specify the same function,
i.e., whether f ∼= g (point-wise equivalence).
The standard approach to LEC involves SAT solvers. Recall that the Boolean
satisfiability problem (SAT) asks whether a given Boolean formula is satisfiable.
An assignment is any set of values for the variables in the formula. A formula
Efficient Parallel CircuitSAT Decomposition 3
Assume |X| = k; the set of all assignments to X then forms a Boolean hypercube
{0, 1}k . For an arbitrary subset B ⊆ X, the assignments to B similarly form a
hypercube {0, 1}|B| .
For an arbitrary subset B ⊆ X and assignment β ∈ {0, 1}|B| , the substitution
of β into formula C is performed in the standard way (see, e.g., [6]). The resulting
formula is denoted by C[β/B]. For any B ⊆ X, we associate the set of 2|B|
possible formulas of the form C[β/B], where β ∈ {0, 1}|B| .
Let tA (C) denote the runtime of SAT solver A on formula C. Following [37],
we define the decomposition hardness of C with respect to algorithm A and
decomposition set B as
X
µA,B (C) = tA (C[β/B]). (1)
β∈{0,1}|B|
Both (1) and (2) serve as upper bounds on the hardness of C, since there
exists an algorithm that solves SAT for C by applying a complete SAT solver to
all formulas C[β/B]. The computation of (2) can be approached using black-box
optimization algorithms. We emphasize that the set {C[β/B] | β ∈ {0, 1}|B| }
can be processed in parallel.
This approach has proven effective in several cases, enabling, for example,
the construction of non-trivial attacks on certain cryptographic functions (see
[35]). However, for hard LEC instances, more specialized constructions often
yield better results. We present one such construction in the next section.
The concept of SAT partitioning was introduced in [20] (see also [19]).
The construction that divides C into formulas of the form C[β/B] for some
B ⊆ X trivially yields a SAT partitioning of C. Below, we employ an alternative
partitioning construction from [8], specifically designed for CircuitSAT problems.
Consider a CircuitSAT problem, which could represent either an LEC prob-
lem or an inversion problem for a function f : {0, 1}n → {0, 1}m implemented
by a circuit Sf . Given γ ∈ Range(f ) ⊆ {0, 1}m , the inversion problem requires
finding α ∈ {0, 1}n such that f (α) = γ.
Let C be the CNF encoding this CircuitSAT problem, which we refer to
as the associated CNF. Let X denote the set of variables in C, and let X in =
{x1 , . . . , xn } be the subset of X corresponding to inputs of circuit Sf . We in-
in
terpret each assignment α ∈ {0, 1}|X | as the coefficients of a binary number in
n
N0 = {0, . . . , 2 − 1}, establishing a bijection ϕ : {0, 1}n → N0n .
n
– SAT (C is satisfiable);
– UNSAT (C is unsatisfiable);
– INDET (satisfiability cannot be determined within time t).
The time limit t can be expressed either as physical time (in seconds) or as
the number of elementary operations performed by the solver. For CDCL SAT
solvers, it is convenient to limit the runtime by the number of conflicts [26].
The algorithm involves several parameters. The first parameter, q, represents
the size of the initial interval partitioning. At the initial step, a complete interval
system Rn consisting of q intervals is constructed. We denote this system by
Rn0 = {I1 , . . . , Iq }. Each interval Ij , j ∈ {1, . . . , q}, is associated with its CNF
encoding C0j . The value of q is selected based on the computing environment’s
capabilities; for example, q may equal the number of available computing cores
to which the formulas C0j , j ∈ {1, . . . , q}, are distributed.
For each j ∈ {1, . . . , q}, the SAT solver At is applied to the formula C ∧ C0j .
If At (C ∧ C0j ) returns INDET, then C0j encodes an interval Ij ∈ Rn0 that can
be divided into smaller intervals. For simplicity, we assume each subsequent
partition splits into at most d intervals, where d is another pre-specified algorithm
parameter.
The process terminates in one of two cases:
1. When At finds a satisfying assignment for some CNF C(I) encoding inter-
val I.
2. When the unsatisfiability of C ∧ C(I) for every interval I generated during
the algorithm’s execution was proved.
Our goal is to prove that under certain general conditions on At , the described
procedure will find a satisfying assignment for satisfiable CNF C and construct
a finite tree with ⊥-labeled leaves for unsatisfiable C. We preface this result with
the following lemma.
Lemma 1. Consider a Boolean circuit Sf specifying a total function f : {0, 1}n →
{0, 1}m , and let Cf be its template CNF in the sense of [38]. Let X denote the
variables in Cf , with X in = {x1 , . . . , xn } being the variables from X associated
with the inputs of Sf . For any input α = (α1 , . . . , αn ) ∈ {0, 1}n , consider the
CNF
xα αn
1 ∧ · · · ∧ xn ∧ Cf .
1
(4)
Applying only the Unit Propagation rule [26] to (4) derives values for all vari-
ables in X (as literals) without conflicts. For variables y1 , . . . , ym associated
with outputs of Sf , this yields y1 = γ1 , . . . , ym = γm , where f (α) = γ and
γ = (γ1 , . . . , γm ).
This lemma is well-known and appears in several contemporaneous works [2,
21,36]. Its validity follows directly from the properties of Tseitin transformations.
We now prove the completeness of the tree construction algorithm for T (C)
described above.
8 V. Kondratiev et al.
Algorithm 2: SplitInterval
Input: current level lcurrent , maximum level lmax , splitting factor d, array
solvelevels
Output: number of new intervals dcurrent
1: if solvelevels is not empty then
2: lavg ← ⌊Average(solvelevels)⌋
3: dcurrent ← dlavg −lcurrent
4: lnew ← lavg
5: else
6: if lmax > lcurrent then
7: dcurrent ← dlmax −lcurrent
8: lnew ← lmax
9: else
10: dcurrent ← d
11: lnew ← lcurrent + 1
1. If |solvelevels| > 0 and lcurrent < lavg , then dcurrent = dlavg −lcurrent . This
enables reaching levels with higher solution probability while minimally in-
creasing queue size.
2. Else, if lcurrent < lmax , then dcurrent = dlmax −lcurrent , immediately adapting to
the current maximum tree depth.
3. Else, if lcurrent = lmax , then dcurrent = d and lmax is incremented by 1.
5 Computational Experiments
5.1 Benchmarks
We evaluated our approach on two benchmark classes. The first class comprises
Logical Equivalence Checking (LEC) instances for algorithms that sort k natu-
ral numbers represented by l-bit vectors. Specifically, we examined the following
sorting algorithms: bubble sort, selection sort [10], and pancake sort [15]. The
corresponding tests are denoted as BvSk,l (Bubble versus Selection), BvPk,l (Bub-
ble versus Pancake), and PvSk,l (Pancake versus Selection) LEC problems.
The second benchmark class consists of CNF formulas encoding preimage
attacks on the MD4 cryptographic hash function. We focus on attacks against
a step-reduced variant of MD4’s compression function. MD4 [34], one of the
earliest practical cryptographic hash algorithms, uses the Merkle–Damgård con-
struction [11, 30]. While vulnerable to collision attacks [43] and now considered
obsolete, no practical preimage attack exists even for its compression function.
The best known attack [25] requires 296 function calls, making it impractical.
Realistic attacks target the compression function with reduced steps. The
original 48-step algorithm’s variants are denoted MD4-k (k ≤ 48). The first suc-
cessful attack on MD4-32 appeared in [13]. Later, attacks for k ≤ 39 achievable
on personal computers were published in [12, 17]. To our knowledge, the largest
tractable variant is MD4-43, with attacks described in [8, 46, 47]. We apply our
Section 4 algorithm to improve upon [8]’s results.
Number Max.
CPU Wall-clock CPU/wall
Instance q d t of reached
time (s) time (s) ratio
INDETs level
BvP11,3 1000 3 500 25 2 332 392 9698 34.2
BvP17,2 1000 3 500 922 3 1 333 851 38 523 34.6
PvS9,4 1000 3 500 1548 3 2 000 801 57 649 34.7
PvS14,2 1000 3 500 0 1 73 971 2170 34.0
PvS11,3 1000 3 500 1251 3 1 723 511 49 553 34.7
Number Max.
CPU Wall-clock CPU/wall
Instance q d t of reached
time (s) time (s) ratio
INDETs level
BvP12,3 1000 3 500 2858 4 4 862 491 27 771 175.0
BvS13,3 1000 3 500 2106 5 8 478 171 48 015 176.5
which our algorithm successfully solved using one cluster node (36 cores). Table 1
presents the results.
Let us analyze the table contents. All experiments began with q = 1000 ini-
tial partitions, constructed using the interval division scheme from [8], enabling
the division of any interval of length greater than 1 (in the sense of the defini-
tion given in Section 3) into equal intervals of smaller length. The parameter d
determines how many subintervals to create when splitting an interval, while t
specifies the time limit (in seconds) for the SAT solver (Kissat 4.0.1) to solve
one task at each decomposition level.
The instances in Table 1 exceeded the 100 000-second limit on a single Intel
E5-2695 core. The table columns show
For the second experiment series, we addressed harder LEC instances unsolv-
able within 100 000 seconds on one node, utilizing five cluster nodes (180 cores).
Table 2 presents these results.
Efficient Parallel CircuitSAT Decomposition 13
The third experiment series addressed inversion problems for MD4-k cryp-
tographic hash functions (described previously). We examined MD4-k for k ∈
{40, 41, 42, 43}, targeting the inversion of the hash 1128 (a 128-bit vector of ones).
Initial parameters q and t were chosen similar to those in [8] for MD4-40 and
MD4-43 inversions.
Notably, the algorithm continued processing intervals even after finding sat-
isfying assignments, stopping only when queue Q emptied and all subtasks were
completed. This ensured a fair comparison with results from [8]. Table 3 presents
these findings.
The “CnC wall-clock time” column shows results from the Cube-and-Conquer
strategy [18] with default settings. We generated cubes using march cu1 and
solved them with Kissat 4.0.1. For MD4-40, march cu failed to construct cubes
within 100 000 seconds. For MD4-41 and MD4-42, solving exceeded 300 000 sec-
onds without finding solutions. MD4-43 required 264 039 seconds to find a sat-
isfying assignment.
Our algorithm demonstrated superior performance over both [8] and default
Cube-and-Conquer for MD4-40 through MD4-43 inversion problems.
Acknowledgments.
This research was financially supported by the Ministry of Education and Science
of the Russian Federation (State Registration № 121041300065-9).
We thank Stepan Kochemazov for his advice, which helped us improve the
presentation of the manuscript.
References
16. Gladush, A., Gribanova, I., Kondratiev, V., Pavlenko, A., Semenov, A.: Measuring
the effectiveness of sat-based guess-and-determine attacks in algebraic cryptanaly-
sis. In: L. Sokolinsky, M. Zymbler (eds.) Parallel Computational Technologies, pp.
143–157. Springer International Publishing, Cham (2022)
17. Gribanova, I., Semenov, A.A.: Using automatic generation of relaxation constraints
to improve the preimage attack on 39-step MD4. In: 41st International Convention
on Information and Communication Technology, Electronics and Microelectronics,
MIPRO 2018, Opatija, Croatia, May 21-25, 2018, pp. 1174–1179. IEEE (2018)
18. Heule, M.J.H., Kullmann, O., Wieringa, S., Biere, A.: Cube and conquer: Guiding
cdcl sat solvers by lookaheads. In: HVC, pp. 50–65 (2012)
19. Hyvärinen, A.E.J.: Grid based propositional satisfiability solving. Ph.D. thesis,
Aalto University, Helsinki, Finland (2011)
20. Hyvärinen, A.E.J., Junttila, T., Niemelä, I.: A Distribution Method for Solving
SAT in Grids, p. 430–435. Springer Berlin Heidelberg (2006)
21. Järvisalo, M., Junttila, T.A.: Limitations of restricted branching in clause learning.
Constraints An Int. J. 14(3), 325–356 (2009)
22. Karp, R.M.: Reducibility among Combinatorial Problems, p. 85–103. Springer US
(1972)
23. Kroening, D.: Software verification. In: Handbook of Satisfiability - Second Edition,
FAIA, vol. 336, pp. 791–818. IOS Press (2021)
24. Kuehlmann, A., Paruthi, V., Krohm, F., Ganai, M.K.: Robust boolean reasoning
for equivalence checking and functional property verification. IEEE Trans. Com-
put. Aided Des. Integr. Circuits Syst. 21(12), 1377–1394 (2002)
25. Leurent, G.: MD4 is not one-way. In: FSE, LNCS, vol. 5086, pp. 412–428 (2008)
26. Marques-Silva, J., Lynce, I., Malik, S.: Conflict-driven clause learning SAT solvers.
In: Handbook of Satisfiability - Second Edition, FAIA, vol. 336, pp. 133–182. IOS
Press (2021)
27. Marques-Silva, J., Sakallah, K.: GRASP: A search algorithm for propositional sat-
isfiability. IEEE Transactions on Computers 48(5), 506–521 (1999)
28. Marques-Silva, J.P., Sakallah, K.A.: GRASP - a new search algorithm for satisfia-
bility. In: ICCAD, pp. 220–227. IEEE Computer Society / ACM (1996)
29. Irkutsk Supercomputer Center of SB RAS. URL [Link]
30. Merkle, R.C.: A certified digital signature. In: CRYPTO, Lecture Notes in Com-
puter Science, vol. 435, pp. 218–238. Springer (1989)
31. Molitor, P., Mohnke, J., Becker, B., Scholl, C.: Equivalence Checking of Digital
Circuits: Fundamentals, Principles, Methods. Kluwer Academic Publishers (2004)
32. de Moura, L.M., Bjørner, N.S.: Z3: an efficient SMT solver. In: TACAS, LNCS,
vol. 4963, pp. 337–340. Springer (2008)
33. Rintanen, J.: Planning and sat. In: Handbook of Satisfiability - Second Edition,
FAIA, vol. 336, pp. 765–789. IOS Press (2021)
34. Rivest, R.L.: The MD4 message digest algorithm. In: Advances in Cryptology -
CRYPTO, LNCS, pp. 303–311 (1990)
35. Semenov, A., Zaikin, O., Kochemazov, S.: Finding Effective SAT Partitionings Via
Black-Box Optimization, p. 319–355. Springer International Publishing (2021)
36. Semenov, A.A.: Decomposition representations of logical equations in problems
of inversion of discrete functions. Journal of Computer and Systems Sciences
International 48, 718–731 (2009)
37. Semenov, A.A., Chivilikhin, D., Pavlenko, A., Otpuschennikov, I.V., Ulyantsev,
V., Ignatiev, A.: Evaluating the hardness of SAT instances using evolutionary
optimization algorithms. In: CP, LIPIcs, vol. 210, pp. 47:1–47:18 (2021)
16 V. Kondratiev et al.
38. Semenov, A.A., Otpuschennikov, I.V., Gribanova, I., Zaikin, O., Kochemazov, S.:
Translation of algorithmic descriptions of discrete functions to SAT with applica-
tions to cryptanalysis problems. Log. Methods Comput. Sci. 16(1) (2020)
39. Semenov, A.A., Zaikin, O., Bespalov, D., Posypkin, M.: Parallel logical cryptanal-
ysis of the generator A5/1 in bnb-grid system. In: PaCT, LNCS, vol. 6873, pp.
473–483 (2011)
40. Semenov, A.A., Zaikin, O., Otpuschennikov, I.V., Kochemazov, S., Ignatiev, A.:
On cryptographic attacks using backdoors for SAT. In: AAAI, pp. 6641–6648
(2018)
41. Szeider, S.: Backdoor sets for DLL subsolvers. J. Autom. Reason. 35(1-3), 73–88
(2005)
42. Tseitin, G.S.: On the complexity of derivation in propositional calculus. Studies
in Constructive Mathematics and Mathematical Logic, Part II pp. 115–125 (1970)
43. Wang, X., Lai, X., Feng, D., Chen, H., Yu, X.: Cryptanalysis of the hash functions
MD4 and RIPEMD. In: EUROCRYPT, LNCS, vol. 3494, pp. 1–18 (2005)
44. Wegener, I.: The Complexity of Boolean Functions. John Wiley & Sons (1987)
45. Williams, R., Gomes, C.P., Selman, B.: Backdoors to typical case complexity. In:
IJCAI, pp. 1173–1178 (2003)
46. Zaikin, O.: Inverting 43-step MD4 via Cube-and-Conquer. In: IJCAI, pp. 1894–
1900 (2022)
47. Zaikin, O.: Inverting cryptographic hash functions via Cube-and-Conquer. J. Artif.
Intell. Res. 81, 359–399 (2024)
48. Zhang, H.: Combinatorial designs by sat solvers. In: Handbook of Satisfiability -
Second Edition, FAIA, vol. 336, pp. 818–858. IOS Press (2021)