DIMACS Series in Discrete Mathematics and Theoretical Computer Science Volume 00, 0000

The Warwick Automatic Groups Software

Derek F. Holt

Abstract. This paper provides a description of the algorithms employed by the Warwick Automata package for calculating the finite state automata associated with a short-lex automatic group. The aim is to provide an overview of the whole process, rather than concentrating on technical details, which have been already been published elsewhere. A number of related programs are also described.

1. Introduction

The purpose of this paper is to provide a description of the algorithms employed by the Warwick Automata package for calculating the finite state automata associated with a short-lex automatic group. Such a description, with full technical details and proofs, has already been published in [2]. Our aim here, however, is to attempt to give a less technical overview of the full procedure. This overview also serves to present a more accurate and up-to-date description of the procedure than [2]. Some recent examples on which Automata has been successfully run will then be discussed. Finally, we shall describe some associated programs, which perform various functions on the output. All of these programs are available from Warwick by anonymous ftp. (Please e-mail the author for details.)

It will be assumed that the reader has some familiarity with the definition and elementary theory of finite state automata. The best general reference for the theory of automatic groups is the six-author book [1]. If A is a finite set (the alphabet), then A^{∗} will denote the set of all strings of elements of A, including the empty string, which will be denoted by ε. Elements of A^{∗} will be referred to as words in A. In this paper, A will always denote a finite set which generates a group G as a monoid, so each word in A can be regarded as an element of G. If u and v are words in A, then we shall use u = v to mean that u and v are equal as elements of G, whereas u ≡ v will mean that u and v are equal as strings.

Let A and G be as above. Then G is said to be automatic (with respect to A), if it has an automatic structure. This consists of a collection of finite state

\begin{matrix}c \\ ◯ \end{matrix}0000 American Mathematical Society 1052-1798/00 $1.00 + $.25 per page

1991 Mathematics Subject Classification. Primary 20F10, 20-04, 68Q40; Secondary 03D40.

Key words and phrases. Automatic Groups, Computer Programs.

This paper is in final form and no version of it will be submitted for publication elsewhere.

automata. The first of these, usually denoted by W, is called the word-acceptor. It has input alphabet A, and accepts at least one word in A mapping onto each g ∈ G. The remaining automata M_{x}, are called the multipliers. There is one of these for each generator x ∈ A, and also one for x = Id_{G} (which will be denoted by M_{$}). They read pairs of words (w_{1}, w_{2}), with w_{1}, w_{2} ∈ A^{∗}, and accept such a pair if and only if w_{1} and w_{2} are both accepted by W, and w_{1}x = w_{2}. (We shall clarify the technical problem of dealing with words w_{1} and w_{2} of different lengths at the beginning of the next section.)

Notice that this definition apparently depends on the particular monoid generating set A for the group G, as well as G itself, but it is not too difficult to prove (see Section 2.4 of [1]) that the property of being automatic is preserved under change of generators, and so we can unambiguously say that a particular group is automatic or not automatic. Although it is not necessary theoretically, the programs we are discussing require that A is closed under inversion (that is, for each x ∈ A, there exists y ∈ A with xy = Id_{G}), and so we shall assume this from now on.

The definition says nothing specific about the nature of the words accepted by the word-acceptor. We shall be dealing here exclusively with so-called shortlex word-acceptors, which we shall now describe. For this, we require an ordered monoid-generating set A for the group G. For words u and v in A, we write u ≺ v if either u is shorter than v, or u and v have the same lengths, but u comes earlier than v in the lexicographical ordering of A^{∗} relative to the given ordering of A. So, for example, if A = {a, b} with a < b, then ε ≺ a ≺ b ≺ aa ≺ ab ≺ ba ≺ bb ≺ aaa ≺ aab. This is known as the short-lex ordering on A^{∗}. A word w in A is said to be irreducible, if it is the least word in the short-lex ordering which is equal to w as an element of G. Otherwise, it is called reducible.

The group G is called short-lex automatic with respect to the order monoidgenerating set A, if it has a short-lex automatic structure. This is an automatic structure in which W accepts precisely the irreducible elements in A^{∗}. In particular, it accepts a unique word for each group element, and accepts the empty string as representative of Id_{G}. Note that the equality multiplier M_{$} accepts (u, v) if and only if u ≡ v and u is accepted by W.

It turns out that the existence of a short-lex automatic structure for G definitely does depend on both the choice and the ordering of A. Some important classes of groups, including word-hyperbolic and finitely generated abelian groups have shortlex automatic structures for any choice of ordered generating set. Other groups, including many Euclidean groups (finitely generated free abelian-by-finite) have short-lex automatic structures for some choices but not others. Finally, there are some groups, such as the braid groups B_{n} for n ≥ 4, which are automatic, but probably have no short-lex automatic structures at all.

The Warwick Automata package can (currently) only handle short-lex automatic structures. It cannot provide any information at all on whether a group might be automatic if it has no such structure. However, if the group does have such a structure using a particular ordered generating set A then, in principle, given enough time and space, the programs would be capable of verifying this fact, and calculating the associated finite state automata explicitly. I am not aware of any existing software which can do the same thing for automatic structures which are not short-lex. In Chapter 6 of [1], an algorithm is described for deciding whether a given collection of finite state automata consists of the automatic structure for some (not necessarily short-lex) automatic group G. This algorithm has two shortcomings. Firstly, it does not necessarily determine the group G up to isomorphism (although this would probably be fairly clear in most cases). Secondly, and more seriously, it does not make any suggestions as to how to come up with the automata for testing.

