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

FreeMonoid(0) is a monoid, not a group #950

Merged
merged 4 commits into from
Dec 22, 2016

Conversation

markuspf
Copy link
Member

Please make sure that this pull request:

  • is submitted to the correct branch (the stable branch is only for bugfixes)
  • contains an accurate description of changes for the release notes below
  • provides new tests or relies on existing ones
  • correctly refers to other issues and related pull requests

Tick all what applies to this pull request

  • Improves and extends functionality

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.

@markuspf
Copy link
Member Author

Of course this breaks all semigroup tests.

@markuspf
Copy link
Member Author

@james-d-mitchell any input on how your preferred fix looks like?

@james-d-mitchell
Copy link
Contributor

Will have a look later today. I recall trying to fix this previously and
not finding a good solution.
On Tue, 15 Nov 2016 at 13:42, Markus Pfeiffer notifications@github.com
wrote:

@james-d-mitchell https://github.com/james-d-mitchell any input on how
your preferred fix looks like?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#950 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGYFd3W39BP7Cobfo3e2fwGxrMZvhZnuks5q-ba4gaJpZM4Kyfx3
.[image: Web Bug from
https://github.com/notifications/beacon/AGYFd06DNP-ADxC6bchLtF_zwlwQh0GHks5q-ba4gaJpZM4Kyfx3.gif]
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/gap-system/gap","title":"gap-system/gap","subtitle":"GitHub
repository","main_image_url":"
https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png
","avatar_image_url":"
https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open
in GitHub","url":"https://github.com/gap-system/gap"}},"updates":{"snippets":[{"icon":"PERSON","message":"@markuspf
in #950: @james-d-mitchell any input on how your preferred fix looks
like?"}],"action":{"name":"View Pull Request","url":"
https://github.com/gap-system/gap/pull/950#issuecomment-260643938"}}}

@james-d-mitchell
Copy link
Contributor

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.

@james-d-mitchell
Copy link
Contributor

@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.

@markuspf
Copy link
Member Author

I will fix this soon.

@markuspf markuspf self-assigned this Dec 12, 2016
* Differend handling of special case of 0 generators in FreeMonoid
* Remove implication IsMagmaWithOne and IsTrivial -> IsMagmaWithInverses

This prevents FreeMonoid(0) from becoming a group.
@markuspf
Copy link
Member Author

Now this of course begs the question what to do about things like

gap> S := Semigroup(PartialPerm([1]));
<trivial partial perm monoid of rank 1 with 1 generator>

Why does this produce a monoid, not a semigroup?

@james-d-mitchell
Copy link
Contributor

james-d-mitchell commented Dec 12, 2016 via email

@codecov-io
Copy link

Current coverage is 49.54% (diff: 100%)

Merging #950 into master will increase coverage by 0.06%

@@             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          

Powered by Codecov. Last update f88399d...70ea675

@markuspf
Copy link
Member Author

But is that not the same kind of cleverness that we are just trying to fix?

@james-d-mitchell
Copy link
Contributor

Yes, this was probably a mistake, which I'd like to rectify at a later point.

@markuspf markuspf merged commit 8116a40 into gap-system:master Dec 22, 2016
@olexandr-konovalov
Copy link
Member

olexandr-konovalov commented Dec 23, 2016

@markuspf as you likely know - with all packages loaded we now have:

########> Diff in /home/gap-jenkins/workspace/GAP-master-test/GAPCOPTS/32build\
/GAPTARGET/install/label/graupius/GAP-master-snapshot/tst/testinstall/semigrp.\
tst:290
# Input is:
S := Semigroup(PartialPerm([1]));
# Expected output:
<trivial partial perm monoid of rank 1 with 1 generator>
# But found:
<trivial partial perm group of rank 1 with 1 generator>
########
########> Diff in /home/gap-jenkins/workspace/GAP-master-test/GAPCOPTS/32build\
/GAPTARGET/install/label/graupius/GAP-master-snapshot/tst/testinstall/semigrp.\
tst:300
# Input is:
S := Semigroup(IdentityTransformation);
# Expected output:
<trivial transformation monoid of degree 0 with 1 generator>
# But found:
<trivial transformation group of degree 0 with 1 generator>
########
########> Diff in /home/gap-jenkins/workspace/GAP-master-test/GAPCOPTS/32build\
/GAPTARGET/install/label/graupius/GAP-master-snapshot/tst/testinstall/semigrp.\
tst:309
# Input is:
S := Monoid(PartialPerm([1]));
# Expected output:
<trivial partial perm monoid of rank 1 with 1 generator>
# But found:
<trivial partial perm group of rank 1 with 1 generator>
########
########> Diff in /home/gap-jenkins/workspace/GAP-master-test/GAPCOPTS/32build\
/GAPTARGET/install/label/graupius/GAP-master-snapshot/tst/testinstall/semigrp.\
tst:311
# Input is:
S := Monoid(PartialPerm([1]));
# Expected output:
<trivial partial perm monoid of rank 1 with 1 generator>
# But found:
<trivial partial perm group of rank 1 with 1 generator>
########
########> Diff in /home/gap-jenkins/workspace/GAP-master-test/GAPCOPTS/32build\
/GAPTARGET/install/label/graupius/GAP-master-snapshot/tst/testinstall/semigrp.\
tst:317
# Input is:
S := Monoid(IdentityTransformation);
# Expected output:
<trivial transformation monoid of degree 0 with 1 generator>
# But found:
<trivial transformation group of degree 0 with 1 generator>
########

and

########> Diff in [ "./trans.xml", 968, 980 ]
# Input is:
S := Semigroup( IdentityTransformation );
# Expected output:
<trivial transformation group of degree 0 with 1 generator>
# But found:
<trivial transformation monoid of degree 0 with 1 generator>
########
########> Diff in [ "./trans.xml", 1004, 1016 ]
# Input is:
S := Semigroup( IdentityTransformation );
# Expected output:
<trivial transformation group of degree 0 with 1 generator>
# But found:
<trivial transformation monoid of degree 0 with 1 generator>
########
########> Diff in [ "./trans.xml", 1040, 1052 ]
# Input is:
S := Semigroup( IdentityTransformation );
# Expected output:
<trivial transformation group of degree 0 with 1 generator>
# But found:
<trivial transformation monoid of degree 0 with 1 generator>
########

@markuspf
Copy link
Member Author

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)

markuspf added a commit to markuspf/gap that referenced this pull request Dec 23, 2016
@james-d-mitchell
Copy link
Contributor

I don't know if it's my fault, but certainly I am preparing a new version of Semigroups to deal with these changes.

james-d-mitchell added a commit that referenced this pull request Dec 23, 2016
@markuspf markuspf deleted the free-monoid branch February 5, 2017 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants