From bc0b6c9727ea279da8fdad0d062b7fc585bd9128 Mon Sep 17 00:00:00 2001 From: Friedrich Rober Date: Wed, 13 Dec 2023 12:10:49 +0100 Subject: [PATCH 1/6] Add `LowIndexNormalSubgroups` operation --- gap/LINS.gd | 8 ++++++++ gap/LINS.gi | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/gap/LINS.gd b/gap/LINS.gd index 6df2e00..604cc21 100644 --- a/gap/LINS.gd +++ b/gap/LINS.gd @@ -175,6 +175,14 @@ DeclareAttribute( "LinsOptions", IsLinsGraph, "mutable" ); ## Main functions ############################################################################# +if not IsBound(LowIndexNormalSubgroups) then + # The polycyclic package also declares this in exactly the same way; + # to ensure one can load either package or both, in either + # order, we only declare these conditionally in both packages. + KeyDependentOperation( "LowIndexNormalSubgroups", + IsGroup, IsPosInt, ReturnTrue ); +fi; + ## <#GAPDoc Label="LowIndexNormalSubgroupsSearch"> ## ## diff --git a/gap/LINS.gi b/gap/LINS.gi index f5e9ad2..acd1258 100644 --- a/gap/LINS.gi +++ b/gap/LINS.gi @@ -464,3 +464,12 @@ end); InstallGlobalFunction( LowIndexNormalSubgroupsSearchForAll, function(G, n) return LowIndexNormalSubgroupsSearch(G, n); end); + +InstallMethod( LowIndexNormalSubgroupsOp, "for groups", + [IsGroup, IsPosInt], +function(G, n) + local gr, iso; + gr := LowIndexNormalSubgroupsSearchForAll(G, n); + iso := IsomorphismFpGroup(gr); + return List(List(gr), rH -> PreImage(iso, Grp(rH))); +end); From 261bf4e7df50787475bab2585391bda5551bf799 Mon Sep 17 00:00:00 2001 From: Friedrich Rober Date: Wed, 13 Dec 2023 12:27:37 +0100 Subject: [PATCH 2/6] Add tests for `LowIndexNormalSubgroups` --- .../quick/Operation/DihedralGroup_20_10_Fp.tst | 14 ++++++++++++++ .../quick/Operation/DihedralGroup_20_10_Pc.tst | 14 ++++++++++++++ .../quick/Operation/DihedralGroup_20_10_Perm.tst | 16 ++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst create mode 100644 tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst create mode 100644 tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst diff --git a/tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst b/tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst new file mode 100644 index 0000000..debb672 --- /dev/null +++ b/tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst @@ -0,0 +1,14 @@ +############################################################################# +# G = D_20 +# index = 10 +# fp-group +############################################################################# + +gap> G := DihedralGroup(IsFpGroup, 20); + +gap> L := LowIndexNormalSubgroups(G, 10); +[ , Group([ r ]), + Group([ r^-2, s ]), Group([ r^-2, s*r^-1 ]), Group([ r^-2 ]), + Group([ r^5 ]) ] +gap> List(L, H -> Index(G, H)); +[ 1, 2, 2, 2, 4, 10 ] diff --git a/tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst b/tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst new file mode 100644 index 0000000..24551f0 --- /dev/null +++ b/tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst @@ -0,0 +1,14 @@ +############################################################################# +# G = D_20 +# index = 10 +# pc-group +############################################################################# + +gap> G := DihedralGroup(20); + +gap> L := LowIndexNormalSubgroups(G, 10); +[ Group([ f1, f2, f3 ]), Group([ f1, f3^4 ]), Group([ f2 ]), + Group([ f1*f2*f3^4, f1*f2 ]), Group([ f3^4 ]), + Group([ of ..., f2*f3^2 ]) ] +gap> List(L, H -> Index(G, H)); +[ 1, 2, 2, 2, 4, 10 ] diff --git a/tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst b/tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst new file mode 100644 index 0000000..378432e --- /dev/null +++ b/tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst @@ -0,0 +1,16 @@ +############################################################################# +# G = D_20 +# index = 10 +# perm-group +############################################################################# + +gap> G := DihedralGroup(IsPermGroup, 20); +Group([ (1,2,3,4,5,6,7,8,9,10), (2,10)(3,9)(4,8)(5,7) ]) +gap> L := LowIndexNormalSubgroups(G, 10); +[ Group([ (2,10)(3,9)(4,8)(5,7), (1,6)(2,7)(3,8)(4,9)(5,10), (1,7,3,9,5) + (2,8,4,10,6) ]), Group([ (2,10)(3,9)(4,8)(5,7), (1,7,3,9,5)(2,8,4,10,6) + ]), Group([ (1,6)(2,7)(3,8)(4,9)(5,10), (1,7,3,9,5)(2,8,4,10,6) ]), + Group([ (1,6)(2,5)(3,4)(7,10)(8,9), (1,7,3,9,5)(2,8,4,10,6) ]), + Group([ (1,7,3,9,5)(2,8,4,10,6) ]), Group([ (1,6)(2,7)(3,8)(4,9)(5,10) ]) ] +gap> List(L, H -> Index(G, H)); +[ 1, 2, 2, 2, 4, 10 ] \ No newline at end of file From 351d4f1ccb87716a6d7c620534ba5c92b24c738f Mon Sep 17 00:00:00 2001 From: Friedrich Rober Date: Thu, 14 Dec 2023 14:42:07 +0100 Subject: [PATCH 3/6] Finish `LowIndexNormalSubs` - Rename `LowIndexNormalSubgroups` -> `LowIndexNormalSubs` - Add option `allSubgroups` to `LowIndexNormalSubs` - Add documentation for `LowIndexNormalSubs` - Move previous examples to advanced section - Add simplfied examples in introduction using the new high-level function --- doc/intro.xml | 102 ++------------ doc/lins_interface.xml | 125 +++++++++++++++++- gap/LINS.gd | 24 +++- gap/LINS.gi | 18 ++- .../Operation/DihedralGroup_20_10_Fp.tst | 2 +- .../Operation/DihedralGroup_20_10_Pc.tst | 2 +- .../Operation/DihedralGroup_20_10_Perm.tst | 4 +- 7 files changed, 171 insertions(+), 106 deletions(-) diff --git a/doc/intro.xml b/doc/intro.xml index 6b6633d..f6df25d 100644 --- a/doc/intro.xml +++ b/doc/intro.xml @@ -22,7 +22,7 @@ The current implementation in &GAP; uses a table of groups that was computed by Examples In this section we present example sessions which demonstrate -how to use the search methods provided by &LINS;.