The Automata package for short-lex automatic groups takes a finite group presentation as input (it is proved in Theorem 2.3.12 of [1] that all automatic groups are finitely presented). The ordering of the generating set is defined by the order in which the generators are input, and inverses are inserted directly after each generator, unless they are explicitly specified elsewhere. The program first attempts to produce likely candidates for the automata in a short-lex automatic structure for G. It then uses a method similar to that described in Chapter 6 of [1] to verify the correctness of these automata. However, in the short-lex situation, the details are considerably simpler than in the general case and, furthermore, it is verified that the automata really do correspond to the given group G. Although it is perhaps a somewhat rash claim to make, I believe that the fact that these programs effectively verify the correctness of the results that they produce renders the results intrinsically more reliable than those produced by many computer programs.

The remainder of the paper is organized as follows. In Section 2, we discuss two-variable finite state automata, logical operations on finite state automata, and introduce the concept of word-difference automata, which is central to the main algorithm. In Section 3, we describe the algorithm itself. In Section 4, we give a few examples with time and space requirements, in order to give an idea of the current scope of the procedure. Finally, in Section 5, we discuss briefly some related programs that are available with the Warwick package, which take a shortlex automatic structure as input. These are really just operations on finite state automata, and are not inherently dependent on the group structure. They include methods of determining the cardinality of the accepted language, enumerating the accepted language, and determining the growth series of the accepted language. By applying the last of these to the word-acceptor in a short-lex automatic structure, we obtain the growth series of the group.

Nearly all of the code in the Warwick package was written by the author, David Epstein and Sarah Rees. A procedure for minimizing the number of states in a finite state automaton accepting a given language was written by Dave Pearson. The growth-series code was written by Uri Zwick.

2. Finite State Automata

Let X be a finite state automaton with input alphabet A. We denote the set of states of X by S(X) and the set of accept states by A(X). The programs in Automata deal exclusively with partial deterministic automata, and all automata mentioned in this paper are of this type. (See Definition 1.2.5. of [1].) They have a unique initial state σ_{0}(X), and for each x ∈ A and σ ∈ S(X), there is either a unique transition from σ with label x, or no transition. In the first case, we denote the target of the transition by σ^{x}, and in the second case we say that σ^{x} is undefined. We can then define σ^{u}, for σ ∈ S(X) and u ∈ A^{∗} in the obvious way.

The automata in an automatic structure of a group G may be one-variable or two-variable. The word-acceptor is one-variable, and has input alphabet a monoid generating set A of G. The multipliers (and other automata, to be introduced later) are two-variable, and the idea is that they should read two words u and v in A simultaneously, and at the same rate. This creates a technical problem if u and v do not have the same length. To get round this, we introduce an extra symbol $, which maps onto the identity element of G, and let A^{†} = A ∪ {$}. Then if (u, v) is an ordered pair of words in A, we adjoin a sequence of $’s to the end of the shorter of u and v if necessary, to make them both have the same length. The resulting pair will be denoted by (u, v)^{†}, and can be regarded as an element of (A^{†} × A^{†})^{∗}. Such a word has the property that the symbol $ occurs in at most one of u and v, and only at the end of that word, and it is known as a padded word in A × A. We shall assume from now on, without further comment, that all of the two-variable automata that arise have input language A^{†} × A^{†} and accept only padded words.

The Automata package makes heavy use of logical operations on finite state automata. Let X and Y be two finite state automata, with the same input alphabet, and let the accepted languages be L(X) and L(Y), respectively. Then there are straightforward algorithms for constructing finite state automata X · Y, X′, X ∧ Y and X ∨ Y, with accepted languages L(X)L(Y), A^{∗} \ L(X), L(X) ∩ L(Y) and L(X) ∪ L(Y), respectively. If Z is a two-variable automaton accepting padded words in A × A then there is one-variable automata E(Z), with input alphabet A, that accepts u ∈ A^{∗} if and only if there exists v ∈ A^{∗} with (u, v)^{†} ∈ L(Z). (Clearly the same applies with u and v interchanged, and we can construct the corresponding “for all” automata by using a combination of negation and “there exists”.) These operations are all implemented in Automata. The algorithms are described in Chapter 1 of [1], and we shall not go into details here, except to mention that the construction of E(Z) amounts to constructing a deterministic automaton equivalent to a non-deterministic one, and potentially involves increasing the number n of states of Z to 2^{n} states of E(Z). This is one of the reasons why the programs can be very space-demanding for larger examples. Automata also contains a procedure for replacing an automaton X with an equivalent one (that is, one accepting the same language) with the minimal number of states. This is applied routinely after all of the logical operations that we have just described.

The principal difference in emphasis between the current paper and [2] is that we shall describe as much of the algorithm as possible in terms of these logical operations on finite state automata. In [2], we gave more detailed direct descriptions of the individual procedures, and put much more emphasis on the string-rewriting aspects. I hope that the current approach is conceptually easier to understand.

