Commit aed5ec18 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Multiplication sign is not omitted anymore for multiplication of equal identifiers

parent 3e5a2ac4
graph_drawing @ c8ecf708
Subproject commit 0e6c5e55add6e924a4201a2132457e9b3c7e26d0 Subproject commit c8ecf7081c6b944228a208617ad539e67091ef78
...@@ -42,23 +42,23 @@ class TestLeidenOefenopgave(TestCase): ...@@ -42,23 +42,23 @@ class TestLeidenOefenopgave(TestCase):
'(x + 1) ^ 3', '(x + 1) ^ 3',
'(x + 1)(x + 1) ^ 2', '(x + 1)(x + 1) ^ 2',
'(x + 1)(x + 1)(x + 1)', '(x + 1)(x + 1)(x + 1)',
'(xx + x * 1 + 1x + 1 * 1)(x + 1)', '(x * x + x * 1 + 1x + 1 * 1)(x + 1)',
'(xx + x + 1x + 1 * 1)(x + 1)', '(x * x + x + 1x + 1 * 1)(x + 1)',
'(xx + x + x + 1 * 1)(x + 1)', '(x * x + x + x + 1 * 1)(x + 1)',
'(xx + x + x + 1)(x + 1)', '(x * x + x + x + 1)(x + 1)',
'(xx + (1 + 1)x + 1)(x + 1)', '(x * x + (1 + 1)x + 1)(x + 1)',
'(xx + 2x + 1)(x + 1)', '(x * x + 2x + 1)(x + 1)',
'(x ^ (1 + 1) + 2x + 1)(x + 1)', '(x ^ (1 + 1) + 2x + 1)(x + 1)',
'(x ^ 2 + 2x + 1)(x + 1)', '(x ^ 2 + 2x + 1)(x + 1)',
'x ^ 2 * x + x ^ 2 * 1 + 2xx + 2x * 1 + 1x + 1 * 1', 'x ^ 2 * x + x ^ 2 * 1 + 2x * x + 2x * 1 + 1x + 1 * 1',
'x ^ 2 * x + x ^ 2 + 2xx + 2x * 1 + 1x + 1 * 1', 'x ^ 2 * x + x ^ 2 + 2x * x + 2x * 1 + 1x + 1 * 1',
'x ^ 2 * x + x ^ 2 + 2xx + 2x + 1x + 1 * 1', 'x ^ 2 * x + x ^ 2 + 2x * x + 2x + 1x + 1 * 1',
'x ^ 2 * x + x ^ 2 + 2xx + 2x + x + 1 * 1', 'x ^ 2 * x + x ^ 2 + 2x * x + 2x + x + 1 * 1',
'x ^ 2 * x + x ^ 2 + 2xx + 2x + x + 1', 'x ^ 2 * x + x ^ 2 + 2x * x + 2x + x + 1',
'x ^ 2 * x + x ^ 2 + 2xx + (2 + 1)x + 1', 'x ^ 2 * x + x ^ 2 + 2x * x + (2 + 1)x + 1',
'x ^ 2 * x + x ^ 2 + 2xx + 3x + 1', 'x ^ 2 * x + x ^ 2 + 2x * x + 3x + 1',
'x ^ (2 + 1) + x ^ 2 + 2xx + 3x + 1', 'x ^ (2 + 1) + x ^ 2 + 2x * x + 3x + 1',
'x ^ 3 + x ^ 2 + 2xx + 3x + 1', 'x ^ 3 + x ^ 2 + 2x * x + 3x + 1',
'x ^ 3 + x ^ 2 + 2x ^ (1 + 1) + 3x + 1', 'x ^ 3 + x ^ 2 + 2x ^ (1 + 1) + 3x + 1',
'x ^ 3 + x ^ 2 + 2x ^ 2 + 3x + 1', 'x ^ 3 + x ^ 2 + 2x ^ 2 + 3x + 1',
'x ^ 3 + (1 + 2)x ^ 2 + 3x + 1', 'x ^ 3 + (1 + 2)x ^ 2 + 3x + 1',
...@@ -69,12 +69,12 @@ class TestLeidenOefenopgave(TestCase): ...@@ -69,12 +69,12 @@ class TestLeidenOefenopgave(TestCase):
self.assertRewrite([ self.assertRewrite([
'(x + 1) ^ 2', '(x + 1) ^ 2',
'(x + 1)(x + 1)', '(x + 1)(x + 1)',
'xx + x * 1 + 1x + 1 * 1', 'x * x + x * 1 + 1x + 1 * 1',
'xx + x + 1x + 1 * 1', 'x * x + x + 1x + 1 * 1',
'xx + x + x + 1 * 1', 'x * x + x + x + 1 * 1',
'xx + x + x + 1', 'x * x + x + x + 1',
'xx + (1 + 1)x + 1', 'x * x + (1 + 1)x + 1',
'xx + 2x + 1', 'x * x + 2x + 1',
'x ^ (1 + 1) + 2x + 1', 'x ^ (1 + 1) + 2x + 1',
'x ^ 2 + 2x + 1', 'x ^ 2 + 2x + 1',
]) ])
...@@ -83,16 +83,16 @@ class TestLeidenOefenopgave(TestCase): ...@@ -83,16 +83,16 @@ class TestLeidenOefenopgave(TestCase):
self.assertRewrite([ self.assertRewrite([
'(x - 1) ^ 2', '(x - 1) ^ 2',
'(x - 1)(x - 1)', '(x - 1)(x - 1)',
'xx + x * -1 + (-1)x + (-1) * -1', 'x * x + x * -1 + (-1)x + (-1) * -1',
'xx + x * -1 + (-1)x - -1', 'x * x + x * -1 + (-1)x - -1',
'xx + x * -1 + (-1)x + 1', 'x * x + x * -1 + (-1)x + 1',
'xx - x * 1 + (-1)x + 1', 'x * x - x * 1 + (-1)x + 1',
'xx - x + (-1)x + 1', 'x * x - x + (-1)x + 1',
'xx - x - 1x + 1', 'x * x - x - 1x + 1',
'xx - x - x + 1', 'x * x - x - x + 1',
'xx + (1 + 1) * -x + 1', 'x * x + (1 + 1) * -x + 1',
'xx + 2 * -x + 1', 'x * x + 2 * -x + 1',
'xx - 2x + 1', 'x * x - 2x + 1',
'x ^ (1 + 1) - 2x + 1', 'x ^ (1 + 1) - 2x + 1',
'x ^ 2 - 2x + 1', 'x ^ 2 - 2x + 1',
]) ])
...@@ -134,8 +134,8 @@ class TestLeidenOefenopgave(TestCase): ...@@ -134,8 +134,8 @@ class TestLeidenOefenopgave(TestCase):
def test_1_5(self): def test_1_5(self):
self.assertRewrite([ self.assertRewrite([
'(2x + x)x', '(2x + x)x',
'(2 + 1)xx', '(2 + 1)x * x',
'3xx', '3x * x',
'3x ^ (1 + 1)', '3x ^ (1 + 1)',
'3x ^ 2', '3x ^ 2',
]) ])
...@@ -146,15 +146,15 @@ class TestLeidenOefenopgave(TestCase): ...@@ -146,15 +146,15 @@ class TestLeidenOefenopgave(TestCase):
'-(4x + 5)(5 - 4x)', '-(4x + 5)(5 - 4x)',
'-(4x * 5 + 4x * -4x + 5 * 5 + 5 * -4x)', '-(4x * 5 + 4x * -4x + 5 * 5 + 5 * -4x)',
'-(20x + 4x * -4x + 5 * 5 + 5 * -4x)', '-(20x + 4x * -4x + 5 * 5 + 5 * -4x)',
'-(20x + (-16)xx + 5 * 5 + 5 * -4x)', '-(20x + (-16)x * x + 5 * 5 + 5 * -4x)',
'-(20x + (-16)xx + 25 + 5 * -4x)', '-(20x + (-16)x * x + 25 + 5 * -4x)',
'-(20x + (-16)xx + 25 + (-20)x)', '-(20x + (-16)x * x + 25 + (-20)x)',
'-(20x - 16xx + 25 + (-20)x)', '-(20x - 16x * x + 25 + (-20)x)',
'-(20x - 16xx + 25 - 20x)', '-(20x - 16x * x + 25 - 20x)',
'-((1 - 1)20x - 16xx + 25)', '-((1 - 1)20x - 16x * x + 25)',
'-(0 * 20x - 16xx + 25)', '-(0 * 20x - 16x * x + 25)',
'-(0 - 16xx + 25)', '-(0 - 16x * x + 25)',
'-(-16xx + 25)', '-(-16x * x + 25)',
'-(-16x ^ (1 + 1) + 25)', '-(-16x ^ (1 + 1) + 25)',
'-(-16x ^ 2 + 25)', '-(-16x ^ 2 + 25)',
'--16x ^ 2 - 25', '--16x ^ 2 - 25',
......
...@@ -19,8 +19,8 @@ class TestLeidenOefenopgaveV12(TestCase): ...@@ -19,8 +19,8 @@ class TestLeidenOefenopgaveV12(TestCase):
def test_1_d(self): def test_1_d(self):
self.assertRewrite([ self.assertRewrite([
'(2x + x)x', '(2x + x)x',
'(2 + 1)xx', '(2 + 1)x * x',
'3xx', '3x * x',
'3x ^ (1 + 1)', '3x ^ (1 + 1)',
'3x ^ 2', '3x ^ 2',
]) ])
...@@ -32,20 +32,20 @@ class TestLeidenOefenopgaveV12(TestCase): ...@@ -32,20 +32,20 @@ class TestLeidenOefenopgaveV12(TestCase):
'-(2 * 6x + 2 * -4)(6x - 4)x', '-(2 * 6x + 2 * -4)(6x - 4)x',
'-(12x + 2 * -4)(6x - 4)x', '-(12x + 2 * -4)(6x - 4)x',
'-(12x - 8)(6x - 4)x', '-(12x - 8)(6x - 4)x',
'-(12x - 8)(6xx + (-4)x)', '-(12x - 8)(6x * x + (-4)x)',
'-(12x - 8)(6xx - 4x)', '-(12x - 8)(6x * x - 4x)',
'-(12x - 8)(6x ^ (1 + 1) - 4x)', '-(12x - 8)(6x ^ (1 + 1) - 4x)',
'-(12x - 8)(6x ^ 2 - 4x)', '-(12x - 8)(6x ^ 2 - 4x)',
'-(12x * 6x ^ 2 + 12x * -4x + (-8)6x ^ 2 + (-8) * -4x)', '-(12x * 6x ^ 2 + 12x * -4x + (-8)6x ^ 2 + (-8) * -4x)',
'-(72x x ^ 2 + 12x * -4x + (-8)6x ^ 2 + (-8) * -4x)', '-(72x * x ^ 2 + 12x * -4x + (-8)6x ^ 2 + (-8) * -4x)',
'-(72x x ^ 2 + (-48)xx + (-8)6x ^ 2 + (-8) * -4x)', '-(72x * x ^ 2 + (-48)x * x + (-8)6x ^ 2 + (-8) * -4x)',
'-(72x x ^ 2 + (-48)xx + (-48)x ^ 2 + (-8) * -4x)', '-(72x * x ^ 2 + (-48)x * x + (-48)x ^ 2 + (-8) * -4x)',
'-(72x x ^ 2 + (-48)xx + (-48)x ^ 2 + (--32)x)', '-(72x * x ^ 2 + (-48)x * x + (-48)x ^ 2 + (--32)x)',
'-(72x x ^ 2 + (-48)xx + (-48)x ^ 2 + 32x)', '-(72x * x ^ 2 + (-48)x * x + (-48)x ^ 2 + 32x)',
'-(72x x ^ 2 - 48xx + (-48)x ^ 2 + 32x)', '-(72x * x ^ 2 - 48x * x + (-48)x ^ 2 + 32x)',
'-(72x x ^ 2 - 48xx - 48x ^ 2 + 32x)', '-(72x * x ^ 2 - 48x * x - 48x ^ 2 + 32x)',
'-(72x ^ (1 + 2) - 48xx - 48x ^ 2 + 32x)', '-(72x ^ (1 + 2) - 48x * x - 48x ^ 2 + 32x)',
'-(72x ^ 3 - 48xx - 48x ^ 2 + 32x)', '-(72x ^ 3 - 48x * x - 48x ^ 2 + 32x)',
'-(72x ^ 3 - 48x ^ (1 + 1) - 48x ^ 2 + 32x)', '-(72x ^ 3 - 48x ^ (1 + 1) - 48x ^ 2 + 32x)',
'-(72x ^ 3 - 48x ^ 2 - 48x ^ 2 + 32x)', '-(72x ^ 3 - 48x ^ 2 - 48x ^ 2 + 32x)',
'-(72x ^ 3 + (1 + 1) * -48x ^ 2 + 32x)', '-(72x ^ 3 + (1 + 1) * -48x ^ 2 + 32x)',
......
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