Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FroidurePinExtendedAlg for partial perm monoids #1697

Merged
merged 1 commit into from
Sep 9, 2017

Conversation

wilfwilson
Copy link
Member

In #1674 I gave an example of a monoid of partial perms, on which GreensDClasses gave an incorrect result. This PR resolves #1674.

@markuspf tracked the cause down to a line in FroidurePinExtendedAlg. The problem is that a line in this method assumed that the One of any element of a monoid is the same as the One of the monoid. This is the documented behaviour of how One works in a magma-with-one, but this is not how monoids of partial perms behave. I will open an issue in the hope of addressing the disparity between behaviour and documentation.

lib/semirel.gi Outdated
@@ -972,13 +972,14 @@ function(m)
fi;

#gens:=Set(GeneratorsOfMonoid(semi));
gens:=Set(Filtered(GeneratorsOfMonoid(semi), x-> not IsOne(x)));
one := One(semi);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer a uniform formatting here: either use one:=One(semi); here or put the spaces on all the other assignments.

@codecov
Copy link

codecov bot commented Sep 7, 2017

Codecov Report

Merging #1697 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1697      +/-   ##
==========================================
- Coverage   64.42%   64.42%   -0.01%     
==========================================
  Files        1002     1002              
  Lines      326711   326713       +2     
  Branches    13218    13218              
==========================================
- Hits       210489   210477      -12     
- Misses     113357   113361       +4     
- Partials     2865     2875      +10
Impacted Files Coverage Δ
lib/semirel.gi 70.86% <100%> (+0.04%) ⬆️
src/hpc/thread.c 46.44% <0%> (-0.6%) ⬇️
src/funcs.c 72.25% <0%> (-0.55%) ⬇️
src/hpc/threadapi.c 33.99% <0%> (-0.47%) ⬇️
src/hpc/traverse.c 77.9% <0%> (-0.31%) ⬇️
src/stats.c 73.07% <0%> (-0.14%) ⬇️
src/gap.c 57.24% <0%> (-0.09%) ⬇️
lib/adjoin.gi 75.51% <0%> (+2.04%) ⬆️

@olexandr-konovalov olexandr-konovalov added the gapdays2017-fall Issues and PRs that arose at https://www.gapdays.de/gapdays2017-fall label Sep 7, 2017
@markuspf
Copy link
Member

markuspf commented Sep 8, 2017

This looks good to me, maybe @james-d-mitchell can have a look (and merge if he's happy).

@@ -972,13 +972,14 @@ function(m)
fi;

#gens:=Set(GeneratorsOfMonoid(semi));
gens:=Set(Filtered(GeneratorsOfMonoid(semi), x-> not IsOne(x)));
one:=One(semi);
gens:=Set(Filtered(GeneratorsOfMonoid(semi), x -> x <> one));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, really this is the only changed line here, right? I'm not sure it's worth changing the other lines too (i.e. by replacing One(semi) by one).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I don't know what Wilf's motivation was, I think it's quite natural to use the already computed value of one instead of recomputing it a few times later on -- this is a (albeit fairly minor, but still natural) optimization.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ship has sailed but just to say that One is an attribute of a semigroup and so only calculated on the first call...

@james-d-mitchell
Copy link
Contributor

@markuspf @wilfwilson looks good to me, apart from I don't see why One(semi) is replaced with the local variable one.

@markuspf markuspf merged commit a8867a9 into gap-system:master Sep 9, 2017
@wilfwilson wilfwilson deleted the fix-issue-1674 branch September 13, 2017 13:26
@olexandr-konovalov olexandr-konovalov added the release notes: added PRs introducing changes that have since been mentioned in the release notes label Jan 22, 2018
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.9.0 milestone Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gapdays2017-fall Issues and PRs that arose at https://www.gapdays.de/gapdays2017-fall release notes: added PRs introducing changes that have since been mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect behaviour for certain partial perm semigroups
5 participants