We shall now introduce the concept of word-difference automata, which play a central role in the programs. Assume, as usual, that A is a monoid generating set for a group G. Then a two-variable automaton Z accepting padded words in A × A is called a word-difference automaton, if there is a function α : S(Z) → G such that

(i) α(σ_{0}(Z)) = Id_{G}, and (ii) for all x, y ∈ A^{†} and τ ∈ S(Z) such that τ^{(x,y)} is defined, we have α(τ^{(x,y)}) =

x^{−1}α(τ)y. We shall assume that all states τ in a word-difference automaton Z are acces-

sible; that is, there exist words u, v in A such that σ_{0}(Z)^{(u,v)^{†}} = τ. It follows from Properties (i) and (ii) that α(τ) = u^{−1}v, and so the map α is determined by the transition function of Z. We shall also assume that each accept state is mapped by α onto the same element g of G. We then say that Z is a word-difference automaton accepting g.

It is proved in Theorem 2.3.2 of [1] and Theorem 2.3 of [2] that any automatic structure has the so-called fellow-traveler property. This means that there is a finite set WD (the word-differences) of elements of G with the following property. If u, v ∈ L(W) and either u = v or u^{−1}v = x for some x ∈ A, and p(u) and p(v) are prefixes of u and v having the same length, then p(u)^{−1}p(v) ∈ WD. We also insist that x ∈ WD for all x ∈ A ∪ {Id_{G}}. We can therefore define associated word-difference automata W D_{x}, for x ∈ A ∪ {Id_{G}}, in which the set of states is WD, α is the identity map, and τ^{(x,y)} is defined if and only if x^{−1}τy ∈ WD, in which case it is equal to x^{−1}τy. The initial state is Id_{G}, and there is a single accept state x.

It is clear from all of this (c.f. Theorem 2.3.4 of [1] and Corollary 2.4 of [2]) that the multipliers M_{x} in an automatic structure accept (u, v)^{†} if and only if W D_{x} accepts (u, v)^{†} and the word-acceptor W accepts both u and v. As we shall see in the next section, this fact can be used to construct them.

There are two other word-difference automata which arise in the algorithms. We define L_{1} to be the set of padded words (u, v)^{†} in A × A with the following properties

(i) u = v in G; (ii) v is irreducible; (iii) u is reducible; (iv) u = tx with t ∈ A^{∗}, x ∈ A, and t is irreducible;

(v) u = ys with s ∈ A^{∗}, y ∈ A, and s is irreducible. So, if we think of the elements of L_{1} as reduction rules for G, where we replace occurrences of the left hand sides of rules by the corresponding right hand sides, then L_{1} is the minimal set of reduction rules necessary to reduce any word in A to its irreducible representative. If G has a short-lex automatic structure with respect to A, then it follows from the fellow-traveler property that the automaton W D_{$} accepts all words (u, v)^{†} in L_{1}. (This is because W D_{x} accepts (t, v)^{†} with t as in (iv).) Since the word-acceptor W accepts precisely the set of irreducible words, it is clear that the words (u, v)^{†} satisfying properties (ii)–(v) can be recognized by some finite state automaton X. Since the words accepted by W D_{$} satisfy property (i), it follows that X ∧ W D_{$} is a word-difference automaton accepting the language L_{1}. More generally, we shall say that a word-difference automaton accepting Id_{G} has property P_{1}, if its language contains L_{1}.

We define L_{2} to be the same as L_{1}, except that we omit property (v) from the definition; so L_{2} is usually larger than L_{1}. Again, there is a word-difference automaton accepting L_{2}, and a word-difference automaton accepting Id_{G} is said to have property P_{2} if its language contains L_{2}. In particular, W D_{$} has property P_{2}.

In the programs, we shall be constructing automata D_{1} and D_{2} which we hope will have properties P_{1} and P_{2}, respectively. (These are referred to as the principal transition table and the product transition table in [2].)

3. Description of the Algorithm

To understand the algorithm, it is essential to distinguish between the theoretical and the practical points of view. The material in Section 2 was completely theoretical. We assumed the existence of a short-lex automatic structure for a group G, and used the associated automata W and M_{x} to deduce the existence of W D_{x}, and word-difference automata with properties P_{1} and P_{2}.

The algorithms also assume the existence of an automatic structure, but their aim is to construct this structure, and W and M_{x} are not explicitly available at the beginning. Thus we cannot use them to construct the word-difference automata D_{1} and D_{2}. On the contrary, we first guess candidates for D_{1} and D_{2}, and then use these to construct candidates for W and M_{x}, and finally check the correctness of the complete automatic structure.

Another point to be borne in mind is that we cannot solve the word problem in G until the whole process is complete. This means that we cannot necessarily calculate the map α in the word-difference automata precisely, even though we know theoretically that it exists. The best we can do is to calculate a map α̂ from the set of states to A^{∗}, where α̂(σ) is the least element of A^{∗} (under the short-lex ordering) which is currently known to be equal to α(σ) in G. In the construction of D_{1} and D_{2}, we really want the states to be elements of WD and α to be the identity map, and so in practice, the states are elements of A^{∗} which we cannot currently reduce, and α̂(σ) is the identity map. Whenever we discover that two states are equal in G, we amalgamate them.

