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
Romain WALLON
sat4j
Commits
83265ace
Commit
83265ace
authored
May 17, 2021
by
Daniel Le Berre
Browse files
added constraints for = in the same order as expected by VeriPB
parent
ea618d84
Changes
2
Hide whitespace changes
Inline
Side-by-side
org.sat4j.core/src/main/java/org/sat4j/minisat/core/Solver.java
View file @
83265ace
...
...
@@ -497,8 +497,8 @@ public class Solver<D extends DataStructureFactory>
public
IConstr
addExactly
(
IVecInt
literals
,
int
n
)
throws
ContradictionException
{
ConstrGroup
group
=
new
ConstrGroup
(
false
);
group
.
add
(
addAtMost
(
literals
,
n
));
group
.
add
(
addAtLeast
(
literals
,
n
));
group
.
add
(
addAtMost
(
literals
,
n
));
return
group
;
}
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolver.java
View file @
83265ace
...
...
@@ -164,10 +164,10 @@ public abstract class PBSolver extends Solver<PBDataStructureFactory>
assert
vlits
.
size
()
==
literals
.
size
();
assert
literals
.
size
()
==
coeffs
.
size
();
ConstrGroup
group
=
new
ConstrGroup
(
false
);
group
.
add
(
addConstr
(
this
.
dsfactory
.
createPseudoBooleanConstraint
(
vlits
,
coeffs
,
false
,
weight
)));
group
.
add
(
addConstr
(
this
.
dsfactory
.
createPseudoBooleanConstraint
(
vlits
,
coeffs
,
true
,
weight
)));
group
.
add
(
addConstr
(
this
.
dsfactory
.
createPseudoBooleanConstraint
(
vlits
,
coeffs
,
false
,
weight
)));
return
group
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment