Moving Deﬁnition Variables in Quantiﬁed Boolean Formulas (cid:63)

. Augmenting problem variables in a quantiﬁed Boolean formula with deﬁnition variables enables a compact representation in clausal form. Generally these deﬁnition variables are placed in the innermost quantiﬁer level. To restore some structural information, we introduce a preprocessing technique that moves deﬁnition variables to the quantiﬁer level closest to the variables that de-ﬁne them. We express the movement in the QRAT proof system to allow veriﬁcation by independent proof checkers. We evaluated deﬁnition variable movement on the QBFEVAL’20 competition benchmarks. Movement signiﬁcantly improved performance for the competition’s top solvers. Combining variable movement with the preprocessor B LOQQER improves solver performance compared to us-ing B LOQQER alone.


Introduction
Boolean formulas and circuits can be translated into conjunctive normal form (CNF) by introducing definition variables to augment the existing problem variables. Definition variables are introduced through a set of defining clauses, given by the Tseitin [19] or Plaisted-Greenbaum [16] transformation. Problem variables occurring in the defining clauses constitute the defining variables; they determine the values of the definition variables. In CNF, definitions are not an explicit part of the problem representation, preventing solvers from using this structural information. Quantified Boolean formulas (QBF) extend CNF into prenex conjunctive normal form (PCNF) with the addition of quantifier levels. In practice, definition variables are usually placed in the innermost quantifier level. However, as we will show, placing a definition variable in the quantifier level immediately following its defining variables can improve solver performance.
We describe a preprocessing technique for moving definition variables to the quantifier level of their innermost defining variables. As a starting point, existing tools KISSAT and CNFTOOLS can detect candidate definitions in a CNF formula. We generate a proof in the QRAT proof system that, through a series of clause additions and deletions, effectively replaces the old definition variable with a new variable at the desired quantification level.
Most Boolean satisfiability (SAT) solvers generate proofs of unsatisfiability for independent checking [7,9,20]. This has proved valuable for verifying solutions independent of the (potentially buggy) solvers. Proof generation is difficult for QBF and The authors are supported by the NSF under grant CCF-2108521. relatively uncommon in solvers. The QBF preprocessor BLOQQER [2] generates QRAT proofs [8] for all of the transformations it performs. Our QRAT proofs for variable movement also allow verification with the independent proof checker QRAT-TRIM, ensuring that the movement preserves equivalence with the original formula.
Clausal-based QBF solvers rely on preprocessing to improve performance. Almost every top-tier solver in the QBFEVAL'20 competition 1 used some combination of BLO-QQER, HQSPRE [21], or QBFRELAY [15]. Some solvers incorporate preprocessing techniques into the solving phase, e.g., DEPQBF's [14] use of dynamic quantified blocked clause elimination. Unlike other preprocessing techniques, variable movement does not add or remove clauses or literals. However, it can prompt the removal of literals through universal reduction and may guide solver decisions in a beneficial way.
The contributions of this paper include: (1) adapting the SAT solver KISSAT and CNF preprocessor CNFTOOLS to detect definitions in a QBF, (2) giving an algorithm for moving variables that maximizes variable movement, (3) formulating steps for generating a QRAT proof of variable movement, and (4) evaluting the impact of these transformations. Variable movement significantly improves the performance of top solvers from the QBFEVAL'20 competition. Combining variable movement with BLOQQER further improves solver performance.

Quantified Boolean Formulas
Quantified Boolean formulas (QBF) can be represented in prenex conjunctive normal form (PCNF) as Π.ψ, where Π is a prefix of the form Q 1 X 1 Q 2 X 2 · · · Q n X n for Q i ∈ {∀, ∃} and the matrix ψ is a CNF formula. The formula ψ is a conjunction of clauses, where each clause is a disjunction of literals. A literal l is either a variable l = x or negated variable l = x, and Var (l) = x. The formula ψ(l) is the clauses {C | C ∈ ψ, l ∈ C}. The set of all variables occurring in a formula is given by Var (ψ). Substituting a variable y for x in ψ, denoted as ψ[y/x], will replace every instance of x with y and x with y in the formula. The sets of variables X i are disjoint, and we assume every variable occurring in ψ is in some X i . A variable x is fresh if it does not occur in Π.ψ. The quantifier for literal l with Var (l) ∈ X i is Q(Π, l) = Q i , and l is said to be in quantifier level λ(l) = i. If Q(Π, l) = Q i and Q(Π, k) = Q j , then l ≤ Π k if i ≤ j. Q 1 X 1 is referred to as the outermost quantifier level and Q n X n is the innermost quantifier level.