We can now give a somewhat simplified breakdown of the complete algorithm. The input is an ordered monoid-generating set A of a finitely presented group G, together with defining relations for G given as words in A. In principal, it will succeed if and only if G is short-lex automatic with respect to A, in which case it will construct the finite state automata of the associated automatic structure. (After minimization, these automata are essentially uniquely determined, because their languages are uniquely determined by A and G.)

Step 1. Construct a word-difference automaton D_{1} accepting the identity, which we

hope has property P_{1}.

Step 2. Construct a candidate for the word-acceptor W. Construct the equality multiplier M_{$}, which accepts the padded word (u, v)^{†} if and only if u = v ∈ L(W).

Step 3. Construct a word-difference automaton D_{2} accepting the identity, which we

hope has property P_{2}.

Step 4. Construct candidates for the multipliers M_{x}, for all x ∈ A. If, during this construction, we find distinct words u and v in A, both accepted by W, with u = v in G, then return to Step 1.

Step 5. Check correctness of D_{2}. If incorrect, return to Step 3. Step 6. Check correctness of W and M_{x}. If incorrect, return to Step 1.

We shall describe these steps in more detail. All of them except for Step 1 are essentially logical operations on finite state automata, and so we leave Step 1 until last. Assume then that we have completed Step 1, and let GT be the two-variable automaton which, for u, v ∈ A^{∗} accepts (u, v)^{†} if and only if u ≻ v. In Step 2, we construct W using the standard finite state automaton operation

W = (A^{∗} · E(D_{1} ∧ GT) · A^{∗})′.

Expressed in words, W accepts w ∈ A^{∗} if and only if it does not have a substring u such that there exists v ∈ A^{∗} with u ≻ v and (u, v)^{†} accepted by D_{1}. It is clear that, if D_{1} really does have property P_{1}, then W will accept the set of irreducible words; in other words, it will be correct.

The converse is not necessarily true; that is, it is possible for W to be correct and for D_{1} not to accept everything in L_{1}. However, what is true is that if W is correct and u is reducible (so not accepted by W), then there is a substring s of u such that D_{1} accepts (s, t)^{†} for some s ≻ t, and it is not difficult to use D_{1} to find s and t. (This technique is contained in the proof of Theorem 4.1 of [2], and we shall not give further details here.) Thus, if W is correct, then we can effectively use D_{1} to reduce words in A^{∗} to their irreducible representatives. That is, we can solve the word problem in G and calculate the maps α associated with the word-difference automata correctly. The subsequent steps of the algorithm use this technique under the assumption that W is indeed correct. As we shall see shortly, if this is the case, and G really is short-lex automatic with respect to A, then it is guaranteed that after a finite number of iterations through the loop in Steps 3–5, the multipliers M_{x} will also be correct, and so Step 6 will succeed.

Another significant property of the W constructed is that, even if it is incorrect, it always accepts at least one word for each group element. To see this, let g ∈ G and let u be a word in A mapping onto G. Then we can use D_{1} to reduce u to a word v accepted by W, and since we are assuming that D_{1} accepts the identity, we have u = v = g. This means that the language accepted by W always contains the irreducible words; that is, it can be too large but never too small. Since Step 6 effectively checks that W accepts only irreducible words, we know that, if Step 6 succeeds, then the automatic structure that we have constructed is for the given group G. In the more general situation described in Chapter 6 of [1], nothing about W is assumed, and so it is possible, even if the verification process succeeds, that the automatic structure is for a proper factor group of the given group G.

The equality multiplier M_{$} constructed in Step 2 is not really necessary but it is useful to have it available in Step 6.

In Step 3, our aim is to make D_{2} equal to the automaton W D_{$} defined in Section 2. For this, we need a candidate for the word-difference set WD. For our initial candidate (on the first call of Step 3), we let I be the set of all images α̂(τ) for τ ∈ S(D_{1}), and put

S(D_{2}) = I ∪ I^{−1} ∪ A ∪ {ε}.

We do this because we know that WD is closed under inversion (since A is), and we require it to contain A ∪ {ε}. We then define D_{2} exactly as specified for W D_{$} in Section 2. That is, for τ ∈ S(D_{2}) and x, y ∈ A^{†}, τ^{(x,y)} is defined if and only if x^{−1}τy ∈ S(D_{2}), in which case it is equal to x^{−1}τy. The initial state and the only accept state is ε. The expressions x^{−1}τy are calculated using the word reduction algorithm mentioned above. Remember that, if W is correct, then so is the word reduction algorithm, and so S(D_{2}) can be regarded as a subset of G and α̂ = α. It follows that, if W is correct and S(D_{2}) really does contain WD, then D_{2}, as constructed, will have property P_{2}. However, in many examples S(D_{2}) will not contain WD on the first iteration, and Step 5 tests for this, and produces some explicit elements in WD \ S(D_{2}) if it is nonempty. If G is short-lex automatic with respect to A, then WD is finite, and so we will only need to go through this iteration a finite number of times (assuming of course that W is correct).

