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
c44dfa3a
Commit
c44dfa3a
authored
Oct 31, 2018
by
Anne Parrain
Browse files
confl.updateSlack() is now called inside confl.setDecisionLevel()
parent
54b0b4a6
Pipeline
#3254
failed with stages
in 3 minutes and 5 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMap.java
View file @
c44dfa3a
...
...
@@ -576,6 +576,8 @@ public class ConflictMap extends MapPb implements IConflict {
public
void
setDecisionLevel
(
int
dl
)
{
assert
dl
<=
this
.
currentLevel
;
if
(
dl
<
this
.
currentLevel
)
this
.
updateSlack
(
dl
);
this
.
currentLevel
=
dl
;
}
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolverCP.java
View file @
c44dfa3a
...
...
@@ -137,6 +137,7 @@ public class PBSolverCP extends PBSolver {
int
litImplied
=
this
.
trail
.
last
();
int
currentLevel
=
this
.
voc
.
getLevel
(
litImplied
);
IConflict
confl
=
chooseConflict
((
PBConstr
)
myconfl
,
currentLevel
);
confl
.
setDecisionLevel
(
currentLevel
);
assert
confl
.
slackConflict
().
signum
()
<
0
;
while
(!
confl
.
isUnsat
()
&&
!
confl
.
isAssertive
(
currentLevel
))
{
if
(!
this
.
undertimeout
)
{
...
...
@@ -144,7 +145,6 @@ public class PBSolverCP extends PBSolver {
}
PBConstr
constraint
=
(
PBConstr
)
this
.
voc
.
getReason
(
litImplied
);
// result of the resolution is in the conflict (confl)
confl
.
setDecisionLevel
(
currentLevel
);
confl
.
resolve
(
constraint
,
litImplied
,
this
);
updateNumberOfReductions
(
confl
);
assert
confl
.
slackConflict
().
signum
()
<
0
;
...
...
@@ -160,10 +160,10 @@ public class PBSolverCP extends PBSolver {
if
(
this
.
voc
.
getLevel
(
litImplied
)
!=
currentLevel
)
{
this
.
trailLim
.
pop
();
slistener
.
backtracking
(
LiteralsUtils
.
toDimacs
(
litImplied
));
confl
.
updateSlack
(
this
.
voc
.
getLevel
(
litImplied
));
}
assert
this
.
voc
.
getLevel
(
litImplied
)
<=
currentLevel
;
currentLevel
=
this
.
voc
.
getLevel
(
litImplied
);
confl
.
setDecisionLevel
(
currentLevel
);
assert
confl
.
slackIsCorrect
(
currentLevel
);
assert
currentLevel
==
decisionLevel
();
assert
litImplied
>
1
;
...
...
@@ -212,8 +212,8 @@ public class PBSolverCP extends PBSolver {
+
this
.
getClass
().
getName
()
+
")\n"
+
(
this
.
noRemove
?
""
:
prefix
+
" - Removing satisfied literals at a higher level before CP \n"
)
+
(
this
.
skipAllow
?
prefix
+
" - Skipping as much as possible cutting planes during analysis conflict- Jan Elffers's algorithm \n"
+
(
this
.
skipAllow
?
prefix
+
" - Skipping as much as possible cutting planes during analysis conflict- Jan Elffers's algorithm \n"
:
""
)
+
prefix
+
" - "
+
autoDivisionStrategy
+
"\n"
+
prefix
+
" - "
+
postprocess
+
"\n"
+
prefix
+
" - "
+
conflictFactory
+
"\n"
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/tools/InprocCardConstrLearningSolver.java
View file @
c44dfa3a
...
...
@@ -168,6 +168,7 @@ public class InprocCardConstrLearningSolver extends PBSolverCP {
int
litImplied
=
this
.
trail
.
last
();
int
currentLevel
=
this
.
voc
.
getLevel
(
litImplied
);
IConflict
confl
=
chooseConflict
((
PBConstr
)
myconfl
,
currentLevel
);
confl
.
setDecisionLevel
(
currentLevel
);
assert
confl
.
slackConflict
().
signum
()
<
0
;
while
(!
confl
.
isAssertive
(
currentLevel
))
{
if
(!
this
.
undertimeout
)
{
...
...
@@ -182,7 +183,6 @@ public class InprocCardConstrLearningSolver extends PBSolverCP {
constraint
=
(
PBConstr
)
extendedConstr
;
}
// result of the resolution is in the conflict (confl)
confl
.
setDecisionLevel
(
currentLevel
);
confl
.
resolve
(
constraint
,
litImplied
,
this
);
updateNumberOfReductions
(
confl
);
assert
confl
.
slackConflict
().
signum
()
<
0
;
...
...
@@ -199,10 +199,10 @@ public class InprocCardConstrLearningSolver extends PBSolverCP {
if
(
this
.
voc
.
getLevel
(
litImplied
)
!=
currentLevel
)
{
this
.
trailLim
.
pop
();
slistener
.
backtracking
(
LiteralsUtils
.
toDimacs
(
litImplied
));
confl
.
updateSlack
(
this
.
voc
.
getLevel
(
litImplied
));
}
assert
this
.
voc
.
getLevel
(
litImplied
)
<=
currentLevel
;
currentLevel
=
this
.
voc
.
getLevel
(
litImplied
);
confl
.
setDecisionLevel
(
currentLevel
);
assert
confl
.
slackIsCorrect
(
currentLevel
);
assert
currentLevel
==
decisionLevel
();
assert
litImplied
>
1
;
...
...
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