Inference Techniques in QBF
Given a clause C, if a literal l ∈ C is universally quantified, and all existentially literals k ∈ C satisfy k < Π l, then l can be removed from C. This process is called universal reduction (UR). Given two clauses C and D with x ∈ C and x ∈ D, the Q-resolvent over pivot variable x is UR(C) ∪ UR(D) \ {x, x} [12]. The operation is undefined if the result is tautological. This extends resolution for propositional logic by applying UR to the clauses before combining them, while disallowing tautologies. Adding or removing non-tautological Q-resolvents preserves logical equivalence.
Given a prefix Π and clauses C and D with l ∈ C and l ∈ D, the outer resolvent over existentially quantified pivot literal l is C ∪ {k | k ∈ D, k = l, k ≤ Π l}. Given a QBF Π.ψ, a clause C is Q-blocked on some existentially quantified literal l ∈ C if for all D ∈ ψ(l) the outer resolvent of C with D on l is a tautology. This extends the blocked property for CNF with the restriction on the conflicting literal's quantifier level.
A clause C subsumes D if C ⊆ D. The property Q-blocked-subsumed generalizes Q-blocked by requiring the outer resolvents be tautologies or subsumed by some clause in the formula.
Given a QBF Ψ = Π.ψ, if a clause C is Q-blocked-subsumed then C is QRAT w.r.t. Ψ . In this case, C can be added to ψ or deleted from ψ if C ∈ ψ while preserving equivalence. A series of clause additions and deletions resulting in the empty formula is a satisfaction proof for a QBF if all clause deletions are QRAT. A series of clause additions and deletions deriving the empty clause is a refutation proof for a QBF if all clause additions are QRAT. In a dual proof both clause additions and deletions are QRAT, so each step preserves equivalence regardless of the truth value of the QBF. The QBF Ψ that results from applying the dual proof steps to Ψ is equivalent to Ψ .

Definitions
A variable x is a definition variable in Ψ = Π.ψ with defining clauses δ(x) containing x, δ(x) containing x, and defining variables Z x = Var [δ(x) ∪ δ(x)] \ {x} when two properties hold: (1) the definition is left-total, meaning that x has a value for every assignment of Z x , and (2) the definition is right-unique, meaning that x has a unique value for every assignment of Z x . The clauses δ(x) ∪ δ(x) are left-total iff they are Qblocked on variable x. This implies that the definition variable comes after the defining variables w.r.t. Π. The definition is right-unique if the SAT problem {C | C ∈ δ(x) ∪ δ(x), C = C \ {x, x}} is unsatisfiable. We can assume that any right-unique variable is universally quantified, otherwise the formula would be trivially false.
The remaining clauses of x are ρ(x) = ψ(x) \ δ(x) and ρ(x) = ψ(x) \ δ(x). If x occurs as a single polarity in the remaining clauses, it can be encoded as a onesided definition: if ρ(x) is empty only δ(x) are needed to define x, similarly with ρ(x) and δ(x) . This is a stronger condition than monotonicity used for the general Plaisted-Greenbaum transformation [16].
In some definitions including exclusive-or (XOR denoted by ⊕), multiple variables are left-total and right-unique. Determining the definition variable requires information about how definition variables are nested within the formula.
Q-resolution can be generalized to sets of clauses C and D, denoted C ⊗ x D, by generating the non-tautological resolvents from clauses in C(x) and D(x) on pivot variable x pairwise. Given a definition variable x and defining variables {z 1 , . . . , z n }, let x be a fresh variable with θ x = δ(x) and θ x = δ(x)[x /x]. The procedure defining variable elimination applies set-based Q-resolution in the following way: set θ 1 = θ x (z 1 ) ⊗ z1 θ x (z 1 ) ∧ θ x (z 1 ) ⊗ z1 θ x (z 1 ) and compute θ 2 = θ 1 (z 2 ) ⊗ z2 θ 1 (z 2 ); continue the process until θ n = θ n−1 (z n ) ⊗ zn θ n−1 (z n ). UR is not applied because x is in the innermost quantifier level with respect to its defining variables. The first step ensures all clauses in θ 1 will contain both x and x . θ n will either be {(x ∨ x )} or empty. If θ n = {(x ∨ x )}, linearizing the sets of resolvents θ i forms a Q-resolution derivation of (x ∨ x ). This is similar to Davis Putnam variable elimination [4].

