Expression evaluated;
NaturalNumber five = N.create(5);
NaturalNumber two = N.create(2);
Addition seven = new Addition(five, two);
NaturalNumber six = N.create("6");
Expression naturalExpr = new Multiplication(six, seven);
evaluated = naturalExpr.evaluate();
System.out.printf("%s = %s%n", naturalExpr, evaluated);
assertEquals(evaluated, N.create(42));
Expression equality = new Equality(naturalExpr, N.create(42));
evaluated = equality.evaluate();
System.out.printf("%s : %s%n", equality, evaluated);
assertEquals(evaluated, TruthValue.True);
Expression elementOf = new ElementOf(naturalExpr, N);
evaluated = elementOf.evaluate();
System.out.printf("%s : %s%n", elementOf, evaluated);
assertEquals(evaluated, TruthValue.True);
elementOf = new ElementOf(six, N);
evaluated = elementOf.evaluate();
System.out.printf("%s : %s%n", elementOf, evaluated);
assertEquals(evaluated, TruthValue.True);
Expression sqrt = new Sqrt(N.create(45));
evaluated = sqrt.evaluate();
System.out.printf("%s = %s%n", sqrt, evaluated);
assertEquals(evaluated, new Multiplication(N.create(3), new Sqrt(N.create(5))));
}