visma
visma copied to clipboard
Simplification of expression
This partially solves issue #141
- Added property reduced in the Expression class.
- Added a class method, get_reduced() to simplify the expression.
- If the expression is simplified to a single token, the class type changes from Expression to appropriate Function class.
Can you add some tests for the above?
~~Also, note you might need to add an extra check if the expression needs to be simplified.
For example, when solving for y
in x - 2yz + 1= 0
the resultant expression y=-0.5*((-1.0-x)/z)
can be reduced but must not be reduced.~~
Hey @8hantanu , I have added the test function.