remove the default rewriting(G::AbstractFPGroup)

It's better to show MethodError than to default to surprising behaviour.
This commit is contained in:
Marek Kaluba 2021-12-18 21:57:41 +01:00
parent 72ea5c8123
commit 20711aa1e8
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
1 changed files with 12 additions and 2 deletions

View File

@ -20,8 +20,18 @@ word_type(G::AbstractFPGroup) = word_type(typeof(G))
# the default:
word_type(::Type{<:AbstractFPGroup}) = Word{UInt8}
# the default (results in free rewriting)
rewriting(G::AbstractFPGroup) = alphabet(G)
"""
rewriting(G::AbstractFPGroup)
Return a "rewriting object" for elements of `G`. The rewriting object must must implement
KnuthBendix.rewrite_from_left!(
u::AbstractWord,
v::AbstractWord,
rewriting(G)
)
For example if `G` is a `FreeGroup` then `alphabet(G)` is returned which results in free rewriting. For `FPGroup` a rewriting system is returned which may (or may not) rewrite word `v` to its normal form.
"""
function rewriting end
Base.@propagate_inbounds function (G::AbstractFPGroup)(
word::AbstractVector{<:Integer},