# Symmetries of Quantified Boolean Formulas

While symmetries are well understood for Boolean formulas and successfully exploited in practical SAT solving, less is known about symmetries in quantified Boolean formulas (QBF). There are some works introducing adaptions of propositional symmetry breaking techniques, with a theory covering only very specific parts of QBF symmetries. We present a general framework that gives a concise characterization of symmetries of QBF. Our framework naturally incorporates the duality of universal and existential symmetries resulting in a general basis for QBF symmetry breaking.

## Authors

• 23 publications
• 6 publications
10/02/2019

### Improving Reasoning on DQBF

The aim of this PhD project is to develop fast and robust reasoning tool...
03/01/2021

### Extending Prolog for Quantified Boolean Horn Formulas

Prolog is a well known declarative programming language based on proposi...
11/17/2017

### Exploring the Use of Shatter for AllSAT Through Ramsey-Type Problems

In the context of SAT solvers, Shatter is a popular tool for symmetry br...
05/25/2022

### SAT Preprocessors and Symmetry

Exploitation of symmetries is an indispensable approach to solve certain...
05/12/2019

### Quantifier Localization for DQBF

Dependency quantified Boolean formulas (DQBFs) are a powerful formalism,...
04/29/2019

### QRATPre+: Effective QBF Preprocessing via Strong Redundancy Properties

We present version 2.0 of QRATPre+, a preprocessor for quantified Boolea...
02/16/2016

### Symmetry Breaking Predicates for SAT-based DFA Identification

It was shown before that the NP-hard problem of deterministic finite aut...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Mathematicians are generally advised [1]

not to destroy symmetry in a given problem but instead to exploit it. In automated reasoning, we generally exploit symmetries by destroying them. In this context, to destroy a symmetry means to enrich the given problem by additional constraints which tell the solver that certain parts of the search space are equivalent, so that it investigates only one of them. Such symmetry breaking techniques have been studied since long. They are particularly well developed in SAT

[2] and CSP [3]. In CSP [4] it has been observed that it is appropriate to distinguish two kinds of symmetries: those of the problem itself and those of the solution set. In the present paper, we apply this idea to Quantified Boolean Formulas (QBF).

Symmetry breaking for QBF has already been studied more than ten years ago [5, 6, 7], and it can have a dramatic effect on the performance of QBF solvers. As an extreme example, the instances of the KBKF benchmark set [8] are highly symmetric. For some problem sizes , we applied the two configurations QRes (standard Q-resolution) and LD (long-distance resolution) of the solver DepQBF [9] to this benchmark set. For LD it is known that it performs exponentially better than QRes on the KBKF formulas [10]. The table above shows the runtimes of DepQBF without and with symmetry breaking (SB). While QRes-DepQBF only solves two formulas without symmetry breaking, with symmetry breaking it even outperforms LD-DepQBF. Also for the LD configuration, the symmetry breaking formulas are beneficial. While this is an extreme example, symmetries appear not only in crafted formulas. In fact, we found that about 60% of the benchmarks used in the recent edition of QBFEval have nontrivial symmetries that could be exploited.

Our goal in this paper is to develop an explicit, uniform, and general theory for symmetries of QBFs. The theory is developed from scratch, and we include detailed proofs of all theorems. The pioneering work on QBF symmetries [5, 6, 7] largely consisted in translating the well-known techniques from SAT to QBF. This is not trivial, as universal quantifiers require special treatment. Since then, however, research on QBF symmetry breaking almost stagnated. We believe that more work is necessary. For example, we have observed that universal symmetry breakers concerning universal variables fail to work correctly in recent clause-and-cube-learning QBF solvers when compactly provided as cubes. Although the encoding of the symmetry breaker is provably correct in theory, it turns out to be incompatible with pruning techniques like pure literal elimination for which already the compatibility with learning is not obvious [11]. Problems occur, for example, in the KBKF formulas mentioned above. (Of course, for the reported timings we have only used parts of the symmetry breaking formula which are provably correct both in theory and in practice.)

We hope that the theory developed in this paper will help to resuscitate the interest in symmetries for QBF, lead to a better understanding of the interplay between symmetry breaking and modern optimization techniques, provide a starting point for translating recent progress made in SAT and CSP to the QBF world, and produce special symmetry breaking formulas that better exploit the unique features of QBF.

## 2 Quantified Boolean Formulas

Let be a finite set of propositional variables and be a set of Boolean formulas over . The elements of are well-formed objects built from the variables of , truth constants (true) and (false), as well as logical connectives according to a certain grammar. For most of the paper, we will not need to be very specific about the structure of the elements of . We assume a well-defined semantics for the logical connectives, i.e., for every and every assignment there is a designated value associated to and . In particular, we use (conjunction), (disjunction), (equivalence), (implication), (xor), and (negation) with their standard semantics for combining and negating formulas. Two formulas are equivalent if for every assignment we have . We use lowercase Greek letters for Boolean formulas and assignments.

If is a function and is an assignment, the assignment is defined through (). A partial assignment is a function with . If is such a partial assignment and , then is supposed to be an element of such that for every assignment with we have . For example, imagine that the formula is obtained from by replacing every variable by the truth value .

We use uppercase Greek letters to denote quantified Boolean formulas (QBFs). A QBF has the form where is a Boolean formula and is a quantifier prefix for , i.e., for . We only consider closed formulas, i.e., each element of appears in the prefix. For a fixed prefix , the quantifier block of the variable is defined by the smallest and the largest such that .

Every QBF is either true or false. The truth value is defined recursively as follows: is true iff both and are true, and is true iff or is true. For example, is true and is false. The semantics of a QBF can also be described as a game for two players [12]: In the th move, the truth value of is chosen by the existential player if and by the universal player if . The existential player wins if the resulting formula is true and the universal player wins if the resulting formula is false. In this interpretation, a QBF is true if there is a winning strategy for the existential player and it is false if there is a winning strategy for the universal player.

Strategies can be described as trees. Let be a prefix. An existential strategy for is a tree of height where every node at level has one child if and two children if . In the case , the two edges to the children are labeled by and , respectively. In the case , the edge to the only child is labeled by either or . Universal strategies are defined analogously, the only difference being that the roles of the quantifiers are exchanged, i.e., nodes at level have two successors if (one labeled and one labeled ) and one successor if (labeled either or ). Here are the four existential strategies and the two universal strategies for the prefix :

We write for the set of all existential strategies and for the set of all universal strategies. As shown in the following lemma, existential and universal strategies for the same prefix a share at least one common path. Unless stated otherwise, a path is meant to be complete in the sense that it starts at the root and ends at a leaf.

###### Lemma 1

If is a prefix and , , then and have a path in common.

###### Proof

A common path can be constructed by induction on the length of the prefix. There is nothing to show for prefixes of length . Suppose the claim holds for all prefixes of length  and consider a prefix of length . Let , be arbitrary. By chopping off the leafs of and , we obtain elements of and , respectively, and these share a common path by induction hypothesis. If , then has a unique continuation in , with an edge labeled either or , and has two continuations in , one labeled and one labeled , so the continuation of in must also appear in . If , the argumentation is analogous. ∎

Every path in a strategy for a prefix corresponds to an assignment . An existential strategy for QBF is a winning strategy (for the existential player) if all its paths are assignments for which is true. A universal strategy is a winning strategy (for the universal player) if all its paths are assignments for which is false. For a QBF and an existential strategy , we define , where ranges over all the assignments corresponding to a path of . Then we have if and only if is an existential winning strategy. For a universal strategy , we define , where ranges over all the assignments corresponding to a path of . Then if and only if is a universal winning strategy.

