Exemplo n.º 1
0
 public void TreeHasCorrectStringForm()
 {
     var tree = new Arithmetic.Product<int>(VariableNode.Make<int>(0, "x"),
                                            new Arithmetic.Plus<int>(VariableNode.Make<int>(1, "y"),
                                                                     Constant.Int(3)));
     Assert.AreEqual(tree.ToString(), "(x ∙ (y + 3))");
 }
Exemplo n.º 2
0
 public void TreeHasCorrectStringForm()
 {
     var tree = new Arithmetic.Product<int>(VariableNode.Make<int>(0, "x"),
                                            new Arithmetic.Plus<int>(VariableNode.Make<int>(1, "y"),
                                                                     Constant.Int(3)));
     Assert.AreEqual(tree.ToString(), "(x ∙ (y + 3))");
     var tree2 = new Logic.MultipleOr(new PredicateNode("P", VariableNode.Make<int>(0, "x")),
                                         new PredicateNode("Q", VariableNode.Make<int>(1, "y"), VariableNode.Make<int>(2, "z")),
                                         new PredicateNode("H", new FunctionNode("f", VariableNode.Make<int>(0, "x")), new FunctionNode("c")));
     Assert.AreEqual(tree2.ToString(), "P(x) V Q(y,z) V H(f(x),c)");
 }