(a) To achieve the tax objectives of the settlor, the court may modify the terms of a trust in a manner that is not contrary to the probable intention of the settlor.
(b) The court may provide that the modification described in subsection (a) of this section has retroactive effect.