static void ReplaceLevel3() {
Expression<Func<int, int>> Formula = (n) => (n * 2 + 1) * 4;

// nhrada hodnoty 1 za 3
// vede k vrazu 
// (n * 2 + 3) * 4
Expression top = Formula.Body;
ConstantExpression newConstantSum = Expression.Constant(3);
Expression newSum = Expression.MakeBinary(
top.Left().NodeType,
top.Left().Left(),
newConstantSum );
Expression newTree = Expression.MakeBinary(
top.NodeType,
newSum,
top.Right() );
Console.WriteLine("Pvodn strom: {0}", top.ToString());
Console.WriteLine("Upraven strom: {0}", newTree.ToString());
}
