static Runnable dm_ai_ruleToRunnable(S s) { L l = tok_splitAtComma(s); if (l(l) != 2) null; fS cmd = second(l); new Matches m; if (!swic_trim(first(l), "whenever ", m)) null; final F0 cond = dm_ai_conditionToPredicate1(m.rest()); if (cond == null) null; ret r { if (isTrue(callF(cond))) dm_processCommand1(cmd); }; }