Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SAT4J
sat4j
Commits
3610d72b
Commit
3610d72b
authored
Sep 20, 2021
by
Daniel Le Berre
Browse files
Merge branch 'VERIPB2' into 'master'
Add support for veripb in CP based solvers See merge request
!9
parents
0e8589ac
d3266770
Pipeline
#15943
passed with stages
in 38 minutes and 24 seconds
Changes
45
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
3610d72b
...
@@ -25,7 +25,7 @@ maven38-java11:
...
@@ -25,7 +25,7 @@ maven38-java11:
except
:
except
:
-
master
-
master
script
:
script
:
-
mvn $MAVEN_CLI_OPTS clean
org.jacoco:jacoco-maven-plugin:prepare-agent --settings settings.xml deploy
-
mvn $MAVEN_CLI_OPTS clean
package -Dmaven.javadoc.skip=true -Djacoco.skip=true
cache
:
cache
:
paths
:
paths
:
-
.m2/repository
-
.m2/repository
...
...
org.sat4j.core/src/main/java/org/sat4j/minisat/core/Solver.java
View file @
3610d72b
...
@@ -497,8 +497,8 @@ public class Solver<D extends DataStructureFactory>
...
@@ -497,8 +497,8 @@ public class Solver<D extends DataStructureFactory>
public
IConstr
addExactly
(
IVecInt
literals
,
int
n
)
public
IConstr
addExactly
(
IVecInt
literals
,
int
n
)
throws
ContradictionException
{
throws
ContradictionException
{
ConstrGroup
group
=
new
ConstrGroup
(
false
);
ConstrGroup
group
=
new
ConstrGroup
(
false
);
group
.
add
(
addAtMost
(
literals
,
n
));
group
.
add
(
addAtLeast
(
literals
,
n
));
group
.
add
(
addAtLeast
(
literals
,
n
));
group
.
add
(
addAtMost
(
literals
,
n
));
return
group
;
return
group
;
}
}
...
...
org.sat4j.core/src/main/java/org/sat4j/minisat/orders/SolutionPhaseSelectionStrategy.java
0 → 100644
View file @
3610d72b
/*******************************************************************************
* SAT4J: a SATisfiability library for Java Copyright (C) 2004, 2012 Artois University and CNRS
*
* 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.
*
* Based on the original MiniSat specification from:
*
* An extensible SAT solver. Niklas Een and Niklas Sorensson. Proceedings of the
* Sixth International Conference on Theory and Applications of Satisfiability
* Testing, LNCS 2919, pp 502-518, 2003.
*
* See www.minisat.se for the original solver in C++.
*
* Contributors:
* CRIL - initial API and implementation
*******************************************************************************/
package
org.sat4j.minisat.orders
;
import
static
org
.
sat4j
.
core
.
LiteralsUtils
.
negLit
;
import
static
org
.
sat4j
.
core
.
LiteralsUtils
.
var
;
import
org.sat4j.core.LiteralsUtils
;
/**
* Keeps track of the phase of the latest assignment during search, while
* preserving the one of the latest solution found (typically for optimization).
*
* (implemented after seeing a talk at PoS 18 :
* https://easychair.org/smart-program/FLoC2018/POS-2018-07-07.html#talk:72764)
*
* @author leberre
*
*/
public
final
class
SolutionPhaseSelectionStrategy
extends
AbstractPhaserecordingSelectionStrategy
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
void
init
(
int
nlength
)
{
if
(
this
.
phase
==
null
||
this
.
phase
.
length
<
nlength
)
{
this
.
phase
=
new
int
[
nlength
];
for
(
int
i
=
1
;
i
<
nlength
;
i
++)
{
this
.
phase
[
i
]
=
negLit
(
i
);
}
}
}
public
void
assignLiteral
(
int
p
)
{
this
.
phase
[
var
(
p
)]
=
p
;
}
@Override
public
String
toString
()
{
return
"lightweight component caching from RSAT plus solution phase"
;
}
public
void
updateVar
(
int
p
)
{
}
public
void
updateVarAtDecisionLevel
(
int
p
)
{
}
public
void
onModelFound
(
int
[]
model
)
{
for
(
int
l
:
model
)
{
this
.
phase
[
Math
.
abs
(
l
)]
=
LiteralsUtils
.
toInternal
(
l
);
}
}
}
org.sat4j.core/src/main/java/org/sat4j/specs/IConstr.java
View file @
3610d72b
...
@@ -106,4 +106,28 @@ public interface IConstr {
...
@@ -106,4 +106,28 @@ public interface IConstr {
* rebuilding it.
* rebuilding it.
*/
*/
String
dump
();
String
dump
();
/**
* Get a unique id for this constraint.
*
* @return a unique integral id for the constraint.
* @throws UnsupportedOperationException
* if no such identifier is available
* @since 3.0
*/
default
int
getId
()
{
throw
new
UnsupportedOperationException
();
}
/**
* Allow the user to give a specific id to the constraint.
*
* The constraint may ignore it.
*
* @param nbConstraintsRead
* @since 3.0
*/
default
void
setId
(
int
nbConstraintsRead
)
{
// do nothing
}
}
}
org.sat4j.core/src/main/java/org/sat4j/tools/DotSearchTracing.java
View file @
3610d72b
...
@@ -191,7 +191,13 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
...
@@ -191,7 +191,13 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
@Override
@Override
public
final
void
learn
(
final
IConstr
constr
)
{
public
final
void
learn
(
final
IConstr
constr
)
{
String
learned
=
this
.
currentNodeName
+
"_learned"
;
String
learned
=
this
.
currentNodeName
+
"_learned"
;
saveLine
(
lineTab
(
"\""
+
learned
+
"\" [label=\""
+
constr
.
toString
(
this
)
String
text
;
if
(
constr
==
null
)
{
text
=
"0 >= 1"
;
}
else
{
text
=
constr
.
toString
(
this
);
}
saveLine
(
lineTab
(
"\""
+
learned
+
"\" [label=\""
+
text
+
"\", shape=box, color=\"orange\", style=dotted]"
));
+
"\", shape=box, color=\"orange\", style=dotted]"
));
saveLine
(
"\""
+
learned
+
"\""
+
"--"
+
"\""
+
this
.
currentNodeName
saveLine
(
"\""
+
learned
+
"\""
+
"--"
+
"\""
+
this
.
currentNodeName
+
"\""
+
"[label=\"\", color=orange, style=dotted]"
);
+
"\""
+
"[label=\"\", color=orange, style=dotted]"
);
...
...
org.sat4j.core/src/main/java/org/sat4j/tools/ProblemDecorator.java
0 → 100644
View file @
3610d72b
package
org.sat4j.tools
;
import
java.io.PrintWriter
;
import
org.sat4j.specs.IProblem
;
import
org.sat4j.specs.IVecInt
;
import
org.sat4j.specs.TimeoutException
;
/**
* Decorator design pattern for the IProblem interface.
*
* @author leberre
*
* @param <T>
* @since 2.3.6
*/
public
class
ProblemDecorator
<
T
extends
IProblem
>
implements
IProblem
{
private
final
T
decorated
;
public
ProblemDecorator
(
T
decorated
)
{
this
.
decorated
=
decorated
;
}
@Override
public
boolean
model
(
int
var
)
{
return
decorated
.
model
(
var
);
}
@Override
public
int
[]
model
()
{
return
decorated
.
model
();
}
@Override
public
int
[]
primeImplicant
()
{
return
decorated
.
primeImplicant
();
}
@Override
public
boolean
primeImplicant
(
int
p
)
{
return
decorated
.
primeImplicant
(
p
);
}
@Override
public
boolean
isSatisfiable
()
throws
TimeoutException
{
return
decorated
.
isSatisfiable
();
}
@Override
public
boolean
isSatisfiable
(
IVecInt
assumps
,
boolean
globalTimeout
)
throws
TimeoutException
{
return
decorated
.
isSatisfiable
(
assumps
,
globalTimeout
);
}
@Override
public
boolean
isSatisfiable
(
boolean
globalTimeout
)
throws
TimeoutException
{
return
decorated
.
isSatisfiable
(
globalTimeout
);
}
@Override
public
boolean
isSatisfiable
(
IVecInt
assumps
)
throws
TimeoutException
{
return
decorated
.
isSatisfiable
(
assumps
);
}
@Override
public
int
[]
findModel
()
throws
TimeoutException
{
return
decorated
.
findModel
();
}
@Override
public
int
[]
findModel
(
IVecInt
assumps
)
throws
TimeoutException
{
return
decorated
.
findModel
(
assumps
);
}
@Override
public
int
nConstraints
()
{
return
decorated
.
nConstraints
();
}
@Override
public
int
newVar
(
int
howmany
)
{
return
decorated
.
newVar
(
howmany
);
}
@Override
public
int
nVars
()
{
return
decorated
.
nVars
();
}
@Override
public
void
printInfos
(
PrintWriter
out
,
String
prefix
)
{
decorated
.
printInfos
(
out
,
prefix
);
}
@Override
public
void
printInfos
(
PrintWriter
out
)
{
decorated
.
printInfos
(
out
);
}
public
T
decorated
()
{
return
decorated
;
}
@Override
public
int
[]
decisions
()
{
return
decorated
.
decisions
();
}
}
org.sat4j.core/src/test/java/org/sat4j/minisat/constraints/TestParityConstraint.java
0 → 100644
View file @
3610d72b
package
org.sat4j.minisat.constraints
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
assertFalse
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.junit.Test
;
import
org.sat4j.core.VecInt
;
import
org.sat4j.minisat.SolverFactory
;
import
org.sat4j.specs.ISolver
;
import
org.sat4j.specs.TimeoutException
;
import
org.sat4j.tools.ModelIterator
;
public
class
TestParityConstraint
{
@Test
public
void
testParityTwo
()
throws
TimeoutException
{
ISolver
solver
=
SolverFactory
.
newDefault
();
solver
.
newVar
(
2
);
solver
.
addParity
(
VecInt
.
of
(
1
,
2
),
true
);
assertTrue
(
solver
.
isSatisfiable
());
ModelIterator
iterator
=
new
ModelIterator
(
solver
);
assertTrue
(
iterator
.
isSatisfiable
());
iterator
.
model
();
assertTrue
(
iterator
.
isSatisfiable
());
iterator
.
model
();
assertFalse
(
iterator
.
isSatisfiable
());
}
@Test
public
void
testParityThree
()
throws
TimeoutException
{
ISolver
solver
=
SolverFactory
.
newDefault
();
solver
.
newVar
(
3
);
solver
.
addParity
(
VecInt
.
of
(
1
,
2
,
3
),
false
);
assertTrue
(
solver
.
isSatisfiable
());
ModelIterator
iterator
=
new
ModelIterator
(
solver
);
while
(
iterator
.
isSatisfiable
())
{
iterator
.
model
();
}
assertEquals
(
4
,
iterator
.
numberOfModelsFoundSoFar
());
}
@Test
public
void
testParityThreeUnsat
()
throws
TimeoutException
{
ISolver
solver
=
SolverFactory
.
newDefault
();
solver
.
newVar
(
3
);
solver
.
addParity
(
VecInt
.
of
(
1
,
2
,
3
),
false
);
solver
.
addParity
(
VecInt
.
of
(
1
,
2
,
3
),
true
);
assertFalse
(
solver
.
isSatisfiable
());
}
}
org.sat4j.pb/src/main/java/org/sat4j/pb/LanceurPseudo2007.java
View file @
3610d72b
...
@@ -34,9 +34,12 @@ import org.sat4j.DecisionMode;
...
@@ -34,9 +34,12 @@ import org.sat4j.DecisionMode;
import
org.sat4j.core.ASolverFactory
;
import
org.sat4j.core.ASolverFactory
;
import
org.sat4j.pb.reader.OPBReader2012
;
import
org.sat4j.pb.reader.OPBReader2012
;
import
org.sat4j.pb.tools.OptimalModelIterator
;
import
org.sat4j.pb.tools.OptimalModelIterator
;
import
org.sat4j.pb.tools.PBSearchListener
;
import
org.sat4j.pb.tools.VERIPBSearchListener
;
import
org.sat4j.reader.DimacsReader
;
import
org.sat4j.reader.DimacsReader
;
import
org.sat4j.reader.Reader
;
import
org.sat4j.reader.Reader
;
import
org.sat4j.specs.ISolver
;
import
org.sat4j.specs.ISolver
;
import
org.sat4j.specs.ISolverService
;
/**
/**
* Launcher for the Pseudo Boolean 2007 competition.
* Launcher for the Pseudo Boolean 2007 competition.
...
@@ -61,6 +64,13 @@ public class LanceurPseudo2007 extends LanceurPseudo2005 {
...
@@ -61,6 +64,13 @@ public class LanceurPseudo2007 extends LanceurPseudo2005 {
@Override
@Override
protected
Reader
createReader
(
ISolver
theSolver
,
String
problemname
)
{
protected
Reader
createReader
(
ISolver
theSolver
,
String
problemname
)
{
String
veripb
=
System
.
getProperty
(
"veripb"
);
if
(
veripb
!=
null
)
{
PBSearchListener
<
ISolverService
>
listener
=
new
VERIPBSearchListener
(
problemname
);
this
.
solver
.
setSearchListener
(
listener
);
log
(
"using VERIPB proof format"
);
}
if
(
problemname
.
endsWith
(
".cnf"
))
if
(
problemname
.
endsWith
(
".cnf"
))
return
new
DimacsReader
(
theSolver
);
return
new
DimacsReader
(
theSolver
);
return
new
OPBReader2012
(
handle
);
return
new
OPBReader2012
(
handle
);
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/SolverFactory.java
View file @
3610d72b
...
@@ -39,6 +39,8 @@ import org.sat4j.minisat.learning.MiniSATLearning;
...
@@ -39,6 +39,8 @@ import org.sat4j.minisat.learning.MiniSATLearning;
import
org.sat4j.minisat.learning.NoLearningButHeuristics
;
import
org.sat4j.minisat.learning.NoLearningButHeuristics
;
import
org.sat4j.minisat.orders.PhaseInLastLearnedClauseSelectionStrategy
;
import
org.sat4j.minisat.orders.PhaseInLastLearnedClauseSelectionStrategy
;
import
org.sat4j.minisat.orders.RSATPhaseSelectionStrategy
;
import
org.sat4j.minisat.orders.RSATPhaseSelectionStrategy
;
import
org.sat4j.minisat.orders.RandomLiteralSelectionStrategy
;
import
org.sat4j.minisat.orders.RandomWalkDecorator
;
import
org.sat4j.minisat.orders.UserFixedPhaseSelectionStrategy
;
import
org.sat4j.minisat.orders.UserFixedPhaseSelectionStrategy
;
import
org.sat4j.minisat.orders.VarOrderHeap
;
import
org.sat4j.minisat.orders.VarOrderHeap
;
import
org.sat4j.minisat.restarts.ArminRestarts
;
import
org.sat4j.minisat.restarts.ArminRestarts
;
...
@@ -1207,6 +1209,15 @@ public final class SolverFactory extends ASolverFactory<IPBSolver> {
...
@@ -1207,6 +1209,15 @@ public final class SolverFactory extends ASolverFactory<IPBSolver> {
return
solver
;
return
solver
;
}
}
public
static
IPBSolver
newCuttingPlanesGreedy
()
{
PBSolverCP
solver
=
newCuttingPlanes
();
IOrder
order
=
new
RandomWalkDecorator
((
VarOrderHeap
)
solver
.
getOrder
(),
1.0
);
order
.
setPhaseSelectionStrategy
(
new
RandomLiteralSelectionStrategy
());
solver
.
setOrder
(
order
);
return
solver
;
}
public
static
IPBSolver
newPartialRoundingSatPOS2020
()
{
public
static
IPBSolver
newPartialRoundingSatPOS2020
()
{
PBSolverCP
solver
=
(
PBSolverCP
)
newPartialRoundingSat
();
PBSolverCP
solver
=
(
PBSolverCP
)
newPartialRoundingSat
();
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/AtLeastPB.java
View file @
3610d72b
...
@@ -154,4 +154,16 @@ public final class AtLeastPB extends AtLeast implements PBConstr {
...
@@ -154,4 +154,16 @@ public final class AtLeastPB extends AtLeast implements PBConstr {
public
BigInteger
getSumCoefs
()
{
public
BigInteger
getSumCoefs
()
{
return
BigInteger
.
valueOf
(
size
());
return
BigInteger
.
valueOf
(
size
());
}
}
private
int
id
;
@Override
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
@Override
public
int
getId
()
{
return
id
;
}
}
}
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMap.java
View file @
3610d72b
...
@@ -31,11 +31,14 @@ package org.sat4j.pb.constraints.pb;
...
@@ -31,11 +31,14 @@ package org.sat4j.pb.constraints.pb;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
org.sat4j.core.LiteralsUtils
;
import
org.sat4j.core.VecInt
;
import
org.sat4j.core.VecInt
;
import
org.sat4j.minisat.constraints.cnf.Lits
;
import
org.sat4j.minisat.constraints.cnf.Lits
;
import
org.sat4j.minisat.core.ILits
;
import
org.sat4j.minisat.core.ILits
;
import
org.sat4j.minisat.core.VarActivityListener
;
import
org.sat4j.minisat.core.VarActivityListener
;
import
org.sat4j.pb.IPBSolverService
;
import
org.sat4j.pb.core.PBSolverStats
;
import
org.sat4j.pb.core.PBSolverStats
;
import
org.sat4j.pb.tools.PBSearchListener
;
import
org.sat4j.specs.IVecInt
;
import
org.sat4j.specs.IVecInt
;
import
org.sat4j.specs.IteratorInt
;
import
org.sat4j.specs.IteratorInt
;
...
@@ -176,6 +179,11 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -176,6 +179,11 @@ public class ConflictMap extends MapPb implements IConflict {
}
}
}
}
@Override
public
void
setListener
(
PBSearchListener
<
IPBSolverService
>
listener
)
{
this
.
listener
=
listener
;
}
/**
/**
* convert level into an index in the byLevel structure
* convert level into an index in the byLevel structure
*
*
...
@@ -278,6 +286,7 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -278,6 +286,7 @@ public class ConflictMap extends MapPb implements IConflict {
public
BigInteger
resolve
(
PBConstr
cpb
,
int
litImplied
,
public
BigInteger
resolve
(
PBConstr
cpb
,
int
litImplied
,
VarActivityListener
val
)
{
VarActivityListener
val
)
{
assert
litImplied
>
1
;
assert
litImplied
>
1
;
listener
.
withReason
(
cpb
);
preProcess
();
preProcess
();
int
nLitImplied
=
litImplied
^
1
;
int
nLitImplied
=
litImplied
^
1
;
if
(
cpb
==
null
||
!
this
.
weightedLits
.
containsKey
(
nLitImplied
))
{
if
(
cpb
==
null
||
!
this
.
weightedLits
.
containsKey
(
nLitImplied
))
{
...
@@ -388,6 +397,7 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -388,6 +397,7 @@ public class ConflictMap extends MapPb implements IConflict {
// coefficients of the conflict must be multiplied by coefMult
// coefficients of the conflict must be multiplied by coefMult
long
before
=
System
.
nanoTime
();
long
before
=
System
.
nanoTime
();
if
(!
this
.
coefMult
.
equals
(
BigInteger
.
ONE
))
{
if
(!
this
.
coefMult
.
equals
(
BigInteger
.
ONE
))
{
listener
.
multiplyConflict
(
coefMult
);
for
(
int
i
=
0
;
i
<
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
size
();
i
++)
{
changeCoef
(
i
,
this
.
weightedLits
.
getCoef
(
i
)
changeCoef
(
i
,
this
.
weightedLits
.
getCoef
(
i
)
.
multiply
(
this
.
coefMult
));
.
multiply
(
this
.
coefMult
));
...
@@ -720,6 +730,7 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -720,6 +730,7 @@ public class ConflictMap extends MapPb implements IConflict {
this
.
possReducedCoefs
=
this
.
possReducedCoefs
.
subtract
(
coefsBis
[
lit
]);
this
.
possReducedCoefs
=
this
.
possReducedCoefs
.
subtract
(
coefsBis
[
lit
]);
coefsBis
[
lit
]
=
BigInteger
.
ZERO
;
coefsBis
[
lit
]
=
BigInteger
.
ZERO
;
assert
this
.
possReducedCoefs
.
equals
(
possConstraint
(
wpb
,
coefsBis
));
assert
this
.
possReducedCoefs
.
equals
(
possConstraint
(
wpb
,
coefsBis
));
listener
.
weakenOnReason
(
LiteralsUtils
.
toDimacs
(
wpb
.
get
(
lit
)));
// saturation of the constraint
// saturation of the constraint
degUpdate
=
saturation
(
coefsBis
,
degUpdate
,
wpb
);
degUpdate
=
saturation
(
coefsBis
,
degUpdate
,
wpb
);
...
@@ -735,6 +746,7 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -735,6 +746,7 @@ public class ConflictMap extends MapPb implements IConflict {
assert
degree
.
signum
()
>
0
;
assert
degree
.
signum
()
>
0
;
BigInteger
degreeResult
=
degree
;
BigInteger
degreeResult
=
degree
;
boolean
isMinimumEqualsToDegree
=
true
;
boolean
isMinimumEqualsToDegree
=
true
;
boolean
useSaturation
=
false
;
int
comparison
;
int
comparison
;
for
(
int
i
=
0
;
i
<
coefs
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
coefs
.
length
;
i
++)
{
comparison
=
coefs
[
i
].
compareTo
(
degree
);
comparison
=
coefs
[
i
].
compareTo
(
degree
);
...
@@ -745,6 +757,7 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -745,6 +757,7 @@ public class ConflictMap extends MapPb implements IConflict {
this
.
possReducedCoefs
=
this
.
possReducedCoefs
.
add
(
degree
);
this
.
possReducedCoefs
=
this
.
possReducedCoefs
.
add
(
degree
);
}
}
coefs
[
i
]
=
degree
;
coefs
[
i
]
=
degree
;
useSaturation
=
true
;
}
else
if
(
comparison
<
0
&&
coefs
[
i
].
signum
()
>
0
)
{
}
else
if
(
comparison
<
0
&&
coefs
[
i
].
signum
()
>
0
)
{
isMinimumEqualsToDegree
=
false
;
isMinimumEqualsToDegree
=
false
;
}
}
...
@@ -764,6 +777,10 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -764,6 +777,10 @@ public class ConflictMap extends MapPb implements IConflict {
}
}
}
}
}
}
listener
.
divideReason
(
degree
);
}
if
(
useSaturation
)
{
listener
.
saturateReason
();
}
}
return
degreeResult
;
return
degreeResult
;
}
}
...
@@ -1023,7 +1040,6 @@ public class ConflictMap extends MapPb implements IConflict {
...
@@ -1023,7 +1040,6 @@ public class ConflictMap extends MapPb implements IConflict {
}
}
this
.
byLevel
[
0
].
push
(
lit
);
this
.
byLevel
[
0
].
push
(
lit
);
}
}
}
}
}
}
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMapClause.java
View file @
3610d72b
...
@@ -31,6 +31,8 @@ package org.sat4j.pb.constraints.pb;
...
@@ -31,6 +31,8 @@ package org.sat4j.pb.constraints.pb;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
org.sat4j.core.LiteralsUtils
;
public
final
class
ConflictMapClause
extends
ConflictMap
{
public
final
class
ConflictMapClause
extends
ConflictMap
{
public
ConflictMapClause
(
PBConstr
cpb
,
int
level
)
{
public
ConflictMapClause
(
PBConstr
cpb
,
int
level
)
{
...
@@ -68,8 +70,14 @@ public final class ConflictMapClause extends ConflictMap {
...
@@ -68,8 +70,14 @@ public final class ConflictMapClause extends ConflictMap {
reducedCoefs
[
i
]
=
BigInteger
.
ONE
;
reducedCoefs
[
i
]
=
BigInteger
.
ONE
;
}
else
{
}
else
{
reducedCoefs
[
i
]
=
BigInteger
.
ZERO
;