boolean satisfied = ((TruthValue) evaluated).toBoolean();
System.out.printf(" check: %s at %s = %s: %s%n",
this, x.name(), expr, satisfied);
if (!satisfied) {
Equality eq = new Equality(lhs.evaluate(), rhs.evaluate());
ExpressionContext.getInstance().addStatement(
new Statement(Command.Expression, eq));
}
return satisfied;
} else {
Equality eq = (Equality) evaluated;
throw new IllegalStateException(String.format(
"Cannot check equality: %s = %s (%s %s), %s = %s ",
eq.lhs(), eq.rhs(), eq.lhs().getClass().getSimpleName(), eq.rhs().getClass().getSimpleName(), x.name(), expr));
}
} finally {
x.reset();
}
}