Skip to content

Commit c12eec2

Browse files
committed
lower bound SymbolicUtils
1 parent c423abe commit c12eec2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ NaNMath = "0.3"
3535
SafeTestsets = "0.0.1"
3636
SpecialFunctions = "0.7, 0.8, 0.9, 0.10"
3737
StaticArrays = "0.10, 0.11, 0.12"
38+
SymbolicUtils = "0.1.1"
3839
TreeViews = "0.3"
3940
UnPack = "0.1"
4041
Unitful = "1.1"

src/simplify.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ end
1515
# This is required to infer the right type for
1616
# Operation(Variable{Parameter{Number}}(:foo), [])
1717
# While keeping the metadata that the variable is a parameter.
18-
SymbolicUtils.promote_symtype(f::SymbolicUtils.Variable{FnType{X,Parameter{Y}}},
18+
SymbolicUtils.promote_symtype(f::SymbolicUtils.Sym{FnType{X,Parameter{Y}}},
1919
xs...) where {X, Y} = Y
2020

2121
SymbolicUtils.arguments(x::Operation) = x.args
2222

2323
# SymbolicUtils wants raw numbers
2424
SymbolicUtils.to_symbolic(x::Constant) = x.value
25-
SymbolicUtils.to_symbolic(x::Variable{T}) where {T} = SymbolicUtils.Variable{T}(x.name)
25+
SymbolicUtils.to_symbolic(x::Variable{T}) where {T} = SymbolicUtils.Sym{T}(x.name)
2626

2727
# Optional types of vars
2828
# Once converted to SymbolicUtils Variable, a Parameter needs to hide its metadata
2929
_vartype(x::Variable{<:Parameter{T}}) where {T} = T
3030
_vartype(x::Variable{T}) where {T} = T
3131
SymbolicUtils.symtype(x::Variable) = _vartype(x) # needed for a()
32-
SymbolicUtils.symtype(x::SymbolicUtils.Variable{<:Parameter{T}}) where {T} = T
32+
SymbolicUtils.symtype(x::SymbolicUtils.Sym{<:Parameter{T}}) where {T} = T
3333

3434
# returning Any causes SymbolicUtils to infer the type using `promote_symtype`
3535
# But we are OK with Number here for now I guess
@@ -44,8 +44,8 @@ end
4444

4545
to_mtk(x) = x
4646
to_mtk(x::Number) = Constant(x)
47-
to_mtk(v::SymbolicUtils.Variable{T}) where {T} = Variable{T}(nameof(v))
48-
to_mtk(v::SymbolicUtils.Variable{FnType{X,Y}}) where {X,Y} = Variable{Y}(nameof(v))
47+
to_mtk(v::SymbolicUtils.Sym{T}) where {T} = Variable{T}(nameof(v))
48+
to_mtk(v::SymbolicUtils.Sym{FnType{X,Y}}) where {X,Y} = Variable{Y}(nameof(v))
4949
function to_mtk(expr::SymbolicUtils.Term)
5050
Operation(to_mtk(SymbolicUtils.operation(expr)),
5151
map(to_mtk, SymbolicUtils.arguments(expr)))

0 commit comments

Comments
 (0)