View Javadoc

1   /*******************************************************************************
2    * SAT4J: a SATisfiability library for Java Copyright (C) 2004, 2012 Artois University and CNRS
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 original MiniSat specification from:
20   *
21   * An extensible SAT solver. Niklas Een and Niklas Sorensson. Proceedings of the
22   * Sixth International Conference on Theory and Applications of Satisfiability
23   * Testing, LNCS 2919, pp 502-518, 2003.
24   *
25   * See www.minisat.se for the original solver in C++.
26   *
27   * Contributors:
28   *   CRIL - initial API and implementation
29   *******************************************************************************/
30  
31  package org.sat4j.pb.constraints;
32  
33  import java.io.FileNotFoundException;
34  import java.io.IOException;
35  
36  import org.sat4j.pb.GoodOPBReader;
37  import org.sat4j.pb.IPBSolver;
38  import org.sat4j.reader.ParseFormatException;
39  import org.sat4j.reader.Reader;
40  
41  /**
42   * @author leberre
43   * 
44   *         Those pseudo boolean problems were kindly provided by Niklas Een.
45   * 
46   */
47  public abstract class AbstractEZPseudoBooleanAndPigeonHoleTest extends
48          AbstractPigeonHoleWithCardinalityTest<IPBSolver> {
49  
50      /**
51       * Cr?ation d'un test
52       * 
53       * @param arg
54       *            argument ?ventuel
55       */
56      public AbstractEZPseudoBooleanAndPigeonHoleTest(String arg) {
57          super(arg);
58      }
59  
60      @Override
61      protected Reader createInstanceReader(IPBSolver solver) {
62          return new GoodOPBReader(solver);
63      }
64  
65      @Override
66      protected void tearDown() {
67          super.tearDown();
68      }
69  
70      // VASCO: traveling tournament problem
71      public void testncirc43() throws FileNotFoundException, IOException,
72              ParseFormatException {
73          assertTrue(solveInstance(PREFIX
74                  + "normalized-opb/submitted/manquinho/ttp/normalized-circ4_3.opb"));
75      }
76  
77      public void testncirc63() throws FileNotFoundException, IOException,
78              ParseFormatException {
79          assertTrue(solveInstance(PREFIX
80                  + "normalized-opb/submitted/manquinho/ttp/normalized-circ6_3.opb"));
81      }
82  
83      public void testncirc83() throws FileNotFoundException, IOException,
84              ParseFormatException {
85          assertTrue(solveInstance(PREFIX
86                  + "normalized-opb/submitted/manquinho/ttp/normalized-circ8_3.opb"));
87      }
88  
89      public void testndata43() throws FileNotFoundException, IOException,
90              ParseFormatException {
91          assertTrue(solveInstance(PREFIX
92                  + "normalized-opb/submitted/manquinho/ttp/normalized-data4_3.opb"));
93      }
94  
95      public void testndata63() throws FileNotFoundException, IOException,
96              ParseFormatException {
97          assertTrue(solveInstance(PREFIX
98                  + "normalized-opb/submitted/manquinho/ttp/normalized-data6_3.opb"));
99      }
100 
101     public void testndata83() throws FileNotFoundException, IOException,
102             ParseFormatException {
103         assertTrue(solveInstance(PREFIX
104                 + "normalized-opb/submitted/manquinho/ttp/normalized-data8_3.opb"));
105     }
106 
107     public void testn9symml() throws FileNotFoundException, IOException,
108             ParseFormatException {
109         assertTrue(solveInstance(PREFIX
110                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-9symml.opb"));
111     }
112 
113     public void testnC17() throws FileNotFoundException, IOException,
114             ParseFormatException {
115         assertTrue(solveInstance(PREFIX
116                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-C17.opb"));
117     }
118 
119     public void testnC432() throws FileNotFoundException, IOException,
120             ParseFormatException {
121         assertTrue(solveInstance(PREFIX
122                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-C432.opb"));
123     }
124 
125     public void testnb1() throws FileNotFoundException, IOException,
126             ParseFormatException {
127         assertTrue(solveInstance(PREFIX
128                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-b1.opb"));
129     }
130 
131     public void testnc8() throws FileNotFoundException, IOException,
132             ParseFormatException {
133         assertTrue(solveInstance(PREFIX
134                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-c8.opb"));
135     }
136 
137     public void testncc() throws FileNotFoundException, IOException,
138             ParseFormatException {
139         assertTrue(solveInstance(PREFIX
140                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-cc.opb"));
141     }
142 
143     public void testncm42a() throws FileNotFoundException, IOException,
144             ParseFormatException {
145         assertTrue(solveInstance(PREFIX
146                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-cm42a.opb"));
147     }
148 
149     public void testncmb() throws FileNotFoundException, IOException,
150             ParseFormatException {
151         assertTrue(solveInstance(PREFIX
152                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-cmb.opb"));
153     }
154 
155     public void testnmux() throws FileNotFoundException, IOException,
156             ParseFormatException {
157         assertTrue(solveInstance(PREFIX
158                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-mux.opb"));
159     }
160 
161     public void testnmyadder() throws FileNotFoundException, IOException,
162             ParseFormatException {
163         assertTrue(solveInstance(PREFIX
164                 + "normalized-opb/submitted/manquinho/synthesis-ptl-cmos-circuits/normalized-my_adder.opb"));
165     }
166 }