code: private Backbone buildBackbone(final Collection<Variable> variables) {
          final SortedSet<Variable> posBackboneVars = isBothOrPositiveType() ? new TreeSet<Variable>() : null;
          final SortedSet<Variable> negBackboneVars = isBothOrNegativeType() ? new TreeSet<Variable>() : null;
          final SortedSet<Variable> optionalVars = isBothType() ? new TreeSet<Variable>() : null;
          for (final Variable var : variables) {
              final Integer idx = this.name2idx.get(var.name());
              if (idx == null) {
                  if (isBothType()) {
                      optionalVars.add(var);
                  }
              } else {
                  switch (this.backboneMap.get(idx)) {
                      case TRUE:
                          if (isBothOrPositiveType()) {
                              posBackboneVars.add(var);
                          }
                          break;
                      case FALSE:
                          if (isBothOrNegativeType()) {
                              negBackboneVars.add(var);
                          }
                          break;
                      case UNDEF:
                          if (isBothType()) {
                              optionalVars.add(var);
                          }
                          break;
                      default:
                          throw new IllegalStateException("Unknown tristate: " + this.backboneMap.get(idx));
                  }
              }
          }
          return new Backbone(posBackboneVars, negBackboneVars, optionalVars);
      }
docs: Builds the backbone object from the computed backbone literals.
  @param variables relevant variables
  @return backbone