code: private boolean isRemovable(ExtensionalDataNode node, ImmutableSet<Integer> independentIndexes,
                                  ImmutableSet<Variable> requiredAndCooccuringVariables) {
          ImmutableList<? extends VariableOrGroundTerm> arguments = node.getProjectionAtom().getArguments();
  
          return independentIndexes.stream()
                  .map(i -> arguments.get(i - 1))
                  .allMatch(t -> (t instanceof Variable) && (!requiredAndCooccuringVariables.contains(t)));
      }
docs: TODO: explain