##############################################################################
##
#W  gpd.gd                     Gpd Package                       Chris Wensley
#W                                                                & Emma Moore
##
##  Declaration file for functions in the Gpd package.
##
#H  @(#)$Id: gpd.gd,v 1.01 2006/05/16 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.01 2006/05/16 gap Exp $";

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

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

############################################################################# 
## 
#A  ObjectsOfGroupoid( <gpd> ) 
#A  ComponentsOfGroupoid( <gpd> ) 
## 
DeclareAttribute( "ObjectsOfGroupoid", 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" ] ); 
 
############################################################################# 
## 
#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> )              
## 
DeclareOperation( "ConnectedGroupoidNC", [ IsHomogeneousList, IsGroup ] ); 
DeclareOperation( "ConnectedGroupoid", [ IsHomogeneousList, IsGroup ] ); 

############################################################################## 
## 
#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 ] );  
  
## ======================================================================== ##
##                            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 
## 
