1
0
mirror of https://github.com/kalmarek/SmallHyperbolic synced 2024-11-23 23:40:28 +01:00

generalize groupparse to arbitrary number of gens

This commit is contained in:
kalmarek 2020-04-23 16:43:40 +02:00
parent 9c9b9b5e37
commit bc183ec5f4
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -34,13 +34,17 @@ function parse_magma_fpgroup(str::AbstractString)
end end
function parse_magma_fpgroup(gens_str::AbstractVector{<:AbstractString}, rels_str::AbstractVector{<:AbstractString}) function parse_magma_fpgroup(gens_str::AbstractVector{<:AbstractString}, rels_str::AbstractVector{<:AbstractString})
rels_expr = Meta.parse.(rels_str)
expr = :([$(rels_expr...)]) gens_arr = Symbol.(gens_str)
gens_expr = Expr(:tuple, gens_arr...)
rels_arr = Meta.parse.(rels_str)
rels_expr = :([$(rels_arr...)])
F = FreeGroup(String.(gens_str)) F = FreeGroup(String.(gens_str))
relations = @eval begin relations = @eval begin
a,b,c = AbstractAlgebra.gens($F) $gens_expr = AbstractAlgebra.gens($F);
$expr $rels_expr
end end
return F/relations return F/relations