diff --git a/ChangeLog b/ChangeLog index d80a413..483708d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +0.9.7 + Breaking changes: ContainsSet(sk, P) replaced with P in ExtendedImageSet(sk), since ExtendedImageSet is now a HashSet for faster lookup. SortedExtendedImageSet added for retaining the functionality of having a sorted list of the extended images. 0.9.6 MakeRepresentative added. To simplify the process of changing a representative, the primitve caching mechanism for the words navigating in the equivalence classes were removed. This makes computing the morphism for holonomy less performant. Proper memoization is to be added later. 0.9.5 diff --git a/doc/holonomy.xml b/doc/holonomy.xml index 45213a1..f91fe47 100644 --- a/doc/holonomy.xml +++ b/doc/holonomy.xml @@ -13,6 +13,8 @@ can create, display and act on finite sets. The skeleton of a transformation semigroup is a data structure containing information about the action on the state set. For instance, the set of images, their strongly connected components and mapping between and within these components. These details are calculated by the Semigrops package. <#Include Label="Skeleton"> <#Include Label="ExtendedImageSet"> +<#Include Label="SortedExtendedImageSet"> + <#Include Label="Singletons"> <#Include Label="NonImageSingletons"> <#Include Label="RepresentativeSets"> diff --git a/doc/mansections.xml b/doc/mansections.xml index 3375ed9..dfac02a 100644 --- a/doc/mansections.xml +++ b/doc/mansections.xml @@ -524,17 +524,18 @@ Transformation( [ 1, 3, 1, 2 ] ) <#GAPDoc Label="ExtendedImageSet"> - The set of images of the semigroup action. + The extended set of images of the semigroup action. The state set, the singletons and all image sets X^s, s\in S. +Stored in a HashSet, thus it is useful for quick checks for the existence of an image. -gap> SgpDecFiniteSetDisplayOn(); gap> S := Semigroup(Transformation([1,1,3,3])); <commutative transformation semigroup of degree 4 with 1 generator> gap> sk := Skeleton(S);; -gap> ExtendedImageSet(sk); -[ {1,2,3,4}, {1,3}, {1}, {2}, {3}, {4} ] -gap> SgpDecFiniteSetDisplayOff(); +gap> FiniteSet([1,3],4) in ExtendedImageSet(sk); +true +gap> FiniteSet([2,3],4) in ExtendedImageSet(sk); +false @@ -1032,6 +1033,26 @@ gap> Skeleton(FullTransformationSemigroup(4)); <#/GAPDoc> +<#GAPDoc Label="SortedExtendedImageSet"> + + + The extended set of images of the semigroup action sorted in descending order. + +The state set, the singletons and all image sets X^s, s\in S. + +gap> SgpDecFiniteSetDisplayOn(); +gap> S := Semigroup(Transformation([1,1,3,3])); +<commutative transformation semigroup of degree 4 with 1 generator> +gap> sk := Skeleton(S);; +gap> SortedExtendedImageSet(sk); +[ {1,2,3,4}, {1,3}, {1}, {2}, {3}, {4} ] +gap> SgpDecFiniteSetDisplayOff(); + + + +<#/GAPDoc> + + ##T <#GAPDoc Label="Chains"> diff --git a/lib/finiteset.gd b/lib/finiteset.gd index a4616bc..dd6ebb9 100644 --- a/lib/finiteset.gd +++ b/lib/finiteset.gd @@ -2,7 +2,7 @@ ## ## finiteset.gd SgpDec package ## -## Copyright (C) 2010-2013 +## Copyright (C) 2010-2023 ## ## Attila Egri-Nagy, Chrystopher L. Nehaniv, James D. Mitchell ## @@ -24,6 +24,7 @@ DeclareGlobalFunction("SgpDecFiniteSetDisplayOff"); DeclareGlobalFunction("FiniteSet"); DeclareSynonym("Cardinality",SizeBlist); DeclareSynonym("FiniteSetSize",SizeBlist); +DeclareGlobalFunction("FiniteSetComparator"); DeclareGlobalFunction("OnFiniteSet"); DeclareGlobalFunction("IsIdentityOnFiniteSet"); DeclareGlobalFunction("IsSingleton"); diff --git a/lib/finiteset.gi b/lib/finiteset.gi index e8ae82b..f98a9e2 100644 --- a/lib/finiteset.gi +++ b/lib/finiteset.gi @@ -2,7 +2,7 @@ ## ## finiteset.gi SgpDec package ## -## Copyright (C) 2010-2013 +## Copyright (C) 2010-2023 ## ## Attila Egri-Nagy, Chrystopher L. Nehaniv, James D. Mitchell ## @@ -62,6 +62,16 @@ local i; return true; end); +#for sorting finitesets, first by size, then by content +InstallGlobalFunction(FiniteSetComparator, +function(A,B) + if SizeBlist(A) <> SizeBlist(B) then + return SizeBlist(A)>SizeBlist(B); + else + return A 1 then # the stricter test is PermutatorGroup(sk, x2) = JGroup diff --git a/lib/skeleton.gd b/lib/skeleton.gd index 2fa21c4..5113e8b 100644 --- a/lib/skeleton.gd +++ b/lib/skeleton.gd @@ -38,7 +38,7 @@ DeclareAttribute("RepresentativeSets",IsSkeleton); DeclareGlobalFunction("RepresentativeSetsOnDepth"); #functions -DeclareGlobalFunction("ContainsSet"); +DeclareGlobalFunction("SortedExtendedImageSet"); DeclareGlobalFunction("TilesOf"); DeclareGlobalFunction("TilesContaining"); DeclareGlobalFunction("DepthOfSet"); diff --git a/lib/skeleton.gi b/lib/skeleton.gi index 3690468..db9dd70 100644 --- a/lib/skeleton.gi +++ b/lib/skeleton.gi @@ -61,37 +61,25 @@ function(sk) return Filtered(Singletons(sk), x-> not x in ForwardOrbit(sk)); end); -#for sorting finitesets, first by size, then by content -DescendingSizeSorter := function(v,w) - if SizeBlist(v) <> SizeBlist(w) then - return SizeBlist(v)>SizeBlist(w); - else - return vEvalWordInSkeleton(sk,w)); nontrivs := Filtered([1..Size(roundtrips)], diff --git a/tst/skeleton.tst b/tst/skeleton.tst index f151c4d..703341d 100644 --- a/tst/skeleton.tst +++ b/tst/skeleton.tst @@ -30,7 +30,7 @@ gap> S := Semigroup(Transformation([5,5,5,5,5]));; gap> sk := Skeleton(S);; gap> Display(sk); -gap> ExtendedImageSet(sk); +gap> SortedExtendedImageSet(sk); [ {1,2,3,4,5}, {1}, {2}, {3}, {4}, {5} ] gap> ImageWitness(sk, FiniteSet([1..5]), FiniteSet([5])); fail @@ -62,7 +62,7 @@ gap> Q := FiniteSet([3,4],6);; gap> IsSubsetBlist(OnFiniteSet(Q, EvalWordInSkeleton(sk, > SubductionWitness(sk,P,Q))),P); true -gap> ExtendedImageSet(sk); +gap> SortedExtendedImageSet(sk); [ {1,2,3,4,5,6}, {1,2,3,4}, {1,2,3}, {4,5,6}, {1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}, {4,5}, {4,6}, {5,6}, {1}, {2}, {3}, {4}, {5}, {6} ] gap> Interpret(sk, 1,1); @@ -77,7 +77,7 @@ gap> DominatingChains(sk, [FiniteSet([1],6)]); [ {1,2,3,4,5,6}, {1,2,3,4}, {1,2,3}, {1,3}, {1} ], [ {1,2,3,4,5,6}, {1,2,3,4}, {1,4}, {1} ] ] gap> sk := Skeleton(Semigroup(Transformation([5,5,5,5,5])));; -gap> ExtendedImageSet(sk); +gap> SortedExtendedImageSet(sk); [ {1,2,3,4,5}, {1}, {2}, {3}, {4}, {5} ] gap> NonImageSingletonClasses(sk); [ [ {4} ], [ {3} ], [ {2} ], [ {1} ] ]