We next describe Step 4. We construct the multipliers exactly according to the definition of standard automata in Definition 2.3.3 of [1]. For each M_{x}, the set of states is S(W) × S(W) × S(D_{2}) with initial state (σ_{0}(W), σ_{0}(W), σ_{0}(D_{2})), and for x, y ∈ A^{†} and (σ_{1}, σ_{2}, τ) ∈ S(M_{x}), the transition (σ_{1}, σ_{2}, τ)^{(x,y)} is defined to be equal to (σ_{1}^{x}, σ_{2}^{y}, τ^{(x,y)}) provided all three components are defined, and undefined otherwise. The M_{x} for different x differ from each other only in their accept states; the accept states of M_{x} are all (σ_{1}, σ_{2}, τ) such that σ_{1}, σ_{2} ∈ A(W) and α̂(τ) ≡ x. However, once the M_{x} have been constructed in this fashion, they are immediately minimized, after which they no longer have the same sets of states, and are no longer necessarily word-difference automata.

It sometimes happens that, during the course of the construction in Step 4, we find distinct words u, v in A, both accepted by W, for which u = v in G. This means that W is accepting two words for the same group element, and so it cannot be correct. We can therefore return immediately to Step 1. (This happens when there is (u, v) ∈ L(D_{2}) \ L(D_{1}), where (u, v) ought to be in L(D_{1}), and so D_{1} is incorrect.) Although we know of no theoretical reason why this should be the case, we have never yet encountered an example in which we have got through to Step 6 and the axiom checking has failed. It seems that, if our automata are wrong, then this fact becomes clear either at this stage or at Step 5.

Note that, if W is correct (which ensures that S(D_{2}) is a subset of G and α is the identity map) and D_{2} accepts everything in L_{2} (defined in Section 2), then S(D_{2}) must contain WD, and so the multiplers M_{x} will be correct. Suppose that W is correct but M_{x} is not correct, for some x ∈ A. From the construction of M_{x}, it is clear that, if M_{x} accepts (u, v)^{†}, then W accepts u and v, and ux = v in G. Thus, there exist words u and v in A^{∗} such that W accepts u and v and ux = v in G, but M_{x} does not accept (u, v)^{†}. But then, since v is the unique word accepted by W that is equal to ux in G, M_{x} cannot accept (u, w)^{†} for any w ∈ A^{∗}. So we can test for this, by constructing the automata W ∧ E(M_{x})′ for each x ∈ A, and we do this in Step 5. If all of these automata have empty accepted language and W is correct, then the M_{x} must also be correct, and we proceed to Step 6 for the final verification. Otherwise, we find some explicit words u which are not accepted by some W ∧ E(M_{x})′, and we let v be the reduction of ux (using D_{1}); then W accepts v and ux = v in G. Since M_{x} does not accept (u, v), there must be prefixes p(u) and p(v) of u and v of the same length, such that p(u)^{−1}p(v) ∉ S(D_{2}). We therefore return to Step 3, and adjoin all such elements and their inverses to S(D_{2}), and then recalculate D_{2} itself.

Step 6 depends on the following logical automaton operation. If Z_{1} and Z_{2} are any two two-variable automata with the same input alphabet A^{†} × A^{†}, then we define their composite to be the two-variable automaton with language

{(u, v)^{†}|∃w ∈ A^{∗} : (u, w)^{†} ∈ L(Z_{1}) and (w, v)^{†} ∈ L(Z_{2})}.

In particular, for multipliers M_{x} and M_{y}, we denote their composite by M_{xy}. The composite operation is easily seen to be associative, and so we can define M_{u} for any u ∈ A^{∗} by repeated application, where M_{ε} = M_{$}. It is also easy to see that, if M_{u} accepts (v, w)^{†}, then vu = w in G. The axiom checking process essentially verifies the converse of this statement. More precisely, let R be the set of defining relators of G, as a monoid (so it includes the inverse relators xx^{−1}, for all x ∈ A). Then, it is proved in Theorem 2.5 of [2], that if M_{r} has the same language as M_{$} for all r ∈ R, then the automata W and M_{x} are correct. So we can check this by repeated application of the composite operation. Since this operation involves making a non-deterministic automaton deterministic, it potentially involves an exponential increase in the number of states. We try to keep this under control by minimizing after every operation. With a long relator r it seems to be most efficient to split r roughly in half as r ≡ st and then form M_{s} and M_{t}, and construct M_{r} as the composite of these. In most examples, Step 6 takes the longest time, and is often the most space-demanding.

Finally we turn to Step 1. Our current approach to this is to use the Knuth-Bendix procedure on the group presentation to derive a list of reduction rules of the form (u, v), where u and v are words in A, u = v in G and u ≻ v. Since we devoted a large part of [2] to the Knuth-Bendix procedure, we will not discuss it in detail here, but concentrate on its application to Step 1 of the procedure. At any time, the existing rules are used to reduce words w in A to their least possible representative, by substituting v for u whenever u is a substring of w and (u, v) is a rule. Occasionally, the Knuth-Bendix procedure terminates with a finite complete set of reduction rules, in which case these rules suffice to reduce any word to its irreducible representative in G. But this does not usually happen. For any particular w, it is guaranteed that we will eventually generate enough rules to correctly reduce w, but we have no way in general of knowing how long this will take, or even whether we can currently reduce w correctly. (For example, the group itself could be trivial, but it could take a long time for this fact to emerge.)

