|
1 |
| package org.sat4j.minisat.constraints.pb; |
|
2 |
| |
|
3 |
| import java.math.BigInteger; |
|
4 |
| |
|
5 |
| import org.sat4j.minisat.core.ILits; |
|
6 |
| |
|
7 |
| public class ConflictArrayCard extends ConflictArray { |
|
8 |
| |
|
9 |
25264
| public ConflictArrayCard(int[] lits, BigInteger[] coefs, BigInteger d,
|
|
10 |
| ILits voc) { |
|
11 |
25264
| super(lits, coefs, d, voc);
|
|
12 |
| |
|
13 |
| } |
|
14 |
| |
|
15 |
25264
| public static IConflict createConflict(PBConstr cpb) {
|
|
16 |
25264
| return new ConflictArrayCard(cpb.getLits(), cpb.getCoefs(), cpb
|
|
17 |
| .getDegree(), cpb.getVocabulary()); |
|
18 |
| } |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
0
| protected BigInteger reduceUntilConflict(int litImplied, int ind,
|
|
32 |
| BigInteger[] reducedCoefs, WatchPb wpb) { |
|
33 |
0
| BigInteger atleast = BigInteger.ZERO;
|
|
34 |
0
| for (int i = 0; i < reducedCoefs.length; i++) {
|
|
35 |
0
| if (!wpb.getVocabulary().isFalsified(wpb.get(i)))
|
|
36 |
0
| atleast = atleast.add(BigInteger.ONE);
|
|
37 |
0
| reducedCoefs[i] = BigInteger.ONE;
|
|
38 |
| } |
|
39 |
0
| coefMultCons = coefs[litImplied ^ 1];
|
|
40 |
0
| coefMult = BigInteger.ONE;
|
|
41 |
0
| return atleast;
|
|
42 |
| } |
|
43 |
| |
|
44 |
| } |