Does SAT exhibit fractal behavior?
Joost J. Joosten† and Grant Olney Passmore‡
March 20, 2008
Abstract
Maybe, in analogy with Poincaré’s aforementioned
approach to physics, we can single out some qualitative properties of SAT and UNSAT. If we can isolate
topologically well-behaved fragments of the set of all
sets of clauses, this might, for instance, give rise to a
probabilistic approach to deal with SAT membership.
In this paper we study the structure of the set SAT of
all satisfiable propositional logical formulas. In particular we raise the question whether the distribution
of SAT within the set A of all propositional formulas
exhibits fractal behavior. This answer is of course
relative to a metric on A. We show that for one such
metric there is strong evidence that the distribution
does indeed behave wildly. Next we look at an alternative metric.
2
Structuring the set of sets of
clauses
Keywords: theory of computation, boolean satisfiability
Let A denote the set of all sets of clauses. At times
when no confusion can arise, we shall call a set of
clauses also a formula. We shall define a notion of
1 Introduction
distance on A. To this end, let us introduce a relation
One(ϕ, ψ) that defines when two formulas ϕ and ψ
Physics is full of (differential) equations whose so- have distance 1 from each other. We define One(ϕ, ψ)
lutions are either not expressible in terms of known in two steps: first by defining a relation One∗(ϕ, ψ),
analytical functions or give directly rise to uncon- and then deriving One(ϕ, ψ) as its symmetric closure.
trollable dynamical behavior. Poincaré took an interesting turn at tackling these problems. Rather Definition 2.1. Let ϕ = {S1 , . . . Sn } (n ≥ 0) and
′
′
than being interested in the full solution or trajectory ψ = {S1 , . . . Sm } (m ≥ 0) be some given formulas in
of such impenetrable dynamical systems, he consid- A. We define the relation One∗(ϕ, ψ) to hold if one
ered qualitative and topological properties of them of the following applies.
instead (e.g. those properties that do not change un1. If m = n and Si = Si′ for all but one fixed j such
der smooth changes of coordinates).
that (Sj \{l})∪{¬l} = Sj′ for some literal l ∈ Sj .
We would like to make an analogy to computability. The set SAT of all satisfiable sets of clauses in
2. If m = n and Si = Si′ for all but one fixed j such
propositional logic is well defined and actually elethat Sj = Sj′ ∪ {l} for some literal l ∈ Sj .
mentary decidable. However, we know that it is likely
3. If ϕ = ψ ∪ {{l}} for some unit clause {l} ∈ ϕ.
– depending on if P = NP – to be very hard to decide
whether or not some set of clauses S belongs to SAT.
Definition 2.2. We define the relation One(ϕ, ψ) to
† Institute for Logic, Language and Computation, Univerbe the symmetric closure of One∗(ϕ, ψ).
sity of Amsterdam, NL; email:
[email protected]
‡ Laboratory for Foundations of Computer Science, University of Edinburgh, UK; email:
[email protected]
Once we have defined the one-step distance, we can
extend this to all sets of clauses in the following way.
1
Definition 2.3. For given formulas ϕ and ψ, we de- Corollary 2.8. hA, Oi is a complete and separable
fine the distance between them d(ϕ, ψ) to be the length metric space. Equivalently, hA, Oi is a Polish space.
minus one of the shortest sequence
Proof. Completeness follows from the fact that the
hϕ = χ0 , χ1 , . . . , χm−1 = ψi
triviality of a Cauchy sequence implies its limit is
contained in the space. Separability follows simply
such that for each consecutive χi , χi+1 , we have by the fact that A is countable.
One(χi , χi+1 ). We refer to consecutive members of
a sequence with this property as being “single steps.”
Though Corollary 2.8 seems to imply that our
space is quite nice topologically, it is rather not. In
It is important to observe that d is indeed a total
particular, we now observe that the topology generfunction on A × A.
ated by d is in fact discrete.
Lemma 2.4. d : A × A → N is a total function.
Theorem 2.9. hA, Oi is equivalent to the discrete
topology
on A. That is, O = 2A .
Proof. Given any fixed ϕ, ψ ∈ A it suffices to show
that at least one path of single steps exists between
ϕ = {S1 , . . . , Sn } and ψ = {S1′ , . . . , Sm }. Consider Proof. The proof is easy, by showing that every sinthe sequence that is built by removing each literal gleton pointset is open.
appearing in an Si in ϕ one by one until ϕ has been
Nevertheless, d still endows A with some rather
transformed into the set containing only the empty
clause. Then build up each Sj′ in ψ step by step in interesting and seemingly chaotic structure. We now
turn to analysing the qualitative interaction between
the analogous manner.
UNSAT and SAT under hA, Oi.
Lemma 2.5. d : A × A → N is a metric function.
2.1
Proof. It is clear that (i) d(ϕ, ψ) ≥ 0, (ii) d(ϕ, ψ) = 0
iff ϕ = ψ, and (iii) d(ϕ, ψ) = d(ψ, ϕ). The triangle
inequality, d(ϕ, λ) ≤ d(ϕ, ψ) + d(ψ, λ) also holds for
all ϕ, ψ, λ ∈ A as a path from ϕ to ψ and a path from
ψ to λ can be composed to obtain a path from ϕ to
λ.
Unsatisfiable formulas
The simplest unsatisfiable formula is ⊥, the set containing only the empty clause. It is easy to observe
that all formulas distance one from ⊥ are satisfiable. In this sense, we can see ⊥ as a little island
within a surrounding sea of satisfiable formulas. Let
Thus, we obtain a topology on A, hA, Oi, gener- us make this intuitive notion precise and then address
ated by the collection of open n-balls O∗ defined as the question as to whether or not more islands exist.
follows:
Definition 2.10. Let P be a property on A and let
[ [
x ∈ A with P (x). With ~xP we denote the set of all
{
O∗ =
{{ψ ∈ A | d(ϕ, ψ) < n}}}.
points that can be reached from x using only distance
ϕ∈A n∈N
one steps to other points with property P . This set is
Definition 2.6. We call a Cauchy sequence c = inductively defined as follows:
hϕ0 , ϕ1 , . . .i trivial iff
1. P (x) ⇒ x ∈ ~xP ,
∃n ∈ N ∀m ∈ N (m ≥ n ⇒ ϕm = ϕm+1 ).
2. y ∈ ~xP ∧ One(y, z) ∧ P (z) ⇒ z ∈ ~xP .
Lemma 2.7. The only Cauchy sequences over hA, Oi
We say that x and y are connected if y ∈ ~xP . A
are trivial.
set B is called connected whenever all of its points
We immediately obtain the following corollary.
are.
2
Definition 2.11. Let P be a property on A. We say
Note that the formula ⊤, that is the empty set, is
that P contains an island if there is some x and y also connected to any other satisfiable formula.
with P (x), P (y), such that x ∈
/ ~yP .
Note that the distances between x and y using
Lemma 2.12. UNSATcontains an island.
paths within SAT or UNSAT are linear in the sum
of the number of literals appearing in x and y.
Proof. Consider ⊥, the set with just the empty
clause.
2.2
Lemma 2.13. For any two x, y ∈ UNSAT \ ⊥ we
have x ∈ ~yP .
Metric relations between SAT and
UNSAT
In the previous subsection we focused solely upon the
topological structure of SAT and UNSAT. Let us now
make some quantitative observations.
Proof. We can define a sequence of unsatisfiable formulas that bring us from x to y by taking only single
steps as follows. Start with x, first add {p} to x,
where {p} is some unit clause appearing in neither
x nor y. Next, add {¬p} to x. Finally remove one
by one the rest of x until {p} and {¬p} are all that
remain. As at all times, both {p} and {¬p} are contained in the set of clauses, each intermediate formula
in the sequence is unsatisfiable. Finally, build up y
step by step. The last two steps will be to throw away
the spurious {¬p} and {p} to end with y.
Lemma 2.16. ∀ x∈SAT ∃ y∈UNSAT d(x, y) ≤ 2.
Proof. In two steps we adjoin two new unit clauses
with complementary literals.
So, in this sense the satisfiable formulas are thin
within the unsatisfiable ones. The next lemma says
that, in a certain sense, the set UNSAT is not thin in
SAT.
Corollary 2.14. UNSAT consists of two islands.
Lemma 2.17. ∀ n∈N ∃ x∈UNSAT ∀ y∈SAT d(x, y) ≥
2n.
Theorem 2.15. SAT is connected.
Proof. Consider x, y ∈ SAT. We shall define again
a path in SAT from x to y consisting of only single
steps. As x is satisfiable, we can find a satisfying
assignment α. So, for each clause, there is at least one
literal satisfied by α. In each clause in x, select one
such satisfied literal. Now, from each clause throw
away all non-selected literals by taking only single
steps. At this stage, we have a set of unit clauses.
Now, select one such unit clause, {p}, and reduce
the remaining formula to contain only {p} by taking
single steps.
As y is also satisfiable, there is some assignment β
satisfying it. It is clear that we can build up y from
the single unit clause {p} in a way similar to (but
reverse of) the manner in which we came from x to
{p}. If β |= ¬p we might first need to flip the polarity
in our unit clause {p} if p occurs at all in some clause
in y. This is admissible as flipping the polarity of
a literal is indeed a single step (see case (1) of the
definition of One∗).
Proof. Consider the set consisting of n distinct pairs
of complementary unit clauses.
The combination of 2.16 and 2.17 suggests some
wild topological structure on SAT, especially around
the area where there are about as many satisfiable as
non-satisfiable formulas, see [2] [1].
Question 2.18. Is there a way to capture this wild
structure?
3
3.1
Towards a more general
space of propositions
Probabilistic propositions
As we wish to employ analytical techniques to investigate SAT, we seek an isometric embedding of A into
a continuous Polish space. We first define P.
3
This is because probabilistic propositions, while they
may be of any arbitrary finite size, are themselves
only each built from finitely many probabilistic literals. The next step towards constructing our metric
will be to define the notion of a literal valuation vector
for each ϕ ∈ P.
Definition 3.1. Let L be the set of propositional literals. Let P ∗ = L × [0, 1]. If x = hl, ri ∈ P ∗ we call
x a “probabilistic literal.” We define P to be the set
of all sets of clauses ϕ built from probabilistic literals
with the property that for all l ∈ L,
{r | ∃Si ∈ ϕ (hl, ri ∈ Si )}
Definition 3.4. Given ϕ ∈ P, we define the literal
valuation vector for ϕ to be the (countably) infinite
dimensional vector σ(ϕ) with the following property:
is a singleton.
We call members of P “probabilistic propositions.”
Thus, each l ∈ L exists in P ∗ continuum many times,
once for each r ∈ [0, 1], and P is the set of all sets of
clauses built from literals in P ∗ with the restriction
that no classical propositional literal appears in the
same probabilistic proposition with more than one
real valuation attached to it. If x = hl, ri ∈ P ∗ , we
let π0 (x) = l and π1 (x) = r.
On the way to defining our metric ∂ : P × P → R,
we fix a bijection from between L and N.
σ(ϕ)[n] = r if ∃Si ∈ ϕ s.t. ∃hl, ri ∈ Si (γ(l) = n),
σ(ϕ)[n] = 0 otherwise.
This vector is well-defined, since by definition if a
probabilistic proposition ϕ ∈ P contains both hl, ri
and hl, r′ i in any of its clauses, then r = r′ . It is
easy to construct two different probabilistic propositions that nevertheless yield the same literal valuation
vector. Our metric accommodates this fact by combining geometric aspects of the literal valuation vector
together with topological aspects of the metric d.
Definition 3.2. Let γ : L → N be some bijection.
We may now define our metric ∂ : P × P → R.
We now recall a space familiar to functional analysts, the countable direct sum of Euclidean space.
Definition 3.5. Let ϕ, ψ ∈ P. We define the ∂distance between ϕ and ψ, ∂(ϕ, ψ), as follows:
Definition 3.3. We first define its domain E∞ and
then derive its topology from the standard metric.
∂(ϕ, ψ) = d∞ (σ(ϕ), σ(ψ)) + d(πA (ϕ), πA (ψ)).
E∞ = ⊕n∈N R.
where πA : P → A is the “forgetful projection map”
that takes a probabilistic proposition to its classical
Now, members of E∞ are simply infinite dimensional counterpart (by ignoring the literal valuations).
vectors with only finitely many nonzero real components. The standard metric d∞ : E∞ × E∞ → R is Theorem 3.6. ∂ : P × P → R is a metric on P.
the straight-forward generalization of the Pythagorean
Proof. We verify each metric axiom in turn: (i)-(iii)
Theorem one would expect. That is, given x, y ∈ E∞
are immediate. (iv) Given ϕ, ψ, λ ∈ P, we have
sX
∂(ϕ, λ) = d∞ (σ(ϕ), σ(λ)) + d(πA (ϕ), πA (λ))
(x[n] − y[n])2 .
d∞ (x, y) = 2
≤ (d∞ (σ(ϕ), σ(ψ)) + d∞ (σ(ψ), σ(λ)))
n∈N
+ (d(πA (ϕ), πA (ψ)) + d(πA (ψ), πA (λ)))
≤ (d∞ (σ(ϕ), σ(ψ)) + d(πA (ϕ), πA (ψ)))
Observe that since any two x, y ∈ E∞ agree for all but
+ (d∞ (σ(ψ), σ(λ)) + d(πA (ψ), πA (λ)))
finitely many components, d∞ (x, y) always converges.
≤ ∂(ϕ, ψ) + ∂(ψ, λ).
It is readily observed to be a metric.
Theorem 3.7. There is an isometry Π : A → P.
As the members of E∞ are simply infinite dimensional vectors with only finitely many nonzero real Proof. Let Π map each ϕ ∈ A to the equivalent forcomponents, this space provides a wonderful frame- mula over P in which each literal occurring in ϕ is
work for embedding our probabilistic propositions. assigned the valuation 0.
4
Theorem 3.8. hP, ∂i is complete.
Proof. Consider any ∂ Cauchy sequence c =
hx0 , x1 , . . .i.
If c is trivial, its limit must be
in P. Consider c nontrivial. As ∂(xi , xi+1 ) =
d∞ (σ(xi ), σ(xi+1 )) + d(πA (xi ), πA (xi+1 )), it follows,
as d takes values only in N, that an index n ∈ N must
exist s.t. ∀m ∈ N (m ≥ n → πA (xm ) = πA (xm+1 )).
That is, the Cauchy sequence c′ = hxn , xn+1 , . . .i
must converge solely w.r.t. the metric d∞ upon the
corresponding literal valuation vectors in the space
E∞ , and moreover we see that the underlying classical proposition (e.g. that given by πA (xi ) for each
element of c′ ) must after index n remain constant. It
then follows that the number of nonzero entries in the
literal valuation vectors for each element of c′ must
remain constant, and thus the limit w.r.t. d∞ of the
sequence of literal valuation vectors lies in E∞ . But
then since for all ~v ∈ E∞ there exists some ϕ ∈ P s.t.
σ(ϕ) = ~v , we have
lim c = lim c′ = lim hxn , xn+1 , . . .i = ψ
s.t. ∀i ∈ N (πA (ψ) = πA (xi )) ∧ σ(ψ) = lim σ(xn ).
But, such a ψ exists uniquely in P. Thus, every ∂
Cauchy sequence in P converges to a limit in P.
Theorem 3.9. hP, ∂i is separable.
Proof. Consider the space of forumlas generated by
the collection of probabilistic literals whose literal
valuation vectors contain only rational values.
Thus, our space hP, ∂i is an uncountable continuous Polish space that admits an isometric embedding
of our natural discrete metric space. We present this
space as an avenue for future investigations.
References
[1] A. Alou, A. Ramani, I. Markov, K. Sakallah, Solving Difficult Instances of Boolean Satisfiability in
the Presence of Symmetry. IEEE Transactions on
CAD, 22(9):1117-1137, September 2003.
[2] P. Beame, Phase Transitions in Proof Complexity
and Satisfiability Search. AAAS Annual Meeting,
Seattle, February 2004.
5