private boolean producesItself() {
        return production.productionList()
                         .stream()
                         .anyMatch(p -> (p instanceof ReferenceTermProduction) && ((ReferenceTermProduction)p).producesAll());
    }
Returns true if it is known that this rule matches its own output.
If it does, it will only be evaluated once, to avoid infinite loops.
This default implementation returns false;
container-search/src/main/java/com/yahoo/prelude/semantics/rule/ProductionRule.java