Skip to content

Commit

Permalink
deal with unwanted side-effects of gap-system#3006
Browse files Browse the repository at this point in the history
- Let the filters created by `DeclareHandlingByNiceBasis` imply
  `IsFreeLeftModule`.
  This was the case before the changes from gap-system#3006, and this change fixes
  the problem described in gap-system#5322, as I had sketched in the discussion of gap-system#5325.
- Document this change (following gap-system#5325).
- Increase the rank of `IsHandledByNiceBasis` by 2.
  Then we get back to the rank before the changes from gap-system#3006.
  This way, the `\in` method with second argument in
  `IsFreeLeftModule and IsHandledByNiceBasis` is again ranked higher than
  the one with second argument `IsFreeLeftModule and IsFiniteDimensional`.
  The bug described in issue gap-system#5334 which has been found because of the
  reordering of these two methods (due to gap-system#3006)
  gets fixed via pull request gap-system#5335,
  now we can return to the better method ordering.
  (I do not like uprankings, but I have no better idea to solve this problem.)
  • Loading branch information
ThomasBreuer committed Jan 19, 2023
1 parent 0adf6d1 commit 14d2c31
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions lib/basis.gd
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,10 @@ DeclareOperation( "RelativeBasisNC", [ IsBasis, IsHomogeneousList ] );
## (see&nbsp;<Ref Sect="Vector Spaces Handled By Nice Bases"/>).
## <P/>
## <A>name</A> must be a string,
## a filter <M>f</M> with this name is created, and
## a filter <M>f</M> with this name is created which implies
## <Ref Filt="IsFreeLeftModule"/>, and
## a logical implication from the join of <M>f</M> with
## <Ref Filt="IsFreeLeftModule"/> and <Ref Filt="IsAttributeStoringRep"/> to
## <Ref Filt="IsAttributeStoringRep"/> to
## <Ref Filt="IsHandledByNiceBasis"/> is installed.
## <P/>
## <A>record</A> must be a record with the following components.
Expand Down Expand Up @@ -895,6 +896,7 @@ DeclareGlobalFunction( "CheckForHandlingByNiceBasis" );
InstallGlobalFunction( "DeclareHandlingByNiceBasis", function( name, info )
local entry;
DeclareFilter( name );
InstallTrueMethod( IsFreeLeftModule, ValueGlobal( name ) );
entry := [ ValueGlobal( name ), info ];
Add( NiceBasisFiltersInfo, entry, 1 );
end );
Expand Down
2 changes: 1 addition & 1 deletion lib/basis.gi
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ InstallGlobalFunction( "InstallHandlingByNiceBasis",
entry:= First( NiceBasisFiltersInfo,
x -> IsIdenticalObj( filter, x[1] ) );
entry[3] := record.detect;
filter:= filter and IsFreeLeftModule and IsAttributeStoringRep;
filter:= filter and IsAttributeStoringRep;
InstallTrueMethod( IsHandledByNiceBasis, filter );

# Install the methods.
Expand Down
6 changes: 4 additions & 2 deletions lib/module.gd
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ DeclareProperty( "IsFullMatrixModule", IsFreeLeftModule, 20 );
## </ManSection>
## <#/GAPDoc>
##
DeclareCategory( "IsHandledByNiceBasis", IsFreeLeftModule );
#T why not `DeclareFilter' ?
DeclareCategory( "IsHandledByNiceBasis", IsFreeLeftModule, 3 );
# We want that 'IsFreeLeftModule and IsHandledByNiceBasis' has a higher rank
# than 'IsFreeLeftModule and IsFiniteDimensional'.
# (There are concurrent '\in' methods for the two situations.)


#############################################################################
Expand Down

0 comments on commit 14d2c31

Please sign in to comment.