Definition Detection
Given a QBF, we first detect definitions to determine which variables can be moved. All definitions are detected before variable movement begins. Variable movement depends on the defining clauses, the definition variables, and the nesting of definition variables. At a minimum, definition detection must produce the defining clauses, and the rest can be inferred during movement.
Since the seminal work by Eén and Biere [5], bounded variable elimination (BVE) has been an essential preprocessing technique in SAT solving. The technique relies on definitions, so most SAT solvers incorporate some form of definition detection. The conflict-driven clause learning SAT solver KISSAT [1] extends the commonly used syntactic pattern matching with semantic definition detection. The detection is applied to variables independently. Alternatively, the preprocessor CNFTOOLS [10] performs hierarchical definition detection, capturing additional information about definition variable nesting and monotonic definitions.
These tools run on CNF formulas. Stripping the prefix from a QBF yields a CNF, but not all definitions in the CNF are valid w.r.t. the prefix. For example, some definitions will not be left-total because of the quantifier level requirements for the Q-blocked property. Such definitions can be avoided during variable movement, and there is no need to modify the tools in this respect.

Hierarchical Definition Detection in CNFTOOLS
The hierarchical definition detection in CNFTOOLS employs a breadth first search (BFS) to recurse through nested definitions in a formula. Root clauses are selected heuristically, then BFS begins on the variables occurring in those clauses. All unit clauses are selected as root clauses. The max-var root selection selects variables based on their numbering. This exploits the practice of numbering definition variables after problem variables. The more involved min-unblocked root selection finds a minimally unblocked literal. The heuristic is more expensive but does not rely on variable numbering.
When a variable is encountered in the BFS, CNFTOOLS checks if the defining clauses are blocked. If so, the following detection methods are applied: pattern matching for BiEQ, AND, OR, and full patterns, monotonic checking, and semantic checking. BiEQ refers to an equivalence between two variables.
A definition is a full pattern if ∀C ∈ δ(x)∪δ(x), |C| = n+1 where n is the number of defining variables and there are 2 n defining clauses. The full pattern includes some common encodings for XOR, XNOR, NOT, and Majority3, but is often avoided. Since the detection follows the hierarchical nesting of definitions, definition variables can be distinguished from defining variables online.
CNFTOOLS detects monotonic definitions, and some are either fully-defined or onesided. The advantage of hierarchical detection is the ability to detect these one-sided definitions. The one-sided property is a necessary restriction on monotonic definitions because in some situations, monotonic definition variables may occur both positively and negatively in the defining clauses of other definitions. These additional clauses can prevent variable movement w.r.t. the QRAT proof system.
Semantic checking involves a right uniqueness check on the SAT problem described in the preliminaries. As definitions are detected the defining clauses are removed from the formula for the following iterations. This does not affect fully defined definition detection, but it can produce problematic one-sided definitions. For example, a variable may occur both positively and negatively in the defining clauses of other definitions, and removing those clauses makes the variable one-sided. Similar to the monotonic case, the additional defining clauses can prevent movement w.r.t. the QRAT proof system.

Independent Definition Detection in KISSAT
KISSAT uses definition detection to find candidates for BVE. Starting with the 2021 SAT Competition, semantic definition detection was incorporated into the BVE inprocessing stage [6]. The semantic check is called after the syntactic pattern matching for BiEQ, AND, OR, ITE, and XOR definitions. An internal SAT solver KITTEN with low overhead and limited capabilities performs a right-uniqueness check on the formula ψ(x) ∪ ψ(x) after removing all occurrences of x and x. This formula includes ρ(x) and ρ(x) as the set of defining clauses are not known in advance. If the formula is unsatisfiable, an unsatisfiable core is extracted (potentially after reduction) and returned as the set of defining clauses.
Core extraction does not guarantee the defining clauses are blocked. Internally KISSAT generates resolvents over the defining clauses. We modify KISSAT to only detect semantic definition where zero resolvents are generated. We ignore built-in heuristics for selecting candidate variables and instead iterate over all variables.
No nesting information is gathered during definition detection in KISSAT. This makes it impossible to distinguish between defining variables and the definition variable for XORs. Further, if a variable is checked only once and the XOR was detected first additional definitions would be ignored. We modified KISSAT so that when an XOR or semantic definition is detected for a variable, the clauses from that definition are marked as inactive and the definition detection procedure is rerun. This will determine if a variable is defined elsewhere. The clauses are marked active when detection begins on the next variable.

