View Javadoc

1   /*******************************************************************************
2   * SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
3   *
4   * All rights reserved. This program and the accompanying materials
5   * are made available under the terms of the Eclipse Public License v1.0
6   * which accompanies this distribution, and is available at
7   * http://www.eclipse.org/legal/epl-v10.html
8   *
9   * Alternatively, the contents of this file may be used under the terms of
10  * either the GNU Lesser General Public License Version 2.1 or later (the
11  * "LGPL"), in which case the provisions of the LGPL are applicable instead
12  * of those above. If you wish to allow use of your version of this file only
13  * under the terms of the LGPL, and not to allow others to use your version of
14  * this file under the terms of the EPL, indicate your decision by deleting
15  * the provisions above and replace them with the notice and other provisions
16  * required by the LGPL. If you do not delete the provisions above, a recipient
17  * may use your version of this file under the terms of the EPL or the LGPL.
18  * 
19  * Based on the pseudo boolean algorithms described in:
20  * A fast pseudo-Boolean constraint solver Chai, D.; Kuehlmann, A.
21  * Computer-Aided Design of Integrated Circuits and Systems, IEEE Transactions on
22  * Volume 24, Issue 3, March 2005 Page(s): 305 - 317
23  * 
24  * and 
25  * Heidi E. Dixon, 2004. Automating Pseudo-Boolean Inference within a DPLL 
26  * Framework. Ph.D. Dissertation, University of Oregon.
27  *******************************************************************************/
28  
29  package org.sat4j.pb.constraints;
30  
31  import java.io.FileNotFoundException;
32  import java.io.IOException;
33  
34  import org.sat4j.reader.ParseFormatException;
35  
36  /**
37   * @author leberre
38   * 
39   *         Those pseudo boolean problems were kindly provided by Niklas Een.
40   * 
41   */
42  public abstract class AbstractPseudoBooleanAndPigeonHoleTest extends
43  		AbstractEZPseudoBooleanAndPigeonHoleTest {
44  
45  	protected static final String PREFIX = System.getProperty("test.pbprefix");
46  
47  	public AbstractPseudoBooleanAndPigeonHoleTest(String arg) {
48  		super(arg);
49  	}
50  
51  	public void testaloul1011() throws FileNotFoundException, IOException,
52  			ParseFormatException {
53  		assertFalse(solveInstance(PREFIX
54  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl10_11_pb.cnf.cr.opb"));
55  	}
56  
57  	public void testaloul1015() throws FileNotFoundException, IOException,
58  			ParseFormatException {
59  		assertFalse(solveInstance(PREFIX
60  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl10_15_pb.cnf.cr.opb"));
61  	}
62  
63  	public void testaloul1020() throws FileNotFoundException, IOException,
64  			ParseFormatException {
65  		assertFalse(solveInstance(PREFIX
66  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl10_20_pb.cnf.cr.opb"));
67  	}
68  
69  	public void testaloul1516() throws FileNotFoundException, IOException,
70  			ParseFormatException {
71  		assertFalse(solveInstance(PREFIX
72  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl15_16_pb.cnf.cr.opb"));
73  	}
74  
75  	public void testaloul1520() throws FileNotFoundException, IOException,
76  			ParseFormatException {
77  		assertFalse(solveInstance(PREFIX
78  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl15_20_pb.cnf.cr.opb"));
79  	}
80  
81  	public void testaloul1525() throws FileNotFoundException, IOException,
82  			ParseFormatException {
83  		assertFalse(solveInstance(PREFIX
84  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl15_25_pb.cnf.cr.opb"));
85  	}
86  
87  	public void testaloul2021() throws FileNotFoundException, IOException,
88  			ParseFormatException {
89  		assertFalse(solveInstance(PREFIX
90  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl20_21_pb.cnf.cr.opb"));
91  	}
92  
93  	public void testaloul2025() throws FileNotFoundException, IOException,
94  			ParseFormatException {
95  		assertFalse(solveInstance(PREFIX
96  				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl20_25_pb.cnf.cr.opb"));
97  	}
98  
99  	public void testaloul2030() throws FileNotFoundException, IOException,
100 			ParseFormatException {
101 		assertFalse(solveInstance(PREFIX
102 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl20_30_pb.cnf.cr.opb"));
103 	}
104 
105 	public void testaloul3031() throws FileNotFoundException, IOException,
106 			ParseFormatException {
107 		assertFalse(solveInstance(PREFIX
108 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl30_31_pb.cnf.cr.opb"));
109 	}
110 
111 	public void testaloul3035() throws FileNotFoundException, IOException,
112 			ParseFormatException {
113 		assertFalse(solveInstance(PREFIX
114 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl30_35_pb.cnf.cr.opb"));
115 	}
116 
117 	public void testaloul3040() throws FileNotFoundException, IOException,
118 			ParseFormatException {
119 		assertFalse(solveInstance(PREFIX
120 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl30_40_pb.cnf.cr.opb"));
121 	}
122 
123 	public void testaloul3536() throws FileNotFoundException, IOException,
124 			ParseFormatException {
125 		assertFalse(solveInstance(PREFIX
126 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl35_36_pb.cnf.cr.opb"));
127 	}
128 
129 	public void testaloul3540() throws FileNotFoundException, IOException,
130 			ParseFormatException {
131 		assertFalse(solveInstance(PREFIX
132 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl35_40_pb.cnf.cr.opb"));
133 	}
134 
135 	public void testaloul3545() throws FileNotFoundException, IOException,
136 			ParseFormatException {
137 		assertFalse(solveInstance(PREFIX
138 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl35_45_pb.cnf.cr.opb"));
139 	}
140 
141 	public void testaloul4041() throws FileNotFoundException, IOException,
142 			ParseFormatException {
143 		assertFalse(solveInstance(PREFIX
144 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl40_41_pb.cnf.cr.opb"));
145 	}
146 
147 	public void testaloul4045() throws FileNotFoundException, IOException,
148 			ParseFormatException {
149 		assertFalse(solveInstance(PREFIX
150 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl40_45_pb.cnf.cr.opb"));
151 	}
152 
153 	public void testaloul4050() throws FileNotFoundException, IOException,
154 			ParseFormatException {
155 		assertFalse(solveInstance(PREFIX
156 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl40_50_pb.cnf.cr.opb"));
157 	}
158 
159 	public void testaloul5051() throws FileNotFoundException, IOException,
160 			ParseFormatException {
161 		assertFalse(solveInstance(PREFIX
162 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl50_51_pb.cnf.cr.opb"));
163 	}
164 
165 	public void testaloul5055() throws FileNotFoundException, IOException,
166 			ParseFormatException {
167 		assertFalse(solveInstance(PREFIX
168 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl50_55_pb.cnf.cr.opb"));
169 	}
170 
171 	public void testaloul5060() throws FileNotFoundException, IOException,
172 			ParseFormatException {
173 		assertFalse(solveInstance(PREFIX
174 				+ "normalized-opb/submitted/aloul/FPGA_SAT05/normalized-chnl50_60_pb.cnf.cr.opb"));
175 	}
176 
177 	public void testncirc103() throws FileNotFoundException, IOException,
178 			ParseFormatException {
179 		assertTrue(solveInstance(PREFIX
180 				+ "normalized-opb/submitted/manquinho/ttp/normalized-circ10_3.opb"));
181 	}
182 
183 	public void testndata103() throws FileNotFoundException, IOException,
184 			ParseFormatException {
185 		assertTrue(solveInstance(PREFIX
186 				+ "normalized-opb/submitted/manquinho/ttp/normalized-data10_3.opb"));
187 	}
188 
189 	public void testPN10() throws FileNotFoundException, IOException,
190 			ParseFormatException {
191 		assertFalse(solveInstance(PREFIX + "pigeons/PN-10-9.opb"));
192 	}
193 }