<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>M AT H C H E C K2: A SAT+CAS Verifier for Combinatorial Conjectures</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Curtis Bright</institution>
          ,
          <addr-line>Vijay Ganesh , Albert Heinle , Ilias Kotsireas</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>From Doron Zeilberger's talk at the Fields institute in Toronto</institution>
          ,
          <addr-line>December 2015 (</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>-In this paper, we outline MATHCHECK2, a combination of a SAT solver and a computer algebra system (CAS) aimed at finitely verifying or counterexampling mathematical conjectures. Using MATHCHECK2 we verified the Hadamard conjecture from design theory for matrices up to order 144 and many additional orders up to 168. Also, we provide independent verification of the claim that Williamson matrices of order 35 do not exist, and demonstrate for the first time that 35 is the smallest number with this property. In the course of our work, we discovered over 500 Hadamard matrices which were not equivalent to any matrices in the comprehensive MAGMA Hadamard database. The crucial insight behind MATHCHECK2 is that a combination of an efficient search procedure (like those in SAT solvers) with a domain-specific knowledge base (à la CAS) can be a very effective way to verify, counterexample, and learn deeper properties of mathematical conjectures (especially in combinatorics) and the structures they refer to. MATHCHECK2 can be seen as a systematic parallel generator of structures referred to by the conjecture-under-verification C, and these conjectures are typically of the form “for all natural numbers n, some combinatorial object exists”. MATHCHECK2 uses a divideand-conquer approach to parallelize the search, and a CAS to prune away classes whose members are guaranteed to not satisfy the conjecture C. The SAT solver is used to verify whether any of the remaining structures for each number n satisfy C, and in addition learn UNSAT cores in a conflict-driven clauselearning style feedback loop to further prune the search space. Finally, our latest version of MATHCHECK2 (updated from our previously presented version [5]) uses programmatic methods to learn clauses which are generated on-the-fly by domain-specific constraints.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>“Brute-brute force has no hope. But clever, inspired
brute force is the future.” – Doron Zeilberger1</p>
      <p>
        Many conjectures in combinatorial mathematics are simple
to state but very hard to verify. For example, a conjecture
like the Hadamard [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] might assert the existence of certain
combinatorial objects in an infinite number of cases, which
makes exhaustive search impossible. In such cases,
mathematicians often resort to finite verification in the hopes of learning
some meta property of the class of combinatorial structures
they are investigating, or discover a counterexample to such
conjectures. However, even finite verification of combinatorial
conjectures up to some finite bound is very difficult, because
the search space for such conjectures is often exponential in the
size of the structures they refer to. This makes straightforward
brute-force search impractical, and also ansatz-driven methods
do not scale well enough in general.
      </p>
      <p>
        In recent years, conflict-driven clause-learning (CDCL)
Boolean SAT solvers [
        <xref ref-type="bibr" rid="ref18 ref19 ref3">3, 18, 19</xref>
        ] have become very efficient
general-purpose search procedures for a large variety of
applications. Despite this remarkable progress these algorithms
have worst-case exponential time complexity, and may not
perform well by themselves for many search applications.
Put differently, SAT solvers are probably the best
generalpurpose search procedures we currently have, and can become
more efficient with appropriately encoded domain-specific
knowledge. By contrast, computer algebra systems (CAS)
such as MAPLE [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], MATHEMATICA [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ], and SAGE [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] are
often a rich storehouse of algorithms to obtain domain-specific
knowledge, but do not contain sophisticated, general-purpose
search procedures.
      </p>
      <p>Fortunately the strengths of modern SAT solvers and CAS
are complementary, i.e., the domain-specific knowledge of a
CAS can be crucially important in cutting down the search
space associated with combinatorial conjectures, while at the
same time the clever heuristics of SAT solvers, in conjunction
with CAS, can efficiently search a wide variety of such spaces.</p>
      <p>
        The success of the SAT and CAS combination has been
demonstrated in papers on MATHCHECK [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ] and
MATHCHECK2 [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. In the first paper, Ganesh et al. explored one
way of combining these two classes of systems wherein the
CAS was used as a theory solver, à la DPLL(T), to add theory
lemmas to the SAT solvers that was the primary driver of
the search. They used MATHCHECK to finitely verify (i.e.,
verify up to some finite bound) conjectures from graph theory.
In the second paper, the method was generalized to work
with combinatorial structures, in particular Hadamard matrices.
Hadamard matrices are 4n 4n matrices H with 1 entries
for which H H T is a diagonal matrix with each diagonal entry
equal to 4n. The Hadamard conjecture states that such a matrix
exists for any natural number n. In particular, we specialize
in Hadamard matrices generated by the so-called Williamson
method. MATHCHECKwas restructured to contain a generator,
which divides the seach space a priori into equivalence classes
using CAS systems. The additional information about each of
these equivalence classes enabled us to ignore many of the
classes in our search, since we were able to prove with a CAS
that these cannot contain a solution. We were able to construct
Hadamard matrices – using the Williamson construction method
– for orders as large as 168, and verified that Williamson
matrices do not exist in order 35. This was a result which
was previously computed using a different methodology by
D. Ðokovic´ [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ], who requested an independent verification.
      </p>
      <p>
        In this paper, we present a refinement of our methods and
an improved implementation of MATHCHECK2. Previously,
we observed that many of the generated SAT instances used
a common set of clauses to help prune away the search
space. With more and more of these pruning results included
the number of these clauses increased and could harm the
performance of the SAT solver. To assist the SAT solver,
we chose to encode some constraints using a programmatic
approach as presented by Ganesh et al. [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. Using this
approach we were able to generate Williamson matrices of all
even orders up to 42 in a feasible amount of time. Note that
previously done searches for Williamson matrices assumed that
the order was odd, leveraging additional symmetry in these
cases.
      </p>
      <sec id="sec-1-1">
        <title>A. Contributions</title>
        <p>
          This paper makes the following contributions:
1) An improvement of our prototype MATHCHECK2, a
combination of CAS and SAT solvers for finitely
verifying or counterexampling math conjectures. We discuss
three techniques in Section IV that dramatically improve
the search capabilities of the basic MATHCHECK2
methodology. We further show how we assist the SAT
solver by performing certain checks programmatically
using a CAS and thereby prune away parts of the search
space significantly. All three techniques can be adapted
for other conjectures, beyond the ones considered in this
paper. https://sites.google.com/site/uwmathcheck/.
2) Description of a novel algorithm for finding Williamson
matrices of a given order (or showing that none exist).
This algorithm makes use of recent theorems about the
properties of compressed sequences [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ] and invariants
which significantly limit the number of compressed
sequences to search.
3) Submission of the Hadamard matrices generated by
our system (up to order 168) to the MAGMA database
of Hadamard matrices. Up until now, more than 500
matrices were generated by us which are not equivalent
to any matrix previously included in this database. (We
keep a list that is regularly updated at https://sites.google.
com/site/uwmathcheck/hadamard-conjecture.) Such
matrices that are not equivalent to any previously known
Hadamard matrix are very useful in practical applications
of coding theory.
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>II. ARCHITECTURE OF MATHCHECK2</title>
      <p>The architecture of our proposed MATHCHECK2 system is