The definitions made in the previous paragraph are consistent with the interpretation of QBFs introduced earlier: a QBF is true if and only if there is an existential winning strategy, and it is false if and only if there is a universal winning strategy. Lemma 1 ensures that a QBF is either true or false. As another consequence of Lemma 1, observe that for every QBF we have

 ∃ s∈S∃(P):[P.ϕ]s=⊤⟺∀ t∈S∀(P):[P.ϕ]t=⊤ and ∀ s∈S∃(P):[P.ϕ]s=⊥⟺∃ t∈S∀(P):[P.ϕ]t=⊥.

We will also need the following property, the proof of which is straightforward.

###### Lemma 2

Let be a prefix for , and let . Then for all we have , and for all we have .

## 3 Groups and Group Actions

Symmetries can be described using groups and group actions [13]. Recall that a group is a set together with an associative binary operation , . A group has a neutral element and every element has an inverse in . A typical example for a group is the set of integers together with addition. Another example is the group of permutations. For any fixed , a permutation is a bijective function . The set of all such functions together with composition forms a group, called the symmetric group and denoted by .

A (nonempty) subset of a group  is called a subgroup of  if it is closed under the group operation and taking inverses. For example, the set of all even integers is a subgroup of , and the set is a subgroup of . In general, a subset of is not a subgroup. However, for every subset we can consider the intersection of all subgroups of containing . This is a subgroup and it is denoted by . The elements of are called generators of the subgroup. For example, we have , but also . A set of generators for is .

If is a group and is a set, then a group action is a map , which is compatible with the group operation in the sense that for all and we have and , where is the neutral element of . Note that when we have a group action, every element of can be viewed as a bijective function .

For example, for and we have a group action by the definition of the elements of . Alternatively, we can let act on a set of tuples of length , say on , via permutation of the indices, i.e., . For example, for we would have , , , etc. As one more example, we can consider the group consisting of all pairs of permutations. The operation for this group is defined componentwise, i.e., . We can let act on a set of two dimensional arrays with shape , say on , by letting the first component of a group element permute the row index and the second component permute the column index. For example, for we then have

If we have a group action , we can define an equivalence relation on via . The axioms of groups and group actions ensure that is indeed an equivalence relation. The equivalence classes are called the orbits of the group action. For example, for the action of on discussed above, there are some orbits of size 1 (e.g., ), some orbits of size 3 (e.g., ), and there is one orbit of size 6 ().

## 4 Syntactic Symmetries

We use group actions to describe symmetries of QBFs. Two kinds of group actions are of interest. On the one hand, we consider transformations that map formulas to formulas, i.e., a group action . On the other hand, we consider transformations that map strategies to strategies, i.e., a group action or . In both cases, we consider groups which preserve the set of winning strategies for a given QBF .

Let us first consider group actions . In this case, we need to impose a technical restriction introduced in the following definition.

###### Definition 3

Let be a prefix for . A bijective function is called admissible (w.r.t. ) if

1. for every assignment and every formula we have ;

2. for every variable the formula only contains variables that belong to the same quantifier block of as .

The first condition ensures that an admissible function preserves propositional satisfiability. In particular, it implies that for any , the formulas and are equivalent, as are and for every binary connective . As a consequence, it follows that the inverse of an admissible function is again admissible. It also follows that an admissible function is essentially determined by its values for the variables. Note however that variables can be mapped to arbitrary formulas.

###### Example 4

Let and . There is an admissible function with . For such a function, we may have . A function with cannot be admissible, because of the second condition. By the first condition, a function with and cannot be admissible.

Next we show that admissible functions not only preserve satisfiability of Boolean formulas, but also the truth of QBFs.

###### Theorem 5

Let be a prefix for and be admissible for . For any the formula is true if and only if is true.

###### Proof

Since the inverse of an admissible function is admissible, it suffices to show “”. To do so, we proceed by induction on the number of quantifier blocks in .

There is nothing to show when is empty. Suppose the claim is true for all prefixes with quantifier blocks, and consider a prefix for some , , and a prefix for with at most quantifier blocks whose top quantifier is not . By the admissibility, we may view as a pair of functions and , where is admissible for . Let be a winning strategy for . We will construct a winning strategy for .

