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 interact.tex ACE documentation - interactive fns 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{Functions for Using ACE Interactively}1415The user will probably benefit most from interactive use of {\ACE} by16setting the `InfoLevel' of `InfoACE' to at least 317(see~"SetInfoACELevel"), particularly if she uses the `messages'18option with a non-zero value.1920Have you read the various options warnings yet? If not, please take21the time to read Section~"General Warnings regarding the Use of22Options" which directs you to various important sections of23Chapter~"Options for ACE".2425We describe in this chapter the functions that manipulate and initiate26interactive {\ACE} processes.2728An interactive {\ACE} process is initiated by `ACEStart' and29terminated via `ACEQuit'; these functions are described in30Section~"Starting and Stopping Interactive ACE Processes". `ACEStart'31also has forms that manipulate an already started interactive {\ACE}32process. `ACEStart' always returns a positive integer <i>, which33identifies the interactive {\ACE} process that was initiated or34manipulated.3536Most functions (there is one `ACEStart' exception), that manipulate an37already started interactive {\ACE} process, have a form where the38first argument is the integer <i> returned by the initiating39`ACEStart' command, and a second form with one argument fewer (where40the integer <i> is discovered by a default mechanism, namely by41determining the least integer <i> for which there is a currently42active interactive {\ACE} process). We will thus commonly say that43``for the <i>th (or default) interactive {ACE} process'' a certain44function performs a given action. In each case, it is an error, if <i>45is not the index of an active interactive process, or there are no46current active interactive processes.4748*Notes*:49The global method of passing options (via `PushOptions'), should not50be used with any of the interactive functions. In fact, the51`OptionsStack' should be empty at the time any of the interactive52functions is called.5354On `quit'ting {\GAP}, `ACEQuitAll();' is executed, which terminates55all active interactive {\ACE} processes. If {\GAP} is killed without56`quit'ting, before all interactive {\ACE} processes are terminated,57*zombie* processes (still living *child* processes whose *parents*58have died), will result. Since zombie processes do consume resources,59in such an event, the responsible computer user should seek out and60kill the still living `ace' children (e.g.~by piping the output of a61`ps' with appropriate options, usually `aux' or `ef', to `grep ace',62to find the process ids, and then using `kill'; try `man ps' and `man63kill' if these hints are unhelpful).6465%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%66\Section{Starting and Stopping Interactive ACE Processes}6768\>ACEStart( <fgens>, <rels>, <sgens> [:<options>] )!{details} F69\>ACEStart( <i> [:<options>] ) F70\>ACEStart( [:<options>] ) F71\>ACEStart( <i>, <fgens>, <rels>, <sgens> [:<options>] ) F72\>ACEStart( 0 [:<options>] ) F73\>ACEStart( 0, <fgens>, <rels>, <sgens> [:<options>] ) F74\>ACEStart( 0, <i> [:<options>] ) F75\>ACEStart( 0, <i>, <fgens>, <rels>, <sgens> [:<options>] ) F7677The variables are: <i>, a positive integer numbering from 1 that78represents (indexes) an already running interactive {\ACE} process;79<fgens>, a list of free generators; <rels>, a list of words in the80generators <fgens> giving relators for a finitely presented group; and81<sgens>, a list of subgroup generators, again expressed as words in82the free generators <fgens>. Each of <fgens>, <rels> and <sgens> are83given in the standard {\GAP} format for finitely presented groups (See84Chapter~"ref:Finitely Presented Groups" of the {\GAP} Reference85Manual).8687All forms of `ACEStart' accept options described in Chapters~"Options88for ACE" and~"Strategy Options for ACE", and Appendix~"Other ACE89Options", which are listed behind a colon in the usual way (see90"ref:Function Calls" in the {\GAP} Reference Manual). The reader is91strongly encouraged to read the introductory sections of92Chapter~"Options for ACE", with regard to options. The global93mechanism (via `PushOptions') of passing options is *not* recommended94for use with the interactive {\ACE} interface functions; please ensure95the `OptionsStack' is empty before calling an interactive {\ACE}96interface function.9798The return value (for all forms of `ACEStart') is an integer99(numbering from 1) which represents the running process. It is100possible to have more than one interactive process running at once.101The integer returned may be used to index which of these processes an102interactive {\ACE} interface function should be applied to.103104The first four forms of `ACEStart' insert a `start' (see~"option105start") directive after the user's options to invoke an enumeration.106The last four forms, with `0' as first argument, do not insert a107`start' directive. Moreover, the last 3 forms of `ACEStart', with `0'108as first argument only differ from the corresponding forms of109`ACEStart' without the `0' argument, in that they do not insert a110`start' directive. `ACEStart(0)', however, is special; unlike the111no-argument form of `ACEStart' it invokes a new interactive {\ACE}112process. We will now further describe each form of `ACEStart', in the113order they appear above.114115The first form of `ACEStart' (on three arguments) is the usual way to116start an interactive {\ACE} process.117118When `ACEStart' is called with one positive integer argument <i> it119starts a new enumeration on the <i>th running process, i.e.~it scrubs120a previously generated table and starts from scratch with the same121parameters (i.e.~the same arguments and options); except that if new122options are included these will modify those given previously. The123only reason for doing such a thing, without new options, is to perhaps124compare timings of runs (a second run is quicker because memory has125already been allocated). If you are interested in this sort of126information, however, you may be better off dealing directly with the127standalone.128129When `ACEStart' is called with no arguments it finds the least130positive integer <i> for which an interactive process is running and131applies `ACEStart(<i>)'. (Most users will only run one interactive132process at a time. Hence, `ACEStart()' will be a useful shortcut for133`ACEStart(1)'.)134135The fourth form of `ACEStart' on four arguments, invokes a new136enumeration on the <i>th running process, with new generators <fgens>,137relators <rels> and subgroup generators <sgens>. This is provided so a138user can re-use an already running process, rather than start a new139process. This may be useful when pseudo-ttys are a scarce resource.140See the notes for the non-interactive `ACECosetTable'141("ACECosetTableFromGensAndRels") which demonstrates an application of142a usage of this and the following form of `ACEStart' in a loop.143144The fifth form of `ACEStart' (on the one argument: `0') initiates an145interactive {\ACE} process, processes any user options, but does not146insert a `start' (see~"option start") directive. This form is mainly147for gurus who are familiar with the {\ACE} standalone and who wish, at148least initially, to communicate with {\ACE} using the primitive149read/write tools of Section~"Primitive ACE Read/Write Functions". In150this case, after the group generators, relators, and subgroup151generators have been set in the {\ACE} process, invocations of any of152`ACEGroupGenerators' (see~"ACEGroupGenerators"), `ACERelators'153(see~"ACERelators"), `ACESubgroupGenerators'154(see~"ACESubgroupGenerators"), or `ACEParameters'155(see~"ACEParameters") will establish the corresponding {\GAP} values.156Be warned, though, that unless one of the general {\ACE} modes (see157Section~"General ACE modes"): `ACEStart' (without a zero argument),158`ACERedo' (see~"ACERedo") or `ACEContinue' (see~"ACEContinue"), or one159of the mode options: `start' (see~"option start"), `redo' (see~"option160redo") or `continu' (see~"option continu"), has been invoked since the161last change of any parameter options (see~"ACEParameterOptions"), some162of the values reported by `ACEParameters' may well be *incorrect*.163164The sixth form of `ACEStart' (on four arguments), is like the first165form of `ACEStart' (on three arguments), except that it does not166insert a `start' (see~"option start") directive. It initiates an167interactive {\ACE} process, with a presentation defined by its last 3168arguments.169170The seventh form of `ACEStart' (on two arguments), is like the second171form of `ACEStart' (on one argument), except that it does not insert a172`start' (see~"option start") directive. It processes any new options173for the <i>th interactive {\ACE} process. `ACEStart(0, <i> [:174<options> ] )', is similar to `SetACEOptions(<i> [: <options> ] )'175(see~"SetACEOptions"), but unlike the latter does not invoke a general176mode (see Section~"General ACE Modes").177178The last form of `ACEStart' (on five arguments), is like the fourth179form of `ACEStart' (on four arguments), except that it does not insert180a `start' (see~"option start") directive. It re-uses an existing181interactive {\ACE} process, with a new presentation. There is no form182of `ACEStart' with the same functionality as this form, where the <i>183argument is omitted.184185*Note:*186When an interactive {\ACE} process is initiated by `ACEStart' a187process number <i> is assigned to it (the integer <i> returned by the188`ACEStart' command), an {\ACE} (binary) process (in the UNIX sense) is189started up, a {\GAP} iostream is assigned to communicate with the190{\ACE} (binary) process, and the essential ``defining'' data191associated with the interactive {\ACE} process is saved in192`ACEData.io[<i>]' (see~"ACEData" for precisely what is saved).193194\>ACEQuit( <i> )!{details} F195\>ACEQuit() F196197terminate an interactive {\ACE} process, where <i> is the integer198returned by `ACEStart' when the process was started. If the second199form is used (i.e.~without arguments) then the interactive process of200least index that is still running is terminated.201202*Note:*203`ACEQuit(<i>)' terminates the {\ACE} (binary) process of interactive204{\ACE} process <i>, and closes its {\GAP} iostream, and unbinds the205record `ACEData.io[<i>]' (see~"ACEStart" note).206207It can happen that the {\ACE} (binary) process, and hence the {\GAP}208iostream assigned to communicate with it, can die, e.g.~by the user209typing a `Ctrl-C' while the {\ACE} (binary) process is engaged in a210long calculation. `IsACEProcessAlive' (see~"IsACEProcessAlive") is211provided to check the status of the {\GAP} iostream (and hence the212status of the {\ACE} (binary) process it was communicating with); in213the case that it is indeed dead, `ACEResurrectProcess'214(see~"ACEResurrectProcess") may be used to start a new {\ACE} (binary)215process and assign a new {\GAP} iostream to communicate with it, by216using the ``defining'' data of the interactive {\ACE} process saved in217`ACEData.io[<i>]'.218219\>ACEQuitAll() F220221is provided as a convenience, to terminate all active interactive222{\ACE} processes with a single command. It is equivalent to executing223`ACEQuit(<i>)' for all active interactive {\ACE} processes <i>224(see~"ACEQuit").225226%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%227\Section{General ACE Modes}228229For our purposes, we define an interactive {\ACE} interface command to230be an {\ACE} mode, if it delivers an enumeration result (see231Section~"Results messages"). Thus, `ACEStart' (see~"ACEStart"), except232when called with the argument 0, and the commands `ACERedo' and233`ACEContinue' which we describe below are {\ACE} modes; we call these234*general {\ACE} modes*. Additionally, there are two other commands235which deliver enumeration results: `ACEAllEquivPresentations'236(see~"ACEAllEquivPresentations") and `ACERandomEquivPresentations'237(see~"ACERandomEquivPresentations"); we call these ``experimentation''238{\ACE} modes and describe them in Section~"Experimentation ACE Modes".239240*Guru Note:*241The {\ACE} standalone uses the term `mode' in a slightly different242sense. There, the commands: `start', `redo' or `continue', put the243{\ACE} enumerator in `start mode', `redo mode' or `continue mode'. In244this manual, we have used the term to mean the command itself, and245generalised it to include any command that produces enumeration246results.247248After changing any of {\ACE}'s parameters, one of three *general249modes* is possible: one may be able to ``continue'' via `ACEContinue'250(see~"ACEContinue"), or ``redo'' via `ACERedo' (see~"ACERedo"), or if251neither of these is possible one may have to re-``start'' the252enumeration via `ACEStart' (see~"ACEStart"). Generally, the253appropriate mode is invoked automatically when options are changed; so254most users should be able to ignore the following three functions.255256\>ACEModes( <i> ) F257\>ACEModes() F258259for the <i>th (or default) interactive {\ACE} process, return a record260whose fields are the modes `ACEStart', `ACEContinue' and `ACERedo',261and whose values are `true' if the mode is possible for the process262and `false' otherwise.263264\>ACEContinue( <i> [:<options>] ) F265\>ACEContinue( [:<options>] ) F266267for the <i>th (or default) interactive {\ACE} process, apply any268<options> and then ``continue'' the current enumeration, building upon269the existing table. If a previous run stopped without producing a270finite index you can, in principle, change any of the options and271continue on. Of course, if you make any changes which invalidate the272current table, you won't be allowed to `ACEContinue' and an error will273be raised. However, after `quit'ting the `break'-loop, the interactive274{\ACE} process should normally still be active; after doing so, run275`ACEModes' (see~"ACEModes") to see which of `ACERedo' or `ACEStart' is276possible.277278\>ACERedo( <i> [:<options>] ) F279\>ACERedo( [:<options>] ) F280281for the <i>th (or default) interactive {\ACE} process, apply any282<options> and then ``redo'' the current enumeration from coset 1283(i.e., the subgroup), keeping any existing information in the table.284285*Notes:*286The difference between `ACEContinue' and `ACERedo' is somewhat287technical, and the user should regard it as a mode that is a little288more expensive than `ACEContinue' but cheaper than `ACEStart'.289`ACERedo' is really intended for the case where additional relators290and/or subgroup generators have been introduced; the current table,291which may be incomplete or exhibit a finite index, is still ``valid''.292However, the new data may allow the enumeration to complete, or cause293a collapse to a smaller index. In some cases, `ACERedo' may not be294possible and an error will be raised; in this case, `quit' the295`break'-loop, and try `ACEStart', which will discard the current table296and re-``start'' the enumeration.297298%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%299\Section{Interactive ACE Process Utility Functions and Interruption of300an Interactive ACE Process}301302\>ACEProcessIndex( <i> ) F303\>ACEProcessIndex() F304305With argument <i>, which must be a positive integer, `ACEProcessIndex'306returns <i> if it corresponds to an active interactive process, or307raises an error. With no arguments it returns the default active308interactive process or returns `fail' and emits a warning message to309`Info' at `InfoACE' or `InfoWarning' level 1.310311*Note:*312Essentially, an interactive {\ACE} process <i> is ``active'' if313`ACEData.io[<i>]' is bound (i.e.~we still have some data telling us314about it). Also see~"ACEStart" note.315316\>ACEProcessIndices() F317318returns the list of integer indices of all active interactive {\ACE}319processes (see~"ACEProcessIndex" for the meaning of ``active'').320321\>IsACEProcessAlive( <i> ) F322\>IsACEProcessAlive() F323324return `true' if the {\GAP} iostream of the <i>th (or default)325interactive {\ACE} process started by `ACEStart' is alive (i.e.~can326still be written to), or `false', otherwise. (See the notes327for~"ACEStart" and~"ACEQuit".)328329\atindex{interruption}{@interruption of an interactive ACE process}330\atindex{break-loop}{@\noexpand`break'-loop}331If the user does not yet have a `gap>' prompt then usually {\ACE} is332still away doing something and an {\ACE} interface function is still333waiting for a reply from {\ACE}. Typing a `Ctrl-C' (i.e.~holding down334the `Ctrl' key and typing `c') will stop the waiting and send {\GAP}335into a `break'-loop, from which one has no option but to `quit;'. The336typing of `Ctrl-C', in such a circumstance, usually causes the stream337of the interactive {\ACE} process to die; to check this we provide338`IsACEProcessAlive' (see~"IsACEProcessAlive"). If the stream of an339interactive {\ACE} process, indexed by <i>, say, has died, it may340still be possible to recover enough of the state, before the death of341the stream, from the information stored in the `ACEData.io[<i>]'342record (see Section~"The ACEData Record"). For such a purpose, we have343provided `ACEResurrectProcess' (see~"ACEResurrectProcess").344345The {\GAP} iostream of an interactive {\ACE} process will also die if346the {\ACE} binary has a segmentation fault. We do hope that this never347happens to you, but if it does and the failure is reproducible, then348it's a bug and we'd like to know about it. Please read the `README'349that comes with the {\ACE} package to find out what to include in a350bug report and who to email it to.351352\>ACEResurrectProcess( <i> [: <options>] ) F353\>ACEResurrectProcess( [: <options>] ) F354355re-generate the {\GAP} iostream of the <i>th (or default) interactive356{\ACE} process started by `ACEStart' (see~"ACEStart", the final note,357in particular), and try to recover as much as possible of the previous358state from saved values of the process's arguments and parameter359options. The possible <options> here are `use' and `useboth' which are360described in detail below.361362The arguments of the <i>th interactive {\ACE} process are stored in363`ACEData.io[<i>].args', a record with fields `fgens', `rels' and364`sgens', which are the {\GAP} group generators, relators and subgroup365generators, respectively (see Section~"The ACEData Record"). Option366information is saved in `ACEData.io[<i>].options' when a user uses an367interactive {\ACE} interface function with options or uses368`SetACEOptions' (see~"SetACEOptions"). Parameter option information is369saved in `ACEData.io[<i>].parameters' if `ACEParameters' (see~"ACEParameters")370is used to extract from {\ACE} the current values of the {\ACE}371parameter options (this is generally less reliable unless one of the372general {\ACE} modes (see Section~"General ACE Modes"), has been run373previously).374375By default, `ACEResurrectProcess' recovers parameter option376information from `ACEData.io[<i>].options' if it is bound, or from377`ACEData.io[<i>].parameters' if it is bound, otherwise. The378`ACEData.io[<i>].options' record, however, is first filtered for379parameter and strategy options (see Sections~"ACEParameterOptions"380and~"The ACEStrategyOptions list") and the `echo' option (see~"option381echo"). To alter this behaviour, the user is provided two options:382383\beginitems384385\quad`use := <useList>'& <useList> may contain one or both of386`"options"' and `"parameters"'. By default, `use = ["options",387"parameters"]'.388389\quad`useboth' & (A boolean option). By default, `useboth = false'.390391\enditems392393If `useboth = true', `SetACEOptions' (see~"SetACEOptions") is applied394to the <i>th interactive {\ACE} process with each395`ACEData.io[<i>].(<field>)' for each <field> (`"options"' or396`"parameters"') that is bound and in <useList>, in the order implied397by <useList>. If `useboth = false', `SetACEOptions' is applied with398`ACEData.io[<i>].(<field>)' for only the first <field> that is bound399in <useList>. The current value of the `echo' option is also preserved400(no matter what values the user chooses for the `use' and `useboth'401options).402403*Notes:*404Do not use general {\ACE} options with `ACEResurrectProcess'; they405will only be superseded by those options recovered from406`ACEData.io[<i>].options' and/or `ACEData.io[<i>].parameters'.407Instead, call `SetACEOptions' first (or afterwards). When called prior408to `ACEResurrectProcess', `SetACEOptions' will emit a warning that the409stream is dead; despite this, the `ACEData.io[<i>].options' *will* be410updated.411412`ACEResurrectProcess' does *not* invoke an {\ACE} mode (see413Section~"General ACE Modes"). This leaves the user free to use414`SetACEOptions' (which does invoke an {\ACE} mode) to further modify415options afterwards.416417\>ToACEGroupGenerators( <fgens> ) F418419This function produces, from a {\GAP} list <fgens> of free group420generators, the {\ACE} directive string required by the `group'421(see~"option group") option. (The `group' option may be used to define422the equivalent of <fgens> in an {\ACE} process.)423424\>ToACEWords( <fgens>, <words> ) F425426This function produces, from a {\GAP} list <words> in free group427generators <fgens>, a string that represents those <words> as an428{\ACE} list of words. `ToACEWords' may be used to provide suitable429values for the options `relators' (see~"option relators"),430`generators' (see~"option generators"), `sg' (see~"option sg"), and431`rl' (see~"option rl").432433%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%434\Section{Experimentation ACE Modes}435436Now we describe the two *experimentation modes*. The term *mode* was437defined in Section~"General ACE Modes".438439\>ACEAllEquivPresentations( <i>, <val> ) F440\>ACEAllEquivPresentations( <val> ) F441442for the <i>th (or default) interactive {\ACE} process, generates and443tests an enumeration for combinations of relator ordering, relator444rotations, and relator inversions; <val> is in the integer range 1 to4457.446447The argument <val> is considered as a binary number. Its three bits448are treated as flags, and control relator rotations (the $2^0$ bit),449relator inversions (the $2^1$ bit) and relator orderings (the $2^2$450bit), respectively; where $1$ means ``active'' and $0$ means451``inactive''. (See below for an example).452453Before we describe the {\GAP} output of `ACEAllEquivPresentations' let454us spend some time considering what happens before the {\ACE} binary455output is parsed.456457The `ACEAllEquivPresentations' command first performs a ``priming458run'' using the options as they stand. In particular, the `asis' and459`messages' options are honoured.460461It then turns `asis' (see~"option asis") on and `messages'462(see~"option messages") off (i.e.~sets `messages' to 0), and generates463and tests the requested equivalent presentations. The maximum and464minimum values attained by `m' (the maximum number of coset numbers465defined at any stage) and `t' (the total number of coset numbers466defined) are tracked, and each time the statistics are better than467what we've already seen, the {\ACE} binary emits a summary result line468for the relators used. See Appendix~"The Meanings of ACE's output469messages" for a discussion of the statistics `m' and `t'. To observe470these messages set the `InfoLevel' of `InfoACE' to 3; and it's471*recommended* that you do this so that you get some idea of what the472{\ACE} binary is doing.473474The order in which the equivalent presentations are generated and475tested has no particular significance, but note that the presentation476as given *after* the initial priming run) is the *last* presentation477to be generated and tested, so that the group's relators are left478``unchanged'' by running the `ACEAllEquivPresentations' command.479480As discussed by Cannon, Dimino, Havas and Watson \cite{CDHW73} and481Havas and Ramsay \cite{HR01} such equivalent presentations can yield482large variations in the number of coset numbers required in an483enumeration. For this command, we are interested in this variation.484485After the final presentation is run, some additional status486information messages are printed to the {\ACE} output:487488\beginlist%unordered489490\item{--} the number of runs which yielded a finite index;491492\item{--} the total number of runs (excluding the priming run); and493494\item{--} the range of values observed for `m' and `t'.495496\endlist497498As an example (drawn from the discussion in \cite{HR99ace}) consider the499enumeration of the $448$ coset numbers of the subgroup500$\langle a^2,a^{-1}b \rangle$ of the group501$$502(8,7 \mid 2,3)503= \langle a,b \mid a^8 = b^7 = (ab)^2 = (a^{-1}b)^3 = 1 \rangle.504$$505There are $4!=24$ relator orderings and $2^4=16$ combinations of506relator or inverted relator. Exponents are taken into account when507rotating relators, so the relators given give rise to 1, 1, 2 and 2508rotations respectively, for a total of $1.1.2.2=4$ combinations. So,509for <val>${} = 7$ (resp.~$3$), $24.16.4=1536$ (resp.~$16.4=64$)510equivalent presentations are tested.511512Now we describe the output of `ACEAllEquivPresentations'; it is a513record with fields:514515\beginitems516517\quad`primingResult' & the {\ACE} enumeration result message (see518Section~"Results Messages") of the priming run;519520\quad`primingStats' & the enumeration result of the priming run as a521{\GAP} record with fields `index', `cputime', `cputimeUnits',522`activecosets', `maxcosets' and `totcosets', exactly as for the record523returned by `ACEStats' (see~"ACEStats");524525\quad`equivRuns' & a list of data records, one for each progressively526``best'' run, where each record has fields:527528\qquad`rels'& the relators in the order used for the run,529530\qquad`enumResult'& the {\ACE} enumeration result message (see531Section~"Results Messages") of the run, and532533\qquad`stats'& the enumeration result as a {\GAP} record exactly like534the record returned by `ACEStats' (see~"ACEStats");535536\quad`summary' & a record with fields:537538\qquad`successes'& the total number of successful (i.e.~having finite539enumeration index) runs,540541\qquad`runs'& the total number of equivalent presentation runs542executed,543544\qquad`maxcosetsRange'& the range of values as a {\GAP} list inside545which each `equivRuns[<i>].maxcosets' lies, and546547\qquad`totcosetsRange'& the range of values as a {\GAP} list inside548which each `equivRuns[<i>].totcosets' lies.549550\enditems551552*Notes:*553In general, the length of the `equivRuns' field list will be less than554the number of runs executed.555556There is no way to stop the `ACEAllEquivPresentations' command before557it has completed, other than killing the task. So do a reality check558beforehand on the size of the search space and the time for each559enumeration. If you are interested in finding a ``good'' enumeration,560it can be very helpful, in terms of running time, to put a tight limit561on the number of coset numbers via the `max' option. You may also have562to set `compaction' = $100$ to prevent time-wasting attempts to563recover space via compaction. This maximises throughput by causing the564``bad'' enumerations, which are in the majority, to overflow quickly565and abort. If you wish to explore a very large search-space, consider566firing up many copies of {\ACE}, and starting each with a ``random''567equivalent presentation. Alternatively, you could use the568`ACERandomEquivPresentations' command.569570571\>ACERandomEquivPresentations( <i>, <val> ) F572\>ACERandomEquivPresentations( <val> ) F573\>ACERandomEquivPresentations( <i>, [<val>] ) F574\>ACERandomEquivPresentations( [<val>] ) F575\>ACERandomEquivPresentations( <i>, [<val>, <Npresentations>] ) F576\>ACERandomEquivPresentations( [<val>, <Npresentations>] ) F577578for the <i>th (or default) interactive {\ACE} process, generates and579tests up to <Npresentations> (or 8, in the first 4 forms) random580presentations; <val>, an integer in the range 1 to 7, acts as for581`ACEAllEquivPresentations' and <Npresentations>, when given, should be582a positive integer.583584The routine first turns `asis' (see~"option asis") on and `messages'585(see~"option messages") off (i.e.~sets `messages' to 0), and then586generates and tests the requested number of random equivalent587presentations. For each presentation, the relators used and the588summary result line are printed by {\ACE}. To observe these messages589set the `InfoLevel' of `InfoACE' to at least 3.590591`ACERandomEquivPresentations' parses the {\ACE} messages, translating592them to {\GAP}, and thus returns a list of records (similar to the593field `equivRuns' of the returned record of594`ACEAllEquivPresentations'). Each record of the returned list is the595data derived from a presentation run and has fields:596597\beginitems598599\quad`rels'& the relators in the order used for the run,600601\quad`enumResult'& the {\ACE} enumeration result message (see602Section~"Results Messages") of the run, and603604\quad`stats'& the enumeration result as a {\GAP} record exactly like605the record returned by `ACEStats' (see~"ACEStats").606607\enditems608609*Notes:*610The relator inversions and rotations are ``genuinely'' random. The611relator permuting is a little bit of a kludge, with the ``quality'' of612the permutations tending to improve with successive presentations.613When the `ACERandomEquivPresentations' command completes, the614presentation active is the *last* one generated.615616*Guru Notes:*617It might appear that neglecting to restore the original presentation618is an error. In fact, it is a useful feature! Suppose that the space619of equivalent presentations is too large to exhaustively test. As620noted in the entry for `ACEAllEquivPresentations', we can start up621multiple copies of `ACEAllEquivPresentations' at random points in the622search-space. Manually generating `random' equivalent presentations to623serve as starting-points is tedious and error-prone. The624`ACERandomEquivPresentations' command provides a simple solution;625simply run `ACERandomEquivPresentations(<i>, 7);' before626`ACEAllEquivPresentations(<i>, 7);'.627628%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%629\Section{Interactive Query Functions and an Option Setting Function}630631\>ACEGroupGenerators( <i> ) F632\>ACEGroupGenerators() F633634return the {\GAP} group generators of the <i>th (or default)635interactive {\ACE} process. If no generators have been saved for the636interactive {\ACE} process, possibly because the process was started637via `ACEStart(0);' (see~"ACEStart"), the {\ACE} process is638interrogated, and the equivalent in {\GAP} is saved and returned.639Essentially, `ACEGroupGenerators(<i>)' interrogates {\ACE} and640establishes `ACEData.io[<i>].args.fgens', if necessary, and returns641`ACEData.io[<i>].args.fgens'. As a side-effect, if any of the642remaining fields of `ACEData.io[<i>].args' or643`ACEData.io[<i>].acegens' are unset, they are also set. Note that644{\GAP} provides `GroupWithGenerators' (see~"ref:GroupWithGenerators"645in the {\GAP} Reference Manual) to establish a free group on a given646set of already-defined generators.647648\>ACERelators( <i> ) F649\>ACERelators() F650651return the {\GAP} relators of the <i>th (or default) interactive652{\ACE} process. If no relators have been saved for the interactive653{\ACE} process, possibly because the process was started via654`ACEStart(0);' (see~"ACEStart"), the {\ACE} process is interrogated,655the equivalent in {\GAP} is saved and returned. Essentially,656`ACERelators(<i>)' interrogates {\ACE} and establishes657`ACEData.io[<i>].args.rels', if necessary, and returns658`ACEData.io[<i>].args.rels'. As a side-effect, if any of the remaining659fields of `ACEData.io[<i>].args' or `ACEData.io[<i>].acegens' are660unset, they are also set.661662\>ACESubgroupGenerators( <i> ) F663\>ACESubgroupGenerators() F664665return the {\GAP} subgroup generators of the <i>th (or default)666interactive {\ACE} process. If no subgroup generators have been saved667for the interactive {\ACE} process, possibly because the process was668started via `ACEStart(0);' (see~"ACEStart"), the {\ACE} process is669interrogated, the equivalent in {\GAP} is saved and returned.670Essentially, `ACESubgroupGenerators(<i>)' interrogates {\ACE} and671establishes `ACEData.io[<i>].args.sgens', if necessary, and returns672`ACEData.io[<i>].args.sgens'. As a side-effect, if any of the673remaining fields of `ACEData.io[<i>].args' or674`ACEData.io[<i>].acegens' are unset, they are also set.675676\>DisplayACEArgs( <i> ) F677\>DisplayACEArgs() F678679display the arguments (i.e.~<fgens>, <rels> and <sgens>) of the <i>th680(or default) process started by `ACEStart'. In fact,681`DisplayACEArgs(<i>)' is just a pretty-printer of the682`ACEData.io[<i>].args' record. Use `GetACEArgs' (see~"GetACEOptions")683in assignments. Unlike `ACEGroupGenerators'684(see~"ACEGroupGenerators"), `ACERelators' (see~"ACERelators") and685`ACESubgroupGenerators' (see~"ACESubgroupGenerators"),686`DisplayACEArgs' does not have the side-effect of setting any of the687fields of `ACEData.io[<i>].args' if they are unset.688689\>GetACEArgs( <i> ) F690\>GetACEArgs() F691692return a record of the current arguments (i.e.~<fgens>, <rels> and693<sgens>) of the <i>th (or default) process started by `ACEStart'. In694fact, `GetACEOptions(<i>)' simply returns the `ACEData.io[<i>].args'695record, or an empty record if that record is unbound. Unlike696`ACEGroupGenerators' (see~"ACEGroupGenerators"), `ACERelators'697(see~"ACERelators") and `ACESubgroupGenerators'698(see~"ACESubgroupGenerators"), `GetACEOptions' does not have the699side-effect of setting any of the fields of `ACEData.io[<i>].args' if700they are unset.701702\>DisplayACEOptions( <i> ) F703\>DisplayACEOptions() F704705display the options, explicitly set by the user, of the <i>th (or default) process started by706`ACEStart'. In fact, `DisplayACEOptions(<i>)' is just a pretty-printer707of the `ACEData.io[<i>].options' record. Use `GetACEOptions'708(see~"GetACEOptions") in assignments. Please note that no-value {\ACE}709options will appear with the assigned value `true' (see710Section~"Interpretation of ACE Options" for how the {\ACE} interface711functions interpret such options).712713*Notes:*714Any options set via `ACEWrite' (see~"ACEWrite") will *not* be715displayed. Also, recall that if {\ACE} is not given any options it716uses the `default' strategy (see Section~"What happens if no ACE717Strategy Option or if no ACE Option is passed"). To discover the718various settings of the {\ACE} Parameter Options719(see~"ACEParameterOptions") in vogue for the {\ACE} process, use720`ACEParameters' (see~"ACEParameters").721722\>GetACEOptions( <i> ) F723\>GetACEOptions() F724725return a record of the current options (those that have been726explicitly set by the user) of the <i>th (or default) process started727by `ACEStart'. Please note that no-value {\ACE} options will appear728with the assigned value `true' (see Section~"Interpretation of ACE729Options" for how the {\ACE} interface functions interpret such730options). The notes applying to `DisplayACEOptions'731(see~"DisplayACEOptions") also apply here.732733\>SetACEOptions( <i> [:<options>] ) F734\>SetACEOptions( [:<options>] ) F735736modify the current options of the <i>th (or default) process started737by `ACEStart'. Please ensure that the `OptionsStack' is empty before738calling `SetACEOptions', otherwise the options already present on the739`OptionsStack' will also be ``seen''. All interactive {\ACE} interface740functions that accept options, actually call an internal version of741`SetACEOptions'; so, it is generally important to keep the742`OptionsStack' clear while working with {\ACE} interactively.743744After setting the options passed, the first mode of the following:745`ACEContinue' (see~"ACEContinue"), `ACERedo' (see~"ACERedo") or746`ACEStart' (see~"ACEStart"), that may be applied, is automatically747invoked.748749Since a user will sometimes have options in the form of a record750(e.g.~via `GetACEOptions'), we provide an alternative to the751behind-the-colon syntax, in a manner .like `PushOptions', for the752passing of options via `SetACEOptions':753754\>SetACEOptions( <i>, <optionsRec> )!{record version} F755\>SetACEOptions( <optionsRec> )!{record version} F756757In this form, the record <optionsRec> is used to update the current758options of the <i>th (or default) process started by `ACEStart'. Note759that since <optionsRec> is a record each field must have an assigned760value; in particular, no-value {\ACE} options should be assigned the761value `true' (see Section~"Interpretation of ACE Options"). Please762don't mix these two forms of `SetACEOptions' with the previous two763forms; i.e.~do *not* pass both a record argument and options, since764this will lead to options appearing in the wrong order; if you want to765do this, make two separate calls to `SetACEOptions', e.g.~let's say766you have a process like that started by:767768\beginexample769gap> ACEExample("A5", ACEStart);770771\endexample772773then the following demonstrates both usages of `SetACEOptions':774775\beginexample776gap> SetACEOptions( rec(echo := 2) );777gap> SetACEOptions( : hlt);778779\endexample780781Each of the three commands above generates output; for brevity it has782not been included.783784*Notes:*785786\atindex{break-loop}{@\noexpand`break'-loop}787When `ACECosetTableFromGensAndRels' enters a `break'-loop788(see~"ACECosetTable"), local versions of the second form of each of789`DisplayACEOptions' and `SetACEOptions' become available. (Even though790the names are similar and their function is analogous they are in fact791different functions.)792793\>ACEParameters( <i> ) F794\>ACEParameters() F795796return a record of the current values of the {\ACE} Parameter Options797(see~"ACEParameterOptions") of the <i>th (or default) process started798by `ACEStart', according to {\ACE}. Please note that some options may799be reported with incorrect values if they have been changed recently800without following up with one of the modes `ACEContinue', `ACERedo' or801`ACEStart'. Together the commands `ACEGroupGenerators', `ACERelators',802`ACESubgroupGenerators' and `ACEParameters' give the equivalent {\GAP}803information that is obtained in {\ACE} with `sr := 1' (see~"option804sr"), which is the ``Run Parameters'' block obtained in the messaging805output (observable when the `InfoLevel' of `InfoACE' is set to at806least 3), when `messages' (see~"option messages") is set a non-zero807value.808809*Notes:*810One use for this function might be to determine the options required811to replicate a previous run, but be sure that, if this is your812purpose, any recent change in the parameter option values has been813followed by an invocation of one of `ACEContinue' (see~"ACEContinue"),814`ACERedo' (see~"ACERedo") or `ACEStart' (see~"ACEStart").815816As a side-effect, for {\ACE} process <i>, any of the fields of817`ACEData.io[<i>].args' or `ACEData.io[<i>].acegens' that are unset,818are set.819820\>IsCompleteACECosetTable( <i> ) F821\>IsCompleteACECosetTable() F822823return, for the <i>th (or default) process started by `ACEStart',824`true' if {\ACE}'s current coset table is complete, or `false'825otherwise.826827*Note:*828The completeness of the coset table of the <i>th interactive {\ACE}829process is determined by checking whether830`ACEData.io[<i>].stats.index' is positive; a value of zero indicates831the last enumeration failed to complete. The record832`ACEData.io[<i>].stats' is what is returned by `ACEStats(<i>)'833(see~"ACEStats").834835\>ACEDisplayCosetTable( <i> ) F836\>ACEDisplayCosetTable() F837\>ACEDisplayCosetTable( <i>, [<val>] ) F838\>ACEDisplayCosetTable( [<val>] ) F839\>ACEDisplayCosetTable( <i>, [<val>, <last>] ) F840\>ACEDisplayCosetTable( [<val>, <last>] ) F841\>ACEDisplayCosetTable( <i>, [<val>, <last>, <by>] ) F842\>ACEDisplayCosetTable( [<val>, <last>, <by>] ) F843844compact and display the (possibly incomplete) coset table of the <i>th845(or default) process started by `ACEStart'; <val> must be an integer,846and <last> and <by> must be positive integers. In the first two forms847of the command, the entire coset table is displayed, without orders or848coset representatives. In the third and fourth forms, the absolute849value of <val> is taken to be the last line of the table to be850displayed (and 1 is taken to be the first); in the fifth and sixth851forms, `|<val>|' is taken to be the first line of the table to be852displayed, and <last> is taken to be the number of the last line to be853displayed. In the last two forms, the table is displayed from line854`|<val>|' to line <last> in steps of <by>. If <val> is negative, then855the orders modulo the subgroup (if available) and coset856representatives are displayed also.857858*Note:*859The coset table displayed will normally only be `lenlex' standardised860if the call to `ACEDisplayCosetTable' is preceded by861`ACEStandardCosetNumbering' (see~"ACEStandardCosetNumbering"). The862options `lenlex' (see~"option lenlex") and `semilenlex' (see~"option863semilenlex") are only executed by `ACECosetTable'864(see~"ACECosetTable"). The {\ACE} binary does not provide `semilenlex'865standardisation, and hence `ACEDisplayCosetTable' will never display a866`semilenlex' standard coset table.867868\>ACECosetRepresentative( <i>, <n> ) F869\>ACECosetRepresentative( <n> ) F870871return, for the <i>th (or default) process started by `ACEStart', the872coset representative of coset <n> of the current coset table held by873{\ACE}, where <n> must be a positive integer.874875\>ACECosetRepresentatives( <i> ) F876\>ACECosetRepresentatives() F877878return, for the <i>th (or default) process started by `ACEStart', the879list of coset representatives of the current coset table held by880{\ACE}.881882\>ACETransversal( <i> ) F883\>ACETransversal() F884885return, for the <i>th (or default) process started by `ACEStart', the886list of coset representatives of the current coset table held by887{\ACE}, if the current table is complete, and `fail' otherwise.888Essentially, `ACETransversal(<i>) = ACECosetRepresentatives(<i>)' for889a complete table.890891\>ACECycles( <i> ) F892\>ACECycles() F893\>ACEPermutationRepresentation( <i> ) F894\>ACEPermutationRepresentation() F895896return, for the <i>th (or default) process started by `ACEStart', a897list of permutations corresponding to the group generators, (i.e., the898permutation representation), if the current coset table held by {\ACE}899is complete or `fail', otherwise. In the event of failure a message is900emitted to `Info' at `InfoACE' or `InfoWarning' level 1.901902\>ACETraceWord( <i>, <n>, <word> ) F903\>ACETraceWord( <n>, <word> ) F904905for the <i>th (or default) interactive {\ACE} process started by906`ACEStart', trace <word> through {\ACE}'s coset table, starting at907coset <n>, and return the final coset number if the trace completes,908and `fail' otherwise. In Group Theory terms, if the cosets of a909subgroup $H$ in a group $G$ are the subject of interactive {\ACE}910process <i> and the coset identified by that process by the integer911<n> corresponds to some coset $Hx$, for some $x$ in $G$, and <word>912represents the element $g$ of $G$, then, providing the current coset913table is complete enough, `ACETraceWord( <i>, <n>, <word> )' returns914the integer identifying the coset $Hxg$.915916*Notes:*917You may wish to compact {\ACE}'s coset table first, either explicitly918via `ACERecover' (see~"ACERecover"), or, implicitly, via any function919call that invokes {\ACE}'s compaction routine (see~"ACERecover" note).920921If you actually wanted {\ACE}'s coset representative, then, for a922*compact* table, feed the output of `ACETraceWord' to923`ACECosetRepresentative' (see~"ACECosetRepresentative").924925\>ACEOrders( <i> ) F926\>ACEOrders() F927\>ACEOrders( <i> : suborder := <suborder> ) F928\>ACEOrders(: suborder := <suborder> ) F929930for the <i>th (or default) interactive {\ACE} process started by931`ACEStart', search for all coset numbers whose representatives' orders932(modulo the subgroup) are either finite, or, if invoked with the933`suborder' option, are multiples of <suborder>, where <suborder>934should be a positive integer. `ACEOrders' returns a (possibly empty)935list of records, each with fields `coset', `order' and `rep', which936are respectively, the coset number, its order modulo the subgroup, and937a representative for each coset number satisfying the criteria of the938search.939940*Note:*941You may wish to compact {\ACE}'s coset table first, either explicitly942via `ACERecover' (see~"ACERecover"), or, implicitly, via any function943call that invokes {\ACE}'s compaction routine (see~"ACERecover" note).944945\>ACEOrder( <i>, <suborder> ) F946\>ACEOrder( <suborder> ) F947948for the <i>th (or default) interactive {\ACE} process started by949`ACEStart', search for coset number(s) whose coset representatives950have order modulo the subgroup a multiple of <suborder>. When951<suborder> is a positive integer, `ACEOrder' returns just one record952with fields `coset', `order' and `rep', which are respectively, the953coset number, its order modulo the subgroup, and a representative for954the first coset number satisfying the criteria of the search, or955`fail' if there is no such coset number. The value of <suborder> may956also be a negative integer, in which case, `ACEOrder( <i>, <suborder>957)' is equivalent to `ACEOrders( <i> : suborder := |<suborder>|)'; or958<suborder> may be zero, in which case, `ACEOrder( <i>, 0 )' is959equivalent to `ACEOrders( <i> )'.960961*Note:*962You may wish to compact {\ACE}'s coset table first, either explicitly963via `ACERecover' (see~"ACERecover"), or, implicitly, via any function964call that invokes {\ACE}'s compaction routine (see~"ACERecover" note).965966\>ACECosetOrderFromRepresentative( <i>, <cosetrep> ) F967\>ACECosetOrderFromRepresentative( <cosetrep> ) F968969for the <i>th (or default) interactive {\ACE} process return the order970(modulo the subgroup) of the coset with representative <cosetrep>, a971word in the free group generators.972973*Note:*974`ACECosetOrderFromRepresentative' calls `ACETraceWord' to determine975the coset (number) to which <cosetrep> belongs, and then scans the976output of `ACEOrders' to determine the order of the coset (number).977978\>ACECosetsThatNormaliseSubgroup( <i>, <n> ) F979\>ACECosetsThatNormaliseSubgroup( <n> ) F980981for the <i>th (or default) interactive {\ACE} process started by982`ACEStart', determine non-trivial (i.e.~other than coset 1) coset983numbers whose representatives normalise the subgroup.984985\beginlist%unordered986987\item{--} If <n> $> 0$, the list of the first <n> non-trivial coset988numbers whose representatives normalise the subgroup is returned.989990\item{--} If <n> $\< 0$, a list of records with fields `coset' and991`rep' which represent the coset number and a representative,992respectively, of the first <n> non-trivial coset numbers whose993representatives normalise the subgroup is returned.994995\item{--} If <n> $= 0$, a list of records with fields `coset' and996`rep' which represent the coset number and a representative,997respectively, of all non-trivial coset numbers whose representatives998normalise the subgroup is returned.9991000\endlist10011002*Note:*1003You may wish to compact {\ACE}'s coset table first, either explicitly1004via `ACERecover' (see~"ACERecover"), or, implicitly, via any function1005call that invokes {\ACE}'s compaction routine (see~"ACERecover" note).10061007\>ACEStyle( <i> ) F1008\>ACEStyle() F10091010returns the current enumeration style as one of the strings: `"C"',1011`"Cr"', `"CR"', `"R"', `"R*"', `"Rc"', `"R/C"', or `"R/C (defaulted)"'1012(see Section~"Enumeration Style").10131014The next two functions of this section are really intended for {\ACE}1015standalone gurus. To fully understand their output you will need to1016consult the standalone manual and the C source code.10171018\>ACEDumpVariables( <i> ) F1019\>ACEDumpVariables() F1020\>ACEDumpVariables( <i>, [<level>] ) F1021\>ACEDumpVariables( [<level>] ) F1022\>ACEDumpVariables( <i>, [<level>, <detail>] ) F1023\>ACEDumpVariables( [<level>, <detail>] ) F10241025dump the internal variables of {\ACE} of the <i>th (or default)1026process started by `ACEStart'; <level> should be one of 0, 1, or 2,1027and <detail> should be 0 or 1.10281029The value of <level> determines which of the three levels of {\ACE} to1030dump. (You will need to read the standalone manual to understand what1031Levels 0, 1 and 2 are all about.) The value of <detail> determines the1032amount of detail (`<detail> = 0' means less detail). The first two1033forms of `ACEDumpVariables' (with no list argument) selects `<level> =10340, <detail> = 0'. The third and fourth forms (with a list argument1035containing the integer <level>) makes `<detail> = 0'. This command is1036intended for gurus; the source code should be consulted to see what1037the output means.10381039\>ACEDumpStatistics( <i> ) F1040\>ACEDumpStatistics() F10411042dump {\ACE}'s internal statistics accumulated during the most recent1043enumeration of the <i>th (or default) process started by `ACEStart',1044provided the {\ACE} binary was built with the statistics package1045(which it is by default). Use `ACEBinaryVersion();'1046(see~"ACEBinaryVersion") to check for the inclusion of the statistics1047package. See the `enum.c' source file for the meaning of the1048variables.10491050\>ACEBinaryVersion( <i> ) F1051\>ACEBinaryVersion() F10521053for the <i>th (or default) process started by `ACEStart', print, via1054`Info' (at `InfoACE' level 1), version details of the {\ACE} binary1055you are currently running, including what compiler flags were set when1056the executable was built, and also returns the version number of the1057binary as a string. Essentially the information obtained is what is1058obtained via {\ACE}'s `options' option (see~"option options"), and the1059returned value is what is stored in `ACEData.version' (see~"ACEData").1060A typical output, illustrating the default build, is:10611062\beginexample1063gap> ACEBinaryVersion();1064#I No interactive ACE sessions are currently active1065#I ACE Binary Version: 3.0011066#I ACE 3.001 Sat Feb 27 11:27:15 20161067#I =========================================1068#I Host information:1069#I name = banksia1070#I ACE 3.001 executable built:1071#I Wed Feb 24 15:25:26 AWST 20161072#I Level 0 options:1073#I statistics package = on1074#I coinc processing messages = on1075#I dedn processing messages = on1076#I Level 1 options:1077#I workspace multipliers = decimal1078#I Level 2 options:1079#I host info = on1080"3.001"10811082\endexample10831084*Notes:*1085The {\ACE} binary's banner may also appear in the output (if it has1086not already appeared). Unlike other {\ACE} interface functions, the1087information obtained via `ACEBinaryVersion();' is absolutely1088independent of any enumeration. For this reason, we make it1089permissible to run `ACEBinaryVersion();' when there are no currently1090active interactive {\ACE} processes; and, in such a case,1091`ACEBinaryVersion();' emits a warning that there are no interactive1092{\ACE} sessions currently active and initiates (and closes again) its1093own stream to obtain the information from the {\ACE} binary. For the1094current version of the {\ACE} package (the {\GAP} code component) use1095`ACEPackageVersion();' (see~"ACEPackageVersion").10961097%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1098\Section{Interactive Versions of Non-interactive ACE Functions}10991100\>ACECosetTable( <i> [:<options>] )!{interactive} F1101\>ACECosetTable( [:<options>] )!{interactive} F11021103return a coset table as a {\GAP} object, in standard form (for1104{\GAP}). These functions perform the same function as1105`ACECosetTableFromGensAndRels' and `ACECosetTable' on three arguments1106(see~"ACECosetTable"), albeit interactively, on the <i>th (or default)1107process started by `ACEStart'. If options are passed then an internal1108version of `ACEModes' is run to determine which of the general {\ACE}1109modes (see Section~"General ACE Modes") `ACEContinue', `ACERedo' or1110`ACEStart' is possible; and (an internal version of) the first mode of1111these that is allowed is executed, to ensure the resultant table is1112correct for the current options.11131114\>ACEStats( <i> [:<options>] )!{interactive} F1115\>ACEStats( [:<options>] )!{interactive} F11161117perform the same function as `ACEStats' on three arguments1118(see~"ACEStats" --- non-interactive version), albeit interactively, on1119the <i>th (or default) process started by `ACEStart'. If options are1120passed then an internal version of `ACEModes' is run to determine1121which of the general {\ACE} modes (see Section~"General ACE Modes")1122`ACEContinue', `ACERedo' or `ACEStart' is possible; and (an internal1123version of) the first mode of these that is allowed is executed, to1124ensure the resultant statistics are correct for the current options.11251126See Section~"Example of Using ACE Interactively (Using ACEStart)" for1127an example demonstrating both these functions within an interactive1128process.11291130\>IsACEGeneratorsInPreferredOrder( <i> )!{interactive} F1131\>IsACEGeneratorsInPreferredOrder()!{interactive} F11321133for the <i>th (or default) interactive {\ACE} process started by1134`ACEStart', return `true' if the group generators of that process, are1135in an order that will not be changed by {\ACE}, and `false' otherwise.1136This function has greatest relevance to users who call `ACECosetTable'1137(see~"ACECosetTable!interactive"), with the `lenlex' option1138(see~"option lenlex"). For more details, see the discussion for the1139non-interactive version of `IsACEGeneratorsInPreferredOrder'1140("IsACEGeneratorsInPreferredOrder"), which is called with two1141arguments.11421143%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1144\Section{Steering ACE Interactively}11451146\index{dead coset (number)}1147\>ACERecover( <i> ) F1148\>ACERecover() F11491150invoke the compaction routine on the coset table of the <i>th (or1151default) interactive {\ACE} process started by `ACEStart', in order to1152recover the space used by the dead coset numbers. A `CO' message line1153is printed if any rows of the coset table were recovered, and a `co'1154line if none were. (See Appendix~"The Meanings of ACE's output1155messages" for the meanings of these messages.)11561157*Note:*1158The compaction routine is called automatically when any of1159`ACEDisplayCosetTable' (see~"ACEDisplayCosetTable"),1160`ACECosetRepresentative' (see~"ACECosetRepresentative"),1161`ACECosetRepresentatives' (see~"ACECosetRepresentatives"),1162`ACETransversal' (see~"ACETransversal"), `ACECycles'1163(see~"ACECycles"), `ACEStandardCosetNumbering'1164(see~"ACEStandardCosetNumbering"), `ACECosetTable'1165(see~"ACECosetTable") or `ACEConjugatesForSubgroupNormalClosure'1166(see~"ACEConjugatesForSubgroupNormalClosure"), is invoked.11671168\atindex{lenlex standardisation scheme}%1169{@\noexpand`lenlex' standardisation scheme}1170\>ACEStandardCosetNumbering( <i> ) F1171\>ACEStandardCosetNumbering() F11721173compact and then do a `lenlex' standardisation (see Section~"Coset1174Table Standardisation Schemes") of the numbering of cosets in the1175coset table of the <i>th (or default) interactive {\ACE} process1176started by `ACEStart'. That is, for a given ordering of the generators1177in the columns of the table, they produce a canonic table. A table1178that includes a column for each generator inverse immediately1179following the column for the corresponding generator, standardised1180according to the `lenlex' scheme, has the property that a row-major1181scan (i.e.~a scan of the successive rows of the *body* of the table1182row by row, from left to right) encounters previously unseen cosets in1183numeric order. This function does not display the new table; use1184`ACEDisplayCosetTable' (see~"ACEDisplayCosetTable") for that.11851186*Notes:*1187In a `lenlex' canonic table, the coset representatives are ordered1188first according to length and then the lexicographic order defined by1189the order the generators and their inverses head the columns. Note1190that, unless special action is taken, {\ACE} avoids having an1191involutory generator in the first column (by swapping the first two1192generators), except when there is only one generator, or when the1193second generator is also an involution; so the lexicographic order1194used by {\ACE} need not necessarily correspond with the order in which1195the generators were first put to {\ACE}. (We have used the term1196``involution'' above; what we really mean is a generator `x' for1197which there is a relator `x*x' or `x^2'. Such a generator may, of1198course, turn out to actually be the identity.) The function1199`IsACEGeneratorsInPreferredOrder' (see1200"IsACEGeneratorsInPreferredOrder") detects cases when {\ACE} would1201swap the first two generators.12021203Standardising the coset numbering within {\ACE} does *not* affect the1204{\GAP} coset table obtained via `ACECosetTable' (see~"ACECosetTable").1205If `ACECosetTable' is called without the `lenlex' option {\GAP}'s1206default standardisation is applied after conversion of {\ACE}'s1207output, which undoes an {\ACE} standardisation. On the other hand, if1208`ACECosetTable' is called with the `lenlex' option then after a check1209and special action, if required, the equivalent of a call to1210`ACEStandardCosetNumbering' is invoked, irrespective of whether it has1211been done by the user beforehand. The check that is done is a call to1212`IsACEGeneratorsInPreferredOrder' (see1213"IsACEGeneratorsInPreferredOrder") to ensure that {\ACE} has not1214swapped the first two generators. The special action taken when the1215call to `IsACEGeneratorsInPreferredOrder' returns `false', is the1216setting of the `asis' option (see~"option asis") to 1 and the1217resubmission of the relators to {\ACE} taking care not to submit the1218relator that determines the first generator as an involution as that1219generator squared (these two actions together avert {\ACE}'s swapping1220of the first two generators), followed by the re-`start'ing of the1221enumeration.12221223*Guru Notes:*1224In five of the ten standard enumeration strategies of Sims1225\cite{Sim94} (i.e.~the five Sims strategies not provided by {\ACE}),1226the table is standardised repeatedly. This is expensive1227computationally, but can result in fewer cosets being necessary. The1228effect of doing this can be investigated in {\ACE} by (repeatedly)1229halting the enumeration (via restrictive options), standardising the1230coset numbering, and continuing (see Section~"Emulating Sims" for an1231example).12321233\>ACEAddRelators( <i>, <wordlist> ) F1234\>ACEAddRelators( <wordlist> ) F12351236add, for the <i>th (or default) interactive {\ACE} process started by1237`ACEStart', the words in the list <wordlist> to any relators already1238present, and automatically invoke `ACERedo', if it can be applied, or1239otherwise `ACEStart'. Note that {\ACE} sorts the resultant relator1240list, unless the `asis' option (see~"option asis") has been set to 1;1241don't assume, unless `asis = 1', that the new relators have been1242appended in user-provided order to the previously existing relator1243list. `ACEAddRelators' also returns the new relator list. Use1244`ACERelators' (see~"ACERelators") to determine the current relator1245list.12461247\>ACEAddSubgroupGenerators( <i>, <wordlist> ) F1248\>ACEAddSubgroupGenerators( <wordlist> ) F12491250add, for the <i>th (or default) interactive {\ACE} process started by1251`ACEStart', the words in the list <wordlist> to any subgroup1252generators already present, and automatically invoke `ACERedo', if it1253can be applied, or otherwise `ACEStart'. Note that {\ACE} sorts the1254resultant subgroup generator list, unless the `asis' option1255(see~"option asis") has been set to 1; don't assume, unless `asis =12561', that the new subgroup generators have been appended in1257user-provided order to the previously existing subgroup generator1258list. `ACEAddSubgroupGenerators' also returns the new subgroup1259generator list. Use `ACESubgroupGenerators'1260(see~"ACESubgroupGenerators") to determine the current subgroup1261generator list.12621263\>ACEDeleteRelators( <i>, <list> ) F1264\>ACEDeleteRelators( <list> ) F12651266for the <i>th (or default) interactive {\ACE} process started by1267`ACEStart', delete <list> from the current relators, if list is a list1268of words in the group generators, or those current relators indexed by1269the integers in <list>, if <list> is a list of positive integers, and1270automatically invoke `ACEStart'. `ACEDeleteRelators' also returns the1271new relator list. Use `ACERelators' (see~"ACERelators") to determine1272the current relator list.12731274\>ACEDeleteSubgroupGenerators( <i>, <list> ) F1275\>ACEDeleteSubgroupGenerators( <list> ) F12761277for the <i>th (or default) interactive {\ACE} process started by1278`ACEStart', delete <list> from the current subgroup generators, if1279list is a list of words in the group generators, or those current1280subgroup generators indexed by the integers in <list>, if <list> is a1281list of positive integers, and automatically invoke `ACEStart'.1282`ACEDeleteSubgroupGenerators' also returns the new subgroup generator1283list. Use `ACESubgroupGenerators' (see~"ACESubgroupGenerators") to1284determine the current subgroup generator list.12851286\>ACECosetCoincidence( <i>, <n> ) F1287\>ACECosetCoincidence( <n> ) F12881289for the <i>th (or default) interactive {\ACE} process started by1290`ACEStart', return the representative of coset <n>, where <n> must be1291a positive integer, and add it to the subgroup generators; i.e.,1292equates this coset with coset 1, the subgroup. `ACERedo' is1293automatically invoked.12941295\>ACERandomCoincidences( <i>, <subindex> ) F1296\>ACERandomCoincidences( <subindex> ) F1297\>ACERandomCoincidences( <i>, [<subindex>] ) F1298\>ACERandomCoincidences( [<subindex>] ) F1299\>ACERandomCoincidences( <i>, [<subindex>, <attempts>] ) F1300\>ACERandomCoincidences( [<subindex>, <attempts>] ) F13011302for the <i>th (or default) interactive {\ACE} process started by1303`ACEStart', attempt up to <attempts> (or, in the first four forms, 8)1304times to find nontrivial subgroups with index a multiple of <subindex>1305by repeatedly making random coset numbers coincident with coset 1 and1306seeing what happens. The starting coset table must be non-empty, but1307must *not* be complete (use `ACERandomlyApplyCosetCoincidence'1308(see~"ACERandomlyApplyCosetCoincidence") if your table is already1309complete). For each attempt, by applying {\ACE}'s `rc' option1310(see~"option rc") random coset representatives are repeatedly added to1311the subgroup and the enumeration `redo'ne. If the table becomes too1312small, the attempt is aborted, the original subgroup generators1313restored, and another attempt made. If an attempt succeeds, then the1314new set of subgroup generators is retained. `ACERandomCoincidences'1315returns the list of new subgroup generators added. Use1316`ACESubgroupGenerators' (see~"ACESubgroupGenerators") to determine the1317current subgroup generator list.13181319*Notes:*1320`ACERandomCoincidences' may add subgroup generators even if it failed1321to determine a nontrivial subgroup with index a multiple of1322<subindex>; in such a case, the original status may be restored by1323applying `ACEDeleteSubgroupGenerators'1324(see~"ACEDeleteSubgroupGenerators") with the list returned by1325`ACERandomCoincidences'.13261327`ACERandomCoincidences' applies the `rc' option (see~"option rc") of1328{\ACE} which takes the line that if an enumeration has already1329obtained a finite index then either, <subindex> is already a divisor1330of that finite index, or the request is impossible. Thus an invocation1331of `ACERandomCoincidences', in the case where the coset table is1332already complete, is an error.13331334*Guru Notes:* A coset can have many different representatives.1335Consider running `ACEStandardCosetNumbering'1336(see~"ACEStandardCosetNumbering") before `ACERandomCoincidences', to1337canonicise the table and the representatives.13381339\>ACERandomlyApplyCosetCoincidence( <i> [: <controlOptions>]) F1340\>ACERandomlyApplyCosetCoincidence( [: <controlOptions>]) F13411342for the <i>th (or default) interactive {\ACE} process started by1343`ACEStart', try to find a larger proper subgroup (i.e.~a subgroup of1344smaller but nontrivial index), by repeatedly applying1345`ACECosetCoincidence' (see~"ACECosetCoincidence") and seeing what1346happens; `ACERandomlyApplyCosetCoincidence' returns the (possibly1347empty) list of new subgroup generators added. The starting coset table1348must already be complete (use `ACERandomCoincidences'1349(see~"ACERandomCoincidences") if your table is not already complete).1350`ACERandomlyApplyCosetCoincidence' provides the following four options1351(<controlOptions>).13521353\beginitems13541355\quad`subindex := <subindex>' &1356Sets the restriction that the final index should be a multiple of1357<subindex>; <subindex> must be a positive integer divisor of the1358initial subgroup index.13591360\quad`hibound := <hibound>' &1361Sets the restriction that the final index should be (strictly) less1362than <hibound>; <hibound> must be an integer that is greater than 11363and at most the initial subgroup index.13641365\quad`lobound := <lobound>' &1366Sets the restriction that the final index should be (strictly) greater1367than <lobound>; <lobound> must be an integer that is at least 1 and1368(strictly) less than the initial subgroup index.13691370\quad`attempts := <attempts>' &1371Sets the restriction that the number of applications of1372`ACECosetCoincidence' should be at most <attempts>; <attempts> must be1373a positive integer.13741375\enditems13761377By default, `<subindex> = 1', <hibound> is the existing subgroup1378index, `<lobound> = 1' and `<attempts> = 8'. If after an attempt the1379new index is a multiple of <subindex>, less than <hibound> and greater1380than <lobound> then the process terminates (and the list of new1381subgroup generators is returned). Otherwise, if an attempt reaches a1382stage where the criteria cannot be satisfied, the attempt is aborted,1383the original subgroup generators restored, and another attempt made.1384If no attempt is successful an empty list is returned. Use1385`ACESubgroupGenerators' (see~"ACESubgroupGenerators") to determine the1386current subgroup generator list.13871388\>ACEConjugatesForSubgroupNormalClosure( <i> ) F1389\>ACEConjugatesForSubgroupNormalClosure() F1390\>ACEConjugatesForSubgroupNormalClosure( <i> : add ) F1391\>ACEConjugatesForSubgroupNormalClosure(: add ) F13921393for the <i>th (or default) interactive {\ACE} process started by1394`ACEStart', test each conjugate of a subgroup generator by a group1395generator for membership in the subgroup, and return the (possibly1396empty) list of conjugates that were determined to not belong to the1397subgroup (coset 1); and, if called with the `add' option, these1398conjugates are also added to the existing list of subgroup generators.13991400*Notes:* A conjugate of a subgroup generator is tested for membership1401of the subgroup, by checking whether it can be traced from coset 1 to1402coset 1 (see `ACETraceWord':~"ACETraceWord"). For an *incomplete*1403coset table, such a trace may not complete, in which case1404`ACEConjugatesForSubgroupNormalClosure' may return an empty list even1405though the subgroup is *not* normally closed within the group.14061407The `add' option does *not* guarantee that the resultant subgroup is1408normally closed. It is still possible that some conjugates of the1409newly added subgroup generators will not be elements of the subgroup.14101411*Example:*1412To demonstrate the usage and features of1413`ACEConjugatesForSubgroupNormalClosure', let us consider an example1414where we know pretty well what to expect.14151416Let $G$ be the group, isomorphic to the symmetric group $S_6$, with1417the presentation1418$$1419\{ a, b \mid a^2, b^6, (ab^{-1}ab)^3, (ab^{-1}ab^2)^4, (ab)^5,1420(ab^{-2}ab^2)^2 \}1421$$1422(from \cite{CM72}), and let $H$ be the subgroup $\langle ab^31423\rangle$. There is an isomorphism $\phi$ from $G$ to $S_6$ mapping $a$1424onto $(1,2)$ and $ab^3$ onto $(1,2,3,4,5,6)$. It follows that $\phi$1425maps $ab^3$ into $A_6$. So we know that the normal closure of $H$ has1426index 2 in $G$. Let us observe this via {\ACE}.14271428First we start an enumeration with `max' set to 80.14291430\beginexample1431gap> F := FreeGroup( "a", "b" );;1432gap> a := F.1;; b := F.2;;1433gap> fgens := GeneratorsOfGroup( F );;1434gap> rels := [ a^2, b^6, (a*b^-1*a*b)^3, (a*b^-1*a*b^2)^4, (a*b)^5,1435> (a*b^-2*a*b^2)^2 ];;1436gap> sgens := [ a*b^3 ];;1437gap> i := ACEStart( fgens, rels, sgens : max := 80 );;1438gap> IsCompleteACECosetTable( i );1439false1440gap> ACEConjugatesForSubgroupNormalClosure( i : add );1441#I ACEConjugatesForSubgroupNormalClosure: All (traceable) conjugates in subgp1442[ ]14431444\endexample14451446Though we know that $H$ is not equal to its normal closure, we did not1447get any new elements (we had warned above of such a possibility).1448Apparently our incomplete table is too small. So let us increase `max'1449to 100 and continue.14501451\beginexample1452gap> ACEContinue( i : max := 100 );;1453gap> IsCompleteACECosetTable( i );1454false1455gap> ACEConjugatesForSubgroupNormalClosure( i : add );1456[ b^-1*a*b^4 ]1457gap> IsCompleteACECosetTable( i );1458true1459gap> ACEStats( i ).index;14602014611462\endexample14631464This time we got a new element, and after adding it to the subgroup1465generators we obtained a complete table. However the resulting1466subgroup need not yet be the normal closure of $H$ (and in fact we1467know that it is not). So we continue with another call to the function1468`ACEConjugatesForSubgroupNormalClosure'.14691470\beginexample1471gap> ACEConjugatesForSubgroupNormalClosure( i : add );1472[ b^-2*a*b^5, b*a*b^2 ]1473gap> ACEStats( i ).index;1474214751476\endexample14771478Now we have the index that we expected. Another call to the function1479`ACEConjugatesForSubgroupNormalClosure' should not yield any more1480conjugates. We ensure that this is indeed the case and then display1481the resulting list of subgroup generators.14821483\beginexample1484gap> ACEConjugatesForSubgroupNormalClosure( i : add );1485#I ACEConjugatesForSubgroupNormalClosure: All (traceable) conjugates in subgp1486[ ]1487gap> ACESubgroupGenerators( i );1488[ a*b^3, b*a*b^2, b^-1*a*b^4, b^-2*a*b^5 ]14891490\endexample14911492%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1493\Section{Primitive ACE Read/Write Functions}14941495For those familiar with the workings of the {\ACE} standalone we1496provide primitive read/write tools to communicate directly with an1497interactive {\ACE} process, started via `ACEStart' (possibly with1498argument 0, but this is not essential). For the most part, it is up to1499the user to translate the output strings from {\ACE} into a form1500useful in {\GAP}. However, after the group generators, relators, and1501subgroup generators have been set in the {\ACE} process, via1502`ACEWrite', invocations of any of `ACEGroupGenerators'1503(see~"ACEGroupGenerators"), `ACERelators' (see~"ACERelators"),1504`ACESubgroupGenerators' (see~"ACESubgroupGenerators"), or1505`ACEParameters' (see~"ACEParameters") will establish the corresponding1506{\GAP} values. Be warned though, that unless one of the modes1507`ACEStart' (without a zero argument; see~"ACEStart"), `ACERedo'1508(see~"ACERedo") or `ACEContinue' (see~"ACEContinue"), or their1509equivalent for the standalone {\ACE} (`start;', `redo;', or1510`continue;'), has been invoked since the last change of any parameter1511options (see~"ACEParameterOptions"), some of the values reported by1512`ACEParameters' may well be *incorrect*.15131514\>ACEWrite( <i>, <string> ) F1515\>ACEWrite( <string> ) F15161517write <string> to the <i>th or default interactive {\ACE} process;1518<string> must be in exactly the form the {\ACE} standalone expects.1519The command is echoed via `Info' at `InfoACE' level 4 (with a1520```ToACE> ''' prompt); i.e.~`SetInfoACELevel(4);' will allow you to1521see what is transmitted to the {\ACE} binary. `ACEWrite' returns `true'1522if successful in writing to the stream of the interactive {\ACE} process,1523and `fail' otherwise.15241525*Note:*1526If `ACEWrite' returns `fail' (which means that the {\ACE} process has1527died), you may like to try resurrecting the interactive {\ACE} process1528via `ACEResurrectProcess' (see~"ACEResurrectProcess").15291530\>ACERead( <i> ) F1531\>ACERead() F15321533read a complete line of {\ACE} output, from the <i>th or default1534interactive {\ACE} process, if there is output to be read and returns1535`fail' otherwise. When successful, the line is returned as a string1536complete with trailing newline character. Please note that it is1537possible to be ``too quick'' (i.e.~the return can be `fail' purely1538because the output from {\ACE} is not there yet), but if `ACERead'1539finds any output at all, it waits for a complete line.15401541\>ACEReadAll( <i> ) F1542\>ACEReadAll() F15431544read and return as many *complete* lines of {\ACE} output, from the1545<i>th or default interactive {\ACE} process, as there are to be read,1546*at the time of the call*, as a list of strings with the trailing1547newlines removed and returns the empty list otherwise. `ACEReadAll'1548also writes each line read via `Info' at `InfoACE' level 3. Whenever1549`ACEReadAll' finds only a partial line, it waits for the complete1550line, thus increasing the probability that it has captured all the1551output to be had from {\ACE}.15521553\>ACEReadUntil( <i>, <IsMyLine> ) F1554\>ACEReadUntil( <IsMyLine> ) F1555\>ACEReadUntil( <i>, <IsMyLine>, <Modify> ) F1556\>ACEReadUntil( <IsMyLine>, <Modify> ) F15571558read complete lines of {\ACE} output, from the <i>th or default1559interactive {\ACE} process, ``chomps'' them (i.e.~removes any trailing1560newline character), emits them to `Info' at `InfoACE' level 3, and1561applies the function <Modify> (where <Modify> is just the identity1562map/function for the first two forms) until a ``chomped'' line <line>1563for which `<IsMyLine>( <Modify>(<line>) )' is true. `ACEReadUntil'1564returns the list of <Modify>-ed ``chomped'' lines read.15651566*Notes:*1567When provided by the user, <Modify> should be a function that accepts1568a single string argument.15691570<IsMyLine> should be a function that is able to accept the output of1571<Modify> (or take a single string argument when <Modify> is not1572provided) and should return a boolean.15731574If `<IsMyLine>( <Modify>(<line>) )' is never true, `ACEReadUntil' will1575wait indefinitely.15761577%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1578%%1579%E158015811582