diff options
Diffstat (limited to 'notes')
-rw-r--r-- | notes/original_plan.txt | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/notes/original_plan.txt b/notes/original_plan.txt new file mode 100644 index 0000000..38224ae --- /dev/null +++ b/notes/original_plan.txt @@ -0,0 +1,65 @@ + +lexing/parsing options: +- reuse old spectrum code as-as +- modify spectrum code as iterator +- nom (from s-expr example) + +sexpr_expr + Integer(i64) + Float(f64) + String(String) + Boolean(bool) + Symbol(String) + List: vec of expr + +later add: + Vector + Quote + + +--- basic CAS + +canonical_expr + + Number + Integer + Rational + denominator always positive + both are non-zero integers + Float + Constant (pi, etc) + Sum + at least two members + no members are Sum + at most one member is a number + Product + at least two members + no members are Product + at most one member is a number + Power + Factorial + unary + simplify if operand is a positive integer + UnaryFunction + eg, sin, cos + +simple test cases: + + (+ 1 2 3) => 6 + (/ c (^ d 2)) => (* c (^ d -2)) + (- a (* 2 b)) => (+ a (* -2 b)) + (- a b) => (+ a (* -1 b)) + (* a (* b c)) => (* a b c) + +- parse sexpr into canonical expression +- rational number + +more expr: + Complex (split up Number) + Limit + Series + Equation(left, right) + Vector + Operator (?) + Derivative (?) + Integral (?) |