private void inlineIncluded() {
        // Re-add our own conditions last to - added later overrides
        Map<String, NamedCondition> thisConditions = namedConditions;
        namedConditions = new LinkedHashMap<>();

        Set<RuleBase> included = new HashSet<>();
        included.add(this);
        for (ListIterator<ProductionRule> i = productionRules.listIterator(); i.hasNext(); ) {
            ProductionRule rule = i.next();
            if ( ! (rule instanceof IncludeDirective) ) continue;

            i.remove();
            RuleBase toInclude = ((IncludeDirective)rule).getIncludedBase();
            if ( ! included.contains(toInclude))
                toInclude.inlineIn(this, i, included);
        }

        namedConditions.putAll(thisConditions);
    }
Rules are order based - they are included recursively depth first
container-search/src/main/java/com/yahoo/prelude/semantics/RuleBase.java