private Assignment createAssignment(final int modelBDD) {
    if (modelBDD == BDDKernel.BDD_FALSE)
      return null;
    if (modelBDD == BDDKernel.BDD_TRUE)
      return new Assignment();
    final List<int[]> nodes = this.kernel.allNodes(modelBDD);
    final Assignment assignment = new Assignment();
    for (final int[] node : nodes) {
      final Variable variable = this.idx2var.get(node[1]);
      if (node[2] == BDDKernel.BDD_FALSE)
        assignment.addLiteral(variable);
      else if (node[3] == BDDKernel.BDD_FALSE)
        assignment.addLiteral(variable.negate());
      else
        throw new IllegalStateException("Expected that the model BDD has one unique path through the BDD.");
    }
    return assignment;
  }
private Assignment createAssignment ( final int modelBDD ) { if ( modelBDD == BDDKernel . BDD_FALSE ) return null ; if ( modelBDD == BDDKernel . BDD_TRUE ) return new Assignment ( ) ; final List < int [ ] > nodes = this . kernel . allNodes ( modelBDD ) ; final Assignment assignment = new Assignment ( ) ; for ( final int [ ] node : nodes ) { final Variable variable = this . idx2var . get ( node [ 1 ] ) ; if ( node [ 2 ] == BDDKernel . BDD_FALSE ) assignment . addLiteral ( variable ) ; else if ( node [ 3 ] == BDDKernel . BDD_FALSE ) assignment . addLiteral ( variable . negate ( ) ) ; else throw new IllegalStateException ( "Expected that the model BDD has one unique path through the BDD." ) ; } return assignment ; }
Creates an assignment from a BDD.
@param modelBDD the BDD
@return the assignment
@throws IllegalStateException if the BDD does not represent a unique model