At regular intervals, we interrupt the Knuth-Bendix procedure, and form a candidate for the word-difference automaton D_{1} using the current set of rules. We do this as follows. S(D_{1}) is initially empty. Consider each rule (u, v) in turn, and let u = x_{1}x_{2} … x_{m} and v = y_{1}y_{2} … y_{n} with m ≥ n. We pad v if necessary in the usual way, by putting y_{i} = $ for n < i ≤ m. Let d_{0} = ε and for 1 ≤ i ≤ m let d_{i} be the reduction, using the current rules, of x_{i}^{−1}d_{i−1}y_{i} (so d_{i} is a word-difference). Then we adjoin the states d_{i} to S(D_{1}) and the transitions d_{i−1}^{(x_{i},y_{i})} = d_{i} to D_{1} if any of them are not there already. Of course α maps a state to its image in G, and the start and accept states are both ε.

Suppose G really is short-lex automatic with respect to A. Then, as we saw in Section 2, there is a word-difference automaton that accepts the language L_{1}. Since this automaton contains only finitely many states and transitions, it follows that these states and transitions will be manifested by a finite subset of L_{1}. Thus once we have run the Knuth-Bendix procedure long enough to generate all of the rules in this finite subset, and we have enough rules to correctly reduce each of the transitions x_{i}^{−1}d_{i−1}y_{i} described above, the candidate for D_{1} that we construct will have the required property P_{1}, and then the remaining steps 2–6 of the complete procedure will also complete successfully.

The big problem is to recognize when this has happened and to proceed to Step 2. Currently, we have no completely satisfactory heuristics for this. Our default method is to wait until several successive candidates for D_{1} have been identical; that is to wait until D_{1} has apparently become constant. This approach is successful for many straightforward examples. However, because the current system of rules at any time is not adequate to reduce all strings correctly, it happens sometimes that the D_{1} constructed has superfluous states and accepts strings that are not in L_{1}. This, in itself, does not matter provided that there are not too many such superfluous states, but it has the effect that it makes it difficult to recognize when D_{1} has property P_{1}, because it never appears to become stable. In such cases, the user has to decide interactively when to stop. Of course, if D_{1} appears to be increasing steadily and rapidly in size, then this is good evidence that G is not short-lex automatic with respect to A.

Currently, if we need to return to Step 1 after Steps 3 or 6, then we begin again completely, because it seems to difficult (and space consuming) to attempt to restart from where we left off last time. As we mentioned above, we have never encountered an example in which Step 6 failed. It would probably be a good idea to insert the discovered identity u = v as a new rule if we return to Step 1 after Step 3, but we are not currently doing that. Alternatively, we could simply recalculate D_{1} after adjoining the new rule (u, v) and not use Knuth-Bendix again at all. We intend to experiment with such alternative strategies in the near future. Another simple policy, which we do use sometimes, is to use D_{2} in place of D_{1}, which seems reasonable theoretically, since the language of D_{2} is usually larger than that of D_{1}. In fact, this is often effective; the only disadvantage is that it usually increases the space requirements of Step 2 quite considerably, and so it is not always practical.

