CAP_project icon indicating copy to clipboard operation
CAP_project copied to clipboard

Primitively installed methods are not recognized as primitive

Open mohamed-barakat opened this issue 3 years ago • 2 comments

The mechanism we use to add compiled methods does not register the added methods as primitive:

gap> LoadPackage( "FinSets", false );
true
gap> "CartesianLambdaIntroduction" in ListPrimitivelyInstalledOperationsOfCategory( SkeletalFinSets );
false
gap> SkeletalFinSets!.added_functions.CartesianLambdaIntroduction;
[ [ function( cat, alpha ) ... end, [  ] ], [ function( cat_1, alpha_1 ) ... end, [  ] ] ]
gap> Display( last );
[ [ function ( cat, alpha )
            local result_morphism, source;
            source := Source( alpha );
            result_morphism := PreCompose( cat, CartesianLeftUnitor( cat, source ), alpha );
            return DirectProductToExponentialAdjunctionMap( cat, TerminalObject( cat ), source, result_morphism );
        end, [  ] ], [ function ( cat_1, alpha_1 )
            local hoisted_1_1, hoisted_2_1, hoisted_3_1, hoisted_4_1, hoisted_5_1, hoisted_6_1, deduped_7_1, deduped_8_1, deduped_9_1;
            deduped_9_1 := Length( Source( alpha_1 ) );
            deduped_8_1 := Length( Range( alpha_1 ) );
            deduped_7_1 := [ 1 .. deduped_9_1 ];
            hoisted_6_1 := deduped_8_1;
            hoisted_2_1 := AsList( alpha_1 );
            hoisted_1_1 := [ 0 .. deduped_9_1 - 1 ];
            hoisted_5_1 := List( deduped_7_1, function ( i_2 )
                    return hoisted_2_1[1 + hoisted_1_1[i_2]];
                end );
            hoisted_4_1 := deduped_7_1;
            hoisted_3_1 := deduped_9_1;
            return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
                   ), cat_1, ObjectifyObjectForCAPWithAttributes( rec(
                     ), cat_1, Length, 1 ), ObjectifyObjectForCAPWithAttributes( rec(
                     ), cat_1, Length, deduped_8_1 ^ deduped_9_1 ), AsList, [ List( [ 0 .. deduped_9_1 ^ deduped_9_1 - 1 ], function ( i_2 )
                            local hoisted_1_2, hoisted_2_2, hoisted_3_2;
                            hoisted_1_2 := List( hoisted_1_1, function ( j_3 )
                                    return REM_INT( QUO_INT( i_2, hoisted_3_1 ^ j_3 ), hoisted_3_1 );
                                end );
                            hoisted_2_2 := List( hoisted_4_1, function ( i_3 )
                                    return hoisted_1_2[1 + hoisted_1_1[i_3]];
                                end );
                            hoisted_3_2 := List( hoisted_4_1, function ( i_3 )
                                    return hoisted_5_1[1 + hoisted_2_2[i_3]];
                                end );
                            return Sum( hoisted_1_1, function ( k_3 )
                                    return hoisted_3_2[(1 + k_3)] * hoisted_6_1 ^ k_3;
                                end );
                        end )[1 + deduped_9_1 * GeometricSumDiff1( deduped_9_1, deduped_9_1 )] ] );
        end, [  ] ] ]

mohamed-barakat avatar Sep 04 '22 14:09 mohamed-barakat

FYI: The compilation of CartesianLambdaIntroduction was enforced here.

mohamed-barakat avatar Sep 04 '22 14:09 mohamed-barakat

This is intended to make sure the compiled category behaves exactly the same as the original category when using it with Opposite or WrapperCategory and only_primitive_operations. Search for IsPrecompiledDerivation if you are interested in the exact implementation for this.

zickgraf avatar Sep 05 '22 06:09 zickgraf

@mohamed-barakat Can this issue be closed?

zickgraf avatar Sep 04 '24 12:09 zickgraf

Yes, thanks.

mohamed-barakat avatar Sep 04 '24 21:09 mohamed-barakat