<h3>6 <span class="Heading">New <strong class="pkg">GAP</strong> Objects and Utility Functions provided by the
<strong class="pkg">AtlasRep</strong> Package</span></h3>
<p>This chapter describes <strong class="pkg">GAP</strong> objects and functions that are provided by the <strong class="pkg">AtlasRep</strong> package but that might be of general interest.</p>
<p>The new objects are straight line decisions (see Section <a href="chap6.html#X8121E9567A7137C9"><span class="RefLink">6.1</span></a>) and black box programs (see Section <a href="chap6.html#X7BE856BC785A9E8F"><span class="RefLink">6.2</span></a>).</p>
<p>The new functions are concerned with representations of minimal degree, see Section <a href="chap6.html#X87E1F08D80C9E069"><span class="RefLink">6.3</span></a>, and a JSON interface, see Section <a href="chap6.html#X7E5CB1637F127B2E"><span class="RefLink">6.4</span></a>.</p>
<h4>6.1 <span class="Heading">Straight Line Decisions</span></h4>
<p><em>Straight line decisions</em> are similar to straight line programs (see Section <a href="../../../doc/ref/chap37.html#X7DC99E4284093FBB"><span class="RefLink">Reference: Straight Line Programs</span></a>) but return <code class="keyw">true</code> or <code class="keyw">false</code>. A straight line decision checks whether its inputs have some property. An important example is to check whether a given list of group generators is in fact a list of standard generators (cf. Section<a href="chap3.html#X795DB7E486E0817D"><span class="RefLink">3.3</span></a>) for this group.</p>
<p>A straight line decision in <strong class="pkg">GAP</strong> is represented by an object in the filter <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>) that stores a list of <q>lines</q> each of which has one of the following three forms.</p>
<ol>
<li><p>a nonempty dense list <span class="SimpleMath">l</span> of integers,</p>
</li>
<li><p>a pair <span class="SimpleMath">[ l, i ]</span> where <span class="SimpleMath">l</span> is a list of form 1. and <span class="SimpleMath">i</span> is a positive integer,</p>
</li>
<li><p>a list <span class="SimpleMath">[</span> <code class="code">"Order"</code><span class="SimpleMath">, i, n ]</span> where <span class="SimpleMath">i</span> and <span class="SimpleMath">n</span> are positive integers.</p>
</li>
</ol>
<p>The first two forms have the same meaning as for straight line programs (see Section <a href="../../../doc/ref/chap37.html#X7DC99E4284093FBB"><span class="RefLink">Reference: Straight Line Programs</span></a>), the last form means a check whether the element stored at the <span class="SimpleMath">i</span>-thlabel has the order <span class="SimpleMath">n</span>.</p>
<p>For the meaning of the list of lines, see <code class="func">ResultOfStraightLineDecision</code> (<a href="chap6.html#X7E7B328A84685480"><span class="RefLink">6.1-6</span></a>).</p>
<p>Straight line decisions can be constructed using <code class="func">StraightLineDecision</code> (<a href="chap6.html#X825C4E4180F3D989"><span class="RefLink">6.1-5</span></a>), defining attributes for straight line decisions are <code class="func">NrInputsOfStraightLineDecision</code> (<a href="chap6.html#X7B1A43427BD97FDF"><span class="RefLink">6.1-3</span></a>) and <code class="func">LinesOfStraightLineDecision</code> (<a href="chap6.html#X82AFAD9F7FA5CE8A"><span class="RefLink">6.1-2</span></a>), an operation for straight line decisions is <code class="func">ResultOfStraightLineDecision</code> (<a href="chap6.html#X7E7B328A84685480"><span class="RefLink">6.1-6</span></a>).</p>
<p>Special methods applicable to straight line decisions are installed for the operations <codeclass="func">Display</code> (<a href="../../../doc/ref/chap6.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>), <code class="func">IsInternallyConsistent</code> (<a href="../../../doc/ref/chap12.html#X7F6C5C3287E8B816"><span class="RefLink">Reference: IsInternallyConsistent</span></a>), <code class="func">PrintObj</code> (<a href="../../../doc/ref/chap6.html#X815BF22186FD43C9"><span class="RefLink">Reference: PrintObj</span></a>), and <code class="func">ViewObj</code> (<a href="../../../doc/ref/chap6.html#X815BF22186FD43C9"><span class="RefLink">Reference: ViewObj</span></a>).</p>
<p>For a straight line decision <var class="Arg">prog</var>, the default <code class="func">Display</code> (<a href="../../../doc/ref/chap6.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>) method prints the interpretation of <var class="Arg">prog</var> as a sequence of assignments of associative words and of order checks; a record with components <code class="code">gensnames</code> (with value a list of strings) and <code class="code">listname</code> (a string) may be entered as second argument of <code class="func">Display</code> (<a href="../../../doc/ref/chap6.html#X83A5C59278E13248"><span class="RefLink">Reference: Display</span></a>), in this case these names are used, the default for <code class="code">gensnames</code> is <codeclass="code">[ g1, g2, </code><span class="SimpleMath">...</span><code class="code"> ]</code>, the default for <var class="Arg">listname</var> is <span class="SimpleMath">r</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ LinesOfStraightLineDecision</code>( <var class="Arg">prog</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: the list of lines that define the straight line decision.</p>
<p>This defining attribute for the straight line decision <var class="Arg">prog</var> (see <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>)) corresponds to <code class="func">LinesOfStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X81A8AFC47F8E4B91"><span class="RefLink">Reference: LinesOfStraightLineProgram</span></a>) for straight line programs.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ NrInputsOfStraightLineDecision</code>( <var class="Arg">prog</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: the number of inputs required for the straight line decision.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ScanStraightLineDecision</code>( <var class="Arg">string</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a record containing the straight line decision, or <code class="keyw">fail</code>.</p>
<p>Let <var class="Arg">string</var> be a string that encodes a straight line decision in the sense that it consists of the lines listed for <code class="func">ScanStraightLineProgram</code> (<a href="chap7.html#X7D6617E47B013A37"><span class="RefLink">7.4-1</span></a>), except that <code class="code">oup</code> lines are not allowed, and instead lines of the following form may occur.</p>
<dl>
<dt><strong class="Mark"><code class="code">chor </code><span class="SimpleMath">a</span> <span class="SimpleMath">b</span></strong></dt>
<dd><p>means that it is checked whether the order of the element at label <span class="SimpleMath">a</span> is <span class="SimpleMath">b</span>.</p>
</dd>
</dl>
<p><code class="func">ScanStraightLineDecision</code> returns a record containing as the value of its component <code class="code">program</code> the corresponding <strong class="pkg">GAP</strong> straight line decision (see <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>)) if the input string satisfies the syntax rules stated above, and returns <code class="keyw">fail</code> otherwise. In the latter case, information about the first corrupted line of the program is printed if the info level of <code class="func">InfoCMeatAxe</code> (<a href="chap7.html#X78601C3A87921E08"><span class="RefLink">7.1-2</span></a>) is at least <span class="SimpleMath">1</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ StraightLineDecision</code>( <var class="Arg">lines</var>[, <var class="Arg">nrgens</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ StraightLineDecisionNC</code>( <var class="Arg">lines</var>[, <var class="Arg">nrgens</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: the straight line decision given by the list of lines.</p>
<p>Let <var class="Arg">lines</var> be a list of lists that defines a unique straight line decision (see <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>)); in this case <code class="func">StraightLineDecision</code> returns this program, otherwise an error is signalled. The optional argument <var class="Arg">nrgens</var> specifies the number of input generators of the program; if a list of integers (a line of form 1. in the definition above) occurs in <var class="Arg">lines</var> then this number is not determined by <var class="Arg">lines</var> and therefore <em>must</em> be specified by the argument <var class="Arg">nrgens</var>; if not then <code class="func">StraightLineDecision</code> returns <code class="keyw">fail</code>.</p>
<p><code class="func">StraightLineDecisionNC</code> does the same as <code class="func">StraightLineDecision</code>, except that the internal consistency of the program is not checked.</p>
<p><code class="func">ResultOfStraightLineDecision</code> evaluates the straight line decision (see <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>)) <var class="Arg">prog</var> at the group elements in the list <var class="Arg">gens</var>.</p>
<p>The function for computing the order of a group element can be given as the optional argument <var class="Arg">orderfunc</var>. For example, this may be a function that gives up at a certain limit if one has to be aware of extremely huge orders in failure cases.</p>
<p>The <em>result</em> of a straight line decision with lines <span class="SimpleMath">p_1, p_2, ..., p_k</span> when applied to <var class="Arg">gens</var> is defined as follows.</p>
<dl>
<dt><strong class="Mark">(a)</strong></dt>
<dd><p>First a list <span class="SimpleMath">r</span> of intermediate values is initialized with a shallow copy of <var class="Arg">gens</var>.</p>
</dd>
<dt><strong class="Mark">(b)</strong></dt>
<dd><p>For <span class="SimpleMath">i ≤ k</span>, before the <span class="SimpleMath">i</span>-th step, let <span class="SimpleMath">r</span> be of length <span class="SimpleMath">n</span>. If <span class="SimpleMath">p_i</span> is the external representation of an associative word in the first <span class="SimpleMath">n</span> generators then the image of this word under the homomorphism that is given by mapping <span class="SimpleMath">r</span> to these first <span class="SimpleMath">n</span> generators is added to <span class="SimpleMath">r</span>. If <span class="SimpleMath">p_i</span> is a pair <span class="SimpleMath">[ l, j ]</span>, for a list <span class="SimpleMath">l</span>, then the same element is computed, but instead of being added to <span class="SimpleMath">r</span>, it replaces the <span class="SimpleMath">j</span>-th entry of <span class="SimpleMath">r</span>. If <span class="SimpleMath">p_i</span> is a triple <span class="SimpleMath">[</span><code class="code">"Order"</code><span class="SimpleMath">, i, n ]</span> then it is checked whether the order of <span class="SimpleMath">r[i]</span> is <span class="SimpleMath">n</span>; if not then <code class="keyw">false</code> is returned immediately.</p>
</dd>
<dt><strong class="Mark">(c)</strong></dt>
<dd><p>If all <span class="SimpleMath">k</span> lines have been processed and no order check has failed then <code class="keyw">true</code> is returned.</p>
<p>The above straight line decision <code class="code">dec</code> returns <code class="keyw">true</code> –for <em>any</em> input of the right length.</p>
<p>The above straight line decision admits two inputs; it tests whether the orders of the inputs are <span class="SimpleMath">2</span> and <span class="SimpleMath">3</span>, and the order of their product is <span class="SimpleMath">5</span>.</p>
<h5>6.1-7 <span class="Heading">Semi-Presentations and Presentations</span></h5>
<p>We can associate a <em>finitely presented group</em> <span class="SimpleMath">F / R</span> to each straight line decision <var class="Arg">dec</var>, say, as follows. The free generators of the free group <span class="SimpleMath">F</span> are in bijection with the inputs, and the defining relators generating <span class="SimpleMath">R</span> as a normal subgroup of <span class="SimpleMath">F</span> are given by those words <span class="SimpleMath">w^k</span> for which <var class="Arg">dec</var> contains a check whether the order of <span class="SimpleMath">w</span> equals <span class="SimpleMath">k</span>.</p>
<p>So if <var class="Arg">dec</var> returns <code class="keyw">true</code> for the input list <span class="SimpleMath">[ g_1, g_2, ..., g_n ]</span> then mapping the free generators of <span class="SimpleMath">F</span> to the inputs defines an epimorphism <span class="SimpleMath">Φ</span> from <span class="SimpleMath">F</span> to the group <span class="SimpleMath">G</span>, say, that is generated by these inputs, such that <span class="SimpleMath">R</span> is contained in the kernel of <span class="SimpleMath">Φ</span>.</p>
<p>(Note that <q>satisfying <var class="Arg">dec</var></q> is a stronger property than <q>satisfying a presentation</q>. For example, <span class="SimpleMath">⟨ x ∣ x^2 = x^3 = 1 ⟩</span> is a presentation for the trivial group, but the straight line decision that checks whether the order of <span class="SimpleMath">x</span> is both <span class="SimpleMath">2</span> and <span class="SimpleMath">3</span> clearly always returns <code class="keyw">false</code>.)</p>
<p><strong class="pkg">AtlasRep</strong> supports the following two kinds of straight line decisions.</p>
<ul>
<li><p>A <em>presentation</em> is a straight line decision <var class="Arg">dec</var> that is defined for a set of standard generators of a group <span class="SimpleMath">G</span> and that returns <code class="keyw">true</code> if and only if the list of inputs is in fact a sequence of such standard generators for <span class="SimpleMath">G</span>. In other words, the relators derived from the order checks in the way described above are defining relators for <span class="SimpleMath">G</span>, and moreover these relators are words in terms of standard generators. (In particular the kernel of the map <span class="SimpleMath">Φ</span> equals <span class="SimpleMath">R</span> whenever <var class="Arg">dec</var> returns <code class="keyw">true</code>.)</p>
</li>
<li><p>A <em>semi-presentation</em> is a straight line decision <var class="Arg">dec</var> that is defined for a set of standard generators of a group <span class="SimpleMath">G</span> and that returns <code class="keyw">true</code> for a list of inputs <em>that is known to generate a group isomorphic with <span class="SimpleMath">G</span></em> if and only if these inputs form in fact a sequence of standard generators for <span class="SimpleMath">G</span>. In other words, the relators derived from the order checks in the way described above are <em>not necessarily defining relators</em> for <span class="SimpleMath">G</span>, but if we assume that the <span class="SimpleMath">g_i</span> generate <span class="SimpleMath">G</span> then they are standard generators. (In particular, <span class="SimpleMath">F / R</span> may be a larger group than <span class="SimpleMath">G</span> but in this case <span class="SimpleMath">Φ</span> maps the free generators of <span class="SimpleMath">F</span> to standard generators of <span class="SimpleMath">G</span>.)</p>
<p>More about semi-presentations can be found in <a href="chapBib.html#biBNW05">[NW05]</a>.</p>
</li>
</ul>
<p>Available presentations and semi-presentations are listed by <code class="func">DisplayAtlasInfo</code> (<a href="chap3.html#X79DACFFA7E2D1A99"><span class="RefLink">3.5-1</span></a>), they can be accessed via <code class="func">AtlasProgram</code> (<a href="chap3.html#X801F2E657C8A79ED"><span class="RefLink">3.5-4</span></a>). (Clearly each presentation is also a semi-presentation. So a semi-presentation for some standard generators of a group is regarded as available whenever a presentation for these standard generators and this group is available.)</p>
<p>Note that different groups can have the same semi-presentation. We illustrate this with an example that is mentioned in <a href="chapBib.html#biBNW05">[NW05]</a>. The groups <span class="SimpleMath">L_2(7) ≅ L_3(2)</span> and <span class="SimpleMath">L_2(8)</span> are generated by elements of the orders <span class="SimpleMath">2</span> and <span class="SimpleMath">3</span> such that their product has order <span class="SimpleMath">7</span>, and no further conditions are necessary to define standard generators.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AsStraightLineDecision</code>( <var class="Arg">bbox</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: an equivalent straight line decision for the given black box program, or <code class="keyw">fail</code>.</p>
<p>For a black box program (see <code class="func">IsBBoxProgram</code> (<a href="chap6.html#X87CAF2DE870D0E3B"><span class="RefLink">6.2-1</span></a>)) <var class="Arg">bbox</var>, <code class="func">AsStraightLineDecision</code> returns a straight line decision (see <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>)) with the same output as <var class="Arg">bbox</var>, in the sense of <code class="func">AsBBoxProgram</code> (<a href="chap6.html#X826ACFE887E0B6B8"><span class="RefLink">6.2-5</span></a>), if such a straight line decision exists, and <code class="keyw">fail</code> otherwise.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ StraightLineProgramFromStraightLineDecision</code>( <var class="Arg">dec</var> )</td><td class="tdright">( operation )</td></tr></table></div>
<p>Returns: the straight line program associated to the given straight line decision.</p>
<p>For a straight line decision <var class="Arg">dec</var> (see <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>), <code class="func">StraightLineProgramFromStraightLineDecision</code> returns the straight line program (see <code class="func">IsStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X7F69FF3F7C6694CB"><span class="RefLink">Reference: IsStraightLineProgram</span></a>) obtained by replacing each line of type 3. (i.e, each order check) by an assignment of the power in question to a new slot, and by declaring the list of these elements as the return value.</p>
<p>This means that the return value describes exactly the defining relators of the presentation that is associated to the straight line decision, see <a href="chap6.html#X7C94ECAC8583CEAE"><span class="RefLink">6.1-7</span></a>.</p>
<p>For example, one can use the return value for printing the relators with <code class="func">StringOfResultOfStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X8098EAAF7D344466"><span class="RefLink">Reference: StringOfResultOfStraightLineProgram</span></a>), or for explicitly constructing the relators as words in terms of free generators, by applying <code class="func">ResultOfStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X7847D32B863E822F"><span class="RefLink">Reference: ResultOfStraightLineProgram</span></a>) to the program and to these generators.</p>
<p><em>Black box programs</em> formalize the idea that one takes some group elements, forms arithmetic expressions in terms of them, tests properties of these expressions, executes conditional statements (including jumps inside the program) depending on the results of these tests, and eventually returns some result.</p>
<p>A specification of the language can be found in <a href="chapBib.html#biBNic06">[Nic06]</a>, see also</p>
<p>The <em>inputs</em> of a black box program may be explicit group elements, and the program may also ask for random elements from a given group. The <em>program steps</em> form products, inverses, conjugates, commutators, etc. of known elements, <em>tests</em> concern essentially the orders of elements, and the <em>result</em> is a list of group elements or <code class="keyw">true</code> or <code class="keyw">false</code> or <code class="keyw">fail</code>.</p>
<p>Examples that can be modeled by black box programs are</p>
<dl>
<dt><strong class="Mark"><em>straight line programs</em>,</strong></dt>
<dd><p>which require a fixed number of input elements and form arithmetic expressions of elements but do not use random elements, tests, conditional statements and jumps; the return value is always a list of elements; these programs are described in Section <a href="../../../doc/ref/chap37.html#X7DC99E4284093FBB"><span class="RefLink">Reference: Straight Line Programs</span></a>.</p>
</dd>
<dt><strong class="Mark"><em>straight line decisions</em>,</strong></dt>
<dd><p>which differ from straight line programs only in the sense that also order tests are admissible, and that the return value is <code class="keyw">true</code> if all these tests are satisfied, and <code class="keyw">false</code> as soon as the first such test fails; they are described in Section <a href="chap6.html#X8121E9567A7137C9"><span class="RefLink">6.1</span></a>.</p>
</dd>
<dt><strong class="Mark"><em>scripts for finding standard generators</em>,</strong></dt>
<dd><p>which take a group and a function to generate a random element in this group but no explicit input elements, admit all control structures, and return either a list of standard generators or <code class="keyw">fail</code>; see <code class="func">ResultOfBBoxProgram</code> (<a href="chap6.html#X869BACFB80A3CC87"><span class="RefLink">6.2-4</span></a>) for examples.</p>
</dd>
</dl>
<p>In the case of general black box programs, currently <strong class="pkg">GAP</strong> provides only the possibility to read an existing program via <code class="func">ScanBBoxProgram</code> (<a href="chap6.html#X7EA20532868F9863"><span class="RefLink">6.2-2</span></a>), and to run the program using <code class="func">RunBBoxProgram</code> (<a href="chap6.html#X7D211A5D8602B330"><span class="RefLink">6.2-3</span></a>). It is not our aim to write such programs in <strong class="pkg">GAP</strong>.</p>
<p>The special case of the <q>find</q> scripts mentioned above is also admissible as an argument of <code class="func">ResultOfBBoxProgram</code> (<a href="chap6.html#X869BACFB80A3CC87"><span class="RefLink">6.2-4</span></a>), which returns either the set of found generators or <code class="keyw">fail</code>.</p>
<p>Contrary to the general situation, more support is provided for straight line programs and straight line decisions in <strong class="pkg">GAP</strong>, see Section <a href="../../../doc/ref/chap37.html#X7DC99E4284093FBB"><span class="RefLink">Reference: Straight Line Programs</span></a> for functions that manipulate them (compose, restrict etc.).</p>
<p>The functions <code class="func">AsStraightLineProgram</code> (<a href="chap6.html#X7D36DFA87C8B2C48"><span class="RefLink">6.2-6</span></a>) and <code class="func">AsStraightLineDecision</code> (<a href="chap6.html#X7C13D08C7D55E20A"><span class="RefLink">6.1-8</span></a>) can be used to transform a general black box program object into a straight line program or a straight line decision if this is possible.</p>
<p>Conversely, one can create an equivalent general black box program from a straight line program or from a straight line decision with <code class="func">AsBBoxProgram</code> (<a href="chap6.html#X826ACFE887E0B6B8"><span class="RefLink">6.2-5</span></a>).</p>
<p>Computing a straight line program related to a given straight line decision is supported in the sense of <code class="func">StraightLineProgramFromStraightLineDecision</code> (<a href="chap6.html#X7EA613C57DDC67D5"><span class="RefLink">6.1-9</span></a>).</p>
<p>Note that none of these three kinds of objects is a special case of another: Running a black box program with <code class="func">RunBBoxProgram</code> (<a href="chap6.html#X7D211A5D8602B330"><span class="RefLink">6.2-3</span></a>) yields a record, running a straight line program with <code class="func">ResultOfStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X7847D32B863E822F"><span class="RefLink">Reference: ResultOfStraightLineProgram</span></a>) yields a list of elements, and running a straight line decision with <code class="func">ResultOfStraightLineDecision</code> (<a href="chap6.html#X7E7B328A84685480"><span class="RefLink">6.1-6</span></a>) yields <code class="keyw">true</code> or <code class="keyw">false</code>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ScanBBoxProgram</code>( <var class="Arg">string</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a record containing the black box program encoded by the input string, or <code class="keyw">fail</code>.</p>
<p>For a string <var class="Arg">string</var> that describes a black box program, e.g., the return value of <code class="func">StringFile</code> (<a href="../../../pkg/gapdoc/doc/chap6.html#X7E14D32181FBC3C3"><span class="RefLink">GAPDoc: StringFile</span></a>), <code class="func">ScanBBoxProgram</code> computes this black box program. If this is successful then the return value is a record containing as the value of its component <code class="code">program</code> the corresponding <strong class="pkg">GAP</strong> object that represents the program, otherwise <code class="keyw">fail</code> is returned.</p>
<p>As the first example, we construct a black box program that tries to find standard generators for the alternating group <span class="SimpleMath">A_5</span>; these standard generators are any pair of elements of the orders <span class="SimpleMath">2</span> and <span class="SimpleMath">3</span>, respectively, such that their product has order <span class="SimpleMath">5</span>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">findstr:= "\
<span class="GAPprompt">></span> <span class="GAPinput"> set V 0\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput">lbl START1\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> rand 1\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> ord 1 A\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> incr V\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if V gt 100 then timeout\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if A notin 1 2 3 5 then fail\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if A noteq 2 then jmp START1\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput">lbl START2\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> rand 2\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> ord 2 B\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> incr V\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if V gt 100 then timeout\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if B notin 1 2 3 5 then fail\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if B noteq 3 then jmp START2\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> # The elements 1 and 2 have the orders 2 and 3, respectively.\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> set X 0\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput">lbl CONJ\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> incr X\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if X gt 100 then timeout\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> rand 3\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> cjr 2 3\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> mu 1 2 4 # ab\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> ord 4 C\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if C notin 2 3 5 then fail\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> if C noteq 5 then jmp CONJ\n\</span>
<span class="GAPprompt">></span> <span class="GAPinput"> oup 2 1 2";;
<span class="GAPprompt">gap></span> <span class="GAPinput">find:= ScanBBoxProgram( findstr );</span>
rec( program := <black box program> )
</pre></div>
<p>The second example is a black box program that checks whether its two inputs are standard generators for <span class="SimpleMath">A_5</span>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ RunBBoxProgram</code>( <var class="Arg">prog</var>, <var class="Arg">G</var>, <var class="Arg">input</var>, <var class="Arg">options</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a record describing the result and the statistics of running the black box program <var class="Arg">prog</var>, or <code class="keyw">fail</code>, or the string <code class="code">"timeout"</code>.</p>
<p>For a black box program <var class="Arg">prog</var>, a group <var class="Arg">G</var>, a list <var class="Arg">input</var> of group elements, and a record <var class="Arg">options</var>, <code class="func">RunBBoxProgram</code> applies <var class="Arg">prog</var> to <var class="Arg">input</var>, where <var class="Arg">G</var> is used only to compute random elements.</p>
<p>The return value is <code class="keyw">fail</code> if a syntax error or an explicit <code class="code">fail</code> statement is reached at runtime, and the string <code class="code">"timeout"</code> if a <code class="code">timeout</code> statement is reached. (The latter might mean that the random choices were unlucky.) Otherwise a record with the following components is returned.</p>
<dl>
<dt><strong class="Mark"><code class="code">gens</code></strong></dt>
<dd><p>a list of group elements, bound if an <code class="code">oup</code> statement was reached,</p>
</dd>
<dt><strong class="Mark"><code class="code">result</code></strong></dt>
<dd><p><code class="keyw">true</code> if a <code class="code">true</code> statement was reached, <codeclass="keyw">false</code> if either a <code class="code">false</code> statement or a failed order check was reached,</p>
</dd>
</dl>
<p>The other components serve as statistical information about the numbers of the various operations (<code class="code">multiply</code>, <code class="code">invert</code>, <code class="code">power</code>, <code class="code">order</code>, <code class="code">random</code>, <code class="code">conjugate</code>, <code class="code">conjugateinplace</code>, <code class="code">commutator</code>), and the runtime in milliseconds (<code class="code">timetaken</code>).</p>
<p>The following components of <var class="Arg">options</var> are supported.</p>
<dl>
<dt><strong class="Mark"><code class="code">randomfunction</code></strong></dt>
<dd><p>the function called with argument <var class="Arg">G</var> in order to compute a random element of <var class="Arg">G</var> (default <code class="func">PseudoRandom</code> (<a href="../../../doc/ref/chap30.html#X811B5BD47DC5356B"><span class="RefLink">Reference: PseudoRandom</span></a>))</p>
</dd>
<dt><strong class="Mark"><code class="code">orderfunction</code></strong></dt>
<dd><p>the function for computing element orders (default <code class="func">Order</code> (<a href="../../../doc/ref/chap31.html#X84F59A2687C62763"><span class="RefLink">Reference: Order</span></a>)),</p>
</dd>
<dt><strong class="Mark"><code class="code">verbose</code></strong></dt>
<dd><p>if <code class="keyw">true</code> then print information about the line that is currently processed, and about order checks (default <code class="keyw">false</code>),</p>
</dd>
<dt><strong class="Mark"><code class="code">allowbreaks</code></strong></dt>
<dd><p>if <code class="keyw">true</code> then call <code class="func">Error</code> (<a href="../../../doc/ref/chap6.html#X7E7AD8D87EBA1A08"><span class="RefLink">Reference: Error</span></a>) when a <code class="code">break</code> statement is reached, otherwise ignore <code class="code">break</code> statements (default <code class="keyw">true</code>).</p>
</dd>
</dl>
<p>As an example, we run the black box programs constructed in the example for <code class="func">ScanBBoxProgram</code> (<a href="chap6.html#X7EA20532868F9863"><span class="RefLink">6.2-2</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ResultOfBBoxProgram</code>( <var class="Arg">prog</var>, <var class="Arg">G</var>[, <var class="Arg">options</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a list of group elements or <code class="keyw">true</code>, <code class="keyw">false</code>, <code class="keyw">fail</code>, or the string <code class="code">"timeout"</code>.</p>
<p>This function calls <code class="func">RunBBoxProgram</code> (<a href="chap6.html#X7D211A5D8602B330"><span class="RefLink">6.2-3</span></a>) with the black box program <var class="Arg">prog</var> and second argument either a group or a list of group elements; if <var class="Arg">options</var> is not given then the default options of <code class="func">RunBBoxProgram</code> (<a href="chap6.html#X7D211A5D8602B330"><span class="RefLink">6.2-3</span></a>) are assumed. The return value is <code class="keyw">fail</code> if this call yields <code class="keyw">fail</code>, otherwise the <code class="code">gens</code> component of the result, if bound, or the <code class="code">result</code> component if not.</p>
<p>Note that a <em>group</em> <var class="Arg">G</var> is used as the second argument in the call of <code class="func">RunBBoxProgram</code> (<a href="chap6.html#X7D211A5D8602B330"><span class="RefLink">6.2-3</span></a>) (the source for random elements), whereas a <em>list</em> <var class="Arg">G</var> is used as the third argument (the inputs).</p>
<p>As an example, we run the black box programs constructed in the example for <code class="func">ScanBBoxProgram</code> (<a href="chap6.html#X7EA20532868F9863"><span class="RefLink">6.2-2</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AsBBoxProgram</code>( <var class="Arg">slp</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: an equivalent black box program for the given straight line program or straight line decision.</p>
<p>Let <var class="Arg">slp</var> be a straight line program (see <code class="func">IsStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X7F69FF3F7C6694CB"><span class="RefLink">Reference: IsStraightLineProgram</span></a>)) or a straight line decision (see <code class="func">IsStraightLineDecision</code> (<a href="chap6.html#X8787E2EC7DB85A89"><span class="RefLink">6.1-1</span></a>)). Then <code class="func">AsBBoxProgram</code> returns a black box program <var class="Arg">bbox</var> (see <code class="func">IsBBoxProgram</code> (<a href="chap6.html#X87CAF2DE870D0E3B"><span class="RefLink">6.2-1</span></a>)) with the <q>same</q> output as <var class="Arg">slp</var>, in the sense that <code class="func">ResultOfBBoxProgram</code> (<a href="chap6.html#X869BACFB80A3CC87"><span class="RefLink">6.2-4</span></a>) yields the same result for <var class="Arg">bbox</var> as <code class="func">ResultOfStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X7847D32B863E822F"><span class="RefLink">Reference: ResultOfStraightLineProgram</span></a>) or <code class="func">ResultOfStraightLineDecision</code> (<a href="chap6.html#X7E7B328A84685480"><span class="RefLink">6.1-6</span></a>), respectively, for <var class="Arg">slp</var>.</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ AsStraightLineProgram</code>( <var class="Arg">bbox</var> )</td><td class="tdright">( attribute )</td></tr></table></div>
<p>Returns: an equivalent straight line program for the given black box program, or <code class="keyw">fail</code>.</p>
<p>For a black box program (see <code class="func">AsBBoxProgram</code> (<a href="chap6.html#X826ACFE887E0B6B8"><span class="RefLink">6.2-5</span></a>)) <var class="Arg">bbox</var>, <code class="func">AsStraightLineProgram</code> returns a straight line program (see <code class="func">IsStraightLineProgram</code> (<a href="../../../doc/ref/chap37.html#X7F69FF3F7C6694CB"><span class="RefLink">Reference: IsStraightLineProgram</span></a>)) with the same output as <var class="Arg">bbox</var> if such a straight line program exists, and <code class="keyw">fail</code> otherwise.</p>
<h4>6.3 <span class="Heading">Representations of Minimal Degree</span></h4>
<p>This section deals with minimal degrees of permutation and matrix representations. We do not provide an algorithm that computes these degrees for an arbitrary group, we only provide some tools for evaluating known databases, mainly concerning <q>bicyclic extensions</q> (see <a href="chapBib.html#biBCCN85">[CCN+85, Section 6.5]</a>) of simple groups, in order to derive the minimal degrees, see Section <a href="chap6.html#X7FC33DFF8481F8D1"><span class="RefLink">6.3-4</span></a>.</p>
<p>In the <strong class="pkg">AtlasRep</strong> package, this information can be used for prescribing <q>minimality conditions</q> in <code class="func">DisplayAtlasInfo</code> (<a href="chap3.html#X79DACFFA7E2D1A99"><span class="RefLink">3.5-1</span></a>), <code class="func">OneAtlasGeneratingSetInfo</code> (<a href="chap3.html#X841478AB7CD06D44"><span class="RefLink">3.5-6</span></a>), and <code class="func">AllAtlasGeneratingSetInfos</code> (<a href="chap3.html#X84C2D76482E60E42"><span class="RefLink">3.5-7</span></a>). An overview of the stored minimal degrees can be shown with <code class="func">BrowseMinimalDegrees</code> (<a href="chap3.html#X7F31A7CB841FE63F"><span class="RefLink">3.6-1</span></a>).</p>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MinimalRepresentationInfo</code>( <var class="Arg">grpname</var>, <var class="Arg">conditions</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Returns: a record with the components <code class="code">value</code> and <code class="code">source</code>, or <code class="keyw">fail</code></p>
<p>Let <var class="Arg">grpname</var> be the <strong class="pkg">GAP</strong> name of a group <span class="SimpleMath">G</span>, say. If the information described by <var class="Arg">conditions</var> about minimal representations of this group can be computed or is stored then <code class="func">MinimalRepresentationInfo</code> returns a record with the components <code class="code">value</code> and <code class="code">source</code>, otherwise <code class="keyw">fail</code> is returned.</p>
<p>The following values for <var class="Arg">conditions</var> are supported.</p>
<ul>
<li><p>If <var class="Arg">conditions</var> is <code class="func">NrMovedPoints</code> (<a href="../../../doc/ref/chap42.html#X85E7B1E28430F49E"><span class="RefLink">Reference: NrMovedPoints for a permutation</span></a>) then <code class="code">value</code>, if known, is the degree of a minimal faithful (not necessarily transitive) permutation representation for <span class="SimpleMath">G</span>.</p>
</li>
<li><p>If <var class="Arg">conditions</var> consists of <code class="func">Characteristic</code> (<a href="../../../doc/ref/chap31.html#X81278E53800BF64D"><span class="RefLink">Reference: Characteristic</span></a>) and a prime integer <var class="Arg">p</var> then <code class="code">value</code>, if known, is the dimension of a minimal faithful (not necessarily irreducible) matrix representation in characteristic <var class="Arg">p</var> for <span class="SimpleMath">G</span>.</p>
</li>
<li><p>If <var class="Arg">conditions</var> consists of <code class="func">Size</code> (<a href="../../../doc/ref/chap30.html#X858ADA3B7A684421"><span class="RefLink">Reference: Size</span></a>) and a prime power <var class="Arg">q</var> then <code class="code">value</code>, if known, is the dimension of a minimal faithful (not necessarily irreducible) matrix representation over the field of size <var class="Arg">q</var> for <span class="SimpleMath">G</span>.</p>
</li>
</ul>
<p>In all cases, the value of the component <code class="code">source</code> is a list of strings that describe sources of the information, which can be the ordinary or modular character table of <span class="SimpleMath">G</span> (see <a href="chapBib.html#biBCCN85">[CCN+85]</a>, <a href="chapBib.html#biBJLPW95">[JLPW95]</a>, <a href="chapBib.html#biBHL89">[HL89]</a>), the table of marks of <span class="SimpleMath">G</span>, or <a href="chapBib.html#biBJan05">[Jan05]</a>. For an overview of minimal degrees of faithful matrix representations for sporadic simple groups and their covering groups, see also</p>
<p>Note that <code class="func">MinimalRepresentationInfo</code> cannot provide any information about minimal representations over prescribed fields in characteristic zero.</p>
<p>Information about groups that occur in the <strong class="pkg">AtlasRep</strong> package is precomputed in <code class="func">MinimalRepresentationInfoData</code> (<a href="chap6.html#X7E1B76DC86A8C405"><span class="RefLink">6.3-2</span></a>), so the packages <strong class="pkg">CTblLib</strong> and <strong class="pkg">TomLib</strong> are not needed when <code class="func">MinimalRepresentationInfo</code> is called for these groups. (The only case that is not covered by this list is that one asks for the minimal degree of matrix representations over a prescribed field in characteristic coprime to the group order.)</p>
<p>One of the following strings can be given as an additional last argument.</p>
<dl>
<dt><strong class="Mark"><code class="code">"cache"</code></strong></dt>
<dd><p>means that the function tries to compute (and then store) values that are not stored in <code class="func">MinimalRepresentationInfoData</code> (<a href="chap6.html#X7E1B76DC86A8C405"><span class="RefLink">6.3-2</span></a>), but stored values are preferred; this is also the default.</p>
</dd>
<dt><strong class="Mark"><code class="code">"lookup"</code></strong></dt>
<dd><p>means that stored values are returned but the function does not attempt to compute values that are not stored in <code class="func">MinimalRepresentationInfoData</code> (<a href="chap6.html#X7E1B76DC86A8C405"><span class="RefLink">6.3-2</span></a>).</p>
</dd>
<dt><strong class="Mark"><code class="code">"recompute"</code></strong></dt>
<dd><p>means that the function always tries to compute the desired value, and checks the result against stored values.</p>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.