As we have seen, Steps 2–6 are more routine and predictable than Step 1, but they are subject to exponential increase in storage demands at certain points. Our experience with examples indicates that when D_{1} is correct (i.e. it has property P_{1}, then the space requirements will be large, but not impracticably so, but when D_{1} is incorrect, the exponential increases will really occur and cripple the whole process. There is no known theoretical reason why this should be the case, but it is seems reasonable to suppose that when D_{1} is correct then the subsequent calculations are constructing natural objects associated with G, whereas when D_{1} is incorrect, the calculations are in some sense meaningless and therefore random.

This situation indicates that the most important problem now is to try to find improved methods of carrying out Step 1. Improvements to the remaining steps would also be useful of course, but they are more likely to be purely computational in nature rather than algorithmic. In the Knuth-Bendix procedure, there is considerable freedom in the choice order in which we process overlaps. A strategy needs to be found which produces the finite subset of L_{1} mentioned above as quickly as possible. There may also be completely different approaches to Step 1, which do not involve Knuth-Bendix, but none has been found to date.

4. Examples

A number of relatively easy and straightforward examples in which the Automata program runs successfully were described in [2]. Here we describe some examples of varying difficulty which have arisen in some natural context during the past few years, for which we have successfully computed the automatic structure. There are two shell-scripts available which run the complete procedure described in Section 3, by running the individual programs that perform the steps in the procedure in the correct order. These are called automata and automatac. The second of these has often proved more efficacious on the harder examples.

The first example is a group that was used by Charlie Gunn at the Geometry Center, Minneapolis, in connection with drawing pictures of tessellations of hyperbolic space with a dodecahedral fundamental region. Such pictures were used in the film ”Not Knot” produced by the Center. The word-acceptor of the group is used to generate each group-element exactly once, which results in faster and more accurate drawings. The presentation is

G_{1} = ⟨a, b, c, d, e, f|a^{4}, b^{4}, c^{4}, d^{4}, e^{4}, f^{4}, abAe, bcBf, cdCa, deDb, efEc, faF d⟩.

(In all of the examples in this section, we use the inverse by case-change convention; that is A is the inverse of a, etc.) The automatac program completed in a total of 545 seconds on a Silicon Graphics Iris XS24 machine, with 32 Megabytes of core memory available. The word-acceptor has 48 states and the multipliers range from 145–175 states. This example went twice round the first loop (Steps 1–4) of the algorithm, and six times round the second loop (Steps 3–6).

In the above example, and in many of those that follow, it would be possible to eliminate several of the generators before starting. Experience has shown that this is not a good idea in general. The programs appear to run best on the natural presentations of the groups, rather than on presentations that have been manipulated by the user.

The second example is a group arising from a (2, 2, 2, 2, 2, 2)-orbifold proposed by Bill Thurston. The presentation is

G_{2} = ⟨a, b, c, d, e, f, g, h, i, j, k, l|
dcbadc, (ahIE)^{2}, (beJF)^{2}, (cfKG)^{2}, (dgLH)^{2}, (ilKJ)^{2}⟩.

Initially this caused problems because of the large number of generators, which meant that the alphabet for the two-variable automata had size 361. To cope with this, we had to provide an optional new method of storage for automata, essentially storing the transition table as a sparse matrix, rather than as a simple two-dimensional array. The example then became tractable. The word-acceptor has 131 states and the multipliers range from 132–232 states. The total time on the SGI machine was 930 seconds.

The Fibonacci groups have been favorite test examples in combinatorial group theory for many years. The groups F (2, n) (for n > 2, say) have the presentation

F (2, n) = ⟨a_{1}, …, a_{n}|a_{1}a_{2} = a_{3}, a_{2}a_{3} = a_{4}, …, a_{n−1}a_{n} = a_{1}, a_{n}a_{1} = a_{2}⟩.

The group is finite when n = 3, 4, 5 or 7. For n = 6 it is Euclidean (free abelian-by finite), and is an easy example for automata. For n ≥ 8 and n even, they are known to be hyperbolic, and hence short-lex automatic. For n = 8, the automata program ran out of space on the SGI machine while computing the multipliers. It completed (in about 9 hours cpu-time) on a much slower Solbourne machine with 128 Megabytes of memory. The word-acceptor has 212 states and the multipliers all have 1861 states. In this example, the automatac program went twice round the first loop, then twice round the second loop, and then needed to go another time around the first loop before completing. In other words D_{1} was wrong the first time (with 51 word-differences), then D_{2} was wrong, and then it transpired that D_{1} was wrong again (with 54 word-differences). There are in fact 58 states (word-differences) in the correct D_{1} automaton.

We have also successfully computed the automatic structure of F (2, 10), which is larger (and more difficult) than that of F (2, 8), but not disproportionately so. The examples for n odd are much more difficult, and it is not known whether or not they are hyperbolic. Since writing the first draft of this paper, the author has rewritten some of the procedures in Automata, using improved data structures (but no essentially new algorithms), and it has become possible to complete some larger examples. In particular, F (2, 9) has been proved to be short-lex automatic using its natural presentation, and this is the largest automatic structure that we have successfully computed to date. The word-acceptor has 3251 states, and the multipliers about 25000 states, but they had about 860000 states before minimization. The complete computation took about 12 hours of cpu-time and used up to about 130 Megabytes of memory on a new SPARCstation 20. More details of this calculation can be found in [3]. This group had already been proved to be infinite by M. F. Newman in [4]; the automatic structure easily provides an independent proof of this fact, together with additional information, such as the fact that the generators have infinite order, which had not been known previously.

We conclude by mentioning some further large examples which we have successfully computed recently. The first of these is a presentation for the Picard group P = SL(2, R), where R is the ring of Gaussian integers, taken from [6]:

P = ⟨a, t, u, l, j|

a^{2} = l^{2} = (at)^{3} = (al)^{2} = (tl)^{2} = (ul)^{2} = (ual)^{3} = j, j^{2} = [t, u] = 1, j central⟩.

The word-acceptor has 403 states and the multipliers range from 403–3718. (The smallest is for the central generator j, which is of course −I in SL(2, R).) The most remarkable thing about this example is that it was necessary to go 12 times around the second loop in the procedure. This suggests that techniques should be sought to find more missing word-differences at the same time.

The following presentation was proposed by André Rocha:

G = ⟨a, b, c, d, e, f|BceF a, CdfBa, DebCa, EfcDa, F bdEa, ecfdb⟩.

(This is the fundamental group of a negatively closed Seifert-Weber manifold.) The word-acceptor has 1429 states, and the multipliers about 14000 states.

The final presentation was proposed several years ago by Thurston, and represents a knot with surgery. (The first two relations define the group of the knot, and the final relation the surgery. The computation for the knot group itself, obtained by omitting the final relation, is relatively straightforward.)

G = ⟨x, y, t|txT = xyx, tyT = xy, (XY xy)^{2} = t^{3}⟩.

The word-acceptor has 1188 states, and the multipliers about 9300 states.

5. Related Algorithms

In this final section, we mention some related algorithms that have been implemented at Warwick, which take an automatic structure of a group as input. The first few of these are fairly easy, and the implementations are distributed with Automata. There is a program to enumerate the accepted words of a finite state automaton up to a given length, using a depth-first search. When applied to the word-acceptor of a short-lex automatic group, this produces a unique word for each group element, and is the basis of many of the applications of the programs to hyperbolic geometry, particularly to drawing pictures. There is a fast and simple program to decide whether the language of an automaton is finite and, if so, to determine its order. This can be used on the word-acceptor to determine the order of a finite group. (For most presentations of finite groups, Todd-Coxeter coset enumeration provides the fastest mechanical way of determining the order, but there are some cases in which the automatic group method works faster.)

If a group is word-hyperbolic, then the geodesics between any two vertices in the Cayley graph have the fellow-traveler property - that is they remain within a bounded distance of each other. It has recently been proved by Panos Papasoglu (see [5]) that the converse of this statement is also true; if the geodesics in the Cayley graph have the fellow-traveler property, then the group is hyperbolic. This means that there should be an automatic structure for the group in which the wordacceptor accepts all shortest words for each group element. There is a program available with the package which attempts to calculate this word-acceptor. If it terminates, then the geodesic word-acceptor that is calculated is guaranteed to be correct and so, by the result of Papasoglu, we have verified that the group is hyperbolic.

The algorithm used is as follows. We assume that some short-lex automatic structure for the group G has already been calculated. Assume also that we have a list WDG of some or all of the word-differences that occur between geodesics in the Cayley graph of G, and that WDG contains the set WD (see Section 3) that was calculated with the short-lex automatic structure. Let W DG be the corresponding two-variable word-difference automaton which accepts (u, v) if and only if u = v, u and v have equal lengths, and the word-differences arising from the two paths u and v all lie in WDG. Now calculate a sequence W_{i}(i ≥ 0) of finite state automata, where W_{0} is the short-lex word-acceptor, which we already have, and

W_{i+1} = {u|∃v ∈ L(W_{i}) with (u, v) ∈ L(W DG)}.

Then L(W_{i}) ⊆ L(W_{i+1}) for all i, and if L(W_{i}) = L(W_{i+1}) for some i, then L(W_{i}) is the set of all geodesic words, and so W_{i} is the required geodesic word-acceptor. (To see this, let u be any geodesic word, let v be the short-lex reduced word equal to u in G, and let u = u_{0}, u_{1}, …, u_{n} = v be a reduction of u to v where, for each i, (u_{i}, u_{i+1}) is in the language L_{2} defined in Section 2. Since u is a geodesic, the u_{i} all have the same length and, since we are assuming that WDG contains WD, we have (u_{i}, u_{i+1}) ∈ L(W DG) for all i, and so u ∈ L(W_{n}).) So if the algorithm terminates, then we know that the answer is correct. Conversely, if WDG contains all the worddifferences that arise from pairs (u, v), where u is a geodesic and v is the short-lex reduced word equal to u in G, then the algorithm will terminate; in fact W_{1} will already be the correct geodesic word-acceptor. The only problem with all of this is how to find the set WDG. We can try WDG = WD as a first attempt, but that is often not large enough. Currently, our method is to choose random geodesics u up to a specified length (40 or 50 is usually adequate in the examples that we are considering), reduce them to their short-lex minimal equivalents v, calculate the word-differences that arise from (u, v), and adjoin them to WDG if they are not there already. A deterministic method for doing this has been proposed by David Epstein but has not yet been implemented.

For example, in the group G_{1} of Section 4, |WD| = 75 and the algorithm does not appear to terminate with WDG = WD, but by choosing random geodesics we rapidly increase WDG to size 103, and the procedure then terminates with the geodesic word-acceptor W_{1} having 64 states. In G_{2}, WD has size 99 and is already adequate to calculate the geodesic word-acceptor, which has 156 states. We have not yet succeeded in calculating the geodesic word-acceptor for F (2, 8).

Finally, we should like to mention the growth-rate program, written by Uri Zwick. This is not supplied with Automata, but a binary executable for Sun 4 architecture is available on request. The growth-function for a group G with a given monoid generating set A is defined to be the formal power series f_{G,A}(t) = ∑_{i≥0} w(i)t^{i}, where w(i) is the number of elements of G for which the shortest word in A has length i. If we have a short-lex word-acceptor W for G with respect to A, then clearly w(i) is equal to the number of words of length i in L(W), and so f_{G,A}(t) can be calculated from W. It can be proved that the generating function of the language of a finite state automaton is always a rational function of t, and the result is output in this form by Zwick’s program. For example, the growth function for the free group on two generators is (1 + t)/(1 − 3t), whereas the growth-rate for the example G_{1} in Section 4 is (1 + 3t + 3t^{2} + t^{3})/(1 − 9t + 9t^{2} − t^{3}).

References

1. David B. A. Epstein, J. W. Cannon, D. F. Holt, S. V. F. Levy, M. S. Paterson, and W. P. Thurston, Word Processing in Groups, Jones and Bartlett, 1992.

2. D. B. A. Epstein, D. F. Holt, and S. E. Rees, The Use of Knuth-Bendix Methods to Solve the Word Problem in Automatic Groups, J. Symbolic Computation 12 (1991), 397–414.

3. D. F. Holt, An alternative proof that the Fibonacci group F (2, 9) is infinite, Experimental Mathematics (to appear).

4. M. F. Newman, Proving a group infinite, Arch. Math. 54 (1990), 209–211.

5. P. Papasoglu, Strongly geodesically automatic groups are hyperbolic, (Warwick preprint) (1994) (to appear).

6. R. G. Swan, Generators and relations for certain special linear groups, Bull. American Math. Soc. 74 (1968), 576–581.

Mathematics Institute, University of Warwick, Coventry CV4 7AL, U.K.

    E-mail address: dfh@maths.warwick.ac.uk