Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 418346%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1%%2%W moreexamples.tex ACE appendix - more examples Joachim Neub"user3%W Greg Gamble4%%5%H $Id$6%%7%Y Copyright (C) 2000 Centre for Discrete Mathematics and Computing8%Y Department of Information Tech. & Electrical Eng.9%Y University of Queensland, Australia.10%%1112%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%13\Chapter{Finer Points with Examples}1415The examples in this chapter are intended to provide the nearest16{\GAP} equivalent of the similarly named sections in Appendix~A of17`ace3001.ps' (the standalone manual in directory `standalone-doc').18There is a *lot* of detail here, which the novice {\ACE} Package user19won't want to know about. Please, despite the name of the first20section of this chapter, read the examples in Appendix~"Examples"21first.2223%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%24\Section{Getting Started}2526Each of the functions `ACECosetTableFromGensAndRels'27(see~"ACECosetTableFromGensAndRels"), `ACEStats' (see~"ACEStats" ---28non-interactive version) and `ACEStart' (see~"ACEStart"), may be29called with three arguments: <fgens> (the group generators), <rels>30(the group relators), and <sgens> (the subgroup generators). While it31is legal for the arguments <rels> and <sgens> to be empty lists, it is32always an error for <fgens> to be empty, e.g.3334\beginexample35gap> ACEStats([],[],[]);36Error, fgens (arg[1]) must be a non-empty list of group generators ...37called from38CALL_ACE( "ACEStats", arg[1], arg[2], arg[3] ) called from39<function>( <arguments> ) called from read-eval-loop40Entering break read-eval-print loop ...41type: 'quit;' to quit to outer loop, or42type: 'fgens := <val>; return;' to assign <val> to fgens to continue.43brk> fgens := FreeGeneratorsOfFpGroup(FreeGroup("a"));44[ a ]45brk> return;46rec( index := 0, cputime := 13, cputimeUnits := "10^-2 seconds",47activecosets := 499998, maxcosets := 499998, totcosets := 499998 )4849\endexample5051The example shows that the {\ACE} package does allow you to recover52from the `break'-loop. However, the definition of `fgens' above is53local to the `break'-loop, and in any case we shall want two54generators for the examples we wish to consider and raise some other55points; so let us re-define `fgens' and start again:5657\beginexample58gap> F := FreeGroup("a", "b");; fgens := FreeGeneratorsOfFpGroup(F);;5960\endexample6162\atindex{ACEStats}{@\noexpand`ACEStats'!example}63*An `ACEStats' example*6465By default, the presentation is not echoed; use the `echo'66(see~"option echo") option if you want that. Also, by default, the67{\ACE} binary only prints a *results message*, but we won't see that68unless we set `InfoACE' to a level of at least 269(see~"SetInfoACELevel"):7071\beginexample72gap> SetInfoACELevel(2);7374\endexample7576Calling `ACEStats' with arguments `fgens', `[]', `[]', defines a free77froup with 2 generators, since the second argument defines an empty78relator list; and since the third argument is an empty list of79generators, the subgroup defined is trivial. So the enumeration80overflows:8182\beginexample83gap> ACEStats(fgens, [], []);84#I OVERFLOW (a=249998 r=83333 h=83333 n=249999; l=337 c=0.10; m=249998 t=2499\8598)86rec( index := 0, cputime := 10, cputimeUnits := "10^-2 seconds",87activecosets := 249998, maxcosets := 249998, totcosets := 249998 )8889\endexample9091The line starting with ```\#I '''. is the `Info'-ed *results92message* from {\ACE}; see Appendix~"The Meanings of ACE's Output93Messages" for details on what it means. Observe that since the94enumeration overflowed, {\ACE}'s result message has been translated95into a {\GAP} record with `index' field 0.9697To dump out the presentation and parameters associated with an98enumeration, {\ACE} provides the `sr' (see~"option sr") option.99However, you won't see output of this command, unless you set the100`InfoACELevel' to at least 3. Also, to ensure the reliability of the101output of the `sr' option, an enumeration should *precede* it; for102`ACEStats' (and `ACECosetTableFromGensAndRels') the directive `start'103(see~"option start") required to initiate an enumeration is inserted104(automatically) after all the user's options, except if the user105herself supplies an option that initiates an enumeration (namely, one106of `start' or `begin' (see~"option start"), `aep' (see~"option aep")107or `rep' (see~"option rep")). Interactively, the equivalent of the108`sr' command is `ACEParameters' (see~"ACEParameters"), which gives an109output record that is immediately {\GAP}-usable. With the above in110mind let's rerun the enumeration and get {\ACE}'s dump of the111presentation and parameters:112113\beginexample114gap> SetInfoACELevel(3);115gap> ACEStats(fgens, [], [] : start, sr := 1);116#I ACE 3.001 Wed Oct 31 09:36:39 2001117#I =========================================118#I Host information:119#I name = rigel120#I OVERFLOW (a=249998 r=83333 h=83333 n=249999; l=337 c=0.09; m=249998 t=2499\12198)122#I #--- ACE 3.001: Run Parameters ---123#I Group Name: G;124#I Group Generators: ab;125#I Group Relators: ;126#I Subgroup Name: H;127#I Subgroup Generators: ;128#I Wo:1000000; Max:249998; Mess:0; Ti:-1; Ho:-1; Loop:0;129#I As:0; Path:0; Row:1; Mend:0; No:0; Look:0; Com:10;130#I C:0; R:0; Fi:7; PMod:3; PSiz:256; DMod:4; DSiz:1000;131#I #---------------------------------132rec( index := 0, cputime := 9, cputimeUnits := "10^-2 seconds",133activecosets := 249998, maxcosets := 249998, totcosets := 249998 )134135\endexample136137Observe that at `InfoACE' level 3, one also gets {\ACE}'s banner. We138could have printed out the first few lines of the coset table if we139had wished, using the `print' (see~"option print") option, but note as140with the `sr' option, an enumeration should *precede* it. Here's what141happens if you disregard this (recall, we still have the `InfoACE'142level set to 3):143144\beginexample145gap> ACEStats(fgens, [], [] : print := [-1, 12]);146#I ACE 3.001 Wed Oct 31 09:37:37 2001147#I =========================================148#I Host information:149#I name = rigel150#I ** ERROR (continuing with next line)151#I no information in table152#I ***153#I ***154#I OVERFLOW (a=249998 r=83333 h=83333 n=249999; l=337 c=0.09; m=249998 t=2499\15598)156rec( index := 0, cputime := 9, cputimeUnits := "10^-2 seconds",157activecosets := 249998, maxcosets := 249998, totcosets := 249998 )158159\endexample160161Essentially, because {\ACE} had not done an enumeration prior to162getting the `print' directive, it complained with an ```** ERROR''',163recovered and went on with the `start' directive automatically164inserted by the `ACEStats' command: no ill effects at the {\GAP}165level, but also no table.166167Now, let's do what we should have done (to get those first few lines168of the coset table), namely, insert the `start' option before the169`print' option (the `InfoACE' level is still 3):170171\beginexample172gap> ACEStats(fgens, [], [] : start, print := [-1, 12]);173#I ACE 3.001 Wed Oct 31 09:38:28 2001174#I =========================================175#I Host information:176#I name = rigel177#I OVERFLOW (a=249998 r=83333 h=83333 n=249999; l=337 c=0.10; m=249998 t=2499\17898)179#I co: a=249998 r=83333 h=83333 n=249999; c=+0.00180#I coset || a A b B order rep've181#I -------+---------------------------------------------182#I 1 || 2 3 4 5183#I 2 || 6 1 7 8 0 a184#I 3 || 1 9 10 11 0 A185#I 4 || 12 13 14 1 0 b186#I 5 || 15 16 1 17 0 B187#I 6 || 18 2 19 20 0 aa188#I 7 || 21 22 23 2 0 ab189#I 8 || 24 25 2 26 0 aB190#I 9 || 3 27 28 29 0 AA191#I 10 || 30 31 32 3 0 Ab192#I 11 || 33 34 3 35 0 AB193#I 12 || 36 4 37 38 0 ba194#I ***195rec( index := 0, cputime := 10, cputimeUnits := "10^-2 seconds",196activecosets := 249998, maxcosets := 249998, totcosets := 249998 )197198\endexample199200The values we gave to the `print' option, told {\ACE} to print the201first 12 lines and include coset representatives. Note that, since202there are no relators, the table has separate columns for generator203inverses. So the default workspace of $1000000$ words allows a table204of $249998 = 1000000/4 - 2$ cosets. Since row `fill'ing (see~"option205fill") is on by default, the table is simply filled with cosets in206order. Note that a compaction phase is done before printing the table,207but that this does nothing here (the lowercase `co:' tag), since there208are no dead cosets. The coset representatives are simply all possible209freely reduced words, in length plus lexicographic (i.e. `lenlex'; see210Section~"Coset Table Standardisation Schemes") order.211212\atindex{ACECosetTableFromGensAndRels}%213{@\noexpand`ACECosetTableFromGensAndRels'!example}214*Using `ACECosetTableFromGensAndRels'*215216The essential difference between the functions `ACEStats' and217`ACECosetTableFromGensAndRels' is that `ACEStats' parses the *results218message* from the {\ACE} binary and outputs a {\GAP} record containing219statistics of the enumeration, and `ACECosetTableFromGensAndRels'220after parsing the *results message*, goes on to parse {\ACE}'s coset221table, if it can, and outputs a {\GAP} list of lists version of that222table. So, if we had used `ACECosetTableFromGensAndRels' instead of223`ACEStats' in our examples above, we would have observed similar224output, except that we would have ended up in a `break'-loop (because225the enumeration overflows) instead of obtaining a record containing226enumeration statistics. We have already seen an example of that in227Section~"Using ACE Directly to Generate a Coset Table". So, here we228will consider two options that prevent one entering a `break'-loop,229namely the `silent' (see~"option silent") and `incomplete'230(see~"option incomplete") options. Firstly, let's take the last231`ACEStats' example, but use `ACECosetTableFromGensAndRels' instead and232include the `silent' option. (We still have the `InfoACE' level set at2333.)234235\beginexample236gap> ACECosetTableFromGensAndRels(fgens, [], [] : start, print := [-1, 12],237> silent);238#I ACE 3.001 Wed Oct 31 09:40:18 2001239#I =========================================240#I Host information:241#I name = rigel242#I OVERFLOW (a=249998 r=83333 h=83333 n=249999; l=337 c=0.09; m=249998 t=2499\24398)244#I co: a=249998 r=83333 h=83333 n=249999; c=+0.00245#I coset || a A b B order rep've246#I -------+---------------------------------------------247#I 1 || 2 3 4 5248#I 2 || 6 1 7 8 0 a249#I 3 || 1 9 10 11 0 A250#I 4 || 12 13 14 1 0 b251#I 5 || 15 16 1 17 0 B252#I 6 || 18 2 19 20 0 aa253#I 7 || 21 22 23 2 0 ab254#I 8 || 24 25 2 26 0 aB255#I 9 || 3 27 28 29 0 AA256#I 10 || 30 31 32 3 0 Ab257#I 11 || 33 34 3 35 0 AB258#I 12 || 36 4 37 38 0 ba259#I ***260fail261262\endexample263264Since, the enumeration overflowed and the `silent' option was set,265`ACECosetTableFromGensAndRels' simply returned `fail'. But hang on,266{\ACE} at least has a partial table; we should be able to obtain it in267{\GAP} format, in a situation like this. We can. We simply use the268`incomplete' option, instead of the `silent' option. However, if we269did that with the example above, the result would be an enormous table270(the number of *active cosets* is 249998); so let us also set the271`max' (see~"option max") option, in order that we should get a more272modestly sized partial table. Finally, we will use `print := -12'273since it is a shorter equivalent alternative to `print := [-1, 12]'.274Note that the output here was obtained with {\GAP} 4.3 (and is the275same with {\GAP} 4.4). With {\GAP} 4.2 the output was similar except276that the last `Info'-ed message (before the final output) states that277the coset table result is incomplete only, since no standardisation is278done. It turns out that the table displayed via the `print' option is279already in `lenlex' standard form; so despite the differences in the280{\GAP} versions, each version of {\GAP} since {\GAP} 4.2 has output281the same table.282283*Note:* Sinec the order options are passed to {\ACE} behind the colon,284has not been honoured since {\GAP} 4.5 (at about the time {\ACE} 5.1285was released in 2012), the behaviour exhibited below is no longer286observed. To approximately get the behaviour below, omit the option287`start'. This option is inserted anyway, if a user omits it, and288importantly is inserted after the `max' option is put to the {\ACE}289binary.290291\beginexample292gap> ACECosetTableFromGensAndRels(fgens, [], [] : max := 12,293> start, print := -12,294> incomplete);295#I ACE 3.001 Wed Oct 31 09:41:14 2001296#I =========================================297#I Host information:298#I name = rigel299#I OVERFLOW (a=12 r=4 h=4 n=13; l=5 c=0.00; m=12 t=12)300#I co: a=12 r=4 h=4 n=13; c=+0.00301#I coset || a A b B order rep've302#I -------+---------------------------------------------303#I 1 || 2 3 4 5304#I 2 || 6 1 7 8 0 a305#I 3 || 1 9 10 11 0 A306#I 4 || 12 0 0 1 0 b307#I 5 || 0 0 1 0 0 B308#I 6 || 0 2 0 0 0 aa309#I 7 || 0 0 0 2 0 ab310#I 8 || 0 0 2 0 0 aB311#I 9 || 3 0 0 0 0 AA312#I 10 || 0 0 0 3 0 Ab313#I 11 || 0 0 3 0 0 AB314#I 12 || 0 4 0 0 0 ba315#I ***316#I co: a=12 r=4 h=4 n=13; c=+0.00317#I coset || a A b B318#I -------+----------------------------319#I 1 || 2 3 4 5320#I 2 || 6 1 7 8321#I 3 || 1 9 10 11322#I 4 || 12 0 0 1323#I 5 || 0 0 1 0324#I 6 || 0 2 0 0325#I 7 || 0 0 0 2326#I 8 || 0 0 2 0327#I 9 || 3 0 0 0328#I 10 || 0 0 0 3329#I 11 || 0 0 3 0330#I 12 || 0 4 0 0331#I ACECosetTable: Coset table is incomplete, reduced & lenlex standardised.332[ [ 2, 6, 1, 12, 0, 0, 0, 0, 3, 0, 0, 0 ],333[ 3, 1, 9, 0, 0, 2, 0, 0, 0, 0, 0, 4 ],334[ 4, 7, 10, 0, 1, 0, 0, 2, 0, 0, 3, 0 ],335[ 5, 8, 11, 1, 0, 0, 2, 0, 0, 3, 0, 0 ] ]336337\endexample338339Observe, that despite the fact that {\ACE} is able to define coset340representatives for all 12 coset numbers defined, the body of the341coset table now contains a 0 at each place formerly occupied by a342coset number larger than 12 (0 essentially represents ``don't know'').343To get a table that is the same in the first 12 rows as before we344would have had to set `max' to 38, since that was the largest coset345number that appeared in the body of the 12-line table, previously.346Also, note that the `max' option *preceded* the `start' option; since347the interface respects the order in which options are put by the user,348the enumeration invoked by `start' would otherwise have only been349restricted by the size of `workspace' (see~"option workspace"). The350warning that the coset table is incomplete is emitted at `InfoACE' or351`InfoWarning' level 1, i.e.~by default, you will see it.352353\atindex{ACEStart}{@\noexpand`ACEStart'!example}354*Using `ACEStart'*355356The limitation of the functions `ACEStats' and357`ACECosetTableFromGensAndRels' (on three arguments) is that they do358not *interact* with {\ACE}; they call {\ACE} with user-defined input,359and collect and parse the output for either statistics or a coset360table. On the other hand, the `ACEStart' (see~"ACEStart") function361allows one to start up an {\ACE} process and maintain a dialogue with362it. Moreover, via the functions `ACEStats' and `ACECosetTable' (on 1363or no arguments), one is able to extract the same information that we364could with the non-interactive versions of these functions. However,365we can also do a lot more. Each {\ACE} option that provides output366that can be used from within {\GAP} has a corresponding interactive367interface function that parses and translates that output into a form368usable from within {\GAP}.369370Now we emulate our (successful) `ACEStats' exchanges above, using371interactive {\ACE} interface functions. We could do this with:372`ACEStart(0, fgens, [], [] : start, sr := 1);' where the `0' first373argument tells `ACEStart' not to insert `start' after the options374explicitly listed. Alternatively, we may do the following (note that375the `InfoACE' level is still 3):376377\beginexample378gap> ACEStart(fgens, [], []);379#I ACE 3.001 Wed Oct 31 09:42:49 2001380#I =========================================381#I Host information:382#I name = rigel383#I ***384#I OVERFLOW (a=249998 r=83333 h=83333 n=249999; l=337 c=0.10; m=249998 t=2499\38598)3861387gap> ACEParameters(1);388#I #--- ACE 3.001: Run Parameters ---389#I Group Name: G;390#I Group Generators: ab;391#I Group Relators: ;392#I Subgroup Name: H;393#I Subgroup Generators: ;394#I Wo:1000000; Max:249998; Mess:0; Ti:-1; Ho:-1; Loop:0;395#I As:0; Path:0; Row:1; Mend:0; No:0; Look:0; Com:10;396#I C:0; R:0; Fi:7; PMod:3; PSiz:256; DMod:4; DSiz:1000;397#I #---------------------------------398rec( enumeration := "G", subgroup := "H", workspace := 1000000,399max := 249998, messages := 0, time := -1, hole := -1, loop := 0, asis := 0,400path := 0, row := 1, mendelsohn := 0, no := 0, lookahead := 0,401compaction := 10, ct := 0, rt := 0, fill := 7, pmode := 3, psize := 256,402dmode := 4, dsize := 1000 )403404\endexample405406Observe that the `ACEStart' call returned an integer (1, here). All 8407forms of the `ACEStart' function, return an integer that identifies408the interactive {\ACE} interface function initiated or communicated409with. We may use this integer to tell any interactive {\ACE} interface410function which interactive {\ACE} process we wish to communicate with.411Above we passed `1' to the `ACEParameters' command which caused `sr :=4121' (see~"option sr") to be passed to the interactive {\ACE} process413indexed by 1 (the process we just started), and a record containing414the parameter options (see~"ACEParameterOptions") is returned. Note415that the ``Run Parameters'': `Group Generators', `Group Relators' and416`Subgroup Generators' are considered ``args'' (i.e.~arguments) and a417record containing these is returned by the `GetACEArgs'418(see~"GetACEArgs") command; or they may be obtained individually via419the commands: `ACEGroupGenerators' (see~"ACEGroupGenerators"),420`ACERelators' (see~"ACERelators"), or `ACESubgroupGenerators'421(see~"ACESubgroupGenerators").422423We can obtain the enumeration statistics record, via the interactive424version of `ACEStats' (see~"ACEStats!interactive") :425426\beginexample427gap> ACEStats(1); # The interactive version of ACEStats takes 1 or no arg'ts428rec( index := 0, cputime := 10, cputimeUnits := "10^-2 seconds",429activecosets := 249998, maxcosets := 249998, totcosets := 249998 )430431\endexample432433To display 12 lines of the coset table with coset representatives434without invoking a further enumeration we could do: `ACEStart(0, 1 :435print := [-1, 12]);'. Alternatively, we may use the436`ACEDisplayCosetTable' (see~"ACEDisplayCosetTable") (the table itself437is emitted at `InfoACE' level 1, since by default we presumably want438to see it):439440\beginexample441gap> ACEDisplayCosetTable(1, [-1, 12]);442#I co: a=249998 r=83333 h=83333 n=249999; c=+0.00443#I coset || a A b B order rep've444#I -------+---------------------------------------------445#I 1 || 2 3 4 5446#I 2 || 6 1 7 8 0 a447#I 3 || 1 9 10 11 0 A448#I 4 || 12 13 14 1 0 b449#I 5 || 15 16 1 17 0 B450#I 6 || 18 2 19 20 0 aa451#I 7 || 21 22 23 2 0 ab452#I 8 || 24 25 2 26 0 aB453#I 9 || 3 27 28 29 0 AA454#I 10 || 30 31 32 3 0 Ab455#I 11 || 33 34 3 35 0 AB456#I 12 || 36 4 37 38 0 ba457#I ------------------------------------------------------------458459\endexample460461Still with the same interactive {\ACE} process we can now emulate the462`ACECosetTableFromGensAndRels' exchange that gave us an incomplete463coset table. Note that it is still necessary to invoke an enumeration464after setting the `max' (see~"option max") option. We could just call465`ACECosetTable' with the argument 1 and the same 4 options we used for466`ACECosetTableFromGensAndRels'. Alternatively, we can do the467equivalent of the 4 options one (or two) at a time, via their468equivalent interactive commands. Note that the `ACEStart' command469(without `0' as first argument) inserts a `start' directive after the470user option `max':471472\beginexample473gap> ACEStart(1 : max := 12);474#I ***475#I OVERFLOW (a=12 r=4 h=4 n=13; l=5 c=0.00; m=12 t=12)4761477478\endexample479480Now the following `ACEDisplayCosetTable' command does the equivalent481of the `print := [-1, 12]' option.482483\beginexample484gap> ACEDisplayCosetTable(1, [-1, 12]);485#I co: a=12 r=4 h=4 n=13; c=+0.00486#I coset || a A b B order rep've487#I -------+---------------------------------------------488#I 1 || 2 3 4 5489#I 2 || 6 1 7 8 0 a490#I 3 || 1 9 10 11 0 A491#I 4 || 12 0 0 1 0 b492#I 5 || 0 0 1 0 0 B493#I 6 || 0 2 0 0 0 aa494#I 7 || 0 0 0 2 0 ab495#I 8 || 0 0 2 0 0 aB496#I 9 || 3 0 0 0 0 AA497#I 10 || 0 0 0 3 0 Ab498#I 11 || 0 0 3 0 0 AB499#I 12 || 0 4 0 0 0 ba500#I ------------------------------------------------------------501502\endexample503504Finally, we call `ACECosetTable' with 1 argument (which invokes the505interactive version of `ACECosetTableFromGensAndRels') with the option506`incomplete'.507508\beginexample509gap> ACECosetTable(1 : incomplete);510#I start = yes, continue = yes, redo = yes511#I ***512#I OVERFLOW (a=12 r=4 h=4 n=13; l=4 c=0.00; m=12 t=12)513#I co: a=12 r=4 h=4 n=13; c=+0.00514#I coset || a A b B515#I -------+----------------------------516#I 1 || 2 3 4 5517#I 2 || 6 1 7 8518#I 3 || 1 9 10 11519#I 4 || 12 0 0 1520#I 5 || 0 0 1 0521#I 6 || 0 2 0 0522#I 7 || 0 0 0 2523#I 8 || 0 0 2 0524#I 9 || 3 0 0 0525#I 10 || 0 0 0 3526#I 11 || 0 0 3 0527#I 12 || 0 4 0 0528#I ACECosetTable: Coset table is incomplete, reduced & lenlex standardised.529[ [ 2, 6, 1, 12, 0, 0, 0, 0, 3, 0, 0, 0 ],530[ 3, 1, 9, 0, 0, 2, 0, 0, 0, 0, 0, 4 ],531[ 4, 7, 10, 0, 1, 0, 0, 2, 0, 0, 3, 0 ],532[ 5, 8, 11, 1, 0, 0, 2, 0, 0, 3, 0, 0 ] ]533534\endexample535536Observe the line beginning ```\#I start = yes,''' (the first line in537the output of `ACECosetTable'). This line appears in response to the538option `mode' (see~"option mode") inserted by `ACECosetTable' after539any user options; it is inserted in order to check that no user540options (possibly made before the `ACECosetTable' call) have541invalidated {\ACE}'s coset table. Since the line also says `continue =542yes', the mode `continue' (the least expensive of the three modes;543see~"option continu") is directed at {\ACE} which evokes a *results544message*. Then `ACECosetTable' extracts the incomplete table via a545`print' (see "option print") directive. If you wish to see all the546options that are directed to {\ACE}, set the `InfoACE' level to 4547(then all such commands are `Info'-ed behind a ```ToACE> ''' prompt;548see~"SetInfoACELevel").549550Following the standalone manual, we now set things up to do the551alternating group $A_5$, of order $60$. (We saw the group $A_5$ with552subgroup $C_5$ earlier in Section~"Example of Using ACE Interactively553(Using ACEStart)"; here we are concerned with observing and remarking554on the output from the {\ACE} binary.) We turn messaging on via the555`messages' (see~"option messages") option; setting `messages' to 1556tells {\ACE} to emit a *progress message* on each pass of its main557loop. In the example following we set `messages := 1000', which, for558our example, sets the interval between messages so high that we only559get the ``Run Parameters'' block (the same as that obtained with `sr560:= 1'), no progress messages and the final *results message*. Recall561`F' is the free group we defined on generators `fgens': `"a"' and562`"b"'. Here we will be interested in seeing what is transmitted to the563{\ACE} binary; so we will set the `InfoACE' level to 4 (what is564transmitted to {\ACE} will now appear behind a ```ToACE> ''' prompt,565and we will still see the messages *from* {\ACE}). Note, that when566{\GAP} prints `F.1' ($=$ `fgens[1]') it displays `a', but the567*variable* `a' is (at the moment) unassigned; so for convenience (in568defining relators, for example) we first assign the variable `a' to be569`F.1' (and `b' to be `F.2').570571\beginexample572gap> SetInfoACELevel(4);573gap> a := F.1;; b := F.2;;574gap> # Enumerating A_5 = < a, b || a^2, b^3, (a*b)^5 >575gap> # over Id (trivial subgp)576gap> ACEStart(1, fgens, [a^2, b^3, (a*b)^5], []577> # 4th arg empty (to define Id)578> : enumeration := "A_5", # Define the Group Name579> subgroup := "Id", # Define the Subgroup Name580> max := 0, # Set `max' back to default (no limit)581> messages := 1000); # Progress messages every 1000 iter'ns582#I ToACE> group:ab;583#I ToACE> relators:a^2,b^3,a*b*a*b*a*b*a*b*a*b;584#I ToACE> generators;585#I ToACE> enumeration:A_5;586#I ToACE> subgroup:Id;587#I ToACE> max:0;588#I ToACE> messages:1000;589#I ToACE> text:***;590#I ***591#I ToACE> text:***;592#I ***593#I ToACE> Start;594#I #--- ACE 3.001: Run Parameters ---595#I Group Name: A_5;596#I Group Generators: ab;597#I Group Relators: (a)^2, (b)^3, (ab)^5;598#I Subgroup Name: Id;599#I Subgroup Generators: ;600#I Wo:1000000; Max:333331; Mess:1000; Ti:-1; Ho:-1; Loop:0;601#I As:0; Path:0; Row:1; Mend:0; No:3; Look:0; Com:10;602#I C:0; R:0; Fi:6; PMod:3; PSiz:256; DMod:4; DSiz:1000;603#I #---------------------------------604#I INDEX = 60 (a=60 r=77 h=1 n=77; l=3 c=0.00; m=66 t=76)6051606607\endexample608609Observe that the `fgens' and subgroup generators (the empty list)610arguments are transmitted to {\ACE} via the {\ACE} binary's `group'611and `generators' options, respectively. Observe also, that the relator612`(a*b)^5' is expanded by {\GAP} to `a*b*a*b*a*b*a*b*a*b' when613transmitted to {\ACE} and then {\ACE} correctly deduces that it's614`(a*b)^5'.615616Since we did not specify a strategy the `default' (see~"option617default") strategy was followed and hence coset number definitions618were R (i.e.~HLT) style, and a total of $76$ coset numbers (`t=76')619were defined (if we had tried `felsch' we would have achieved the best620possible: `t=60'). Note, that {\ACE} already ``knew'' the group621generators and subgroup generators; so, we could have avoided622re-transmitting that information by using the `relators' (see~"option623relators") option:624625\beginexample626gap> ACEStart(1 : relators := ToACEWords(fgens, [a^2, b^3, (a*b)^5]),627> enumeration := "A_5",628> subgroup := "Id",629> max := 0,630> messages := 1000);631#I Detected usage of a synonym of one (or more) of the options:632#I `group', `relators', `generators'.633#I Discarding current values of args.634#I (The new args will be extracted from ACE, later).635#I ToACE> relators:a^2,b^3,a*b*a*b*a*b*a*b*a*b;636#I ToACE> enumeration:A_5;637#I ToACE> subgroup:Id;638#I ToACE> max:0;639#I ToACE> messages:1000;640#I No group generators saved. Setting value(s) from ACE ...641#I ToACE> sr:1;642#I #--- ACE 3.001: Run Parameters ---643#I Group Name: A_5;644#I Group Generators: ab;645#I Group Relators: (a)^2, bbb, ababababab;646#I Subgroup Name: Id;647#I Subgroup Generators: ;648#I Wo:1000000; Max:333331; Mess:1000; Ti:-1; Ho:-1; Loop:0;649#I As:0; Path:0; Row:1; Mend:0; No:3; Look:0; Com:10;650#I C:0; R:0; Fi:6; PMod:3; PSiz:256; DMod:4; DSiz:1000;651#I #---------------------------------652#I ToACE> text:***;653#I ***654#I ToACE> Start;655#I #--- ACE 3.001: Run Parameters ---656#I Group Name: A_5;657#I Group Generators: ab;658#I Group Relators: (a)^2, (b)^3, (ab)^5;659#I Subgroup Name: Id;660#I Subgroup Generators: ;661#I Wo:1000000; Max:333331; Mess:1000; Ti:-1; Ho:-1; Loop:0;662#I As:0; Path:0; Row:1; Mend:0; No:3; Look:0; Com:10;663#I C:0; R:0; Fi:6; PMod:3; PSiz:256; DMod:4; DSiz:1000;664#I #---------------------------------665#I INDEX = 60 (a=60 r=77 h=1 n=77; l=3 c=0.00; m=66 t=76)6661667668\endexample669670Note the usage of `ToACEWords' (see~"ToACEWords") to provide the671appropriate string value of the `relators' option. Also, observe the672`Info'-ed warning of the action triggered by using the `relators'673option, that says that the current values of the ``args'' (i.e.~what674would be returned by `GetACEArgs'; see~"GetACEArgs") were discarded,675which immediately triggered the action of reinstantiating the value of676`ACEData.io[1].args' (which is what the `Info':677678\begintt679#I No group generators saved. Setting value(s) from ACE ...680\endtt681682was all about). Also observe that the ``Run Parameters'' block was683`Info'-ed twice; the first time was due to `ACEStart' emitting `sr'684with value `1' to {\ACE}, the response of which is used to685re-instantiate `ACEData.io[1].args', and the second is in response to686transmitting `Start' to {\ACE}.687688689In particular, {\GAP} no longer thinks `fgens' are the group690generators:691692\beginexample693gap> ACEGroupGenerators(1) = fgens;694false695696\endexample697698Groan! We will just have to re-instantiate everything:699700\beginexample701gap> fgens := ACEGroupGenerators(1);;702gap> F := GroupWithGenerators(fgens);; a := F.1;; b := F.2;;703704\endexample705706We now define a non-trivial subgroup, of small enough index, to make707the observation of all progress messages, by setting `messages := 1',708a not too onerous proposition. As for defining the relators, we could709use the 1-argument version of `ACEStart', in which case we would use710the `subgroup' (see~"option subgroup") option with the value711`ToACEWords(fgens, [ a*b ])'. However, as we saw, in the end we don't712save anything by doing this, since afterwards the variables `fgens',713`a', `b' and `F' would no longer be associated with `ACEStart' process7141. Instead, we will use the more convenient 4-argument form, and also715switch the `InfoACELevel' back to 3:716717\beginexample718gap> SetInfoACELevel(3);719gap> ACEStart(1, ACEGroupGenerators(1), ACERelators(1), [ a*b ]720> : messages := 1);721#I ***722#I ***723#I #--- ACE 3.001: Run Parameters ---724#I Group Name: A_5;725#I Group Generators: ab;726#I Group Relators: (a)^2, (b)^3, (ab)^5;727#I Subgroup Name: Id;728#I Subgroup Generators: ab;729#I Wo:1000000; Max:333331; Mess:1; Ti:-1; Ho:-1; Loop:0;730#I As:0; Path:0; Row:1; Mend:0; No:3; Look:0; Com:10;731#I C:0; R:0; Fi:6; PMod:3; PSiz:256; DMod:4; DSiz:1000;732#I #---------------------------------733#I AD: a=2 r=1 h=1 n=3; l=1 c=+0.00; m=2 t=2734#I SG: a=2 r=1 h=1 n=3; l=1 c=+0.00; m=2 t=2735#I RD: a=3 r=1 h=1 n=4; l=2 c=+0.00; m=3 t=3736#I RD: a=4 r=2 h=1 n=5; l=2 c=+0.00; m=4 t=4737#I RD: a=5 r=2 h=1 n=6; l=2 c=+0.00; m=5 t=5738#I RD: a=6 r=2 h=1 n=7; l=2 c=+0.00; m=6 t=6739#I RD: a=7 r=2 h=1 n=8; l=2 c=+0.00; m=7 t=7740#I RD: a=8 r=2 h=1 n=9; l=2 c=+0.00; m=8 t=8741#I RD: a=9 r=2 h=1 n=10; l=2 c=+0.00; m=9 t=9742#I CC: a=8 r=2 h=1 n=10; l=2 c=+0.00; d=0743#I RD: a=9 r=5 h=1 n=11; l=2 c=+0.00; m=9 t=10744#I RD: a=10 r=5 h=1 n=12; l=2 c=+0.00; m=10 t=11745#I RD: a=11 r=5 h=1 n=13; l=2 c=+0.00; m=11 t=12746#I RD: a=12 r=5 h=1 n=14; l=2 c=+0.00; m=12 t=13747#I RD: a=13 r=5 h=1 n=15; l=2 c=+0.00; m=13 t=14748#I RD: a=14 r=5 h=1 n=16; l=2 c=+0.00; m=14 t=15749#I CC: a=13 r=6 h=1 n=16; l=2 c=+0.00; d=0750#I CC: a=12 r=6 h=1 n=16; l=2 c=+0.00; d=0751#I INDEX = 12 (a=12 r=16 h=1 n=16; l=3 c=0.00; m=14 t=15)7521753754\endexample755756Observe that we used `ACERelators(1)' (see~"ACERelators") to grab the757value of the relators we had defined earlier. We also used758`ACEGroupGenerators(1)' (see~"ACEGroupGenerators") to get the group759generators.760761The run ended with 12 active (see Section~"Coset Statistics762Terminology") coset numbers (`a=12') after defining a total number of76315 coset numbers (`t=15'); the definitions occurred at the steps with764progress messages tagged by `AD:' (coset 1 application definition) and765`SG:' (subgroup generator phase), and the 13 tagged by `RD:' (R style766definition). So there must have been 3 coincidences: observe that767there were 3 progress messages with a `CC:' tag. (See Appendix~"The768Meanings of ACE's Output Messages".)769770We can dump out the statistics accumulated during the run, using771`ACEDumpStatistics' (see~"ACEDumpStatistics"), which `Info's the772{\ACE} output of the `statistics' (see~"option statistics") at773`InfoACE' level 1.774775\beginexample776gap> ACEDumpStatistics();777#I #- ACE 3.001: Level 0 Statistics -778#I cdcoinc=0 rdcoinc=2 apcoinc=0 rlcoinc=0 clcoinc=0779#I xcoinc=2 xcols12=4 qcoinc=3780#I xsave12=0 s12dup=0 s12new=0781#I xcrep=6 crepred=0 crepwrk=0 xcomp=0 compwrk=0782#I xsaved=0 sdmax=0 sdoflow=0783#I xapply=1 apdedn=1 apdefn=1784#I rldedn=0 cldedn=0785#I xrdefn=1 rddedn=5 rddefn=13 rdfill=0786#I xcdefn=0 cddproc=0 cdddedn=0 cddedn=0787#I cdgap=0 cdidefn=0 cdidedn=0 cdpdl=0 cdpof=0788#I cdpdead=0 cdpdefn=0 cddefn=0789#I #---------------------------------790791\endexample792793The statistic `qcoinc=3' states what we had already observed, namely,794that there were three coincidences. Of these, two were primary795coincidences (`rdcoinc=2'). Since `t=15', there were fourteen796non-trivial coset number definitions; one was during the application797of coset 1 to the subgroup generator (`apdefn=1'), and the remainder798occurred during applications of the coset numbers to the relators799(`rddefn=13'). For more details on the meanings of the variables you800will need to read the C code comments.801802Now let us display all 12 lines of the coset table with coset803representatives.804805\beginexample806gap> ACEDisplayCosetTable([-12]);807#I CO: a=12 r=13 h=1 n=13; c=+0.00808#I coset || b B a order rep've809#I -------+--------------------------------------810#I 1 || 3 2 2811#I 2 || 1 3 1 3 B812#I 3 || 2 1 4 3 b813#I 4 || 8 5 3 5 ba814#I 5 || 4 8 6 2 baB815#I 6 || 9 7 5 5 baBa816#I 7 || 6 9 8 3 baBaB817#I 8 || 5 4 7 5 bab818#I 9 || 7 6 10 5 baBab819#I 10 || 12 11 9 3 baBaba820#I 11 || 10 12 12 2 baBabaB821#I 12 || 11 10 11 3 baBabab822#I ------------------------------------------------------------823824\endexample825826Note how the pre-printout compaction phase now does some work827(indicated by the upper-case `CO:' tag), since there were828coincidences, and hence dead coset numbers. Note how `b' and `B' head829the first two columns, since {\ACE} requires that the first two830columns be occupied by a generator/inverse pair or a pair of831involutions. The `a' column is also the `A' column, as `a' is an832involution.833834We now use `ACEStandardCosetNumbering' to produce a `lenlex' standard835table within {\ACE}, but note that this is only `lenlex' with respect836to the ordering `b, a' of the generators. Then we call837`ACEDisplayCosetTable' again to see it. Observe that at both the838standardisation and coset table display steps a compaction phase is839invoked but on both occasions the lowercase `co:' tag indicates that840nothing is done (all the recovery of dead coset numbers that could be841done was done earlier).842843\beginexample844gap> ACEStandardCosetNumbering();845#I co/ST: a=12 r=13 h=1 n=13; c=+0.00846gap> ACEDisplayCosetTable([-12]);847#I co: a=12 r=13 h=1 n=13; c=+0.00848#I coset || b B a order rep've849#I -------+--------------------------------------850#I 1 || 2 3 3851#I 2 || 3 1 4 3 b852#I 3 || 1 2 1 3 B853#I 4 || 5 6 2 5 ba854#I 5 || 6 4 7 5 bab855#I 6 || 4 5 8 2 baB856#I 7 || 8 9 5 5 baba857#I 8 || 9 7 6 5 baBa858#I 9 || 7 8 10 3 babaB859#I 10 || 11 12 9 3 babaBa860#I 11 || 12 10 12 3 babaBab861#I 12 || 10 11 11 2 babaBaB862#I ------------------------------------------------------------863864\endexample865866Of course, the table above is not `lenlex' with respect to the order867of the generators we had originally given to {\ACE}; to get that, we868would have needed to specify `lenlex' (see~"option lenlex") at the869enumeration stage. The effect of the `lenlex' option at the870enumeration stage is the following: behind the scenes it ensures that871the relator `a^2' is passed to {\ACE} as `aa' and then it sets the872option `asis' to 1; this bit of skulduggery stops {\ACE} treating `a'873as an involution, allowing `a' and `A' (the inverse of `a') to take up874the first two columns of the coset table, effectively stopping {\ACE}875from reordering the generators. To see what is passed to {\ACE}, at876the enumeration stage, we set the `InfoACELevel' to 4, but since we877don't really want to see messages this time we set `messages := 0'.878879\beginexample880gap> SetInfoACELevel(4);881gap> ACEStart(1, ACEGroupGenerators(1), ACERelators(1), [ a*b ]882> : messages := 0, lenlex);883#I ToACE> group:ab;884#I ToACE> relators:aa, b^3,a*b*a*b*a*b*a*b*a*b;885#I ToACE> generators:a*b;886#I ToACE> asis:1;887#I ToACE> messages:0;888#I ToACE> text:***;889#I ***890#I ToACE> text:***;891#I ***892#I ToACE> Start;893#I INDEX = 12 (a=12 r=17 h=1 n=17; l=3 c=0.00; m=15 t=16)8941895gap> ACEStandardCosetNumbering();896#I ToACE> standard;897#I CO/ST: a=12 r=13 h=1 n=13; c=+0.00898gap> # The capitalised `CO' indicates space was recovered during compaction899gap> ACEDisplayCosetTable([-12]);900#I ToACE> print:-12;901#I ToACE> text:------------------------------------------------------------;902#I co: a=12 r=13 h=1 n=13; c=+0.00903#I coset || a A b B order rep've904#I -------+---------------------------------------------905#I 1 || 2 2 3 2906#I 2 || 1 1 1 3 2 a907#I 3 || 4 4 2 1 3 b908#I 4 || 3 3 5 6 5 ba909#I 5 || 7 7 6 4 5 bab910#I 6 || 8 8 4 5 2 baB911#I 7 || 5 5 8 9 5 baba912#I 8 || 6 6 9 7 5 baBa913#I 9 || 10 10 7 8 3 babaB914#I 10 || 9 9 11 12 3 babaBa915#I 11 || 12 12 12 10 3 babaBab916#I 12 || 11 11 10 11 2 babaBaB917#I ------------------------------------------------------------918919\endexample920921You may have noticed the use of {\ACE}'s `text' option several times922above; this just tells {\ACE} to print the argument given to `text'923(as a comment). This is used by the {\GAP} interface as a sentinel;924when the string appears in the {\ACE} output, the {\GAP} interface925knows not to expect anything else.926927%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%928\Section{Emulating Sims}929930Here we consider the various `sims' strategies (see~"option sims"),931with respect to duplicating Sims' example statistics of his strategies932given in Section 5.5 of \cite{Sim94}, and giving approximations of his933even-numbered strategies.934935In order to duplicate Sims' maximum active coset numbers and total936coset numbers statistics, one needs to work with the formal inverses937of the relators and subgroup generators from \cite{Sim94}, since938definitions are made from the front in Sims' routines and from the939rear in {\ACE}. Also, in instances where940`IsACEGeneratorsInPreferredOrder(<gens>, <rels>)' returns `false', for941group generators <fgens> and relators <rels>, one will need to apply942the `lenlex' option to stop {\ACE} from re-ordering the generators and943relators (see~"IsACEGeneratorsInPreferredOrder" and~"option lenlex").944In general, we can match Sims' values for the `sims := 1' and `sims :=9453' strategies (the R style and R\* style Sims strategies with946`mendelsohn' off) and for the `sims := 9' (C style) strategy, but947sometimes we may not exactly match Sims' statistics for the `sims :=9485' and `sims := 7' strategies (the R style and R\* style Sims949strategies with `mendelsohn' on); Sims does not specify an order for950the (Mendelsohn) processing of cycled relators and evidently {\ACE}'s951processing order is different to the one Sims used in his CHLT952algorithm to get his statistics (see~"option mendelsohn").953954*Note:*955HLT as it appears in Table 5.5.1 of \cite{Sim94} is achieved in {\ACE}956with the sequence ```hlt, lookahead := 0''' and CHLT is (nearly)957equivalent to ```hlt, lookahead := 0, mendelsohn'''; also Sims'958`<save> = false' equates to R style (`rt' positive, `ct := 0') in959{\ACE}, and `<save> = true', for Sims' HLT and CHLT, equates to R\*960style (`rt' negative, `ct := 0') in {\ACE}. Sims' Felsch strategy961coincides with {\ACE}'s `felsch := 0' strategy, i.e.~`sims := 9' is962identical to `felsch := 0'. (See the options~"option hlt", "option963lookahead", "option mendelsohn", "option ct", "option rt" and~"option964felsch".)965966The following duplicates the ``Total'' (`totcosets' in {\ACE}) and967``Max.~Active'' (`maxcosets' in {\ACE}) statistics for Example~5.2 of968\cite{Sim94}, found in Sims' Table~5.5.3, for the `sims := 3'969strategy.970971\beginexample972gap> SetInfoACELevel(1); # No behind-the-scenes info. please973gap> F := FreeGroup("r", "s", "t");; r := F.1;; s := F.2;; t := F.3;;974gap> ACEStats([r, s, t], [(r^t*r^-2)^-1, (s^r*s^-2)^-1, (t^s*t^-2)^-1], []975> : sims := 3);976rec( index := 1, cputime := 0, cputimeUnits := "10^-2 seconds",977activecosets := 1, maxcosets := 673, totcosets := 673 )978979\endexample980981By replacing `sims := 3' with `sims := <i>' for <i> equal to~1, 5, 7982or~9, one may verify that for <i> equal to~1 or~9, Sims' statistics983are again duplicated, and observe a slight variance with Sims'984statistics for <i> equal to~5 or~7.985986Now, we show how one can approximate any one of Sims' even-numbered987strategies. Essentially, the idea is to start an interactive {\ACE}988process using `ACEStart' (see~"ACEStart") with `sims := <i>', for <i>989equal to~1, 3, 5, 7 or~9, and `max' set to some low value <maxstart>990so that the enumeration stops after only completing a few rows of the991coset table. Then, to approximate Sims' strategy `<i> + 1', one992alternately applies `ACEStandardCosetNumbering' and `ACEContinue',993progressively increasing the value of `max' by some value <maxstep>.994The general algorithm is provided by the `ACEEvenSims' function995following.996997\beginexample998gap> ACEEvenSims := function(fgens, rels, sgens, i, maxstart, maxstep)999> local j;1000> j := ACEStart(fgens, rels, sgens : sims := i, max := maxstart);1001> while ACEStats(j).index = 0 do1002> ACEStandardCosetNumbering(j);1003> ACEContinue(j : max := ACEParameters(j).max + maxstep);1004> od;1005> return ACEStats(j);1006> end;;10071008\endexample10091010It turns out that one can duplicate the Sims' strategy 4 statistics in1011Table~5.5.3 of \cite{Sim94}, with `<i> = 3' (so that `<i> + 1 = 4'),1012`<maxstart> = 14' and `<maxstep> = 50':10131014\beginexample1015gap> ACEEvenSims([r, s, t], [(r^t*r^-2)^-1, (s^r*s^-2)^-1, (t^s*t^-2)^-1],1016> [], 3, 14, 50);1017rec( index := 1, cputime := 0, cputimeUnits := "10^-2 seconds",1018activecosets := 1, maxcosets := 393, totcosets := 393 )10191020\endexample10211022Setting `<maxstep> = 60' (and leaving the other parameters the same)1023also gives Sims' statistics, but `<maxstart> = 64' with `<maxstep> =102480' does better:10251026\beginexample1027gap> ACEEvenSims([r, s, t], [(r^t*r^-2)^-1, (s^r*s^-2)^-1, (t^s*t^-2)^-1],1028> [], 3, 64, 80);1029rec( index := 1, cputime := 0, cputimeUnits := "10^-2 seconds",1030activecosets := 1, maxcosets := 352, totcosets := 352 )10311032\endexample10331034Even though the (`lenlex') standardisation steps in the above examples1035produce a significant improvement over the `sims := 3' statistics,1036this does not happen universally. Sims \cite{Sim94} gives many1037examples where the even-numbered strategies fail to show any1038significant improvement over the odd-numbered strategies, and one1039example (see~Table~5.5.7) where `sims := 2' gives a performance that1040is very much worse than any of the other Sims strategies. As with any1041of the strategies, what works well for some groups may not work at all1042well with other groups. There are *no* general rules. It's a bit of a1043game. Let's hope you win most of the time.10441045%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1046%%1047%E104810491050