Commit 9b7fd64e authored by leberre's avatar leberre

Added test files for sat4j core. Moved release to 2.0.2 in pom files.


git-svn-id: svn+ssh://svn.forge.ow2.org/svnroot/sat4j/maven/trunk@79 ba638df5-4473-46d1-82f8-c3ae2a17a6e1
parent a0511186
HOW TO BUILD SAT4J FROM SOURCE
+ Using Maven
Just launch
$ mvn -Dmaven.test.skip=true install
to build the SAT4J modules from the source tree.
All the dependencies will be gathered by Maven.
+ Using ant
Download the missing libraries and put them in the lib directory:
+ Apache commons CLI
+ Apache commons UseBean
+ Mozilla Rhino
Just type:
$ ant
to build the modules from source.
<project name="sat4j" default="default">
<property name="testreport.dir" value="tests"/>
<property name="build" value="bin" />
<property name="doc" value="api" />
<property name="target" value="jsr14"/>
<property name="dist" value="dist"/>
<property name="release" value="CUSTOM"/>
<property name="tag" value="HEAD"/>
<property name="lib" value="lib"/>
<target name="pseudo" depends="core" description="Build a jar file suitable for the PB evaluations from CVS">
<echo>Building Pseudo Boolean Solver</echo>
<antcall target="build">
<param name="package" value="pb"/>
<param name="src" value="org.sat4j.pb/src/main/java" />
<param name="jarname" value="org.sat4j.pb"/>
<param name="mainclass" value="org.sat4j.pb.LanceurPseudo2007"/>
</antcall>
<antcall target="source-package">
<param name="package" value="pb"/>
<param name="src" value="org.sat4j.pb/src/main/java" />
<param name="jarname" value="org.sat4j.pb"/>
</antcall>
<antcall target="zip-bundle">
<param name="package" value="pb"/>
</antcall>
</target>
<target name="maxsat" depends="pseudo" description="Build a jar file suitable for the MaxSAT evaluations from CVS">
<echo>Building MAXSAT Solver</echo>
<antcall target="build">
<param name="package" value="maxsat"/>
<param name="src" value="org.sat4j.maxsat/src/main/java" />
<param name="jarname" value="org.sat4j.maxsat"/>
<param name="mainclass" value="org.sat4j.maxsat.GenericOptLauncher"/>
</antcall>
<antcall target="source-package">
<param name="package" value="maxsat"/>
<param name="src" value="org.sat4j.maxsat/src/main/java" />
<param name="jarname" value="org.sat4j.maxsat"/>
</antcall>
</target>
<target name="csp" depends="core" description="Build a jar file suitable for the CSP competitions from CVS">
<echo>Building CSP Solver</echo>
<antcall target="build">
<param name="package" value="csp"/>
<param name="src" value="org.sat4j.csp/src/main/java" />
<param name="jarname" value="org.sat4j.csp"/>
<param name="mainclass" value="org.sat4j.csp.CSPLauncher"/>
</antcall>
<antcall target="source-package">
<param name="package" value="csp"/>
<param name="src" value="org.sat4j.csp/src/main/java" />
<param name="jarname" value="org.sat4j.csp"/>
</antcall>
</target>
<target name="sat" depends="core" description="Build a jar file suitable for experimenting with SAT solvers from CVS">
<echo>Building the Java SAT Solvers toolkit</echo>
<antcall target="build">
<param name="package" value="sat"/>
<param name="src" value="org.sat4j.sat/src/main/java" />
<param name="jarname" value="org.sat4j.sat"/>
<param name="mainclass" value="org.sat4j.Lanceur"/>
</antcall>
<antcall target="source-package">
<param name="package" value="sat"/>
<param name="src" value="org.sat4j.sat/src/main/java" />
<param name="jarname" value="org.sat4j.sat"/>
</antcall>
</target>
<target name="core" depends="clean" description="Build a jar file suitable for embedding SAT technology into a Java application from CVS">
<echo>Building core library to be embedded into Java applications</echo>
<antcall target="build">
<param name="package" value="core"/>
<param name="src" value="org.sat4j.core/src/main/java" />
<param name="jarname" value="org.sat4j.core"/>
<param name="mainclass" value="org.sat4j.BasicLauncher"/>
</antcall>
<antcall target="source-package">
<param name="package" value="core"/>
<param name="src" value="org.sat4j.core/src/main/java" />
<param name="jarname" value="org.sat4j.core"/>
</antcall>
<antcall target="zip-bundle">
<param name="package" value="core"/>
</antcall>
</target>
<target name="sudoku" depends="core" description="Build the sudoku demo from CVS">
<echo>Building Sudoku app ${java.home}</echo>
<antcall target="build">
<param name="package" value="sudoku"/>
<param name="src" value="sudoku/src"/>
<param name="lib" value="sudoku/lib"/>
<param name="jarname" value="org.sat4j.sudoku"/>
<param name="mainclass" value="org.sat4j.apps.sudoku.SDApplication"/>
</antcall>
</target>
<target name="prepare" depends="clean">
<!-- Create the time stamp -->
<tstamp>
<format property="BUILD_DATE" pattern="yyyyMMdd"/>
</tstamp>
<echo>Creating build and doc directories</echo>
<mkdir dir="${build}" />
<mkdir dir="${testreport.dir}" />
<mkdir dir="${dist}" />
<mkdir dir="${dist}/${release}" />
<mkdir dir="${dist}/${release}/lib" />
<mkdir dir="${doc}" />
<mkdir dir="${doc}/core" />
<mkdir dir="${doc}/sat" />
<mkdir dir="${doc}/pb" />
<mkdir dir="${doc}/maxsat" />
<mkdir dir="${doc}/csp" />
</target>
<path id="somePath">
<pathelement location="${build}"/>
<fileset dir="${lib}">
<include name="*.jar"/>
</fileset>
<fileset dir="${dist}/${release}">
<include name="*.jar"/>
</fileset>
<pathelement location="${java.home}/lib/javaws.jar"/>
</path>
<target name="javadoc">
<echo>Generating Javodoc</echo>
<javadoc destdir="${doc}/${module}"
access="public"
source="1.5"
use="true"
notree="false"
nonavbar="false"
noindex="false"
splitindex="true"
author="true"
version="true"
nodeprecatedlist="false"
nodeprecated="false"
packagenames="org.sat4j.*,org.sat4j.spec.*,org.sat4j.core.*,org.sat4j.minisat.*,org.sat4j.minisat.core.*,org.sat4j.minisat.constraints.*,org.sat4j.minisat.constraints.cnf.*"
sourcepath="${module}/src"
stylesheetfile="core/lib/stylesheet.css"
overview="${module}/src/overview.html"
doctitle="SAT4J: a SATisfiability library for Java">
<classpath refid="somePath"/>
<group title="User level: stable public API." packages="org.sat4j:org.sat4j.*"/>
<group title="Developer level: internal API, subject to change." packages="org.sat4j.minisat.*:org.sat4j.reader.csp:org.sat4j.pb.*"/>
</javadoc>
</target>
<target name="build" depends="prepare">
<echo>Compiling source code ${src} using target ${target}</echo>
<javac
srcdir="${src}"
destdir="${build}"
source="1.5"
target="${target}"
>
<classpath refid="somePath"/>
</javac>
<copy todir="${build}" failonerror="false">
<fileset dir="${src}">
<include name="**/*.properties"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.js"/>
<include name="**/*.html"/>
<include name="**/*.version"/>
<exclude name="**/package.html"/>
<exclude name="**/*.jpage"/>
</fileset>
<fileset dir="${src}/../resources">
<include name="about.html"/>
</fileset>
<fileset dir="${src}/../../../">
<include name="plugin.properties"/>
<include name="**/*.MF"/>
</fileset>
</copy>
<replace dir="${build}" token="9.9.9.token" value="${release}.v${BUILD_DATE}"><include name="**/*.version"/><include name="**/*.MF"/></replace>
<jar destfile="${dist}/${release}/${jarname}.jar" basedir="${build}" manifest="${build}/META-INF/MANIFEST.MF">
<!--
<manifest>
<attribute name="Built-By" value="Daniel Le Berre"/>
<attribute name="Main-Class" value="${mainclass}"/>
<attribute name="SplashScreen-Image" value="sat4j.png"/>
<attribute name="Specification-Title" value="SAT4J"/>
<attribute name="Specification-Version" value="1.5+"/>
<attribute name="Specification-Vendor"
value="Daniel Le Berre"
/>
<attribute name="Implementation-Title" value="SAT4J"/>
<attribute name="Implementation-Version" value="NA "/>
<attribute name="Implementation-Vendor"
value="CRIL-CNRS FRE 2499"
/>
</manifest>
<zipgroupfileset dir="${lib}">
<include name="commons*.jar"/>
<include name="jlf*.jar"/>
<include name="csp*.jar"/>
<include name="js.jar"/>
</zipgroupfileset>
-->
</jar>
<copy todir="${dist}/${release}/lib" failonerror="false">
<fileset dir="${lib}">
<include name="commons*.jar"/>
<include name="jlf*.jar"/>
<include name="csp*.jar"/>
<include name="js.jar"/>
</fileset>
</copy>
</target>
<target name="source-package">
<jar destfile="${dist}/${release}/${jarname}-src.jar" manifest="${build}/META-INF/MANIFEST.MF">
<fileset dir="${src}">
<include name="**/*.java"/>
<include name="**/*.properties"/>
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
<include name="**/*.js"/>
<include name="**/*.html"/>
<include name="**/*.version"/>
<exclude name="**/package.html"/>
<exclude name="**/*.jpage"/>
</fileset>
<fileset dir="${src}/../resources">
<include name="about.html"/>
</fileset>
<fileset dir="${src}/../../../">
<include name="plugin.properties"/>
<include name="build.properties"/>
<include name="**/*.MF"/>
</fileset>
</jar>
</target>
<target name="zip-bundle" depends="prepare">
<zip destfile="${dist}/${release}/sat4j-${package}-v${BUILD_DATE}.zip">
<fileset dir="${dist}/${release}/">
<include name="*${package}*.jar"/>
</fileset>
</zip>
</target>
<target name="javadocs" description="Build all the Javadocs">
<antcall target="javadoc">
<param name="module" value="core"/>
<param name="lib" value="core/lib"/>
</antcall>
<antcall target="javadoc">
<param name="module" value="sat"/>
<param name="lib" value="sat/lib"/>
</antcall>
<antcall target="javadoc">
<param name="module" value="pb"/>
<param name="lib" value="pb/lib"/>
</antcall>
<antcall target="javadoc">
<param name="module" value="maxsat"/>
<param name="lib" value="maxsat/lib"/>
</antcall>
<antcall target="javadoc">
<param name="module" value="csp"/>
<param name="lib" value="csp/lib"/>
</antcall>
</target>
<target name="default"
depends="sat" description="Build the SAT4J library and the associated Javadoc from CVS"
>
<antcall target="javadoc">
<param name="src" value="core/src"/>
<param name="lib" value="core/lib"/>
</antcall>
<echo>
You just built SAT4J from CVS.
The code might not be in a very good shape.
You should take a look at http://www.sat4j.org/junit/
to check that the functional tests are ok.
Use that snapshot at your own risk! :-=)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Please fill bug reports and feature requests at
http://forge.objectweb.org/tracker/?group_id=228
</echo>
</target>
<target name="p2" depends="cleanrelease,core,pseudo" description="Build a full release of SAT4J project">
<echo>Built full release ${release}</echo>
</target>
<target name="all" depends="cleanrelease,core,pseudo,maxsat,csp,sat,sudoku" description="Build a full release of SAT4J project">
<echo>Built full release ${release}</echo>
</target>
<target name="cleanrelease">
<delete dir="${dist}/${release}" />
</target>
<target name="clean" description="Delete build and doc directories">
<!-- Delete the ${build} and ${doc} directory trees -->
<delete dir="${build}" />
<delete dir="$testreport.dir}"/>
<delete dir="${doc}" />
</target>
</project>
......@@ -3,11 +3,10 @@
<parent>
<groupId>org.sat4j</groupId>
<artifactId>org.sat4j.pom</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>
</parent>
<artifactId>org.sat4j.core</artifactId>
<name>SAT4J core</name>
<url>http://www.sat4j.org</url>
<description>
The core library contains a flexible implementation in Java of the initial Minisat specification.
The library is regularly updated with latest SAT technologies. It is a mature software that target
......
c SATCompetition compliant instance v1.0
c FILE: aim-50-1_6-no-1.cnf
c
c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp),
c and Yuichi Asahiro
c
c DESCRIPTION: Artifical instances from generator by source. Generators
c and more information in sat/contributed/iwama.
c
c NOTE: Not Satisfiable
c
c output cnf generated by opensat
p cnf 50 76
16 23 42 0
-16 23 42 0
26 41 -42 0
-26 41 -42 0
32 -41 -42 0
6 15 -41 0
-6 15 -32 0
1 -32 46 0
-1 -32 46 0
-15 -41 -46 0
-15 -21 -46 0
-23 33 38 0
-23 -33 38 0
8 22 33 0
8 22 -33 0
-22 37 -38 0
13 36 -37 0
13 -22 -36 0
-13 -22 -37 0
11 -23 47 0
-8 11 -47 0
-8 -11 39 0
-11 27 -39 0
-8 -11 -39 0
-7 26 29 0
-7 -26 29 0
-13 20 36 0
-13 17 20 0
5 -17 20 0
5 -19 -45 0
-5 -10 -45 0
6 25 47 0
-6 -10 25 0
-2 -27 37 0
-27 -36 40 0
18 39 -40 0
-2 -19 31 0
5 18 -30 0
-31 -43 -50 0
10 -30 43 0
10 -41 43 0
19 21 29 0
37 42 45 0
-20 27 40 0
-21 -36 48 0
31 -36 -48 0
3 -9 -18 0
16 -40 -47 0
1 -18 21 0
2 28 32 0
-1 -24 -50 0
-12 35 49 0
-6 -36 45 0
7 12 -43 0
7 30 -43 0
-5 9 -17 0
3 14 50 0
-12 17 -49 0
24 34 49 0
14 -20 24 0
-9 35 -49 0
-4 -47 50 0
2 4 -48 0
-20 35 -44 0
30 -31 -43 0
-14 -29 35 0
19 -22 -24 0
-25 -28 48 0
-14 -34 44 0
9 20 44 0
-3 9 -29 0
12 48 0
-12 -25 -43 0
-25 -31 48 0
14 -16 49 0
-3 -4 -35 0
c SATCompetition compliant instance v1.0
c FILE: aim-50-1_6-yes1-1.cnf
c
c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp),
c and Yuichi Asahiro
c
c DESCRIPTION: Artifical instances from generator by source. Generators
c and more information in sat/contributed/iwama.
c
c NOTE: Satisfiable
c
c output cnf generated by opensat
p cnf 50 80
5 28 41 0
5 -28 41 0
10 30 -41 0
5 -10 -41 0
-5 25 30 0
-5 -25 30 0
11 -30 -33 0
-11 -30 -33 0
7 -30 33 0
-7 14 33 0
-4 -7 -14 0
4 -14 -29 0
-1 -14 32 0
-1 4 -32 0
1 24 29 0
1 -24 -34 0
-6 -24 34 0
6 -24 38 0
6 -32 -38 0
32 44 48 0
-38 -44 48 0
22 29 -48 0
22 -29 32 0
-22 -25 -48 0
-22 25 40 0
18 -22 -40 0
-18 20 -40 0
-18 28 -40 0
-18 -28 39 0
-28 35 -39 0
-35 -39 43 0
-35 -43 -50 0
-43 -45 50 0
31 45 50 0
-31 -44 45 0
-15 44 49 0
-15 -31 -49 0
15 -31 36 0
15 23 -36 0
-23 -36 46 0
20 27 -46 0
-20 -23 27 0
-16 -27 -46 0
16 26 -27 0
16 17 -26 0
2 13 -17 0
2 -13 -26 0
-5 -17 -26 0
-2 -17 42 0
-2 12 -13 0
-2 -12 -42 0
8 13 -42 0
-8 -10 13 0
3 -8 10 0
-3 10 -37 0
-3 10 -47 0
10 19 47 0
-12 -19 47 0
12 -19 21 0
9 -19 -21 0
-9 -11 -21 0
-9 11 -49 0
11 41 49 0
19 -32 37 0
-1 39 -50 0
8 17 40 0
38 43 49 0
23 42 -47 0
-13 -29 37 0
-34 37 -47 0
-33 -37 50 0
-6 14 34 0
9 -20 -50 0
35 36 38 0
3 31 46 0
7 -16 21 0
-6 17 26 0
23 24 46 0
18 24 -45 0
-4 -6 7 0
c FILE: aim-100-1_6-no-1.cnf
c
c SOURCE: Kazuo Iwama, Eiji Miyano (miyano@cscu.kyushu-u.ac.jp),
c and Yuichi Asahiro
c
c DESCRIPTION: Artifical instances from generator by source. Generators
c and more information in sat/contributed/iwama.
c
c NOTE: Not Satisfiable
c
p cnf 100 160
16 30 95 0
-16 30 95 0
-30 35 78 0
-30 -78 85 0
-78 -85 95 0
8 55 100 0
8 55 -95 0
9 52 100 0
9 73 -100 0
-8 -9 52 0
38 66 83 0
-38 83 87 0
-52 83 -87 0
66 74 -83 0
-52 -66 89 0
-52 73 -89 0
-52 73 -74 0
-8 -73 -95 0
40 -55 90 0
-40 -55 90 0
25 35 82 0
-25 82 -90 0
-55 -82 -90 0
11 75 84 0
11 -75 96 0
23 -75 -96 0
-11 23 -35 0
-23 29 65 0
29 -35 -65 0
-23 -29 84 0
-35 54 70 0
-54 70 77 0
19 -77 -84 0
-19 -54 70 0
22 68 81 0
-22 48 81 0
-22 -48 93 0
3 -48 -93 0
7 18 -81 0
-7 56 -81 0
3 18 -56 0
-18 47 68 0
-18 -47 -81 0
-3 68 77 0
-3 -77 -84 0
19 -68 -70 0