outlined in Figure 1. At its heart is a generator of combinatorial
structures, which uses data provided to it by CAS functions
to prune the search space and interfaces with SAT solvers
to verify the conjecture-in-question. The generator contains
functions useful for translating combinatorial conditions into
Problem</p>
      <p>Generator
SAT</p>
      <p>UNSAT</p>
      <p>SAT instance
Domain-specific constraints
assums : vars( ) ! fT; Fg</p>
      <p>SAT solver result
(Solution or
UNSAT core)</p>
      <p>SAT+CAS
clauses which can be read by a SAT solver. It is possible to
substitute the SAT solver with an SMT solver to simplify the
encoding process, but this resulted in a too large overhead
in our computations. The generator is currently optimized to
deal with conjectures which concern Hadamard matrices from
coding and combinatorial design theory.</p>
      <p>
        Once the class of combinatorial objects has been determined,
the script accepts a parameter n which determines the size
of the object to search for. For example, when searching for
Hadamard matrices, the parameter n denotes the order (i.e., the
number of rows) of the matrix. The generator then queries the
CAS (we chose MAPLE in our calculations) it is interfaced with
for properties that any order n instance of the combinatorial
object in question must satisfy. However, since our generator
is written in Python, many CAS functionality is provided
by certain modules such as NUMPY [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ]; in order to avoid
overhead in calling a CAS specifically, we tried to use these
module functions whenever possible. The result returned by
the CAS is read by the generator and then used to prune the
space which will be searched by the SAT solver.
      </p>
      <p>Once the generator determines the space to be searched it
splits the space into distinct subspaces in a divide-and-conquer
fashion. Once the partitioning of the search space has been
completed, the script generates two types of files:
1) A single “master” file in DIMACS2 format which
contains the conditions specifying the combinatorial object
being searched for. These are encoded as propositional
formulae in conjunctive normal form. An assignment to
the variables which makes all of them true would give
a valid instance of the object being searched for (and
a proof that no such assignment exists proves that no
instance of the object in question exists).
2) A set of files which contain partial assignments of the
variables in the master file. Each file corresponds to
exactly one subspace of the search space produced by
the generator.</p>
      <p>The main advantage of splitting up the problem in such a
way is that it easily facilitates parallelization. Using domain
2For more information on this format, please refer to http://www.
satcompetition.org/2009/format-benchmarks2009.html
specific knowledge, we partition the search space into different
classes of the same mathematical structure, and since these
classes are independent of each other, a cluster of SAT solvers
can search the space for each partition in parallel.</p>
      <p>As a new feature, the generator does not include all clauses
for sanity checks into the files. We rather perform the most
common checks programmatically in a feedback loop inside
the SAT solver. In this way, we reduce the number of
needed clauses in each file, and we observed a speedup of
MATHCHECK2 when searching for Hadamard matrices.</p>
      <p>
        Furthermore, an UNSAT core (generated by SAT solvers
such as MAPLESAT [
        <xref ref-type="bibr" rid="ref16 ref17">17, 16</xref>
        ]) can often be used to further
prune away other similar instances. The UNSAT core of
an unsatisfiable formula is a set of clauses that pithily
characterizes the reason why is unsatisfiable and thus encodes
an unsatisfying subspace of the search space.
      </p>
    </sec>
    <sec id="sec-3">
      <title>III. MATHEMATICAL BACKGROUND In this section we discuss the definitions and theorems used in this work.</title>
      <sec id="sec-3-1">
        <title>A. Hadamard and Williamson matrices</title>
        <p>Definition 1. A matrix H 2 f 1gn n, n 2 N, is called a
