Dear Stefan Kohl, It's wonderful! It's great! Thank you very much for your help!
P.S. I resent same e-mail, because I forgot cc:. With best regards ----- Original Message ----- > From: Stefan Kohl <ste...@mcs.st-and.ac.uk> > To: Stephen Linton <steve.lin...@st-andrews.ac.uk> > Cc: buynnnm...@yahoo.co.jp; supp...@gap-system.org > Date: 2014/9/17, Wed 08:05 > Subject: Re: [GAP Forum] Is there a simple way to view the source of the > function (ex. IsSolvable)? > > On Tue, September 16, 2014 10:53 pm, Stephen Linton wrote: >> The thing is that IsSolvable is not really a single function, it is an > Operation. >> >> An Operation in GAP is a collection of functions called Methods that can be > used to >> compute the result for different kinds of objects. >> >> You can get the actual Method applied to particular objects via > “ApplicableMethod”. For >> instance: >> >> gap> g := SymmetricGroup(5); >> Sym( [ 1 .. 5 ] ) >> gap> ApplicableMethod(IsSolvableGroup,[g]); >> function( G ) ... end >> gap> f := last; >> function( G ) ... end >> gap> Print(f); >> function ( G ) >> local pcgs; >> pcgs := TryPcgsPermGroup( G, false, false, true ); >> if IsPcgs( pcgs ) then >> SetIndicesEANormalSteps( pcgs, pcgs!.permpcgsNormalSteps ); >> SetIsPcgsElementaryAbelianSeries( pcgs, true ); >> if not HasPcgs( G ) then >> SetPcgs( G, pcgs ); >> fi; >> if not HasPcgsElementaryAbelianSeries( G ) then >> SetPcgsElementaryAbelianSeries( G, pcgs ); >> fi; >> return true; >> else >> return false; >> fi; >> return; >> end >> gap> FilenameFunc(f); >> "/Users/sal/HG/gap/lib/grpperm.gi" >> gap> StartlineFunc(f); >> 1221 >> >> So the Method that would apply to this particular group is found in > grpperm.gi starting >> at line 1221 (in my development version of GAP). > > A slightly more direct approach is with PageSource: > > gap> PageSource(ApplicableMethod(IsSolvableGroup,[SymmetricGroup(5)])); > Showing source in /cygdrive/c/GAP/GAP4R7/lib/grpperm.gi (from line 1216) > ############################################################################# > ## > #M IsSolvableGroup( <G> ) . . . . . . . . . . . . . . . . solvability > test > ## > InstallMethod( IsSolvableGroup,"for permgrp", true, [ IsPermGroup ], > 0, > function(G) > local pcgs; > pcgs:=TryPcgsPermGroup( G, false, false, true ); > if IsPcgs(pcgs) then > SetIndicesEANormalSteps(pcgs,pcgs!.permpcgsNormalSteps); > SetIsPcgsElementaryAbelianSeries(pcgs,true); > if not HasPcgs(G) then > SetPcgs(G,pcgs); > fi; > if not HasPcgsElementaryAbelianSeries(G) then > SetPcgsElementaryAbelianSeries(G,pcgs); > fi; > return true; > else > return false; > fi; > end); > > Stefan > _______________________________________________ Forum mailing list Forum@mail.gap-system.org http://mail.gap-system.org/mailman/listinfo/forum