From c75ff00aa99e280df0d420f74d41c9d52ef1ae0b Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Thu, 13 Oct 2022 23:38:18 +0200 Subject: [PATCH] use KB.Settings to pass options to knuthbendix --- src/aut_groups/mcg.jl | 2 +- src/aut_groups/sautFn.jl | 8 ++++---- src/types.jl | 2 +- test/AutFn.jl | 2 +- test/fp_groups.jl | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/aut_groups/mcg.jl b/src/aut_groups/mcg.jl index 8b3bbce..0bb17b2 100644 --- a/src/aut_groups/mcg.jl +++ b/src/aut_groups/mcg.jl @@ -74,7 +74,7 @@ relations(S::SurfaceGroup) = S.relations function symplectic_twists(π₁Σ::SurfaceGroup) g = genus(π₁Σ) - saut = SpecialAutomorphismGroup(FreeGroup(2g), maxrules=100) + saut = SpecialAutomorphismGroup(FreeGroup(2g), max_rules=1000) Aij = [SymplecticMappingClass(saut, :A, i, j) for i in 1:g for j in 1:g if i≠j] diff --git a/src/aut_groups/sautFn.jl b/src/aut_groups/sautFn.jl index 19e5f45..4f8c609 100644 --- a/src/aut_groups/sautFn.jl +++ b/src/aut_groups/sautFn.jl @@ -7,12 +7,12 @@ function SpecialAutomorphismGroup(F::FreeGroup; ordering = KnuthBendix.LenLex, k A, rels = gersten_relations(n, commutative=false) S = [A[i] for i in 1:2:length(A)] - maxrules = 1000*n + max_rules = 1000 * n - rws = KnuthBendix.RewritingSystem(rels, ordering(A)) - Logging.with_logger(Logging.NullLogger()) do + rws = Logging.with_logger(Logging.NullLogger()) do + rws = KnuthBendix.RewritingSystem(rels, ordering(A)) # the rws is not confluent, let's suppress warning about it - KnuthBendix.knuthbendix!(rws; maxrules=maxrules, kwargs...) + KnuthBendix.knuthbendix(rws, KnuthBendix.Settings(; max_rules=max_rules, kwargs...)) end return AutomorphismGroup(F, S, rws, ntuple(i -> gens(F, i), n)) end diff --git a/src/types.jl b/src/types.jl index f20b55a..cb50fe0 100644 --- a/src/types.jl +++ b/src/types.jl @@ -229,7 +229,7 @@ function FPGroup( word_rels = [word(lhs) => word(rhs) for (lhs, rhs) in [relations(G); rels]] rws = KnuthBendix.RewritingSystem(word_rels, ordering) - KnuthBendix.knuthbendix!(rws; kwargs...) + rws = KnuthBendix.knuthbendix(rws, KnuthBendix.Settings(; kwargs...)) return FPGroup(G.gens, rels, rws) end diff --git a/test/AutFn.jl b/test/AutFn.jl index 8c566ea..0df66e8 100644 --- a/test/AutFn.jl +++ b/test/AutFn.jl @@ -79,7 +79,7 @@ @test inv(l)(deepcopy(D)) == (a, d^-1*b,c, d) end - A = SpecialAutomorphismGroup(F4, maxrules=1000) + A = SpecialAutomorphismGroup(F4, max_rules=1000) @testset "AutomorphismGroup constructors" begin @test A isa Groups.AbstractFPGroup diff --git a/test/fp_groups.jl b/test/fp_groups.jl index e06f165..f46b544 100644 --- a/test/fp_groups.jl +++ b/test/fp_groups.jl @@ -40,7 +40,7 @@ end # quotient of G - H = FPGroup(G, [aG^2=>cG, bG*cG=>aG], maxrules=200) + H = FPGroup(G, [aG^2 => cG, bG * cG => aG], max_rules=200) h = H(word(g)) @@ -48,7 +48,7 @@ @test_throws AssertionError h == g @test_throws MethodError h*g - H′ = FPGroup(G, [aG^2=>cG, bG*cG=>aG], maxrules=200) + H′ = FPGroup(G, [aG^2 => cG, bG * cG => aG], max_rules=200) @test_throws AssertionError one(H) == one(H′) Groups.normalform!(h)