Moving Variables
Given all detected definitions, we move definition variables as close to their defining variables as possible to maximize universal reduction. To do this, we introduce empty existential quantifier levels, denoted T i , following each Q i X i in the prefix yielding There is no T n because variables are not moved inwards. For each definition variable x that can be moved, a fresh variable x is placed in the quantifier level T m for m = max{λ(z) | z ∈ Z x }. That is, x will be placed in the existential block that immediately follows the innermost defining variable.
Finally, x will be removed from the prefix, and the new formula will be ψ[x /x].
x 5 is placed in an existential quantifier level following the innermost defining variable x 4 . Then, x 5 is substituted for Finally, x 2 can be removed from (x 2 ∨x 5 ) by universal reduction.
New variables are introduced for movement because QRAT steps either add or delete clauses and cannot affect the quantifier level of an existing variable. When definitions are added in the checker QRAT-TRIM the new definition variables are placed in a quantifier level based on their defining variables. For a definition variable x, if the innermost defining variable z ∈ X i is existentially quantified (Q i = ∃) the definition variable is placed in X i , and if z is universally quantified (Q i = ∀) the definition variable is placed in the existential level X i+1 , So, new definition variables are placed in the desired quantifier level. Because contiguous levels with the same quantifier can be combined, the introduction of T levels does not change the semantics.

Moving in Order
Moving an individual definition variable is simple, but the general algorithm must consider definition dependencies to be efficient and make various checks to be correct. The tools for definition detection run on CNF instances, so, some definitions may not be left-total when considering the prefix. This can occur if the definition variable is in a level outer to one of its defining variables. Also, some monotonic definitions may not satisfy the one-sided property. These problems are checked during proof generation. If they occur, that variable is not moved.
The variable movement algorithm starts at the outermost quantifier level and sweeps inwards, at each step moving all possible definition variables to the current level. A definition variable x can be moved if x > Π z for all z ∈ Z x , and x is not universally quantified. It can be moved to T m where m = max{λ(z) | z ∈ Z x }, and will be moved during iteration m of the algorithm. Once a definition variable has been moved, if it was a defining variable for some other definitions, those definitions are checked for movement. Since the iteration starts at the outermost level, it guarantees variables that can be moved within our framework are moved as far as possible. This requires a single pass, so moved definitions will not be revisited.

XOR Processing
It is not initially clear how to determine which are the defining variables for an XOR definition. If a variable is defined elsewhere and appears in an XOR, it must be a defining variable in the XOR. In addition, universal variables must be defining variables.
However, a distinction cannot be made between the remaining variables without information about movement.
. . , determining the definition variables for the XOR definitions will hinge on the movement of x 6 . Case 1, Let x i = x 7 in the AND definition, x 6 cannot be moved. Then, x 5 can be moved to ∃ 3 as the definition variable of (x 3 ⊕ x 4 ⊕ x 5 ). No other variables can be moved. Case 2, Let x i = x 2 in the AND definitions, x 6 can be moved to ∃ 1 . Then, x 5 can be moved to ∃ 1 as the definition variable of (x 1 ⊕ x 5 ⊕ x 6 ). Next, x 4 can be moved to ∃ 2 as the definition variable of (x 3 ⊕ x 4 ⊕ x 5 ). The possible movement of x 6 will determine how the XOR definitions are moved. This information is not known until runtime, so the definition variable of an XOR cannot be determined before variable movement is performed.
As seen in the example, movement of definition variables can affect what variable in an XOR is eventually moved. The definition variable for an XOR must be determined online during the movement process. During initialization and propagation, we reset the definition variable as the innermost variable in the XOR. If that variable is defined elsewhere, it cannot be moved. Otherwise, we perform the same check as the general case to see if the definition variable can be moved. With XOR definitions, the algorithm is still deterministic and produces optimal movement, since all variables that can be moved are moved to their outermost level.

