static F1 ai_executedRuleScorer() { ret func(ExecutedRule r) -> Int { int n = r.failureLevel(); if (n == 0) ret nempty(r.output) ? 0 : nempty(r.facts) ? 1 : 2; else ret n < 0 ? 10 : Int.MAX_VALUE-n; }; }