public void treeSubstitute(Object oldObject, Object newObject) {
    List<ArgPosition> locs = getArgPositionsForTerm(oldObject);
    for (ArgPosition loc : locs) {
      setSpecifiedObject(loc, newObject);
    }
  }