Case 1: . In this case, the upper levels of and consist of single paths. Let be the assignment corresponding to the upper levels of . The subtree of rooted at the end of (level ) is a winning strategy for . By induction hypothesis, has a winning strategy. Let have an initial path corresponding to the assignment followed by a winning strategy of . (Since is invertible and independent of , the assignment is well-defined.) Then is a winning strategy of . To see this, let be an arbitrary path of . We show that . Indeed,

 [f(ϕ)]ρ \vboxto0.0pt\hss$t$startswith$τ$\hssto0.0pt\hss$↓$\hss=[[f(ϕ)]τ]ρ\vboxto0.0pt\hssDef.of$τ$\hssto0.0pt\hss$↓$\hss=[[f(ϕ)]f−11(σ)]ρ\vboxto0.0pt\hssDef.of$f1,f2$\hssto0.0pt\hss$↓$\hss=[[f1(f2(ϕ))]f−11(σ)]ρ =\vboxto0.0pt\hss$↑$\hssto0.0pt\hss$f1$admissible\hss[[f−11(f1(f2(ϕ)))]σ]ρ=[[f2(ϕ)]σ]ρ=\vboxto0.0pt\hss$↑$\hssto0.0pt\hss$f2$admissible\hss[f2([ϕ]σ)]ρ=\vboxto0.0pt\hss$↑$\hssto0.0pt\hsschoiceof$t$\hss⊤.

Case 2: . In this case, the upper levels of both and form complete binary trees in which every path corresponds to an assignment for the variables . Let be such an assignment, and let . Let be the subtree of  rooted at . This is a winning strategy for the formula obtained from by instantiating the variables according to and dropping the corresponding part of the prefix. By induction hypothesis, has a winning strategy. Pick one and use it as the subtree of rooted at . The same calculation as in Case 1 shows that is a winning strategy for . ∎

Next we introduce the concept of a syntactic symmetry group. The attribute ‘syntactic’ shall emphasize that this group acts on formulas, in contrast to the ‘semantic’ symmetry group introduced later, which acts on strategies. Our distinction between syntactic and semantic symmetries corresponds to the distinction between the problem and solution symmetries made in CSP [4].

###### Definition 6

Let be a QBF and let be a group action such that every is admissible w.r.t. . We call a syntactic symmetry group for if and are equivalent for all .

It should be noticed that being a ‘symmetry group’ is strictly speaking not a property of the group itself but rather a property of the action of on . Further, we call a group action admissible if every is admissible and we call a symmetry. Definition 6 implies that when is a syntactic symmetry group for , then for every element the QBF has the same set of winning strategies as . Note that this is not already a consequence of Thm. 5, which only said that is true if and only if is true, which does not imply that they have the same winning strategies.

###### Example 7

Consider the QBF . A syntactic symmetry group for is , where is an admissible function with , , , .

Symmetries are often restricted to functions which map variables to literals. But this restriction is not necessary. Also the admissible function defined by , , , is a syntactic symmetry for .

## 5 Semantic Symmetries

For the definition of semantic symmetry groups, no technical requirement like the admissibility is needed. Every permutation of strategies that maps winning strategies to winning strategies is fine.

###### Definition 8

Let be a QBF and let be a group acting on (or on ). We call a semantic symmetry group for if for all and all (or all ) we have .

A single syntactic symmetry can give rise to several distinct semantic symmetries, as shown in the following example.

###### Example 9

Consider again . The function of the previous example, which exchanges with and with  in the formula, can be translated to a semantic symmetry :

This symmetry exchanges the labels of level 3 and level 4 and swaps the existential parts of the two paths in the middle. Regardless of the choice of , the strategy on the left is winning if and only if the strategy on the right is winning, so maps winning strategies to winning strategies.

