You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SymbolicUtils.jl provides various utilities for symbolic computing. SymbolicUtils.jl is what one would use to build
a Computer Algebra System (CAS). If you're looking for a complete CAS, similar to SymPy or Mathematica, see
Symbolics.jl. If you want to build a crazy CAS for your weird
Octonian algebras, you've come to the right place.
Symbols in SymbolicUtils carry type information. Operations on them propagate this information. A rule-based rewriting language can be used to find subexpressions that satisfy arbitrary conditions and apply arbitrary transformations on the matches. The library also contains a set of useful simplification rules for expressions of numeric symbols and numbers. These can be remixed and extended for special purposes.
If you are a Julia package developer in need of a rule rewriting system for your own types, have a look at the interfacing guide.
"I don't want to read your manual, just show me some cool code"
julia>using SymbolicUtils
julia> SymbolicUtils.show_simplified[] =true
julia>@syms x::Real y::Real z::Complexf(::Number)::Real
(x, y, z, f(::Number)::Real)
julia>2x^2- y + x^2
(3* (x ^2)) + (-1* y)
julia>f(sin(x)^2+cos(x)^2) + z
f(1) + z
julia> r =@rulesinh(im *~x) =>sin(~x)
sinh(im *~x) =>sin(~x)
julia>r(sinh(im * y))
sin(y)
julia>simplify(cos(y)^2+sinh(im*y)^2, RuleSet([r]))
1
Citations
The pattern matcher is an adaption of the one by Gerald Jay Sussman (as seen in 6.945 at MIT), his use of symbolic programming in the book SICM inspired this package.