Stream<Node> query(Term goal) async* { final candidates = rules[goal.name]; if (candidates != null) { for (final rule in candidates) { yield* rule.query(this, goal); } } }