From 158ce5ee2759c7fd753b1dbc8aa019928de79bf9 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Mon, 30 Jul 2018 08:30:27 +0200 Subject: [PATCH] replace Nemo -> AbstractAlgebra --- src/AutGroup.jl | 2 +- src/Groups.jl | 8 ++++---- test/AutGroup-tests.jl | 21 ++++++++++----------- test/DirectProd-tests.jl | 5 ++--- test/FreeGroup-tests.jl | 10 +++++----- test/WreathProd-tests.jl | 6 +++--- test/runtests.jl | 3 ++- 7 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 6903aee..5c9952a 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -19,7 +19,7 @@ struct FlipAut{I<:Integer} end struct PermAut{I<:Integer} - perm::Nemo.Generic.perm{I} + perm::Generic.perm{I} end struct Identity end diff --git a/src/Groups.jl b/src/Groups.jl index cf94eaa..e255817 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -1,10 +1,10 @@ __precompile__() module Groups -using Nemo -import Nemo: Group, GroupElem, Ring -import Nemo: parent, parent_type, elem_type -import Nemo: elements, order, gens, matrix_repr +using AbstractAlgebra +import AbstractAlgebra: Group, GroupElem, Ring +import AbstractAlgebra: parent, parent_type, elem_type +import AbstractAlgebra: elements, order, gens, matrix_repr import Base: length, ==, hash, show, convert import Base: inv, reduce, *, ^ diff --git a/test/AutGroup-tests.jl b/test/AutGroup-tests.jl index 5e6acb7..7457c57 100644 --- a/test/AutGroup-tests.jl +++ b/test/AutGroup-tests.jl @@ -1,5 +1,4 @@ @testset "Automorphisms" begin - using Nemo G = PermutationGroup(Int8(4)) @testset "AutSymbol" begin @@ -14,7 +13,7 @@ @test isa(Groups.flip_autsymbol(3), Groups.AutSymbol) end - a,b,c,d = Nemo.gens(FreeGroup(4)) + a,b,c,d = gens(FreeGroup(4)) D = NTuple{4,FreeGroupElem}([a,b,c,d]) @testset "flip_autsymbol correctness" begin @@ -85,16 +84,16 @@ f = Groups.AutSymbol("a", 1, Groups.FlipAut(1)) @test isa(Automorphism{3}(f), Groups.GWord) @test isa(Automorphism{3}(f), Automorphism) - @test isa(AutGroup(FreeGroup(3)), Nemo.Group) + @test isa(AutGroup(FreeGroup(3)), Group) @test isa(AutGroup(FreeGroup(1)), Groups.AbstractFPGroup) A = AutGroup(FreeGroup(1)) - @test isa(Nemo.gens(A), Vector{Automorphism{1}}) - @test length(Nemo.gens(A)) == 1 + @test isa(gens(A), Vector{Automorphism{1}}) + @test length(gens(A)) == 1 A = AutGroup(FreeGroup(1), special=true) - @test length(Nemo.gens(A)) == 0 + @test length(gens(A)) == 0 A = AutGroup(FreeGroup(2)) - @test length(Nemo.gens(A)) == 7 - gens = Nemo.gens(A) + @test length(gens(A)) == 7 + gens = gens(A) @test isa(A(Groups.rmul_autsymbol(1,2)), Automorphism) @test A(Groups.rmul_autsymbol(1,2)) in gens @@ -147,7 +146,7 @@ b = Groups.flip_autsymbol(2)*A(inv(Groups.rmul_autsymbol(1,2))) @test a*b == b*a @test a^3 * b^3 == A() - g,h = Nemo.gens(A)[[1,8]] # (g, h) = (ϱ₁₂, ϱ₃₂) + g,h = gens(A)[[1,8]] # (g, h) = (ϱ₁₂, ϱ₃₂) @test Groups.domain(A) == NTuple{4, FreeGroupElem}(gens(A.objectGroup)) @@ -193,13 +192,13 @@ @test isa(S, Vector{Groups.AutSymbol}) S = [G(s) for s in unique(S)] @test isa(S, Vector{Automorphism{N}}) - @test S == Nemo.gens(G) + @test S == gens(G) @test length(S) == 51 S_inv = [S..., [inv(s) for s in S]...] @test length(unique(S_inv)) == 75 G = AutGroup(FreeGroup(N), special=true) - S = Nemo.gens(G) + S = gens(G) S_inv = [G(), S..., [inv(s) for s in S]...] S_inv = unique(S_inv) B_2 = [i*j for (i,j) in Base.product(S_inv, S_inv)] diff --git a/test/DirectProd-tests.jl b/test/DirectProd-tests.jl index cb85b61..3fb124b 100644 --- a/test/DirectProd-tests.jl +++ b/test/DirectProd-tests.jl @@ -1,13 +1,12 @@ @testset "DirectProducts" begin - using Nemo G = PermutationGroup(3) g = G([2,3,1]) F, a = FiniteField(2,3,"a") @testset "Constructors" begin - @test isa(Groups.DirectProductGroup(G,2), Nemo.Group) - @test isa(G×G, Nemo.Group) + @test isa(Groups.DirectProductGroup(G,2), AbstractArray.Group) + @test isa(G×G, AbstractAlgebra.Group) @test isa(Groups.DirectProductGroup(G,2), Groups.DirectProductGroup{Generic.PermGroup{Int64}}) GG = Groups.DirectProductGroup(G,2) diff --git a/test/FreeGroup-tests.jl b/test/FreeGroup-tests.jl index b917406..007b6dc 100644 --- a/test/FreeGroup-tests.jl +++ b/test/FreeGroup-tests.jl @@ -41,18 +41,18 @@ end end @testset "FreeGroup" begin - @test isa(FreeGroup(["s", "t"]), Nemo.Group) + @test isa(FreeGroup(["s", "t"]), Group) G = FreeGroup(["s", "t"]) @testset "elements constructors" begin @test isa(G(), FreeGroupElem) @test eltype(G.gens) == Groups.FreeSymbol @test length(G.gens) == 2 - @test eltype(Nemo.gens(G)) == FreeGroupElem - @test length(Nemo.gens(G)) == 2 + @test eltype(gens(G)) == FreeGroupElem + @test length(gens(G)) == 2 end - s, t = Nemo.gens(G) + s, t = gens(G) @testset "internal arithmetic" begin @@ -130,7 +130,7 @@ end @test Groups.replace_all(s*c*s*c*s, subst) == s*t^4*s*t^4*s G = FreeGroup(["x", "y"]) - x,y = Nemo.gens(G) + x,y = gens(G) @test Groups.replace(x*y^9, 2, y^2, y) == x*y^8 @test Groups.replace(x^3, 1, x^2, y) == x*y diff --git a/test/WreathProd-tests.jl b/test/WreathProd-tests.jl index 437280d..bf3e1ba 100644 --- a/test/WreathProd-tests.jl +++ b/test/WreathProd-tests.jl @@ -4,13 +4,13 @@ b = S_3([2,3,1]) @testset "Constructors" begin - @test isa(Groups.WreathProduct(F, S_3), Nemo.Group) + @test isa(Groups.WreathProduct(F, S_3), AbstractAlgebra.Group) @test isa(Groups.WreathProduct(F, S_3), Groups.WreathProduct) - @test isa(Groups.WreathProduct(F, S_3), Groups.WreathProduct{Nemo.FqNmodFiniteField}) + @test isa(Groups.WreathProduct(F, S_3), Groups.WreathProduct{AbstractAlgebra.FqNmodFiniteField}) aa = Groups.DirectProductGroupElem([a^0 ,a, a^2]) - @test isa(Groups.WreathProductElem(aa, b), Nemo.GroupElem) + @test isa(Groups.WreathProductElem(aa, b), AbstractAlgebra.GroupElem) @test isa(Groups.WreathProductElem(aa, b), Groups.WreathProductElem) @test isa(Groups.WreathProductElem(aa, b), Groups.WreathProductElem{typeof(a)}) diff --git a/test/runtests.jl b/test/runtests.jl index 346a89e..30ac4bb 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,5 +1,6 @@ -using Groups using Base.Test +using AbstractAlgebra +using Groups @testset "Groups" begin include("FreeGroup-tests.jl")