+how to use the main high-level functions provided by &LINS;.

Example : all normal subgroups up to index n @@ -30,37 +30,11 @@ how to use the search methods provided by &LINS;.

We compute all normal subgroups in D_{50}, the dihedral group of size 50. n := 50; +gap> n := 50;; gap> G := DihedralGroup(n); -]]> - -The search algorithm automatically translates the group into a finitely presented group -via a call to IsomorphismFpGroup.
-The isomorphism is stored inside the lins graph. - gr := LowIndexNormalSubgroupsSearchForAll(G, n); - -gap> r := LinsRoot(gr); - -gap> H := Grp(r); - -gap> Iso := IsomorphismFpGroup(gr); -[ f1, f2, f3 ] -> [ F1, F2, F3 ] -gap> Source(Iso) = G; -true -gap> Range(Iso) = H; -true -]]> - -In order to get all nodes from the search graph, we need to use List. -As expected, the algorithm finds D_{50}, C_{25}, C_5 -and the trivial group. - L := List(gr); -[ , , , - ] -gap> IsoTypes := List(L, node -> StructureDescription(Grp(node))); +gap> L := LowIndexNormalSubs(G, n);; +gap> IsoTypes := List(L, H -> StructureDescription(H)); [ "D50", "C25", "C5", "1" ] ]]> @@ -77,72 +51,22 @@ gap> d := 4;; gap> C := CyclicGroup(5);; gap> G := DirectProduct(ListWithIdenticalEntries(d, C)); -]]> - -Again, the search algorithm automatically translates the group into a finitely presented group -via a call to IsomorphismFpGroup. - gr := LowIndexNormalSubgroupsSearchForIndex(G, 5 ^ 2, infinity); - -]]> - -Now we are not interested in all normal subgroups that the search graph considered, -but only in those of index 25. Thus we need to use ComputedNormalSubgroups. -For a prime p, and integers d, s \in \mathbb{N}, -the number of subgroups of order p^s of an elementary abelian p-group of order p^d -is exactly - -\frac -{\left(p^d - 1\right)\left(p^d - p\right) \cdots \left(p^d - p^{s-1}\right)} -{\left(p^s - 1\right)\left(p^s - p\right) \cdots \left(p^s - p^{s-1}\right)}\;. - - -( (p^d - 1)(p^d - p) \cdots (p^d - p^{(s-1)}) ) / ( (p^s - 1)(p^s - p) \cdots (p^s - p^{(s-1)}) ) . - -Thus we expect to find -\frac{(5^4-1) \cdot (5^4-5)}{(5^2 - 1) \cdot (5^2 - 5)} = 806 -( (5^4-1) \cdot (5^4-5) ) / ( (5^2 - 1) \cdot (5^2 - 5) ) = 806 -normal subgroups of index 25.
-Furthermore, all subgroups need to be of the isomorphism type C_5^2. - L := ComputedNormalSubgroups(gr);; -gap> Length(L); -806 -gap> IsoTypes := DuplicateFreeList(List(L, node -> StructureDescription(Grp(node)))); -[ "C5 x C5" ] +gap> L := LowIndexNormalSubs(G, 5 ^ 2 : allSubgroups := false);; +gap> IsoTypes := Collected(List(L, H -> StructureDescription(H))); +[ [ "C5 x C5", 806 ] ] ]]> - -Example : a normal subgroup of index n + -We compute a normal subgroup of index 3 \cdot 5 = 15 in -C_3 \times C_3 \times C_4 \times C_5, -a direct product of cyclic groups: - pList := [3, 3, 4, 5];; -gap> G := DirectProduct(List(pList, p -> CyclicGroup(p))); - -]]> +

