1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| package org.sat4j.minisat.constraints; |
8 |
| |
9 |
| import org.sat4j.minisat.constraints.card.AtLeast; |
10 |
| import org.sat4j.minisat.constraints.cnf.WLClause; |
11 |
| import org.sat4j.minisat.core.Constr; |
12 |
| import org.sat4j.specs.ContradictionException; |
13 |
| import org.sat4j.specs.IVecInt; |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| |
19 |
| public class CardinalityDataStructure extends AbstractCardinalityDataStructure { |
20 |
| |
21 |
| private static final long serialVersionUID = 1L; |
22 |
| |
23 |
9478532
| public Constr createUnregisteredClause(IVecInt literals) {
|
24 |
9478532
| return new WLClause(literals, getVocabulary());
|
25 |
| } |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
249681
| public Constr createClause(IVecInt literals) throws ContradictionException {
|
33 |
249681
| return AtLeast.atLeastNew(solver, getVocabulary(), literals, 1);
|
34 |
| } |
35 |
| |
36 |
| |
37 |
| |
38 |
| |
39 |
| |
40 |
| |
41 |
| |
42 |
0
| @Override
|
43 |
| public Constr createCardinalityConstraint(IVecInt literals, int degree) |
44 |
| throws ContradictionException { |
45 |
0
| return AtLeast.atLeastNew(solver, getVocabulary(), literals, degree);
|
46 |
| } |
47 |
| |
48 |
| } |