diff --git a/Project.toml b/Project.toml index d838a1097..5e915c717 100644 --- a/Project.toml +++ b/Project.toml @@ -35,7 +35,7 @@ SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462" Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" -StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" +StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" SymbolicIndexingInterface = "2efcf032-c050-4f8e-a9bb-153293bab1f5" SymbolicLimits = "19f23fe9-fdab-4a78-91af-e7b7767979c3" SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b" @@ -84,7 +84,6 @@ RuntimeGeneratedFunctions = "0.5.9" SciMLBase = "2" Setfield = "1" SpecialFunctions = "2" -StaticArrays = "1.1" SymPy = "2" SymbolicIndexingInterface = "0.3.14" SymbolicLimits = "0.2.0" diff --git a/src/Symbolics.jl b/src/Symbolics.jl index f78bc9931..f3f9963f6 100644 --- a/src/Symbolics.jl +++ b/src/Symbolics.jl @@ -5,44 +5,42 @@ module Symbolics using PrecompileTools -@recompile_invalidations begin +using DocStringExtensions, Markdown - using DocStringExtensions, Markdown +using LinearAlgebra - using LinearAlgebra +using Reexport - using Reexport +using DomainSets - using DomainSets +using Setfield - using Setfield +import DomainSets: Domain - import DomainSets: Domain +using TermInterface +import TermInterface: maketerm, iscall, operation, arguments, symtype, metadata - using TermInterface - import TermInterface: maketerm, iscall, operation, arguments, symtype, metadata +import SymbolicUtils: Term, Add, Mul, Pow, Sym, Div, BasicSymbolic, +FnType, @rule, Rewriters, substitute, +promote_symtype, isadd, ismul, ispow, isterm, issym, isdiv - import SymbolicUtils: Term, Add, Mul, Pow, Sym, Div, BasicSymbolic, - FnType, @rule, Rewriters, substitute, - promote_symtype, isadd, ismul, ispow, isterm, issym, isdiv +using SymbolicUtils.Code - using SymbolicUtils.Code +import SymbolicUtils.Rewriters: Chain, Prewalk, Postwalk, Fixpoint - import SymbolicUtils.Rewriters: Chain, Prewalk, Postwalk, Fixpoint +import SymbolicUtils.Code: toexpr - import SymbolicUtils.Code: toexpr +import ArrayInterface +using RuntimeGeneratedFunctions +using SciMLBase, IfElse +import MacroTools - import ArrayInterface - using RuntimeGeneratedFunctions - using SciMLBase, IfElse - import MacroTools +using SymbolicIndexingInterface - using SymbolicIndexingInterface +import SymbolicLimits - import SymbolicLimits +using ADTypes: ADTypes - using ADTypes: ADTypes -end @reexport using SymbolicUtils RuntimeGeneratedFunctions.init(@__MODULE__) diff --git a/src/arrays.jl b/src/arrays.jl index 084bf8620..5d7af2e88 100644 --- a/src/arrays.jl +++ b/src/arrays.jl @@ -1,6 +1,6 @@ using SymbolicUtils using SymbolicUtils: @capture -using StaticArrays +using StaticArraysCore import Base: eltype, length, ndims, size, axes, eachindex export @arrayop, ArrayMaker, @makearray, @setview, @setview! diff --git a/src/diff.jl b/src/diff.jl index c86ebb43f..5e9f073d5 100644 --- a/src/diff.jl +++ b/src/diff.jl @@ -1,4 +1,4 @@ -abstract type Operator <: Function end +abstract type Operator end propagate_shape(::Operator, x) = axes(x) """ @@ -45,6 +45,7 @@ end (D::Differential)(x::Union{Num, Arr}) = wrap(D(unwrap(x))) (D::Differential)(x::Complex{Num}) = wrap(ComplexTerm{Real}(D(unwrap(real(x))), D(unwrap(imag(x))))) SymbolicUtils.promote_symtype(::Differential, T) = T +SymbolicUtils.isbinop(f::Differential) = false is_derivative(x) = iscall(x) ? operation(x) isa Differential : false @@ -54,6 +55,7 @@ Base.:*(D1::Differential, D2::Differential) = D1 ∘ D2 Base.:^(D::Differential, n::Integer) = iszero(n) ? identity : _repeat_apply(D, n) Base.show(io::IO, D::Differential) = print(io, "Differential(", D.x, ")") +Base.nameof(D::Differential) = :Differential Base.:(==)(D1::Differential, D2::Differential) = isequal(D1.x, D2.x) Base.hash(D::Differential, u::UInt) = hash(D.x, xor(u, 0xdddddddddddddddd))