Added cost(Effect) function in Rewriter.
cost(Effect) function calculates the overall metric after replacement. A greater returned value is a better result of the replacement.
cost(Effect) function calculates the overall metric after replacement. A greater returned value is a better result of the replacement.