-
Notifications
You must be signed in to change notification settings - Fork 162
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
FreeMonoid(0) is a monoid, not a group #950
Conversation
Of course this breaks all semigroup tests. |
@james-d-mitchell any input on how your preferred fix looks like? |
Will have a look later today. I recall trying to fix this previously and
|
I think the changes you've made are correct, and are the ones I would have made had I had more courage. The diffs in the tests look pretty harmless to me, I'm going to try running the Semigroups package tests with your changes to see if anything more serious comes up. I'll report when I've done that. |
@markuspf I ran the Semigroups tests and this does not break anything seriously there (somethings are broken but they are all like the failures in the tests here). I think you should rewrite the test output so that the test don't fail, and press ahead with this. |
I will fix this soon. |
* Differend handling of special case of 0 generators in FreeMonoid * Remove implication IsMagmaWithOne and IsTrivial -> IsMagmaWithInverses This prevents FreeMonoid(0) from becoming a group.
c86cf81
to
70ea675
Compare
Now this of course begs the question what to do about things like
Why does this produce a monoid, not a semigroup? |
Because it is a monoid :) Is this related to the current issue? The
Semigroup function makes a monoid out of any generating set which contains
the One of its generators.
|
Current coverage is 49.54% (diff: 100%)@@ master #950 diff @@
==========================================
Files 424 424
Lines 223152 223158 +6
Methods 3430 3430
Messages 0 0
Branches 0 0
==========================================
+ Hits 110415 110561 +146
+ Misses 112737 112597 -140
Partials 0 0
|
But is that not the same kind of cleverness that we are just trying to fix? |
Yes, this was probably a mistake, which I'd like to rectify at a later point. |
@markuspf as you likely know - with all packages loaded we now have:
and
|
Most of this is of course @james-d-mitchell's fault and a bug in the semigroups package. (The other is the documentation not being updated) |
I don't know if it's my fault, but certainly I am preparing a new version of Semigroups to deal with these changes. |
Change manual examples after #950
Please make sure that this pull request:
Tick all what applies to this pull request
Write below the description of changes (for the release notes)
FreeMonoid(0)
was previously inferred to be a group which meant that code for monoids needed to be special cased. See also #673.