[GAP Forum] GAP's type hierarchy

Alexander Konovalov alexk at mcs.st-andrews.ac.uk
Thu Feb 23 22:30:18 GMT 2012


Dear Grigory, dear Forum,

Reading fresh post by Frank, I've recollected that the next message was never answered in the forum:

On 10 Aug 2011, at 08:37, Grigory Sarnitskiy wrote:

> Hello! I've never used GAP but I heard it's uses some kind of hierarchy to represent mathematical structures. I'm trying to collect information of such hierarchies in various computer algebra system's and languages.
> 
> I would like to find a graph representing the GAP's hierarchy. For example Axiom's graph of its math categories is http://ubuntuone.com/p/19TT/ (although it is not complete and categories' names are abbreviated) and the graph of Haskell's basic algebra library is http://ubuntuone.com/p/19TS/.
> 
> And does anybody knows the same thing for MAGMA?  MAGMA is not very open and I couldn't find a mailing list or a forum for its  users to ask the question.

Unless anyone has another suggestion of utility function for doing this 
systematically, my advise would be to grep for all "DeclareCategory" and 
"DeclareCategoryKernel" statements to get an overview of categories
declared in the GAP library:

$ cd gap4r4/lib/
$ grep "DeclareCategoryKernel(" *
boolean.g:DeclareCategoryKernel( "IsBool", IsObject, IS_BOOL );
cyclotom.g:DeclareCategoryKernel( "IsCyc", IsCyclotomic, IS_CYC );
cyclotom.g:DeclareCategoryKernel( "IsRat", IsCyc, IS_RAT );
cyclotom.g:DeclareCategoryKernel( "IsInt", IsRat, IS_INT );
...
record.g:DeclareCategoryKernel( "IsRecord", IsObject, IS_REC );
string.g:DeclareCategoryKernel( "IsString", IsHomogeneousList, IS_STRING );
type.g:#F  DeclareCategoryKernel( <name>, <super>, <filter> )  create a new category
wpobj.gd:DeclareCategoryKernel( "IsWeakPointerObject",

and

$ grep "DeclareCategory(" *
addcoset.gd:DeclareCategory( "IsAdditiveCoset",
addmagma.gd:DeclareCategory( "IsNearAdditiveMagma",
addmagma.gd:DeclareCategory( "IsNearAdditiveMagmaWithZero",
addmagma.gd:DeclareCategory( "IsNearAdditiveGroup",
...
rwspcgrp.gd:DeclareCategory(
semiquo.gd:DeclareCategory("IsQuotientSemigroup", IsSemigroup);
...
zmodnz.gd:DeclareCategory( "IsZmodnZObj", IsScalar );
zmodnz.gd:DeclareCategory( "IsZmodnZObjNonprime", IsZmodnZObj );
zmodnz.gd:DeclareCategory( "IsZmodpZObjSmall", IsZmodpZObj );
zmodnz.gd:DeclareCategory( "IsZmodpZObjLarge", IsZmodpZObj );

In some places, you will need to look on one or more lines following 
the line with the declaration command. Note, however, that:

- this list contains both documented and undocumented categories;

- it contains both categories for different mathematical objects
 (e.g. IsNearAdditiveMagma, IsAlgebraicExtension) and for GAP 
 objects and data structures (e.g. IsRecord, IsOperation);

- GAP is extendable, so GAP packages (see 'pkg' subdirectory) may create 
 even more categories.

- you may find some more categories in the GAP 4.5 release coming soon.

Hope this is still actual, sorry for not getting back earlier.

Best wishes, 
Alexander


More information about the Forum mailing list