public function testArrMul2()
 {
     $renderer = RenderStringVisitor::init();
     $simplfier = SimplifyVisitor::init();
     $am = new ArrayMultiplicationNode(new ConstantNode(3), new VariableNode('x'), new ConstantNode(5));
     $this->assertEquals('3 * x * 5', $renderer->visit($am));
     $this->assertEquals('15 * x', $renderer->visit($simplfier->visit($am)));
 }
 public function testTreeRender2()
 {
     $deriver = new DerivationVisitor('x');
     $simplfier = SimplifyVisitor::init();
     $renderer = RenderStringVisitor::init();
     $f = Tree::add(Tree::mult(3, 'x'), Tree::mult(2, 'x'), 3)->pow(2);
     $this->assertEquals("(3 * x + 2 * x + 3) ^ 2", $renderer->visit($f));
     $this->assertEquals('10 * (3 * x + 2 * x + 3)', $renderer->visit($simplfier->visit($deriver->visit($f))));
     $this->assertEquals(50, $renderer->visit($simplfier->visit($deriver->visit($deriver->visit($f)))));
 }