Hadamard matrix, if for all i 6= j 2 f1; : : : ; ng, the dot
product between row i and row j in H is equal to zero. We
call n the order of the Hadamard matrix.</p>
        <p>Two Hadamard matrices H1 and H2 are said to be equivalent
if H2 can be generated from H1 by applying a sequence of
negations/permutations to the rows/columns of H1, i.e., if
there exist signed permutation matrices U and V such that
U H1 V = H2.</p>
        <p>One prominent class of special Hadamard matrices are those
generated by so-called Williamson matrices.</p>
        <p>
          Theorem 1 (cf. [
          <xref ref-type="bibr" rid="ref26">26</xref>
          ]). Let n 2 N and let A, B, C, D 2
f 1gn n. Further, suppose that
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>1) A, B, C, and D are symmetric;</title>
        <p>2) A, B, C, and D commute pairwise (i.e., AB = BA,</p>
        <p>AC = CA, etc.);
3) A2 + B2 + C2 + D2 = 4nIn, where In is the identity
matrix of order n.</p>
      </sec>
      <sec id="sec-3-3">
        <title>Then a Hadamard matrix of order 4n can be constructed (for</title>
        <p>
          details see [
          <xref ref-type="bibr" rid="ref26">26</xref>
          ]).
        </p>
        <p>For practical purposes, one considers A, B, C, and D in the
Williamson construction to be circulant matrices, i.e., those
matrices in which every row is the previous row shifted by one
entry to the right (with wrap-around, so that the first entry of
each row is the last entry of the previous row). Such matrices
are completely defined by their first row [x0; : : : ; xn 1] and
always satisfy the commutativity property. If the matrix is also
symmetric then we must further have x1 = xn 1, x2 = xn 2,
and in general xi = xn i for i = 1, : : : , n 1. Therefore, if
a matrix is both symmetric and circulant its first row must be
of one of the two forms
[x0; x1; x2; : : : ; x(n 1)=2; x(n 1)=2; : : : ; x2; x1]
[x0; x1; x2; : : : ; xn=2 1; xn=2; xn=2 1; : : : ; x2; x1]
(1)
according to if n is odd or even.</p>
      </sec>
      <sec id="sec-3-4">
        <title>Definition 2. A symmetric sequence of length n is one of the</title>
        <p>form (1), i.e., one which satisfies xi = xn i for i = 1, : : : ,
n 1.</p>
        <p>Williamson matrices are circulant matrices A, B, C, and D
which satisfy the conditions of Theorem 1. Since they must
be circulant, they are completely defined by their first row. (In
light of this, we may simply refer to them as if they were
sequences.)</p>
      </sec>
      <sec id="sec-3-5">
        <title>B. Williamson equivalences</title>
        <p>
          There are three types of operations which, when applied
to the Williamson matrices, produce different but essentially
equivalent matrices. For our purposes, generating just one of the
equivalent matrices will be sufficient, so we impose additional
constraints on the search space to cut down on extraneous
solutions and hence speed up the search.
1. Ordering: Note that the conditions on the Williamson
matrices are symmetric with respect to A, B, C, and D. In
other words, those four matrices can be permuted amongst
themselves and they will still generate a valid Hadamard matrix.
Given this, we enforce the constraint that
jrsum(A)j
jrsum(B)j
jrsum(C)j
jrsum(D)j;
where rsum(X) denotes the sum of the entries of the first (or
any) row of X. Any A, B, C, and D can be permuted so that
this condition holds.
2. Negation: The entries in the sequences defining any of
A, B, C, or D can be negated and the sequences will still
generate a Hadamard matrix. Given this, we do not need to
try both possibilities for the sign of the rowsum of A, B,
C, and D. For example, we can choose to enforce that the
rowsum of each of the generating matrices is nonnegative.
Alternatively, when n is odd we can choose the signs so they
satisfy rsum(X) n (mod 4) for X 2 fA; B; C; Dg. In this
case, a result of Williamson [
          <xref ref-type="bibr" rid="ref26">26</xref>
          ] says that aibicidi = 1 for
all 1 i (n 1)=2.
3. Permuting entries: We can reorder the entries of the
generating sequences with the rule ai 7! aki mod n where k
is any number coprime with n, and similarly for bi, ci, di
(the same reordering must be applied to each sequence for the
result to still be equivalent). Such a rule effectively applies an
automorphism of Zn to the generating sequences.
        </p>
      </sec>
      <sec id="sec-3-6">
        <title>C. Filtering theorem</title>
        <p>Because the search space for Hadamard matrices is so large,
it is advantageous to focus on a specific construction method
and use known properties of that construction type to filter the
search space. We now list the definitions we need to state the
main such filtering theorem we used.</p>
        <p>Definition 3. The power spectral density of the sequence A
is the nonnegative real sequence</p>
        <p>PSDA(s) := jDFTA(s)j2
for s 2 Z
where DFTA is the discrete Fourier transform of A.
Definition 4. The periodic autocorrelation function of the
sequence A is the periodic function given by</p>
        <p>PAFA(s) :=</p>
        <p>In order to check if a matrix H 2 f 1gn n with rows
H0, : : : , Hn 1 is Hadamard, it is necessary to verify that
Hi Hj = 0 for all 0 i; j &lt; n with i 6= j. In other words,
we want to verify that the componentwise product
Hi Hj =
hi;0 hj;0
hi;1 hj;1
hi;n 1 hj;n 1
a(d) = aj + aj+d +</p>
        <p>j</p>
      </sec>
      <sec id="sec-3-7">
        <title>Theorem 2. Let A, B, C, and D be sequences of length</title>
        <p>n = dm which satisfy
