public MathExpression Resolve(string variable)
{
MathExpression expression = this.ResolveSafe(variable);
if (expression == null)
{
string message = string.Format("The variable '{0}' has not been defined.", variable);
throw new MathExpressionException(message);
}
return expression;
}