44# Declarations
55#
66
7+ # Technical functions
8+ DeclareGlobalFunction( " INSTALL_FUNCTIONS_FOR_FIN_SETS" );
9+
710# ! @Chapter The category of finite sets
811
912# ! @Section GAP Categories
1013
14+ # ! @Description
15+ # ! The GAP category of categories
16+ # ! of finite sets.
17+ # ! @Arguments object
18+ DeclareCategory( " IsCategoryOfFinSets" ,
19+ IsCapCategory );
20+
1121# ! @Description
1222# ! The GAP category of objects in the category
1323# ! of finite sets.
@@ -50,16 +60,30 @@ DeclareAttribute( "AsList",
5060
5161# ! @Section Constructors
5262
63+ # ! @Description
64+ # ! Construct a category of finite sets.
65+ # ! Accepts the options <C>overhead</C> (default: <C>true</C>) and
66+ # ! <C>FinalizeCategory</C> (default: <C>true</C>).
67+ # ! @Returns a &CAP; category
68+ DeclareOperation( " CategoryOfFinSets" , [ ] );
69+
5370# ! @Description
5471# ! Construct a finite set out of the list <A>L</A>, i.e.,
55- # ! an object in the &CAP; category <C>FinSets </C>.
72+ # ! an object in the &CAP; category <C>cat_of_fin_sets </C>.
5673# ! The &GAP; operation <C>Set</C> must be applicable to <A>L</A> without throwing an error.
5774# ! Equality is determined as follows: <C>FinSet( L1 ) = FinSet( L2 )</C> iff <C>IsEqualForElementsOfFinSets( Immutable( Set( L1 ) ), Immutable( Set( L2 ) ) )</C>.
5875# ! Warning: all internal operations use <C>FinSetNC</C> (see below) instead of <C>FinSet</C>.
5976# ! Thus, this notion of equality is only valid for objects created by calling <C>FinSet</C> explicitly.
60- # ! Internally, <C>FinSet( L )</C> is an alias for <C>FinSetNC( Set( L ) )</C> and equality is determined as for <C>FinSetNC</C>.
61- # ! Thus, <C>FinSet( L1 ) = FinSetNC( L2 )</C> iff <C>IsEqualForElementsOfFinSets( Immutable( Set( L1 ) ), Immutable( L2 ) )</C> and
62- # ! <C>FinSetNC( L1 ) = FinSet( L2 )</C> iff <C>IsEqualForElementsOfFinSets( Immutable( L1 ), Immutable( Set( L2 ) ) )</C>.
77+ # ! Internally, <C>FinSet( cat_of_fin_sets, L )</C> is an alias for <C>FinSetNC( cat_of_fin_sets, Set( L ) )</C> and equality is determined as for <C>FinSetNC</C>.
78+ # ! Thus, <C>FinSet( cat_of_fin_sets, L1 ) = FinSetNC( cat_of_fin_sets, L2 )</C> iff <C>IsEqualForElementsOfFinSets( Immutable( Set( L1 ) ), Immutable( L2 ) )</C> and
79+ # ! <C>FinSetNC( cat_of_fin_sets, L1 ) = FinSet( cat_of_fin_sets, L2 )</C> iff <C>IsEqualForElementsOfFinSets( Immutable( L1 ), Immutable( Set( L2 ) ) )</C>.
80+ # ! @Arguments cat_of_fin_sets, L
81+ # ! @Returns a &CAP; object
82+ DeclareOperation( " FinSet" ,
83+ [ IsCategoryOfFinSets, IsList ] );
84+
85+ # ! @Description
86+ # ! Return <C>FinSet</C>( <C>FinSets</C>, <A>L</A> ).
6387# ! @Arguments L
6488# ! @Returns a &CAP; object
6589DeclareOperation( " FinSet" ,
@@ -68,8 +92,16 @@ DeclareOperation( "FinSet",
6892
6993# ! @Description
7094# ! Construct a finite set out of the duplicate-free (w.r.t. <C>IsEqualForElementsOfFinSets</C>) and dense list <A>L</A>, i.e.,
71- # ! an object in the &CAP; category <C>FinSets</C>.
72- # ! Equality is determined as follows: <C>FinSetNC( L1 ) = FinSetNC( L2 )</C> iff <C>IsEqualForElementsOfFinSets( Immutable( L1 ), Immutable( L2 ) )</C>.
95+ # ! an object in the &CAP; category <C>cat_of_fin_sets,</C>.
96+ # ! Equality is determined as follows: <C>FinSetNC( cat_of_fin_sets, L1 ) = FinSetNC( cat_of_fin_sets, L2 )</C>
97+ # ! iff <C>IsEqualForElementsOfFinSets( Immutable( L1 ), Immutable( L2 ) )</C>.
98+ # ! @Arguments cat_of_fin_sets, L
99+ # ! @Returns a &CAP; object
100+ DeclareOperation( " FinSetNC" ,
101+ [ IsCategoryOfFinSets, IsList ] );
102+
103+ # ! @Description
104+ # ! Return <C>FinSetNC</C>( <C>FinSets</C>, <A>L</A> ).
73105# ! @Arguments L
74106# ! @Returns a &CAP; object
75107DeclareOperation( " FinSetNC" ,
@@ -137,11 +169,11 @@ DeclareOperation( "Iterator",
137169 [ IsFiniteSet ] );
138170
139171# ! @Description
140- # ! Compute the set-theoretic union of the elements of <A>L</A>, where <A>L</A> is a list of finite sets.
141- # ! @Arguments L
172+ # ! Compute the set-theoretic union of the elements of <A>L</A>, where <A>L</A> is a list of finite sets in the category <A>cat_of_fin_sets</A> .
173+ # ! @Arguments cat_of_fin_sets, L
142174# ! @Returns a &CAP; object
143175DeclareOperation( " UnionOfFinSets" ,
144- [ IsList ] );
176+ [ IsCategoryOfFinSets, IsList ] );
145177
146178# ! @Description
147179# ! Returns <C>List( AsList( <A>M</A> ), <A>f</A> )</C>.
0 commit comments