##############################################################################
##
#W  gpd.gd                     Gpd Package                       Chris Wensley
#W                                                                & Emma Moore
##
##  Declaration file for functions in the Gpd package.
##
#H  @(#)$Id: gpd.gd,v 1.02 2007/06/18 gap Exp $
##
#Y  Copyright (C) 1999,2001 University of St. Andrews, North Haugh,
#Y                          St. Andrews, Fife KY16 9SS, Scotland
##
Revision.("gpd/gap/gpd_gd") := 
   "@(#)$Id: gpd.gd,v 1.02 2007/06/18 gap Exp $";

#############################################################################
##
#V  InfoGpd
##
DeclareInfoClass( "InfoGpd" );

############################################################################## 
## 
#P  IsMathCat( <obj> )
#P  IsGroupoid( <gpd> )                
#P  IsConnectedGroupoid( <gpd> ) 
#P  IsGroupoidWithConstantGroup( <gpd> )
## 
##  A groupoid can be various things.
## 
DeclareProperty( "IsMathCat", IsDomain and IsMultiplicativeElementCollection );
DeclareProperty( "IsGroupoid", IsMathCat and
    IsMultiplicativeElementWithInverseCollection ); 
DeclareProperty( "IsConnectedGroupoid", IsGroupoid );  
DeclareProperty( "IsGroupoidWithConstantGroup", IsGroupoid );

############################################################################# 
## 
#A  ObjectsOfGroupoid( <gpd> ) 
#A  GeneratorsOfGroupoid( <gpd> )
#A  ComponentsOfGroupoid( <gpd> ) 
## 
DeclareAttribute( "ObjectsOfGroupoid", IsGroupoid );  
DeclareAttribute( "GeneratorsOfGroupoid", IsGroupoid);
DeclareAttribute( "ComponentsOfGroupoid", IsGroupoid );  
  
############################################################################## 
## 
#R  IsConnectedGroupoidRep( <gpd> )                
## 
##  A connected groupoid is determined by a set of objects and a group
## 
DeclareRepresentation( "IsConnectedGroupoidRep",
    IsGroupoid and IsAttributeStoringRep and IsComponentObjectRep, 
    [ "objects", "group" ] ); 
 
############################################################################## 
## 
#R  IsConnectedGroupoidWithRaysRep( <gpd> )                
## 
##  A connected groupoid with variable object groups is determined by 
##  a set of objects, a root object, a (parent) group, a root group, 
##  and a set of conjugating elements for each ray in the star graph.
## 
DeclareRepresentation( "IsConnectedGroupoidWithRaysRep",
    IsGroupoid and IsAttributeStoringRep and IsComponentObjectRep, 
    [ "objects", "rootObject", "group", "rootGroup", "rayConjugators" ] ); 
 
############################################################################# 
## 
#P  IsPermGroupoid( <gpd> )                                    
#P  IsFpGroupoid( <gpd> )                                    
#P  IsPcGroupoid( <gpd> )                                    
#P  IsFreeGroupoid( <gpd> )                                    
## 
DeclareProperty( "IsPermGroupoid", IsGroupoid );  
DeclareProperty( "IsFpGroupoid", IsGroupoid );  
DeclareProperty( "IsPcGroupoid", IsGroupoid );  
DeclareProperty( "IsFreeGroupoid", IsGroupoid );  
  
############################################################################# 
## 
#F  Groupoid( <args> )              
## 
DeclareGlobalFunction( "Groupoid" );

############################################################################# 
##           
#O  ConnectedGroupoidNC( <objects>, <group> )              
#O  ConnectedGroupoid( <objects>, <group> )              
#O  ConnectedGroupoidWithRaysNC( <obs>, <rootob>, <parent>, <rootgp>, <conj> )
#O  ConnectedGroupoidWithRays( <obs>, <rootob>, <parent>, <rootgp>, <conj> )
## 
DeclareOperation( "ConnectedGroupoidNC", [ IsHomogeneousList, IsGroup ] ); 
DeclareOperation( "ConnectedGroupoid", [ IsHomogeneousList, IsGroup ] ); 
DeclareOperation( "ConnectedGroupoidWithRaysNC", 
    [ IsHomogeneousList, IsObject, IsGroup, IsGroup, IsHomogeneousList ] );
