passagemath-gap-pkg-semigroups 10.6.29__cp312-abi3-musllinux_1_2_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-gap-pkg-semigroups might be problematic. Click here for more details.

Files changed (356) hide show
  1. gap/pkg/semigroups/CHANGELOG.md +1699 -0
  2. gap/pkg/semigroups/CONTRIBUTING.md +91 -0
  3. gap/pkg/semigroups/GNUmakefile +110 -0
  4. gap/pkg/semigroups/GNUmakefile.in +110 -0
  5. gap/pkg/semigroups/GPL +674 -0
  6. gap/pkg/semigroups/LICENSE +16 -0
  7. gap/pkg/semigroups/Makefile +26 -0
  8. gap/pkg/semigroups/Makefile.gappkg +225 -0
  9. gap/pkg/semigroups/PackageInfo.g +529 -0
  10. gap/pkg/semigroups/README.md +102 -0
  11. gap/pkg/semigroups/VERSIONS +112 -0
  12. gap/pkg/semigroups/aclocal.m4 +375 -0
  13. gap/pkg/semigroups/autogen.sh +25 -0
  14. gap/pkg/semigroups/bin/x86_64-pc-linux-musl-default64-kv10/semigroups.so +0 -0
  15. gap/pkg/semigroups/config.guess +1807 -0
  16. gap/pkg/semigroups/config.log +1068 -0
  17. gap/pkg/semigroups/config.status +1133 -0
  18. gap/pkg/semigroups/config.sub +1960 -0
  19. gap/pkg/semigroups/configure +9742 -0
  20. gap/pkg/semigroups/configure.ac +71 -0
  21. gap/pkg/semigroups/data/doc/greens.pickle +1 -0
  22. gap/pkg/semigroups/data/gens/fullbool-8.pickle.gz +0 -0
  23. gap/pkg/semigroups/data/gens/fullbool.pickle.gz +0 -0
  24. gap/pkg/semigroups/data/gens/hall.pickle.gz +0 -0
  25. gap/pkg/semigroups/data/gens/reflex-6.pickle.gz +0 -0
  26. gap/pkg/semigroups/data/gens/reflex.pickle.gz +0 -0
  27. gap/pkg/semigroups/data/tst/bipart4 +10 -0
  28. gap/pkg/semigroups/data/tst/pperm10 +1 -0
  29. gap/pkg/semigroups/data/tst/tables.gz +0 -0
  30. gap/pkg/semigroups/data/tst/testdata +1 -0
  31. gap/pkg/semigroups/data/tst/testinstall.pickle +1 -0
  32. gap/pkg/semigroups/data/tst/trans3 +7 -0
  33. gap/pkg/semigroups/data/tst/trans3-old +7 -0
  34. gap/pkg/semigroups/environment.yml +7 -0
  35. gap/pkg/semigroups/gap/attributes/acting.gd +15 -0
  36. gap/pkg/semigroups/gap/attributes/acting.gi +297 -0
  37. gap/pkg/semigroups/gap/attributes/attr.gd +91 -0
  38. gap/pkg/semigroups/gap/attributes/attr.gi +1214 -0
  39. gap/pkg/semigroups/gap/attributes/dual.gd +25 -0
  40. gap/pkg/semigroups/gap/attributes/dual.gi +209 -0
  41. gap/pkg/semigroups/gap/attributes/factor.gd +17 -0
  42. gap/pkg/semigroups/gap/attributes/factor.gi +453 -0
  43. gap/pkg/semigroups/gap/attributes/homomorph.gd +84 -0
  44. gap/pkg/semigroups/gap/attributes/homomorph.gi +591 -0
  45. gap/pkg/semigroups/gap/attributes/inverse.gd +38 -0
  46. gap/pkg/semigroups/gap/attributes/inverse.gi +708 -0
  47. gap/pkg/semigroups/gap/attributes/isomorph.gd +16 -0
  48. gap/pkg/semigroups/gap/attributes/isomorph.gi +377 -0
  49. gap/pkg/semigroups/gap/attributes/isorms.gd +49 -0
  50. gap/pkg/semigroups/gap/attributes/isorms.gi +1383 -0
  51. gap/pkg/semigroups/gap/attributes/maximal.gd +16 -0
  52. gap/pkg/semigroups/gap/attributes/maximal.gi +1876 -0
  53. gap/pkg/semigroups/gap/attributes/properties.gd +109 -0
  54. gap/pkg/semigroups/gap/attributes/properties.gi +1658 -0
  55. gap/pkg/semigroups/gap/attributes/rms-translat.gd +39 -0
  56. gap/pkg/semigroups/gap/attributes/rms-translat.gi +1078 -0
  57. gap/pkg/semigroups/gap/attributes/semifp.gd +12 -0
  58. gap/pkg/semigroups/gap/attributes/semifp.gi +84 -0
  59. gap/pkg/semigroups/gap/attributes/translat.gd +474 -0
  60. gap/pkg/semigroups/gap/attributes/translat.gi +1779 -0
  61. gap/pkg/semigroups/gap/congruences/cong.gd +154 -0
  62. gap/pkg/semigroups/gap/congruences/cong.gi +351 -0
  63. gap/pkg/semigroups/gap/congruences/conginv.gd +38 -0
  64. gap/pkg/semigroups/gap/congruences/conginv.gi +589 -0
  65. gap/pkg/semigroups/gap/congruences/conglatt.gd +101 -0
  66. gap/pkg/semigroups/gap/congruences/conglatt.gi +886 -0
  67. gap/pkg/semigroups/gap/congruences/congpairs.gd +21 -0
  68. gap/pkg/semigroups/gap/congruences/congpairs.gi +272 -0
  69. gap/pkg/semigroups/gap/congruences/congpart.gd +90 -0
  70. gap/pkg/semigroups/gap/congruences/congpart.gi +449 -0
  71. gap/pkg/semigroups/gap/congruences/congrees.gd +20 -0
  72. gap/pkg/semigroups/gap/congruences/congrees.gi +313 -0
  73. gap/pkg/semigroups/gap/congruences/congrms.gd +54 -0
  74. gap/pkg/semigroups/gap/congruences/congrms.gi +1467 -0
  75. gap/pkg/semigroups/gap/congruences/congsemigraph.gd +28 -0
  76. gap/pkg/semigroups/gap/congruences/congsemigraph.gi +289 -0
  77. gap/pkg/semigroups/gap/congruences/congsimple.gd +27 -0
  78. gap/pkg/semigroups/gap/congruences/congsimple.gi +236 -0
  79. gap/pkg/semigroups/gap/congruences/conguniv.gd +20 -0
  80. gap/pkg/semigroups/gap/congruences/conguniv.gi +271 -0
  81. gap/pkg/semigroups/gap/congruences/congwordgraph.gd +21 -0
  82. gap/pkg/semigroups/gap/congruences/congwordgraph.gi +250 -0
  83. gap/pkg/semigroups/gap/elements/bipart.gd +71 -0
  84. gap/pkg/semigroups/gap/elements/bipart.gi +995 -0
  85. gap/pkg/semigroups/gap/elements/blocks.gd +31 -0
  86. gap/pkg/semigroups/gap/elements/blocks.gi +134 -0
  87. gap/pkg/semigroups/gap/elements/boolmat.gd +74 -0
  88. gap/pkg/semigroups/gap/elements/boolmat.gi +726 -0
  89. gap/pkg/semigroups/gap/elements/elements.gd +11 -0
  90. gap/pkg/semigroups/gap/elements/elements.gi +121 -0
  91. gap/pkg/semigroups/gap/elements/ffmat.gd +71 -0
  92. gap/pkg/semigroups/gap/elements/ffmat.gi +311 -0
  93. gap/pkg/semigroups/gap/elements/maxplusmat.gd +131 -0
  94. gap/pkg/semigroups/gap/elements/maxplusmat.gi +782 -0
  95. gap/pkg/semigroups/gap/elements/pbr.gd +51 -0
  96. gap/pkg/semigroups/gap/elements/pbr.gi +740 -0
  97. gap/pkg/semigroups/gap/elements/pperm.gd +11 -0
  98. gap/pkg/semigroups/gap/elements/pperm.gi +14 -0
  99. gap/pkg/semigroups/gap/elements/semiringmat.gd +136 -0
  100. gap/pkg/semigroups/gap/elements/semiringmat.gi +717 -0
  101. gap/pkg/semigroups/gap/elements/star.gd +21 -0
  102. gap/pkg/semigroups/gap/elements/star.gi +21 -0
  103. gap/pkg/semigroups/gap/elements/trans.gd +13 -0
  104. gap/pkg/semigroups/gap/elements/trans.gi +50 -0
  105. gap/pkg/semigroups/gap/fp/freeband.gd +22 -0
  106. gap/pkg/semigroups/gap/fp/freeband.gi +502 -0
  107. gap/pkg/semigroups/gap/fp/freeinverse.gd +30 -0
  108. gap/pkg/semigroups/gap/fp/freeinverse.gi +465 -0
  109. gap/pkg/semigroups/gap/fp/tietze.gd +89 -0
  110. gap/pkg/semigroups/gap/fp/tietze.gi +1578 -0
  111. gap/pkg/semigroups/gap/fp/word.gd +15 -0
  112. gap/pkg/semigroups/gap/fp/word.gi +67 -0
  113. gap/pkg/semigroups/gap/greens/acting-inverse.gi +774 -0
  114. gap/pkg/semigroups/gap/greens/acting-regular.gi +553 -0
  115. gap/pkg/semigroups/gap/greens/acting.gd +81 -0
  116. gap/pkg/semigroups/gap/greens/acting.gi +2433 -0
  117. gap/pkg/semigroups/gap/greens/froidure-pin.gd +25 -0
  118. gap/pkg/semigroups/gap/greens/froidure-pin.gi +741 -0
  119. gap/pkg/semigroups/gap/greens/generic.gd +117 -0
  120. gap/pkg/semigroups/gap/greens/generic.gi +630 -0
  121. gap/pkg/semigroups/gap/ideals/acting.gd +17 -0
  122. gap/pkg/semigroups/gap/ideals/acting.gi +1155 -0
  123. gap/pkg/semigroups/gap/ideals/froidure-pin.gd +11 -0
  124. gap/pkg/semigroups/gap/ideals/froidure-pin.gi +105 -0
  125. gap/pkg/semigroups/gap/ideals/ideals.gd +45 -0
  126. gap/pkg/semigroups/gap/ideals/ideals.gi +442 -0
  127. gap/pkg/semigroups/gap/ideals/lambda-rho.gd +16 -0
  128. gap/pkg/semigroups/gap/ideals/lambda-rho.gi +614 -0
  129. gap/pkg/semigroups/gap/libsemigroups/cong.gd +24 -0
  130. gap/pkg/semigroups/gap/libsemigroups/cong.gi +431 -0
  131. gap/pkg/semigroups/gap/libsemigroups/fpsemi.gd +16 -0
  132. gap/pkg/semigroups/gap/libsemigroups/fpsemi.gi +53 -0
  133. gap/pkg/semigroups/gap/libsemigroups/froidure-pin.gd +17 -0
  134. gap/pkg/semigroups/gap/libsemigroups/froidure-pin.gi +945 -0
  135. gap/pkg/semigroups/gap/libsemigroups/sims1.gd +38 -0
  136. gap/pkg/semigroups/gap/libsemigroups/sims1.gi +308 -0
  137. gap/pkg/semigroups/gap/main/acting.gd +36 -0
  138. gap/pkg/semigroups/gap/main/acting.gi +779 -0
  139. gap/pkg/semigroups/gap/main/froidure-pin.gd +72 -0
  140. gap/pkg/semigroups/gap/main/froidure-pin.gi +655 -0
  141. gap/pkg/semigroups/gap/main/graded.gd +26 -0
  142. gap/pkg/semigroups/gap/main/graded.gi +355 -0
  143. gap/pkg/semigroups/gap/main/lambda-rho.gd +29 -0
  144. gap/pkg/semigroups/gap/main/lambda-rho.gi +514 -0
  145. gap/pkg/semigroups/gap/main/orbits.gd +24 -0
  146. gap/pkg/semigroups/gap/main/orbits.gi +512 -0
  147. gap/pkg/semigroups/gap/main/semiact.gd +20 -0
  148. gap/pkg/semigroups/gap/main/semiact.gi +821 -0
  149. gap/pkg/semigroups/gap/main/setup.gd +61 -0
  150. gap/pkg/semigroups/gap/main/setup.gi +1094 -0
  151. gap/pkg/semigroups/gap/obsolete.gd +9 -0
  152. gap/pkg/semigroups/gap/obsolete.gi +14 -0
  153. gap/pkg/semigroups/gap/options.g +55 -0
  154. gap/pkg/semigroups/gap/semigroups/grpperm.gd +12 -0
  155. gap/pkg/semigroups/gap/semigroups/grpperm.gi +177 -0
  156. gap/pkg/semigroups/gap/semigroups/semibipart.gd +28 -0
  157. gap/pkg/semigroups/gap/semigroups/semibipart.gi +570 -0
  158. gap/pkg/semigroups/gap/semigroups/semiboolmat.gd +20 -0
  159. gap/pkg/semigroups/gap/semigroups/semiboolmat.gi +104 -0
  160. gap/pkg/semigroups/gap/semigroups/semicons.gd +52 -0
  161. gap/pkg/semigroups/gap/semigroups/semicons.gi +1194 -0
  162. gap/pkg/semigroups/gap/semigroups/semidp.gd +13 -0
  163. gap/pkg/semigroups/gap/semigroups/semidp.gi +509 -0
  164. gap/pkg/semigroups/gap/semigroups/semieunit.gd +126 -0
  165. gap/pkg/semigroups/gap/semigroups/semieunit.gi +889 -0
  166. gap/pkg/semigroups/gap/semigroups/semiex.gd +104 -0
  167. gap/pkg/semigroups/gap/semigroups/semiex.gi +1590 -0
  168. gap/pkg/semigroups/gap/semigroups/semiffmat.gd +37 -0
  169. gap/pkg/semigroups/gap/semigroups/semiffmat.gi +565 -0
  170. gap/pkg/semigroups/gap/semigroups/semifp.gd +28 -0
  171. gap/pkg/semigroups/gap/semigroups/semifp.gi +1364 -0
  172. gap/pkg/semigroups/gap/semigroups/semigraph.gd +40 -0
  173. gap/pkg/semigroups/gap/semigroups/semigraph.gi +292 -0
  174. gap/pkg/semigroups/gap/semigroups/semigrp.gd +165 -0
  175. gap/pkg/semigroups/gap/semigroups/semigrp.gi +1225 -0
  176. gap/pkg/semigroups/gap/semigroups/semimaxplus.gd +72 -0
  177. gap/pkg/semigroups/gap/semigroups/semimaxplus.gi +710 -0
  178. gap/pkg/semigroups/gap/semigroups/semintmat.gd +13 -0
  179. gap/pkg/semigroups/gap/semigroups/semintmat.gi +74 -0
  180. gap/pkg/semigroups/gap/semigroups/semipbr.gd +19 -0
  181. gap/pkg/semigroups/gap/semigroups/semipbr.gi +139 -0
  182. gap/pkg/semigroups/gap/semigroups/semipperm.gd +27 -0
  183. gap/pkg/semigroups/gap/semigroups/semipperm.gi +711 -0
  184. gap/pkg/semigroups/gap/semigroups/semiquo.gd +14 -0
  185. gap/pkg/semigroups/gap/semigroups/semiquo.gi +97 -0
  186. gap/pkg/semigroups/gap/semigroups/semiringmat.gd +16 -0
  187. gap/pkg/semigroups/gap/semigroups/semiringmat.gi +21 -0
  188. gap/pkg/semigroups/gap/semigroups/semirms.gd +19 -0
  189. gap/pkg/semigroups/gap/semigroups/semirms.gi +977 -0
  190. gap/pkg/semigroups/gap/semigroups/semitrans.gd +49 -0
  191. gap/pkg/semigroups/gap/semigroups/semitrans.gi +909 -0
  192. gap/pkg/semigroups/gap/tools/display.gd +24 -0
  193. gap/pkg/semigroups/gap/tools/display.gi +749 -0
  194. gap/pkg/semigroups/gap/tools/io.gd +17 -0
  195. gap/pkg/semigroups/gap/tools/io.gi +543 -0
  196. gap/pkg/semigroups/gap/tools/iterators.gd +16 -0
  197. gap/pkg/semigroups/gap/tools/iterators.gi +253 -0
  198. gap/pkg/semigroups/gap/tools/utils.gd +19 -0
  199. gap/pkg/semigroups/gap/tools/utils.gi +756 -0
  200. gap/pkg/semigroups/gapbind14/.ccls +18 -0
  201. gap/pkg/semigroups/gapbind14/.clang-format +104 -0
  202. gap/pkg/semigroups/gapbind14/CPPLINT.cfg +5 -0
  203. gap/pkg/semigroups/gapbind14/LICENSE +674 -0
  204. gap/pkg/semigroups/gapbind14/README.md +76 -0
  205. gap/pkg/semigroups/gapbind14/demo/.gitignore +4 -0
  206. gap/pkg/semigroups/gapbind14/demo/LICENSE +293 -0
  207. gap/pkg/semigroups/gapbind14/demo/Makefile.gappkg +220 -0
  208. gap/pkg/semigroups/gapbind14/demo/Makefile.in +19 -0
  209. gap/pkg/semigroups/gapbind14/demo/PackageInfo.g +87 -0
  210. gap/pkg/semigroups/gapbind14/demo/README.md +17 -0
  211. gap/pkg/semigroups/gapbind14/demo/configure +34 -0
  212. gap/pkg/semigroups/gapbind14/demo/gap/gapbind_demo.gd +19 -0
  213. gap/pkg/semigroups/gapbind14/demo/gap/gapbind_demo.gi +10 -0
  214. gap/pkg/semigroups/gapbind14/demo/init.g +16 -0
  215. gap/pkg/semigroups/gapbind14/demo/makedoc.g +10 -0
  216. gap/pkg/semigroups/gapbind14/demo/read.g +6 -0
  217. gap/pkg/semigroups/gapbind14/demo/src/gapbind_demo.cc +142 -0
  218. gap/pkg/semigroups/gapbind14/demo/tst/testall.g +12 -0
  219. gap/pkg/semigroups/gapbind14/include/gapbind14/cpp_fn.hpp +223 -0
  220. gap/pkg/semigroups/gapbind14/include/gapbind14/gap_include.hpp +26 -0
  221. gap/pkg/semigroups/gapbind14/include/gapbind14/gapbind14.hpp +445 -0
  222. gap/pkg/semigroups/gapbind14/include/gapbind14/tame_free_fn.hpp +420 -0
  223. gap/pkg/semigroups/gapbind14/include/gapbind14/tame_mem_fn.hpp +556 -0
  224. gap/pkg/semigroups/gapbind14/include/gapbind14/to_cpp.hpp +162 -0
  225. gap/pkg/semigroups/gapbind14/include/gapbind14/to_gap.hpp +158 -0
  226. gap/pkg/semigroups/gapbind14/src/.clang-format +108 -0
  227. gap/pkg/semigroups/gapbind14/src/gapbind14.cpp +334 -0
  228. gap/pkg/semigroups/init.g +150 -0
  229. gap/pkg/semigroups/m4/ax_append_flag.m4 +50 -0
  230. gap/pkg/semigroups/m4/ax_check_compile_flag.m4 +53 -0
  231. gap/pkg/semigroups/m4/ax_check_hpcombi.m4 +121 -0
  232. gap/pkg/semigroups/m4/ax_check_libsemigroup.m4 +68 -0
  233. gap/pkg/semigroups/m4/ax_compare_version.m4 +177 -0
  234. gap/pkg/semigroups/m4/ax_cxx_compile_stdcxx.m4 +1009 -0
  235. gap/pkg/semigroups/m4/ax_cxx_compile_stdcxx_14.m4 +34 -0
  236. gap/pkg/semigroups/m4/ax_prefix_config_h.m4 +203 -0
  237. gap/pkg/semigroups/m4/ax_pthread.m4 +522 -0
  238. gap/pkg/semigroups/m4/find_gap.m4 +94 -0
  239. gap/pkg/semigroups/makedoc.g +153 -0
  240. gap/pkg/semigroups/prerequisites.sh +62 -0
  241. gap/pkg/semigroups/read.g +105 -0
  242. gap/pkg/semigroups/release.toml +6 -0
  243. gap/pkg/semigroups/tst/extreme/README +2 -0
  244. gap/pkg/semigroups/tst/extreme/attrinv.tst +703 -0
  245. gap/pkg/semigroups/tst/extreme/bipart.tst +2803 -0
  246. gap/pkg/semigroups/tst/extreme/closure.tst +652 -0
  247. gap/pkg/semigroups/tst/extreme/cong.tst +286 -0
  248. gap/pkg/semigroups/tst/extreme/conginv.tst +43 -0
  249. gap/pkg/semigroups/tst/extreme/examples.tst +2449 -0
  250. gap/pkg/semigroups/tst/extreme/freeband.tst +37 -0
  251. gap/pkg/semigroups/tst/extreme/greens-acting-regular.tst +27 -0
  252. gap/pkg/semigroups/tst/extreme/greens-acting.tst +1999 -0
  253. gap/pkg/semigroups/tst/extreme/ideals.tst +858 -0
  254. gap/pkg/semigroups/tst/extreme/inverse.tst +1025 -0
  255. gap/pkg/semigroups/tst/extreme/maximal.tst +856 -0
  256. gap/pkg/semigroups/tst/extreme/misc.tst +4236 -0
  257. gap/pkg/semigroups/tst/extreme/monoid_pkg.tst +1488 -0
  258. gap/pkg/semigroups/tst/extreme/properties.tst +914 -0
  259. gap/pkg/semigroups/tst/extreme/semibipart.tst +2837 -0
  260. gap/pkg/semigroups/tst/extreme/semieunit.tst +49 -0
  261. gap/pkg/semigroups/tst/extreme/semiffmat.tst +353 -0
  262. gap/pkg/semigroups/tst/extreme/semigroups.tst +245 -0
  263. gap/pkg/semigroups/tst/extreme/semiiter.tst +58 -0
  264. gap/pkg/semigroups/tst/extreme/semirms.tst +1091 -0
  265. gap/pkg/semigroups/tst/extreme/transform.tst +305 -0
  266. gap/pkg/semigroups/tst/extreme/translat.tst +44 -0
  267. gap/pkg/semigroups/tst/standard/README +2 -0
  268. gap/pkg/semigroups/tst/standard/attributes/acting.tst +388 -0
  269. gap/pkg/semigroups/tst/standard/attributes/attr.tst +2404 -0
  270. gap/pkg/semigroups/tst/standard/attributes/dual.tst +308 -0
  271. gap/pkg/semigroups/tst/standard/attributes/factor.tst +629 -0
  272. gap/pkg/semigroups/tst/standard/attributes/homomorph.tst +1134 -0
  273. gap/pkg/semigroups/tst/standard/attributes/inverse.tst +1521 -0
  274. gap/pkg/semigroups/tst/standard/attributes/isomorph.tst +435 -0
  275. gap/pkg/semigroups/tst/standard/attributes/isorms.tst +1147 -0
  276. gap/pkg/semigroups/tst/standard/attributes/maximal.tst +853 -0
  277. gap/pkg/semigroups/tst/standard/attributes/properties.tst +2028 -0
  278. gap/pkg/semigroups/tst/standard/attributes/semifp.tst +53 -0
  279. gap/pkg/semigroups/tst/standard/attributes/translat.tst +796 -0
  280. gap/pkg/semigroups/tst/standard/congruences/cong.tst +1044 -0
  281. gap/pkg/semigroups/tst/standard/congruences/conginv.tst +292 -0
  282. gap/pkg/semigroups/tst/standard/congruences/conglatt.tst +421 -0
  283. gap/pkg/semigroups/tst/standard/congruences/congpairs.tst +1011 -0
  284. gap/pkg/semigroups/tst/standard/congruences/congrees.tst +288 -0
  285. gap/pkg/semigroups/tst/standard/congruences/congrms.tst +701 -0
  286. gap/pkg/semigroups/tst/standard/congruences/congsemigraph.tst +422 -0
  287. gap/pkg/semigroups/tst/standard/congruences/congsimple.tst +311 -0
  288. gap/pkg/semigroups/tst/standard/congruences/conguniv.tst +259 -0
  289. gap/pkg/semigroups/tst/standard/congruences/congwordgraph.tst +330 -0
  290. gap/pkg/semigroups/tst/standard/elements/bipart.tst +783 -0
  291. gap/pkg/semigroups/tst/standard/elements/blocks.tst +166 -0
  292. gap/pkg/semigroups/tst/standard/elements/boolmat.tst +608 -0
  293. gap/pkg/semigroups/tst/standard/elements/elements.tst +117 -0
  294. gap/pkg/semigroups/tst/standard/elements/ffmat.tst +349 -0
  295. gap/pkg/semigroups/tst/standard/elements/maxplusmat.tst +613 -0
  296. gap/pkg/semigroups/tst/standard/elements/pbr.tst +506 -0
  297. gap/pkg/semigroups/tst/standard/elements/pperm.tst +32 -0
  298. gap/pkg/semigroups/tst/standard/elements/semiringmat.tst +601 -0
  299. gap/pkg/semigroups/tst/standard/elements/trans.tst +58 -0
  300. gap/pkg/semigroups/tst/standard/fp/freeband.tst +311 -0
  301. gap/pkg/semigroups/tst/standard/fp/freeinverse.tst +147 -0
  302. gap/pkg/semigroups/tst/standard/fp/tietze.tst +780 -0
  303. gap/pkg/semigroups/tst/standard/fp/word.tst +106 -0
  304. gap/pkg/semigroups/tst/standard/greens/acting-inverse.tst +545 -0
  305. gap/pkg/semigroups/tst/standard/greens/acting-regular.tst +396 -0
  306. gap/pkg/semigroups/tst/standard/greens/acting.tst +2033 -0
  307. gap/pkg/semigroups/tst/standard/greens/froidure-pin.tst +1831 -0
  308. gap/pkg/semigroups/tst/standard/greens/generic.tst +1436 -0
  309. gap/pkg/semigroups/tst/standard/ideals/acting.tst +279 -0
  310. gap/pkg/semigroups/tst/standard/ideals/froidure-pin.tst +178 -0
  311. gap/pkg/semigroups/tst/standard/ideals/ideals.tst +380 -0
  312. gap/pkg/semigroups/tst/standard/libsemigroups/cong.tst +310 -0
  313. gap/pkg/semigroups/tst/standard/libsemigroups/froidure-pin.tst +778 -0
  314. gap/pkg/semigroups/tst/standard/libsemigroups/sims1.tst +379 -0
  315. gap/pkg/semigroups/tst/standard/main/acting.tst +411 -0
  316. gap/pkg/semigroups/tst/standard/main/froidure-pin.tst +392 -0
  317. gap/pkg/semigroups/tst/standard/main/semiact.tst +203 -0
  318. gap/pkg/semigroups/tst/standard/main/setup.tst +1144 -0
  319. gap/pkg/semigroups/tst/standard/obsolete.tst +19 -0
  320. gap/pkg/semigroups/tst/standard/options.tst +54 -0
  321. gap/pkg/semigroups/tst/standard/semigroups/grpperm.tst +581 -0
  322. gap/pkg/semigroups/tst/standard/semigroups/semibipart.tst +2635 -0
  323. gap/pkg/semigroups/tst/standard/semigroups/semiboolmat.tst +1871 -0
  324. gap/pkg/semigroups/tst/standard/semigroups/semicons.tst +1173 -0
  325. gap/pkg/semigroups/tst/standard/semigroups/semidp.tst +739 -0
  326. gap/pkg/semigroups/tst/standard/semigroups/semieunit.tst +339 -0
  327. gap/pkg/semigroups/tst/standard/semigroups/semiex.tst +2055 -0
  328. gap/pkg/semigroups/tst/standard/semigroups/semiffmat.tst +746 -0
  329. gap/pkg/semigroups/tst/standard/semigroups/semifp.tst +2702 -0
  330. gap/pkg/semigroups/tst/standard/semigroups/semigraph.tst +133 -0
  331. gap/pkg/semigroups/tst/standard/semigroups/semigrp.tst +1112 -0
  332. gap/pkg/semigroups/tst/standard/semigroups/semimaxplus.tst +654 -0
  333. gap/pkg/semigroups/tst/standard/semigroups/semipbr.tst +2142 -0
  334. gap/pkg/semigroups/tst/standard/semigroups/semipperm.tst +2169 -0
  335. gap/pkg/semigroups/tst/standard/semigroups/semiquo.tst +278 -0
  336. gap/pkg/semigroups/tst/standard/semigroups/semirms.tst +3010 -0
  337. gap/pkg/semigroups/tst/standard/semigroups/semitrans.tst +2758 -0
  338. gap/pkg/semigroups/tst/standard/tools/display.tst +1040 -0
  339. gap/pkg/semigroups/tst/standard/tools/io.tst +363 -0
  340. gap/pkg/semigroups/tst/testinstall.tst +1815 -0
  341. gap/pkg/semigroups/tst/teststandard.g +22 -0
  342. gap/pkg/semigroups/tst/workspaces/load-workspace.tst +142 -0
  343. gap/pkg/semigroups/tst/workspaces/load.g +11 -0
  344. gap/pkg/semigroups/tst/workspaces/save-workspace.tst +166 -0
  345. gap/pkg/semigroups/tst/workspaces/save.g +14 -0
  346. passagemath_gap_pkg_semigroups-10.6.29.dist-info/METADATA +93 -0
  347. passagemath_gap_pkg_semigroups-10.6.29.dist-info/METADATA.bak +94 -0
  348. passagemath_gap_pkg_semigroups-10.6.29.dist-info/RECORD +356 -0
  349. passagemath_gap_pkg_semigroups-10.6.29.dist-info/WHEEL +5 -0
  350. passagemath_gap_pkg_semigroups-10.6.29.dist-info/top_level.txt +1 -0
  351. passagemath_gap_pkg_semigroups.libs/libgcc_s-0cd532bd.so.1 +0 -0
  352. passagemath_gap_pkg_semigroups.libs/libsemigroups-f0b7066b.so.2.0.0 +0 -0
  353. passagemath_gap_pkg_semigroups.libs/libstdc++-5d72f927.so.6.0.33 +0 -0
  354. sage/all__sagemath_gap_pkg_semigroups.py +1 -0
  355. sage/libs/all__sagemath_gap_pkg_semigroups.py +1 -0
  356. sage/libs/gap_pkg_semigroups.abi3.so +0 -0
