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
26
27
28
29
30
31 package org.sat4j.pb.constraints;
32
33 import java.io.FileNotFoundException;
34 import java.io.IOException;
35
36 import org.sat4j.minisat.AbstractAcceptanceTestCase;
37 import org.sat4j.reader.ParseFormatException;
38 import org.sat4j.specs.ISolver;
39
40
41
42
43
44
45
46 public abstract class AbstractPigeonHoleWithCardinalityTest<T extends ISolver>
47 extends AbstractAcceptanceTestCase<T> {
48
49 protected static final String PREFIX = System.getProperty("test.pbprefix");
50
51
52
53
54
55
56
57 public AbstractPigeonHoleWithCardinalityTest(String arg) {
58 super(arg);
59 }
60
61 public void testPN34() throws FileNotFoundException, IOException,
62 ParseFormatException {
63 assertTrue(solveInstance(PREFIX + "pigeons/PN-3-4.opb"));
64 }
65
66 public void testPN4() throws FileNotFoundException, IOException,
67 ParseFormatException {
68 assertFalse(solveInstance(PREFIX + "pigeons/PN-4-3.opb"));
69 }
70
71 public void testPN45() throws FileNotFoundException, IOException,
72 ParseFormatException {
73 assertTrue(solveInstance(PREFIX + "pigeons/PN-4-5.opb"));
74 }
75
76 public void testPN5() throws FileNotFoundException, IOException,
77 ParseFormatException {
78 assertFalse(solveInstance(PREFIX + "pigeons/PN-5-4.opb"));
79 }
80
81 public void testPN56() throws FileNotFoundException, IOException,
82 ParseFormatException {
83 assertTrue(solveInstance(PREFIX + "pigeons/PN-5-6.opb"));
84 }
85
86 public void testPN6() throws FileNotFoundException, IOException,
87 ParseFormatException {
88 assertFalse(solveInstance(PREFIX + "pigeons/PN-6-5.opb"));
89 }
90
91 public void testPN67() throws FileNotFoundException, IOException,
92 ParseFormatException {
93 assertTrue(solveInstance(PREFIX + "pigeons/PN-6-7.opb"));
94 }
95
96 public void testPN7() throws FileNotFoundException, IOException,
97 ParseFormatException {
98 assertFalse(solveInstance(PREFIX + "pigeons/PN-7-6.opb"));
99 }
100
101 public void testPN78() throws FileNotFoundException, IOException,
102 ParseFormatException {
103 assertTrue(solveInstance(PREFIX + "pigeons/PN-7-8.opb"));
104 }
105
106 public void testPN8() throws FileNotFoundException, IOException,
107 ParseFormatException {
108 assertFalse(solveInstance(PREFIX + "pigeons/PN-8-7.opb"));
109 }
110
111 public void testPN89() throws FileNotFoundException, IOException,
112 ParseFormatException {
113 assertTrue(solveInstance(PREFIX + "pigeons/PN-8-9.opb"));
114 }
115
116 public void testPN9() throws FileNotFoundException, IOException,
117 ParseFormatException {
118 assertFalse(solveInstance(PREFIX + "pigeons/PN-9-8.opb"));
119 }
120
121 public void testPN910() throws FileNotFoundException, IOException,
122 ParseFormatException {
123 assertTrue(solveInstance(PREFIX + "pigeons/PN-9-10.opb"));
124 }
125 }