+Main Functions -Again, the search algorithm automatically translates the group into a finitely presented group -via a call to IsomorphismFpGroup. - gr := LowIndexNormalSubgroupsSearchForIndex(G, 15, 1); - -]]> +In this section, we include all the main high-level functions provided to the User. +For advanced search methods in the lattice of normal subgroups, take a look at Chapter .

-We use ComputedNormalSubgroups in order to get the normal subgroup of index 15. -As expected, the algorithm finds a group of the isomorphism type C_{12} = C_3 \times C_4. - L := ComputedNormalSubgroups(gr); -[ ] -gap> IsoTypes := List(L, node -> StructureDescription(Grp(node))); -[ "C12" ] -]]> - - +<#Include Label="LowIndexNormalSubs">

diff --git a/doc/lins_interface.xml b/doc/lins_interface.xml index f41a6cd..17bd253 100644 --- a/doc/lins_interface.xml +++ b/doc/lins_interface.xml @@ -1,7 +1,8 @@ LINS Interface -This chapter explains the provided search methods +This chapter is intended for advanced users. +It explains the provided search methods and the interface to the search graph structure LinsGraph.
@@ -80,4 +81,126 @@ Returns the index [G : H].
+
+Examples + +In this section we present example sessions which demonstrate +how to use the advanced search methods provided by &LINS;. +For this we revise the examples from the introduction as well as include new ones.

