use KB.IndexAutomaton as rewriting for FPGroups

This commit is contained in:
Marek Kaluba 2022-10-13 23:41:05 +02:00
parent c75ff00aa9
commit 827969ae84
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
3 changed files with 11 additions and 7 deletions

View File

@ -51,12 +51,14 @@ function SurfaceGroup(genus::Integer, boundaries::Integer)
comms = Word(word)
word_rels = [ comms => one(comms) ]
rws = KnuthBendix.RewritingSystem(word_rels, KnuthBendix.RecursivePathOrder(Al))
KnuthBendix.knuthbendix!(rws)
rws = let R = KnuthBendix.RewritingSystem(word_rels, KnuthBendix.Recursive(Al))
KnuthBendix.IndexAutomaton(KnuthBendix.knuthbendix(R))
end
elseif boundaries == 1
S = typeof(one(Word(Int[])))
word_rels = Pair{S, S}[]
rws = RewritingSystem(word_rels, KnuthBendix.LenLex(Al))
word_rels = Pair{W,W}[]
rws = let R = RewritingSystem(word_rels, KnuthBendix.LenLex(Al))
KnuthBendix.IndexAutomaton(KnuthBendix.knuthbendix(R))
end
else
throw("Not Implemented")
end

View File

@ -14,7 +14,9 @@ function SpecialAutomorphismGroup(F::FreeGroup; ordering = KnuthBendix.LenLex, k
# the rws is not confluent, let's suppress warning about it
KnuthBendix.knuthbendix(rws, KnuthBendix.Settings(; max_rules=max_rules, kwargs...))
end
return AutomorphismGroup(F, S, rws, ntuple(i -> gens(F, i), n))
idxA = KnuthBendix.IndexAutomaton(rws)
return AutomorphismGroup(F, S, idxA, ntuple(i -> gens(F, i), n))
end
KnuthBendix.alphabet(G::AutomorphismGroup{<:FreeGroup}) = alphabet(rewriting(G))

View File

@ -231,7 +231,7 @@ function FPGroup(
rws = KnuthBendix.knuthbendix(rws, KnuthBendix.Settings(; kwargs...))
return FPGroup(G.gens, rels, rws)
return FPGroup(G.gens, rels, KnuthBendix.IndexAutomaton(rws))
end
function Base.show(io::IO, ::MIME"text/plain", G::FPGroup)