#############################################################################
##
#W  tmadmin.tmd          GAP table of marks library           Thomas Merkwitz
##
#H  @(#)$Id: tmadmin.tmd,v 1.5 2003/10/30 08:03:15 gap Exp $
##
#Y  Copyright (C)  1997,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
##
##  This file contains the declarations of all functions and variables to
##  handle the table of marks library.
##
Revision.( "tomlib/gap/tmadmin_tmd" ) :=
    "@(#)$Id: tmadmin.tmd,v 1.5 2003/10/30 08:03:15 gap Exp $";


#############################################################################
##
#V  LIBTOMKNOWN
##
##  `LIBTOMKNOWN' is a record that controls the loading of data files of the
##  {\GAP} library of tables of marks.
##  It has the following components.
##  \beginitems
##  `ACTUAL' &
##      the name of the file to be read at the moment
##      (is set by `SetActualLibFileName'),
##
##  `LOADSTATUS' &
##      a record whose components are names of files in the library of
##      tables of marks,
##      with value a list whose first entry is one of `"loaded"',
##      `"unloaded"', `"userloaded"' and whose second entry is an integer
##      that controls when the corresponding tables of marks can be removed
##      from {\GAP},
##
##  `MAX' &
##      {\GAP} remembers at most `MAX' of the previously loaded library
##      files (the default value is $10$),
##
##  `UNLOAD' &
##      is it allowed to remove previously loaded library files
##      (is set to `true' by default),
##
##  `STDGEN' &
##      a list describing standard generators of almost simple groups in the
##      table of marks library.
##  \enditems
##
##  Additionally the names of the files already loaded occur as components of
##  `LIBTOMKNOWN';
##  the corresponding values are given by the data of the files.
##
BindGlobal( "LIBTOMKNOWN", rec() );
LIBTOMKNOWN.LOADSTATUS := rec();
LIBTOMKNOWN.UNLOAD := true;
LIBTOMKNOWN.MAX := 10;


#############################################################################
##
#R  IsLibTomRep
##
##  Library tables of marks have their own representation.
#T  what does this mean?
##
DeclareRepresentation("IsLibTomRep", IsAttributeStoringRep,["sortperm"]);


#############################################################################
##
##  We replace the library function `TableOfMarksFromLibrary' that just
##  issues a warning about nonavailability of the Tables Of Marks Library.
##
MakeReadWriteGlobal( "TableOfMarksFromLibrary" );
UNBIND_GLOBAL( "TableOfMarksFromLibrary" );


#############################################################################
##
#F  TableOfMarksFromLibrary( <string> )
##
##  returns the table of marks with name <string>.
##
DeclareGlobalFunction( "TableOfMarksFromLibrary" );


#############################################################################
##
#F  ConvertToLibTom( <record> )
##
##  `ConvertToLibTom' converts a record with components from
##  `TableOfMarksComponents' into a library table of marks object with the
##  corresponding attribute values set.
##
DeclareGlobalFunction( "ConvertToLibTom" );


#############################################################################
##
#F  SetActualLibFileName( <filename> )
##
DeclareGlobalFunction( "SetActualLibFileName" );


#############################################################################
##
#F  LIBTOM( <arg> )
#F  AFLT( <source>, <destination>, <fusion> )
#F  ACLT( <identifier>, <component>, <value> )
##
##  The library format of library table of marks is a call to the function
##  `LIBTOM', with the arguments sorted as in `TableOfMarksComponents'
##  (see~"TableOfMarksComponents").
##
##  `AFLT' adds a fusion map <value> from the table of marks with name
##  <source> to the table of marks with name <destination>.
##  The fusion map is a list of positive integers, storing at position $i$
##  the position of the class in <destination> that contains the subgroups
##  in the $i$-th class of <source>.
##
##  `ACLT' adds the value <value> of a component with name <component> to the
##  table of marks with identifier value <identifier> in the library of
##  tables of marks.
##
DeclareGlobalFunction( "LIBTOM" );
DeclareGlobalFunction( "AFLT" );
DeclareGlobalFunction( "ACLT" );


#############################################################################
##
#F  MakeLIBTOMLIST()
##
DeclareGlobalFunction( "MakeLIBTOMLIST" );


#############################################################################
##
#F  AllLibTomNames()
##
##  returns the list containing all names of available library tables of
##  marks.
##
DeclareGlobalFunction( "AllLibTomNames" );


#############################################################################
##
#A  NamesLibTom( <string> )
#A  NamesLibTom( <tom> )
##
##  all names of the library table <tom> or of the library table with
##  name <string>
##
DeclareAttribute( "NamesLibTom", IsTableOfMarks and IsLibTomRep );
DeclareAttribute( "NamesLibTom", IsString );


#############################################################################
##
#A  NotifiedFusionsOfLibTom( <tom> )
#A  NotifiedFusionsOfLibTom( <string> )
#A  FusionsOfLibTom( <tom> )
#A  FusionsOfLibTom( <string> )
##
##  Are there any fusions from the library table of marks <tom> or  the
##  table of marks with name <string> into other liberary tables  marks?
##
##  `NotifiedFusionsOfLibTom' returns the names of all such tables of marks.
##  `FusionsOfLibTom' returns the complete fusion maps. Therefore the
##  corresponding library file has to be loaded.
##
DeclareAttribute( "NotifiedFusionsOfLibTom",
    IsTableOfMarks and IsLibTomRep );
DeclareAttribute( "NotifiedFusionsOfLibTom", IsString );

DeclareAttribute( "FusionsOfLibTom", IsTableOfMarks and IsLibTomRep );
DeclareAttribute( "FusionsOfLibTom", IsString );
#T what is the difference to `FusionsTom'?


#############################################################################
##
#A  NotifiedFusionsToLibTom( <tom> )
#A  NotifiedFusionsToLibTom( <string> )
#A  FusionsToLibTom( <tom> )
#A  FusionsToLibTom( <string> )
##
##  Are there any fusions from other library table of marks to <tom> or the
##  table of marks with name <string>.
##
##  `NofifiedFusionsToLibTom' returns the names of all such tables of marks.
##  `FusionsToLibTom' returns the complete fusion maps.
##  For that, the correponding library files have to be loaded.
##
DeclareAttribute( "NotifiedFusionsToLibTom",
    IsTableOfMarks and IsLibTomRep );
DeclareAttribute( "NotifiedFusionsToLibTom", IsString );
#T replace this by `NamesOfFusionSources'!!

DeclareAttribute( "FusionsToLibTom", IsTableOfMarks and IsLibTomRep );
DeclareAttribute( "FusionsToLibTom", IsString );


#############################################################################
##
#E