+ + +Revised Example : all normal subgroups up to index n + +We compute all normal subgroups in D_{50}, +the dihedral group of size 50. + n := 50;; +gap> G := DihedralGroup(n); + +]]> + +The search algorithm automatically translates the group into a finitely presented group +via a call to IsomorphismFpGroup.
+The isomorphism is stored inside the lins graph. + gr := LowIndexNormalSubgroupsSearchForAll(G, n); + +gap> r := LinsRoot(gr); + +gap> H := Grp(r); + +gap> Iso := IsomorphismFpGroup(gr); +[ f1, f2, f3 ] -> [ F1, F2, F3 ] +gap> Source(Iso) = G; +true +gap> Range(Iso) = H; +true +]]> + +In order to get all nodes from the search graph, we need to use List. +As expected, the algorithm finds D_{50}, C_{25}, C_5 +and the trivial group. + L := List(gr); +[ , , , + ] +gap> IsoTypes := List(L, node -> StructureDescription(Grp(node))); +[ "D50", "C25", "C5", "1" ] +]]> + +
+ + +Revised Example : all normal subgroups of index n + +We compute all normal subgroups of index 5^2 = 25 in C_5^4, +the direct product of 4 copies of the cyclic group of order 5: + p := 5;; +gap> d := 4;; +gap> C := CyclicGroup(5);; +gap> G := DirectProduct(ListWithIdenticalEntries(d, C)); + +]]> + +Again, the search algorithm automatically translates the group into a finitely presented group +via a call to IsomorphismFpGroup. + gr := LowIndexNormalSubgroupsSearchForIndex(G, 5 ^ 2, infinity); + +]]> + +Now we are not interested in all normal subgroups that the search graph considered, +but only in those of index 25. Thus we need to use ComputedNormalSubgroups. +For a prime p, and integers d, s \in \mathbb{N}, +the number of subgroups of order p^s of an elementary abelian p-group of order p^d +is exactly + +\frac +{\left(p^d - 1\right)\left(p^d - p\right) \cdots \left(p^d - p^{s-1}\right)} +{\left(p^s - 1\right)\left(p^s - p\right) \cdots \left(p^s - p^{s-1}\right)}\;. + + +( (p^d - 1)(p^d - p) \cdots (p^d - p^{(s-1)}) ) / ( (p^s - 1)(p^s - p) \cdots (p^s - p^{(s-1)}) ) . + +Thus we expect to find +\frac{(5^4-1) \cdot (5^4-5)}{(5^2 - 1) \cdot (5^2 - 5)} = 806 +( (5^4-1) \cdot (5^4-5) ) / ( (5^2 - 1) \cdot (5^2 - 5) ) = 806 +normal subgroups of index 25.
+Furthermore, all subgroups need to be of the isomorphism type C_5^2. + L := ComputedNormalSubgroups(gr);; +gap> IsoTypes := Collected(List(L, node -> StructureDescription(Grp(node)))); +[ [ "C5 x C5", 806 ] ] +]]> + +
+ + +Example : a normal subgroup of index n + +We compute a normal subgroup of index 3 \cdot 5 = 15 in +C_3 \times C_3 \times C_4 \times C_5, +a direct product of cyclic groups: + pList := [3, 3, 4, 5];; +gap> G := DirectProduct(List(pList, p -> CyclicGroup(p))); + +gap> gr := LowIndexNormalSubgroupsSearchForIndex(G, 15, 1); + +]]> + +We use ComputedNormalSubgroups in order to get the normal subgroup of index 15. +As expected, the algorithm finds a group of the isomorphism type C_{12} = C_3 \times C_4. + L := ComputedNormalSubgroups(gr); +[ ] +gap> IsoTypes := List(L, node -> StructureDescription(Grp(node))); +[ "C12" ] +]]> + + + +

+
diff --git a/gap/LINS.gd b/gap/LINS.gd index 604cc21..6f510a1 100644 --- a/gap/LINS.gd +++ b/gap/LINS.gd @@ -175,13 +175,23 @@ DeclareAttribute( "LinsOptions", IsLinsGraph, "mutable" ); ## Main functions ############################################################################# -if not IsBound(LowIndexNormalSubgroups) then - # The polycyclic package also declares this in exactly the same way; - # to ensure one can load either package or both, in either - # order, we only declare these conditionally in both packages. - KeyDependentOperation( "LowIndexNormalSubgroups", - IsGroup, IsPosInt, ReturnTrue ); -fi; +## <#GAPDoc Label="LowIndexNormalSubs"> +## +## +## +## Returns a list of all normal subgroups of G with index at most n. +## If the option allSubgroups is set to false, +## then onlye the normal subgroups of G with index equal to n are returned.

+## +## The generic method uses to transform G into an fp-group +## and then calls some variant of the low-level function .

+## +## Note that a similar operation exists in the package polycyclic. +## Due to technical incompabilities, those operations could not be unified.

