Commit 52101f51 authored by Taddeus Kroes's avatar Taddeus Kroes

Completed some items from TODO list:

- Fraction term cancellation now has priority over constant multiplication.
- Some other issues had already been resolved.
parent 5653a56b
......@@ -59,43 +59,6 @@ Division of 0 by 1 reduces to 0.
- validation: preorder traversal implementatie vergelijken met andere
implementaties.
- Fix the following loop using strategy (reduce_fraction_constants):
>>> 2 / 7 - 4 / 11
2 / 7 - 4 / 11
>>> @
22 / 77 - 28 / 77
>>> @
2 / 7 - 28 / 77
>>> @
2 / 7 + 4 / 11
- Cancel terms before multiplying constants: (3 * ...) / (3 * ...) -> ... / ...
>>> (7/3)*(3/5)
7 / 3 * (3 / 5)
>>> ??
Expand fraction with nominator greater than denominator 7 / 3 to an integer
plus a fraction.
Multiply fractions 7 / 3 and 3 / 5.
>>> @
7 * 3 / (3 * 5)
>>> ?
Multiply constant 7 with 3.
>>> @
21 / (3 * 5)
>>> @
21 / 15
>>> @
7 / 5
- Fix error while parsing unicode PI:
>>> sin(1/2 * pi)
sin(1 / 2 * π)
>>> @
unknown char � ignored.
unknown char � ignored.
ERROR: 41.7-41.8: "syntax error, unexpected TIMES" near "*".
ERROR: 41.14-41.15: "syntax error, unexpected RPAREN" near ")".
- No matches for sin(pi), sin(2pi), sin(4pi), etc...
- Create unit tests for node inequivalence operator.
......@@ -112,11 +75,9 @@ Division of 0 by 1 reduces to 0.
- Use pretty-print for expressions in hint messages.
- Parser:
+ add unit tests for operator associativity (derivatives/integrals).
- Parser: add unit tests for operator associativity (derivatives/integrals).
- Modules:
+ Equations with substitution
+ Sqrt
+ Sort
+ Gonio
......@@ -7,7 +7,7 @@ from .logarithmic import factor_in_exponent_multiplicant, \
from .derivatives import chain_rule
from .negation import double_negation, negated_factor, negated_nominator, \
negated_denominator, negated_zero, negated_factor
from .fractions import multiply_with_fraction
from .fractions import multiply_with_fraction, extract_fraction_terms
from .integrals import factor_out_constant, integrate_variable_root
from .powers import remove_power_of_one
from .sqrt import quadrant_sqrt, extract_sqrt_mult_priority
......@@ -56,6 +56,9 @@ RELATIVE = [
# sqrt(2 ^ 2) -> 2 # not sqrt 4
(quadrant_sqrt, raise_numerics),
#
(extract_fraction_terms, multiply_numerics),
]
......
......@@ -173,8 +173,8 @@ class TestLeidenOefenopgave(TestCase):
self.assertRewrite([
'(7/3)(3/5)',
'(7 * 3) / (3 * 5)',
'21 / (3 * 5)',
'21 / 15',
'3 / 3 * 7 / 5',
'1 * 7 / 5',
'7 / 5',
])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment