Skip to content

Commit

Permalink
Merge pull request homalg-project#1713 from mohamed-barakat/TerminalC…
Browse files Browse the repository at this point in the history
…ategoryWithMultipleObjects

enhanced TerminalCategoryWithMultipleObjects
  • Loading branch information
mohamed-barakat authored Jan 1, 2025
2 parents 2937f8d + 34a281c commit 91ebb51
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -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",

Expand Down
14 changes: 7 additions & 7 deletions CAP/examples/TerminalCategoryWithMultipleObjects.g
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ t := TerminalObject( T );
z := ZeroObject( T );
#! <A zero object in TerminalCategoryWithMultipleObjects( )>
Display( i );
#! InitialObject
#! InitialObject( )
Display( t );
#! TerminalObject
#! TerminalObject( )
Display( z );
#! ZeroObject
#! ZeroObject( )
IsIdenticalObj( i, z );
#! false
IsIdenticalObj( t, z );
Expand Down Expand Up @@ -111,7 +111,7 @@ id := IdentityMorphism( a );
Display( id );
#! a
#! |
#! | IdentityMorphism
#! | IdentityMorphism( a )
#! v
#! a
m = id;
Expand All @@ -123,7 +123,7 @@ zero := ZeroMorphism( a, a );
Display( zero );
#! a
#! |
#! | ZeroMorphism
#! | ZeroMorphism( a, a )
#! v
#! a
id = zero;
Expand All @@ -135,7 +135,7 @@ lift := Lift( m, n );
Display( lift );
#! a
#! |
#! | Lift
#! | Lift( m, n )
#! v
#! a
IsColiftable( m, n );
Expand All @@ -145,7 +145,7 @@ colift := Colift( m, n );
Display( colift );
#! b
#! |
#! | Colift
#! | Colift( m, n )
#! v
#! b
DirectProduct( T, [ ] );
Expand Down
22 changes: 16 additions & 6 deletions CAP/gap/TerminalCategory.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand All @@ -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 );

Expand Down

0 comments on commit 91ebb51

Please sign in to comment.