Proving Variable Movement
In this section we describe how to modify a formula through a series of QRAT clause additions and deletions to achieve variable movement. Moving a definition variable x in the formula Π.ψ involves: -Introducing a new definition variable x to replace x.
-Deriving an equivalence between x and x.
-Transforming the formula to ψ to ψ[x /x] with x removed from Π and x placed in the existential quantifier level following its innermost defining variable.
The algorithm for moving a definition variable x proceeds in five steps, each involving some clause additions or deletions. Some of the steps can be simplified depending on the type of definition. Moving a one-sided definition requires slight modifications to a few steps, and these are discussed following each of the relevant steps.
We introduce a fresh existential variable x and add the defining clauses δ(x)[x /x] and δ(x)[x /x]. Each clause is Q-blocked on x or x since the definition is left-total and variable x is in the quantifier level following its innermost defining variable. 2. Add the equivalence clauses x ↔ x .
Both x and x are fully defined by the same set of variables, so it is possible to derive the equivalence clauses (x ∨ x ) and (x ∨ x ). The first implication added is Q-blocked-subsumed. Consider (x ∨ x ), for each clause C ∈ δ(x ). The outer resolvent of C with (x∨x ) on x is subsumed by the corresponding C ∈ δ(x). This is not the case for (x ∨ x ) because the outer resolvent of (x ∨ x ) with (x ∨ x ) is not subsumed by the formula. The clause (x ∨ x ) is QRAT for certain definitions, in particular AND/OR. In the general case we generate a chain of Q-resolutions that imply (x ∨ x ). We use defining variable elimination to eliminate Z x from the formula δ(x)∪δ(x ). The procedure produces the clause (x∨x ). The resolution tree rooted at (x∨x ) is traversed in post-order giving the list of clauses C 1 , ..., C n , (x∨ x ). We add the clauses in order, deriving (x ∨ x ). The clauses are subsumed by (x ∨ x ) and deleted. If defining variable elimination does not produce (x ∨ x ), then the definition is not right-unique. The variable x cannot be moved in this case. ONE-SIDED: assuming for the one-sided definition that x occurs positively in the defining clauses, the implication (x ∨ x) is added. The implication is Q-blockedsubsumed for the same reasons as the first implication above. If x occurs negatively the implication (x ∨ x ) is added. We will continue the remaining steps under the assumption that x occurs positively in the defining clauses for the one-sided case.

Add and remove the remaining clauses ρ(x) and ρ(x).
For all clauses C ∈ ρ(x) , C ∈ ρ(x ) is the Q-resolvent of C with (x ∨ x ) on pivot x, so C can be added. C can be deleted because it is the Q-resolvent of C with (x ∨ x) on pivot x . Similar reasoning is used for C ∈ ρ(x). ONE-SIDED: All C ∈ ρ(x ) are added with the same reasoning as above. However, there is no (x ∨ x ) so C ∈ ρ(x) cannot be deleted until step 5.

Remove the equivalence clauses
, the outer resolvent of (x ∨ x ) and D is subsumed by the defining clause D ∈ δ(x ), and the outer resolvent of (x ∨ x ) with (x ∨ x ) is a tautology. Similarly, (x ∨ x ) is Q-blocked-subsumed. ONE-SIDED: the definition clauses need the implication in order to be deleted, and so deletion is deferred to step 5. 5. Remove the defining clauses δ(x) and δ(x).
The defining clauses on x are all Q-blocked and are deleted. ONE-SIDED: The defining clauses D ∈ δ(x) can be deleted because they are Qresolvents of D ∈ δ(x ) with (x ∨ x) on x . Now the clauses (x ∨ x) and ρ(x) are Q-blocked on x because x only occurs negatively. They are deleted.
Given the QBF Π.ψ, applying the transformation sequentially with definition variables x 1 , . . . , x n will yield the QBF Π.ψ where all definition variables x i have been replaced by new variables x i and the new variables are in the appropriate quantifier levels. The concatenated series of clause additions and deletions generated for each definition variable gives a QRAT proof of the equivalence between Π.ψ and Π.ψ The steps above can also be used to move a definition variable to some existential quantifier between the variable and its innermost defining variable. In addition, a definition variable that is inside its defining variables can be moved further inwards by reversing the steps, but it is not clear when this would be useful.
Example 4. Given the QBF ∃x 1 ∀x 2 .(x 1 ∨ x 2 ) ∧ (x 1 ∨ x 2 ), we have the definition x 1 ↔ x 2 . The definition is right-unique but the defining clauses are not Q-blocked on x 1 since x 1 is at an outer quantifier level. The QBF is false but moving x 1 inward would make it true. To avoid this, we only move variables outward.
Example 5. Given the definition x 1 ⊕x 2 ⊕x 3 with x 1 as the definition variable we have δ( Defining variable elimination will perform the following steps: The clause additions to derive the second implication in step 2 would be ( . Each subsequent clause in the list is implied by Qresolution. With more defining variables, the resolution tree becomes more complex. The derivation will be of the form θ 1 , ..., θ n−1 for θ i ⊂ θ i where θ i will include only the clauses needed to derive (x 1 ∨ x 1 ). These can be determined by working through the resolution chain backwards from (x 1 ∨ x 1 ).
, we show the steps generating the QRAT proof of movement for variable x 4 with the pivot appearing as the first literal in the clause. Clauses following a d are deleted from the formula.
The definition variable x 4 is replaced by the fresh variable x 4 which will be placed in the prenex as ∃x 1 x 2 x 3 ∃x 4 ∀x 5 x 6 achieving the desired movement. The QRAT proof system uses a stronger redundancy notion that avoids auxiliary clauses for an AND definition in step 2.
We verified all instances of variable movement on QBFEVAL'20 benchmarks using QRAT-TRIM [8]. By default, QRAT-TRIM will check a satisfaction proof with forward checking, verifying the clause deletion steps are correct in order they appear. A refutation proof is checked with backward checking, verifying the clause addition steps are correct starting at the empty clause and working backwards. Since we do not know whether the problem will be true or false at the variable movement stage, we must check both clause addition and deletion steps to preserve equivalence. To do this, we modified QRAT-TRIM with a DUAL-FORWARD mode that performs a forward check on both clause additions and deletion. We verified several end-to-end proofs for formulas solved by BLOQQER after variable movement. We append the BLOQQER proof onto our variable movement proof, and verify it against the original formula with QRAT-TRIM. All formulas that BLOQQER solved were verified in this way.

Evaluation
Variable movement is evaluated on 494 of the QBFEVAL'20 benchmarks. We compare definition detection tools KISSAT and CNFTOOLS, then evaluate the affect of variable movement on solver performance. The repository can be found at https://github.com/jreeves3/qbf-definition-variable-movement-Artifact.
We ran our experiments on StarExec [18]. The specs for the compute nodes can be found online. The compute nodes that ran our experiments were Intel Xeon E5 cores with 2.4 GHz, and all experiments ran with 32 GB.

Evaluating Definition Detection
The tools are given 10 seconds to detect definitions. KISSAT attempts to check each variable, whereas CNFTOOLS will iterate through root clauses until the time limit. Root clause selection is split into the max-var (mv) and blocked (mb) heuristics. We consider all definitions extracted up to a timeout if one occurs. The combined approach takes the union of definitions found in each tool, and each tool is still allotted 10 seconds. Figure 1 shows the number of definitions found (top) and moved (bottom) compared to the combined approach. None of the tools goes above the diagonal in either plot because the combined approach takes a union of found definitions and movement cannot be diminished by additional detected definitions. In many cases multiple tools contribute to the combined found and combined movement, shown by a column of points where none are on the diagonal. There is a noticeable pattern between CNFTOOLS (mb) and (mv) where (mb) performs slightly worse due to the cost of computing the minimally-blocked root clause. But there are some instances where the minimallyblocked heuristic is advantageous and leads to more movement. For combined, definitions were found in 493 instances and moved in 157 instances Comparing the plots to each other, the number of definitions found is not a strict predictor of movement. KISSAT finds a similar number of definitions as CNFTOOLS for many instances but consistently moves more. Table 1 shows the breakdown of definitions found and moved by type. Many more of the definitions moved are AND/OR definitions. Table 1 shows the breakdown of variable movement by definition type. CNFTOOLS has similar syntactic definition detection similar to KISSAT for BiEQ, AND/OR, XOR, but fails to move a fraction of the XOR definitions. CNFTOOLS does detect tens of XORs as monotonic definitions with the wrong definition variable, meaning the BFS picked up nested definitions in the wrong direction w.r.t. quantifier levels. But, the reason for the large gap between CNFTOOLS and KISSAT is efficiency. CNFTOOLS does not detect the vast majority of XOR definitions moved by KISSAT within the time limit, and the same is true for the other definitions. KISSAT uses the entire 10 seconds on 11 formulas whereas CNFTOOLS times out on 111 (mv) and 99 (mb). Increasing the timeout for each tool in the combined approach to 50 seconds produces only 780 more moved variables over 2 formulas. It is clear from the bottom plot in Figure 1 that CN-FTOOLS contributes to the movement of the combined approach in a handful of cases where KISSAT is not on the diagonal. Combining the output of the tools makes use of KISSAT's speed in detecting many simple definitions and CNFTOOLS's ability to find one-sided definitions using complex heuristics and search. No variables found by semantic detection were moved in KISSAT and only 88 were moved in CNFTOOLS (mb). KISSAT found 159,544 right-unique definitions with KIT-TEN, but only 23,457 were left-total. Of those, the majority had defining variables in the same level as the definition variable, and a smaller fraction had the definition variable at an outer level. Similarly with CNFTOOLS, 48,715 (mb) and 147,170 (mv) semantic definitions were detected via. right-uniqueness checks. These semantic definitions may not be introduced or manipulated by users in the same way as the standard definitions, and this would explain why they already occur in the desired quantifier level.
By far the most common reason definitions cannot be moved is that they already appear in the same quantifier level as some of their defining variables. For example, Table 1. The number of definitions found and moved over all instances. Definitions moved are broken down by a selection of the types, omitting ITE and semantic. Some one-sided definitions CNFTOOLS moves are fully-defined, and combined will move them based on the fully-defined definition provided by KISSAT. So, the missing one-sided definitions for combined are spread across the other definition types.  Table 2 shows other reasons a variable may not be moved. A definition is not left-total when the definition variable is at a level outer to some of its defining variables. The tools detected several of these definitions on both universally and existentially quantified variables. Example 2 shows why these variables cannot be moved inwards. Additionally, some of the monotonic definitions extracted by CNFTOOLS are neither fully-defined nor one-sided. This is determined online when a definition variable becomes a candidate for moving. Waiting to make these checks until moving is optimal because many definitions are detected, and a large fraction will be filtered out because of their quantifier level placement. CNFTOOLS detect 2,038,407 (mv) and 1,897,482 (mb) monotonic definitions, but this does not match up with the number of one-sided definitions moved. The majority of monotonic definitions found and moved are actually fully defined. This means for many of the definitions, either δ(x) or δ(x) can be removed from the QBF while preserving equivalence. This can be done in QRAT by recursing through the monotonic definitions and deleting the redundant defining clauses. The large number of fully defined monotonic definitions shows that formulas written in QBF generally do not take advantage of optimized encodings, such as the Plaisted-Greenbaum transformation.

Evaluating Solvers
We used the following solvers to evaluate the impact of variable movement.
-RAREQS (Recursive Abstraction Refinement QBF Solver) [11] pioneered the use of counterexample guided abstraction refinement (CEGAR)-driven recursion and learning in QBF solvers. The 2012 version has comparable performance to current top-tier solvers. -CAQE (Clausal Abstraction for Quantifier Elimination) [17] is the first place winner of the 2017, 2018, and 2020 competitions. The solver is written in RUST and based on the CEGAR clausal abstraction algorithm. -DEPQBF implements the adapted DPLL algorithm QDPLL, relying on dependency schemes to select independent variables for decision making [14]. DEPQBF incorporates QBCE [2] as inprocessing which complicates its relation to preprocessors like BLOQQER. -GHOSTQ is a non-clausal QBF solver [13]. The solver attempts to convert CNF or QCIR to the GHOSTQ format which introduces Ghost variables, the dual of Tseitin variables. The structural information gained by the conversion is important to GHOSTQ's performance. The conversion relies on the discovery of definitions, which is significantly hampered by preprocessors that delete or change clauses. GHOSTQ also supports a CEGAR extension. Figure 2 shows the performance of QBF solvers on the original (-o) and moved (-m) formulas using the combined definition detection. The times include definition detection and proof generation, adding 50 seconds on average. In moved formulas, adjacent quantifier levels of the same type were conjoined into a single quantifier level because of GHOSTQ's internal definition detection. This did not impact the other solvers. Movement significantly improves performance of CAQE, DEPQBF, and GHOSTQ-p (plain mode). GHOSTQ-ce (CEGAR mode) and RAREQS improve slightly with movement. Since both GHOSTQ modes use the same conversion to the GHOSTQ format, the impact of variable movement on the conversion does not explain the difference. GHOSTQ in CEGAR mode and RAREQS use similar solving techniques, and this may explain why they improve little. Separate experiments moving all definitions except XORs did improve the performance of GHOSTQ in both modes while not affecting other solvers. This is because the conversion to the GHOSTQ format only checks the innermost quantifier level for XOR definitions, and cannot find them if they have been moved.
Most state-of-the-art QBF solvers make use of preprocessors. The exception is GHOSTQ because its definition detection suffers after the application of QBCE. Figure 3 shows solver performance with moving variables before applying BLOQQER (m-  b) and only applying BLOQQER (-b). The solving time includes the variable movement and BLOQQER runtime within a 100 second timeout. After moving variables, BLO-QQER solved 3 formulas and those data are reflected in the plot. In addition, each of the 14 formulas BLOQQER solved before movement, BLOQQER also solved after move-ment. This data is constant across solvers so is not included in the plot. Performance improved for all solvers when applying variable movement before BLOQQER. One reason for this is movement may allow for more applications of universal reduction. We also experimented with moving variables after BLOQQER preprocessed the formulas. Few variables were moved, and it did not affect solver performance. This is likely due to QBCE removing defining clauses from the formula.

PGBDDQ Case Study
Two player games can be succinctly represented in QBF, as an existential player versus a universal opponent. Problem variables encode moves alternating between quantifier levels, and definition variables encode the game state as moves are played over time. Given a 1 × N board, the linear domino placement game has two players alternately placing 1 × 2 dominos on the board. The first player who cannot place a domino loses. The game can be encoded with around N 2 /2 problem variables and 3N 2 /2 definition variables. PGBDDQ is a BDD-based, proof-generating QBF solver. [3] It starts at the innermost quantifier level and performs bucket elimination, linearizing variables and eliminating them through a series of BDD operations that are equivalence-preserving. As BDDs are manipulated, PGBDDQ generates a dual proof through a series of clause additions and deletions. PGBDDQ can solve the linear domino placement problem with polynomial performance when definitions are placed after their defining variables (After). In this configuration, moves are processed from the last to the first, with the BDDs at each quantifier level effectively encoding the outcomes of the possible end games for each board state. The performance deteriorates when definition variables are placed in the innermost quantifier level (End). In this configuration, the BDDs at each quantifier level must encode the outcomes of the possible end games in terms of the history of all moves up to that point in the game. Figure 6 shows the performance of PGBDDQ on false formulas where the second player will win. In each configuration, the same hand-crafted BDD variable ordering was used. With the After encoding and without variable movement, PGBDDQ runs out of memory on 32 GB RAM at N = 12. Applying our movement algorithm to this encoding (Move), the solver performs significantly better and solves all formulas up to N = 30 before timeouts occur. This shows how the general problem of memory inefficiency within a BDD can be eased by moving definition variables across quantifier levels. The gap in performance between the Move placement and the After placement may be due to the ordering of variable within a quantifier block or moving variables too far outward. When a variable is moved it can be placed anywhere within a quantifier level as this does not change semantics. Also, variables do not need to be moved all the way to their innermost defining variable. Exploring these options in the context of a structurally dependent solver PGBDDQ may lead to improvements that affect other QBF solvers.

Conclusion and Future Work
We presented a technique for moving definition variables in QBFs. The movement can be verified within the QRAT proof system, and we validated all proofs in the evaluation with QRAT-TRIM. Using the tools KISSAT and CNFTOOLS to detect definitions, we created a tool-chain for variable movement. On the QBFEVAL'20 benchmarks, one quarter of formulas had definitions that could be moved, and the movement increased solver performance. In addition, we found that movement followed by BLOQQER was more effective than preprocessing with BLOQQER.
For future work, incorporating quantifier level information into definition detection could reduce the costs. For example, the hierarchical detection could recurse outwards based on quantifier levels, reducing the number of root clauses explored and reducing the number of incorrect definitions detected. Additionaly, there are ways to expand on variable movement. It is possible to place variables anywhere within a given quantifier level and also to adjust how far variables are moved. Optimizing movement may require understanding how variable movement impacts each solver's internal heuristics and solving algorithm. Separately, monotonic definitions that are not one-sided present an interesting challenge for variable movement, as they occur in both polarities outside of the definition. It might also be possible to move the approximately 160,000 semantic definitions found be KITTEN that were right-unique but not left-total.

Acknowledgements
We would like to thank Armin Biere for feedback on the semantic definition detection in KISSAT, Markus Iser for insight into the hierarchical definition detection of CNFTOOLS, and Will Klieber for his explanation of GHOSTQ's PCNF converter. We also thank the community at StarExec for providing computational resources.