aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-11 17:07:53 -0800
committerBryan Newbold <bnewbold@robocracy.org>2021-11-11 17:07:53 -0800
commit468bf78c172a483d8d6dd40a28230c9a3e771b94 (patch)
tree045e4238e11d0b2a7b6b48a268987b5d22c4e29c
parent7552b304fc6847c0558ae483647c93e4a08a445f (diff)
downloadcasual-468bf78c172a483d8d6dd40a28230c9a3e771b94.tar.gz
casual-468bf78c172a483d8d6dd40a28230c9a3e771b94.zip
commit old plan file
-rw-r--r--notes/original_plan.txt65
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 (?)