Commit 62ba46ce authored by Sander Mathijs van Veen's avatar Sander Mathijs van Veen

Merge branch 'negated' of kompiler.org:trs into negated

parents ff77c565 c050ce57
...@@ -3,20 +3,32 @@ from tests.rulestestcase import RulesTestCase as TestCase, rewrite ...@@ -3,20 +3,32 @@ from tests.rulestestcase import RulesTestCase as TestCase, rewrite
class TestLeidenOefenopgaveV12(TestCase): class TestLeidenOefenopgaveV12(TestCase):
def test_1_e(self): def test_1_e(self):
return self.assertRewrite([
for chain in [['-2(6x - 4) ^ 2 * x', '-2(6x - 4) ^ 2 * x',
'-2(6x - 4)(6x - 4)x', '-2(6x - 4)(6x - 4)x',
'(-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)(6x - 4)x', '(-12x + 8)(6x - 4)x',
'(-12x * 6x - 12x * -4 + 8 * 6x + 8 * -4)x', '(-12x * 6x - 12x * -4 + 8 * 6x + 8 * -4)x',
'(-72xx - 12x * -4 + 8 * 6x + 8 * -4)x', '(-72xx - 12x * -4 + 8 * 6x + 8 * -4)x',
'(-72 * x ^ (1 + 1) - 12x * -4 + 8 * 6x + 8 * -4)x', '(-72 * x ^ (1 + 1) - 12x * -4 + 8 * 6x + 8 * -4)x',
'(-72 * x ^ 2 - 12x * -4 + 8 * 6x + 8 * -4)x', '(-72 * x ^ 2 - 12x * -4 + 8 * 6x + 8 * -4)x',
'(-72 * x ^ 2 - -48x + 8 * 6x + 8 * -4)x', '(-72 * x ^ 2 - -48x + 8 * 6x + 8 * -4)x',
'(-72 * x ^ 2 - -48x + 48x + 8 * -4)x', '(-72 * x ^ 2 + 48x + 8 * 6x + 8 * -4)x',
'', '(-72 * x ^ 2 + 48x + 48x + 8 * -4)x',
''] '(-72 * x ^ 2 + (1 + 1) * 48x + 8 * -4)x',
]: '(-72 * x ^ 2 + 2 * 48x + 8 * -4)x',
self.assertRewrite(chain) '(-72 * x ^ 2 + 96x + 8 * -4)x',
'(-72 * x ^ 2 + 96x - 32)x',
'x(-72 * x ^ 2 + 96x) + x * -32',
'x * -72 * x ^ 2 + x * 96x + x * -32',
'-x * 72 * x ^ 2 + x * 96x + x * -32',
'-x * 72 * x ^ 2 + x ^ (1 + 1) * 96 + x * -32',
'-x * 72 * x ^ 2 + x ^ 2 * 96 + x * -32',
'-x * 72 * x ^ 2 + x ^ 2 * 96 - x * 32'])
# FIXME: '-x ^ (1 + 2) * 72 + x ^ 2 * 96 - x * 32',
# FIXME: '-x ^ 3 * 72 + x ^ 2 * 96 - x * 32',
# FIXME: '-72x ^ 3 + x ^ 2 * 96 - x * 32',
# FIXME: '-72x ^ 3 + 96x ^ 2 - x * 32',
# FIXME: '-72x ^ 3 + 96x ^ 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