From 34a281c10ccede70018a12484f8cbc3397d63046 Mon Sep 17 00:00:00 2001 From: Mohamed Barakat Date: Mon, 30 Sep 2024 16:11:02 +0200 Subject: [PATCH] enhanced TerminalCategoryWithMultipleObjects improving its role as a syntactic category, and closing the gap to LazyCategories --- CAP/PackageInfo.g | 2 +- .../TerminalCategoryWithMultipleObjects.g | 14 ++++++------ CAP/gap/TerminalCategory.gi | 22 ++++++++++++++----- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/CAP/PackageInfo.g b/CAP/PackageInfo.g index e790694ca5..a2b75b911f 100644 --- a/CAP/PackageInfo.g +++ b/CAP/PackageInfo.g @@ -10,7 +10,7 @@ SetPackageInfo( rec( PackageName := "CAP", Subtitle := "Categories, Algorithms, Programming", -Version := "2024.11-02", +Version := "2025.01-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/CAP/examples/TerminalCategoryWithMultipleObjects.g b/CAP/examples/TerminalCategoryWithMultipleObjects.g index 9bacc8715a..4c31bfcfc4 100644 --- a/CAP/examples/TerminalCategoryWithMultipleObjects.g +++ b/CAP/examples/TerminalCategoryWithMultipleObjects.g @@ -14,11 +14,11 @@ t := TerminalObject( T ); z := ZeroObject( T ); #! Display( i ); -#! InitialObject +#! InitialObject( ) Display( t ); -#! TerminalObject +#! TerminalObject( ) Display( z ); -#! ZeroObject +#! ZeroObject( ) IsIdenticalObj( i, z ); #! false IsIdenticalObj( t, z ); @@ -111,7 +111,7 @@ id := IdentityMorphism( a ); Display( id ); #! a #! | -#! | IdentityMorphism +#! | IdentityMorphism( a ) #! v #! a m = id; @@ -123,7 +123,7 @@ zero := ZeroMorphism( a, a ); Display( zero ); #! a #! | -#! | ZeroMorphism +#! | ZeroMorphism( a, a ) #! v #! a id = zero; @@ -135,7 +135,7 @@ lift := Lift( m, n ); Display( lift ); #! a #! | -#! | Lift +#! | Lift( m, n ) #! v #! a IsColiftable( m, n ); @@ -145,7 +145,7 @@ colift := Colift( m, n ); Display( colift ); #! b #! | -#! | Colift +#! | Colift( m, n ) #! v #! b DirectProduct( T, [ ] ); diff --git a/CAP/gap/TerminalCategory.gi b/CAP/gap/TerminalCategory.gi index 686d91a689..09156b22aa 100644 --- a/CAP/gap/TerminalCategory.gi +++ b/CAP/gap/TerminalCategory.gi @@ -323,9 +323,14 @@ InstallGlobalFunction( TerminalCategoryWithMultipleObjects, FunctionWithNamedArg return Pair( """ function( input_arguments... ) - - return ObjectConstructor( cat, "operation_name" ); - + local args, string; + + args := [ input_arguments... ]; + + string := Concatenation( "operation_name", "( ", JoinStringsWithSeparator( List( [ 2 .. number_of_arguments ], i -> String( args[i] ) ), ", " ), " )" ); + + return ObjectConstructor( cat, string ); + end """, 1 ); @@ -337,9 +342,14 @@ InstallGlobalFunction( TerminalCategoryWithMultipleObjects, FunctionWithNamedArg return Pair( """ function( input_arguments... ) - - return MorphismConstructor( cat, top_source, "operation_name", top_range ); - + local args, string; + + args := [ input_arguments... ]; + + string := Concatenation( "operation_name", "( ", JoinStringsWithSeparator( List( [ 2 .. number_of_arguments ], i -> String( args[i] ) ), ", " ), " )" ); + + return MorphismConstructor( cat, top_source, string, top_range ); + end """, 1 );