Closed leesugil closed 4 months ago
regarding 3., maybe we should keep the parenthesis for all terms during the process, and run parenthExpr once on the final Expr to make it visually appealing. (along with maybe replacing " * " with " ")
resolved. added displyExpr to remove parenthesis and * for final output
the current version is a mix of the legacy design ("make it work first") and the goal design ("a true symbolic algebra program"). it's difficult to see how parsing, parenthesizing, and evaluation is done in a clear flow-chart. for example, is there a specific order of operations (not mathematical binary operations, this on later) to be applied to a given expression, like altExpr -> distExpr -> commExpr -> ... ?
doing this will not only visualize the flow of the product but also help us analyze performance issues
also, of all these altExpr, expExpr, distExpr, commExpr, assocExpr, evalExpr, etc.,
-- edit --
looks like there's a different branching going other than the usual tree of Expr, each of the 12 arrangements yielding their own Expr tree.
so the current Expr tree should be more of called as eval tree, where as a given mathematical expression should have a different tree listing all possible different ways of expressing the same thing.
that's an exponential growth.