From 0aa55394d25f0e7cc8e254690fe24a35f477462d Mon Sep 17 00:00:00 2001 From: Fabian Zickgraf Date: Wed, 29 Nov 2023 16:29:35 +0100 Subject: [PATCH] Introduce RingFilter and RingElementFilter --- GaussForHomalg/PackageInfo.g | 3 ++- GaussForHomalg/gap/GaussRationals.gi | 3 +++ HomalgToCAS/PackageInfo.g | 3 ++- HomalgToCAS/gap/HomalgExternalRing.gi | 3 +++ MatricesForHomalg/PackageInfo.g | 4 ++-- MatricesForHomalg/gap/HomalgRing.gi | 2 ++ ToolsForHomalg/PackageInfo.g | 2 +- ToolsForHomalg/gap/ToolsForHomalg.gd | 29 +++++++++++++++++++++++++++ 8 files changed, 44 insertions(+), 5 deletions(-) diff --git a/GaussForHomalg/PackageInfo.g b/GaussForHomalg/PackageInfo.g index ed2829b14..90e218103 100644 --- a/GaussForHomalg/PackageInfo.g +++ b/GaussForHomalg/PackageInfo.g @@ -11,7 +11,7 @@ SetPackageInfo( rec( PackageName := "GaussForHomalg", Subtitle := "Gauss functionality for the homalg project", -Version := "2023.10-01", +Version := "2023.11-01", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), License := "GPL-2.0-or-later", @@ -80,6 +80,7 @@ PackageDoc := rec( Dependencies := rec( GAP := ">= 4.12.1", NeededOtherPackages := [ + [ "ToolsForHomalg", ">= 2023.11-01" ], [ "Gauss", ">= 2021.04-01" ], [ "MatricesForHomalg", ">= 2023.10-01" ], [ "GAPDoc", ">= 1.0" ] ], diff --git a/GaussForHomalg/gap/GaussRationals.gi b/GaussForHomalg/gap/GaussRationals.gi index 0cbd08400..7a9acdb22 100644 --- a/GaussForHomalg/gap/GaussRationals.gi +++ b/GaussForHomalg/gap/GaussRationals.gi @@ -114,6 +114,9 @@ InstallGlobalFunction( HomalgFieldOfRationals, R := CreateHomalgRing( Rationals ); + SetRingFilter( R, IsHomalgRing ); + SetRingElementFilter( R, IsRat ); + SetIsRationalsForHomalg( R, true ); SetRingProperties( R, 0 ); diff --git a/HomalgToCAS/PackageInfo.g b/HomalgToCAS/PackageInfo.g index f8ccea1f0..c6102d1fd 100644 --- a/HomalgToCAS/PackageInfo.g +++ b/HomalgToCAS/PackageInfo.g @@ -11,7 +11,7 @@ SetPackageInfo( rec( PackageName := "HomalgToCAS", Subtitle := "A window to the outer world", -Version := "2023.08-01", +Version := "2023.11-01", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), License := "GPL-2.0-or-later", @@ -160,6 +160,7 @@ PackageDoc := rec( Dependencies := rec( GAP := ">= 4.12.1", NeededOtherPackages := [ + [ "ToolsForHomalg", ">= 2023.11-01" ], [ "MatricesForHomalg", ">= 2023.08-01" ], [ "GAPDoc", ">= 1.0" ] ], diff --git a/HomalgToCAS/gap/HomalgExternalRing.gi b/HomalgToCAS/gap/HomalgExternalRing.gi index 81dc82c61..9e9fa2b8a 100644 --- a/HomalgToCAS/gap/HomalgExternalRing.gi +++ b/HomalgToCAS/gap/HomalgExternalRing.gi @@ -501,6 +501,9 @@ InstallGlobalFunction( CreateHomalgExternalRing, ## create the external ring R := CallFuncList( CreateHomalgRing, ar ); + SetRingFilter( R, IsHomalgRing ); + SetRingElementFilter( R, IsHomalgRingElement ); + ## for the view methods: ## R!.description := "n external"; diff --git a/MatricesForHomalg/PackageInfo.g b/MatricesForHomalg/PackageInfo.g index 208a94dd3..fedba19a3 100644 --- a/MatricesForHomalg/PackageInfo.g +++ b/MatricesForHomalg/PackageInfo.g @@ -11,7 +11,7 @@ SetPackageInfo( rec( PackageName := "MatricesForHomalg", Subtitle := "Matrices for the homalg project", -Version := "2023.11-01", +Version := "2023.11-02", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), License := "GPL-2.0-or-later", @@ -112,7 +112,7 @@ PackageDoc := rec( Dependencies := rec( GAP := ">= 4.12.1", NeededOtherPackages := [ - [ "ToolsForHomalg", ">= 2018.12.15" ], + [ "ToolsForHomalg", ">= 2023.11-01" ], [ "GAPDoc", ">= 1.0" ] ], SuggestedOtherPackages := [ ], ExternalConditions := [] diff --git a/MatricesForHomalg/gap/HomalgRing.gi b/MatricesForHomalg/gap/HomalgRing.gi index 136b31e9b..3526f0eb3 100644 --- a/MatricesForHomalg/gap/HomalgRing.gi +++ b/MatricesForHomalg/gap/HomalgRing.gi @@ -2078,6 +2078,8 @@ InstallGlobalFunction( HomalgRingOfIntegers, if nargs = 0 or arg[1] = 0 then c := 0; R := CreateHomalgRing( Integers ); + SetRingFilter( R, IsHomalgRing ); + SetRingElementFilter( R, IsInt ); elif IsInt( arg[1] ) then c := arg[1]; if Length( Collected( FactorsInt( c ) ) ) = 1 and IsPackageMarkedForLoading( "GaussForHomalg", ">= 2018.09.20") then diff --git a/ToolsForHomalg/PackageInfo.g b/ToolsForHomalg/PackageInfo.g index 83746c9bb..f851b964b 100644 --- a/ToolsForHomalg/PackageInfo.g +++ b/ToolsForHomalg/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "ToolsForHomalg", Subtitle := "Special methods and knowledge propagation tools", -Version := "2023.10-01", +Version := "2023.11-01", Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ), License := "GPL-2.0-or-later", diff --git a/ToolsForHomalg/gap/ToolsForHomalg.gd b/ToolsForHomalg/gap/ToolsForHomalg.gd index fb8c74119..bbd422193 100644 --- a/ToolsForHomalg/gap/ToolsForHomalg.gd +++ b/ToolsForHomalg/gap/ToolsForHomalg.gd @@ -76,6 +76,35 @@ DeclareCategory( "IsContainerForWeakPointers", DeclareCategory( "IsContainerForPointers", IsComponentObjectRep ); +#################################### +# +# attributes: +# +#################################### + +#! @Section Attributes + +#! @Description +#! A filter inheriting from `IsRing` which uniquely identifies the ring ring. +#! For example, the ring `Integers` is identified by `IsIntegers`. +#! If no filter uniquely identifying the ring exists, +#! the most special filter available should be chosen. +#! @Arguments ring +DeclareAttribute( "RingFilter", + IsRing ); + +#! @Description +#! A filter inheriting from `IsRingElement` which uniquely identifies elements of the ring ring. +#! For example, the elements of the ring `Integers` are identified by `IsInt`. +#! If no filter uniquely identifying the elements of the ring exists, +#! the most special filter available should be chosen. +#! @Arguments ring +DeclareAttribute( "RingElementFilter", + IsRing ); + +SetRingFilter( Integers, IsIntegers ); +SetRingElementFilter( Integers, IsInt ); + #################################### # # global functions and operations: