public static void incrementallyLinkTaxonomyNodes(TaxonomyGraph graph, TaxonomyNode parent, TaxonomyNode child) {
    if (parent.children.membP(child)) {
      return;
    }
    TaxonomyGraph.createTaxonomyLink(graph, parent, child);
    { Interval interval = null;
      boolean parentexistsP = parent.initialInterval != null;
      boolean childexistsP = child.initialInterval != null;

      if (childexistsP) {
        if (!parentexistsP) {
          interval = TaxonomyGraph.createNextPostorderInterval(graph);
          parent.initialInterval = interval;
          parent.label = interval.upperBound;
          TaxonomyNode.addTaxonomyNodeInterval(parent, interval);
        }
        { Interval interval000 = null;
          Cons iter000 = child.intervals;

          for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
            interval000 = ((Interval)(iter000.value));
            TaxonomyNode.propagateForeignInterval(parent, interval000);
          }
        }
      }
      else {
        if (!parentexistsP) {
          interval = TaxonomyGraph.createNextPostorderInterval(graph);
          parent.initialInterval = interval;
          parent.label = interval.upperBound;
          TaxonomyNode.addTaxonomyNodeInterval(parent, interval);
        }
        interval = TaxonomyNode.allocateIntervalForNewLeafNode(parent);
        if (interval == null) {
          if (graph.renumberIfOutOfNumbersP) {
            TaxonomyGraph.finalizeTaxonomyGraphNonincrementally(graph);
            return;
          }
          interval = TaxonomyGraph.createNextPostorderInterval(graph);
        }
        child.initialInterval = interval;
        child.label = interval.upperBound;
        TaxonomyNode.addTaxonomyNodeInterval(child, interval);
        parent.treeChildren = parent.treeChildren.concatenate(Cons.cons(child, Stella.NIL), Stella.NIL);
        TaxonomyNode.propagateForeignInterval(parent, interval);
      }
    }
  }