passagemath-gap-pkg-semigroups 10.6.29__cp312-abi3-manylinux_2_24_x86_64.manylinux_2_28_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-pc-linux-gnu-default64-kv10/semigroups.so +0 -0
  15. gap/pkg/semigroups/config.guess +1807 -0
  16. gap/pkg/semigroups/config.log +1069 -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 +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.libs/libsemigroups-6be12ad2.so.2.0.0 +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,740 @@
1
+ ############################################################################
2
+ ##
3
+ ## elements/pbr.gi
4
+ ## Copyright (C) 2015-2022 Attila Egri-Nagy
5
+ ##
6
+ ## Licensing information can be found in the README file of this package.
7
+ ##
8
+ #############################################################################
9
+ ##
10
+
11
+ # This file contains an initial implementation of partitioned binary
12
+ # relations (PBRs) as defined in:
13
+ #
14
+ # Paul Martin and Volodymyr Mazorchuk, Partitioned binary relations,
15
+ # Mathematica Scandinavica, v113, n1, p. 30-52, https://arxiv.org/abs/1102.0862
16
+
17
+ # Internally a PBR is stored as the adjacency list of digraph with
18
+ # vertices [1 .. 2 * n] for some n. More precisely if <x> is a PBR, then:
19
+ #
20
+ # * <x![1]> is equal to <n>
21
+ #
22
+ # * <x![i + 1]> is the vertices adjacent to <i>
23
+ #
24
+ # The number <n> is the *degree* of <x>.
25
+
26
+ #############################################################################
27
+ # Family and type.
28
+ #
29
+ # One per degree to avoid lists with pbrs of different degrees
30
+ # belonging to IsAssociativeElementCollection.
31
+ #############################################################################
32
+
33
+ BindGlobal("TYPES_PBR", []);
34
+ BindGlobal("TYPE_PBR",
35
+ function(n)
36
+
37
+ if not IsInt(n) or n < 0 then
38
+ ErrorNoReturn("the argument is not a non-negative integer");
39
+ fi;
40
+
41
+ n := n + 1; # since the degree can be 0
42
+
43
+ if not IsBound(TYPES_PBR[n]) then
44
+ TYPES_PBR[n] := NewType(NewFamily(Concatenation("PBRFamily",
45
+ String(n - 1)),
46
+ IsPBR,
47
+ CanEasilySortElements,
48
+ CanEasilySortElements),
49
+ IsPBR and IsPositionalObjectRep);
50
+ fi;
51
+
52
+ return TYPES_PBR[n];
53
+ end);
54
+
55
+ #############################################################################
56
+ # Pickler
57
+ #############################################################################
58
+
59
+ InstallMethod(IO_Pickle, "for a PBR",
60
+ [IsFile, IsPBR],
61
+ function(file, x)
62
+ if IO_Write(file, "PABR") = fail then
63
+ return IO_Error;
64
+ fi;
65
+ return IO_Pickle(file, List([1 .. 2 * x![1] + 1], i -> x![i]));
66
+ end);
67
+
68
+ IO_Unpicklers.PABR := function(file)
69
+ local x;
70
+ x := IO_Unpickle(file);
71
+ if x = IO_Error then
72
+ return IO_Error;
73
+ fi;
74
+ return Objectify(TYPE_PBR(x![1]), x);
75
+ end;
76
+
77
+ #############################################################################
78
+ # TODO(later) the embeddings from the paper, AsPBR for a pbr (extend or
79
+ # restrict),
80
+ #############################################################################
81
+
82
+ InstallMethod(EmptyPBR, "for a pos int", [IsPosInt],
83
+ n -> PBRNC(List([1 .. n], y -> []), List([1 .. n], y -> [])));
84
+
85
+ InstallMethod(IdentityPBR, "for a pos int", [IsPosInt],
86
+ n -> PBRNC(List([1 .. n], y -> [-y]), List([1 .. n], y -> [y])));
87
+
88
+ InstallMethod(UniversalPBR, "for a pos in", [IsPosInt],
89
+ function(n)
90
+ local x;
91
+ x := Concatenation([-n .. -1], [1 .. n]);
92
+ return PBRNC(List([1 .. n], y -> x), List([1 .. n], y -> x));
93
+ end);
94
+
95
+ # The following is temporary, with the current definition of
96
+ # IsGeneratorsOfInverseSemigroup for a pbr collection, the One of any element
97
+ # in the collection does not satisfy IsGeneratorsOfInverseSemigroup, and so it
98
+ # cannot be inverted.
99
+
100
+ InstallMethod(InverseMonoidByGenerators,
101
+ [IsPBRCollection],
102
+ function(_)
103
+ ErrorNoReturn("not yet implemented");
104
+ end);
105
+
106
+ # See the comment above, this is not really correct.
107
+
108
+ InstallOtherMethod(InverseMutable, "for a PBR", [IsPBR],
109
+ function(x)
110
+ # TODO(later) change IsBlockBijection(AsBipartition(x)) to
111
+ # IsBlockBijectionPBR.
112
+ if IsPartialPermPBR(x) or
113
+ (IsBipartitionPBR(x) and IsBlockBijection(AsBipartition(x))) then
114
+ return Star(x);
115
+ fi;
116
+ return fail;
117
+ end);
118
+
119
+ # See the comment above, this is not really correct.
120
+
121
+ InstallMethod(IsGeneratorsOfInverseSemigroup, "for a pbr collection",
122
+ [IsPBRCollection],
123
+ function(coll)
124
+ return ForAll(coll, IsBipartitionPBR)
125
+ and IsGeneratorsOfInverseSemigroup(List(coll, AsBipartition));
126
+ end);
127
+
128
+ InstallMethod(StarOp, "for a pbr", [IsPBR],
129
+ function(x)
130
+ local ext;
131
+ ext := ShallowCopy(ExtRepOfObj(x) * -1);
132
+ Apply(ext, ShallowCopy);
133
+ Apply(ext[1], ShallowCopy);
134
+ Apply(ext[2], ShallowCopy);
135
+ return PBR(ext[2], ext[1]);
136
+ end);
137
+
138
+ InstallMethod(DegreeOfPBRCollection, "for a PBR collection",
139
+ [IsPBRCollection],
140
+ function(coll)
141
+ if IsPBRSemigroup(coll) then
142
+ return DegreeOfPBRSemigroup(coll);
143
+ fi;
144
+ return DegreeOfPBR(coll[1]);
145
+ end);
146
+
147
+ InstallMethod(IsBipartitionPBR, "for a pbr",
148
+ [IsPBR],
149
+ x -> IsEquivalenceBooleanMat(AsBooleanMat(x)));
150
+
151
+ InstallMethod(IsTransformationPBR, "for a pbr",
152
+ [IsPBR],
153
+ function(x)
154
+ local n, i;
155
+
156
+ n := x![1];
157
+ for i in [2 .. n + 1] do
158
+ if Length(x![i]) <> 1 or x![i][1] <= n
159
+ or not i - 1 in x![x![i][1] + 1] then
160
+ return false;
161
+ fi;
162
+ od;
163
+ for i in [n + 2 .. 2 * n + 1] do
164
+ if not ForAll(x![i], j -> j <= n and x![j + 1][1] = i - 1) then
165
+ return false;
166
+ fi;
167
+ od;
168
+
169
+ return true;
170
+ end);
171
+
172
+ InstallMethod(IsBlockBijectionPBR, "for a pbr",
173
+ [IsPBR],
174
+ x -> IsBipartitionPBR(x) and IsBlockBijection(AsBipartition(x)));
175
+
176
+ InstallMethod(IsPartialPermPBR, "for a pbr",
177
+ [IsPBR],
178
+ x -> IsBipartitionPBR(x) and IsPartialPermBipartition(AsBipartition(x)));
179
+
180
+ InstallMethod(IsPermPBR, "for a pbr",
181
+ [IsPBR],
182
+ x -> IsBipartitionPBR(x) and IsPermBipartition(AsBipartition(x)));
183
+
184
+ InstallMethod(IsDualTransformationPBR, "for a pbr",
185
+ [IsPBR],
186
+ x -> IsBipartitionPBR(x) and IsDualTransBipartition(AsBipartition(x)));
187
+
188
+ InstallMethod(NumberPBR, "for a pbr",
189
+ [IsPBR],
190
+ x -> NumberBooleanMat(AsBooleanMat(x)));
191
+
192
+ InstallMethod(PBRNumber, "for pos int and pos int",
193
+ [IsPosInt, IsPosInt],
194
+ {nr, deg} -> AsPBR(BooleanMatNumber(nr, 2 * deg)));
195
+
196
+ InstallMethod(IsEmptyPBR, "for a partition binary relation",
197
+ [IsPBR],
198
+ function(x)
199
+ local n, i;
200
+
201
+ n := x![1];
202
+ for i in [2 .. 2 * n + 1] do
203
+ if Length(x![i]) > 0 then
204
+ return false;
205
+ fi;
206
+ od;
207
+ return true;
208
+ end);
209
+
210
+ InstallMethod(IsIdentityPBR, "for a partition binary relation",
211
+ [IsPBR],
212
+ function(x)
213
+ local n, i;
214
+
215
+ n := x![1];
216
+ for i in [2 .. n + 1] do
217
+ if Length(x![i]) <> 1 or x![i][1] <> i + n - 1 then
218
+ return false;
219
+ fi;
220
+ od;
221
+ for i in [n + 2 .. 2 * n + 1] do
222
+ if Length(x![i]) <> 1 or x![i][1] <> i - n - 1 then
223
+ return false;
224
+ fi;
225
+ od;
226
+ return true;
227
+ end);
228
+
229
+ InstallMethod(IsUniversalPBR, "for a partition binary relation",
230
+ [IsPBR],
231
+ function(x)
232
+ local n, i;
233
+
234
+ n := x![1];
235
+ for i in [2 .. 2 * n + 1] do
236
+ if Length(x![i]) < 2 * n then
237
+ return false;
238
+ fi;
239
+ od;
240
+ return true;
241
+ end);
242
+
243
+ InstallMethod(AsPBR, "for a partial perm and pos int",
244
+ [IsPartialPerm, IsPosInt],
245
+ function(x, deg)
246
+ local left, right, j, i;
247
+
248
+ left := List([1 .. deg], x -> []);
249
+ right := List([1 .. deg], x -> []);
250
+
251
+ for i in [1 .. deg] do
252
+ j := i ^ x;
253
+ if j <= deg and j <> 0 then
254
+ Add(left[i], -j);
255
+ Add(right[j], i);
256
+ fi;
257
+ od;
258
+
259
+ return PBR(left, right);
260
+ end);
261
+
262
+ InstallMethod(AsPBR, "for a partial perm", [IsPartialPerm],
263
+ x -> AsPBR(x, Maximum(DegreeOfPartialPerm(x), CoDegreeOfPartialPerm(x))));
264
+
265
+ InstallMethod(AsPBR, "for a transformation and pos int",
266
+ [IsTransformation, IsPosInt],
267
+ function(x, deg)
268
+ local left, right, i;
269
+
270
+ left := List([1 .. deg], x -> []);
271
+ right := List([1 .. deg], x -> []);
272
+
273
+ for i in [1 .. deg] do
274
+ Add(left[i], -(i ^ x));
275
+ Add(right[i ^ x], i);
276
+ od;
277
+
278
+ return PBR(left, right);
279
+ end);
280
+
281
+ InstallMethod(AsPBR, "for a transformation", [IsTransformation],
282
+ x -> AsPBR(x, DegreeOfTransformation(x)));
283
+
284
+ InstallMethod(AsPBR, "for a multiplicative element",
285
+ [IsMultiplicativeElement], x -> AsPBR(AsBipartition(x)));
286
+
287
+ InstallMethod(AsPBR, "for a multiplicative element and pos int",
288
+ [IsMultiplicativeElement, IsPosInt], {x, n} -> AsPBR(AsBipartition(x, n)));
289
+
290
+ # TODO(later) The following doesn't define a monoid embedding of P_n into
291
+ # PBR_n. What is a monoid embedding from P_n to PBR_n?
292
+
293
+ InstallMethod(AsPBR, "for a bipartition",
294
+ [IsBipartition], x -> AsPBR(x, DegreeOfBipartition(x)));
295
+
296
+ InstallMethod(AsPBR, "for a bipartition and pos int",
297
+ [IsBipartition, IsPosInt],
298
+ function(x, n)
299
+ local deg, blocks, out, dom, block, i;
300
+
301
+ deg := DegreeOfBipartition(x);
302
+ blocks := ExtRepOfObj(x);
303
+ out := [[], []];
304
+ dom := Union([-n .. -1], [1 .. n]);
305
+
306
+ for block in blocks do
307
+ for i in block do
308
+ if AbsInt(i) <= n then
309
+ if i < 0 then
310
+ out[2][-i] := Intersection(block, dom);
311
+ else
312
+ out[1][i] := Intersection(block, dom);
313
+ fi;
314
+ fi;
315
+ od;
316
+ od;
317
+ for i in [deg + 1 .. n] do
318
+ Add(out[1], []);
319
+ Add(out[2], []);
320
+ od;
321
+
322
+ return PBRNC(out[1], out[2]);
323
+ end);
324
+
325
+ InstallMethod(AsPBR, "for a boolean matrix", [IsBooleanMat],
326
+ function(x)
327
+ local dim, succ;
328
+
329
+ dim := DimensionOfMatrixOverSemiring(x);
330
+ if not IsEvenInt(dim) then
331
+ ErrorNoReturn("the 1st argument (a boolean matrix)is not of ",
332
+ "even dimension");
333
+ fi;
334
+ succ := Successors(x);
335
+ return PBRNC(succ{[1 .. dim / 2]}, succ{[dim / 2 + 1 .. dim]});
336
+ end);
337
+
338
+ InstallMethod(AsPBR, "for a boolean mat and pos int",
339
+ [IsBooleanMat, IsPosInt],
340
+ function(mat, n)
341
+ local m, nbs, k, i, j;
342
+
343
+ if not IsEvenInt(n) then
344
+ ErrorNoReturn("the 2nd argument (a pos. int) is not even");
345
+ fi;
346
+
347
+ m := DimensionOfMatrixOverSemiring(mat);
348
+
349
+ if not IsEvenInt(m) then
350
+ ErrorNoReturn("the 1st argument (a boolean matrix) ",
351
+ "does not have even dimension");
352
+ fi;
353
+
354
+ nbs := [List([1 .. n / 2], x -> []),
355
+ List([1 .. n / 2], x -> [])];
356
+
357
+ if n <= m then
358
+ for i in [1 .. n / 2] do
359
+ for j in [1 .. n] do
360
+ if mat[i][j] then
361
+ Add(nbs[1][i], j);
362
+ fi;
363
+ od;
364
+ od;
365
+ for i in [n / 2 + 1 .. n] do
366
+ for j in [1 .. n] do
367
+ if mat[i][j] then
368
+ Add(nbs[2][i - n / 2], j);
369
+ fi;
370
+ od;
371
+ od;
372
+ else
373
+ k := (n - m) / 2;
374
+
375
+ for i in [1 .. m / 2] do
376
+ for j in [1 .. m / 2] do
377
+ if mat[i][j] then
378
+ Add(nbs[1][i], j);
379
+ fi;
380
+ od;
381
+ for j in [m / 2 + 1 .. m] do
382
+ if mat[i][j] then
383
+ Add(nbs[1][i], j + k);
384
+ fi;
385
+ od;
386
+ od;
387
+ for i in [m / 2 + 1 .. m] do
388
+ for j in [1 .. m / 2] do
389
+ if mat[i][j] then
390
+ Add(nbs[2][i - m / 2], j);
391
+ fi;
392
+ od;
393
+ for j in [m / 2 + 1 .. m] do
394
+ if mat[i][j] then
395
+ Add(nbs[2][i - m / 2], j + k);
396
+ fi;
397
+ od;
398
+ od;
399
+ fi;
400
+
401
+ return PBRNC(nbs[1], nbs[2]);
402
+ end);
403
+
404
+ # TODO(later) 2 arg version of this
405
+
406
+ InstallMethod(AsTransformation, "for a pbr", [IsPBR],
407
+ function(x)
408
+ local out, n, i;
409
+
410
+ if not IsTransformationPBR(x) then
411
+ ErrorNoReturn("the argument (a pbr) does not define a transformation");
412
+ fi;
413
+
414
+ out := [];
415
+ n := x![1];
416
+
417
+ for i in [2 .. n + 1] do
418
+ out[i - 1] := x![i][1] - n;
419
+ od;
420
+
421
+ return Transformation(out);
422
+ end);
423
+
424
+ # TODO(later) 2 arg version of this
425
+
426
+ InstallMethod(AsPartialPerm, "for a pbr", [IsPBR],
427
+ function(x)
428
+ if not IsPartialPermPBR(x) then
429
+ ErrorNoReturn("the argument (a pbr) does not define a partial perm");
430
+ fi;
431
+ return AsPartialPerm(AsBipartition(x));
432
+ end);
433
+
434
+ # TODO(later) 2 arg version of this
435
+
436
+ InstallMethod(AsPermutation, "for a pbr", [IsPBR],
437
+ function(x)
438
+ if not IsPermPBR(x) then
439
+ ErrorNoReturn("the argument (a pbr) does not define a permutation");
440
+ fi;
441
+ return AsPermutation(AsBipartition(x));
442
+ end);
443
+
444
+ InstallMethod(RandomPBR, "for a pos int", [IsPosInt],
445
+ function(n)
446
+ local digraph;
447
+ digraph := RandomDigraph(2 * n);
448
+ return PBRNC(OutNeighbours(digraph){[1 .. n]},
449
+ OutNeighbours(digraph){[n + 1 .. 2 * n]});
450
+ end);
451
+
452
+ InstallMethod(RandomPBR, "for a pos int", [IsPosInt, IsFloat],
453
+ function(n, p)
454
+ local digraph;
455
+ digraph := RandomDigraph(2 * n, p);
456
+ return PBRNC(OutNeighbours(digraph){[1 .. n]},
457
+ OutNeighbours(digraph){[n + 1 .. 2 * n]});
458
+ end);
459
+
460
+ InstallMethod(PBR, "for pair of dense list",
461
+ [IsDenseList, IsDenseList],
462
+ function(left, right)
463
+ local deg, i;
464
+
465
+ if Length(left) <> Length(right) then
466
+ ErrorNoReturn("the arguments (dense lists) do not have equal length");
467
+ fi;
468
+
469
+ deg := Length(left);
470
+
471
+ for i in [1 .. deg] do
472
+ if not IsHomogeneousList(left[i]) then
473
+ ErrorNoReturn("expected a homogeneous list in position ", i,
474
+ " of the 1st argument (a dense list)");
475
+ elif not IsHomogeneousList(right[i]) then
476
+ ErrorNoReturn("expected a homogeneous list in position ", i,
477
+ " of the 2nd argument (a dense list)");
478
+ elif not ForAll(left[i], j -> IsInt(j) and j <> 0
479
+ and j <= deg and j >= -deg)
480
+ or not ForAll(right[i], j -> IsInt(j) and j <> 0
481
+ and j <= deg and j >= -deg) then
482
+ # TODO(later) more informative
483
+ ErrorNoReturn("the entries in the arguments are not integers ",
484
+ "in [", -deg, " .. -1] or [1 .. ", deg, "]");
485
+ fi;
486
+ od;
487
+ return PBRNC(left, right);
488
+ end);
489
+
490
+ InstallGlobalFunction(PBRNC,
491
+ function(arg...)
492
+ local left, right, n, i, j;
493
+
494
+ arg := StructuralCopy(arg);
495
+ left := arg[1]; # things adjacent to positives
496
+ right := arg[2]; # things adjacent to negatives
497
+
498
+ n := Length(left);
499
+
500
+ for i in [1 .. n] do
501
+ for j in [1 .. Length(left[i])] do
502
+ if left[i][j] < 0 then
503
+ left[i][j] := -left[i][j] + n;
504
+ fi;
505
+ od;
506
+ left[i] := ShallowCopy(left[i]);
507
+ Sort(left[i]);
508
+ for j in [1 .. Length(right[i])] do
509
+ if right[i][j] < 0 then
510
+ right[i][j] := -right[i][j] + n;
511
+ fi;
512
+ od;
513
+ right[i] := ShallowCopy(right[i]);
514
+ Sort(right[i]);
515
+ od;
516
+ MakeImmutable(arg);
517
+ arg := Concatenation([Length(arg[1])], Concatenation(arg));
518
+ return Objectify(TYPE_PBR(arg[1]), arg);
519
+ end);
520
+
521
+ InstallMethod(DegreeOfPBR, "for a pbr",
522
+ [IsPBR], pbr -> pbr![1]);
523
+
524
+ InstallMethod(\*, "for pbrs", IsIdenticalObj,
525
+ [IsPBR, IsPBR],
526
+ function(x, y)
527
+ local n, out, x_seen, y_seen, empty, x_dfs, y_dfs, tmp, i, j;
528
+
529
+ n := x![1];
530
+
531
+ out := Concatenation([n], List([1 .. 2 * n], x -> BlistList([1 .. 2 * n],
532
+ [])));
533
+
534
+ x_seen := BlistList([1 .. 2 * n], []);
535
+ y_seen := BlistList([1 .. 2 * n], []);
536
+ empty := BlistList([1 .. 2 * n], []);
537
+
538
+ x_dfs := function(i, adj) # starting in x
539
+ local j;
540
+ if x_seen[i] then
541
+ return;
542
+ fi;
543
+ x_seen[i] := true;
544
+ for j in x![i + 1] do
545
+ if j <= n then
546
+ adj[j] := true;
547
+ else # j > n
548
+ y_dfs(j - n, adj);
549
+ fi;
550
+ od;
551
+ return;
552
+ end;
553
+
554
+ y_dfs := function(i, adj) # starting in y
555
+ local j;
556
+ if y_seen[i] then
557
+ return;
558
+ fi;
559
+ y_seen[i] := true;
560
+ for j in y![i + 1] do
561
+ if j > n then
562
+ adj[j] := true;
563
+ else # j <= n
564
+ x_dfs(j + n, adj);
565
+ fi;
566
+ od;
567
+ return;
568
+ end;
569
+
570
+ tmp := [];
571
+
572
+ for i in [1 .. n] do # find everything connected to vertex i
573
+ for j in x![i + 1] do
574
+ if j <= n then
575
+ out[i + 1][j] := true;
576
+ elif IsBound(tmp[j]) then
577
+ UNITE_BLIST(out[i + 1], tmp[j]);
578
+ else
579
+ tmp[j] := BlistList([1 .. 2 * n], []);
580
+ IntersectBlist(x_seen, empty);
581
+ IntersectBlist(y_seen, empty);
582
+ x_seen[i] := true;
583
+ y_dfs(j - n, tmp[j]);
584
+ UNITE_BLIST(out[i + 1], tmp[j]);
585
+ fi;
586
+ if SizeBlist(out[i + 1]) = 2 * n then
587
+ break;
588
+ fi;
589
+ od;
590
+ od;
591
+
592
+ for i in [n + 1 .. 2 * n] do # find everything connected to vertex i
593
+ for j in y![i + 1] do
594
+ if j > n then
595
+ out[i + 1][j] := true;
596
+ elif IsBound(tmp[j]) then
597
+ UNITE_BLIST(out[i + 1], tmp[j]);
598
+ else
599
+ tmp[j] := BlistList([1 .. 2 * n], []);
600
+ IntersectBlist(x_seen, empty);
601
+ IntersectBlist(y_seen, empty);
602
+ y_seen[i] := true;
603
+ x_dfs(j + n, tmp[j]);
604
+ UNITE_BLIST(out[i + 1], tmp[j]);
605
+ fi;
606
+ if SizeBlist(out[i + 1]) = 2 * n then
607
+ break;
608
+ fi;
609
+ od;
610
+ od;
611
+ for i in [2 .. 2 * n + 1] do
612
+ out[i] := ListBlist([1 .. 2 * n], out[i]);
613
+ od;
614
+ return Objectify(TYPE_PBR(n), out);
615
+ end);
616
+
617
+ InstallMethod(ExtRepOfObj, "for a pbr",
618
+ [IsPBR],
619
+ function(x)
620
+ local n, out, i, j, k;
621
+
622
+ n := x![1];
623
+ out := [[], []];
624
+ for i in [0, 1] do
625
+ for j in [1 + n * i .. n + n * i] do
626
+ Add(out[i + 1], []);
627
+ for k in x![j + 1] do
628
+ if k > n then
629
+ AddSet(out[i + 1][j - n * i], -(k - n));
630
+ else
631
+ AddSet(out[i + 1][j - n * i], k);
632
+ fi;
633
+ od;
634
+ od;
635
+ od;
636
+
637
+ return out;
638
+ end);
639
+
640
+ # These ViewObj and PrintObj methods are here because Print(ext[1]) produces
641
+ # nicer output than Print(ViewString(ext[1])). The ViewString and PrintString
642
+ # methods are required for use in things like Green's relations.
643
+
644
+ InstallMethod(ViewObj, "for a pbr", [IsPBR], PrintObj);
645
+
646
+ InstallMethod(PrintObj, "for a pbr", [IsPBR],
647
+ function(x)
648
+ local ext;
649
+
650
+ ext := ExtRepOfObj(x);
651
+ Print("\>\>PBR(\>\>", ext[1], "\<\<,");
652
+
653
+ if Length(String(ext[1])) > 72 or Length(String(ext[2])) > 72 then
654
+ Print("\n");
655
+ else
656
+ Print(" ");
657
+ fi;
658
+
659
+ Print("\>\>", ext[2], "\<\<\<\<)");
660
+ end);
661
+
662
+ InstallMethod(ViewString, "for a pbr", [IsPBR], PrintString);
663
+
664
+ InstallMethod(PrintString, "for a pbr",
665
+ [IsPBR],
666
+ function(x)
667
+ local ext, str;
668
+
669
+ ext := ExtRepOfObj(x);
670
+
671
+ str := Concatenation("\>\>PBR(\>\>", PrintString(ext[1]), "\<\<,");
672
+
673
+ if Length(String(ext[1])) > 72 or Length(String(ext[2])) > 72 then
674
+ Append(str, "\n");
675
+ else
676
+ Append(str, " ");
677
+ fi;
678
+
679
+ Append(str, "\>\>");
680
+ Append(str, PrintString(ext[2]));
681
+ Append(str, "\<\<\<\<)");
682
+
683
+ # print empty lists with two spaces for consistency
684
+ # see https://github.com/gap-system/gap/pull/5418
685
+ return ReplacedString(str, "[ ]", "[ ]");
686
+ end);
687
+
688
+ InstallMethod(String, "for a pbr", [IsPBR],
689
+ function(x)
690
+ local ext, str;
691
+ ext := ExtRepOfObj(x);
692
+ str := Concatenation("PBR(", String(ext[1]), ", ", String(ext[2]), ")");
693
+ # print empty lists with two spaces for consistency
694
+ # see https://github.com/gap-system/gap/pull/5418
695
+ return ReplacedString(str, "[ ]", "[ ]");
696
+ end);
697
+
698
+ InstallMethod(\=, "for pbrs", IsIdenticalObj,
699
+ [IsPBR, IsPBR],
700
+ function(x, y)
701
+ local n, i;
702
+
703
+ n := x![1];
704
+ for i in [1 .. 2 * n + 1] do
705
+ if x![i] <> y![i] then
706
+ return false;
707
+ fi;
708
+ od;
709
+ return true;
710
+ end);
711
+
712
+ InstallMethod(\<, "for pbrs", IsIdenticalObj,
713
+ [IsPBR, IsPBR],
714
+ function(x, y)
715
+ local n, i;
716
+
717
+ n := x![1];
718
+ for i in [1 .. 2 * n + 1] do
719
+ if x![i] < y![i] then
720
+ return true;
721
+ elif x![i] > y![i] then
722
+ return false;
723
+ fi;
724
+ od;
725
+ return false;
726
+ end);
727
+
728
+ InstallMethod(OneMutable, "for a pbr",
729
+ [IsPBR],
730
+ function(x)
731
+ local n, out, i;
732
+
733
+ n := x![1];
734
+ out := [n];
735
+ for i in [1 .. n] do
736
+ out[i + 1] := [i + n];
737
+ out[i + n + 1] := [i];
738
+ od;
739
+ return Objectify(TYPE_PBR(n), out);
740
+ end);