Mixed Boolean-Arithmetic Problems
- Mixed Boolean-Arithmetic problems are defined by the interleaving of modular arithmetic and bitwise Boolean operations on n-bit words, creating complex computational models.
- These expressions are pivotal in applications such as code obfuscation, white-box cryptography, and automated synthesis, with tools like SiMBA and Scrambler highlighting their utility.
- Advanced methodologies including e-graph based generation, signature-based simplification, and neural deobfuscation underscore their significance in both theoretical and practical realms.
Mixed Boolean-Arithmetic (MBA) problems concern expressions and computational models that interleave standard arithmetic operations (e.g., modular addition, multiplication) with bitwise Boolean operations (e.g., AND, OR, XOR, NOT) over vectors of finite precision (e.g., -bit words or bit-vectors). These problems are fundamental in program obfuscation, complexity theory, reverse engineering, cryptanalysis, and automated synthesis, as MBAs simultaneously exhibit the algebraic structures of both arithmetic and Boolean domains. MBA expressions are widely employed to obfuscate code, generate opaque predicates, and encode cryptographic transformations, owing to the difficulty of simplification and the combinatorial hardness induced by their interplay of logical and arithmetic semantics.
1. Formal Definitions and Semantics
Let denote the set of -bit words, i.e., . A Mixed Boolean–Arithmetic (MBA) expression over variables is built from:
- Arithmetic operators: , , (all mod ),
- Bitwise operators: 0 (AND), 1 (OR), 2 (XOR), 3 (NOT),
- Constants from 4,
- Parentheses and composition.
Formally, the language is defined by the grammar (see (Lee et al., 4 Mar 2026, Reichenwallner et al., 2023)): 5 where 6 is a variable, 7 is a constant, and each operator is interpreted as above.
Two MBA expressions 8, 9 over 0 are semantically equivalent, 1, iff for all assignments 2, 3.
MBA expressions may be classified as:
- Linear MBA: Sums of bitwise terms, each possibly multiplied by a constant, without nonlinear or product terms.
- Semi-linear MBA: As linear, but bitwise subterms may include nontrivial constant masks (e.g., 4) (Skees, 2024).
- Nonlinear/Polynomial MBA: Involving products of bitwise terms, exponentiation, or other nonlinear composition (Reichenwallner et al., 2023).
2. Algebraic and Computational Structure
MBA problems are hard because they combine two incommensurate algebraic worlds:
- Boolean algebra of idempotent, bitwise operations, characteristic 5.
- Modular arithmetic over 6-bit words, characteristic 7.
Every arithmetic operator can be written (in principle) as a system of Boolean recurrences over the constituent bits, governed by carry/borrow propagation (see (Lomonaco, 2013)); likewise, each bitwise operation can be viewed (on 8-bits) as a vector of 9 single-bit Boolean operations.
The ring of generic integers, as formalized by Lomonaco (Lomonaco, 2013), underlies this dual structure: on the same set, both 0 (arithmetic) and 1 (Boolean) ring laws operate, with all "mixed" operations decomposable into Boolean-polynomial recurrences.
In circuit-theoretic terms, any MBA expression can also be modeled as a layered Boolean-arithmetic circuit or as a "read-2" Boolean circuit, which reveals its expressive and complexity-theoretic power (Jukna, 2022).
3. Core Applications: Obfuscation, Synthesis, and Circuit Complexity
MBA problems are central in several domains:
- Code Obfuscation and Anti-Reverse Engineering: MBA transformations increase expression hardness for reverse engineering, by syntactically entangling data flow and control logic in ways that resist both Boolean and algebraic simplification (Reichenwallner et al., 2023, Lee et al., 4 Mar 2026).
- White-Box Cryptography: S-boxes or mixing layers are encoded as rich MBA forms to resist SAT- and algebraic attacks (Reichenwallner et al., 2023).
- Program Synthesis and Circuit Sizing: Synthesizing MBA expressions consistent with a functional specification is a core challenge for program optimizers and deobfuscators. Recent advances leverage GPU-accelerated cache-free bottom-up enumeration for large search spaces (Bathie et al., 7 May 2026).
- Complexity Theory: Mixed Boolean-arithmetic circuits (especially read-3 and multilinear variants) capture, in a fine-grained manner, the complexity of problems at the boundary of monotone arithmetic, monotone Boolean, and tropical (min,+) circuit models (Jukna, 2022).
4. Algorithmic Methods for MBA Generation and Simplification
4.1. Generation via Equality Expansion
Tools such as Scrambler use e-graph–based "equality expansion" to systematically generate families of semantically equivalent but structurally complex MBA expressions (Lee et al., 4 Mar 2026). The procedure:
- Maintains an e-graph with equivalence classes of expressions.
- Applies a set of semantic-preserving rewrite rules (commutativity, associativity, arithmetic–bitwise bridges, distributivity, etc.) with closure under congruence.
- Measures complexity via AST size, MBA alternation (arithmetic/Boolean switches on any path), and entropy, driving expansion to maximize cost metrics.
In benchmarks, Scrambler produces expressions orders of magnitude more complex than prior tools (e.g., AST size 4; MBA alternation 5) (Lee et al., 4 Mar 2026).
4.2. Algebraic Simplification: Linear and Semi-Linear Cases
The SiMBA algorithm (Reichenwallner et al., 2022) provides a polynomial-time procedure for simplifying linear MBAs:
- Evaluate the candidate MBA on all 6 Boolean inputs, producing a signature vector.
- Solve a small linear system to recover arithmetic coefficients for a basis of bitwise conjunctions.
- Optional refinement via pattern matching. The method is complete: linear MBAs are uniquely determined by their 7-signature.
The MSiMBA extension generalizes this to semi-linear MBAs by constructing generalized signature vectors (considering bitmasks and all bit positions) and enables fast, sound, and complete simplification even when constants appear in bitwise terms (Skees, 2024).
4.3. General and Nonlinear Simplification
GAMBA (Reichenwallner et al., 2023) extends SiMBA to handle all MBA cases:
- Identifies and simplifies maximal linear or pure bitwise subtrees.
- Performs algebraic and bitwise rewrites, constant folding, and associative flattening.
- Handles nonlinear cases via iterative AST rewrites and heuristic substitution of nonlinear subterms. GAMBA achieves near-complete simplification on all major MBA datasets, including highly nonlinear and mixed instances.
4.4. Semantic–Guided Neural Deobfuscation
The gMBA framework (Noh et al., 30 Jun 2025) enhances Transformer-based deobfuscators by injecting expression truth-table embeddings as explicit semantic guidance. The model fuses the numerically encoded truth-table with the syntax embedding, improving deobfuscation accuracy (from 8 to 9 exact-match on standard benchmarks).
4.5. Synthesis from I/O Specification
SIMBA (Bathie et al., 7 May 2026) employs GPU-accelerated, cache-free bottom-up enumeration for synthesizing MBA expressions matching given I/O examples. This approach avoids the scalability limitations of cache-based systems, efficiently exploring the vast MBA search space by leveraging warp-friendly RPN decoding and strict locality.
5. Computational Complexity and Hardness
MBA simplification is governed by the exponential size of the truth-table (0 for 1 variables) and, for nonlinear or general MBAs, by the coNP-hardness of deciding satisfiability/equivalence over bit-vectors (Reichenwallner et al., 2023). Linear and semi-linear classes can be solved efficiently for small 2 via signature-based methods (Reichenwallner et al., 2022, Skees, 2024).
Circuit models for MBA problems (e.g., monotone Boolean, tropical, read-3) relate closely to classical complexity-theoretic results. Read-1 Boolean circuits are equivalent in power to monotone arithmetic circuits for multilinear polynomials and provide exponential lower bounds for several combinatorial optimization problems (e.g., the permanent) (Jukna, 2022).
6. Summary Table: Principal Tools and Results
| Tool/Framework | Domain | MBA Class | Scalability | Key Strength |
|---|---|---|---|---|
| SiMBA | Algebraic simplification | Linear | 4 up to 64 | Polynomial-time, sound and complete |
| MSiMBA | Algebraic simplification | Semi-linear | 5 | Handles masked bitwise terms |
| GAMBA | Algebraic/heuristic | General | 6 small (practical) | Nonlinear MBA, best-in-class coverage |
| Scrambler | Obfuscation generation | All (7) | Large ASTs, 2s | E-graphs for maximal complexity |
| SIMBA | Synthesis (I/O) | General | 8, 9 | GPU, cache-free, no cache limits |
| gMBA | Neural deobfuscation | General | Data-driven | Semantic guidance, exact-match gains |
7. Open Problems and Research Directions
Key limitations and future directions include:
- Scalability to large 0 (number of variables) remains a challenge for all but the fastest linear/semilinear solvers.
- Generation and simplification for MBAs including shifts, rotates, or variable-exponentiation remains less developed.
- Memory management and operator-set expansion in e-graph–based generators (e.g., Scrambler), and cost-aware/solver-guided expansion to construct MBAs hard for modern solvers (Lee et al., 4 Mar 2026).
- Circuit lower bounds in mixed (read-1 or monotone/tropical/arithmetic) MBA models, especially bridging the exponential gap between read-1 and read-2 (Jukna, 2022).
- Integration of algebraic, SAT/SMT, and neural techniques, including hybrid pipelines, semantic-guided simplification, and automated selection of subexpression simplification strategies (Noh et al., 30 Jun 2025, Reichenwallner et al., 2023, Skees, 2024).
MBA problems embody the intersection of combinatorial, algebraic, and computational hardness, with practical importance for software security, program analysis, and complexity theory. Advances in signature-based, e-graph, and neural methods have driven recent progress, yet many theoretical and practical questions remain.