Some further semantic symmetries can be constructed from . For example, in order to be a winning strategy, it is necessary that . So we can take a function that just flips and but does not touch the rest of the tree. For the same reason, also a function that just flips and but does not affect the rest of the tree is a semantic symmetry. The composition of these two functions and the function described before (in an arbitrary order) yields a symmetry that exchanges with and with but keeps fixed. Also this function is a semantic symmetry.

The construction described in the example above works in general. Recall that for an assignment and a function , the assignment is defined by for .

###### Lemma 10

Let be a prefix for and be an element of a group acting admissibly on . Then there is a function such that for all we have that is a path of if and only if is a path of .

###### Proof

Since is an admissible function, it acts independently on variables belonging to different quantifier blocks. Therefore it suffices to consider the case where consists of a single quantifier block. If all quantifiers are existential, then consists of a single path, so the claim is obvious. If there are only universal quantifiers, then consists of a complete binary tree containing all possible paths, so the claim is obvious as well. ∎

Starting from a syntactic symmetry group , we can consider all the semantic symmetries that can be obtained from it like in the example above. All these semantic symmetries from a semantic symmetry group, which we call the semantic symmetry group associated to .

###### Definition 11

Let be a prefix for  and let be an admissible group action. Let be the set of all bijective functions such that for all and every path of there exists a such that is a path of . This is called the associated group of .

Again, it would be formally more accurate but less convenient to say that the action of on is associated to the action of on .

###### Theorem 12

If is a syntactic symmetry group for a QBF , then the associated group of is a semantic symmetry group for .

###### Proof

Let . Obviously, is a group. To show that it is a symmetry group, let be a winning strategy for , and let . We show that is again a winning strategy. Let be a path of . By Def. 11, there exists a such that is a path of . Since is a winning strategy, , and since is a symmetry group, . By admissibility . Hence every path of is a satisfying assignment, so is a winning strategy. ∎

The distinction between a syntactic and a semantic symmetry groups is immaterial when the prefix consists of a single quantifier block. In particular, SAT problems can be viewed as QBFs in which all quantifiers are . For such formulas, each tree in consists of a single paths, so in this case the requirement from Def. 8 boils down to the requirement that should hold for all assignments . This reflects the condition of Def. 6 that and are equivalent.

As we have seen in Example 9, there is more diversity for prefixes with several quantifier blocks. In such cases, a single element of a syntactic symmetry group can give rise to a lot of elements of the associated semantic symmetry group. In fact, the associated semantic symmetry group is very versatile. For example, when there are two strategies and some element  of an associated semantic symmetry group such that , then there is also an element with , and for all . The next lemma is a generalization of this observation which indicates that contains elements that exchange subtrees across strategies.

###### Lemma 13

Let be a prefix and be an admissible group action. Let be the associated group of . Let and let be a path of . Let be such that for all and all .

Further, let and . Let be a path of such that the first edges of agree with the first edges of . By the choice of such a exists. Let be the subtrees of rooted at the the th node of , respectively, and let be the strategy obtained from by replacing by , as illustrated in the picture below. Then there exists with .

###### Proof

Define by , , and for all . Obviously, is a bijective function from to . To show that belongs to , we must show that for every and every path of there exists such that is a path of . For we have , so there is nothing to show.

Consider the case . Let be a path of . If does not end in the subtree , then the same path also appears in and we can take . Now suppose that does end in the subtree . Then is also a path of , because all paths of and ending in or agree above the th node. Since , there exists such that is a path of .

Finally, consider the case . Let be a path of . If does not end in the subtree , then the same path also appears in and we can take . Now suppose that does end in the subtree . Then the first edges of agree with those of . Since , there exists such that is a path of . By assumption on , the element fixes first edges of , so ends in  and is therefore a path of , as required. ∎

## 6 Existential Symmetry Breakers

The action of a syntactic symmetry group of a QBF splits into orbits. For all the formulas in the orbit of , the QBF has exactly the same winning strategies as . For finding a winning strategy, we therefore have the freedom of exchanging with any other formula in its orbit.