DeclareOperation( "ConnectedGroupoidWithRays", 
    [ IsHomogeneousList, IsObject, IsGroup, IsGroup, IsHomogeneousList ] );

############################################################################## 
## 
#R  IsGroupoidRep( <gpd> )                
## 
##  A groupoid is a set of connected groupoids
## 
DeclareRepresentation( "IsGroupoidRep", IsGroupoid and IsAttributeStoringRep, 
    [ "ComponentsOfGroupoid", "Objects" ] ); 
 
############################################################################# 
## 
#O  GroupAsGroupoid( <obj>, <grp> )
#O  GroupoidByUnionNC( <comps> )              
#O  GroupoidByUnion( <comps> )              
## 
DeclareOperation( "GroupAsGroupoid", [ IsObject, IsGroup ] );    
DeclareOperation( "GroupoidByUnionNC", [ IsHomogeneousList ] );    
DeclareOperation( "GroupoidByUnion", [ IsList ] );
 
############################################################################# 
## 
#O  ComponentOfObject( <gpd>, <obj> )                                    
#O  ComponentNrOfObject( <gpd>, <obj> )                                    
## 
DeclareOperation( "ComponentOfObject", [ IsGroupoid, IsObject ] );  
DeclareOperation( "ComponentNrOfObject", [ IsGroupoid, IsObject ] );  
  
############################################################################# 
##                         
#O  ObjectGroup( <gpd>, <obj> )
#A  ObjectGroups( <gpd> )
## 
DeclareOperation( "ObjectGroup", [ IsGroupoid, IsObject ] );    
DeclareAttribute( "ObjectGroups", IsGroupoid );    

## ======================================================================== ##
##                            Groupoid Elements                             ##
## ======================================================================== ##

#############################################################################
##
##  not sure how best to include these!
## 
## #C  IsElementOfGroupoid
## #C  IsElementOfGroupoidCollection
## #C  IsElementOfGroupoidFamily
##
## DeclareCategory( "IsElementOfGroupoid",
##   IsMultiplicativeElementWithInverse and IsAssociativeElement );
## DeclareCategoryCollections( "IsElementOfGroupoid" );
## DeclareCategoryFamily( "IsElementOfGroupoid" );

############################################################################## 
## 
##  A connected groupoid element is [ group element, source, target ]
##
#P  IsGroupoidElement
#R  IsGroupoidElementRep
## 
DeclareProperty( "IsGroupoidElement", IsMultiplicativeElement ); 
DeclareRepresentation( "IsGroupoidElementRep",
    IsGroupoidElement and IsPositionalObjectRep, [ 1, 2, 3 ] ); 

############################################################################## 
## 
#O  GroupoidElementNC( <elt, src, tgt> ) 
#O  GroupoidElement( <gpd, elt, src, tgt> ) 
## 
##  A connected groupoid element is [ group element, source, target ]
## 
DeclareOperation( "GroupoidElementNC",
    [ IsMultiplicativeElement, IsObject, IsObject ] ); 
DeclareOperation( "GroupoidElement",
    [ IsGroupoid, IsMultiplicativeElement, IsObject, IsObject ] ); 

############################################################################## 
## 
#A  GroupElement( <elt> ) 
#A  Tail( <elt> ) 
#A  Head( <elt> ) 
## 
DeclareAttribute( "GroupElement", IsGroupoidElementRep ); 
DeclareAttribute( "Tail", IsGroupoidElement ); 
DeclareAttribute( "Head", IsGroupoidElement ); 
 
############################################################################## 
## 
##  Stars, Costars and Homsets are particular subsets of the elements
##  of a connected groupoid for which an iterator is required
##  
#P  IsHomsetCosets( <obj> )
#R  IsHomsetCosetsRep( <obj> )
#A  UnionHomsets( <gpd> )
#O  IdentityElement( <gpd>, <obj> ) 
#O  ObjectStarNC( <gpd>, <obj> ) 
#O  ObjectStar( <gpd>, <obj> ) 
#O  ObjectCostarNC( <gpd>, <obj> ) 
#O  ObjectCostar( <gpd>, <obj> ) 
#O  HomsetNC( <gpd>, <obj1>, <obj2> ) 
#O  Homset( <gpd>, <obj1>, <obj2> ) 
#A  ElementsOfGroupoid( <gpd> ) 
##
DeclareProperty( "IsHomsetCosets", IsMultiplicativeElementCollection );
DeclareRepresentation( "IsHomsetCosetsRep", 
    IsHomsetCosets and IsPositionalObjectRep, [1,2,3,4,5] ); 
