[GAP Forum] Find the source for <Attribute> in GAP
Stephen Linton
sl4 at st-andrews.ac.uk
Wed Jan 6 09:45:00 GMT 2016
Dear Gaurav,
Attributes are just like Operations, and you can use ApplicableMethod in the same way. A good example is Size:
gap> g := Group((1,2,3,4,5),(1,5)(2,4));
Group([ (1,2,3,4,5), (1,5)(2,4) ])
gap> ApplicableMethod(Size,[g]);
function( G ) ... end
gap> Print(last);
function ( G )
return SizeStabChain( StabChainMutable( G ) );
end
However, there is one complication, which is that once an Attribute has been computed the value is often stored in which case the
method changes to one that just recovers the stored value:
gap> Size(g);
10
gap> ApplicableMethod(Size,[g]);
function( object ) ... end
gap> Print(last);
function ( object )
<<kernel or compiled code>>
end
gap>
Stabilizer, however is not itself an attribute and is rather more complicated. See:
http://www.gap-system.org/Manuals/doc/ref/chap41.html#X797BD60E7ACEF1B1
and also section 41.12 a bit further down.
It doesn’t make sense to ask simply about the Stabilizer of a group — you also have to specify an object to be
stabilised and an action of the group and the call goes through a number of functions that fill in missing arguments and detect special cases before eventually reaching a call of StabilizerOp or StabilizerOfExternalSet where the work is really done.
Steve
> On 6 Jan 2016, at 05:29, Gaurav Dhingra <axyd0000 at gmail.com> wrote:
>
> Hi GAP members
>
> I asked previously
> http://math.stackexchange.com/questions/1570893/which-algorithm-gap-uses-to-check-equality-of-two-groups
> for finding the source of an "operation" in GAP. Also there is already an
> answer for finding the source of a "function" in GAP.
>
> My question is how to find the source of an "Attribute" in GAP?
> For ex. i want to find the Algorithm for finding the `stabilizer` of a
> `SymmetricGroup`
>
> gap> s4:=SymmetricGroup(4);
> Sym( [ 1 .. 4 ] )
> gap> Stabilizer;
> function( arg ) ... end
> gap> StabilizerOfExternalSet; # this is used for SymmetricGroup in
> particular
> <Attribute "StabilizerOfExternalSet">
> gap> func:=ApplicableMethod(StabilizerOfExternalSet, [s4]);
> fail
> gap>
>
> It fails. Is there another method instead of using `ApplicableMethod`?
> Above i used `StabilizerOfExternalSet` after seeing the source code for
> `Stabilizer`.
>
> Gaurav Dhingra
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
More information about the Forum
mailing list