Internals of minicas, a small Computer Algebra System.
In this crate, you will generally work on implementations of [ast::AstNode]. These are:
- The enum [ast::NodeInner], which concretely implements the different variants of the AST
- The wrapper [ast::Node], which wraps a [ast::NodeInner]
- The heap-allocated wrapper [ast::HN], which is a node on the heap.
Creating an AST is easiest done by parsing it from a string:
use *;
let mut n = try_from.unwrap;
Though an AST may be constructed manually (see tests for examples of this).
Once you have an AST, you can typically work with it by calling methods on it, such as [ast::AstNode::finite_eval]:
# use *;
// EG: Evaluating an expression with variables
assert_eq!;
// EG: Interval arithmetic
assert_eq!;
Theres also a number of algorithm modules in [ast]:
use *;
// EG: Rearrange the equation
let mut lhs = new_var;
make_subject;
assert_eq!;
// EG: Constant folding
let mut n = try_from.unwrap;
assert_eq!;
assert_eq!;