From 468bf78c172a483d8d6dd40a28230c9a3e771b94 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 11 Nov 2021 17:07:53 -0800 Subject: commit old plan file --- notes/original_plan.txt | 65 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 notes/original_plan.txt 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 (?) -- cgit v1.2.3