The action of a semantic symmetry group on splits into orbits. In this case, every orbit either contains only winning strategies for or no winning strategies for at all:

Instead of checking all elements of , it is sufficient to check one element per orbit. If a winning strategy exists, then any such sample contains one.

To avoid inspecting strategies that belong to the same orbit symmetry breaking introduces a formula which is such that has at least one winning strategy in every orbit. Such a formula is called a symmetry breaker. The key observation is that instead of solving , we can solve . Every winning strategy for the latter will be a winning strategy for the former, and if the former has at least one winning strategy, then so does the latter. By furthermore allowing transformations of via a syntactic symmetry group, we get the following definition.

###### Definition 14

Let be a prefix for , let be a group acting admissibly on and let be a group action on . A formula is called an existential symmetry breaker for  (w.r.t. the actions of and ) if for every there exist and such that .

###### Example 15

Consider the formula . All the elements of have the form depicted on the right. As syntactic symmetries, we have the admissible functions defined by , , , and , , , respectively, so we can take as a syntactic symmetry group.

According to standard techniques [7] the formula is a symmetry breaker for . When considering together with (what would be sufficient for SAT), the complications for QBF become obvious. The orbit of is . Now consider the strategy with . For any , this strategy does not satisfy , because is true on one branch, but false on the other. Using semantic symmetries can overcome this problem.

Semantic symmetries can act differently on different paths. Let be the function which exchanges and leaves fixed, let be the function which replaces by and leaves fixed, and let be defined like but with the roles of and exchanged. The group is a semantic symmetry group for . This group splits into four orbits: one orbit consists of all strategies with , , one consists of those with , , one consists of those with , , and on consists of those with , .

Taking together with this group , the formula is a symmetry breaker, because each orbit contains one element with .

The following theorem is the main property of symmetry breakers.

###### Theorem 16

Let be a QBF. Let be a syntactic symmetry group and be a semantic symmetry group acting on . Let be an existential symmetry breaker for and . Then is true iff is true.

###### Proof

The direction “” is obvious (by Lemma 2). We show “”. Let be such that . Since is true, such an exists. Let and be such that such that . Since is an existential symmetry breaker, such elements exist. Since and are symmetry groups, . Lemma 2 implies . By the compatibility with logical operations (admissibility),

 [P.gsyn(ϕ∧ψ)]gsem(s)=[P.(gsyn(ϕ)∧gsyn(ψ))]gsem(s)=⊤.

Now by Thm. 5 applied with to , it follows that there exists such that , as claimed. ∎

As a corollary, we may remark that for an existential symmetry breaker for the prefix the formula is always true. To see this, choose and observe that any groups and are symmetry groups for . By the theorem, is true, so is true.

## 7 Universal Symmetry Breakers

An inherent property of reasoning about QBFs is the duality between “existential” and “universal” reasoning [14], i.e., the duality between proving and refuting a QBF. For showing that a QBF is true, an existential strategy has to be found that is an existential winning strategy. An existential symmetry breaker tightens the pool of existential strategies among which the existential winning strategy can be found (in case there is one).

If the given QBF is false, then a universal strategy has to be found that is a universal winning strategy. In this case, an existential symmetry breaker is not useful. Recall that a universal winning strategy is a tree in which all paths are falsifying assignments. Using an existential symmetry breaker as in Thm. 16 tends to increase the number of such paths and thus increases the number of potential candidates. To aid the search for a universal winning strategy, it would be better to increase the number of paths corresponding to satisfying assignments, because this reduces the search space for universal winning strategies. For getting symmetry breakers serving this purpose, we can use a theory that is analogous to the theory of the previous section.

###### Definition 17

Let be a prefix for , let be a group acting admissibly on and let be a group action on . A formula is called a universal symmetry breaker for  (w.r.t. the actions of and ) if for every there exist and