Skip to content

Commit

Permalink
fropin: ensure that factorizations are mutable
Browse files Browse the repository at this point in the history
This is really just for uniformity between MinimalFactorization
and Factorization.
  • Loading branch information
James Mitchell authored and james-d-mitchell committed May 29, 2018
1 parent 67c6726 commit 8265918
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gap/main/fropin.gi
Original file line number Diff line number Diff line change
Expand Up @@ -629,5 +629,5 @@ function(S, x)
"the second argument <x> is not an element ",
"of the first argument <S>,");
fi;
return EN_SEMI_FACTORIZATION(S, PositionCanonical(S, x));
return ShallowCopy(EN_SEMI_FACTORIZATION(S, PositionCanonical(S, x)));
end);
13 changes: 11 additions & 2 deletions tst/standard/factor.tst
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,17 @@ gap> ForAll(S, x -> EvaluateWord(GeneratorsOfSemigroup(S),
> Factorization(S, x)) = x);
true

# Test mutability of factorisation and minimal factorisation
gap> S := OrderEndomorphisms(7);;
gap> Factorization(S, Transformation([2, 4, 4, 4, 7, 7, 7]));
[ 7, 8, 4, 5, 6, 7, 2, 2, 3, 4, 2, 6, 5, 7, 8 ]
gap> IsMutable(last);
true
gap> MinimalFactorization(S, Transformation([2, 4, 4, 4, 7, 7, 7]));
[ 4, 3, 5, 7, 8 ]
gap> IsMutable(last);
true

# FactorTest13: Factorization regularity is learned after creation
gap> S := SingularTransformationSemigroup(5);
<regular transformation semigroup ideal of degree 5 with 1 generator>
Expand Down Expand Up @@ -212,8 +223,6 @@ gap> MinimalFactorization(S, x);
[ 5, 2, 5, 5, 2, 3 ]
gap> Factorization(S, x);
[ 5, 2, 5, 5, 2, 3 ]
gap> EvaluateWord(GeneratorsOfSemigroup(S), last) = x;
true

# SEMIGROUPS_UnbindVariables
gap> Unbind(S);
Expand Down

0 comments on commit 8265918

Please sign in to comment.