}
public static RTLStatement substituteStatement(RTLStatement stmt, SubstitutionState s) {
Context substCtx = new Context();
for (RTLVariable v : stmt.getUsedVariables()) {
SubstitutionElement el = s.getValue(v);
if (!el.isTop()) {
substCtx.addAssignment(v, el.getExpression());
}
}
if (!substCtx.getAssignments().isEmpty()) {
//logger.info("Old stmt: " + stmt);
RTLStatement newStmt = stmt.copy().evaluate(substCtx);