|
1 |
| package org.sat4j.minisat.constraints; |
|
2 |
| |
|
3 |
| import java.math.BigInteger; |
|
4 |
| |
|
5 |
| import org.sat4j.minisat.constraints.pb.IDataStructurePB; |
|
6 |
| import org.sat4j.minisat.constraints.pb.MinWatchCardPB; |
|
7 |
| import org.sat4j.minisat.constraints.pb.PBConstr; |
|
8 |
| import org.sat4j.minisat.constraints.pb.PuebloMinWatchPb; |
|
9 |
| import org.sat4j.minisat.constraints.pb.WLClausePB; |
|
10 |
| import org.sat4j.specs.ContradictionException; |
|
11 |
| import org.sat4j.specs.IVec; |
|
12 |
| import org.sat4j.specs.IVecInt; |
|
13 |
| |
|
14 |
| public class PuebloPBMinClauseCardConstrDataStructure extends |
|
15 |
| AbstractPBClauseCardConstrDataStructure { |
|
16 |
| |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| private static final long serialVersionUID = 1L; |
|
21 |
| |
|
22 |
369775
| protected PBConstr constructClause(IVecInt v) {
|
|
23 |
369775
| return WLClausePB.brandNewClause(solver, getVocabulary(), v);
|
|
24 |
| } |
|
25 |
| |
|
26 |
18412
| protected PBConstr constructCard(IVecInt lits, int degree)
|
|
27 |
| throws ContradictionException { |
|
28 |
18412
| return MinWatchCardPB.normalizedMinWatchCardPBNew(solver,
|
|
29 |
| getVocabulary(), lits, degree); |
|
30 |
| } |
|
31 |
| |
|
32 |
123264
| protected PBConstr constructPB(IDataStructurePB mpb)
|
|
33 |
| throws ContradictionException { |
|
34 |
123264
| return PuebloMinWatchPb.normalizedMinWatchPbNew(solver,
|
|
35 |
| getVocabulary(), mpb); |
|
36 |
| } |
|
37 |
| |
|
38 |
228300
| protected PBConstr constructLearntClause(IVecInt literals) {
|
|
39 |
228300
| return new WLClausePB(literals, getVocabulary());
|
|
40 |
| } |
|
41 |
| |
|
42 |
2544
| protected PBConstr constructLearntCard(IVecInt literals, int degree) {
|
|
43 |
2544
| return new MinWatchCardPB(getVocabulary(), literals, true, degree);
|
|
44 |
| } |
|
45 |
| |
|
46 |
4366
| protected PBConstr constructLearntPB(IVecInt literals,
|
|
47 |
| IVec<BigInteger> coefs, BigInteger degree) { |
|
48 |
4366
| return PuebloMinWatchPb.watchPbNew(getVocabulary(), literals, coefs,
|
|
49 |
| true, degree); |
|
50 |
| } |
|
51 |
| |
|
52 |
| } |