[GAP Forum] Is there a simple way to view the source of the function (ex. IsSolvable)?

Stephen Linton steve.linton at st-andrews.ac.uk
Tue Sep 16 22:53:50 BST 2014


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).

	Steve



On 16 Sep 2014, at 22:29, buynnnmmm1 at yahoo.co.jp wrote:

> Dear GAP forum,
> 
> Because I would like to read the source of IsSolvable function, I was able to find by looking at the source of GAP4 using grep.
> 
> Source of IsSolvable is defined in the "lib/grp.gi" and "lib/grp.gd".
> Noticing that easy to find if grep function name the files whose name ends with .gd, and went to examine the function So who is called from IsSolved function. ( DerivedSeries, DerivedSubgroup, ClosureSubgroupNC, ClosureGroup, NormalClosure, TrivialSubgroup ,Comm ....)
> 
> 
> However, this procedure is troublesome. 
> 
> 
> I tried looking for using the http://www.gap-system.org/search.html the reference manual.
> 
> I found FilenameFunc function in http://www.gap-system.org/Manuals/doc/ref/chap5.html.
> 
> But I got following output.
> 
> gap> FilenameFunc(IsSolvable);
> fail
> 
> So, I would like to know how to see source of functions (ex. IsSolvable) more easier.
> Or I would like to know how to get path of the file the function has been defined.
> 
> Does anyone have any idea how I can do it more easizer.
> 
> 
> With best regards
> 
> 
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum




More information about the Forum mailing list