Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
sat4j
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
51
Issues
51
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SAT4J
sat4j
Commits
c44dfa3a
Commit
c44dfa3a
authored
Oct 31, 2018
by
Anne Parrain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMap.java
...rc/main/java/org/sat4j/pb/constraints/pb/ConflictMap.java
+2
-0
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolverCP.java
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolverCP.java
+4
-4
org.sat4j.pb/src/main/java/org/sat4j/pb/tools/InprocCardConstrLearningSolver.java
...va/org/sat4j/pb/tools/InprocCardConstrLearningSolver.java
+2
-2
No files found.
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
Markdown
is supported
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