+## +## +## <#/GAPDoc> +DeclareOperation( "LowIndexNormalSubs", [IsGroup, IsPosInt] ); ## <#GAPDoc Label="LowIndexNormalSubgroupsSearch"> ## diff --git a/gap/LINS.gi b/gap/LINS.gi index acd1258..6aaf9e2 100644 --- a/gap/LINS.gi +++ b/gap/LINS.gi @@ -142,7 +142,7 @@ end); InstallMethod( ViewObj, "for Lins Graph Node", [IsLinsGraph], function(gr) - Print(""); + Print(""); end); @@ -465,11 +465,19 @@ InstallGlobalFunction( LowIndexNormalSubgroupsSearchForAll, function(G, n) return LowIndexNormalSubgroupsSearch(G, n); end); -InstallMethod( LowIndexNormalSubgroupsOp, "for groups", +InstallMethod( LowIndexNormalSubs, "for groups", [IsGroup, IsPosInt], function(G, n) - local gr, iso; - gr := LowIndexNormalSubgroupsSearchForAll(G, n); + local allSubgroups, gr, iso; + allSubgroups := ValueOption("allSubgroups"); + if allSubgroups = fail then + allSubgroups := true; + fi; + if allSubgroups then + gr := LowIndexNormalSubgroupsSearchForAll(G, n); + else + gr := LowIndexNormalSubgroupsSearchForIndex(G, n, infinity); + fi; iso := IsomorphismFpGroup(gr); - return List(List(gr), rH -> PreImage(iso, Grp(rH))); + return List(ComputedNormalSubgroups(gr), rH -> PreImage(iso, Grp(rH))); end); diff --git a/tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst b/tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst index debb672..b9887fe 100644 --- a/tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst +++ b/tst/files/quick/Operation/DihedralGroup_20_10_Fp.tst @@ -6,7 +6,7 @@ gap> G := DihedralGroup(IsFpGroup, 20); -gap> L := LowIndexNormalSubgroups(G, 10); +gap> L := LowIndexNormalSubs(G, 10); [ , Group([ r ]), Group([ r^-2, s ]), Group([ r^-2, s*r^-1 ]), Group([ r^-2 ]), Group([ r^5 ]) ] diff --git a/tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst b/tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst index 24551f0..54fa9ad 100644 --- a/tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst +++ b/tst/files/quick/Operation/DihedralGroup_20_10_Pc.tst @@ -6,7 +6,7 @@ gap> G := DihedralGroup(20); -gap> L := LowIndexNormalSubgroups(G, 10); +gap> L := LowIndexNormalSubs(G, 10); [ Group([ f1, f2, f3 ]), Group([ f1, f3^4 ]), Group([ f2 ]), Group([ f1*f2*f3^4, f1*f2 ]), Group([ f3^4 ]), Group([ of ..., f2*f3^2 ]) ] diff --git a/tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst b/tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst index 378432e..95d0321 100644 --- a/tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst +++ b/tst/files/quick/Operation/DihedralGroup_20_10_Perm.tst @@ -6,11 +6,11 @@ gap> G := DihedralGroup(IsPermGroup, 20); Group([ (1,2,3,4,5,6,7,8,9,10), (2,10)(3,9)(4,8)(5,7) ]) -gap> L := LowIndexNormalSubgroups(G, 10); +gap> L := LowIndexNormalSubs(G, 10); [ Group([ (2,10)(3,9)(4,8)(5,7), (1,6)(2,7)(3,8)(4,9)(5,10), (1,7,3,9,5) (2,8,4,10,6) ]), Group([ (2,10)(3,9)(4,8)(5,7), (1,7,3,9,5)(2,8,4,10,6) ]), Group([ (1,6)(2,7)(3,8)(4,9)(5,10), (1,7,3,9,5)(2,8,4,10,6) ]), Group([ (1,6)(2,5)(3,4)(7,10)(8,9), (1,7,3,9,5)(2,8,4,10,6) ]), Group([ (1,7,3,9,5)(2,8,4,10,6) ]), Group([ (1,6)(2,7)(3,8)(4,9)(5,10) ]) ] gap> List(L, H -> Index(G, H)); -[ 1, 2, 2, 2, 4, 10 ] \ No newline at end of file +[ 1, 2, 2, 2, 4, 10 ] From f4419e99084960d1fe662e08c46d7055787b78ce Mon Sep 17 00:00:00 2001 From: Friedrich Rober Date: Thu, 14 Dec 2023 16:59:31 +0100 Subject: [PATCH 4/6] Add doc tests --- .github/workflows/CI.yml | 1 + .gitignore | 4 +++- dev/tests_doc/README.md | 9 +++++++++ dev/tests_doc/processTests.sh | 37 +++++++++++++++++++++++++++++++++++ makedoc.g | 3 +++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 dev/tests_doc/README.md create mode 100755 dev/tests_doc/processTests.sh diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d93ae12..919f109 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -34,6 +34,7 @@ jobs: GAPBRANCH: ${{ matrix.gap-branch }} GAP_PKGS_TO_BUILD: "io profiling grape cohomolo" - uses: gap-actions/build-pkg@v1 + - uses: gap-actions/build-pkg-docs@v1 - uses: gap-actions/run-pkg-tests@v2 - uses: gap-actions/process-coverage@v2 - uses: codecov/codecov-action@v3 diff --git a/.gitignore b/.gitignore index 950d0ab..8bec6f5 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,6 @@ /gh-pages/ -_dev \ No newline at end of file +_dev + +/tst/files/doc/ diff --git a/dev/tests_doc/README.md b/dev/tests_doc/README.md new file mode 100644 index 0000000..056c6ef --- /dev/null +++ b/dev/tests_doc/README.md @@ -0,0 +1,9 @@ +# Introduction +The files in this directory are used to post-process test files +that are extracted from the documentation examples. + +# Main Files +- `processTests.sh` : processes all doc tests and moves them into `tst/files/doc`. + +# Instructions +In order to post-process the tests and move them into `tst/files/doc` automatically, one needs to execute `processTests.sh` from any place. diff --git a/dev/tests_doc/processTests.sh b/dev/tests_doc/processTests.sh new file mode 100755 index 0000000..2327872 --- /dev/null +++ b/dev/tests_doc/processTests.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +# go to root of repo +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd $script_dir/../.. +echo "Working in folder $(pwd)" + +# get operating system +unameOut="$(uname -s)" +case "${unameOut}" in + Linux*) machine=Linux;; + Darwin*) machine=Mac;; + CYGWIN*) machine=Cygwin;; + MINGW*) machine=MinGw;; + *) machine="UNKNOWN:${unameOut}" +esac + + +# Post-processing for the extracted examples from the documentation. +# - Add a "\n" to all Print executions. +# - Move files into test_dir +test_dir="tst/files/doc" +mkdir -p $test_dir +files=($(ls -1 tst/lins*.tst)) +echo "Found ${#files[@]} test file(s)" +for file in ${files[@]}; do + echo "Processing $file" + if [ "${machine}" == "Mac" ]; then + sed -i "" 's|Print(\(.*\));|Print(\1, \"\\n\");|g' $file + elif [ "${machine}" == "Linux" ]; then + sed -i 's|Print(\(.*\));|Print(\1, \"\\n\");|g' $file + else + echo "ERROR: Unsupported operating system ${machine}" + exit 1 + fi; + mv $file $test_dir/${file#"tst/"} +done diff --git a/makedoc.g b/makedoc.g index 4588a7c..fe4d4bb 100644 --- a/makedoc.g +++ b/makedoc.g @@ -25,4 +25,7 @@ AutoDoc( rec( scaffold := rec( "license.xml", ], ), + extract_examples := true, autodoc := true ) ); + +Exec("dev/tests_doc/processTests.sh"); From d60d5383f19b8688ee8c7d6d925876af2527c51c Mon Sep 17 00:00:00 2001 From: Friedrich Rober Date: Sat, 16 Dec 2023 12:28:40 +0100 Subject: [PATCH 5/6] Simplify `processTests.sh` --- dev/tests_doc/processTests.sh | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/dev/tests_doc/processTests.sh b/dev/tests_doc/processTests.sh index 2327872..d15b82a 100755 --- a/dev/tests_doc/processTests.sh +++ b/dev/tests_doc/processTests.sh @@ -5,19 +5,7 @@ script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd $script_dir/../.. echo "Working in folder $(pwd)" -# get operating system -unameOut="$(uname -s)" -case "${unameOut}" in - Linux*) machine=Linux;; - Darwin*) machine=Mac;; - CYGWIN*) machine=Cygwin;; - MINGW*) machine=MinGw;; - *) machine="UNKNOWN:${unameOut}" -esac - - # Post-processing for the extracted examples from the documentation. -# - Add a "\n" to all Print executions. # - Move files into test_dir test_dir="tst/files/doc" mkdir -p $test_dir @@ -25,13 +13,5 @@ files=($(ls -1 tst/lins*.tst)) echo "Found ${#files[@]} test file(s)" for file in ${files[@]}; do echo "Processing $file" - if [ "${machine}" == "Mac" ]; then - sed -i "" 's|Print(\(.*\));|Print(\1, \"\\n\");|g' $file - elif [ "${machine}" == "Linux" ]; then - sed -i 's|Print(\(.*\));|Print(\1, \"\\n\");|g' $file - else - echo "ERROR: Unsupported operating system ${machine}" - exit 1 - fi; mv $file $test_dir/${file#"tst/"} done From c9de9a4a97ad200d043615825fb6f4ba8aa5457d Mon Sep 17 00:00:00 2001 From: Friedrich Rober Date: Sat, 16 Dec 2023 12:34:57 +0100 Subject: [PATCH 6/6] Simplify examples --- doc/intro.xml | 16 ++++++---------- doc/lins_interface.xml | 15 +++++---------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/doc/intro.xml b/doc/intro.xml index f6df25d..a171197 100644 --- a/doc/intro.xml +++ b/doc/intro.xml @@ -30,11 +30,10 @@ how to use the main high-level functions provided by &LINS;.

