Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix type piracy #263

Closed
wants to merge 14 commits into from
28 changes: 14 additions & 14 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,28 @@ Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
TimerOutputs = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f"

[compat]
AbstractAlgebra = "0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35"
AbstractAlgebra = "0.34.5, 0.35"
BenchmarkTools = "1"
Combinatorics = "1"
DataStructures = "0.18"
Dates = "1.6, 1.7"
Groebner = "0.4, 0.5, 0.6"
Dates = "1.6"
Groebner = "0.6.3"
IterTools = "1"
LinearAlgebra = "1.6, 1.7"
Logging = "1.6, 1.7"
LinearAlgebra = "1.6"
Logging = "1.6"
MacroTools = "0.5"
ModelingToolkit = "8.51"
Nemo = "0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39"
ParamPunPam = "0.2"
PrecompileTools = "1.1, 1.2"
ModelingToolkit = "8.75"
Nemo = "0.38.3, 0.39"
ParamPunPam = "0.3.1"
PrecompileTools = "1.2"
Primes = "0.5"
Random = "1.6, 1.7"
SpecialFunctions = "1, 2"
SymbolicUtils = "1"
Symbolics = "5.5"
Random = "1.6"
SpecialFunctions = "2"
SymbolicUtils = "1.5"
Symbolics = "5.16"
TestSetExtensions = "2"
TimerOutputs = "0.5"
julia = "1.6, 1.7"
julia = "1.6"

[extras]
CPUSummary = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
Expand Down
2 changes: 1 addition & 1 deletion benchmarking/IdentifiableFunctions/experiments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ end
#! format: off

new_rff = StructuralIdentifiability.RationalFunctionField(funcs1)
cfs = StructuralIdentifiability.beautifuly_generators(new_rff)
cfs = StructuralIdentifiability.beautiful_generators(new_rff)
gb_rff = StructuralIdentifiability.RationalFunctionField(cfs)

K = GF(2^31 - 1)
Expand Down
2 changes: 1 addition & 1 deletion benchmarking/IdentifiableFunctions/homogenization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Bilirubin2_io = @ODEmodel(
funcs = find_identifiable_functions(Bilirubin2_io, with_states = true, strategy = (:gb,))

rff = StructuralIdentifiability.RationalFunctionField(funcs)
cfs = StructuralIdentifiability.beautifuly_generators(rff)
cfs = StructuralIdentifiability.beautiful_generators(rff)
rff = StructuralIdentifiability.RationalFunctionField(cfs)

K = GF(2^31 - 1)
Expand Down
21 changes: 10 additions & 11 deletions src/RationalFunctionFields/RationalFunctionField.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ end
# ------------------------------------------------------------------------------

"""
beautifuly_generators(rff::RationalFunctionField)
beautiful_generators(rff::RationalFunctionField)

Given a field of rational functions `rff` returns a set of "simpler" and
standardized generators for `rff`.
Expand All @@ -221,7 +221,7 @@ Applies the following passes:
1. Filter constants,
2. Remove redundant generators.
"""
@timeit _to function beautifuly_generators(
@timeit _to function beautiful_generators(
rff::RationalFunctionField;
discard_redundant = true,
reversed_order = false,
Expand Down Expand Up @@ -402,7 +402,7 @@ Returns a set of Groebner bases for multiple different rankings of variables.
# The first basis in some ordering
ord = InputOrdering()
new_rff = groebner_basis_coeffs(rff, seed = seed, ordering = ord)
cfs = beautifuly_generators(new_rff)
cfs = beautiful_generators(new_rff)
ordering_to_generators[ord] = cfs
if isempty(cfs)
return ordering_to_generators
Expand All @@ -427,7 +427,7 @@ Returns a set of Groebner bases for multiple different rankings of variables.
ordering = ord,
up_to_degree = up_to_degree,
)
cfs = beautifuly_generators(new_rff, discard_redundant = false)
cfs = beautiful_generators(new_rff, discard_redundant = false)
ordering_to_generators[ord] = cfs
end
end
Expand All @@ -444,7 +444,7 @@ Returns a set of Groebner bases for multiple different rankings of variables.
ordering = ord,
up_to_degree = up_to_degree,
)
cfs = beautifuly_generators(new_rff, discard_redundant = false)
cfs = beautiful_generators(new_rff, discard_redundant = false)
ordering_to_generators[ord] = cfs
end
end
Expand All @@ -462,7 +462,7 @@ Returns a set of Groebner bases for multiple different rankings of variables.
ordering = ord,
up_to_degree = up_to_degree,
)
cfs = beautifuly_generators(new_rff, discard_redundant = false)
cfs = beautiful_generators(new_rff, discard_redundant = false)
ordering_to_generators[ord] = cfs
end
end
Expand All @@ -479,7 +479,7 @@ function monomial_generators_up_to_degree(
) where {T}
@assert strategy in (:monte_carlo,)
relations = linear_relations_between_normal_forms(
beautifuly_generators(rff),
beautiful_generators(rff),
up_to_degree,
seed = seed,
)
Expand Down Expand Up @@ -544,7 +544,7 @@ Result is correct (in the Monte-Carlo sense) with probability at least `prob_thr
seed = seed,
rational_interpolator = rational_interpolator,
)
new_fracs = beautifuly_generators(new_rff)
new_fracs = beautiful_generators(new_rff)
if isempty(new_fracs)
return new_fracs
end
Expand All @@ -568,10 +568,9 @@ Result is correct (in the Monte-Carlo sense) with probability at least `prob_thr
Final cleaning and simplification of generators.
Out of $(length(new_fracs)) fractions $(length(new_fracs_unique)) are syntactically unique."""
runtime =
@elapsed new_fracs = beautifuly_generators(RationalFunctionField(new_fracs_unique))
@elapsed new_fracs = beautiful_generators(RationalFunctionField(new_fracs_unique))
@debug "Checking inclusion with probability $prob_threshold"
runtime =
@elapsed result = issubfield(rff, RationalFunctionField(new_fracs), prob_threshold)
runtime = @elapsed result = issubfield(rff, RationalFunctionField(new_fracs), p)
_runtime_logger[:id_inclusion_check] = runtime
if !result
@warn "Field membership check failed. Error will follow."
Expand Down
2 changes: 1 addition & 1 deletion src/discrete.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function _assess_local_identifiability_discrete_aux(
deg_x = _degree_with_common_denom(values(dds.x_equations))
deg_y = _degree_with_common_denom(values(dds.y_equations))
deg_known = reduce(+, map(total_degree, known_ic), init = 0)
deg_to_check = max(map(total_degree, funcs_to_check)...)
deg_to_check = max(map(total_degree_frac, funcs_to_check)...)
Jac_degree = deg_to_check + deg_known
if deg_x > 1
Jac_degree += 2 * deg_y * ((deg_x^prec - 1) ÷ (deg_x - 1))
Expand Down
6 changes: 1 addition & 5 deletions src/util.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# ------------------------------------------------------------------------------

function Nemo.vars(f::Generic.Frac{<:MPolyElem})
return collect(union(Set(vars(numerator(f))), Set(vars(denominator(f)))))
end

function Nemo.total_degree(f::Generic.Frac{<:MPolyElem})
function total_degree_frac(f::Generic.Frac{<:MPolyElem})
return sum(map(total_degree, unpack_fraction(f)))
end

Expand Down
Loading