From b15d2bc3ddd66abac69ef0a159b010743544b5ee Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Tue, 27 Jun 2023 17:39:45 +0200 Subject: [PATCH] added error message to constructors MeetSemilatticeOfSingle/MultipleDifferences --- Locales/PackageInfo.g | 2 +- Locales/gap/MultipleDifferences.gi | 5 +++++ Locales/gap/SingleDifferences.gi | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Locales/PackageInfo.g b/Locales/PackageInfo.g index 948e8a746..19426b040 100644 --- a/Locales/PackageInfo.g +++ b/Locales/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "Locales", Subtitle := "Locales, frames, coframes, meet semi-lattices of locally closed subsets, and Boolean algebras of constructible sets", -Version := "2023.06-13", +Version := "2023.06-14", Date := ~.Version{[ 1 .. 10 ]}, 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/Locales/gap/MultipleDifferences.gi b/Locales/gap/MultipleDifferences.gi index 779cf06f9..bb5dd825f 100644 --- a/Locales/gap/MultipleDifferences.gi +++ b/Locales/gap/MultipleDifferences.gi @@ -31,6 +31,11 @@ InstallMethod( MeetSemilatticeOfMultipleDifferences, function( P ) local name, D; + if not ( HasIsDistributiveBicartesianProset( P ) and IsDistributiveBicartesianProset( P ) ) then + Error( "the input category `P` must be a distributive (bicartesian) proset (e.g. a distributive lattice) ", + "for the meet-semilattice of multiple differences to be well-defined\n" ); + fi; + name := "The meet-semilattice of multiple differences of "; name := Concatenation( name, Name( P ) ); diff --git a/Locales/gap/SingleDifferences.gi b/Locales/gap/SingleDifferences.gi index 5d394ebd0..9050c7d7c 100644 --- a/Locales/gap/SingleDifferences.gi +++ b/Locales/gap/SingleDifferences.gi @@ -36,6 +36,11 @@ InstallMethod( MeetSemilatticeOfSingleDifferences, function( P ) local name, D, L; + if not ( HasIsDistributiveBicartesianProset( P ) and IsDistributiveBicartesianProset( P ) ) then + Error( "the input category `P` must be a distributive (bicartesian) proset (e.g. a distributive lattice) ", + "for the meet-semilattice of single differences to be well-defined\n" ); + fi; + name := "The meet-semilattice of single differences of "; name := Concatenation( name, Name( P ) ); @@ -84,6 +89,7 @@ InstallMethod( MeetSemilatticeOfSingleDifferences, end ); + ## the following is independent of the representatives of the single differences when the given bicartesian proset is (co)distributive ## (A - A') ≤_D (B - B') ⟺ ( A ≤_C ( A' ∨ B ) ) and ( ( A ∧ B' ) ≤_C A' ) AddIsHomSetInhabited( D, function( D, A, B )