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
53
Issues
53
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
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
3fc24511
Commit
3fc24511
authored
Jul 15, 2020
by
Romain WALLON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More statistics for the different strategies
parent
e19a5e18
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
3 deletions
+66
-3
org.sat4j.core/src/main/java/org/sat4j/minisat/core/GlucoseLCDS.java
...ore/src/main/java/org/sat4j/minisat/core/GlucoseLCDS.java
+6
-1
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMap.java
...rc/main/java/org/sat4j/pb/constraints/pb/ConflictMap.java
+10
-2
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolverStats.java
...t4j.pb/src/main/java/org/sat4j/pb/core/PBSolverStats.java
+41
-0
org.sat4j.pb/src/main/java/org/sat4j/pb/lcds/PBGlucoseLCDS.java
...t4j.pb/src/main/java/org/sat4j/pb/lcds/PBGlucoseLCDS.java
+9
-0
No files found.
org.sat4j.core/src/main/java/org/sat4j/minisat/core/GlucoseLCDS.java
View file @
3fc24511
...
...
@@ -51,7 +51,7 @@ class GlucoseLCDS<D extends DataStructureFactory>
/**
*
*/
pr
ivate
final
Solver
<
D
>
solver
;
pr
otected
final
Solver
<
D
>
solver
;
private
static
final
long
serialVersionUID
=
1L
;
private
int
[]
flags
=
new
int
[
0
];
private
int
flag
=
0
;
...
...
@@ -75,6 +75,7 @@ class GlucoseLCDS<D extends DataStructureFactory>
}
else
{
c
.
remove
(
solver
);
solver
.
slistener
.
delete
(
c
);
onRemove
(
c
);
}
}
if
(
solver
.
isVerbose
())
{
...
...
@@ -88,6 +89,10 @@ class GlucoseLCDS<D extends DataStructureFactory>
}
protected
void
onRemove
(
Constr
c
)
{
// Nothing to do by default.
}
public
ConflictTimer
getTimer
()
{
return
this
.
timer
;
}
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/constraints/pb/ConflictMap.java
View file @
3fc24511
...
...
@@ -386,12 +386,15 @@ public class ConflictMap extends MapPb implements IConflict {
}
// coefficients of the conflict must be multiplied by coefMult
long
before
=
System
.
nanoTime
();
if
(!
this
.
coefMult
.
equals
(
BigInteger
.
ONE
))
{
for
(
int
i
=
0
;
i
<
size
();
i
++)
{
changeCoef
(
i
,
this
.
weightedLits
.
getCoef
(
i
)
.
multiply
(
this
.
coefMult
));
}
}
long
after
=
System
.
nanoTime
();
stats
.
incTimeForArithmeticOperations
(
after
-
before
);
}
assert
slackConflict
().
signum
()
<
0
;
...
...
@@ -674,8 +677,13 @@ public class ConflictMap extends MapPb implements IConflict {
* second integer
* @return the least common factor
*/
protected
static
BigInteger
ppcm
(
BigInteger
a
,
BigInteger
b
)
{
return
a
.
divide
(
a
.
gcd
(
b
)).
multiply
(
b
);
protected
BigInteger
ppcm
(
BigInteger
a
,
BigInteger
b
)
{
long
before
=
System
.
nanoTime
();
BigInteger
lcm
=
a
.
divide
(
a
.
gcd
(
b
)).
multiply
(
b
);
long
after
=
System
.
nanoTime
();
stats
.
incTimeForArithmeticOperations
(
after
-
before
);
return
lcm
;
}
/**
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/core/PBSolverStats.java
View file @
3fc24511
...
...
@@ -30,6 +30,7 @@
package
org.sat4j.pb.core
;
import
java.io.PrintWriter
;
import
java.math.BigInteger
;
import
org.sat4j.minisat.core.SolverStats
;
...
...
@@ -72,6 +73,14 @@ public class PBSolverStats extends SolverStats {
private
long
falsifiedLiteralsRemovedFromReason
;
private
long
timeForArtithmeticOperations
;
private
BigInteger
minRemoved
;
private
BigInteger
maxRemoved
;
private
int
nbRemoved
;
@Override
public
void
reset
()
{
super
.
reset
();
...
...
@@ -136,6 +145,14 @@ public class PBSolverStats extends SolverStats {
out
.
println
(
prefix
+
"number of falsified literals weakened from conflict\t: "
+
this
.
falsifiedLiteralsRemovedFromConflict
);
out
.
println
(
prefix
+
"time for arithmetic operations\t: "
+
this
.
timeForArtithmeticOperations
);
out
.
println
(
prefix
+
"minimum degree of deleted constraints\t: "
+
this
.
minRemoved
);
out
.
println
(
prefix
+
"maximum degree of deleted constraints\t: "
+
this
.
maxRemoved
);
out
.
println
(
prefix
+
"number of deleted constraints\t: "
+
this
.
nbRemoved
);
}
public
long
getNumberOfReductions
()
{
...
...
@@ -260,4 +277,28 @@ public class PBSolverStats extends SolverStats {
}
public
void
incTimeForArithmeticOperations
(
long
time
)
{
this
.
timeForArtithmeticOperations
+=
time
;
}
public
void
setMinRemoved
(
BigInteger
minRemoved
)
{
if
(
minRemoved
==
null
)
{
this
.
minRemoved
=
minRemoved
;
}
else
{
this
.
minRemoved
=
this
.
minRemoved
.
min
(
minRemoved
);
}
}
public
void
setMaxRemoved
(
BigInteger
maxRemoved
)
{
if
(
maxRemoved
==
null
)
{
this
.
maxRemoved
=
maxRemoved
;
}
else
{
this
.
maxRemoved
=
this
.
maxRemoved
.
max
(
maxRemoved
);
}
}
public
void
incNbRemoved
()
{
this
.
nbRemoved
++;
}
}
org.sat4j.pb/src/main/java/org/sat4j/pb/lcds/PBGlucoseLCDS.java
View file @
3fc24511
...
...
@@ -9,6 +9,7 @@ import org.sat4j.minisat.core.Glucose2LCDS;
import
org.sat4j.minisat.core.LearnedConstraintsDeletionStrategy
;
import
org.sat4j.minisat.core.Solver
;
import
org.sat4j.pb.constraints.pb.PBConstr
;
import
org.sat4j.pb.core.PBSolverStats
;
import
org.sat4j.specs.Constr
;
/**
...
...
@@ -81,4 +82,12 @@ public class PBGlucoseLCDS<D extends DataStructureFactory>
+
lbdStrategy
;
}
@Override
protected
void
onRemove
(
Constr
c
)
{
PBConstr
constr
=
(
PBConstr
)
c
;
PBSolverStats
stats
=
(
PBSolverStats
)
solver
.
getStats
();
stats
.
incNbRemoved
();
stats
.
setMinRemoved
(
constr
.
getDegree
());
stats
.
setMaxRemoved
(
constr
.
getDegree
());
}
}
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