DeclareAttribute( "UnionHomsets", IsGroupoid );
DeclareOperation( "IdentityElement", [ IsGroupoid, IsObject ] ); 
DeclareOperation( "ObjectStarNC", [ IsGroupoid, IsObject ] ); 
DeclareOperation( "ObjectStar", [ IsGroupoid, IsObject ] ); 
DeclareOperation( "ObjectCostarNC", [ IsGroupoid, IsObject ] ); 
DeclareOperation( "ObjectCostar", [ IsGroupoid, IsObject ] ); 
DeclareOperation( "HomsetNC", [ IsGroupoid, IsObject, IsObject ] ); 
DeclareOperation( "Homset", [ IsGroupoid, IsObject, IsObject ] ); 
DeclareAttribute( "ElementsOfGroupoid", IsGroupoid ); 

############################################################################## 
## 
#O  RightCosetRepresentatives( <gpd>, <sgpd> ) 
#O  LeftCosetRepresentatives( <gpd>, <sgpd> ) 
#O  LeftCosetRepresentativesFromObject( <gpd>, <sgpd>, <obj> ) 
#O  LeftCosetsNC( <gpd>, <sgpd> ) 
#O  LeftCoset( <gpd>, <elt> )
#O  DoubleCosetRepresentatives( <gpd>, <sgpd>, <sgpd> ) 
## 
DeclareOperation( "RightCosetRepresentatives", [ IsGroupoid, IsGroupoid ] ); 
DeclareOperation( "LeftCosetRepresentatives", [ IsGroupoid, IsGroupoid ] ); 
DeclareOperation( "LeftCosetRepresentativesFromObject", 
    [ IsGroupoid, IsGroupoid, IsObject ] ); 
DeclareOperation( "LeftCosetsNC", [ IsGroupoid, IsGroupoid ] ); 
DeclareOperation( "LeftCoset", [ IsGroupoid, IsGroupoidElementRep ] ); 
DeclareOperation( "DoubleCosetRepresentatives", 
    [ IsGroupoid, IsGroupoid, IsGroupoid ] ); 

## ======================================================================== ##
##                               Subgroupoids                               ##
## ======================================================================== ##

############################################################################# 
## 
#F  Subgroupoid( <args> )              
#F  IsSubgroupoid( <G>, <U> )
## 
DeclareGlobalFunction( "Subgroupoid" );
DeclareGlobalFunction( "IsSubgroupoid" );

############################################################################# 
## 
#O  SubgroupoidByComponents( <gpd>, <obhoms> )              
#O  ComponentPositions( <gpd>, <sgpd> )
#O  DiscreteSubgroupoid( <gpd>, <obs>, <gps> )              
#A  MaximalDiscreteSubgroupoid( <gpd> )  
#O  FullSubgroupoid( <gpd>, <obs> )              
#A  FullIdentitySubgroupoid( <gpd> )  
#A  DiscreteIdentitySubgroupoid( <gpd> )  
## 
DeclareOperation( "SubgroupoidByComponents",
    [ IsGroupoid, IsHomogeneousList ] );
DeclareOperation( "ComponentPositions", [ IsGroupoid, IsGroupoid ] );
DeclareOperation( "DiscreteSubgroupoid",
    [ IsGroupoid, IsHomogeneousList, IsHomogeneousList ] );
DeclareAttribute( "MaximalDiscreteSubgroupoid", IsGroupoid );
DeclareOperation( "FullSubgroupoid", [ IsGroupoid, IsHomogeneousList ] );
DeclareAttribute( "FullIdentitySubgroupoid", IsGroupoid );
DeclareAttribute( "DiscreteIdentitySubgroupoid", IsGroupoid );

############################################################################## 
## 
#P  IsWideSubgroupoid( <gpd> )                
#P  IsDiscreteGroupoid( <gpd> )                
## 
DeclareProperty( "IsWideSubgroupoid", IsGroupoid ); 
DeclareProperty( "IsDiscreteGroupoid", IsGroupoid ); 

############################################################################## 
## 
#E  gpd.gd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here 
## 
