aboutsummaryrefslogtreecommitdiffstats
path: root/2021/09/learning_cas.md
blob: a482be595dbc822159511d2d46665de671e98a50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

Started reading "Computer Algebra and Symbolic Computation: Elementary
Algorithms" by Joel Cohen (2002). This is the somewhat more applied/language
oriented of two books in a series (the other, "Mathematical Methods",
apparently dives deeper in to some simplification and manipulation processes).

Currently thinking that implementing a basic schema/s-expr computer algebra
system would be a good learning exersize, building knowledge and familiarity
with expression manipulation.

Found [expreduce](https://github.com/corywalker/expreduce), a simple golang
computer algebra system. Also [mmaclone](https://github.com/jyh1/mmaclone).
[Blog post](https://corywalker.me/2018/06/03/introduction-to-computer-algebra.html)
about expreduce, and some documentation of functions which have been
implemented. Uses syntax, and I assume conventions, of Mathematica.

Via expreduce, found the 'Rubi' integration rule corpus (and basic CAS system)
by Albert Rich (<http://www.apmaths.uwo.ca/~arich/>). Rich previously worked on
the CAS built-in to TI-83 calculators!

-----

Specific things learned from CASC:EA book so far:

Internal representations of expressions often involve a stage of simplification
after parsing an expression. For example, in product expressions, can simplify
with constraint that none of the members are themselves product expressions,
and that there is only one rational number member, and it is the first member.
Division and subtraction are substituded for product-and-negative-power and
sum-and-negative-product. Presumably additional data structures can be used for
polynomials, etc.

This initial simplification stage, as part of evaluation, reminds me a bit of
the tokenization vs. grammar parsing stages of compilation. Eg, where does
tokenization end and parsing begin.

The 'procedure' definition blocks seem similar to Modelica: Input, Output,
Local Variables, Begin End.