sclass FailedRule > RuleWithParams { L satisfiedConditions; Exp remainingCondition; *() {} *(IfThen *rule, VarMatches *matches, Exp *remainingCondition) {} *(IfThen *rule, VarMatches *matches, L *satisfiedConditions, Exp *remainingCondition) {} } srecord RuleWithParams(IfThen rule, VarMatches matches) { S ruleID() { ret rule.globalID; } } srecord IfThen(Exp in, Exp out) { S globalID; Set options; S originalText; S text() { Collection opt = options; if (nempty(globalID)) opt = concatLists(ll("id: " + globalID), opt); ret (nempty(opt) ? "[" + joinWithComma(opt) + "] " : "") + (in == null ? "" : in.text() + "\n => ") + nlLogic_text(out); } toString { ret text(); } } abstract sclass Exp { abstract S text(); toString { ret text(); } } static noToString record Func(S name, Exp arg) extends Exp { LS options; *(S *name, LS *options, Exp *arg) {} S text() { ret name + (empty(options) ? "" : "[" + joinWithComma(options) + "]") + "(" + arg.text() + ")"; } S argText() { ret nlLogic_text(arg); } } static noToString record And(Exp a, Exp b) extends Exp { S text() { ret a.text() + "\n && " + b.text(); } } static noToString record ExpNot(Exp a) extends Exp { S text() { ret "!" + a.text(); } } abstract sclass Literal extends Exp {} static noToString record Sentence(L tok) extends Literal { S text() { ret join(tok); } } static noToString record Sentence2(S text) extends Literal { S text() { ret text; } } static noToString record Eq(Exp left, Exp right) extends Exp { S text() { ret left.text() + " = " + right.text(); } }