Skip to content

Commit

Permalink
fixed spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
n0rbed committed Sep 13, 2024
1 parent 080d19f commit bc014a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/solver/main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function solve_univar(expression, x; dropmultiplicity=true)
end
end

subs, filtered_expr, assumptions = filter_poly(expression, x, assum=true)
subs, filtered_expr, assumptions = filter_poly(expression, x, assumptions=true)
coeffs, constant = polynomial_coeffs(filtered_expr, [x])
degree = sdegree(coeffs, x)

Expand Down
14 changes: 7 additions & 7 deletions src/solver/preprocess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,17 +241,17 @@ julia> filter_poly((x+1)*term(log, 3), x)
(Dict{Any, Any}(var"##247" => log(3)), var"##247"*(1 + x))
```
"""
function filter_poly(og_expr, var; assum=false)
function filter_poly(og_expr, var; assumptions=false)
expr = deepcopy(og_expr)
expr = unwrap(expr)
vars = get_variables(expr)

# handle edge cases
if !isequal(vars, []) && isequal(vars[1], expr)
assum && return Dict{Any, Any}(), expr, []
assumptions && return Dict{Any, Any}(), expr, []
return (Dict{Any, Any}(), expr)
elseif isequal(vars, [])
assum && return filter_stuff(expr), []
assumptions && return filter_stuff(expr), []
return filter_stuff(expr)
end

Expand All @@ -261,16 +261,16 @@ function filter_poly(og_expr, var; assum=false)
# reassemble expr to avoid variables remembering original values issue and clean
args = arguments(expr)
oper = operation(expr)
new_expr, assumptions = clean_f(term(oper, args...), var, subs)
new_expr, assum_array = clean_f(term(oper, args...), var, subs)

Check warning on line 264 in src/solver/preprocess.jl

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"assum" should be "assume".

assum && return subs, new_expr, assumptions
assumptions && return subs, new_expr, assum_array

Check warning on line 266 in src/solver/preprocess.jl

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"assum" should be "assume".
return subs, new_expr
end

function filter_poly(og_expr; assum=false)
function filter_poly(og_expr; assumptions=false)
new_var = gensym()
new_var = (@variables $(new_var))[1]
return filter_poly(og_expr, new_var; assum=assum)
return filter_poly(og_expr, new_var; assumptions=assumptions)
end


Expand Down

0 comments on commit bc014a0

Please sign in to comment.