Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SAT4J
sat4j
Commits
bd3d186b
Commit
bd3d186b
authored
Sep 21, 2017
by
Daniel Le Berre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved csp and scala packages to their own repository.
parent
ccd7b10b
Pipeline
#260
failed with stage
in 32 seconds
Changes
94
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
0 additions
and
9674 deletions
+0
-9674
org.sat4j.csp/.classpath
org.sat4j.csp/.classpath
+0
-33
org.sat4j.csp/.project
org.sat4j.csp/.project
+0
-39
org.sat4j.csp/.settings/org.eclipse.core.resources.prefs
org.sat4j.csp/.settings/org.eclipse.core.resources.prefs
+0
-5
org.sat4j.csp/.settings/org.eclipse.jdt.core.prefs
org.sat4j.csp/.settings/org.eclipse.jdt.core.prefs
+0
-13
org.sat4j.csp/.settings/org.eclipse.m2e.core.prefs
org.sat4j.csp/.settings/org.eclipse.m2e.core.prefs
+0
-4
org.sat4j.csp/META-INF/MANIFEST.MF
org.sat4j.csp/META-INF/MANIFEST.MF
+0
-24
org.sat4j.csp/build.properties
org.sat4j.csp/build.properties
+0
-5
org.sat4j.csp/plugin.properties
org.sat4j.csp/plugin.properties
+0
-3
org.sat4j.csp/pom.xml
org.sat4j.csp/pom.xml
+0
-58
org.sat4j.csp/src/main/java/org/sat4j/csp/CSPLauncher.java
org.sat4j.csp/src/main/java/org/sat4j/csp/CSPLauncher.java
+0
-152
org.sat4j.csp/src/main/java/org/sat4j/csp/Clausifiable.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Clausifiable.java
+0
-31
org.sat4j.csp/src/main/java/org/sat4j/csp/Constant.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Constant.java
+0
-57
org.sat4j.csp/src/main/java/org/sat4j/csp/CspSatSolverDecorator.java
...sp/src/main/java/org/sat4j/csp/CspSatSolverDecorator.java
+0
-347
org.sat4j.csp/src/main/java/org/sat4j/csp/Domain.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Domain.java
+0
-32
org.sat4j.csp/src/main/java/org/sat4j/csp/Domains.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Domains.java
+0
-99
org.sat4j.csp/src/main/java/org/sat4j/csp/Encoding.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Encoding.java
+0
-39
org.sat4j.csp/src/main/java/org/sat4j/csp/EnumeratedDomain.java
...t4j.csp/src/main/java/org/sat4j/csp/EnumeratedDomain.java
+0
-63
org.sat4j.csp/src/main/java/org/sat4j/csp/Evaluable.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Evaluable.java
+0
-53
org.sat4j.csp/src/main/java/org/sat4j/csp/ICspPBSatSolver.java
...at4j.csp/src/main/java/org/sat4j/csp/ICspPBSatSolver.java
+0
-45
org.sat4j.csp/src/main/java/org/sat4j/csp/Predicate.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Predicate.java
+0
-142
org.sat4j.csp/src/main/java/org/sat4j/csp/RangeDomain.java
org.sat4j.csp/src/main/java/org/sat4j/csp/RangeDomain.java
+0
-68
org.sat4j.csp/src/main/java/org/sat4j/csp/SingletonDomain.java
...at4j.csp/src/main/java/org/sat4j/csp/SingletonDomain.java
+0
-72
org.sat4j.csp/src/main/java/org/sat4j/csp/SolverFactory.java
org.sat4j.csp/src/main/java/org/sat4j/csp/SolverFactory.java
+0
-158
org.sat4j.csp/src/main/java/org/sat4j/csp/Var.java
org.sat4j.csp/src/main/java/org/sat4j/csp/Var.java
+0
-119
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/AllDiff.java
....csp/src/main/java/org/sat4j/csp/constraints/AllDiff.java
+0
-64
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/AllDiffCard.java
.../src/main/java/org/sat4j/csp/constraints/AllDiffCard.java
+0
-61
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/BessiereSupports.java
...main/java/org/sat4j/csp/constraints/BessiereSupports.java
+0
-37
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/GentSupports.java
...src/main/java/org/sat4j/csp/constraints/GentSupports.java
+0
-41
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/Nogoods.java
....csp/src/main/java/org/sat4j/csp/constraints/Nogoods.java
+0
-59
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/Relation.java
...csp/src/main/java/org/sat4j/csp/constraints/Relation.java
+0
-33
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/Supports.java
...csp/src/main/java/org/sat4j/csp/constraints/Supports.java
+0
-120
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/WalshSupports.java
...rc/main/java/org/sat4j/csp/constraints/WalshSupports.java
+0
-37
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints/package.html
....csp/src/main/java/org/sat4j/csp/constraints/package.html
+0
-7
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/ComparisonCtrBuilder.java
...java/org/sat4j/csp/constraints3/ComparisonCtrBuilder.java
+0
-202
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/ConnectionCtrBuilder.java
...java/org/sat4j/csp/constraints3/ConnectionCtrBuilder.java
+0
-405
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/CountingCtrBuilder.java
...n/java/org/sat4j/csp/constraints3/CountingCtrBuilder.java
+0
-332
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/CtrBuilderUtils.java
...main/java/org/sat4j/csp/constraints3/CtrBuilderUtils.java
+0
-154
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/ElementaryCtrBuilder.java
...java/org/sat4j/csp/constraints3/ElementaryCtrBuilder.java
+0
-79
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/GenericCtrBuilder.java
...in/java/org/sat4j/csp/constraints3/GenericCtrBuilder.java
+0
-185
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/LanguageCtrBuilder.java
...n/java/org/sat4j/csp/constraints3/LanguageCtrBuilder.java
+0
-268
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/ObjBuilder.java
.../src/main/java/org/sat4j/csp/constraints3/ObjBuilder.java
+0
-323
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/SchedulingCtrBuilder.java
...java/org/sat4j/csp/constraints3/SchedulingCtrBuilder.java
+0
-554
org.sat4j.csp/src/main/java/org/sat4j/csp/constraints3/StringCondition.java
...main/java/org/sat4j/csp/constraints3/StringCondition.java
+0
-101
org.sat4j.csp/src/main/java/org/sat4j/csp/encodings/BinarySupportEncoding.java
...n/java/org/sat4j/csp/encodings/BinarySupportEncoding.java
+0
-102
org.sat4j.csp/src/main/java/org/sat4j/csp/encodings/DirectEncoding.java
...src/main/java/org/sat4j/csp/encodings/DirectEncoding.java
+0
-68
org.sat4j.csp/src/main/java/org/sat4j/csp/encodings/GeneralizedSupportEncoding.java
...a/org/sat4j/csp/encodings/GeneralizedSupportEncoding.java
+0
-100
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/CspToPBSolverDecorator.java
.../java/org/sat4j/csp/intension/CspToPBSolverDecorator.java
+0
-152
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/EExpressionType.java
...rc/main/java/org/sat4j/csp/intension/EExpressionType.java
+0
-34
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/EOperator.java
....csp/src/main/java/org/sat4j/csp/intension/EOperator.java
+0
-118
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/ICspToSatEncoder.java
...c/main/java/org/sat4j/csp/intension/ICspToSatEncoder.java
+0
-51
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/IExpression.java
...sp/src/main/java/org/sat4j/csp/intension/IExpression.java
+0
-36
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/IIntensionCtrEncoder.java
...in/java/org/sat4j/csp/intension/IIntensionCtrEncoder.java
+0
-36
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/IntegerExpression.java
.../main/java/org/sat4j/csp/intension/IntegerExpression.java
+0
-93
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/IntensionCtrEncoderFactory.java
...a/org/sat4j/csp/intension/IntensionCtrEncoderFactory.java
+0
-53
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/NogoodBasedIntensionCtrEncoder.java
...g/sat4j/csp/intension/NogoodBasedIntensionCtrEncoder.java
+0
-377
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/OperatorExpression.java
...main/java/org/sat4j/csp/intension/OperatorExpression.java
+0
-169
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/Parser.java
...t4j.csp/src/main/java/org/sat4j/csp/intension/Parser.java
+0
-105
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/TseitinBasedIntensionCtrEncoder.java
.../sat4j/csp/intension/TseitinBasedIntensionCtrEncoder.java
+0
-571
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/VarExpression.java
.../src/main/java/org/sat4j/csp/intension/VarExpression.java
+0
-94
org.sat4j.csp/src/main/java/org/sat4j/csp/intension/WrongArityForOperatorException.java
...g/sat4j/csp/intension/WrongArityForOperatorException.java
+0
-11
org.sat4j.csp/src/main/java/org/sat4j/csp/package.html
org.sat4j.csp/src/main/java/org/sat4j/csp/package.html
+0
-7
org.sat4j.csp/src/main/java/org/sat4j/csp/predefinedfunctions.js
...4j.csp/src/main/java/org/sat4j/csp/predefinedfunctions.js
+0
-186
org.sat4j.csp/src/main/java/org/sat4j/reader/CSPExtSupportReader.java
...p/src/main/java/org/sat4j/reader/CSPExtSupportReader.java
+0
-34
org.sat4j.csp/src/main/java/org/sat4j/reader/CSPInstanceReader.java
...csp/src/main/java/org/sat4j/reader/CSPInstanceReader.java
+0
-151
org.sat4j.csp/src/main/java/org/sat4j/reader/CSPReader.java
org.sat4j.csp/src/main/java/org/sat4j/reader/CSPReader.java
+0
-536
org.sat4j.csp/src/main/java/org/sat4j/reader/CSPSupportReader.java
....csp/src/main/java/org/sat4j/reader/CSPSupportReader.java
+0
-34
org.sat4j.csp/src/main/java/org/sat4j/reader/ECSPFormat.java
org.sat4j.csp/src/main/java/org/sat4j/reader/ECSPFormat.java
+0
-228
org.sat4j.csp/src/main/java/org/sat4j/reader/XMLCSP3Reader.java
...t4j.csp/src/main/java/org/sat4j/reader/XMLCSP3Reader.java
+0
-996
org.sat4j.csp/src/main/java/org/sat4j/reader/XMLCSPReader.java
...at4j.csp/src/main/java/org/sat4j/reader/XMLCSPReader.java
+0
-104
org.sat4j.csp/src/main/java/org/sat4j/reader/XMLCommentPrintWriter.java
...src/main/java/org/sat4j/reader/XMLCommentPrintWriter.java
+0
-276
org.sat4j.csp/src/test/java/org/sat4j/csp/constraints3/XCSP3Sat4jSolver.java
...est/java/org/sat4j/csp/constraints3/XCSP3Sat4jSolver.java
+0
-108
org.sat4j.csp/src/test/java/org/sat4j/csp/constraints3/XCSP3TestSuite.java
.../test/java/org/sat4j/csp/constraints3/XCSP3TestSuite.java
+0
-36
org.sat4j.csp/src/test/java/org/sat4j/reader/csp/RangeDomainTest.java
...p/src/test/java/org/sat4j/reader/csp/RangeDomainTest.java
+0
-58
org.sat4j.scala/.cache
org.sat4j.scala/.cache
+0
-0
org.sat4j.scala/.classpath
org.sat4j.scala/.classpath
+0
-27
No files found.
org.sat4j.csp/.classpath
deleted
100644 → 0
View file @
ccd7b10b
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry
kind=
"src"
output=
"target/classes"
path=
"src/main/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"src"
output=
"target/test-classes"
path=
"src/test/java"
>
<attributes>
<attribute
name=
"optional"
value=
"true"
/>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.pde.core.requiredPlugins"
/>
<classpathentry
excluding=
"**"
kind=
"src"
output=
"target/classes"
path=
"src/main/resources"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"con"
path=
"org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"
>
<attributes>
<attribute
name=
"maven.pomderived"
value=
"true"
/>
</attributes>
</classpathentry>
<classpathentry
kind=
"lib"
path=
"/org.ow2.sat4j.pom/lib/xcsp3parser.jar"
/>
<classpathentry
kind=
"output"
path=
"target/classes"
/>
</classpath>
org.sat4j.csp/.project
deleted
100644 → 0
View file @
ccd7b10b
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
org.sat4j.csp
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>
org.eclipse.jdt.core.javabuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.pde.ManifestBuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.pde.SchemaBuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.sonarlint.eclipse.core.sonarlintBuilder
</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>
org.eclipse.m2e.core.maven2Builder
</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>
org.eclipse.m2e.core.maven2Nature
</nature>
<nature>
org.eclipse.jdt.core.javanature
</nature>
<nature>
org.eclipse.pde.PluginNature
</nature>
</natures>
</projectDescription>
org.sat4j.csp/.settings/org.eclipse.core.resources.prefs
deleted
100644 → 0
View file @
ccd7b10b
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8
org.sat4j.csp/.settings/org.eclipse.jdt.core.prefs
deleted
100644 → 0
View file @
ccd7b10b
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.source=1.8
org.sat4j.csp/.settings/org.eclipse.m2e.core.prefs
deleted
100644 → 0
View file @
ccd7b10b
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
org.sat4j.csp/META-INF/MANIFEST.MF
deleted
100644 → 0
View file @
ccd7b10b
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.sat4j.csp
Bundle-Version: 9.9.9.token
Bundle-ClassPath: lib/cspparserxml.jar
Export-Package: org.sat4j.csp;version="9.9.9.token",
org.sat4j.csp.constraints;version="9.9.9.token",
org.sat4j.csp.encodings;version="9.9.9.token",
org.sat4j.reader;version="9.9.9.token"
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.mozilla.javascript;bundle-version="1.6.2",
org.sat4j.csp.xmlparser;bundle-version="1.0.1"
Built-By: Daniel Le Berre
Main-Class: org.sat4j.csp.CSPLauncher
Specification-Title: SAT4J
Specification-Version: NA
Specification-Vendor: Daniel Le Berre
Implementation-Title: SAT4J
Implementation-Version: 9.9.9.token
Implementation-Vendor: CRIL CNRS UMR 8188 - Universite d'Artois
Class-Path: org.sat4j.core.jar lib/js.jar lib/cspparserxml.jar
Bundle-RequiredExecutionEnvironment: J2SE-1.4
org.sat4j.csp/build.properties
deleted
100644 → 0
View file @
ccd7b10b
bin.includes
=
plugin.properties,
\
META-INF/,
\
.
source..
=
src/main/java/,
\
src/test/java/
org.sat4j.csp/plugin.properties
deleted
100644 → 0
View file @
ccd7b10b
bundleName
=
SAT4J CSP
providerName
=
CRIL CNRS UMR 8188 - Universite d'Artois
org.sat4j.csp/pom.xml
deleted
100644 → 0
View file @
ccd7b10b
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
org.ow2.sat4j
</groupId>
<artifactId>
org.ow2.sat4j.pom
</artifactId>
<version>
2.3.6-SNAPSHOT
</version>
</parent>
<artifactId>
org.ow2.sat4j.csp
</artifactId>
<name>
SAT4J csp
</name>
<properties>
<!-- compiler params -->
<javaSource>
1.8
</javaSource>
<javaTarget>
1.8
</javaTarget>
<testSource>
1.8
</testSource>
<testTarget>
1.8
</testTarget>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<!-- common distribution locations -->
<siteRepositoryId
/>
<siteRepositoryUrl
/>
<maven.build.timestamp.format>
yyyyMMdd
</maven.build.timestamp.format>
<sat4j.custom.version>
${project.version}.v${maven.build.timestamp}
</sat4j.custom.version>
<next.eclipse.release.date>
June, 2010
</next.eclipse.release.date>
<bundle-manifest>
${project.build.directory}/META-INF/MANIFEST.MF
</bundle-manifest>
</properties>
<dependencies>
<dependency>
<groupId>
org.ow2.sat4j
</groupId>
<artifactId>
org.ow2.sat4j.pb
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
org.ow2.sat4j
</groupId>
<artifactId>
org.ow2.sat4j.csp.xmlparser
</artifactId>
<version>
${project.version}
</version>
</dependency>
<dependency>
<groupId>
rhino
</groupId>
<artifactId>
js
</artifactId>
<version>
1.7R2
</version>
</dependency>
<dependency>
<groupId>
org.xcsp3
</groupId>
<artifactId>
org.xcsp3.parser
</artifactId>
<version>
3.0
</version>
<scope>
system
</scope>
<systemPath>
${basedir}/../lib/xcsp3parser.jar
</systemPath>
</dependency>
<dependency>
<groupId>
org.xcsp3
</groupId>
<artifactId>
org.xcsp3.utils
</artifactId>
<version>
1.0
</version>
<scope>
system
</scope>
<systemPath>
${basedir}/../lib/org.xcsp.tests-1.0.0-SNAPSHOT.jar
</systemPath>
</dependency>
</dependencies>
</project>
org.sat4j.csp/src/main/java/org/sat4j/csp/CSPLauncher.java
deleted
100644 → 0
View file @
ccd7b10b
/*******************************************************************************
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*******************************************************************************/
package
org.sat4j.csp
;
import
java.io.IOException
;
import
java.util.Map
;
import
org.sat4j.AbstractLauncher
;
import
org.sat4j.ILauncherMode
;
import
org.sat4j.reader.ECSPFormat
;
import
org.sat4j.reader.ParseFormatException
;
import
org.sat4j.reader.Reader
;
import
org.sat4j.specs.ContradictionException
;
import
org.sat4j.specs.IProblem
;
import
org.sat4j.specs.ISolver
;
public
class
CSPLauncher
extends
AbstractLauncher
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
boolean
shouldOnlyDisplayEncoding
=
false
;
public
CSPLauncher
()
{
if
(
System
.
getProperty
(
"CompetitionOutput"
)
!=
null
)
{
bufferizeLog
();
}
}
/*
* (non-Javadoc)
*
* @see org.sat4j.Lanceur#configureSolver(java.lang.String[])
*/
@Override
protected
ISolver
configureSolver
(
String
[]
args
)
{
ICspPBSatSolver
asolver
;
if
(
args
.
length
==
2
)
{
asolver
=
SolverFactory
.
instance
().
createSolverByName
(
args
[
0
]);
}
else
{
asolver
=
new
CspSatSolverDecorator
(
org
.
sat4j
.
pb
.
SolverFactory
.
newDefault
());
}
log
(
asolver
.
toString
(
COMMENT_PREFIX
));
this
.
shouldOnlyDisplayEncoding
=
asolver
.
shouldOnlyDisplayEncoding
();
return
asolver
;
}
/*
* (non-Javadoc)
*
* @see org.sat4j.Lanceur#createReader(org.sat4j.specs.ISolver)
*/
@Override
protected
Reader
createReader
(
final
ISolver
aSolver
,
final
String
problemname
)
{
ECSPFormat
cspFormat
=
ECSPFormat
.
inferInstanceType
(
problemname
);
this
.
out
=
cspFormat
.
decoratePrintWriter
(
this
.
shouldOnlyDisplayEncoding
,
this
.
out
);
flushLog
();
Reader
aReader
=
cspFormat
.
getReader
(
this
,
aSolver
);
setLauncherMode
(
cspFormat
.
isOptimizationModeRequired
()
?
ILauncherMode
.
OPTIMIZATION
:
ILauncherMode
.
DECISION
);
if
(
System
.
getProperty
(
"verbose"
)
!=
null
)
{
log
(
"verbose mode on"
);
aReader
.
setVerbosity
(
true
);
aSolver
.
setVerbose
(
true
);
}
else
{
aSolver
.
setVerbose
(
false
);
}
return
aReader
;
}
@Override
protected
IProblem
readProblem
(
String
problemname
)
throws
ParseFormatException
,
IOException
,
ContradictionException
{
this
.
setSilent
(
true
);
IProblem
problem
=
super
.
readProblem
(
problemname
);
if
(
this
.
shouldOnlyDisplayEncoding
)
{
displayEncoding
();
}
return
problem
;
}
private
void
displayEncoding
()
{
if
(
this
.
reader
.
hasAMapping
())
{
this
.
out
.
write
(
"c CSP to SAT var mapping:\n"
);
Map
<
Integer
,
String
>
mapping
=
this
.
reader
.
getMapping
();
for
(
Map
.
Entry
<
Integer
,
String
>
entry
:
mapping
.
entrySet
())
{
this
.
out
.
write
(
"c "
+
entry
.
getValue
()+
";"
+
entry
.
getKey
()+
"\n"
);
}
}
}
public
static
void
main
(
String
[]
args
)
{
AbstractLauncher
lanceur
=
new
CSPLauncher
();
if
(
args
.
length
>
2
||
args
.
length
==
0
)
{
lanceur
.
usage
();
return
;
}
try
{
lanceur
.
run
(
args
);
}
catch
(
IllegalArgumentException
e
)
{
lanceur
.
log
(
">>>> "
+
e
.
getMessage
()
+
" <<<<"
);
}
}
@Override
public
void
displayLicense
()
{
super
.
displayLicense
();
log
(
"That software uses the Rhino library from the Mozilla project."
);
}
@Override
public
void
usage
()
{
System
.
out
.
println
(
"Please provide a CSP instance file!"
);
//$NON-NLS-1$
}
@Override
protected
String
getInstanceName
(
String
[]
args
)
{
if
(
args
.
length
==
1
)
return
args
[
0
];
return
args
[
1
];
}
@Override
protected
void
displayResult
()
{
try
{
Thread
.
sleep
(
200
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
super
.
displayResult
();
}
}
org.sat4j.csp/src/main/java/org/sat4j/csp/Clausifiable.java
deleted
100644 → 0
View file @
ccd7b10b
/*******************************************************************************
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*******************************************************************************/
package
org.sat4j.csp
;
import
org.sat4j.specs.ContradictionException
;
import
org.sat4j.specs.ISolver
;
import
org.sat4j.specs.IVec
;
@FunctionalInterface
public
interface
Clausifiable
{
void
toClause
(
ISolver
solver
,
IVec
<
Var
>
scope
,
IVec
<
Evaluable
>
vars
)
throws
ContradictionException
;
}
org.sat4j.csp/src/main/java/org/sat4j/csp/Constant.java
deleted
100644 → 0
View file @
ccd7b10b
/*******************************************************************************
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2008 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*******************************************************************************/
package
org.sat4j.csp
;
import
org.sat4j.specs.ContradictionException
;
import
org.sat4j.specs.ISolver
;
public
class
Constant
implements
Evaluable
{
private
final
int
value
;
private
final
Domain
domain
;
public
Constant
(
int
value
)
{
this
.
value
=
value
;
domain
=
new
SingletonDomain
(
value
);
}
public
Domain
domain
()
{
return
domain
;
}
public
int
translate
(
int
key
)
{
throw
new
UnsupportedOperationException
();
}
public
void
toClause
(
ISolver
solver
)
throws
ContradictionException
{
throw
new
UnsupportedOperationException
();
}
/*
* (non-Javadoc)
*
* @see java.lang.Object#toString()
*/
@Override
public
String
toString
()
{
return
String
.
valueOf
(
value
);
}
}
org.sat4j.csp/src/main/java/org/sat4j/csp/CspSatSolverDecorator.java
deleted
100644 → 0
View file @
ccd7b10b
/*******************************************************************************
* SAT4J: a SATisfiability library for Java Copyright (C) 2004-2016 Daniel Le Berre
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU Lesser General Public License Version 2.1 or later (the
* "LGPL"), in which case the provisions of the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of the LGPL, and not to allow others to use your version of
* this file under the terms of the EPL, indicate your decision by deleting
* the provisions above and replace them with the notice and other provisions
* required by the LGPL. If you do not delete the provisions above, a recipient
* may use your version of this file under the terms of the EPL or the LGPL.
*******************************************************************************/
package
org.sat4j.csp
;
import
java.io.PrintStream
;
import
java.io.PrintWriter
;
import
java.math.BigInteger
;
import
java.util.Map
;
import
org.sat4j.pb.IPBSolver
;
import
org.sat4j.pb.ObjectiveFunction
;
import
org.sat4j.specs.Constr
;
import
org.sat4j.specs.ContradictionException
;
import
org.sat4j.specs.IConstr
;
import
org.sat4j.specs.ISolver
;
import
org.sat4j.specs.ISolverService
;
import
org.sat4j.specs.IVec
;
import
org.sat4j.specs.IVecInt
;
import
org.sat4j.specs.SearchListener
;
import
org.sat4j.specs.TimeoutException
;
import
org.sat4j.specs.UnitClauseProvider
;
/**
* A simple decorator allowing to use an {@link IPBSolver} as an {@link ICspPBSatSolver}.
* It provides two methods allowing to set/retrieve whether the associated CSP to SAT encoding must be displayed or not.
*
* @author Emmanuel Lonca - lonca@cril.fr
*/
public
class
CspSatSolverDecorator
implements
ICspPBSatSolver
{
private
static
final
long
serialVersionUID
=
1L
;
private
IPBSolver
solver
;
private
boolean
shouldDisplayEncoding
=
false
;
public
CspSatSolverDecorator
(
IPBSolver
solver
)
{
this
.
solver
=
solver
;
}
public
IConstr
addPseudoBoolean
(
IVecInt
lits
,
IVec
<
BigInteger
>
coeffs
,
boolean
moreThan
,
BigInteger
d
)
throws
ContradictionException
{
return
solver
.
addPseudoBoolean
(
lits
,
coeffs
,
moreThan
,
d
);
}
public
IConstr
addAtMost
(
IVecInt
literals
,
IVecInt
coeffs
,
int
degree
)
throws
ContradictionException
{
return
solver
.
addAtMost
(
literals
,
coeffs
,
degree
);
}
public
IConstr
addAtMost
(
IVecInt
literals
,
IVec
<
BigInteger
>
coeffs
,
BigInteger
degree
)
throws
ContradictionException
{
return
solver
.
addAtMost
(
literals
,
coeffs
,
degree
);
}
public
IConstr
addAtLeast
(
IVecInt
literals
,
IVecInt
coeffs
,
int
degree
)
throws
ContradictionException
{
return
solver
.
addAtLeast
(
literals
,
coeffs
,
degree
);
}
public
IConstr
addAtLeast
(
IVecInt
literals
,
IVec
<
BigInteger
>
coeffs
,
BigInteger
degree
)
throws
ContradictionException
{
return
solver
.
addAtLeast
(
literals
,
coeffs
,
degree
);
}
public
IConstr
addExactly
(
IVecInt
literals
,
IVecInt
coeffs
,
int
weight
)
throws
ContradictionException
{
return
solver
.
addExactly
(
literals
,
coeffs
,
weight
);
}
public
IConstr
addExactly
(
IVecInt
literals
,
IVec
<
BigInteger
>
coeffs
,
BigInteger
weight
)
throws
ContradictionException
{
return
solver
.
addExactly
(
literals
,
coeffs
,
weight
);
}
public
void
setObjectiveFunction
(
ObjectiveFunction
obj
)
{
solver
.
setObjectiveFunction
(
obj
);
}
public
ObjectiveFunction
getObjectiveFunction
()
{
return
solver
.
getObjectiveFunction
();
}
public
boolean
model
(
int
var
)
{
return
solver
.
model
(
var
);
}
public
int
[]
model
()
{
return
solver
.
model
();
}
@SuppressWarnings
(
"deprecation"
)
public
int
newVar
()
{
return
solver
.
newVar
();
}
public
int
[]
primeImplicant
()
{
return
solver
.
primeImplicant
();
}
public
int
nextFreeVarId
(
boolean
reserve
)
{
return
solver
.
nextFreeVarId
(
reserve
);
}
public
boolean
primeImplicant
(
int
p
)
{
return
solver
.
primeImplicant
(
p
);
}
public
boolean
isSatisfiable
()
throws
TimeoutException
{
return
solver
.
isSatisfiable
();
}
public
boolean
isSatisfiable
(
IVecInt
assumps
,
boolean
globalTimeout
)
throws
TimeoutException
{
return
solver
.
isSatisfiable
(
assumps
,
globalTimeout
);
}
public
void
registerLiteral
(
int
p
)
{