We compute all normal subgroups in D_{50}, the dihedral group of size 50. n := 50;; -gap> G := DihedralGroup(n); +gap> G := DihedralGroup(50); -gap> L := LowIndexNormalSubs(G, n);; -gap> IsoTypes := List(L, H -> StructureDescription(H)); +gap> L := LowIndexNormalSubs(G, 50);; +gap> IsoTypes := List(L, StructureDescription); [ "D50", "C25", "C5", "1" ] ]]> @@ -46,13 +45,10 @@ gap> IsoTypes := List(L, H -> StructureDescription(H)); We compute all normal subgroups of index 5^2 = 25 in C_5^4, the direct product of 4 copies of the cyclic group of order 5: p := 5;; -gap> d := 4;; -gap> C := CyclicGroup(5);; -gap> G := DirectProduct(ListWithIdenticalEntries(d, C)); +gap> G := ElementaryAbelianGroup(5^4); gap> L := LowIndexNormalSubs(G, 5 ^ 2 : allSubgroups := false);; -gap> IsoTypes := Collected(List(L, H -> StructureDescription(H))); +gap> IsoTypes := Collected(List(L, StructureDescription)); [ [ "C5 x C5", 806 ] ] ]]> @@ -63,7 +59,7 @@ gap> IsoTypes := Collected(List(L, H -> StructureDescription(H)));

