code: private void validateNode() throws InvalidQueryNodeException {
          ImmutableSet<Variable> substitutionDomain = substitution.getDomain();
  
          // The substitution domain must be a subset of the projectedVariables
          if (!projectedVariables.containsAll(substitutionDomain)) {
              throw new InvalidQueryNodeException("ConstructionNode: all the domain variables " +
                      "of the substitution must be projected.\n" + toString());
          }
  
          // The variables contained in the domain and in the range of the substitution must be disjoint
          if (substitutionDomain.stream()
                  .anyMatch(childVariables::contains)) {
              throw new InvalidQueryNodeException("ConstructionNode: variables defined by the substitution cannot " +
                      "be used for defining other variables.\n" + toString());
          }
  
          // Substitution to non-projected variables is incorrect
          if (substitution.getImmutableMap().values().stream()
                  .filter(v -> v instanceof Variable)
                  .map(v -> (Variable) v)
                  .anyMatch(v -> !projectedVariables.contains(v))) {
              throw new InvalidQueryNodeException(
                      "ConstructionNode: substituting a variable " +
                              "by a non-projected variable is incorrect.\n"
                  + toString());
          }
      }
docs: Validates the node independently of its child