passagemath-gap-pkg-semigroups 10.6.29__cp312-abi3-macosx_13_0_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 (354) 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-apple-darwin22-default64-kv10/semigroups.so +0 -0
  15. gap/pkg/semigroups/config.guess +1807 -0
  16. gap/pkg/semigroups/config.log +1082 -0
  17. gap/pkg/semigroups/config.status +1134 -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 +354 -0
  349. passagemath_gap_pkg_semigroups-10.6.29.dist-info/WHEEL +6 -0
  350. passagemath_gap_pkg_semigroups-10.6.29.dist-info/top_level.txt +1 -0
  351. passagemath_gap_pkg_semigroups.dylibs/libsemigroups.2.dylib +0 -0
  352. sage/all__sagemath_gap_pkg_semigroups.py +1 -0
  353. sage/libs/all__sagemath_gap_pkg_semigroups.py +1 -0
  354. sage/libs/gap_pkg_semigroups.abi3.so +0 -0
@@ -0,0 +1,1779 @@
1
+ #############################################################################
2
+ ##
3
+ # W translat.gi
4
+ # Y Copyright (C) 2015-22 James D. Mitchell, Finn Smith
5
+ ##
6
+ ## Licensing information can be found in the README file of this package.
7
+ ##
8
+ #############################################################################
9
+ ##
10
+ ##
11
+ #############################################################################
12
+ ## This file contains methods for dealing with left and right translation
13
+ ## semigroups, as well as translational hulls.
14
+ ##
15
+ ## Some of the implementation in this file was based on the implementation of
16
+ ## RMS in reesmatsemi.gi in the GAP library - in particular, the creation of
17
+ ## the semigroups and their relation to their elements.
18
+ ##
19
+ ## The code specific to rectangular bands is based on
20
+ ## Howie, J.M. (1995) 'Fundamentals of Semigroup theory'.
21
+ ## United Kingdom: Oxford University Press. (p. 116)
22
+ ##
23
+ ## This file is organised as follows:
24
+ ## 1. Internal functions
25
+ ## 2. Functions for the creation of left/right translations semigroup
26
+ ## and translational hulls, and their elements
27
+ ## 3. Methods for rectangular bands
28
+ ## 4. Methods for monoids
29
+ ## 5. Technical methods, eg. PrintObj, *, =, etc.
30
+ ##
31
+ #############################################################################
32
+
33
+ #############################################################################
34
+ # 1. Internal Functions
35
+ #############################################################################
36
+
37
+ SEMIGROUPS.HasEasyTranslationsGenerators := function(T)
38
+ local S;
39
+
40
+ S := UnderlyingSemigroup(T);
41
+ return IsZeroSimpleSemigroup(S) or
42
+ IsRectangularBand(S) or
43
+ IsSimpleSemigroup(S) or
44
+ SEMIGROUPS.IsNormalRMSOverGroup(S) or
45
+ IsMonogenicSemigroup(S) or
46
+ IsMonoid(S);
47
+ end;
48
+
49
+ SEMIGROUPS.HasEasyBitranslationsGenerators := function(T)
50
+ local S;
51
+
52
+ S := UnderlyingSemigroup(T);
53
+ return IsRectangularBand(S) or
54
+ IsMonogenicSemigroup(S);
55
+ end;
56
+
57
+ # Hash translations by their underlying transformations
58
+ SEMIGROUPS.HashFunctionForTranslations :=
59
+ {x, data} -> ORB_HashFunctionForPlainFlatList(x![1], data);
60
+
61
+ # Hash bitranslations as sum of underlying transformation hashes
62
+ SEMIGROUPS.HashFunctionForBitranslations := function(x, data)
63
+ return (SEMIGROUPS.HashFunctionForTranslations(x![1], data)
64
+ + SEMIGROUPS.HashFunctionForTranslations(x![2], data)) mod data + 1;
65
+ end;
66
+
67
+ SEMIGROUPS.LeftTranslationsBacktrackData := function(S)
68
+ local n, m, id, repspos, multtable, multsets, r_classes, r_class_map,
69
+ r_class_inv_map, r_classes_below, max_R_intersects, intersect, reps,
70
+ left_canon_inverse_by_gen, left_inverses_by_rep, x, right_inverses, seen, t,
71
+ s, transposed_multtable, transposed_multsets, U, Ui, keep, B, sb, r, i, j, a,
72
+ u;
73
+
74
+ n := Size(S);
75
+ reps := UnderlyingRepresentatives(LeftTranslations(S));
76
+ m := Size(reps);
77
+ id := n + 1;
78
+ repspos := List(reps, x -> PositionCanonical(S, x));
79
+
80
+ multtable := List(MultiplicationTableWithCanonicalPositions(S), ShallowCopy);
81
+ for i in [1 .. n] do
82
+ Add(multtable[i], i);
83
+ od;
84
+ Add(multtable, [1 .. id]);
85
+
86
+ multsets := List(multtable, Set);
87
+
88
+ r_classes := RClasses(S);
89
+ r_class_map := [];
90
+
91
+ for i in [1 .. Length(r_classes)] do
92
+ for s in r_classes[i] do
93
+ r_class_map[PositionCanonical(S, s)] := i;
94
+ od;
95
+ od;
96
+
97
+ r_class_inv_map := List(r_classes,
98
+ x -> PositionCanonical(S, Representative(x)));
99
+ r_classes_below := List([1 .. m],
100
+ i -> Set(r_class_map{multsets[repspos[i]]}));
101
+ max_R_intersects := List([1 .. m], x -> []);
102
+
103
+ for i in [1 .. m - 1] do
104
+ for j in [i + 1 .. m] do
105
+ intersect := Intersection(r_classes_below[i], r_classes_below[j]);
106
+ reps := r_class_inv_map{intersect};
107
+
108
+ max_R_intersects[i][j] := Filtered(reps,
109
+ x -> not ForAny(reps,
110
+ y -> x <> y and
111
+ x in multsets[y]));
112
+
113
+ max_R_intersects[j][i] := max_R_intersects[i][j];
114
+ od;
115
+ od;
116
+
117
+ left_canon_inverse_by_gen := List([1 .. n], x -> []);
118
+
119
+ # for all s in S, store the elements t such that reps[i] * t = s for each i
120
+ left_inverses_by_rep := List([1 .. n], x -> List([1 .. m], y -> []));
121
+ for i in [1 .. m] do
122
+ for t in [1 .. id] do
123
+ x := multtable[repspos[i]][t];
124
+ Add(left_inverses_by_rep[x][i], t);
125
+ if not IsBound(left_canon_inverse_by_gen[x][i]) then
126
+ left_canon_inverse_by_gen[x][i] := t;
127
+ fi;
128
+ od;
129
+ od;
130
+
131
+ # for each t in the left inverses of some a in max_R_intersects[i][j] by
132
+ # reps[j], compute the right inverses of each s in S under t
133
+ right_inverses := List([1 .. n], x -> ListWithIdenticalEntries(n + 1, fail));
134
+ seen := List([1 .. id], ReturnFalse);
135
+ for i in [1 .. m] do
136
+ for j in [1 .. m] do
137
+ if i = j then
138
+ continue;
139
+ fi;
140
+ for a in max_R_intersects[i][j] do
141
+ t := left_canon_inverse_by_gen[a][j];
142
+ # don't repeat the calculation if we've already done it for t!
143
+ if not seen[t] then
144
+ seen[t] := true;
145
+ for u in [1 .. n] do
146
+ s := multtable[u][t];
147
+ if right_inverses[s][t] = fail then
148
+ right_inverses[s][t] := [];
149
+ fi;
150
+ Add(right_inverses[s][t], u);
151
+ od;
152
+ fi;
153
+ od;
154
+ od;
155
+ od;
156
+
157
+ transposed_multtable := TransposedMat(multtable);
158
+ transposed_multsets := List(transposed_multtable, Set);
159
+
160
+ # compute intersection over a of the sets U_{i, a} from the paper
161
+ U := [];
162
+ for i in [1 .. m] do
163
+ Ui := BlistList([1 .. n], []);
164
+ for s in [1 .. n] do
165
+ if Ui[s] then
166
+ continue;
167
+ fi;
168
+ keep := true;
169
+ for a in multsets[repspos[i]] do
170
+ B := left_inverses_by_rep[a][i];
171
+ sb := multtable[s][B[1]];
172
+ if multtable[s]{B} <> ListWithIdenticalEntries(Size(B), sb) then
173
+ keep := false;
174
+ break;
175
+ fi;
176
+ od;
177
+ if keep then
178
+ UniteBlistList([1 .. n], Ui, transposed_multsets[s]);
179
+ Ui[s] := true;
180
+ fi;
181
+ od;
182
+ U[i] := ListBlist([1 .. n], Ui);
183
+ od;
184
+
185
+ r := rec();
186
+ r.left_canon_inverse_by_gen := left_canon_inverse_by_gen;
187
+ r.left_inverses_by_rep := left_inverses_by_rep;
188
+ r.max_R_intersects := max_R_intersects;
189
+ r.multsets := multsets;
190
+ r.multtable := multtable;
191
+ r.n := n;
192
+ r.right_inverses := right_inverses;
193
+ r.U := U;
194
+ r.V := List([1 .. m], j -> List([1 .. n], a -> []));
195
+ r.W := List([1 .. m], i -> List([1 .. m], j -> []));
196
+ return r;
197
+ end;
198
+
199
+ SEMIGROUPS.RightInversesLeftReps := function(S)
200
+ local n, reps, m, multtable, out, k, x, i, t;
201
+
202
+ n := Size(S);
203
+ reps := UnderlyingRepresentatives(LeftTranslations(S));
204
+ m := Size(reps);
205
+ multtable := MultiplicationTableWithCanonicalPositions(S);
206
+ out := List([1 .. n], x -> List([1 .. m], y -> []));
207
+
208
+ for i in [1 .. m] do
209
+ k := PositionCanonical(S, reps[i]);
210
+ for t in [1 .. n] do
211
+ x := multtable[t][k];
212
+ Add(out[x][i], t);
213
+ od;
214
+ od;
215
+ return out;
216
+ end;
217
+
218
+ SEMIGROUPS.LeftInversesRightReps := function(S)
219
+ local n, reps, m, multtable, out, k, x, i, t;
220
+
221
+ n := Size(S);
222
+ reps := UnderlyingRepresentatives(RightTranslations(S));
223
+ m := Size(reps);
224
+ multtable := MultiplicationTableWithCanonicalPositions(S);
225
+ out := List([1 .. n], x -> List([1 .. m], y -> []));
226
+
227
+ for i in [1 .. m] do
228
+ k := PositionCanonical(S, reps[i]);
229
+ for t in [1 .. n] do
230
+ x := multtable[k][t];
231
+ Add(out[x][i], t);
232
+ od;
233
+ od;
234
+ return out;
235
+ end;
236
+
237
+ SEMIGROUPS.RightTranslationsBacktrackData := function(S)
238
+ local n, m, id, repspos, transpose_multtable, transpose_multsets, l_classes,
239
+ l_class_map, l_class_inv_map, l_classes_below, max_L_intersects, intersect,
240
+ reps, right_canon_inverse_by_gen, right_inverses_by_rep, x, left_inverses,
241
+ seen, s, multsets, T, Ti, keep, B, sb, r, i, j, t, a, u, multtable;
242
+
243
+ n := Size(S);
244
+ reps := UnderlyingRepresentatives(RightTranslations(S));
245
+ m := Size(reps);
246
+ id := n + 1;
247
+ repspos := List(reps, x -> PositionCanonical(S, x));
248
+
249
+ transpose_multtable :=
250
+ List(TransposedMultiplicationTableWithCanonicalPositions(S),
251
+ ShallowCopy);
252
+ for i in [1 .. n] do
253
+ Add(transpose_multtable[i], i);
254
+ od;
255
+ Add(transpose_multtable, [1 .. id]);
256
+ transpose_multsets := List(transpose_multtable, Set);
257
+
258
+ multtable := TransposedMat(transpose_multtable); # For the added identity
259
+
260
+ l_classes := LClasses(S);
261
+ l_class_map := [];
262
+
263
+ for i in [1 .. Length(l_classes)] do
264
+ for s in l_classes[i] do
265
+ l_class_map[PositionCanonical(S, s)] := i;
266
+ od;
267
+ od;
268
+
269
+ l_class_inv_map := List(l_classes,
270
+ x -> PositionCanonical(S, Representative(x)));
271
+ l_classes_below := List([1 .. m],
272
+ i -> Set(l_class_map{transpose_multsets[repspos[i]]}));
273
+ max_L_intersects := List([1 .. m], x -> []);
274
+
275
+ for i in [1 .. m - 1] do
276
+ for j in [i + 1 .. m] do
277
+ intersect := Intersection(l_classes_below[i], l_classes_below[j]);
278
+ reps := l_class_inv_map{intersect};
279
+
280
+ max_L_intersects[i][j] := Filtered(reps,
281
+ x -> not ForAny(reps,
282
+ y -> x <> y and
283
+ x in transpose_multsets[y]));
284
+
285
+ max_L_intersects[j][i] := max_L_intersects[i][j];
286
+ od;
287
+ od;
288
+
289
+ right_canon_inverse_by_gen := List([1 .. n], x -> []);
290
+
291
+ # for all s in S, store the elements t such that t * reps[i] = s for each i
292
+ right_inverses_by_rep := List([1 .. n], x -> List([1 .. m], y -> []));
293
+ for i in [1 .. m] do
294
+ for t in [1 .. id] do
295
+ x := transpose_multtable[repspos[i]][t];
296
+ Add(right_inverses_by_rep[x][i], t);
297
+ if not IsBound(right_canon_inverse_by_gen[x][i]) then
298
+ right_canon_inverse_by_gen[x][i] := t;
299
+ fi;
300
+ od;
301
+ od;
302
+
303
+ # for each t in the right inverses of some a in max_L_intersects[i][j] by
304
+ # reps[j], compute the left inverses of each s in S under t
305
+ left_inverses := List([1 .. n], x -> ListWithIdenticalEntries(n + 1, fail));
306
+ seen := List([1 .. id], ReturnFalse);
307
+ for i in [1 .. m] do
308
+ for j in [1 .. m] do
309
+ if i = j then
310
+ continue;
311
+ fi;
312
+ for a in max_L_intersects[i][j] do
313
+ for t in right_inverses_by_rep[a][j] do
314
+ # don't repeat the calculation if we've already done it for t!
315
+ if not seen[t] then
316
+ seen[t] := true;
317
+ for u in [1 .. n] do
318
+ s := transpose_multtable[u][t];
319
+ if left_inverses[s][t] = fail then
320
+ left_inverses[s][t] := [];
321
+ fi;
322
+ Add(left_inverses[s][t], u);
323
+ od;
324
+ fi;
325
+ od;
326
+ od;
327
+ od;
328
+ od;
329
+
330
+ multsets := List(multtable, Set);
331
+
332
+ T := [];
333
+ for i in [1 .. m] do
334
+ Ti := BlistList([1 .. n], []);
335
+ for s in [1 .. n] do
336
+ if Ti[s] then
337
+ continue;
338
+ fi;
339
+ keep := true;
340
+ for a in transpose_multsets[repspos[i]] do
341
+ B := right_inverses_by_rep[a][i];
342
+ sb := transpose_multtable[s][B[1]];
343
+ if (transpose_multtable[s]{B} <>
344
+ ListWithIdenticalEntries(Size(B), sb)) then
345
+ keep := false;
346
+ break;
347
+ fi;
348
+ od;
349
+ if keep then
350
+ UniteBlistList([1 .. n], Ti, multsets[s]);
351
+ Ti[s] := true;
352
+ fi;
353
+ od;
354
+ T[i] := ListBlist([1 .. n], Ti);
355
+ od;
356
+
357
+ r := rec();
358
+ r.left_inverses := left_inverses;
359
+ r.max_L_intersects := max_L_intersects;
360
+ r.n := n;
361
+ r.right_canon_inverse_by_gen := right_canon_inverse_by_gen;
362
+ r.right_inverses_by_rep := right_inverses_by_rep;
363
+ r.transpose_multtable := transpose_multtable;
364
+ r.T := T;
365
+ r.F := List([1 .. m], j -> List([1 .. n], a -> []));
366
+ r.G := List([1 .. m], i -> List([1 .. m], j -> []));
367
+ return r;
368
+ end;
369
+
370
+ SEMIGROUPS.LeftTranslationsBacktrackDataW := function(data, i, j, s)
371
+ local left_canon_inverse_by_gen, multtable, right_inverses, W, r, x, a;
372
+
373
+ if IsBound(data.W[i][j][s]) then
374
+ return data.W[i][j][s];
375
+ fi;
376
+
377
+ left_canon_inverse_by_gen := data.left_canon_inverse_by_gen;
378
+ multtable := data.multtable;
379
+ right_inverses := data.right_inverses;
380
+ W := [1 .. data.n];
381
+ for a in data.max_R_intersects[i][j] do
382
+ r := left_canon_inverse_by_gen[a][i];
383
+ x := multtable[s][r];
384
+ if right_inverses[x][left_canon_inverse_by_gen[a][j]] = fail then
385
+ W := [];
386
+ break;
387
+ else
388
+ W := Intersection(W,
389
+ right_inverses[x][left_canon_inverse_by_gen[a][j]]);
390
+ fi;
391
+ od;
392
+ data.W[i][j][s] := W;
393
+ return W;
394
+ end;
395
+
396
+ SEMIGROUPS.RightTranslationsBacktrackDataG := function(data, i, j, s)
397
+ local right_canon_inverse_by_gen, transpose_multtable, left_inverses, G, l, x,
398
+ a;
399
+
400
+ if IsBound(data.G[i][j][s]) then
401
+ return data.G[i][j][s];
402
+ fi;
403
+
404
+ right_canon_inverse_by_gen := data.right_canon_inverse_by_gen;
405
+ transpose_multtable := data.transpose_multtable;
406
+ left_inverses := data.left_inverses;
407
+ G := [1 .. data.n];
408
+ for a in data.max_L_intersects[i][j] do
409
+ l := right_canon_inverse_by_gen[a][i];
410
+ x := transpose_multtable[s][l];
411
+ if left_inverses[x][right_canon_inverse_by_gen[a][j]] = fail then
412
+ G := [];
413
+ break;
414
+ else
415
+ G := Intersection(G,
416
+ left_inverses[x][right_canon_inverse_by_gen[a][j]]);
417
+ fi;
418
+ od;
419
+ data.G[i][j][s] := G;
420
+ return G;
421
+ end;
422
+
423
+ SEMIGROUPS.LeftTranslationsBacktrack := function(L, opt...)
424
+ local S, reps, m, nr_only, nr, data, U, omega_stack, bt, lambda, out, i;
425
+
426
+ S := UnderlyingSemigroup(L);
427
+ reps := UnderlyingRepresentatives(L);
428
+ m := Size(reps);
429
+ nr_only := opt = ["nr_only"];
430
+ nr := 0;
431
+
432
+ data := SEMIGROUPS.LeftTranslationsBacktrackData(S);
433
+ U := data.U;
434
+
435
+ # restrict via the U_{i}
436
+ for i in [1 .. m] do
437
+ omega_stack := [List(U, ShallowCopy)];
438
+ od;
439
+
440
+ bt := function(i)
441
+ local consistent, W, s, j;
442
+
443
+ for s in omega_stack[i][i] do
444
+ lambda[i] := s;
445
+ if i = m then
446
+ if nr_only then
447
+ nr := nr + 1;
448
+ else
449
+ Add(out, ShallowCopy(lambda));
450
+ fi;
451
+ else
452
+ consistent := true;
453
+ omega_stack[i + 1] := [];
454
+ for j in [i + 1 .. m] do
455
+ W := SEMIGROUPS.LeftTranslationsBacktrackDataW(data, i, j, s);
456
+ omega_stack[i + 1][j] := Intersection(omega_stack[i][j], W);
457
+ if IsEmpty(omega_stack[i + 1][j]) then
458
+ consistent := false;
459
+ break;
460
+ fi;
461
+ od;
462
+ if consistent then
463
+ bt(i + 1);
464
+ fi;
465
+ fi;
466
+ od;
467
+ end;
468
+
469
+ lambda := [];
470
+ out := [];
471
+ bt(1);
472
+
473
+ if nr_only then
474
+ return nr;
475
+ fi;
476
+
477
+ Apply(out, x -> LeftTranslationNC(L, x));
478
+ return out;
479
+ end;
480
+
481
+ SEMIGROUPS.RightTranslationsBacktrack := function(R, opt...)
482
+ local S, reps, n, m, omega_stack, nr_only, nr, data, T, possiblegenvals, bt,
483
+ rho, out, i;
484
+
485
+ S := UnderlyingSemigroup(R);
486
+ reps := UnderlyingRepresentatives(R);
487
+ n := Size(S);
488
+ m := Size(reps);
489
+ omega_stack := List([1 .. m], i -> List([1 .. m], j -> []));
490
+ nr_only := opt = ["nr_only"];
491
+ nr := 0;
492
+
493
+ data := SEMIGROUPS.RightTranslationsBacktrackData(S);
494
+ T := data.T;
495
+
496
+ possiblegenvals := List([1 .. m], i -> [1 .. n]);
497
+
498
+ # restrict via the T_{i}
499
+ for i in [1 .. m] do
500
+ IntersectSet(possiblegenvals[i], T[i]);
501
+ od;
502
+
503
+ bt := function(i)
504
+ local consistent, G, s, j;
505
+ for s in omega_stack[i][i] do
506
+ rho[i] := s;
507
+ if i = m then
508
+ if nr_only then
509
+ nr := nr + 1;
510
+ else
511
+ Add(out, ShallowCopy(rho));
512
+ fi;
513
+ else
514
+ consistent := true;
515
+ omega_stack[i + 1] := [];
516
+ for j in [i + 1 .. m] do
517
+ G := SEMIGROUPS.RightTranslationsBacktrackDataG(data, i, j, s);
518
+ omega_stack[i + 1][j] := Intersection(omega_stack[i][j], G);
519
+ if IsEmpty(omega_stack[i + 1][j]) then
520
+ consistent := false;
521
+ break;
522
+ fi;
523
+ od;
524
+ if consistent then
525
+ bt(i + 1);
526
+ fi;
527
+ fi;
528
+ od;
529
+ end;
530
+
531
+ omega_stack := [possiblegenvals];
532
+ rho := [];
533
+ out := [];
534
+ bt(1);
535
+
536
+ if nr_only then
537
+ return nr;
538
+ fi;
539
+
540
+ Apply(out, x -> RightTranslationNC(RightTranslations(S), x));
541
+ return out;
542
+ end;
543
+
544
+ SEMIGROUPS.BitranslationsBacktrack := function(H, opt...)
545
+ local S, n, l_reps, r_reps, l_m, r_m, l_repspos, r_repspos, l_omega_stack,
546
+ r_omega_stack, nr_only, nr, multtable, left_data, right_data,
547
+ left_inverses_by_right_rep, right_inverses_by_left_rep, U, T, L, R, l_bt,
548
+ r_bt, lambda, rho, out, i;
549
+
550
+ S := UnderlyingSemigroup(H);
551
+ n := Size(S);
552
+ l_reps := UnderlyingRepresentatives(LeftTranslations(S));
553
+ r_reps := UnderlyingRepresentatives(RightTranslations(S));
554
+ l_m := Size(l_reps);
555
+ r_m := Size(r_reps);
556
+ l_repspos := List(l_reps, x -> PositionCanonical(S, x));
557
+ r_repspos := List(r_reps, x -> PositionCanonical(S, x));
558
+ l_omega_stack := List([1 .. l_m], i -> List([1 .. l_m], j -> []));
559
+ r_omega_stack := List([1 .. r_m], i -> List([1 .. r_m], j -> []));
560
+ nr_only := opt = ["nr_only"];
561
+ nr := 0;
562
+
563
+ multtable := MultiplicationTableWithCanonicalPositions(S);
564
+
565
+ left_data := SEMIGROUPS.LeftTranslationsBacktrackData(S);
566
+ right_data := SEMIGROUPS.RightTranslationsBacktrackData(S);
567
+ left_inverses_by_right_rep := SEMIGROUPS.LeftInversesRightReps(S);
568
+ right_inverses_by_left_rep := SEMIGROUPS.RightInversesLeftReps(S);
569
+
570
+ U := left_data.U;
571
+ T := right_data.T;
572
+
573
+ l_omega_stack[1] := List([1 .. l_m], i -> [1 .. n]);
574
+ r_omega_stack[1] := List([1 .. r_m], i -> [1 .. n]);
575
+
576
+ # restrict via the T_{i} and U_{i}
577
+ for i in [1 .. l_m] do
578
+ l_omega_stack[1][i] := U[i];
579
+ od;
580
+ for i in [1 .. r_m] do
581
+ r_omega_stack[1][i] := T[i];
582
+ od;
583
+
584
+ L := LeftTranslations(S);
585
+ R := RightTranslations(S);
586
+
587
+ l_bt := function(i)
588
+ local depth, r_finished, consistent, W, x, s, j;
589
+
590
+ if i <= r_m then
591
+ depth := 2 * i - 1;
592
+ else
593
+ depth := r_m + i;
594
+ fi;
595
+
596
+ r_finished := i > r_m;
597
+
598
+ for s in l_omega_stack[depth][i] do
599
+ lambda[i] := s;
600
+
601
+ if r_finished and i = l_m then
602
+ if nr_only then
603
+ nr := nr + 1;
604
+ else
605
+ Add(out, BitranslationNC(H,
606
+ LeftTranslationNC(L, lambda),
607
+ RightTranslationNC(R, rho)));
608
+ fi;
609
+ continue;
610
+ fi;
611
+
612
+ consistent := true;
613
+ l_omega_stack[depth + 1] := [];
614
+ r_omega_stack[depth + 1] := [];
615
+
616
+ # make sure to take care of linking condition
617
+ # x_i * lambda(x_i) = (x_i)rho * x_i
618
+ for j in [i .. Maximum(l_m, r_m)] do
619
+ if (j > i and j <= l_m) then
620
+ W := SEMIGROUPS.LeftTranslationsBacktrackDataW(left_data, i, j, s);
621
+ l_omega_stack[depth + 1][j] := Intersection(l_omega_stack[depth][j],
622
+ W);
623
+ fi;
624
+
625
+ if j <= r_m then
626
+ x := multtable[r_repspos[j]][s];
627
+ r_omega_stack[depth + 1][j] :=
628
+ Intersection(r_omega_stack[depth][j],
629
+ right_inverses_by_left_rep[x][i]);
630
+ fi;
631
+
632
+ if ((j > i and j <= l_m and IsEmpty(l_omega_stack[depth + 1][j])) or
633
+ (j <= r_m and IsEmpty(r_omega_stack[depth + 1][j]))) then
634
+ consistent := false;
635
+ break;
636
+ fi;
637
+ od;
638
+
639
+ if consistent then
640
+ if r_finished then
641
+ l_bt(i + 1);
642
+ else
643
+ # this i is intentional, we go LRLRLR...
644
+ r_bt(i);
645
+ fi;
646
+ fi;
647
+ od;
648
+ end;
649
+
650
+ r_bt := function(i)
651
+ local depth, l_finished, consistent, G, x, s, j;
652
+
653
+ if i <= l_m then
654
+ depth := 2 * i;
655
+ else
656
+ depth := l_m + i;
657
+ fi;
658
+
659
+ l_finished := i >= l_m;
660
+
661
+ for s in r_omega_stack[depth][i] do
662
+ rho[i] := s;
663
+
664
+ if l_finished and i = r_m then
665
+ if nr_only then
666
+ nr := nr + 1;
667
+ else
668
+ Add(out, BitranslationNC(H,
669
+ LeftTranslationNC(L, lambda),
670
+ RightTranslationNC(R, rho)));
671
+ fi;
672
+ continue;
673
+ fi;
674
+
675
+ consistent := true;
676
+ l_omega_stack[depth + 1] := [];
677
+ r_omega_stack[depth + 1] := [];
678
+
679
+ for j in [i + 1 .. Maximum(r_m, l_m)] do
680
+ if j <= r_m then
681
+ G := SEMIGROUPS.RightTranslationsBacktrackDataG(right_data, i, j, s);
682
+ r_omega_stack[depth + 1][j] := Intersection(r_omega_stack[depth][j],
683
+ G);
684
+ fi;
685
+
686
+ if j <= l_m then
687
+ x := multtable[s][l_repspos[j]];
688
+ l_omega_stack[depth + 1][j] :=
689
+ Intersection(l_omega_stack[depth][j],
690
+ left_inverses_by_right_rep[x][i]);
691
+ fi;
692
+
693
+ if ((j <= l_m and IsEmpty(l_omega_stack[depth + 1][j])) or
694
+ (j <= r_m and IsEmpty(r_omega_stack[depth + 1][j]))) then
695
+ consistent := false;
696
+ break;
697
+ fi;
698
+ od;
699
+
700
+ if consistent then
701
+ if l_finished then
702
+ r_bt(i + 1);
703
+ else
704
+ l_bt(i + 1);
705
+ fi;
706
+ fi;
707
+ od;
708
+ end;
709
+
710
+ lambda := [];
711
+ rho := [];
712
+ out := [];
713
+ # Warning: it is assumed that the alternation starts with L; otherwise
714
+ # the depth calculation in l_bt and r_bt must be altered, and some of the
715
+ # logic changed
716
+ l_bt(1);
717
+
718
+ if nr_only then
719
+ return nr;
720
+ fi;
721
+
722
+ return out;
723
+ end;
724
+
725
+ #############################################################################
726
+ # 2. Creation of translations semigroups, translational hull, and elements
727
+ #############################################################################
728
+
729
+ InstallMethod(LeftTranslations, "for a finite enumerable semigroup",
730
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
731
+ function(S)
732
+ local fam, L, type;
733
+
734
+ if SEMIGROUPS.IsNormalRMSOverGroup(S) then
735
+ fam := SEMIGROUPS.FamOfRMSLeftTranslationsByTriple();
736
+ type := fam!.type;
737
+ else
738
+ fam := NewFamily("LeftTranslationsSemigroupElementsFamily",
739
+ IsLeftTranslation);
740
+ type := NewType(fam, IsLeftTranslation);
741
+ fam!.type := type;
742
+ fi;
743
+
744
+ # create the semigroup of left translations
745
+ L := Objectify(NewType(CollectionsFamily(fam), IsLeftTranslationsSemigroup
746
+ and IsWholeFamily and IsAttributeStoringRep), rec());
747
+
748
+ # store the type of the elements in the semigroup
749
+ SetTypeLeftTranslationsSemigroupElements(L, type);
750
+ SetLeftTranslationsSemigroupOfFamily(fam, L);
751
+ SetUnderlyingSemigroup(L, S);
752
+ SetLeftTranslations(S, L);
753
+
754
+ return L;
755
+ end);
756
+
757
+ InstallMethod(RightTranslations, "for a finite enumerable semigroup",
758
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
759
+ function(S)
760
+ local fam, type, R;
761
+
762
+ if SEMIGROUPS.IsNormalRMSOverGroup(S) then
763
+ fam := SEMIGROUPS.FamOfRMSRightTranslationsByTriple();
764
+ type := fam!.type;
765
+ else
766
+ fam := NewFamily("RightTranslationsSemigroupElementsFamily",
767
+ IsRightTranslation);
768
+ type := NewType(fam, IsRightTranslation);
769
+ fam!.type := type;
770
+ fi;
771
+
772
+ # create the semigroup of right translations
773
+ R := Objectify(NewType(CollectionsFamily(fam), IsRightTranslationsSemigroup
774
+ and IsWholeFamily and IsAttributeStoringRep), rec());
775
+
776
+ # store the type of the elements in the semigroup
777
+ SetTypeRightTranslationsSemigroupElements(R, type);
778
+ SetRightTranslationsSemigroupOfFamily(fam, R);
779
+ SetUnderlyingSemigroup(R, S);
780
+ SetRightTranslations(S, R);
781
+
782
+ return R;
783
+ end);
784
+
785
+ InstallMethod(TranslationalHull, "for a finite enumerable semigroup",
786
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
787
+ function(S)
788
+ local fam, type, H;
789
+
790
+ if SEMIGROUPS.IsNormalRMSOverGroup(S) then
791
+ fam := SEMIGROUPS.FamOfRMSBitranslationsByTriple();
792
+ type := fam!.type;
793
+ else
794
+ fam := NewFamily("BitranslationsFamily",
795
+ IsBitranslation);
796
+ type := NewType(fam, IsBitranslation);
797
+ fam!.type := type;
798
+ fi;
799
+
800
+ # create the translational hull
801
+ H := Objectify(NewType(CollectionsFamily(fam), IsBitranslationsSemigroup and
802
+ IsWholeFamily and IsAttributeStoringRep), rec());
803
+
804
+ # store the type of the elements in the semigroup
805
+ SetTypeBitranslations(H, type);
806
+ SetTranslationalHullOfFamily(fam, H);
807
+ SetUnderlyingSemigroup(H, S);
808
+ SetTranslationalHull(S, H);
809
+
810
+ return H;
811
+ end);
812
+
813
+ # Create and calculate the semigroup of inner left translations
814
+ InstallMethod(InnerLeftTranslations, "for a semigroup",
815
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
816
+ function(S)
817
+ local A, I, L, l, s;
818
+
819
+ I := [];
820
+ L := LeftTranslations(S);
821
+ A := GeneratorsOfSemigroup(S);
822
+
823
+ for s in A do
824
+ l := LeftTranslationNC(L, MappingByFunction(S, S, x -> s * x));
825
+ Add(I, l);
826
+ od;
827
+ return Semigroup(I);
828
+ end);
829
+
830
+ # Create and calculate the semigroup of inner right translations
831
+ InstallMethod(InnerRightTranslations, "for a semigroup",
832
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
833
+ function(S)
834
+ local A, I, R, r, s;
835
+
836
+ I := [];
837
+ R := RightTranslations(S);
838
+ A := GeneratorsOfSemigroup(S);
839
+
840
+ for s in A do
841
+ r := RightTranslationNC(R, MappingByFunction(S, S, x -> x * s));
842
+ Add(I, r);
843
+ od;
844
+ return Semigroup(I);
845
+ end);
846
+
847
+ InstallMethod(LeftTranslation,
848
+ "for a left translations semigroup and a general mapping",
849
+ [IsLeftTranslationsSemigroup, IsGeneralMapping],
850
+ function(L, map)
851
+ local S, reps;
852
+
853
+ S := UnderlyingSemigroup(L);
854
+ reps := UnderlyingRepresentatives(L);
855
+
856
+ if S <> Source(map) or Source(map) <> Range(map) then
857
+ ErrorNoReturn("the domain and range of the second argument must be ",
858
+ "the underlying semigroup of the first");
859
+ elif ForAny(reps, s -> ForAny(S, t -> (s ^ map) * t <> (s * t) ^ map)) then
860
+ ErrorNoReturn("the mapping given must define a left translation");
861
+ fi;
862
+
863
+ return LeftTranslationNC(L, map);
864
+ end);
865
+
866
+ InstallOtherMethod(LeftTranslation,
867
+ "for a left translations semigroup and a dense list",
868
+ [IsLeftTranslationsSemigroup, IsDenseList],
869
+ function(L, l)
870
+ local S, reps, semi_list, full_lambda, g, lg, x, y, i, s;
871
+
872
+ S := UnderlyingSemigroup(L);
873
+ reps := UnderlyingRepresentatives(L);
874
+
875
+ if Length(l) <> Length(reps) then
876
+ ErrorNoReturn("the second argument must map indices of representatives ",
877
+ "to indices of elements of the semigroup of the first ",
878
+ "argument");
879
+ elif not ForAll(l, y -> IsPosInt(y) and y <= Size(S)) then
880
+ ErrorNoReturn("the second argument must map indices of representatives ",
881
+ "to indices of elements of the semigroup of the first ",
882
+ "argument");
883
+ fi;
884
+ # TODO (later) store and use LeftTranslationsBacktrackData
885
+ semi_list := AsListCanonical(S);
886
+ full_lambda := [];
887
+ for i in [1 .. Size(reps)] do
888
+ g := reps[i];
889
+ lg := l[i];
890
+ for s in S do
891
+ x := PositionCanonical(S, g * s);
892
+ y := PositionCanonical(S, semi_list[lg] * s);
893
+ if not IsBound(full_lambda[x]) then
894
+ full_lambda[x] := y;
895
+ fi;
896
+ if full_lambda[x] <> y then
897
+ ErrorNoReturn("the transformation given must define a left ",
898
+ "translation");
899
+ fi;
900
+ od;
901
+ od;
902
+
903
+ return LeftTranslationNC(L, l);
904
+ end);
905
+
906
+ # Careful - expects a particular form for normal RMS
907
+ InstallGlobalFunction(LeftTranslationNC,
908
+ function(L, l, opt...)
909
+ local S, reps, map_as_list, i;
910
+
911
+ S := UnderlyingSemigroup(L);
912
+ if _IsLeftTranslationOfNormalRMSSemigroup(L) then
913
+ if IsEmpty(opt) then
914
+ return _LeftTranslationOfNormalRMSNC(L, l);
915
+ else
916
+ return _LeftTranslationOfNormalRMSNC(L, l, opt[1]);
917
+ fi;
918
+ fi;
919
+ if IsDenseList(l) then
920
+ return Objectify(TypeLeftTranslationsSemigroupElements(L),
921
+ [ShallowCopy(l)]);
922
+ fi;
923
+ # l is a mapping on UnderlyingSemigroup(S)
924
+ reps := UnderlyingRepresentatives(L);
925
+ map_as_list := [];
926
+ for i in [1 .. Length(reps)] do
927
+ map_as_list[i] := PositionCanonical(S, reps[i] ^ l);
928
+ od;
929
+
930
+ return Objectify(TypeLeftTranslationsSemigroupElements(L), [map_as_list]);
931
+ end);
932
+
933
+ InstallMethod(RightTranslation,
934
+ "for a right translations semigroup and a general mapping",
935
+ [IsRightTranslationsSemigroup, IsGeneralMapping],
936
+ function(R, map)
937
+ local S, reps;
938
+
939
+ S := UnderlyingSemigroup(R);
940
+ reps := UnderlyingRepresentatives(R);
941
+
942
+ if S <> Source(map) or Source(map) <> Range(map) then
943
+ ErrorNoReturn("the domain and range of the second argument must be ",
944
+ "the underlying semigroup of the first");
945
+ elif ForAny(reps, s -> ForAny(S, t -> s * (t ^ map) <> (s * t) ^ map)) then
946
+ ErrorNoReturn("the mapping given must define a right translation");
947
+ fi;
948
+
949
+ return RightTranslationNC(R, map);
950
+ end);
951
+
952
+ InstallOtherMethod(RightTranslation,
953
+ "for a right translations semigroup and a dense list",
954
+ [IsRightTranslationsSemigroup, IsDenseList],
955
+ function(R, r)
956
+ local S, reps, semi_list, full_rho, g, rg, x, y, i, s;
957
+
958
+ S := UnderlyingSemigroup(R);
959
+ reps := UnderlyingRepresentatives(R);
960
+
961
+ if Length(r) <> Length(reps) then
962
+ ErrorNoReturn("the second argument must map indices of representatives ",
963
+ "to indices of elements of the semigroup of the first ",
964
+ "argument");
965
+ elif not ForAll(r, y -> IsPosInt(y) and y <= Size(S)) then
966
+ ErrorNoReturn("the second argument must map indices of representatives ",
967
+ "to indices of elements of the semigroup of the first ",
968
+ "argument");
969
+ fi;
970
+
971
+ # TODO (later) store and use some of RightTranslationsBacktrackData
972
+ semi_list := AsListCanonical(S);
973
+ full_rho := [];
974
+ for i in [1 .. Size(reps)] do
975
+ g := reps[i];
976
+ rg := r[i];
977
+ for s in S do
978
+ x := PositionCanonical(S, s * g);
979
+ y := PositionCanonical(S, s * semi_list[rg]);
980
+ if not IsBound(full_rho[x]) then
981
+ full_rho[x] := y;
982
+ fi;
983
+ if full_rho[x] <> y then
984
+ ErrorNoReturn("the transformation given must define a right ",
985
+ "translation");
986
+ fi;
987
+ od;
988
+ od;
989
+
990
+ return RightTranslationNC(R, r);
991
+ end);
992
+
993
+ # Careful - expects a particular form for normal RMS
994
+ InstallGlobalFunction(RightTranslationNC,
995
+ function(R, r, opt...)
996
+ local S, reps, map_as_list, i;
997
+
998
+ S := UnderlyingSemigroup(R);
999
+ if _IsRightTranslationOfNormalRMSSemigroup(R) then
1000
+ if IsEmpty(opt) then
1001
+ return _RightTranslationOfNormalRMSNC(R, r);
1002
+ else
1003
+ return _RightTranslationOfNormalRMSNC(R, r, opt[1]);
1004
+ fi;
1005
+ fi;
1006
+ if IsDenseList(r) then
1007
+ return Objectify(TypeRightTranslationsSemigroupElements(R),
1008
+ [ShallowCopy(r)]);
1009
+ fi;
1010
+ # r is a mapping on UnderlyingSemigroup(S)
1011
+ reps := UnderlyingRepresentatives(R);
1012
+ map_as_list := [];
1013
+ for i in [1 .. Length(reps)] do
1014
+ map_as_list[i] := PositionCanonical(S, reps[i] ^ r);
1015
+ od;
1016
+
1017
+ return Objectify(TypeRightTranslationsSemigroupElements(R), [map_as_list]);
1018
+ end);
1019
+
1020
+ # Creates the ideal of the translational hull consisting of
1021
+ # all inner bitranslations
1022
+ InstallMethod(InnerTranslationalHull, "for a semigroup",
1023
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
1024
+ function(S)
1025
+ local A, I, H, L, R, l, r, s;
1026
+
1027
+ I := [];
1028
+ H := TranslationalHull(S);
1029
+ L := LeftTranslations(S);
1030
+ R := RightTranslations(S);
1031
+ A := GeneratorsOfSemigroup(S);
1032
+
1033
+ for s in A do
1034
+ l := LeftTranslationNC(L, MappingByFunction(S, S, x -> s * x));
1035
+ r := RightTranslationNC(R, MappingByFunction(S, S, x -> x * s));
1036
+ Add(I, BitranslationNC(H, l, r));
1037
+ od;
1038
+ return Semigroup(I);
1039
+ end);
1040
+
1041
+ # Creates a bitranslation (l, r) from a left translation l and a right
1042
+ # translation r, as an element of a translational hull H.
1043
+ InstallMethod(Bitranslation,
1044
+ [IsBitranslationsSemigroup, IsLeftTranslation, IsRightTranslation],
1045
+ function(H, l, r)
1046
+ local S, L, R, l_reps, r_reps;
1047
+
1048
+ S := UnderlyingSemigroup(H);
1049
+ L := LeftTranslationsSemigroupOfFamily(FamilyObj(l));
1050
+ R := RightTranslationsSemigroupOfFamily(FamilyObj(r));
1051
+
1052
+ if UnderlyingSemigroup(L) <> S or UnderlyingSemigroup(R) <> S then
1053
+ ErrorNoReturn("each argument must have the same underlying semigroup");
1054
+ fi;
1055
+
1056
+ l_reps := UnderlyingRepresentatives(L);
1057
+ r_reps := UnderlyingRepresentatives(R);
1058
+
1059
+ if ForAny(l_reps, t -> ForAny(r_reps, s -> s * (t ^ l) <> (s ^ r) * t)) then
1060
+ ErrorNoReturn("the translations given must satisfy the linking ",
1061
+ "condition");
1062
+ fi;
1063
+
1064
+ return BitranslationNC(H, l, r);
1065
+ end);
1066
+
1067
+ InstallGlobalFunction(BitranslationNC,
1068
+ {H, l, r} -> Objectify(TypeBitranslations(H), [l, r]));
1069
+
1070
+ #############################################################################
1071
+ # 3. Methods for rectangular bands
1072
+ #############################################################################
1073
+
1074
+ # Every transformation on the relevant index set corresponds to a translation.
1075
+ # The R classes of an I x J rectangular band correspond to (i, J) for i in I.
1076
+ # Dually for L classes.
1077
+ InstallMethod(Size,
1078
+ "for the semigroup of left or right translations of a rectangular band",
1079
+ [IsTranslationsSemigroup and IsWholeFamily], 2,
1080
+ function(T)
1081
+ local S, n;
1082
+ S := UnderlyingSemigroup(T);
1083
+ if not IsRectangularBand(S) then
1084
+ TryNextMethod();
1085
+ elif IsLeftTranslationsSemigroup(T) then
1086
+ n := NrRClasses(S);
1087
+ else
1088
+ n := NrLClasses(S);
1089
+ fi;
1090
+
1091
+ return n ^ n;
1092
+ end);
1093
+
1094
+ # The translational hull of a rectangular band is the direct product of the
1095
+ # left translations and right translations
1096
+ InstallMethod(Size, "for the translational hull of a rectangular band",
1097
+ [IsBitranslationsSemigroup and IsWholeFamily],
1098
+ 1,
1099
+ function(H)
1100
+ local S, L, R;
1101
+ S := UnderlyingSemigroup(H);
1102
+ if not IsRectangularBand(S) then
1103
+ TryNextMethod();
1104
+ fi;
1105
+ L := LeftTranslations(S);
1106
+ R := RightTranslations(S);
1107
+ return Size(L) * Size(R);
1108
+ end);
1109
+
1110
+ # Generators of the left/right translations semigroup on the I x J rectangular
1111
+ # band correspond to the generators of the full transformation monoid on I or J.
1112
+ InstallMethod(GeneratorsOfSemigroup,
1113
+ "for the semigroup of left or right translations of a rectangular band",
1114
+ [IsTranslationsSemigroup and IsWholeFamily],
1115
+ 2,
1116
+ function(T)
1117
+ local S, n, iso, inv, rms, gens, t, f;
1118
+
1119
+ S := UnderlyingSemigroup(T);
1120
+ if not IsRectangularBand(S) then
1121
+ TryNextMethod();
1122
+ fi;
1123
+
1124
+ iso := IsomorphismReesMatrixSemigroup(S);
1125
+ inv := InverseGeneralMapping(iso);
1126
+ rms := Range(iso);
1127
+ if IsLeftTranslationsSemigroup(T) then
1128
+ n := Length(Rows(rms));
1129
+ else
1130
+ n := Length(Columns(rms));
1131
+ fi;
1132
+
1133
+ gens := [];
1134
+ for t in GeneratorsOfMonoid(FullTransformationMonoid(n)) do
1135
+ if IsLeftTranslationsSemigroup(T) then
1136
+ f := function(x)
1137
+ return ReesMatrixSemigroupElement(rms, x[1] ^ t,
1138
+ (), x[3]);
1139
+ end;
1140
+ Add(gens, LeftTranslationNC(T, CompositionMapping(inv,
1141
+ MappingByFunction(rms, rms, f), iso)));
1142
+ else
1143
+ f := function(x)
1144
+ return ReesMatrixSemigroupElement(rms, x[1],
1145
+ (), x[3] ^ t);
1146
+ end;
1147
+ Add(gens, RightTranslationNC(T, CompositionMapping(inv,
1148
+ MappingByFunction(rms, rms, f), iso)));
1149
+ fi;
1150
+ od;
1151
+ return gens;
1152
+ end);
1153
+
1154
+ # Generators of translational hull are the direct product of
1155
+ # generators of left/right translations semigroup for rectangular bands
1156
+ # since they are monoids
1157
+ InstallMethod(GeneratorsOfSemigroup,
1158
+ "for the translational hull of a rectangular band",
1159
+ [IsBitranslationsSemigroup],
1160
+ 2,
1161
+ function(H)
1162
+ local S, left_gens, right_gens, l, r, gens;
1163
+
1164
+ S := UnderlyingSemigroup(H);
1165
+ if not IsRectangularBand(S) then
1166
+ TryNextMethod();
1167
+ fi;
1168
+
1169
+ left_gens := GeneratorsOfSemigroup(LeftTranslations(S));
1170
+ right_gens := GeneratorsOfSemigroup(RightTranslations(S));
1171
+ gens := [];
1172
+
1173
+ for l in left_gens do
1174
+ for r in right_gens do
1175
+ Add(gens, BitranslationNC(H, l, r));
1176
+ od;
1177
+ od;
1178
+
1179
+ return gens;
1180
+ end);
1181
+
1182
+ #############################################################################
1183
+ # 4. Methods for monoids
1184
+ #############################################################################
1185
+
1186
+ InstallMethod(GeneratorsOfSemigroup,
1187
+ "for the left translations of a finite monoid",
1188
+ [IsLeftTranslationsSemigroup and IsWholeFamily],
1189
+ function(L)
1190
+ if not IsMonoid(UnderlyingSemigroup(L)) then
1191
+ TryNextMethod();
1192
+ fi;
1193
+ return GeneratorsOfSemigroup(InnerLeftTranslations(UnderlyingSemigroup(L)));
1194
+ end);
1195
+
1196
+ InstallMethod(GeneratorsOfSemigroup,
1197
+ "for the right translations of a finite monoid",
1198
+ [IsRightTranslationsSemigroup and IsWholeFamily],
1199
+ function(R)
1200
+ if not IsMonoid(UnderlyingSemigroup(R)) then
1201
+ TryNextMethod();
1202
+ fi;
1203
+ return GeneratorsOfSemigroup(InnerRightTranslations(UnderlyingSemigroup(R)));
1204
+ end);
1205
+
1206
+ InstallMethod(GeneratorsOfSemigroup,
1207
+ "for the translational hull of a finite monoid",
1208
+ [IsBitranslationsSemigroup and IsWholeFamily],
1209
+ function(H)
1210
+ if not IsMonoid(UnderlyingSemigroup(H)) then
1211
+ TryNextMethod();
1212
+ fi;
1213
+ return GeneratorsOfSemigroup(InnerTranslationalHull(UnderlyingSemigroup(H)));
1214
+ end);
1215
+
1216
+ InstallMethod(Size,
1217
+ "for a semigroup of left/right translations of a monoid",
1218
+ [IsTranslationsSemigroup and IsWholeFamily],
1219
+ 1,
1220
+ function(T)
1221
+ if not IsMonoid(UnderlyingSemigroup(T)) then
1222
+ TryNextMethod();
1223
+ fi;
1224
+ return Size(UnderlyingSemigroup(T));
1225
+ end);
1226
+
1227
+ InstallMethod(Size, "for a translational hull of a monoid",
1228
+ [IsBitranslationsSemigroup and IsWholeFamily],
1229
+ 1,
1230
+ function(H)
1231
+ if not IsMonoid(UnderlyingSemigroup(H)) then
1232
+ TryNextMethod();
1233
+ fi;
1234
+ return Size(UnderlyingSemigroup(H));
1235
+ end);
1236
+
1237
+ #############################################################################
1238
+ # 5. Methods for monogenic semigroups
1239
+ #############################################################################
1240
+
1241
+ InstallMethod(GeneratorsOfSemigroup,
1242
+ "for the left translations of a finite monogenic semigroup",
1243
+ [IsLeftTranslationsSemigroup and IsWholeFamily],
1244
+ function(L)
1245
+ if not IsMonogenicSemigroup(UnderlyingSemigroup(L)) then
1246
+ TryNextMethod();
1247
+ fi;
1248
+ return Union([One(L)],
1249
+ GeneratorsOfSemigroup(InnerLeftTranslations(UnderlyingSemigroup(L))));
1250
+ end);
1251
+
1252
+ InstallMethod(GeneratorsOfSemigroup,
1253
+ "for the right translations of a finite monogenic semigroup",
1254
+ [IsRightTranslationsSemigroup and IsWholeFamily],
1255
+ function(R)
1256
+ if not IsMonogenicSemigroup(UnderlyingSemigroup(R)) then
1257
+ TryNextMethod();
1258
+ fi;
1259
+ return Union([One(R)],
1260
+ GeneratorsOfSemigroup(InnerRightTranslations(UnderlyingSemigroup(R))));
1261
+ end);
1262
+
1263
+ InstallMethod(GeneratorsOfSemigroup,
1264
+ "for the translational hull of a finite monogenic semigroup",
1265
+ [IsBitranslationsSemigroup and IsWholeFamily],
1266
+ function(H)
1267
+ if not IsMonogenicSemigroup(UnderlyingSemigroup(H)) then
1268
+ TryNextMethod();
1269
+ fi;
1270
+ return Union([One(H)],
1271
+ GeneratorsOfSemigroup(InnerTranslationalHull(UnderlyingSemigroup(H))));
1272
+ end);
1273
+
1274
+ InstallMethod(Size,
1275
+ "for a semigroup of left/right translations of a monogenic semigroup",
1276
+ [IsTranslationsSemigroup and IsWholeFamily],
1277
+ 1,
1278
+ function(T)
1279
+ if not IsMonogenicSemigroup(UnderlyingSemigroup(T)) then
1280
+ TryNextMethod();
1281
+ fi;
1282
+ return Size(UnderlyingSemigroup(T));
1283
+ end);
1284
+
1285
+ InstallMethod(Size, "for a translational hull of a monogenic semigroup",
1286
+ [IsBitranslationsSemigroup and IsWholeFamily],
1287
+ 1,
1288
+ function(H)
1289
+ if not IsMonogenicSemigroup(UnderlyingSemigroup(H)) then
1290
+ TryNextMethod();
1291
+ fi;
1292
+ return Size(UnderlyingSemigroup(H));
1293
+ end);
1294
+
1295
+ #############################################################################
1296
+ # 6. Technical methods
1297
+ #############################################################################
1298
+
1299
+ InstallMethod(UnderlyingRepresentatives,
1300
+ "for a semigroup of left or right translations",
1301
+ [IsTranslationsSemigroup],
1302
+ function(T)
1303
+ local S, L, G;
1304
+
1305
+ S := UnderlyingSemigroup(T);
1306
+ L := IsLeftTranslationsSemigroup(T);
1307
+
1308
+ if SEMIGROUPS.IsNormalRMSOverGroup(S) then
1309
+ G := UnderlyingSemigroup(S);
1310
+ if L then
1311
+ return List(Rows(S), i -> RMSElement(S, i, One(G), 1));
1312
+ else
1313
+ return List(Columns(S), j -> RMSElement(S, 1, One(G), j));
1314
+ fi;
1315
+ fi;
1316
+
1317
+ if IsLeftTranslationsSemigroup(T) then
1318
+ return List(MaximalRClasses(S), Representative);
1319
+ else
1320
+ return List(MaximalLClasses(S), Representative);
1321
+ fi;
1322
+ end);
1323
+
1324
+ InstallMethod(RepresentativeMultipliers,
1325
+ "for a semigroup of left translation",
1326
+ [IsTranslationsSemigroup],
1327
+ function(T)
1328
+ local S, reps, M, out, x, i, j;
1329
+
1330
+ S := UnderlyingSemigroup(T);
1331
+ reps := UnderlyingRepresentatives(T);
1332
+
1333
+ if IsLeftTranslationsSemigroup(T) then
1334
+ M := MultiplicationTableWithCanonicalPositions(S);
1335
+ else
1336
+ M := TransposedMultiplicationTableWithCanonicalPositions(S);
1337
+ fi;
1338
+
1339
+ out := ListWithIdenticalEntries(Length(M), fail);
1340
+ for i in [1 .. Length(reps)] do
1341
+ x := PositionCanonical(S, reps[i]);
1342
+ for j in [1 .. Size(S)] do
1343
+ if out[M[x][j]] = fail then
1344
+ # store [i, j] instead of [x, j] for efficiency
1345
+ out[M[x][j]] := [i, j];
1346
+ fi;
1347
+ od;
1348
+ out[x] := [i, 0];
1349
+ od;
1350
+ return out;
1351
+ end);
1352
+
1353
+ InstallMethod(AsList, "for a semigroup of left or right translations",
1354
+ [IsTranslationsSemigroup and IsWholeFamily],
1355
+ function(T)
1356
+ # Just use the AsList for semigroups if generators are known
1357
+ if SEMIGROUPS.HasEasyTranslationsGenerators(T) then
1358
+ TryNextMethod();
1359
+ elif IsLeftTranslationsSemigroup(T) then
1360
+ return SEMIGROUPS.LeftTranslationsBacktrack(T);
1361
+ else
1362
+ return SEMIGROUPS.RightTranslationsBacktrack(T);
1363
+ fi;
1364
+ end);
1365
+
1366
+ InstallMethod(AsList, "for a translational hull",
1367
+ [IsBitranslationsSemigroup and IsWholeFamily],
1368
+ function(H)
1369
+ local S;
1370
+
1371
+ S := UnderlyingSemigroup(H);
1372
+ if SEMIGROUPS.HasEasyBitranslationsGenerators(H) then
1373
+ TryNextMethod();
1374
+ elif IsReesZeroMatrixSemigroup(S) and IsZeroSimpleSemigroup(S) then
1375
+ return SEMIGROUPS.BitranslationsRZMS(H);
1376
+ elif SEMIGROUPS.IsNormalRMSOverGroup(S) then
1377
+ return SEMIGROUPS.BitranslationsNormalRMS(H);
1378
+ else
1379
+ return SEMIGROUPS.BitranslationsBacktrack(H);
1380
+ fi;
1381
+ end);
1382
+
1383
+ InstallMethod(Size, "for a semigroups of left or right translations",
1384
+ [IsTranslationsSemigroup and IsWholeFamily],
1385
+ T -> Size(AsList(T)));
1386
+
1387
+ InstallMethod(Size, "for a translational hull",
1388
+ [IsBitranslationsSemigroup and IsWholeFamily],
1389
+ H -> Size(AsList(H)));
1390
+
1391
+ InstallMethod(NrLeftTranslations, "for a semigroup",
1392
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
1393
+ function(S)
1394
+ local L, out;
1395
+
1396
+ L := LeftTranslations(S);
1397
+ if SEMIGROUPS.HasEasyTranslationsGenerators(L) then
1398
+ return Size(L); # this is probably more efficient
1399
+ fi;
1400
+
1401
+ out := SEMIGROUPS.LeftTranslationsBacktrack(L, "nr_only");
1402
+ SetSize(L, out);
1403
+ return out;
1404
+ end);
1405
+
1406
+ InstallMethod(NrRightTranslations, "for a semigroup",
1407
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
1408
+ function(S)
1409
+ local R, out;
1410
+
1411
+ R := RightTranslations(S);
1412
+ if SEMIGROUPS.HasEasyTranslationsGenerators(R) then
1413
+ return Size(R); # this is probably more efficient
1414
+ fi;
1415
+
1416
+ out := SEMIGROUPS.RightTranslationsBacktrack(R, "nr_only");
1417
+ SetSize(R, out);
1418
+ return out;
1419
+ end);
1420
+
1421
+ # TODO (later): avoid reproducing the logic in AsList
1422
+ InstallMethod(NrBitranslations, "for a semigroup",
1423
+ [IsSemigroup and CanUseFroidurePin and IsFinite],
1424
+ function(S)
1425
+ local H, out;
1426
+
1427
+ H := TranslationalHull(S);
1428
+ if SEMIGROUPS.HasEasyBitranslationsGenerators(H) then
1429
+ return Size(H); # this is probably more efficient
1430
+ elif IsReesZeroMatrixSemigroup(S) and IsZeroSimpleSemigroup(S) then
1431
+ out := SEMIGROUPS.BitranslationsRZMS(H, "nr_only");
1432
+ elif SEMIGROUPS.IsNormalRMSOverGroup(S) then
1433
+ out := SEMIGROUPS.BitranslationsNormalRMS(H, "nr_only");
1434
+ else
1435
+ out := SEMIGROUPS.BitranslationsBacktrack(H, "nr_only");
1436
+ fi;
1437
+
1438
+ SetSize(H, out);
1439
+ return out;
1440
+ end);
1441
+
1442
+ InstallMethod(Representative, "for a semigroup of left or right translations",
1443
+ [IsTranslationsSemigroup and IsWholeFamily],
1444
+ function(T)
1445
+ local S;
1446
+ S := UnderlyingSemigroup(T);
1447
+ if IsLeftTranslationsSemigroup(T) then
1448
+ return LeftTranslation(T, MappingByFunction(S, S, x -> x));
1449
+ else
1450
+ return RightTranslation(T, MappingByFunction(S, S, x -> x));
1451
+ fi;
1452
+ end);
1453
+
1454
+ InstallMethod(Representative, "for a translational hull",
1455
+ [IsBitranslationsSemigroup and IsWholeFamily],
1456
+ function(H)
1457
+ local L, R, S;
1458
+ S := UnderlyingSemigroup(H);
1459
+ L := LeftTranslations(S);
1460
+ R := RightTranslations(S);
1461
+ return Bitranslation(H, Representative(L), Representative(R));
1462
+ end);
1463
+
1464
+ InstallMethod(ViewObj, "for a semigroup of left or right translations",
1465
+ [IsTranslationsSemigroup and IsWholeFamily],
1466
+ function(T)
1467
+ Print("<the semigroup of ");
1468
+ if IsLeftTranslationsSemigroup(T) then Print("left ");
1469
+ else Print("right ");
1470
+ fi;
1471
+ Print("translations of ", ViewString(UnderlyingSemigroup(T)), ">");
1472
+ end);
1473
+
1474
+ # TODO: not supposed to do this
1475
+ InstallMethod(ViewObj, "for a semigroup of translations",
1476
+ [IsTranslationsSemigroup], PrintObj);
1477
+
1478
+ InstallMethod(PrintObj, "for a semigroup of translations",
1479
+ [IsTranslationsSemigroup],
1480
+ function(T)
1481
+ if IsLeftTranslationsSemigroup(T) then
1482
+ Print("<left ");
1483
+ else
1484
+ Print("<right ");
1485
+ fi;
1486
+ Print("translations semigroup over ",
1487
+ ViewString(UnderlyingSemigroup(T)),
1488
+ ">");
1489
+ end);
1490
+
1491
+ InstallMethod(ViewObj, "for a translation",
1492
+ [IsSemigroupTranslation], PrintObj);
1493
+
1494
+ InstallMethod(PrintObj, "for a translation",
1495
+ [IsSemigroupTranslation],
1496
+ function(t)
1497
+ local L, S;
1498
+ L := IsLeftTranslation(t);
1499
+ if L then
1500
+ S := UnderlyingSemigroup(LeftTranslationsSemigroupOfFamily(FamilyObj(t)));
1501
+ Print("<left ");
1502
+ else
1503
+ S := UnderlyingSemigroup(RightTranslationsSemigroupOfFamily(FamilyObj(t)));
1504
+ Print("<right ");
1505
+ fi;
1506
+
1507
+ Print("translation on ", ViewString(S), ">");
1508
+ end);
1509
+
1510
+ InstallMethod(ViewObj, "for a translational hull",
1511
+ [IsBitranslationsSemigroup], PrintObj);
1512
+
1513
+ InstallMethod(PrintObj, "for a translational hull",
1514
+ [IsBitranslationsSemigroup and IsWholeFamily],
1515
+ function(H)
1516
+ Print("<translational hull over ", ViewString(UnderlyingSemigroup(H)), ">");
1517
+ end);
1518
+
1519
+ InstallMethod(PrintObj, "for a subsemigroup of a translational hull",
1520
+ [IsBitranslationsSemigroup],
1521
+ function(H)
1522
+ Print("<semigroup of bitranslations over ",
1523
+ ViewString(UnderlyingSemigroup(H)), ">");
1524
+ end);
1525
+
1526
+ InstallMethod(ViewObj, "for a bitranslation",
1527
+ [IsBitranslation], PrintObj);
1528
+
1529
+ InstallMethod(PrintObj, "for a bitranslation",
1530
+ [IsBitranslation],
1531
+ function(t)
1532
+ local H;
1533
+ H := TranslationalHullOfFamily(FamilyObj(t));
1534
+ Print("<bitranslation on ", ViewString(UnderlyingSemigroup(H)), ">");
1535
+ end);
1536
+
1537
+ # Note the order of multiplication
1538
+ InstallMethod(\*, "for left translations of a semigroup",
1539
+ IsIdenticalObj,
1540
+ [IsLeftTranslation, IsLeftTranslation],
1541
+ function(x, y)
1542
+ local L, S, prod, i;
1543
+ L := LeftTranslationsSemigroupOfFamily(FamilyObj(x));
1544
+ S := UnderlyingSemigroup(L);
1545
+ prod := [];
1546
+ for i in [1 .. Size(UnderlyingRepresentatives(L))] do
1547
+ prod[i] := PositionCanonical(S, EnumeratorCanonical(S)[y![1][i]] ^ x);
1548
+ od;
1549
+ return Objectify(FamilyObj(x)!.type, [prod]);
1550
+ end);
1551
+
1552
+ InstallMethod(\=, "for left translations of a semigroup",
1553
+ IsIdenticalObj, [IsLeftTranslation, IsLeftTranslation],
1554
+ {x, y} -> x![1] = y![1]);
1555
+
1556
+ InstallMethod(\<, "for left translations of a semigroup",
1557
+ IsIdenticalObj, [IsLeftTranslation, IsLeftTranslation],
1558
+ {x, y} -> x![1] < y![1]);
1559
+
1560
+ # Different order of multiplication
1561
+ InstallMethod(\*, "for right translations of a semigroup",
1562
+ IsIdenticalObj,
1563
+ [IsRightTranslation, IsRightTranslation],
1564
+ function(x, y)
1565
+ local R, S, prod, i;
1566
+ R := RightTranslationsSemigroupOfFamily(FamilyObj(x));
1567
+ S := UnderlyingSemigroup(R);
1568
+ prod := [];
1569
+ for i in [1 .. Size(UnderlyingRepresentatives(R))] do
1570
+ prod[i] := PositionCanonical(S, EnumeratorCanonical(S)[x![1][i]] ^ y);
1571
+ od;
1572
+ return Objectify(FamilyObj(x)!.type, [prod]);
1573
+ end);
1574
+
1575
+ InstallMethod(\=, "for right translations of a semigroup",
1576
+ IsIdenticalObj, [IsRightTranslation, IsRightTranslation],
1577
+ {x, y} -> x![1] = y![1]);
1578
+
1579
+ InstallMethod(\<, "for right translations of a semigroup",
1580
+ IsIdenticalObj, [IsRightTranslation, IsRightTranslation],
1581
+ {x, y} -> x![1] < y![1]);
1582
+
1583
+ InstallMethod(\^, "for a semigroup element and a translation",
1584
+ [IsAssociativeElement, IsSemigroupTranslation],
1585
+ function(x, t)
1586
+ local T, S, M, enum, y;
1587
+
1588
+ if IsLeftTranslation(t) then
1589
+ T := LeftTranslationsSemigroupOfFamily(FamilyObj(t));
1590
+ S := UnderlyingSemigroup(T);
1591
+ M := MultiplicationTableWithCanonicalPositions(S);
1592
+ else
1593
+ T := RightTranslationsSemigroupOfFamily(FamilyObj(t));
1594
+ S := UnderlyingSemigroup(T);
1595
+ M := TransposedMultiplicationTableWithCanonicalPositions(S);
1596
+ fi;
1597
+ if not x in S then
1598
+ ErrorNoReturn("the first argument must be an element of the domain of ",
1599
+ "the second");
1600
+ fi;
1601
+ enum := EnumeratorCanonical(S);
1602
+ x := PositionCanonical(S, x);
1603
+ y := RepresentativeMultipliers(T)[x];
1604
+ if y[2] = 0 then
1605
+ return enum[t![1][y[1]]];
1606
+ else
1607
+ return enum[M[t![1][y[1]]][y[2]]];
1608
+ fi;
1609
+ end);
1610
+
1611
+ SEMIGROUPS.ImagePositionsOfTranslation := function(x)
1612
+ local T, S, tab, images, g;
1613
+ if IsLeftTranslation(x) then
1614
+ T := LeftTranslationsSemigroupOfFamily(FamilyObj(x));
1615
+ S := UnderlyingSemigroup(T);
1616
+ tab := MultiplicationTableWithCanonicalPositions(S);
1617
+ else
1618
+ T := RightTranslationsSemigroupOfFamily(FamilyObj(x));
1619
+ S := UnderlyingSemigroup(T);
1620
+ tab := TransposedMultiplicationTableWithCanonicalPositions(S);
1621
+ fi;
1622
+ images := [];
1623
+ for g in UnderlyingRepresentatives(T) do
1624
+ UniteSet(images, tab[PositionCanonical(S, g ^ x)]);
1625
+ od;
1626
+ return images;
1627
+ end;
1628
+
1629
+ InstallMethod(ImageSetOfTranslation, "for a left or right translation",
1630
+ [IsSemigroupTranslation],
1631
+ function(x)
1632
+ local T, S, enum;
1633
+ if IsLeftTranslation(x) then
1634
+ T := LeftTranslationsSemigroupOfFamily(FamilyObj(x));
1635
+ S := UnderlyingSemigroup(T);
1636
+ else
1637
+ T := RightTranslationsSemigroupOfFamily(FamilyObj(x));
1638
+ S := UnderlyingSemigroup(T);
1639
+ fi;
1640
+ enum := EnumeratorCanonical(S);
1641
+ return Set(List(SEMIGROUPS.ImagePositionsOfTranslation(x), i -> enum[i]));
1642
+ end);
1643
+
1644
+ InstallMethod(\*, "for bitranslations",
1645
+ IsIdenticalObj, [IsBitranslation, IsBitranslation],
1646
+ {x, y} -> Objectify(FamilyObj(x)!.type, [x![1] * y![1], x![2] * y![2]]));
1647
+
1648
+ InstallMethod(\=, "for bitranslations",
1649
+ IsIdenticalObj, [IsBitranslation, IsBitranslation],
1650
+ {x, y} -> x![1] = y![1] and x![2] = y![2]);
1651
+
1652
+ InstallMethod(\<, "for bitranslations", IsIdenticalObj,
1653
+ [IsBitranslation, IsBitranslation],
1654
+ {x, y} -> x![1] < y![1] or (x![1] = y![1] and x![2] < y![2]));
1655
+
1656
+ InstallMethod(UnderlyingSemigroup,
1657
+ "for a semigroup of left or right translations",
1658
+ [IsTranslationsSemigroup],
1659
+ function(T)
1660
+ if IsLeftTranslationsSemigroup(T) then
1661
+ return UnderlyingSemigroup(LeftTranslationsSemigroupOfFamily(
1662
+ ElementsFamily(
1663
+ FamilyObj(T))));
1664
+ else
1665
+ return UnderlyingSemigroup(RightTranslationsSemigroupOfFamily(
1666
+ ElementsFamily(
1667
+ FamilyObj(T))));
1668
+ fi;
1669
+ end);
1670
+
1671
+ InstallMethod(UnderlyingSemigroup,
1672
+ "for a subsemigroup of the translational hull",
1673
+ [IsBitranslationsSemigroup],
1674
+ function(H)
1675
+ return UnderlyingSemigroup(TranslationalHullOfFamily(ElementsFamily(
1676
+ FamilyObj(H))));
1677
+ end);
1678
+
1679
+ InstallMethod(ChooseHashFunction, "for a left or right translation and int",
1680
+ [IsSemigroupTranslation, IsInt],
1681
+ function(_, hashlen)
1682
+ return rec(func := SEMIGROUPS.HashFunctionForTranslations,
1683
+ data := hashlen);
1684
+ end);
1685
+
1686
+ InstallMethod(ChooseHashFunction, "for a bitranslation and int",
1687
+ [IsBitranslation, IsInt],
1688
+ function(_, hashlen)
1689
+ return rec(func := SEMIGROUPS.HashFunctionForBitranslations,
1690
+ data := hashlen);
1691
+ end);
1692
+
1693
+ InstallMethod(OneOp, "for a translational hull",
1694
+ [IsBitranslation],
1695
+ function(h)
1696
+ local H, L, R, S, l, r;
1697
+ H := TranslationalHullOfFamily(FamilyObj(h));
1698
+ S := UnderlyingSemigroup(H);
1699
+ L := LeftTranslations(S);
1700
+ R := RightTranslations(S);
1701
+ l := LeftTranslation(L, MappingByFunction(S, S, x -> x));
1702
+ r := RightTranslation(R, MappingByFunction(S, S, x -> x));
1703
+ return Bitranslation(H, l, r);
1704
+ end);
1705
+
1706
+ InstallMethod(OneOp, "for a semigroup of translations",
1707
+ [IsSemigroupTranslation],
1708
+ function(t)
1709
+ local S, T;
1710
+ if IsLeftTranslation(t) then
1711
+ T := LeftTranslationsSemigroupOfFamily(FamilyObj(t));
1712
+ S := UnderlyingSemigroup(T);
1713
+ return LeftTranslation(T, MappingByFunction(S, S, x -> x));
1714
+ else
1715
+ T := RightTranslationsSemigroupOfFamily(FamilyObj(t));
1716
+ S := UnderlyingSemigroup(T);
1717
+ return RightTranslation(T, MappingByFunction(S, S, x -> x));
1718
+ fi;
1719
+ end);
1720
+
1721
+ InstallGlobalFunction(LeftPartOfBitranslation,
1722
+ function(h)
1723
+ if not IsBitranslation(h) then
1724
+ ErrorNoReturn("the argument must be a bitranslation");
1725
+ fi;
1726
+ return h![1];
1727
+ end);
1728
+
1729
+ InstallGlobalFunction(RightPartOfBitranslation,
1730
+ function(h)
1731
+ if not IsBitranslation(h) then
1732
+ ErrorNoReturn("the argument must be a bitranslation");
1733
+ fi;
1734
+ return h![2];
1735
+ end);
1736
+
1737
+ InstallMethod(IsWholeFamily, "for a collection of translations",
1738
+ [IsSemigroupTranslationCollection],
1739
+ function(C)
1740
+ local L, S, T, t;
1741
+
1742
+ t := Representative(C);
1743
+ L := IsLeftTranslation(t);
1744
+
1745
+ if L then
1746
+ T := LeftTranslationsSemigroupOfFamily(FamilyObj(t));
1747
+ else
1748
+ T := RightTranslationsSemigroupOfFamily(FamilyObj(t));
1749
+ fi;
1750
+
1751
+ S := UnderlyingSemigroup(T);
1752
+
1753
+ if not HasSize(T) or
1754
+ IsRectangularBand(S) or
1755
+ IsSimpleSemigroup(S) or
1756
+ IsZeroSimpleSemigroup(S) or
1757
+ IsMonoidAsSemigroup(S) then
1758
+ TryNextMethod();
1759
+ fi;
1760
+
1761
+ return Size(T) = Size(C);
1762
+ end);
1763
+
1764
+ InstallMethod(IsWholeFamily, "for a collection of bitranslations",
1765
+ [IsBitranslationCollection],
1766
+ function(C)
1767
+ local b, H, S;
1768
+ b := Representative(C);
1769
+ H := TranslationalHullOfFamily(FamilyObj(b));
1770
+ S := UnderlyingSemigroup(H);
1771
+
1772
+ if not HasSize(H) or
1773
+ IsRectangularBand(S) or
1774
+ IsMonoidAsSemigroup(S) then
1775
+ TryNextMethod();
1776
+ fi;
1777
+
1778
+ return Size(H) = Size(C);
1779
+ end);