Main Functions -In this section, we include all the main high-level functions provided to the User. +In this section, we include all the main high-level functions provided to the user. For advanced search methods in the lattice of normal subgroups, take a look at Chapter .

<#Include Label="LowIndexNormalSubs"> diff --git a/doc/lins_interface.xml b/doc/lins_interface.xml index 17bd253..c937438 100644 --- a/doc/lins_interface.xml +++ b/doc/lins_interface.xml @@ -94,8 +94,7 @@ For this we revise the examples from the introduction as well as include new one We compute all normal subgroups in D_{50}, the dihedral group of size 50. n := 50;; -gap> G := DihedralGroup(n); +gap> G := DihedralGroup(50); ]]> @@ -103,7 +102,7 @@ The search algorithm automatically translates the group into a finitely presente via a call to IsomorphismFpGroup.
The isomorphism is stored inside the lins graph. gr := LowIndexNormalSubgroupsSearchForAll(G, n); +gap> gr := LowIndexNormalSubgroupsSearchForAll(G, 50); gap> r := LinsRoot(gr); @@ -136,10 +135,7 @@ gap> IsoTypes := List(L, node -> StructureDescription(Grp(node))); We compute all normal subgroups of index 5^2 = 25 in C_5^4, the direct product of 4 copies of the cyclic group of order 5: p := 5;; -gap> d := 4;; -gap> C := CyclicGroup(5);; -gap> G := DirectProduct(ListWithIdenticalEntries(d, C)); +gap> G := ElementaryAbelianGroup(5^4); ]]> @@ -183,9 +179,8 @@ We compute a normal subgroup of index 3 \cdot 5 = 15 in C_3 \times C_3 \times C_4 \times C_5, a direct product of cyclic groups: pList := [3, 3, 4, 5];; -gap> G := DirectProduct(List(pList, p -> CyclicGroup(p))); - +gap> G := AbelianGroup([3, 3, 4, 5]); + gap> gr := LowIndexNormalSubgroupsSearchForIndex(G, 15, 1); ]]>