static Exp nlLogic_transformShallow(Exp e, F1 f) { if (e == null) null; if (e cast And) ret And(callF(f, e.a), callF(f, e.b)); if (e cast ExpNot) ret ExpNot(callF(f, e.a)); ret callF(f, e); } static Exp nlLogic_transformShallow(IfThen rule, F1 f) { if (rule == null) null; rule = shallowClone(rule); rule.in = nlLogic_transformShallow(rule.in, f); rule.out = nlLogic_transformShallow(rule.out, f); ret out; }