Solving Op en Quasigroup Problems by
Prop ositional Reasoning
y
Jieh Hsiang Hantao Zhang
Department of Computer Science and Department of Computer Science
Information Engeneering The University of Iowa
National Taiwan University, Taipei, Taiwan Iowa City, IA 52242
[email protected] [email protected]
Abstract. There are many op en problems quasigroups satisfying certain constraints is such
in the study of quasigroups. Recently, au-
an example.
tomated techniques have b een employed to
A quasigroup is simply a cancellative nite
attack these op en problems. In this pap er,
group oid, hS; i, where S is a set, a binary op-
we show how a prop ositional satis ability
prover is used to solve many op en problems
eration on S . The cardinality of S , jS j, is called
in quasigroups. Our success relies on a p ow-
the order of the quasigroup. The \multiplication
erful prop ositional prover called SATO and a
table" for the op eration forms a Latin square,
useful technique called the cyclic group con-
of which each row and each column is a permu-
struction. We provide detailed solutions to
tation of S . Interest attaches to many classes of
op en problems solved bySATO.
quasigroups, partly b ecause they are very natural
ob jects in their own right and partly b ecause of
their relationships to design theory.
1 Intro duction
In this pap er, we are interested in the prob-
lems in quasigroups given by Fujita, Slaney and
In the recent years, there has been considerable
Bennett in their award-winning IJCAI pap er [3].
renewed interest in the prop ositional satis abil-
The constraints in Table 1 are taken from [3]:
ity problem (SAT). Because the SAT problem is
Among the Latins squares satisfying these con-
the rst known NP-complete problem, it is rel-
straints, we are also interested in those squares
atively easy to transform any NP-complete prob-
with a hole, i.e., a subsquare (which itself is also
lem in mathematics, computer science and electri-
a Latin square) of the square is missing.
cal engineering into the SAT problem. The SAT
Quasigroups raise many combinatorial prob-
problem is known to be dicult to solve in the-
lems, some of which are often approached com-
ory. However, contrary to the common p ercep-
putationally. The usefulness of advanced auto-
tion that transforming a problem into the SAT
mated reasoning techniques to attack these prob-
problem will not make the problem easier to solve,
lems have been successfully demonstrated in [11 ,
many problems can in fact be solved more e ec-
3 , 7, 10, 6]. In 1990, Zhang rep orted a case of op en
tively by aSAT problem solver than by a sp ecial
problems in quasigroups solved using a constraint
program. Needless to say, transforming a problem
solving technique [11 ]. Subsequently, Fujita used
into the SAT problem is much easier than writing
MGTP, a mo del-generation based rst-order the-
a sp ecial program. The existence problem of nite
orem prover, and Slaney used FINDER, a pro-
gram based on constraint solving, to solve several
Partially supp orted by the National Science Founda-
tion under Grants CCR-9202838 and CCR-9357851.
op en problems in quasigroups [3 ]. Later, Stickel
y
Partially supp orted by the National Science Council
and Zhang, indep endently, used their prop osi-
under grant NSC-83-0408-E-002-012T.
This pap er is organized as follows. In the next
Table 1: Some constrains of quasigroups.
section, we intro duce some problems in quasi-
groups and show how to represent them in the
Name Constraint
prop ositional logic. In section 3, we present one
QG1 x y = u; z w = u; v y = x;
of our to ols to solve problems in quasigroups, i.e.,
v w = z ) x = z , y = w
the cyclic group construction. In section 4, we
QG2 x y = u; z w = u; y v = x;
present solutions to some op en quasigroup prob-
w v = z ) x = z , y = w
lems. Section 5 concludes the pap er.
QG3 (x y ) (y x)=x
QG4 (x (y x)) y = x
QG5 ((x y ) x) x = y
2 Quasigroup Problems
(x y ) y = x (x y ) QG6
QG7 ((x y ) x) y = x
Recall that a quasigroup is a pair hS; i where
S is a nite set, a binary op eration on S and
the \multiplication table" of forms a Latin
tional provers, based on the Davis-Putnam algo-
square. Without loss of generality, we assume
rithm [2 ], to attack these problems and rep orted
S = f0; 1; :::; v 1g,wherev is the order of hS; i.
very comp etitive and new results [7 , 8, 10 ]. The
The following clauses sp ecify a Latin square: For
exp erimental results of this pap er are obtained by
all elements x; y ; u; w 2 S ,
the program SATO (SAtis ability Testing Opti-
mized) ([8 ], [10 ]) which is an ecient implemen-
x u = y; x w = y ) u = w (1)
tation of the Davis-Putnam algorithm.
u x = y; w x = y ) u = w (2)
Quasigroups raise very hard computational
x y = u; x y = w ) u = w (3)
problems. Many of these problems are simply
(x y =0)__(x y = v 1) (4)
intractable for to day's automated reasoning pro-
grams. For instance, it remains op en if there exists
It has b een shown in [7] that the following two
a Latin square of order 10 satisfying QG2. While
clauses are valid consequences of the ab ove clauses
it is beyond the reach of the current reasoning
and adding them into a prover can help to reduce
techniques to do an exhaustive search, we may
the searchspace.
take advantage of techniques develop ed bymath-
ematicians over decades for constructing quasi-
(x 0=y ) __(x (v 1) = y ) (5)
groups. One such technique we found very useful
(0 x = y ) __((v 1) x = y ) (6)
is a starter-adder-typ e construction. This tech-
nique has b een used extensively byvarious math-
In the following we denote by QGi(v ) a Latin
ematicians (e.g., see [5 , 4, 1]). The main idea is
square satisfying clauses (1){(6) plus the con-
to generate a Latin square under a cyclic group
straint QGi given in the intro duction for S =
from the rst row and the rst column of the
f0; :::; (v 1)g. In addition, the idemp otence law,
square. This cyclic group technique o ers a signif-
x x = x, and the constraint x (v 1) x 1,
icant computation advantage: instead of searching
which eliminates some isomorphic mo dels, are
2
for O (v )entries of a square of order v , only O (v )
used for each problem here. Further details on
entries need to b e searched. If a prop ositional rea-
these problems can b e found in [3 ] and [7 ].
2
soning prover is used, only O (v ) prop ositional
3
To obtain prop ositional clauses, we simply in- variables instead of O (v ) variables are needed.
stantiate variables in the clauses of QGi(v )bythe In general, to nd latin squares satisfying QG1{
3 6
values of S and replace each equality a b = c QG7, only O (v ) clauses instead of O (v ) clauses
by a prop ositional variable p . The number of are needed. Despite of the fact that this technique
a;b;c
the prop ositional clauses is thus decided by the is incomplete, we are able to nd many new Latin
order of the quasigroup (i.e., v ) and the number squares using the SATO prover.
Attach the condition that x and y cannot b e of distinct variables in a clause. However, for con-
in X at the same time to clauses (1)-(3). straints QG3{QG7, we have to transform them
into \ at" form rst. For example, the at form
For the Davis-Putnam algorithm, it is relatively
of QG5 is
easier to work with incomplete groups of larger
(x y = z ); (z x = w ) ) (w x = y ):
holes. To search for a QGi(v; n), if we already have
a QGi(m; n), wemay searchforaQGi(v; m)and
It can be shown that the two \transp oses" of the
then ll the QGi(m; n) into QGi(v; m) to obtain
ab ove clause are also valid consequences of QG5:
a QGi(v; n). This ll-in-hole technique is useful
when lo oking for QGi(v; n).
(w x = y ); (x y = z ) ) (z x = w );
There exist many op en problems regarding the
(z x = w ); (w x = y ) ) (x y = z ):
existence of QGi with holes given in Bennett and
Exp erimental results show that when v > 10,
Zhu's survey pap er [1 ]. We are able to nd new
adding these \transp oses" in the input often im-
mo dels for each typ e of QG1{QG7; these solved
proves the p erformance of the Davis-Putnam al-
quasigroups will b e given in section 4.
gorithm. This is also true for QG3{QG7.
For a class of Latin squares satisfying a given
3 Cyclic Group Construction
constraint, we are often interested in those with
holes. An incomplete Latin square is a Latin
The prop ositional reasoning program we used to
square with a single hole and is sp eci ed as
attack quasigroup problems is called SATO (SAt-
hS=X ; i, where X S and for any x ;x 2 X ,
1 2
is abilityTesting Optimized) which is an ecient
x x must be in X but is left undecided in the
1 2
implementation of the Davis-Putnam algorithm
\multiplication table" of . This implies that for
written by Zhang [8 ].
any s 2 S X and x 2 X , s x (or x s) 62 X . We
may consider an incomplete Latin square as one of
For a quasigroup of order v , the number of
order jS j with a subsquare of order jX j \missing";
prop ositional clauses obtained from clauses like
6
if we ll a Latin square of order jX j into the hole,
QG1 and QG2 in Table 1 is O (v ) b ecause there
the result should remain a Latin square. With-
are six distinct variables in QG1 and QG2. For a
out loss of generality, the missing subsquare can
large v , in addition to the large numb er of clauses,
be assumed to be in the b ottom right corner. A
the search space involved in these problems is also
necessary condition for the existence of incomplete
huge. For instance, SATO, or any known com-
quasigroups satisfying QG1{QG7 is that v>3n.
puter programs, including those in [11 , 3 , 7, 10 , 6],
cannot complete an exhaustive search when v
We will denote an incomplete quasigroup of or-
10 for QG2(v ). As a result, a direct representation
der v satisfying QGi, with a hole of size n, by
of the quasigroups in the prop ositional logic is not
QGi(v; n). Note that every QGi(v ) can be con-
likely to succeed.
sidered as a QGi(v; 1) b ecause it is assumed to b e
idemp otent.
Wenow present an incomplete technique which
is develop ed by mathematicians over the years for
There is an easy way to obtain clauses for
nding Latin squares. It is incomplete b ecause
incomplete quasigroups from those of complete
when the metho d fails, wedonotknow if there ex-
quasigroups:
ists a Latin square satisfying the given constraints.
We have used several other techniques, but this
Add p ositive unit clauses such as x y = z
one is the most imp ortantbecause it reduces the
whenever fx; y ; z gX .
search space signi cantly. This technique is a
starter-adder-typ e construction and has b een used Add negative unit clauses such as x y 6= z
extensively byvarious authors (e.g., see [5, 4, 1]). whenever two of fx; y ; z g are in X and the
The main idea of the technique is to generate an other is not in X .
Table 2: The statistics of SATO on the QG2(v; 1) Figure 1: A QG2(14; 1) by the cyclic construction.
problems for v = 7 to 12, using the cyclic group
construction.
* | 0 1 2 3 4 5 6 7 8 9 a b c x
--+------
v Mo del Clause Branch Search
0 | 0 c 9 x a 6 8 4 b 5 1 3 7 2
7 6 11134 50 0.15
1 | 8 1 0 a x b 7 9 5 c 6 2 4 3
8 12 28883 107 0.63
2 | 5 9 2 1 b x c 8 a 6 0 7 3 4
9 28 67501 475 3.35
3 | 4 6 a 3 2 c x 0 9 b 7 1 8 5
10 0 143938 1186 11.99
4 | 9 5 7 b 4 3 0 x 1 a c 8 2 6
11 100 284036 4606 71.21
5 | 3 a 6 8 c 5 4 1 x 2 b 0 9 7
6 | a 4 b 7 9 0 6 5 2 x 3 c 1 8
12 0 525229 14111 302.56
7 | 2 b 5 c 8 a 1 7 6 3 x 4 0 9
8 | 1 3 c 6 0 9 b 2 8 7 4 x 5 a
Example 1 Take G = Z , X = fxg, e = (0 12
13
9 | 6 2 4 0 7 1 a c 3 9 8 5 x b
9 x 1068 4115137), f = (3) and g = (12), we
a | x 7 3 5 1 8 2 b 0 4 a 9 6 c
b | 7 x 8 4 6 2 9 3 c 1 5 b a 0
have a QG2(14; 1), shown in Figure 1. It gives us
c | b 8 x 9 5 7 3 a 4 0 2 6 c 1
aQG2(14) when entry e(x; x) is lled by x. 2
x | c 0 1 2 3 4 5 6 7 8 9 a b
Example 2 Take G = Z , X = ;, e = (0 5 11
15
1074283141139612), f = g = ;,wehavea
incomplete quasigroup under an Ab elian group of
QG2(15; 0), or QG2(15). 2
order v n (e.g., (Z ; +)), from its rst row and
v n
from the last n elements of the rst column.
In order to nd a new Latin square using the
Supp ose that L is a QGi(v; n) based on S with
cyclic group construction, instead of lo oking for an
a hole indexed by X . Let S = G [ X where G =
entire square, we lo ok for only vectors e, f and g.
f0; 1; :::; v n 1g and X = fx ;x ; :::; x g. We
Obviously, the latter will b e much easier than the
1 2 n
2
will denote by e(i; j ) the entry in the cell (i; j )
former b ecause a square of order v has v entries
of L (i.e., e(i; j ) = i j ). The rst row is given
while the three vectors have at most 1:3v entries
bythevectors e =(e(0; 0); :::; e(0;v n 1)) and
altogether (b ecause v>3n).
f = (e(0;v n); :::; e(0;v 1)), and the last n
There are obvious conditions that the vec-
elements of the rst column are given by the vector
tors e; f and g must satisfy in order to pro duce
g =(e(v n; 0); :::; e(v 1; 0)).
QGi(v; n). Instead of putting the constraints on
the three vectors, we simply add instances of the
Cyclic Group Construction 1 The entire L is
following constraints to the clauses of a problem:
constructed from e; f and g using the cyclic group
(x y = z ) ((x +1) (y +1)= (z + 1));
Z , where m = v n,as fol lows:
m
(x y = w ) ((x +1) (y +1)= w );
0 0 0
1. For 0 s; t < m, e(s +1;t )=e where t =
for all x; y ; z < v n and w v n, where +
0
t +1(mod m), and e = e(s; t) if e(s; t) 2 X ,
is mo dulo (v n). This way, we obtain a square
or e(s; t) + 1(mo d m), otherwise.
directly from an SAT prover instead of the three
vectors but this square can b e reconstructed from
2. For 0 s < m, m t < v , e(s +1;t) =
its rst row andcolumnby the cyclic group con-
e(s; t) + 1(mo d m).
struction. This implementation reduces substan-
tially the search space of a problem in quasigroups.
3. For m s < v , 0 t < m, e(s; t +1) =
e(s; t) + 1(mo d m).
Table 2 shows the exp erimental results of the
cyclic group construction on the QG2(v; 1) prob-
lems for v = 7 to 12. Column Mo del gives the
Table 3: Newly solved Quasigroup problems.
Figure 2: A QG4(14; 2) found bySATO.
QGi (v )or(v; n)
* | 0 1 2 3 4 5 6 7 8 9 a b c d
--+------
QG1 (16, 2), (17, 2), (19, 2), (20, 3)
0 | 0 a 6 7 1 b d 9 5 c 2 4 8 3
QG2 (14), (15), (12, 2), (14, 2), (16, 2),
1 | 3 1 0 2 8 6 b d 9 a 4 c 5 7
(17, 2), (15, 3), (17, 3), (18, 4)
2 | 4 c 2 6 b 8 3 a 7 0 d 5 9 1
(46, 15), (51, 14), (54, 15) QG3
3 | 2 b d 3 5 0 8 1 c 6 7 9 4 a
QG4 (14, 2)
4 | 1 2 5 9 4 7 a 8 b 3 c d 0 6
QG5 (14)[without idemp otency], (16)
5 | d 8 1 a 6 5 c 3 4 2 9 7 b 0
QG6 (15), (17)
6 | 9 d 7 0 3 c 6 b 2 4 5 a 1 8
QG7 (15)
7 | 5 0 c 4 a 3 1 7 d b 6 8 2 9
8 | 6 9 3 b 2 d 7 c 8 5 0 1 a 4
9 | a 7 b c d 1 4 2 3 9 8 0 6 5
a | c 6 9 8 0 4 2 5 1 d a 3 7 b
b | 7 4 a d c 9 5 0 6 8 1 b 3 2
total number of mo dels for each case. Coulmns
c | b 5 8 1 9 2 0 4 a 7 3 6
Clause and Branch give, resp ectively,the num-
d | 8 3 4 5 7 a 9 6 0 1 b 2
b ers of input clauses and case-splittings of the
Davis-Putnam algorithm. The data in column
Search are the time (in seconds) sp ent in search-
group construction. The cases for QG5, QG6 and
ing for mo dels (collected on a HP715/50 worksta-
QG7(15) are negative, i.e., there do not exist such
tion with 32 megabytes of memory). The advan-
squares. The case of QG5(16) is also proved in-
tage of the cyclic construction is obvious. For in-
dep endently by Hasegawa's team in Japan. The
stance, it takes 379 seconds for SATO to complete
other cases are p ositive and the squares are ob-
the search of QG2(8) without the cyclic group con-
tained by the cyclic group construction. The vec-
struction but it takes only 0.63 seconds when the
tors for QG2(14; 1) and QG2(15; 0) are given in
cyclic group construction is used. However, no
Examples 1 and 2, resp ectively. The other in-
QG2(12) is found by the cyclic group construc-
volved vectors are listed in Table 4. Note that
tion even though we know it exists, b ecause the
using his prop ositional prover, McCune found a
metho d is incomplete.
QG6(17) without the cyclic group construction [6].
4 Newly Solved Op en Cases
5 Conclusion
It is fortunate that our program made new discov-
We have demonstrated how to use prop ositional
ery in every typ e of the problems, i.e., QG1{QG7,
reasoning to solve op en problems in quasigroups.
listed in [3]. Our program is also able to repro duce
The computing time sp ent on solving these prob-
all the results rep orted in [11 , 3 , 7 , 6 ].
lems varies from a few seconds to several weeks.
For instance, it to ok more than 4 days to solvethe We present in Table 3 our results which an-
case of QG7(15) by running a parallel implementa- swered for the rst time some op en problems
tion of SATO on eightworkstations [9 ]. Because of listed in [1 ]. When a case is solved by the
the need of enormous amount of computing time, cyclic group construction, instead of presenting
the eciency of SATO is very imp ortant to our the newly found Latin squares, we list the vectors
success. e, f and g, which can be used to construct the
entire square by the cyclic group construction.
We plan to study other construction techniques
used by mathematicians. We b elieve that combin- Among these cases, QG4(14; 2), given in Fig-
ing the knowledge of mathematicians and the ad- ure 2, is found without the help of the cyclic
vanced computer technology is a very pro ductive
way to attack any op en mathematical problems,
not just problems in quasigroups.
Table 4: Vectors for the cyclic group construction.
QG1
References
(v; n) e, f, g
(16, 2) (049128x 313105112x 7),
1 2
[1] Bennett, F., Zhu, L.: Conjugate-orthogonal
(1 6), (12 13)
Latin squares and related structures. J. Dinitz &
(17, 2) (0 6 14 10 x 11 1 8 x 12413593),
2 1
D. Stinson (eds), Contemporary Design Theory: A
(2 7), (13 14)
Col lection of Surveys, John Wiley & Sons, 1992.
(19, 2) (014161187122x 3 15 4 13 5 x
2 1
1 6), (9 10), (15 16)
[2] Davis, M., Putnam, H.: (1960) A computing pro-
(20, 3) (0 12 14 16 7 10 13 x 921x x 15
cedure for quanti cation theory. J. of ACM, 7,
1 2 3
64 3),(5811),(141516)
201-215.
QG2
[3] Fujita, M., Slaney, J., Bennett, F.: Automatic
(v; n) e, f, g
generation of some results in nite algebra, Proc.
(12, 2) (0 x 361 10x 2 11 5), (4 7), (4 9)
2 1
International Joint ConferenceonArti cial Intel-
(14, 2) (0 x 9117x 10 8 2 6 3 1),
2 1
ligence, MIT Press, 1993
(4 5), (10 11)
[4] Hedayat, A., Seiden, E.: (1974) On the theory and
(16, 2) (0 8 x 5131012119647x 2),
1 2
application of sum comp osition of Latin squares
(1 3), (12 13)
and orthogonal Latin squares. Paci c J. Math. 54,
(17, 2) (07126913x 141128x 14 3),
1 2
85-b3.
(5 10), (13 14)
(15, 3) (0 x 1065911x 3 x 4 1),
1 3 2
[5] Horton, J.D.: (1974) Sub-Latin squares and in-
(2 7 8), (9 10 11)
complete orthogonal arrays. J. Combin. Theory
(17, 3) (0 7 12 11 x x 810913165x ),
3 2 1
A, 16, 23-33.
(234),(111213)
[6] McCune, W.: A Davis-Putnam program and
(18, 4) (0 x x 511x 10 12 9 x 13 3 6 8),
2 1 3 4
its application to nite rst-order mo del search:
(1 2 4 7), (10 11 12 13)
quasigroup existence problems. Preprint, Division
QG3
of MCS, Argonne National Lab oratory, 1994.
(v; n) e, f, g
[7] Slaney, J., M. Fujita, M. Stickel: Automated rea-
(46, 15) (0 x 22 2 x 24 4 x 26 6 x 28 8 x 30
6 7 8 9 10
soning and exhaustive search: Quasigroup ex-
10 x x 12 x x 14 x x 16 x x
11 1 12 2 13 3 14 4
istence problems. To app ear in Computers and
18 x x 20),
15 5
Mathematics with Applications.
(1357911131517192123252729),
(151413121110987654321)
[8] Zhang, H.: SATO: A decision pro cedure for
(0 16 x 30 21 31 x 32 x 83493510 (51, 14)
6 7 8
prop ositional logic. Asso ciation for Automated
x 36 12 33 13 x 1 x 417x x
9 10 11 12 1
Reasoning Newsletter, No 22, March 1993.
x x x 22 x 23 x 18 x 26 19),
13 2 14 3 4 5
[9] Zhang, H., Bonacina, M. P.: Cumulating search
(23567111415202425272829),
in a distributed computing environment: a case
(14131211109876 54321)
study in parallel satis ability. Pro c. of the First
(54, 15) (0 x 21 x 32 25 33 x 348359x 10
6 7 8 9
International Symp osium on Parallel Symb olic
38 37 x 13 x 36216x 17 3 x x
10 11 12 1 13
Computation. Sept. 26{28, 1994, Linz, Austria.
20 x x x x 24 x 18 x 27 14 28),
14 2 15 3 4 5
(1456711121519222326293031),
[10] Zhang, H., Stickel, M.: Implementing the Davis-
(151413121110987654321)
Putnam algorithm by tries. Technical Rep ort,
QG7
Dept. of Computer Science, The University of
(v; n) e, f, g
Iowa, 1994.
(17, 0) (0 13 9 12 1 3 7 11 2 15 6 10 14 16 5 8 4),
[11] Zhang, J. Search for idemp otent mo dels of quasi-
(),()
group identities, manuscript, Institute of Soft-
ware, Academia Sinica, Beijing. 1990.