@@ -0,0 +1,1194 @@
1
+ ############################################################################
2
+ ##
3
+ ## semigroups/semicons.gi
4
+ ## Copyright (C) 2015-2022 James D. Mitchell
5
+ ## Wilf A. Wilson
6
+ ##
7
+ ## Licensing information can be found in the README file of this package.
8
+ ##
9
+ ############################################################################
10
+ ##
11
+
12
+ # Trivial semigroup: main method
13
+
14
+ InstallGlobalFunction(TrivialSemigroup,
15
+ function(arg...)
16
+ local S;
17
+
18
+ if IsEmpty(arg) then
19
+ S := TrivialSemigroupCons(IsTransformationSemigroup, 0);
20
+ elif Length(arg) = 1 and IsInt(arg[1]) and arg[1] >= 0 then
21
+ S := TrivialSemigroupCons(IsTransformationSemigroup, arg[1]);
22
+ elif Length(arg) = 1 and IsOperation(arg[1]) then
23
+ S := TrivialSemigroupCons(arg[1], 0);
24
+ elif Length(arg) = 2 and IsOperation(arg[1]) and IsInt(arg[2])
25
+ and arg[2] >= 0 then
26
+ S := TrivialSemigroupCons(arg[1], arg[2]);
27
+ else
28
+ ErrorNoReturn("the arguments must be a non-negative integer or ",
29
+ "a filter and a non-negative integer");
30
+ fi;
31
+ SetIsTrivial(S, true);
32
+ return S;
33
+ end);
34
+
35
+ # Trivial semigroup: constructors
36
+
37
+ InstallMethod(TrivialSemigroupCons,
38
+ "for IsTransformationSemigroup and an integer",
39
+ [IsTransformationSemigroup, IsInt],
40
+ function(_, deg)
41
+ if deg = 0 then
42
+ return Semigroup(IdentityTransformation);
43
+ fi;
44
+ return Semigroup(ConstantTransformation(deg, 1));
45
+ end);
46
+
47
+ InstallMethod(TrivialSemigroupCons,
48
+ "for IsPartialPermSemigroup and an integer",
49
+ [IsPartialPermSemigroup, IsInt],
50
+ {filt, n} -> Semigroup(PartialPerm([1 .. n])));
51
+
52
+ InstallMethod(TrivialSemigroupCons,
53
+ "for IsBipartitionSemigroup and an integer",
54
+ [IsBipartitionSemigroup, IsInt],
55
+ function(_, deg)
56
+ local n;
57
+ n := Maximum(deg, 1);
58
+ return Semigroup(Bipartition([Concatenation(List([1 .. n], x -> [-x, x]))]));
59
+ end);
60
+
61
+ InstallMethod(TrivialSemigroupCons,
62
+ "for IsBlockBijectionSemigroup and an integer",
63
+ [IsBlockBijectionSemigroup, IsInt],
64
+ function(_, deg)
65
+ local n;
66
+ n := Maximum(deg, 1);
67
+ return TrivialSemigroupCons(IsBipartitionSemigroup, n);
68
+ end);
69
+
70
+ InstallMethod(TrivialSemigroupCons,
71
+ "for IsPBRSemigroup and an integer",
72
+ [IsPBRSemigroup, IsInt],
73
+ function(_, deg)
74
+ local n;
75
+ n := Maximum(deg, 1);
76
+ return Semigroup(IdentityPBR(n));
77
+ end);
78
+
79
+ InstallMethod(TrivialSemigroupCons,
80
+ "for IsBooleanMatSemigroup and an integer",
81
+ [IsBooleanMatSemigroup, IsInt],
82
+ function(_, deg)
83
+ local n;
84
+ n := Maximum(deg, 1);
85
+ return Semigroup(BooleanMat(List([1 .. n], x -> BlistList([1 .. n], [x]))));
86
+ end);
87
+
88
+ # Trivial semigroup: other constructors
89
+
90
+ for _IsXSemigroup in ["IsFpSemigroup",
91
+ "IsFpMonoid",
92
+ "IsNTPMatrixSemigroup",
93
+ "IsMaxPlusMatrixSemigroup",
94
+ "IsMinPlusMatrixSemigroup",
95
+ "IsTropicalMaxPlusMatrixSemigroup",
96
+ "IsTropicalMinPlusMatrixSemigroup",
97
+ "IsProjectiveMaxPlusMatrixSemigroup",
98
+ "IsIntegerMatrixSemigroup",
99
+ "IsReesMatrixSemigroup",
100
+ "IsReesZeroMatrixSemigroup"] do
101
+ InstallMethod(TrivialSemigroupCons,
102
+ Concatenation("for ", _IsXSemigroup, " and an integer"),
103
+ [ValueGlobal(_IsXSemigroup), IsInt],
104
+ function(filter, deg)
105
+ return AsSemigroup(filter,
106
+ TrivialSemigroupCons(IsTransformationSemigroup, deg));
107
+ end);
108
+ od;
109
+
110
+ Unbind(_IsXSemigroup);
111
+
112
+ # Monogenic semigroup: main method
113
+
114
+ InstallGlobalFunction(MonogenicSemigroup,
115
+ function(arg...)
116
+ local filter, m, r, S;
117
+
118
+ if Length(arg) = 2 then
119
+ filter := IsTransformationSemigroup;
120
+ m := arg[1];
121
+ r := arg[2];
122
+ elif Length(arg) = 3 then
123
+ filter := arg[1];
124
+ m := arg[2];
125
+ r := arg[3];
126
+ fi;
127
+
128
+ if not IsBound(m) or not IsPosInt(m) or not IsPosInt(r)
129
+ or not IsOperation(filter) then
130
+ ErrorNoReturn("the arguments must be 2 positive integers or a filter ",
131
+ "and a 2 positive integers");
132
+ fi;
133
+
134
+ S := MonogenicSemigroupCons(filter, m, r);
135
+
136
+ SetSize(S, m + r - 1);
137
+ SetIsMonogenicSemigroup(S, true);
138
+ if m = 1 then
139
+ SetIsGroupAsSemigroup(S, true);
140
+ else
141
+ SetIsGroupAsSemigroup(S, false);
142
+ SetIsRegularSemigroup(S, false);
143
+ fi;
144
+
145
+ SetIsZeroSemigroup(S, r = 1 and m < 3);
146
+ SetMinimalSemigroupGeneratingSet(S, GeneratorsOfSemigroup(S));
147
+
148
+ return S;
149
+ end);
150
+
151
+ # Monogenic semigroup: constructors
152
+
153
+ InstallMethod(MonogenicSemigroupCons,
154
+ "for a IsTransformationSemigroup and two positive integers",
155
+ [IsTransformationSemigroup, IsPosInt, IsPosInt],
156
+ function(_, m, r)
157
+ local t;
158
+
159
+ t := [1 .. r] + 1;
160
+ t[r] := 1;
161
+
162
+ if m <> 1 then # m = 1 specifies a cyclic group
163
+ Append(t, [1 .. m] + r - 1);
164
+ fi;
165
+
166
+ return Semigroup(Transformation(t));
167
+ end);
168
+
169
+ InstallMethod(MonogenicSemigroupCons,
170
+ "for a IsPartialPermSemigroup and two positive integers",
171
+ [IsPartialPermSemigroup, IsPosInt, IsPosInt],
172
+ function(_, m, r)
173
+ local cyclic_group, nilpotent_offset, nilpotent, im;
174
+
175
+ if m = 1 and r = 1 then
176
+ return Semigroup(PartialPerm([], []));
177
+ elif r = 1 then
178
+ cyclic_group := [];
179
+ nilpotent_offset := 0;
180
+ else
181
+ cyclic_group := [1 .. r] + 1;
182
+ cyclic_group[r] := 1;
183
+ nilpotent_offset := r;
184
+ fi;
185
+ nilpotent := [1 .. m - 1] + nilpotent_offset;
186
+ im := Concatenation(cyclic_group, [0], nilpotent);
187
+
188
+ return Semigroup(PartialPerm(im));
189
+ end);
190
+
191
+ InstallMethod(MonogenicSemigroupCons,
192
+ "for a IsBipartitionSemigroup and two positive integers",
193
+ [IsBipartitionSemigroup, IsPosInt, IsPosInt],
194
+ {filter, m, r} -> MonogenicSemigroupCons(IsBlockBijectionSemigroup, m, r));
195
+
196
+ InstallMethod(MonogenicSemigroupCons,
197
+ "for IsBlockBijectionSemigroup and two positive integers",
198
+ [IsBlockBijectionSemigroup, IsPosInt, IsPosInt],
199
+ function(_, m, r)
200
+ local out, offset, i;
201
+
202
+ if m = 1 and r = 1 then
203
+ return Semigroup(Bipartition([[1, -1]]));
204
+ fi;
205
+
206
+ out := [];
207
+ if r = 1 then
208
+ offset := 1;
209
+ else
210
+ for i in [1 .. r - 1] do
211
+ Add(out, [i, -i - 1]);
212
+ od;
213
+ Add(out, [r, -1]);
214
+ offset := r + 1;
215
+ fi;
216
+
217
+ if m <> 1 then
218
+ Add(out, [offset, -offset, offset + 1, -(offset + m)]);
219
+ for i in [offset + 2 .. offset + m] do
220
+ Add(out, [i, -i + 1]);
221
+ od;
222
+ fi;
223
+
224
+ return Semigroup(Bipartition(out));
225
+ end);
226
+
227
+ # Monogenic semigroup: other constructors
228
+
229
+ for _IsXSemigroup in ["IsPBRSemigroup",
230
+ "IsBooleanMatSemigroup",
231
+ "IsNTPMatrixSemigroup",
232
+ "IsMaxPlusMatrixSemigroup",
233
+ "IsMinPlusMatrixSemigroup",
234
+ "IsTropicalMaxPlusMatrixSemigroup",
235
+ "IsTropicalMinPlusMatrixSemigroup",
236
+ "IsProjectiveMaxPlusMatrixSemigroup",
237
+ "IsIntegerMatrixSemigroup",
238
+ "IsReesMatrixSemigroup",
239
+ "IsReesZeroMatrixSemigroup"] do
240
+ InstallMethod(MonogenicSemigroupCons,
241
+ Concatenation("for ", _IsXSemigroup, " and two positive integers"),
242
+ [ValueGlobal(_IsXSemigroup), IsPosInt, IsPosInt],
243
+ function(filter, m, r)
244
+ return AsSemigroup(filter,
245
+ MonogenicSemigroupCons(IsTransformationSemigroup, m, r));
246
+ end);
247
+ od;
248
+ Unbind(_IsXSemigroup);
249
+
250
+ # Rectangular band: main method
251
+
252
+ InstallGlobalFunction(RectangularBand,
253
+ function(arg...)
254
+ local filter, m, n, S;
255
+
256
+ if Length(arg) = 2 then
257
+ filter := IsTransformationSemigroup;
258
+ m := arg[1];
259
+ n := arg[2];
260
+ elif Length(arg) = 3 then
261
+ filter := arg[1];
262
+ m := arg[2];
263
+ n := arg[3];
264
+ fi;
265
+
266
+ if not IsBound(m) or not IsPosInt(m) or not IsPosInt(n)
267
+ or not IsOperation(filter) then
268
+ ErrorNoReturn("the arguments must be 2 positive integers or a filter ",
269
+ "and a 2 positive integers");
270
+ fi;
271
+
272
+ S := RectangularBandCons(filter, m, n);
273
+
274
+ SetSize(S, m * n);
275
+ SetIsRectangularBand(S, true);
276
+ SetNrRClasses(S, m);
277
+ SetNrLClasses(S, n);
278
+ if m <> 1 or n <> 1 then
279
+ SetIsGroupAsSemigroup(S, false);
280
+ SetIsZeroSemigroup(S, false);
281
+ SetIsTrivial(S, false);
282
+ fi;
283
+ SetIsRightZeroSemigroup(S, m = 1);
284
+ SetIsLeftZeroSemigroup(S, n = 1);
285
+
286
+ return S;
287
+ end);
288
+
289
+ # Rectangular band: constructors
290
+
291
+ InstallMethod(RectangularBandCons,
292
+ "for a filter and a positive integer and positive integer",
293
+ [IsTransformationSemigroup, IsPosInt, IsPosInt],
294
+ function(filter, m, n)
295
+ local L, R, div, gen, gens, min, out, i;
296
+
297
+ if m = 1 then
298
+ return RightZeroSemigroup(filter, n);
299
+ elif n = 1 then
300
+ return LeftZeroSemigroup(filter, m);
301
+ fi;
302
+
303
+ # don't do:
304
+ # DirectProduct(LeftZeroSemigroup(m), RightZeroSemigroup(n));
305
+ # because we know a generating set.
306
+
307
+ L := LeftZeroSemigroup(filter, m);
308
+ R := RightZeroSemigroup(filter, n);
309
+ div := DegreeOfTransformationSemigroup(L);
310
+
311
+ gen := function(l, r)
312
+ return Transformation(Concatenation(ListTransformation(L.(l), div),
313
+ ListTransformation(R.(r)) + div));
314
+ end;
315
+
316
+ gens := [];
317
+ min := Minimum(m, n);
318
+
319
+ for i in [1 .. min] do # 'diagonal' generators
320
+ Add(gens, gen(i, i));
321
+ od;
322
+
323
+ for i in [min + 1 .. n] do # additional generators when n > m
324
+ Add(gens, gen(1, i));
325
+ od;
326
+
327
+ for i in [min + 1 .. m] do # additional generators when n < m
328
+ Add(gens, gen(i, 1));
329
+ od;
330
+
331
+ out := Semigroup(gens);
332
+ SetMinimalSemigroupGeneratingSet(out, GeneratorsOfSemigroup(out));
333
+ return out;
334
+ end);
335
+
336
+ InstallMethod(RectangularBandCons,
337
+ "for a filter and two positive integers",
338
+ [IsBipartitionSemigroup, IsPosInt, IsPosInt],
339
+ function(_, m, n)
340
+ local max, min, out, nrpoints, partitions, neg, i;
341
+
342
+ max := Maximum(m, n);
343
+ min := Minimum(m, n);
344
+ out := EmptyPlist(max);
345
+
346
+ # Find a small degree of partition monoid in which to embed rectangular band
347
+ nrpoints := 1;
348
+ while NrPartitionsSet([1 .. nrpoints]) < max do
349
+ nrpoints := nrpoints + 1;
350
+ od;
351
+
352
+ partitions := PartitionsSet([1 .. nrpoints]);
353
+
354
+ for i in [1 .. min] do
355
+ Add(out, Bipartition(Concatenation(partitions[i], -1 * partitions[i])));
356
+ od;
357
+
358
+ neg := -1 * partitions[1];
359
+ for i in [min + 1 .. m] do
360
+ Add(out, Bipartition(Concatenation(partitions[i], neg)));
361
+ od;
362
+
363
+ for i in [min + 1 .. n] do
364
+ Add(out, Bipartition(Concatenation(partitions[1], -1 * partitions[i])));
365
+ od;
366
+
367
+ return Semigroup(out);
368
+ end);
369
+
370
+ InstallMethod(RectangularBandCons,
371
+ "for a filter and a positive integer and positive integer",
372
+ [IsReesMatrixSemigroup, IsPosInt, IsPosInt],
373
+ function(_, m, n)
374
+ local id, mat;
375
+
376
+ id := ();
377
+ mat := List([1 .. n], x -> List([1 .. m], y -> id));
378
+ return ReesMatrixSemigroup(Group(id), mat);
379
+ end);
380
+
381
+ InstallMethod(RectangularBandCons,
382
+ "for IsPBRSemigroup and a pos int, and pos int",
383
+ [IsPBRSemigroup, IsPosInt, IsPosInt],
384
+ function(filter, m, n)
385
+ return AsSemigroup(filter,
386
+ RectangularBandCons(IsBipartitionSemigroup, m, n));
387
+ end);
388
+
389
+ # Rectangular band: other constructors
390
+
391
+ for _IsXSemigroup in ["IsBooleanMatSemigroup",
392
+ "IsNTPMatrixSemigroup",
393
+ "IsMaxPlusMatrixSemigroup",
394
+ "IsMinPlusMatrixSemigroup",
395
+ "IsTropicalMaxPlusMatrixSemigroup",
396
+ "IsTropicalMinPlusMatrixSemigroup",
397
+ "IsProjectiveMaxPlusMatrixSemigroup",
398
+ "IsIntegerMatrixSemigroup"] do
399
+ InstallMethod(RectangularBandCons,
400
+ Concatenation("for ", _IsXSemigroup, ", pos int, and pos int"),
401
+ [ValueGlobal(_IsXSemigroup), IsPosInt, IsPosInt],
402
+ function(filter, m, n)
403
+ return AsSemigroup(filter,
404
+ RectangularBandCons(IsTransformationSemigroup, m, n));
405
+ end);
406
+ od;
407
+ Unbind(_IsXSemigroup);
408
+
409
+ # Free semilattice: main method
410
+
411
+ InstallGlobalFunction(FreeSemilattice,
412
+ function(arg...)
413
+ local filter, n, S;
414
+
415
+ if Length(arg) = 1 then
416
+ filter := IsTransformationSemigroup;
417
+ n := arg[1];
418
+ elif Length(arg) = 2 then
419
+ filter := arg[1];
420
+ n := arg[2];
421
+ else
422
+ ErrorNoReturn("expected 2 arguments found ", Length(arg));
423
+ fi;
424
+
425
+ if not IsPosInt(n) or not IsOperation(filter) then
426
+ ErrorNoReturn("the arguments must be a positive integer or a filter ",
427
+ "and a positive integer");
428
+ fi;
429
+
430
+ S := FreeSemilatticeCons(filter, n);
431
+
432
+ if "IsMagmaWithOne" in NamesFilter(filter) then
433
+ SetSize(S, 2 ^ n);
434
+ else
435
+ SetSize(S, 2 ^ n - 1);
436
+ fi;
437
+
438
+ SetIsSemilattice(S, true);
439
+
440
+ return S;
441
+ end);
442
+
443
+ # Free semilattice: constructors
444
+
445
+ InstallMethod(FreeSemilatticeCons,
446
+ "for IsFpSemigroup and a pos int",
447
+ [IsFpSemigroup, IsPosInt],
448
+ function(_, n)
449
+ local F, gen, l, i, j, commR, idemR;
450
+ F := FreeSemigroup(n);
451
+ gen := GeneratorsOfSemigroup(F);
452
+ l := Length(gen);
453
+
454
+ commR := [];
455
+ for i in [1 .. l - 1] do
456
+ for j in [i + 1 .. l] do
457
+ Add(commR, [gen[i] * gen[j], gen[j] * gen[i]]);
458
+ od;
459
+ od;
460
+
461
+ idemR := List(gen, x -> [x * x, x]);
462
+ return F / Concatenation(commR, idemR);
463
+ end);
464
+
465
+ InstallMethod(FreeSemilatticeCons,
466
+ "for IsFpSemigroup and a pos int",
467
+ [IsFpMonoid, IsPosInt],
468
+ function(_, n)
469
+ local F, gen, l, i, j, commR, idemR;
470
+ F := FreeMonoid(n);
471
+ gen := GeneratorsOfSemigroup(F);
472
+ l := Length(gen);
473
+
474
+ commR := [];
475
+ for i in [1 .. l - 1] do
476
+ for j in [i + 1 .. l] do
477
+ Add(commR, [gen[i] * gen[j], gen[j] * gen[i]]);
478
+ od;
479
+ od;
480
+
481
+ idemR := List(gen, x -> [x * x, x]);
482
+ return F / Concatenation(commR, idemR);
483
+ end);
484
+
485
+ InstallMethod(FreeSemilatticeCons,
486
+ "for IsTransformationSemigroup and a pos int",
487
+ [IsTransformationSemigroup, IsPosInt],
488
+ function(_, n)
489
+ local gen, i, L;
490
+ gen := [];
491
+ for i in [1 .. n] do
492
+ L := [1 .. n + 1];
493
+ L[i] := n + 1;
494
+ Add(gen, Transformation(L));
495
+ od;
496
+ return Semigroup(gen);
497
+ end);
498
+
499
+ InstallMethod(FreeSemilatticeCons,
500
+ "for IsTransformationSemigroup and a pos int",
501
+ [IsTransformationMonoid, IsPosInt],
502
+ function(_, n)
503
+ local gen, i, L;
504
+ gen := [];
505
+ for i in [1 .. n] do
506
+ L := [1 .. n + 1];
507
+ L[i] := n + 1;
508
+ Add(gen, Transformation(L));
509
+ od;
510
+ return Monoid(gen);
511
+ end);
512
+
513
+ InstallMethod(FreeSemilatticeCons,
514
+ "for IsPartialPermSemigroup and a pos int",
515
+ [IsPartialPermSemigroup, IsPosInt],
516
+ function(_, n)
517
+ local gen, i, L;
518
+ gen := [];
519
+ for i in [1 .. n] do
520
+ L := [1 .. n];
521
+ Remove(L, i);
522
+ Add(gen, PartialPerm(L, L));
523
+ od;
524
+ return Semigroup(gen);
525
+ end);
526
+
527
+ InstallMethod(FreeSemilatticeCons,
528
+ "for IsPartialPermSemigroup and a pos int",
529
+ [IsPartialPermMonoid, IsPosInt],
530
+ function(_, n)
531
+ local gen, i, L;
532
+ gen := [];
533
+ for i in [1 .. n] do
534
+ L := [1 .. n];
535
+ Remove(L, i);
536
+ Add(gen, PartialPerm(L, L));
537
+ od;
538
+ return Monoid(gen);
539
+ end);
540
+
541
+ # Free semilattice: other constructors
542
+
543
+ for _IsXSemigroup in ["IsBipartitionSemigroup",
544
+ "IsPBRSemigroup",
545
+ "IsBooleanMatSemigroup",
546
+ "IsNTPMatrixSemigroup",
547
+ "IsMaxPlusMatrixSemigroup",
548
+ "IsMinPlusMatrixSemigroup",
549
+ "IsTropicalMaxPlusMatrixSemigroup",
550
+ "IsTropicalMinPlusMatrixSemigroup",
551
+ "IsProjectiveMaxPlusMatrixSemigroup",
552
+ "IsIntegerMatrixSemigroup"] do
553
+ InstallMethod(FreeSemilatticeCons,
554
+ Concatenation("for ", _IsXSemigroup, ", and pos int"),
555
+ [ValueGlobal(_IsXSemigroup), IsPosInt],
556
+ function(filter, n)
557
+ return AsSemigroup(filter,
558
+ FreeSemilatticeCons(IsTransformationSemigroup, n));
559
+ end);
560
+ od;
561
+
562
+ for _IsXMonoid in ["IsBipartitionMonoid",
563
+ "IsPBRMonoid",
564
+ "IsBooleanMatMonoid",
565
+ "IsNTPMatrixMonoid",
566
+ "IsMaxPlusMatrixMonoid",
567
+ "IsMinPlusMatrixMonoid",
568
+ "IsTropicalMaxPlusMatrixMonoid",
569
+ "IsTropicalMinPlusMatrixMonoid",
570
+ "IsProjectiveMaxPlusMatrixMonoid",
571
+ "IsIntegerMatrixMonoid"] do
572
+ InstallMethod(FreeSemilatticeCons,
573
+ Concatenation("for ", _IsXMonoid, ", and pos int"),
574
+ [ValueGlobal(_IsXMonoid), IsPosInt],
575
+ function(filter, n)
576
+ return AsMonoid(filter,
577
+ FreeSemilatticeCons(IsTransformationMonoid, n));
578
+ end);
579
+ od;
580
+
581
+ Unbind(_IsXSemigroup);
582
+ Unbind(_IsXMonoid);
583
+
584
+ # Zero semigroup: main method
585
+
586
+ InstallGlobalFunction(ZeroSemigroup,
587
+ function(arg...)
588
+ local filter, n, S;
589
+
590
+ if Length(arg) = 1 then
591
+ filter := IsTransformationSemigroup;
592
+ n := arg[1];
593
+ elif Length(arg) = 2 then
594
+ filter := arg[1];
595
+ n := arg[2];
596
+ fi;
597
+
598
+ if not IsBound(n) or not IsPosInt(n) or not IsOperation(filter) then
599
+ ErrorNoReturn("the arguments must be a positive integer or a filter ",
600
+ "and a positive integer");
601
+ fi;
602
+
603
+ S := ZeroSemigroupCons(filter, n);
604
+
605
+ SetSize(S, n);
606
+ SetIsZeroSemigroup(S, true);
607
+ SetMultiplicativeZero(S, S.1 ^ 2);
608
+ SetIsGroupAsSemigroup(S, IsTrivial(S));
609
+ SetIsRegularSemigroup(S, IsTrivial(S));
610
+ SetIsMonogenicSemigroup(S, n <= 2);
611
+ SetMinimalSemigroupGeneratingSet(S, GeneratorsOfSemigroup(S));
612
+ return S;
613
+ end);
614
+
615
+ # Zero semigroup: constructors
616
+
617
+ InstallMethod(ZeroSemigroupCons,
618
+ "for IsTransformationSemigroup and a positive integer",
619
+ [IsTransformationSemigroup, IsPosInt],
620
+ function(_, n)
621
+ local out, max, deg, N, R, gens, im, iter, r, i;
622
+
623
+ if n = 1 then
624
+ out := Semigroup(Transformation([1]));
625
+ SetMultiplicativeZero(out, out.1);
626
+ return out;
627
+ fi;
628
+
629
+ # calculate the minimal possible degree
630
+ max := 0;
631
+ deg := 0;
632
+ while max < n do
633
+ deg := deg + 1;
634
+ for r in [1 .. deg - 1] do
635
+ N := r ^ (deg - r);
636
+ if N > max then
637
+ max := N;
638
+ R := r;
639
+ fi;
640
+ od;
641
+ od;
642
+
643
+ gens := [];
644
+ im := [1 .. R] * 0 + 1;
645
+ iter := IteratorOfTuples([1 .. R], deg - R);
646
+ NextIterator(iter); # skip the zero
647
+
648
+ for i in [1 .. n - 1] do
649
+ Add(gens, Transformation(Concatenation(im, NextIterator(iter))));
650
+ od;
651
+
652
+ out := Semigroup(gens, rec(acting := false));
653
+ SetMultiplicativeZero(out, ConstantTransformation(deg, 1));
654
+
655
+ return out;
656
+ end);
657
+
658
+ InstallMethod(ZeroSemigroupCons,
659
+ "for IsPartialPermSemigroup and a positive integer",
660
+ [IsPartialPermSemigroup, IsPosInt],
661
+ function(_, n)
662
+ local zero, gens, out, i;
663
+
664
+ zero := PartialPerm([], []);
665
+ if n = 1 then
666
+ gens := [zero];
667
+ else
668
+ gens := EmptyPlist(n - 1);
669
+ for i in [1 .. n - 1] do
670
+ gens[i] := PartialPerm([2 * i - 1], [2 * i]);
671
+ od;
672
+ fi;
673
+ out := Semigroup(gens);
674
+ SetMultiplicativeZero(out, zero);
675
+ return out;
676
+ end);
677
+
678
+ InstallMethod(ZeroSemigroupCons,
679
+ "for a filter and a positive integer",
680
+ [IsBlockBijectionSemigroup, IsPosInt],
681
+ function(_, n)
682
+ local zero, gens, points, pair, out, i;
683
+
684
+ if n = 1 then
685
+ zero := Bipartition([[1, -1]]);
686
+ gens := [zero];
687
+ elif n = 2 then
688
+ points := Concatenation([1 .. 3], [-3 .. -1]);
689
+ zero := Bipartition([points]);
690
+ gens := [Bipartition([[1, -2], [-1, 2, 3, -3]])];
691
+ else
692
+ points := Concatenation([1 .. 2 * (n - 1)], -[1 .. 2 * (n - 1)]);
693
+ zero := Bipartition([points]);
694
+ gens := EmptyPlist(n - 1);
695
+ for i in [1 .. n - 1] do
696
+ pair := [2 * i - 1, -(2 * i)];
697
+ gens[i] := Bipartition([pair, Difference(points, pair)]);
698
+ od;
699
+ fi;
700
+ out := Semigroup(gens);
701
+ SetMultiplicativeZero(out, zero);
702
+ return out;
703
+ end);
704
+
705
+ InstallMethod(ZeroSemigroupCons,
706
+ "for a filter and a positive integer",
707
+ [IsBipartitionSemigroup, IsPosInt],
708
+ function(_, n)
709
+ local zero, out;
710
+
711
+ if n = 2 then
712
+ zero := Bipartition([[1], [2], [-1], [-2]]);
713
+ out := Semigroup(Bipartition([[1, -2], [2], [-1]]));
714
+ SetMultiplicativeZero(out, zero);
715
+ return out;
716
+ fi;
717
+
718
+ return AsSemigroup(IsBipartitionSemigroup,
719
+ ZeroSemigroupCons(IsTransformationSemigroup, n));
720
+ end);
721
+
722
+ InstallMethod(ZeroSemigroupCons,
723
+ "for a IsReesZeroMatrixSemigroup and a positive integer",
724
+ [IsReesZeroMatrixSemigroup, IsPosInt],
725
+ function(_, n)
726
+ local mat;
727
+
728
+ if n = 1 then
729
+ ErrorNoReturn("there is no Rees 0-matrix semigroup of order 1");
730
+ fi;
731
+ mat := [[1 .. n - 1] * 0];
732
+ return ReesZeroMatrixSemigroup(Group(()), mat);
733
+ end);
734
+
735
+ # Zero semigroup: other constructors
736
+
737
+ for _IsXSemigroup in ["IsPBRSemigroup",
738
+ "IsBooleanMatSemigroup",
739
+ "IsNTPMatrixSemigroup",
740
+ "IsMaxPlusMatrixSemigroup",
741
+ "IsMinPlusMatrixSemigroup",
742
+ "IsTropicalMaxPlusMatrixSemigroup",
743
+ "IsTropicalMinPlusMatrixSemigroup",
744
+ "IsProjectiveMaxPlusMatrixSemigroup",
745
+ "IsIntegerMatrixSemigroup"] do
746
+ InstallMethod(ZeroSemigroupCons,
747
+ Concatenation("for ", _IsXSemigroup, " and a positive integer"),
748
+ [ValueGlobal(_IsXSemigroup), IsPosInt],
749
+ function(filter, n)
750
+ return AsSemigroup(filter,
751
+ ZeroSemigroupCons(IsTransformationSemigroup, n));
752
+ end);
753
+ od;
754
+ Unbind(_IsXSemigroup);
755
+
756
+ # Left zero semigroup: main method
757
+
758
+ InstallGlobalFunction(LeftZeroSemigroup,
759
+ function(arg...)
760
+ local filt, n, S, max, deg, N, R, gens, im, iter, r, i;
761
+
762
+ if Length(arg) = 1 then
763
+ filt := IsTransformationSemigroup;
764
+ n := arg[1];
765
+ elif Length(arg) = 2 then
766
+ filt := arg[1];
767
+ n := arg[2];
768
+ fi;
769
+
770
+ if not IsBound(filt) or not IsFilter(filt) or not IsPosInt(n) then
771
+ ErrorNoReturn("the arguments must be a positive integer or ",
772
+ "a filter and a positive integer");
773
+ elif n = 1 then
774
+ return TrivialSemigroup(filt);
775
+ elif filt <> IsTransformationSemigroup then
776
+ S := RectangularBand(filt, n, 1);
777
+ SetIsLeftZeroSemigroup(S, true);
778
+ return S;
779
+ fi;
780
+
781
+ # calculate the minimal possible degree
782
+ max := 0;
783
+ deg := 0;
784
+ while max < n do
785
+ deg := deg + 1;
786
+ for r in [1 .. deg - 1] do
787
+ N := r ^ (deg - r);
788
+ if N > max then
789
+ max := N;
790
+ R := r;
791
+ fi;
792
+ od;
793
+ od;
794
+
795
+ gens := [];
796
+ im := [1 .. R];
797
+ iter := IteratorOfTuples([1 .. R], deg - R);
798
+
799
+ for i in [1 .. n] do
800
+ Add(gens, Transformation(Concatenation(im, NextIterator(iter))));
801
+ od;
802
+
803
+ S := Semigroup(gens, rec(acting := false));
804
+ SetIsLeftZeroSemigroup(S, true);
805
+ return S;
806
+ end);
807
+
808
+ # Right zero semigroup: main method
809
+
810
+ InstallGlobalFunction(RightZeroSemigroup,
811
+ function(arg...)
812
+ local filt, n, S, max, deg, ker, add, iter, gens, i;
813
+
814
+ if Length(arg) = 1 then
815
+ filt := IsTransformationSemigroup;
816
+ n := arg[1];
817
+ elif Length(arg) = 2 then
818
+ filt := arg[1];
819
+ n := arg[2];
820
+ fi;
821
+
822
+ if not IsBound(filt) or not IsFilter(filt) or not IsPosInt(n) then
823
+ ErrorNoReturn("the arguments must be a positive integer or ",
824
+ "a filter and a positive integer");
825
+ elif n = 1 then
826
+ return TrivialSemigroup(filt);
827
+ elif filt <> IsTransformationSemigroup then
828
+ S := RectangularBand(filt, 1, n);
829
+ SetIsRightZeroSemigroup(S, true);
830
+ return S;
831
+ fi;
832
+
833
+ # calculate the minimal possible degree
834
+ max := 0;
835
+ deg := 0;
836
+ while max < n do
837
+ deg := deg + 1;
838
+ if (deg mod 3) = 0 then
839
+ max := 3 ^ (deg / 3);
840
+ elif (deg mod 3) = 1 then
841
+ max := 4 * 3 ^ ((deg - 4) / 3);
842
+ else
843
+ max := 2 * 3 ^ ((deg - 2) / 3);
844
+ fi;
845
+ od;
846
+
847
+ # make the first class of the kernel
848
+ if (deg mod 3) = 0 then
849
+ ker := [[1 .. 3]];
850
+ add := 3;
851
+ elif (deg mod 3) = 1 then
852
+ ker := [[1 .. 4]];
853
+ add := 4;
854
+ else
855
+ ker := [[1 .. 2]];
856
+ add := 2;
857
+ fi;
858
+
859
+ # add remaining classes in kernel (all of size 3)
860
+ while add < deg do
861
+ Add(ker, [1 .. 3] + add);
862
+ add := add + 3;
863
+ od;
864
+
865
+ iter := IteratorOfCartesianProduct(ker);
866
+
867
+ gens := [];
868
+ for i in [1 .. n] do
869
+ Add(gens, TransformationByImageAndKernel(NextIterator(iter), ker));
870
+ od;
871
+
872
+ S := Semigroup(gens, rec(acting := false));
873
+ SetIsRightZeroSemigroup(S, true);
874
+ return S;
875
+ end);
876
+
877
+ InstallGlobalFunction(BrandtSemigroup,
878
+ function(arg...)
879
+ local S;
880
+
881
+ if Length(arg) = 1 and IsPosInt(arg[1]) then
882
+ S := BrandtSemigroupCons(IsPartialPermSemigroup, Group(()), arg[1]);
883
+ elif Length(arg) = 2 and IsOperation(arg[1]) and IsPosInt(arg[2]) then
884
+ S := BrandtSemigroupCons(arg[1], Group(()), arg[2]);
885
+ elif Length(arg) = 2 and IsGroup(arg[1]) and IsPosInt(arg[2]) then
886
+ S := BrandtSemigroupCons(IsPartialPermSemigroup, arg[1], arg[2]);
887
+ elif Length(arg) = 3 and IsOperation(arg[1]) and IsGroup(arg[2])
888
+ and IsPosInt(arg[3]) then
889
+ S := BrandtSemigroupCons(arg[1], arg[2], arg[3]);
890
+ else
891
+ ErrorNoReturn("the arguments must be a positive integer or a filter and",
892
+ " a positive integer, or a perm group and positive ",
893
+ "integer, or a filter, perm group, and positive ",
894
+ "integer");
895
+ fi;
896
+ SetIsZeroSimpleSemigroup(S, true);
897
+ SetIsBrandtSemigroup(S, true);
898
+ return S;
899
+ end);
900
+
901
+ InstallMethod(BrandtSemigroupCons,
902
+ "for IsPartialPermSemigroup, a perm group, and a positive integer",
903
+ [IsPartialPermSemigroup, IsPermGroup, IsPosInt],
904
+ function(_, G, n)
905
+ local gens, one, m, i, x;
906
+
907
+ gens := [];
908
+
909
+ if IsTrivial(G) then
910
+ if n = 1 then
911
+ Add(gens, PartialPerm([1], [1]));
912
+ Add(gens, EmptyPartialPerm());
913
+ else
914
+ for i in [2 .. n] do
915
+ Add(gens, PartialPerm([1], [i]));
916
+ od;
917
+ fi;
918
+ else
919
+ one := PartialPerm(MovedPoints(G), MovedPoints(G));
920
+ for x in GeneratorsOfGroup(G) do
921
+ Add(gens, one * x);
922
+ od;
923
+ m := LargestMovedPoint(G) - SmallestMovedPoint(G) + 1;
924
+ for i in [1 .. n - 1] do
925
+ Add(gens, PartialPerm(MovedPoints(G), MovedPoints(G) + m * i));
926
+ od;
927
+ if n = 1 then
928
+ Add(gens, EmptyPartialPerm());
929
+ fi;
930
+ fi;
931
+
932
+ return InverseSemigroup(gens);
933
+ end);
934
+
935
+ InstallMethod(BrandtSemigroupCons,
936
+ "for IsReesZeroMatrixSemigroup, a finite group, and a positive integer",
937
+ [IsReesZeroMatrixSemigroup, IsGroup and IsFinite, IsPosInt],
938
+ function(_, G, n)
939
+ local mat, i;
940
+ mat := [];
941
+ for i in [1 .. n] do
942
+ Add(mat, ListWithIdenticalEntries(n, 0));
943
+ mat[i][i] := One(G);
944
+ od;
945
+
946
+ return ReesZeroMatrixSemigroup(G, mat);
947
+ end);
948
+
949
+ for _IsXSemigroup in ["IsTransformationSemigroup",
950
+ "IsBipartitionSemigroup",
951
+ "IsPBRSemigroup",
952
+ "IsBooleanMatSemigroup",
953
+ "IsNTPMatrixSemigroup",
954
+ "IsMaxPlusMatrixSemigroup",
955
+ "IsMinPlusMatrixSemigroup",
956
+ "IsTropicalMaxPlusMatrixSemigroup",
957
+ "IsTropicalMinPlusMatrixSemigroup",
958
+ "IsProjectiveMaxPlusMatrixSemigroup",
959
+ "IsIntegerMatrixSemigroup"] do
960
+ InstallMethod(BrandtSemigroupCons,
961
+ Concatenation("for ", _IsXSemigroup, " and a positive integer"),
962
+ [ValueGlobal(_IsXSemigroup), IsPermGroup, IsPosInt],
963
+ function(filter, G, n)
964
+ return AsSemigroup(filter,
965
+ BrandtSemigroupCons(IsPartialPermSemigroup, G, n));
966
+ end);
967
+ od;
968
+ Unbind(_IsXSemigroup);
969
+
970
+ InstallMethod(StrongSemilatticeOfSemigroups,
971
+ "for a digraph, a list, and a list",
972
+ [IsDigraph, IsList, IsList],
973
+ function(D, semigroups, homomorphisms)
974
+ local out, pos, err, efam, etype, type, maps, n, rtclosure, paths, path, len,
975
+ tobecomposed, firsthom, gens, i, j;
976
+
977
+ if not IsMeetSemilatticeDigraph(DigraphReflexiveTransitiveClosure(D)) then
978
+ ErrorNoReturn("the reflexive transitive closure of the 1st argument ",
979
+ "(a digraph) must be a meet semilattice");
980
+ fi;
981
+ pos := PositionProperty(semigroups, x -> not IsSemigroup(x));
982
+ if pos <> fail then
983
+ ErrorNoReturn("the 2nd argument (a list) must consist of semigroups, ",
984
+ "but found ", TNAM_OBJ(semigroups[pos]), " in position ",
985
+ pos);
986
+ elif DigraphNrVertices(D) <> Length(semigroups) then
987
+ err := Concatenation(
988
+ "the 2nd argument (a list) must have length {}, ",
989
+ "the number of vertices of the 1st argument (a digraph)",
990
+ ", but found length {}");
991
+ ErrorNoReturn(StringFormatted(err,
992
+ DigraphNrVertices(D),
993
+ Length(semigroups)));
994
+ fi;
995
+ pos := PositionProperty(homomorphisms, x -> not IsList(x));
996
+ if pos <> fail then
997
+ ErrorNoReturn("the 3rd argument (a list) must consist of lists, ",
998
+ "but found ",
999
+ TNAM_OBJ(homomorphisms[pos]),
1000
+ " in position ",
1001
+ pos);
1002
+ elif DigraphNrVertices(D) <> Length(homomorphisms) then
1003
+ err := Concatenation(
1004
+ "the 3rd argument (a list) must have length {}, ",
1005
+ "the number of vertices of the 1st argument (a digraph)",
1006
+ ", but found length {}");
1007
+ ErrorNoReturn(StringFormatted(err,
1008
+ DigraphNrVertices(D),
1009
+ Length(homomorphisms)));
1010
+ fi;
1011
+
1012
+ out := OutNeighbours(D);
1013
+ for i in [1 .. DigraphNrVertices(D)] do
1014
+ if Length(homomorphisms[i]) <> Length(out[i]) then
1015
+ err := Concatenation(
1016
+ "the 3rd argument (a list) must have the same shape ",
1017
+ "as the out-neighbours of the 1st argument (a digraph), ",
1018
+ "expected shape {} but found {}");
1019
+ ErrorNoReturn(StringFormatted(err,
1020
+ List(out, Length),
1021
+ List(homomorphisms, Length)));
1022
+ fi;
1023
+ pos := PositionProperty(homomorphisms[i],
1024
+ x -> not IsSemigroupHomomorphism(x));
1025
+ if pos <> fail then
1026
+ ErrorNoReturn("the 3rd argument (a list) must consist ",
1027
+ "of lists of homomorphisms, but position ",
1028
+ StringFormatted("[{}, {}]", i, pos),
1029
+ " is not a homomorphism");
1030
+ fi;
1031
+
1032
+ for j in [1 .. Length(homomorphisms[i])] do
1033
+ if Source(homomorphisms[i][j]) <> semigroups[out[i][j]] then
1034
+ err := Concatenation("expected the homomorphism in position {} of the ",
1035
+ "3rd argument to have source equal to position {}",
1036
+ " in the 2nd argument");
1037
+ ErrorNoReturn(StringFormatted(err, [i, j], out[i][j]));
1038
+ elif Range(homomorphisms[i][j]) <> semigroups[i] then
1039
+ err := Concatenation("expected the homomorphism in position {} of the ",
1040
+ "3rd argument to have range equal to position {} ",
1041
+ "in the 2nd argument");
1042
+ ErrorNoReturn(StringFormatted(err, [i, j], i));
1043
+ fi;
1044
+ od;
1045
+ od;
1046
+
1047
+ efam := NewFamily("StrongSemilatticeOfSemigroupsElementsFamily", IsSSSE);
1048
+ etype := NewType(efam, IsSSSERep);
1049
+
1050
+ type := NewType(CollectionsFamily(efam),
1051
+ IsStrongSemilatticeOfSemigroups
1052
+ and IsComponentObjectRep
1053
+ and IsAttributeStoringRep);
1054
+
1055
+ # the next section converts the list of homomorphisms into a matrix,
1056
+ # composing when necessary.
1057
+ maps := [];
1058
+ n := Length(semigroups);
1059
+ rtclosure := DigraphReflexiveTransitiveClosure(D);
1060
+ for i in [1 .. n] do
1061
+ Add(maps, []);
1062
+ for j in [1 .. n] do
1063
+ if i = j then
1064
+ # First check that if a homomorphism from i to i was defined, it
1065
+ # is the identity
1066
+ if IsDigraphEdge(D, [i, i]) then
1067
+ if homomorphisms[i][Position(OutNeighboursOfVertex(D, i), i)]
1068
+ <> IdentityMapping(semigroups[i]) then
1069
+ ErrorNoReturn("Expected homomorphism from ",
1070
+ i, " to ", i,
1071
+ " to be the identity");
1072
+ fi;
1073
+ fi;
1074
+ Add(maps[i], IdentityMapping(semigroups[i]));
1075
+ elif IsDigraphEdge(rtclosure, [i, j]) then
1076
+ paths := IteratorOfPaths(D, i, j);
1077
+ path := NextIterator(paths);
1078
+ len := Length(path[2]);
1079
+ tobecomposed := List([1 .. len],
1080
+ x -> homomorphisms[path[1][x]][path[2][x]]);
1081
+ firsthom := CompositionMapping(tobecomposed);
1082
+
1083
+ # now check the first composition is the same as the composition along
1084
+ # all other paths from i to j
1085
+ while not IsDoneIterator(paths) do
1086
+ path := NextIterator(paths);
1087
+ len := Length(path[2]);
1088
+ tobecomposed := List([1 .. len],
1089
+ x -> homomorphisms[path[1][x]][path[2][x]]);
1090
+ if CompositionMapping(tobecomposed) <> firsthom then
1091
+ ErrorNoReturn("Composing homomorphisms along different paths from ",
1092
+ i,
1093
+ " to ",
1094
+ j,
1095
+ " does not produce the same result. The ",
1096
+ "homomorphisms must commute");
1097
+ fi;
1098
+ od;
1099
+ # If no errors so far, then all paths commute and we can add the comp.
1100
+ Add(maps[i], firsthom);
1101
+ # TODO(later) for larger digraphs, the current method will compute some
1102
+ # compositions of homomorphisms several times. For example, take
1103
+ # Digraph([[], [1], [1], [2, 3], [4]]). It defines a meet-semilattice
1104
+ # and the SSS initialisation will check that composing the
1105
+ # homomorphisms 1->3->4 and 1->2->4 give the same result. Later on in
1106
+ # the initialisation, it will also check equivalence of the paths
1107
+ # 1->2->4->5 and 1->3->4->5, but will not be reusing previously
1108
+
1109
+ # computed information on what the composition 1->3->4 equals, say.
1110
+ # Saving the homomorphsisms already computed using some sort of dynamic
1111
+ # programming approach may improve the speed (at the cost of memory).
1112
+ else
1113
+ Add(maps[i], fail);
1114
+ fi;
1115
+ od;
1116
+ od;
1117
+
1118
+ out := rec();
1119
+
1120
+ gens := [];
1121
+ for i in [1 .. Length(semigroups)] do
1122
+ Append(gens, List(GeneratorsOfSemigroup(semigroups[i]),
1123
+ x -> Objectify(etype, [out, i, x])));
1124
+ od;
1125
+
1126
+ ObjectifyWithAttributes(out,
1127
+ type,
1128
+ SemilatticeOfStrongSemilatticeOfSemigroups,
1129
+ rtclosure,
1130
+ SemigroupsOfStrongSemilatticeOfSemigroups,
1131
+ semigroups,
1132
+ HomomorphismsOfStrongSemilatticeOfSemigroups,
1133
+ maps,
1134
+ ElementTypeOfStrongSemilatticeOfSemigroups,
1135
+ etype,
1136
+ GeneratorsOfMagma,
1137
+ gens);
1138
+ return out;
1139
+ end);
1140
+
1141
+ InstallMethod(Size, "for a strong semilattice of semigroups",
1142
+ [IsStrongSemilatticeOfSemigroups],
1143
+ {S} -> Sum(SemigroupsOfStrongSemilatticeOfSemigroups(S), Size));
1144
+
1145
+ InstallMethod(ViewString, "for a strong semilattice of semigroups",
1146
+ [IsStrongSemilatticeOfSemigroups],
1147
+ function(S)
1148
+ local size;
1149
+ size := Size(SemigroupsOfStrongSemilatticeOfSemigroups(S));
1150
+ return Concatenation("<strong semilattice of ",
1151
+ String(size),
1152
+ " semigroups>");
1153
+ end);
1154
+
1155
+ InstallMethod(SSSE,
1156
+ "for a strong semilattice of semigroups, a pos int, and an associative elt",
1157
+ [IsStrongSemilatticeOfSemigroups, IsPosInt, IsAssociativeElement],
1158
+ function(S, n, x)
1159
+ if n > Size(SemigroupsOfStrongSemilatticeOfSemigroups(S)) then
1160
+ ErrorNoReturn("expected 2nd argument to be an integer between 1 and ",
1161
+ "the size of the semilattice, i.e. ",
1162
+ Size(SemigroupsOfStrongSemilatticeOfSemigroups(S)));
1163
+ elif not x in SemigroupsOfStrongSemilatticeOfSemigroups(S)[n] then
1164
+ ErrorNoReturn("where S, n and x are the 1st, 2nd and 3rd arguments ",
1165
+ "respectively, expected x to be an element of ",
1166
+ "SemigroupsOfStrongSemilatticeOfSemigroups(S)[n]");
1167
+ fi;
1168
+ return Objectify(ElementTypeOfStrongSemilatticeOfSemigroups(S), [S, n, x]);
1169
+ end);
1170
+
1171
+ InstallMethod(\=, "for SSSEs", IsIdenticalObj,
1172
+ [IsSSSERep, IsSSSERep],
1173
+ {x, y} -> x![1] = y![1] and x![2] = y![2] and x![3] = y![3]);
1174
+
1175
+ InstallMethod(\<, "for SSSEs", IsIdenticalObj, [IsSSSERep, IsSSSERep],
1176
+ {x, y} -> (x![2] < y![2]) or (x![2] = y![2] and x![3] < y![3]));
1177
+
1178
+ InstallMethod(\*, "for SSSEs", IsIdenticalObj,
1179
+ [IsSSSERep, IsSSSERep],
1180
+ function(x, y)
1181
+ local D, meet, maps;
1182
+ D := SemilatticeOfStrongSemilatticeOfSemigroups(x![1]);
1183
+ meet := PartialOrderDigraphMeetOfVertices(D, x![2], y![2]);
1184
+ maps := HomomorphismsOfStrongSemilatticeOfSemigroups(x![1]);
1185
+ return SSSE(x![1],
1186
+ meet,
1187
+ (x![3] ^ (maps[meet][x![2]])) * (y![3] ^ (maps[meet][y![2]])));
1188
+ end);
1189
+
1190
+ InstallMethod(ViewString, "for a SSSE", [IsSSSERep],
1191
+ x -> Concatenation("SSSE(", ViewString(x![2]), ", ", ViewString(x![3]), ")"));
1192
+
1193
+ InstallMethod(UnderlyingSemilatticeOfSemigroups, "for a SSSE",
1194
+ [IsSSSERep], x -> x![1]);