1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.sat4j.minisat.constraints;
26
27 import java.math.BigInteger;
28
29 import org.sat4j.minisat.constraints.pb.IDataStructurePB;
30 import org.sat4j.minisat.constraints.pb.MaxWatchPb;
31 import org.sat4j.minisat.constraints.pb.PBConstr;
32 import org.sat4j.specs.ContradictionException;
33 import org.sat4j.specs.IVec;
34 import org.sat4j.specs.IVecInt;
35
36 public class PBMaxClauseCardConstrDataStructure extends
37 PuebloPBMinClauseCardConstrDataStructure {
38
39
40
41
42 private static final long serialVersionUID = 1L;
43
44 @Override
45 protected PBConstr constructPB(IDataStructurePB mpb)
46 throws ContradictionException {
47 return MaxWatchPb.normalizedMaxWatchPbNew(solver, getVocabulary(), mpb);
48 }
49
50 @Override
51 protected PBConstr constructPB(int[] lits, BigInteger[] coefs, BigInteger degree)
52 throws ContradictionException {
53 return MaxWatchPb.normalizedMaxWatchPbNew(solver, getVocabulary(), lits, coefs, degree);
54 }
55
56 @Override
57 protected PBConstr constructLearntPB(IVecInt literals,
58 IVec<BigInteger> coefs, BigInteger degree) {
59 return MaxWatchPb.watchPbNew(getVocabulary(), literals, coefs, true,
60 degree);
61 }
62
63 }