{"action":"created","comment":{"url":"https://api.github.com/repos/gap-packages/Semigroups/pulls/comments/92616509","pull_request_review_id":13134037,"id":92616509,"diff_hunk":"@@ -7,111 +7,81 @@\n ##\n #############################################################################\n ##\n-## This file contains functions for a lattice of congruences.\n+## This file contains functions for a poset of congruences.\n ##\n ## When the congruences of a semigroup are computed, they form a lattice with\n ## respect to containment.  The information about how the congruences lie in\n-## this lattice is stored in an IsCongruenceLattice object (a positional object\n-## based on a list) and can be retrieved from this object with the following\n-## methods\n+## this lattice may be stored in an IsCongruencePoset object (a component object\n+## based on a record) and can be retrieved from this object with the following\n+## methods.\n+##\n+## Most of these methods simply redirect to the partial order defined by this\n+## object, that is a list of lists describing the partial order of the\n+## congruences with respect to containment.\n ##\n-## Most of these methods simply redirect to the first entry of the object, the\n-## actual list of lists of integers which defines the containments in the\n-## lattice.  Component 2 in the list is the list of congruences, which is hidden\n-## when this object is used.\n-\n-InstallMethod(CongruencesOfLattice,\n-\"for a congruence lattice\",\n-[IsCongruenceLattice],\n-function(latt)\n-  return latt![2];\n-end);\n \n InstallMethod(\\[\\],\n-\"for a congruence lattice\",\n-[IsCongruenceLattice, IsObject],\n-function(latt, x)\n-  return latt![1][x];\n+\"for a congruence poset\",\n+[IsCongruencePoset, IsObject],\n+function(poset, x)\n+  return OutNeighboursOfVertex(poset!.po, x);\n end);\n \n InstallMethod(ViewObj,\n-\"for a congruence lattice\",\n-[IsCongruenceLattice],\n-function(latt)\n-  ViewObj(latt![1]);\n+\"for a congruence poset\",\n+[IsCongruencePoset],\n+function(poset)\n+  ViewObj(OutNeighbours(poset!.po));\n end);\n \n InstallMethod(PrintObj,\n-\"for a congruence lattice\",\n-[IsCongruenceLattice],\n-function(latt)\n-  PrintObj(latt![1]);\n+\"for a congruence poset\",\n+[IsCongruencePoset],\n+function(poset)\n+  PrintObj(OutNeighbours(poset!.po));\n end);\n \n InstallMethod(Length,\n-\"for a congruence lattice\",\n-[IsCongruenceLattice],\n-function(latt)\n-  return Length(latt![1]);\n+\"for a congruence poset\",\n+[IsCongruencePoset],\n+function(poset)\n+  return DigraphNrVertices(poset!.po);\n end);\n \n InstallMethod(IsBound\\[\\],\n-\"for a congruence lattice and a positive integer\",\n-[IsCongruenceLattice, IsPosInt],\n-function(latt, x)\n-  return IsBound(latt![1][x]);\n+\"for a congruence poset and a positive integer\",\n+[IsCongruencePoset, IsPosInt],\n+function(poset, x)\n+  return x >= 1 and x <= Length(poset);\n end);\n \n-###############################################################################\n-# LatticeOfXCongruences function\n-###############################################################################\n-#\n-# This abstract function takes a semigroup 'S', a string 'type_string' and a\n-# record 'record'.\n-# type_string should be in [\"Left\", \"Right\", \"\"] and describes the sort of\n-# relations we want to find (respectively: left congruences, right congruences,\n-# two-sided congruences), referred to as 'x congs' below.\n-# record may contain any of the following components, which should be set to\n-# 'true' to have the stated effect:\n-#   * minimal - Return only minimal x-congs\n-#   * 1gen - Return only x-congs with a single generating pair\n-#   * restriction - Return only x-congs generated by relating these elements\n-#\n-###############################################################################\n-\n-# FIXME Monolithic functions = BAD!!! JDM\n-\n-SEMIGROUPS.LatticeOfXCongruences := function(S, type_string, record)\n-  local report, _XSemigroupCongruence, elms, pairs, total, congs1, nrcongs,\n-        children, parents, last_collected, nr, pair, badcong, newchildren,\n-        newparents, newcong, i, c, p, congs, set_func, lattice, join_func,\n-        length, found, ignore, start, j, k;\n-\n+SEMIGROUPS.PrincipalXCongruencePoset := function(S, restriction, cong_func)\n   if not IsFinite(S) then\n-    ErrorNoReturn(\"Semigroups: SEMIGROUPS.LatticeOfXCongruences: usage,\\n\",\n+    ErrorNoReturn(\"Semigroups: SEMIGROUPS.PrincipalXCongruencePoset: usage,\\n\",\n                   \"first argument <S> must be a finite semigroup,\");\n   fi;","path":"gap/congruences/conglatt.gi","position":117,"original_position":117,"commit_id":"f6b6552f0bed16d3cc0d91d27dc050a07e365186","original_commit_id":"f6b6552f0bed16d3cc0d91d27dc050a07e365186","user":{"login":"james-d-mitchell","id":6686071,"avatar_url":"https://avatars.githubusercontent.com/u/6686071?v=3","gravatar_id":"","url":"https://api.github.com/users/james-d-mitchell","html_url":"https://github.com/james-d-mitchell","followers_url":"https://api.github.com/users/james-d-mitchell/followers","following_url":"https://api.github.com/users/james-d-mitchell/following{/other_user}","gists_url":"https://api.github.com/users/james-d-mitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/james-d-mitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/james-d-mitchell/subscriptions","organizations_url":"https://api.github.com/users/james-d-mitchell/orgs","repos_url":"https://api.github.com/users/james-d-mitchell/repos","events_url":"https://api.github.com/users/james-d-mitchell/events{/privacy}","received_events_url":"https://api.github.com/users/james-d-mitchell/received_events","type":"User","site_admin":false},"body":"Instead of this cryptic error message perhaps you could add an argument to this function which is the name of the function calling this one, i.e. `SemigroupCongruence` or whatever. Also I think everywhere you should be checking if `IsEnumerableSemigroupRep(S) and IsFinite(S)` since the methods will only apply to semigroups in `IsEnumerableSemigroupRep`","created_at":"2016-12-15T14:18:13Z","updated_at":"2016-12-15T14:18:13Z","html_url":"https://github.com/gap-packages/Semigroups/pull/240#discussion_r92616509","pull_request_url":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240","_links":{"self":{"href":"https://api.github.com/repos/gap-packages/Semigroups/pulls/comments/92616509"},"html":{"href":"https://github.com/gap-packages/Semigroups/pull/240#discussion_r92616509"},"pull_request":{"href":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240"}}},"pull_request":{"url":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240","id":97933880,"html_url":"https://github.com/gap-packages/Semigroups/pull/240","diff_url":"https://github.com/gap-packages/Semigroups/pull/240.diff","patch_url":"https://github.com/gap-packages/Semigroups/pull/240.patch","issue_url":"https://api.github.com/repos/gap-packages/Semigroups/issues/240","number":240,"state":"open","locked":false,"title":"Refactor congruence lattices","user":{"login":"mtorpey","id":5583599,"avatar_url":"https://avatars.githubusercontent.com/u/5583599?v=3","gravatar_id":"","url":"https://api.github.com/users/mtorpey","html_url":"https://github.com/mtorpey","followers_url":"https://api.github.com/users/mtorpey/followers","following_url":"https://api.github.com/users/mtorpey/following{/other_user}","gists_url":"https://api.github.com/users/mtorpey/gists{/gist_id}","starred_url":"https://api.github.com/users/mtorpey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtorpey/subscriptions","organizations_url":"https://api.github.com/users/mtorpey/orgs","repos_url":"https://api.github.com/users/mtorpey/repos","events_url":"https://api.github.com/users/mtorpey/events{/privacy}","received_events_url":"https://api.github.com/users/mtorpey/received_events","type":"User","site_admin":false},"body":"This PR modifies the existing implementation of congruence lattices.  Where we used to have one monolithic function `SEMIGROUPS.LatticeOfXCongruences` which was unwieldy and confusing, we now have a set of smaller functions which work together.\r\n\r\n`IsCongruenceLattice` is now `IsCongruencePoset` (and might not be a lattice mathematically).  A load of other \"lattice\" names have been changed to \"poset\" accordingly.\r\n\r\nNew functionality has been added, and the user now has access to:\r\n* `PosetOfCongruences`, which takes any list (or coll) of congruences and forms their poset;\r\n* `JoinSemilatticeOfCongruences`, which takes a list of congruences, or a congruence poset, and forms their poset including all the joins;\r\n* `MinimalCongruences`, which takes a list of congruences, or a congruence poset, and returns all the minimal ones.\r\n\r\nAlso, `<restriction>` versions have been added for:\r\n* `[Left/Right]CongruencesOfSemigroup`\r\n* `Minimal[Left/Right]CongruencesOfSemigroup`\r\n* `Principal[Left/Right]CongruencesOfSemigroup`\r\n* `LatticeOf[Left/Right]Congruences`\r\n\r\nTests and doc have been added/updated as appropriate.\r\n\r\nThere's one feature we discussed which hasn't been added yet: properties `IsCongruenceJoinSemilattice`, `IsCongruenceMeetSemilattice` and `IsCongruenceLattice` which would tell the user whether the poset is closed under join, meet, or both.   I got a little confused when implementing it, and I thought I'd wait and discuss it further when I'm back in the department.  Nothing else relies on this feature, so it can easily be added later.","created_at":"2016-12-14T11:26:25Z","updated_at":"2016-12-15T14:26:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c24b4bca6582f1af3ab1b8e43f4335109a15570","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240/commits","review_comments_url":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240/comments","review_comment_url":"https://api.github.com/repos/gap-packages/Semigroups/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gap-packages/Semigroups/issues/240/comments","statuses_url":"https://api.github.com/repos/gap-packages/Semigroups/statuses/f6b6552f0bed16d3cc0d91d27dc050a07e365186","head":{"label":"mtorpey:refactor-congruence-poset","ref":"refactor-congruence-poset","sha":"f6b6552f0bed16d3cc0d91d27dc050a07e365186","user":{"login":"mtorpey","id":5583599,"avatar_url":"https://avatars.githubusercontent.com/u/5583599?v=3","gravatar_id":"","url":"https://api.github.com/users/mtorpey","html_url":"https://github.com/mtorpey","followers_url":"https://api.github.com/users/mtorpey/followers","following_url":"https://api.github.com/users/mtorpey/following{/other_user}","gists_url":"https://api.github.com/users/mtorpey/gists{/gist_id}","starred_url":"https://api.github.com/users/mtorpey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtorpey/subscriptions","organizations_url":"https://api.github.com/users/mtorpey/orgs","repos_url":"https://api.github.com/users/mtorpey/repos","events_url":"https://api.github.com/users/mtorpey/events{/privacy}","received_events_url":"https://api.github.com/users/mtorpey/received_events","type":"User","site_admin":false},"repo":{"id":56322750,"name":"Semigroups","full_name":"mtorpey/Semigroups","owner":{"login":"mtorpey","id":5583599,"avatar_url":"https://avatars.githubusercontent.com/u/5583599?v=3","gravatar_id":"","url":"https://api.github.com/users/mtorpey","html_url":"https://github.com/mtorpey","followers_url":"https://api.github.com/users/mtorpey/followers","following_url":"https://api.github.com/users/mtorpey/following{/other_user}","gists_url":"https://api.github.com/users/mtorpey/gists{/gist_id}","starred_url":"https://api.github.com/users/mtorpey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtorpey/subscriptions","organizations_url":"https://api.github.com/users/mtorpey/orgs","repos_url":"https://api.github.com/users/mtorpey/repos","events_url":"https://api.github.com/users/mtorpey/events{/privacy}","received_events_url":"https://api.github.com/users/mtorpey/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mtorpey/Semigroups","description":"The GAP package Semigroups","fork":true,"url":"https://api.github.com/repos/mtorpey/Semigroups","forks_url":"https://api.github.com/repos/mtorpey/Semigroups/forks","keys_url":"https://api.github.com/repos/mtorpey/Semigroups/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mtorpey/Semigroups/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mtorpey/Semigroups/teams","hooks_url":"https://api.github.com/repos/mtorpey/Semigroups/hooks","issue_events_url":"https://api.github.com/repos/mtorpey/Semigroups/issues/events{/number}","events_url":"https://api.github.com/repos/mtorpey/Semigroups/events","assignees_url":"https://api.github.com/repos/mtorpey/Semigroups/assignees{/user}","branches_url":"https://api.github.com/repos/mtorpey/Semigroups/branches{/branch}","tags_url":"https://api.github.com/repos/mtorpey/Semigroups/tags","blobs_url":"https://api.github.com/repos/mtorpey/Semigroups/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mtorpey/Semigroups/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mtorpey/Semigroups/git/refs{/sha}","trees_url":"https://api.github.com/repos/mtorpey/Semigroups/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mtorpey/Semigroups/statuses/{sha}","languages_url":"https://api.github.com/repos/mtorpey/Semigroups/languages","stargazers_url":"https://api.github.com/repos/mtorpey/Semigroups/stargazers","contributors_url":"https://api.github.com/repos/mtorpey/Semigroups/contributors","subscribers_url":"https://api.github.com/repos/mtorpey/Semigroups/subscribers","subscription_url":"https://api.github.com/repos/mtorpey/Semigroups/subscription","commits_url":"https://api.github.com/repos/mtorpey/Semigroups/commits{/sha}","git_commits_url":"https://api.github.com/repos/mtorpey/Semigroups/git/commits{/sha}","comments_url":"https://api.github.com/repos/mtorpey/Semigroups/comments{/number}","issue_comment_url":"https://api.github.com/repos/mtorpey/Semigroups/issues/comments{/number}","contents_url":"https://api.github.com/repos/mtorpey/Semigroups/contents/{+path}","compare_url":"https://api.github.com/repos/mtorpey/Semigroups/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mtorpey/Semigroups/merges","archive_url":"https://api.github.com/repos/mtorpey/Semigroups/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mtorpey/Semigroups/downloads","issues_url":"https://api.github.com/repos/mtorpey/Semigroups/issues{/number}","pulls_url":"https://api.github.com/repos/mtorpey/Semigroups/pulls{/number}","milestones_url":"https://api.github.com/repos/mtorpey/Semigroups/milestones{/number}","notifications_url":"https://api.github.com/repos/mtorpey/Semigroups/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mtorpey/Semigroups/labels{/name}","releases_url":"https://api.github.com/repos/mtorpey/Semigroups/releases{/id}","deployments_url":"https://api.github.com/repos/mtorpey/Semigroups/deployments","created_at":"2016-04-15T13:37:12Z","updated_at":"2016-04-15T13:37:13Z","pushed_at":"2016-12-15T13:42:01Z","git_url":"git://github.com/mtorpey/Semigroups.git","ssh_url":"git@github.com:mtorpey/Semigroups.git","clone_url":"https://github.com/mtorpey/Semigroups.git","svn_url":"https://github.com/mtorpey/Semigroups","homepage":null,"size":59239,"stargazers_count":0,"watchers_count":0,"language":"GAP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"unstable-3.0"}},"base":{"label":"gap-packages:unstable-3.0","ref":"unstable-3.0","sha":"0223e1977ef3d249662fdabdd1119b6108b3d747","user":{"login":"gap-packages","id":14360610,"avatar_url":"https://avatars.githubusercontent.com/u/14360610?v=3","gravatar_id":"","url":"https://api.github.com/users/gap-packages","html_url":"https://github.com/gap-packages","followers_url":"https://api.github.com/users/gap-packages/followers","following_url":"https://api.github.com/users/gap-packages/following{/other_user}","gists_url":"https://api.github.com/users/gap-packages/gists{/gist_id}","starred_url":"https://api.github.com/users/gap-packages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gap-packages/subscriptions","organizations_url":"https://api.github.com/users/gap-packages/orgs","repos_url":"https://api.github.com/users/gap-packages/repos","events_url":"https://api.github.com/users/gap-packages/events{/privacy}","received_events_url":"https://api.github.com/users/gap-packages/received_events","type":"Organization","site_admin":false},"repo":{"id":56253495,"name":"Semigroups","full_name":"gap-packages/Semigroups","owner":{"login":"gap-packages","id":14360610,"avatar_url":"https://avatars.githubusercontent.com/u/14360610?v=3","gravatar_id":"","url":"https://api.github.com/users/gap-packages","html_url":"https://github.com/gap-packages","followers_url":"https://api.github.com/users/gap-packages/followers","following_url":"https://api.github.com/users/gap-packages/following{/other_user}","gists_url":"https://api.github.com/users/gap-packages/gists{/gist_id}","starred_url":"https://api.github.com/users/gap-packages/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gap-packages/subscriptions","organizations_url":"https://api.github.com/users/gap-packages/orgs","repos_url":"https://api.github.com/users/gap-packages/repos","events_url":"https://api.github.com/users/gap-packages/events{/privacy}","received_events_url":"https://api.github.com/users/gap-packages/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gap-packages/Semigroups","description":"The GAP package Semigroups","fork":false,"url":"https://api.github.com/repos/gap-packages/Semigroups","forks_url":"https://api.github.com/repos/gap-packages/Semigroups/forks","keys_url":"https://api.github.com/repos/gap-packages/Semigroups/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gap-packages/Semigroups/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gap-packages/Semigroups/teams","hooks_url":"https://api.github.com/repos/gap-packages/Semigroups/hooks","issue_events_url":"https://api.github.com/repos/gap-packages/Semigroups/issues/events{/number}","events_url":"https://api.github.com/repos/gap-packages/Semigroups/events","assignees_url":"https://api.github.com/repos/gap-packages/Semigroups/assignees{/user}","branches_url":"https://api.github.com/repos/gap-packages/Semigroups/branches{/branch}","tags_url":"https://api.github.com/repos/gap-packages/Semigroups/tags","blobs_url":"https://api.github.com/repos/gap-packages/Semigroups/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gap-packages/Semigroups/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gap-packages/Semigroups/git/refs{/sha}","trees_url":"https://api.github.com/repos/gap-packages/Semigroups/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gap-packages/Semigroups/statuses/{sha}","languages_url":"https://api.github.com/repos/gap-packages/Semigroups/languages","stargazers_url":"https://api.github.com/repos/gap-packages/Semigroups/stargazers","contributors_url":"https://api.github.com/repos/gap-packages/Semigroups/contributors","subscribers_url":"https://api.github.com/repos/gap-packages/Semigroups/subscribers","subscription_url":"https://api.github.com/repos/gap-packages/Semigroups/subscription","commits_url":"https://api.github.com/repos/gap-packages/Semigroups/commits{/sha}","git_commits_url":"https://api.github.com/repos/gap-packages/Semigroups/git/commits{/sha}","comments_url":"https://api.github.com/repos/gap-packages/Semigroups/comments{/number}","issue_comment_url":"https://api.github.com/repos/gap-packages/Semigroups/issues/comments{/number}","contents_url":"https://api.github.com/repos/gap-packages/Semigroups/contents/{+path}","compare_url":"https://api.github.com/repos/gap-packages/Semigroups/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gap-packages/Semigroups/merges","archive_url":"https://api.github.com/repos/gap-packages/Semigroups/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gap-packages/Semigroups/downloads","issues_url":"https://api.github.com/repos/gap-packages/Semigroups/issues{/number}","pulls_url":"https://api.github.com/repos/gap-packages/Semigroups/pulls{/number}","milestones_url":"https://api.github.com/repos/gap-packages/Semigroups/milestones{/number}","notifications_url":"https://api.github.com/repos/gap-packages/Semigroups/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gap-packages/Semigroups/labels{/name}","releases_url":"https://api.github.com/repos/gap-packages/Semigroups/releases{/id}","deployments_url":"https://api.github.com/repos/gap-packages/Semigroups/deployments","created_at":"2016-04-14T16:36:03Z","updated_at":"2016-12-14T14:16:27Z","pushed_at":"2016-12-15T14:07:10Z","git_url":"git://github.com/gap-packages/Semigroups.git","ssh_url":"git@github.com:gap-packages/Semigroups.git","clone_url":"https://github.com/gap-packages/Semigroups.git","svn_url":"https://github.com/gap-packages/Semigroups","homepage":"http://gap-packages.github.io/Semigroups/","size":60006,"stargazers_count":8,"watchers_count":8,"language":"GAP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":18,"forks":10,"open_issues":18,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240"},"html":{"href":"https://github.com/gap-packages/Semigroups/pull/240"},"issue":{"href":"https://api.github.com/repos/gap-packages/Semigroups/issues/240"},"comments":{"href":"https://api.github.com/repos/gap-packages/Semigroups/issues/240/comments"},"review_comments":{"href":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240/comments"},"review_comment":{"href":"https://api.github.com/repos/gap-packages/Semigroups/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gap-packages/Semigroups/pulls/240/commits"},"statuses":{"href":"https://api.github.com/repos/gap-packages/Semigroups/statuses/f6b6552f0bed16d3cc0d91d27dc050a07e365186"}}}}
{"actor":{"display_login":"james-d-mitchell"}}