gap icon indicating copy to clipboard operation
gap copied to clipboard

behaviour of `ClosureSubgroup` and `ClosureSubgroupNC`

Open ThomasBreuer opened this issue 2 years ago • 1 comments

The code of the function ClosureSubgroupNC contains the following Assert call.

      if ValueOption("noassert")<>true then
        Assert(2,IsSubset(Parent(G),obj));
      fi;

I had thought that the suffix NC expresses that there are no such checks. Shouldn't this check belong to ClosureSubgroup?

ClosureSubgroup makes the relevant containment checks, but does not show an error message if the test fails.

Isn't this strange: At assertion level at least 2, calling ClosureSubgroup accepts input that does not create a subgroup of the intended parent, without signaling that there is a problem, but calling ClosureSubgroupNC will show an error message in this case?

As far as I understand, the current behaviour does not agree with the documentation.

ThomasBreuer avatar Apr 17 '23 14:04 ThomasBreuer

As far as ClosueSubgroupNC is concerned (I have no opinion on ClosureSubgroup): I see assertions not as the tool to catch erroneous user input, but as a tool to find errors in algorithms when internal assumptions do in fact not hold. That's what this assertion is about.

hulpke avatar Apr 19 '23 16:04 hulpke