Then we say that the sequence A(d) = [a(0d); a(1d); : : : ; a(dd)1] is
the m-compression of A.</p>
        <p>Since PSDX (s) is always nonnegative, equation (3) implies
that PSDA(d) (s) 4n (and similarly for B, C, D). Therefore if
a candidate compressed sequence A(d) satisfies PSDA(d) (s) &gt;
4n for some s 2 Z then we know that the uncompressed
sequence A can never be one of the sequences which satisfies
the preconditions of Theorem 2.</p>
      </sec>
      <sec id="sec-3-8">
        <title>D. Useful lemmas</title>
        <p>In the course of our research we discovered the following
useful properties of the compressed sequences which arise in
our context. These lemmas significantly reduce the number of
SAT instances we need to generate.</p>
        <p>Lemma 1. If A is a sequence of length n = dm with 1
entries, then the entries ai(d), i 2 f0; : : : ; d 1g, have absolute
value at most m and ai(d) m (mod 2).</p>
      </sec>
      <sec id="sec-3-9">
        <title>Lemma 2. The compression of a symmetric sequence is also</title>
        <p>symmetric.</p>
        <p>IV. ENCODING AND SEARCH SPACE PRUNING TECHNIQUES</p>
        <p>An attractive property of Hadamard matrices when encoding
them in a SAT context is that each of their entries is one of
two possible values, namely 1. We choose the encoding that
1 is represented by true and 1 is represented by false. We call
this the Boolean value or BV encoding. Under this encoding,
the multiplication function of two x, y 2 f 1g becomes
the XNOR function in the SAT setting, i.e., BV(x y) =
XNOR(BV(x); BV(y)).</p>
      </sec>
      <sec id="sec-3-10">
        <title>B. Williamson autocorrelation encoding</title>
        <p>The Williamson encoding is very similar to the general
encoding but with fewer variables; we merely have the 4 n+1
2
variables
a0; a1; : : : ; ad(n 1)=2e; b0; : : : ; bd(n 1)=2e;</p>
        <p>c0; : : : ; cd(n 1)=2e; d0; : : : ; dd(n 1)=2e:</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Also, instead of the conditions rsum(Hi</title>
      <p>we must enforce the conditions
Hj ) = 0 for i 6= j
rsum(Ai Aj + Bi Bj + Ci Cj + Di Dj ) = 0 for i 6= j:
(4)
Like in Section IV-A this is done by defining new variables
to represent the entries of the componentwise products. Also,
note that because of the symmetry and circulant properties
most of the conditions to enforce will be identical. In fact, it is
only necessary to encode (4) for i = 0 and j = 1, : : : , n2 1
to ensure that such matrices generate a valid Hadamard matrix.</p>
      <sec id="sec-4-1">
        <title>C. Technique 1: Sum-of-squares decomposition</title>
        <p>As a special case of compression, consider what happens
when d = 1 and m = n. In this case, the compression of A
is a sequence with a single entry whose value is Pn 1
k=0 ak =
rsum(A). If A, B, C, and D are f 1g-sequences which satisfy
the conditions of Theorem 2, then the theorem applied to this
m-compression says that
PAFA(1) (0) + PAFB(1) (0) + PAFC(1) (0) + PAFD(1) (0) = 4n
which simplifies to</p>
        <p>rsum(A)2 + rsum(B)2 + rsum(C)2 + rsum(D)2 = 4n;
and by Lemma 1 each rowsum must have the same parity as n.</p>
        <p>
          In other words, the rowsums of the sequences A, B, C, and
D decompose 4n into the sum of four perfect squares whose
parity matches the parity of n. Since there are usually only a
few ways of writing 4n as a sum of four perfect squares this
severely limits the number of sequences which could satisfy the
hypotheses of Theorem 2. Furthermore, some computer algebra
systems contain functions for explicitly computing what the
possible decompositions are (e.g., PowersRepresentations
in MATHEMATICA and nsoks by Joe Riel of Maplesoft [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ]).
We can query such CAS functions to determine all possible
values that the rowsums of A, B, C, and D could possibly
take. For example, when n = 35 we find that there are exactly
three ways to write 4n as a sum of four positive odd squares
in ascending order, namely,
12+32+32+112 = 12+32+72+92 = 32+52+52+92 = 4 35:
Any Williamson quadruple is equivalent to another quadruple
whose rowsum sum-of-squares decomposition is of one of the
above three types.
        </p>
        <p>When using this technique it is necessary to encode
constraints on the rowsum of the generating matrices, e.g.,
rsum(A) = 1. This may be simply done by using a binary
adder network on the variables a0, : : : , ad(n 1)=2e. We give
the variables which appear twice in the first row of A (due to
symmetry) a weight of 2 in the binary adder network so that
the rowsum is computed correctly.</p>
      </sec>
      <sec id="sec-4-2">
        <title>D. Technique 2: Divide-and-Conquer</title>
        <p>Because each instance can take a significant amount of
time to solve, it is beneficial to divide instances into multiple
partitions, each instance encoding a subset of the search space.
In our case, we found that an effective splitting method was to
split by compressions, i.e., to have each instance contain one
possibility of the compressions of A, B, C, and D. To do this,
we first need to know all possible compressions of A, B, C,
and D. These can be generated by applying Lemmas 1 and 2.
For example, when n = 35 and d = 5 there are 28 possible
compressions of A with rsum(A) = 1. Of those, only 12 satisfy
PSDA(s) 4n for all s 2 Z. The calculation of PSDA(s)
was possible to be performed within Python using NUMPY
instead of directly querying a CAS. There are also 12 possible
compressions for each of B, C, and D with rsum(B) =
rsum(C) = 3 and rsum(D) = 11. Thus there are 124 total
instances which would need to be generated for this selection
of rowsums, however, only 41 of them satisfy the conditions
given by Theorem 2.</p>
        <p>Furthermore, if n has two nontrivial divisors m and d then
we can find all possible m-compressions and d-compressions
of A, B, C, and D. In this case, each instance can set both
the m-compression and the d-compression of each of A, B,
C, and D. Since there are more combinations to check when
dealing with two types of compression this causes an increase
in the number of instances generated, but each instance has
more constraints and a smaller subspace to search through.</p>
      </sec>
      <sec id="sec-4-3">
        <title>E. Technique 3: UNSAT core</title>
        <p>After using the divide-and-conquer technique one obtains a
collection of instances which are almost identical. For example,
the order 40 instances contained 4185 variables and only at
most 184 variables differed between instances. Because of this
similarity, a short reason why one instance is unsatisfiable may
also apply to other instances which are similar. When this is
the case, those instances can immediately be pruned away.</p>
        <p>MAPLESAT is one SAT solver which supports UNSAT core
generation. Provided a master instance and a set of assumptions
(variables which are set either true or false), the UNSAT core
contains a subset of the assumptions which make the master
instance unsatisfiable. Thus, any other instance which sets the
variables in the UNSAT core in the same way must also be
unsatisfiable.</p>
      </sec>
      <sec id="sec-4-4">
        <title>F. Technique 4: Programmatic SAT</title>
        <p>There are several constraints shared among the different SAT
instances which help prune away large regions of the search
space. However, the more constraints we include the more the
size of each file increases; the SAT solver has more clauses to
handle and this causes an increase of its runtime. In the latest
version of MATHCHECK2, we oursourced these checks into a
DPLL(CAS) style feedback loop which generates clauses on
the fly whenever it encounters that the SAT solver is searching
in a space where no solution is provably possible.</p>
        <p>Specifically, the possible compressions which were not
filtered out by the generator were translated into a set of
linear constraints which were passed to the SAT+CAS solver.
The CAS would then use these constraints to generate learned
clauses as the search progressed.</p>
        <p>V. VERIFICATION OF THE NONEXISTENCE OF WILLIAMSON</p>
        <p>MATRICES OF ORDER 35</p>
        <p>We searched for Williamson matrices of order 35 using
the techniques described in Section IV with both 5 and
7compression. Despite the exponential growth of possible first
rows of the matrices A, B, C, and D, the described pruning
results in 21,674 SAT instances of three possible forms, as
described in Figure 2. Each instance has subsequently been
checked with several SAT solvers, and each one has been
discovered to be unsatisfiable. Using MAPLESAT with UNSAT
core generation, 19,356 SAT solver calls were necessary to
determine that all instances were unsatisfiable.</p>
        <p>Our practice was to have people that were not involved in
writing the respective code verify its correctness, and to have
domain experts verify the application of the theorems used.
Furthermore, our confidence of the correctness of our code
was strengthened by the successful discovery of
Williamsongenerated Hadamard matrices for all the orders 4n with n &lt; 35.
These have been determined to be valid Hadamard matrices
by the computer algebra system MAGMA.
Programmatic
0.01
0.08
0.05
0.28
0.05
1.51
0.75
6.08
1.08
42.21
VI. EXPERIMENTAL RESULTS ON THE HADAMARD</p>
        <p>CONJECTURE</p>
        <p>We checked all of the Hadamard matrices we computed
for equivalence against those in MAGMA’s Hadamard matrix
database. In total, our methods generated more than 500
pairwise inequivalent Hadamard matrices which were also
not equivalent to any matrices in this database. We submitted
these to the MAGMA team and one can download these on our
project website (URL in Section I-A).</p>
        <p>Experimental Setup and Methodology: The timings were
run on the high-performance computing cluster SHARCNET.
Specifically, the cluster we used ran CentOS 5.4 and used
64-bit AMD Opteron processors running at 2.2 GHz. Each
SAT instance was generated using MATHCHECK2 with the
appropriate parameters and the instance was submitted to
SHARCNET to solve by running MAPLESAT on a single
core (with a timeout of 24 hours).</p>
        <p>Figure 3 contains a summary of the performance of our
encoding and pruning techniques. The timings are for searching
for Williamson matrices of order n with 25 n 35 and for
each of the techniques discussed in Section IV. We did not
use Techniques 2 and 3 for orders 29 and 31 as they have no
nontrivial divisors to perform compression with, but they were
otherwise very effective at partitioning the search space in an
efficient way. Technique 3 was effective at cutting down the
number of instances generated in certain orders. Although the
instances pruned tended to be those which would have been
quickly solved, this technique would be especially valuable in
a situation where few cores are available, as it would allow
the overhead of many SAT solver calls to be avoided.</p>
        <p>The timings given in Figure 3 refer to the total amount
of time used by MAPLESAT across all the jobs run on
SHARCNET for each order and technique. The numbers in
parentheses in Figure 3 denote how many MAPLESAT calls
returned a result and did not time out. The jobs using the base
encoding and Technique 1 which did not time out all returned
SAT. All of the jobs using Technique 2 completed without
timing out and most the instances were found to be UNSAT.
The Technique 3 results were the same as the Technique 2
results except with fewer calls to MAPLESAT as some instances
could immediately be determined to be UNSAT.</p>
        <p>Figure 4 contains the average runtimes for the SAT instances
