|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| package org.sat4j.minisat.constraints; |
|
8 |
| |
|
9 |
| import org.sat4j.minisat.constraints.card.MinWatchCard; |
|
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 CardinalityDataStructureYanMin extends |
|
20 |
| AbstractCardinalityDataStructure { |
|
21 |
| |
|
22 |
| private static final long serialVersionUID = 1L; |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
249266
| public Constr createClause(IVecInt literals) throws ContradictionException {
|
|
30 |
249266
| return MinWatchCard.minWatchCardNew(solver, getVocabulary(), literals,
|
|
31 |
| MinWatchCard.ATLEAST, 1); |
|
32 |
| } |
|
33 |
| |
|
34 |
5979612
| public Constr createUnregisteredClause(IVecInt literals) {
|
|
35 |
5979612
| return new WLClause(literals, getVocabulary());
|
|
36 |
| } |
|
37 |
| |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
0
| @Override
|
|
45 |
| public Constr createCardinalityConstraint(IVecInt literals, int degree) |
|
46 |
| throws ContradictionException { |
|
47 |
0
| return MinWatchCard.minWatchCardNew(solver, getVocabulary(), literals,
|
|
48 |
| MinWatchCard.ATLEAST, degree); |
|
49 |
| } |
|
50 |
| } |