generated by our script using a compression factor of 2 (and
therefore only for even orders). For comparision purposes,
MAPLESAT was run both with and without the programmatic
functionality and all other techniques enabled.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>VII. RELATED WORK</title>
      <p>
        The idea of combining the capabilities of SAT/SMT solvers
and computer algebra systems or domain-specific knowledge
has been examined by various research groups. Recently, Heule
et al. [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] used a SAT solver to solve the Boolean Pythagorean
triples problem from Ramsey theory. Junges et al. [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] studied
an integration of Gröbner basis theory in the context of SMT
solvers. Although they implemented their own version of
Buchberger’s algorithm, they describe that it is possible to
“plug in an off-the-shelf GB procedure implementation such as
the one in SINGULAR” as the core procedure. SINGULAR [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]
is a computer algebra system with specialized algorithms for
polynomial systems. Ábrahám later highlights the potentials
of combining symbolic computation and SMT solving in
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. The VERIT SMT solver [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] uses the computer algebra
system REDUCE [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] to support non-linear arithmetic. The
LEAN theorem prover [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] combines domain-specific knowledge
with SMT solvers. Combining SAT and SMT with theorem
proving has been done in the automated theorem prover COQ
as well [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. The idea of using equivalences in satisfiability
problems to prune the search space has also been exploited by
symmetry breaking [
        <xref ref-type="bibr" rid="ref13 ref23">13, 23</xref>
        ]. SAT-based results on the Erdo˝ s
discrepancy conjecture [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ] inspired the previous version of
MATHCHECK [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ]. This version also combined SAT with
computer algebra systems but specialized in graph theory
and used the CAS to uncover theory lemmas as the search
progressed. Work related to finding Hadamard matrices has
been referenced in Section III.
      </p>
    </sec>
    <sec id="sec-6">
      <title>VIII. CONCLUSIONS AND FUTURE WORK</title>
      <p>We have successfully presented the advantages of utilizing
the power of SAT solvers in combination with domain specific
knowledge and algorithms provided by computer algebra
systems. Our main mathematical problem was the
verification of the Hadamard conjecture for some orders by using
MATHCHECK2 to search for and discover Williamson matrices.
We verified independently, as requested by D. Ðokovic´, that
there is no Hadamard Matrix of order 4 35 which is generated
by Williamson matrices. Moreover, we discovered more than
500 Hadamard matrices that are not equivalent to any matrix
in the MAGMA Hadamard database.</p>
      <p>
        A future direction is to scale to Hadamard matrices of
higher order. For this, we plan to refine the methods (e.g., by
examining other construction types). We also want to analyze
the UNSAT cores generated by Technique 3 to explain their
effectiveness in certain cases, as well as exploring the usage
of incremental SAT solvers [
        <xref ref-type="bibr" rid="ref20 ref3">3, 20</xref>
        ]. Finally, we plan to use
MATHCHECK2 and our newly acquired knowledge to consider
other combinatorial problems. There are many problems which
can be expressed as a search for objects which satisfy certain
autocorrelation equations (as just one example, those involving
complex Golay sequences). Since the ability to work with
autocorrelation is already built-in to MATHCHECK2, we should
be able to execute such searches with minor modifications.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>Erika</given-names>
            <surname>Ábrahám</surname>
          </string-name>
          .
          <article-title>Building bridges between symbolic computation and satisfiability checking</article-title>
          .
          <source>In Proceedings of the 2015 ACM on International Symposium on Symbolic and Algebraic Computation</source>
          , pages
          <fpage>1</fpage>
          -
          <lpage>6</lpage>
          . ACM,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Mickaël</given-names>
            <surname>Armand</surname>
          </string-name>
          , Germain Faure, Benjamin Grégoire, Chantal Keller, Laurent Théry, and
          <string-name>
            <given-names>Benjamin</given-names>
            <surname>Wener</surname>
          </string-name>
          .
          <article-title>Verifying SAT and SMT in COQ for a fully automated decision procedure</article-title>
          .
          <source>In PSATTT'11: International Workshop on Proof-Search in Axiomatic Theories and Type Theories</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Armin</given-names>
            <surname>Biere</surname>
          </string-name>
          , Marijn Heule, Hans van Maaren, and Toby Walsh, editors.
          <source>Handbook of Satisfiability. Frontiers in Artificial Intelligence and Applications</source>
          , vol.
          <volume>185</volume>
          . ios Press,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Thomas</given-names>
            <surname>Bouton</surname>
          </string-name>
          ,
          <string-name>
            <surname>Diego Caminha B De Oliveira</surname>
            , David Déharbe,
            <given-names>and Pascal</given-names>
          </string-name>
          <string-name>
            <surname>Fontaine</surname>
          </string-name>
          .
          <article-title>VERIT: an open, trustable and efficient SMT-solver</article-title>
          .
          <source>In Automated Deduction-CADE-22</source>
          , pages
          <fpage>151</fpage>
          -
          <lpage>156</lpage>
          . Springer,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Curtis</given-names>
            <surname>Bright</surname>
          </string-name>
          , Vijay Ganesh,
          <article-title>Albert Heinle, lias Kotsireas, Saeed Nejati, and Krzysztof Czarnecki. Mathcheck2: A SAT+CAS verifier for combinatorial conjectures</article-title>
          . In Computer Algebra in Scientific Computing (to appear). Springer Berlin Heidelberg,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Bruce</surname>
            <given-names>W Char</given-names>
          </string-name>
          , Gregory J Fee, Keith O Geddes,
          <string-name>
            <surname>Gaston H Gonnet</surname>
          </string-name>
          , and
          <string-name>
            <surname>Michael B Monagan</surname>
          </string-name>
          .
          <article-title>A tutorial introduction to MAPLE</article-title>
          .
          <source>Journal of Symbolic Computation</source>
          ,
          <volume>2</volume>
          (
          <issue>2</issue>
          ):
          <fpage>179</fpage>
          -
          <lpage>200</lpage>
          ,
          <year>1986</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Charles</surname>
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Colbourn</surname>
          </string-name>
          and
          <string-name>
            <surname>Jeffrey H</surname>
          </string-name>
          . Dinitz, editors.
          <source>Handbook of Combinatorial Designs. Discrete Mathematics and its Applications</source>
          (
          <article-title>Boca Raton)</article-title>
          . Chapman &amp; Hall/CRC, Boca Raton, FL, second edition,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Leonardo de Moura</surname>
          </string-name>
          , Soonho Kong, Jeremy Avigad, Floris van Doorn,
          <article-title>and Jakob von Raumer. The LEAN Theorem Prover (System Description)</article-title>
          . In Amy P. Felty and Aart Middeldorp, editors,
          <source>Automated Deduction - CADE-25</source>
          , volume
          <volume>9195</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>378</fpage>
          -
          <lpage>388</lpage>
          . Springer International Publishing,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Wolfram</given-names>
            <surname>Decker</surname>
          </string-name>
          ,
          <string-name>
            <surname>Gert-Martin</surname>
            <given-names>Greuel</given-names>
          </string-name>
          , Gerhard Pfister, and
          <article-title>Hans Schönemann. SINGULAR 4-0-2 - A computer algebra system for polynomial computations</article-title>
          . http://www.singular.uni-kl.de,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Vijay</surname>
            <given-names>Ganesh</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Charles W O'Donnell</surname>
          </string-name>
          , Mate Soos, Srinivas Devadas,
          <string-name>
            <surname>Martin C Rinard</surname>
          </string-name>
          , and
          <string-name>
            <surname>Armando</surname>
          </string-name>
          Solar-Lezama.
          <article-title>LYNX: A programmatic SAT solver for the RNA-folding problem</article-title>
          .
          <source>In Theory and Applications of Satisfiability Testing-SAT</source>
          <year>2012</year>
          , pages
          <fpage>143</fpage>
          -
          <lpage>156</lpage>
          . Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>AC</given-names>
            <surname>Hearn</surname>
          </string-name>
          .
          <article-title>REDUCE user's manual, version 3</article-title>
          .8,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Marijn</surname>
            <given-names>JH Heule</given-names>
          </string-name>
          , Oliver Kullmann, and Victor W Marek.
          <article-title>Solving and verifying the boolean pythagorean triples problem via cube-and-conquer</article-title>
          .
          <source>arXiv preprint arXiv:1605.00723</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Brahim</surname>
            <given-names>Hnich</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Steven D.</given-names>
            <surname>Prestwich</surname>
          </string-name>
          , Evgeny Selensky, and
          <string-name>
            <surname>Barbara</surname>
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Smith.</surname>
          </string-name>
          <article-title>Constraint Models for the Covering Test Problem</article-title>
          .
          <source>Constraints</source>
          ,
          <volume>11</volume>
          (
          <issue>2</issue>
          ):
          <fpage>199</fpage>
          -
          <lpage>219</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>Sebastian</given-names>
            <surname>Junges</surname>
          </string-name>
          , Ulrich Loup, Florian Corzilius, and
          <string-name>
            <given-names>Erika</given-names>
            <surname>Ábrahám</surname>
          </string-name>
          .
          <article-title>On Gröbner bases in the context of satisfiability-modulo-theories solving over the real numbers</article-title>
          .
          <source>In Algebraic Informatics</source>
          , pages
          <fpage>186</fpage>
          -
          <lpage>198</lpage>
          . Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>Boris</given-names>
            <surname>Konev</surname>
          </string-name>
          and
          <string-name>
            <given-names>Alexei</given-names>
            <surname>Lisitsa</surname>
          </string-name>
          .
          <article-title>A SAT attack on the Erdo˝s discrepancy conjecture</article-title>
          .
          <source>In Theory and Applications of Satisfiability Testing-SAT</source>
          <year>2014</year>
          , pages
          <fpage>219</fpage>
          -
          <lpage>226</lpage>
          . Springer,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>Jia</given-names>
            <surname>Hui</surname>
          </string-name>
          <string-name>
            <surname>Liang</surname>
          </string-name>
          , Vijay Ganesh, Pascal Poupart, and
          <string-name>
            <given-names>Krzysztof</given-names>
            <surname>Czarnecki</surname>
          </string-name>
          .
          <article-title>Exponential Recency Weighted Average Branching Heuristic for SAT Solvers</article-title>
          .
          <source>In Proceedings of AAAI-16</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>Jia</given-names>
            <surname>Hui</surname>
          </string-name>
          <string-name>
            <surname>Liang</surname>
          </string-name>
          , Vijay Ganesh, Pascal Poupart, and
          <string-name>
            <given-names>Krzysztof</given-names>
            <surname>Czarnecki</surname>
          </string-name>
          .
          <article-title>Learning Rate Based Branching Heuristic for SAT Solvers</article-title>
          . To appear
          <source>in the proceedings of the 19th International Conference on Theory and Applications of Satisfiability Testing</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <surname>João P Marques-Silva</surname>
            ,
            <given-names>Karem</given-names>
          </string-name>
          <string-name>
            <surname>Sakallah</surname>
          </string-name>
          , et al.
          <article-title>GRASP: A Search Algorithm for Propositional Satisfiability</article-title>
          .
          <source>IEEE Transactions on Computers</source>
          ,
          <volume>48</volume>
          (
          <issue>5</issue>
          ):
          <fpage>506</fpage>
          -
          <lpage>521</lpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <surname>Matthew</surname>
            <given-names>W Moskewicz</given-names>
          </string-name>
          , Conor F Madigan,
          <string-name>
            <surname>Ying Zhao</surname>
            ,
            <given-names>Lintao</given-names>
          </string-name>
          <string-name>
            <surname>Zhang</surname>
          </string-name>
          , and Sharad Malik. CHAFF:
          <article-title>Engineering an Efficient SAT Solver</article-title>
          .
          <source>In Proceedings of the 38th annual Design Automation Conference</source>
          , pages
          <fpage>530</fpage>
          -
          <lpage>535</lpage>
          . ACM,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>Alexander</given-names>
            <surname>Nadel</surname>
          </string-name>
          and
          <string-name>
            <given-names>Vadim</given-names>
            <surname>Ryvchin</surname>
          </string-name>
          .
          <article-title>Efficient SAT Solving under Assumptions</article-title>
          .
          <source>In Theory and Applications of Satisfiability Testing-SAT</source>
          <year>2012</year>
          , pages
          <fpage>242</fpage>
          -
          <lpage>255</lpage>
          . Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <surname>Dragomir</surname>
            <given-names>Ž</given-names>
          </string-name>
          <article-title>Ðokovic´</article-title>
          .
          <source>Williamson matrices of order 4n for n = 33</source>
          ,
          <issue>35</issue>
          ,
          <fpage>39</fpage>
          . Discrete mathematics,
          <volume>115</volume>
          (
          <issue>1</issue>
          ):
          <fpage>267</fpage>
          -
          <lpage>271</lpage>
          ,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <surname>Dragomir</surname>
            <given-names>Ž</given-names>
          </string-name>
          <article-title>Ðokovic´ and Ilias S Kotsireas. Compression of periodic complementary sequences and applications</article-title>
          . Designs, Codes and Cryptography,
          <volume>74</volume>
          (
          <issue>2</issue>
          ):
          <fpage>365</fpage>
          -
          <lpage>377</lpage>
          ,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <surname>Steve</surname>
            <given-names>D</given-names>
          </string-name>
          <string-name>
            <surname>Prestwich</surname>
            , Brahim Hnich, Helmut Simonis, Roberto Rossi, and
            <given-names>S Armagan</given-names>
          </string-name>
          <string-name>
            <surname>Tarim. Partial Symmetry</surname>
          </string-name>
          <article-title>Breaking by Local Search in the Group</article-title>
          . Constraints,
          <volume>17</volume>
          (
          <issue>2</issue>
          ):
          <fpage>148</fpage>
          -
          <lpage>171</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>Joe</given-names>
            <surname>Riel</surname>
          </string-name>
          .
          <article-title>nsoks: A MAPLE script for writing n as a sum of k squares.</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <surname>Stéfan van der Walt</surname>
            ,
            <given-names>S. Chris</given-names>
          </string-name>
          <string-name>
            <surname>Colbert</surname>
            , and
            <given-names>Gaël</given-names>
          </string-name>
          <string-name>
            <surname>Varoquaux</surname>
          </string-name>
          .
          <article-title>The NUMPY array: A structure for efficient numerical computation</article-title>
          .
          <source>Computing in Science &amp; Engineering</source>
          ,
          <volume>13</volume>
          (
          <issue>2</issue>
          ):
          <fpage>22</fpage>
          -
          <lpage>30</lpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>John</given-names>
            <surname>Williamson</surname>
          </string-name>
          .
          <article-title>Hadamard's Determinant Theorem and the Sum of Four Squares</article-title>
          . Duke Math. J,
          <volume>11</volume>
          (
          <issue>1</issue>
          ):
          <fpage>65</fpage>
          -
          <lpage>81</lpage>
          ,
          <year>1944</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <string-name>
            <given-names>Stephen</given-names>
            <surname>Wolfram</surname>
          </string-name>
          .
          <source>The MATHEMATICA Book, version 4</source>
          . Cambridge University Press,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          [28]
          <string-name>
            <surname>Edward</surname>
            <given-names>Zulkoski</given-names>
          </string-name>
          , Vijay Ganesh, and
          <string-name>
            <given-names>Krzysztof</given-names>
            <surname>Czarnecki</surname>
          </string-name>
          .
          <source>MATHCHECK: A Math Assistant via a Combination of Computer Algebra Systems and SAT Solvers</source>
          . In Amy P. Felty and Aart Middeldorp, editors,
          <source>Automated Deduction - CADE-25</source>
          , volume
          <volume>9195</volume>
          of Lecture Notes in Computer Science, pages
          <fpage>607</fpage>
          -
          <lpage>622</lpage>
          . Springer International Publishing,
          <year>2015</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>