Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
SAT4J
sat4j
Commits
d39d0800
Commit
d39d0800
authored
Oct 19, 2017
by
Romain WALLON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Corrects the dot tracing
parent
68b18bc6
Pipeline
#292
passed with stages
in 23 minutes and 44 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
25 deletions
+20
-25
org.sat4j.core/src/main/java/org/sat4j/tools/DotSearchTracing.java
....core/src/main/java/org/sat4j/tools/DotSearchTracing.java
+15
-17
org.sat4j.pb/src/main/java/org/sat4j/pb/reader/OPBReader2005.java
...j.pb/src/main/java/org/sat4j/pb/reader/OPBReader2005.java
+3
-4
org.sat4j.sat/src/main/java/org/sat4j/sat/Lanceur.java
org.sat4j.sat/src/main/java/org/sat4j/sat/Lanceur.java
+1
-2
org.sat4j.sat/src/main/java/org/sat4j/sat/Solvers.java
org.sat4j.sat/src/main/java/org/sat4j/sat/Solvers.java
+1
-2
No files found.
org.sat4j.core/src/main/java/org/sat4j/tools/DotSearchTracing.java
View file @
d39d0800
...
@@ -67,23 +67,21 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
...
@@ -67,23 +67,21 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
*/
*/
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
final
Vec
<
String
>
pile
;
private
final
Vec
<
String
>
stack
;
private
String
currentNodeName
=
null
;
private
String
currentNodeName
=
null
;
private
transient
Writer
out
;
private
transient
Writer
out
;
private
boolean
estOrang
e
=
false
;
private
boolean
assertiv
e
=
false
;
private
Map
<
Integer
,
T
>
mapping
;
private
Map
<
Integer
,
T
>
mapping
;
/**
/**
* @since 2.1
* @since 2.1
*/
*/
public
DotSearchTracing
(
final
String
fileNameToSave
,
public
DotSearchTracing
(
final
String
fileNameToSave
)
{
Map
<
Integer
,
T
>
mapping
)
{
this
.
stack
=
new
Vec
<
String
>();
this
.
pile
=
new
Vec
<
String
>();
this
.
mapping
=
mapping
;
try
{
try
{
this
.
out
=
new
FileWriter
(
fileNameToSave
);
this
.
out
=
new
FileWriter
(
fileNameToSave
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
...
@@ -115,13 +113,13 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
...
@@ -115,13 +113,13 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
String
newName
;
String
newName
;
if
(
this
.
currentNodeName
==
null
)
{
if
(
this
.
currentNodeName
==
null
)
{
newName
=
""
+
absP
;
newName
=
Integer
.
toString
(
absP
)
;
this
.
pile
.
push
(
newName
);
this
.
stack
.
push
(
newName
);
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\", shape=circle, color=blue, style=filled]"
));
+
"\", shape=circle, color=blue, style=filled]"
));
}
else
{
}
else
{
newName
=
this
.
currentNodeName
;
newName
=
this
.
currentNodeName
;
this
.
pile
.
push
(
newName
);
this
.
stack
.
push
(
newName
);
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\", shape=circle, color=blue, style=filled]"
));
+
"\", shape=circle, color=blue, style=filled]"
));
}
}
...
@@ -133,12 +131,12 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
...
@@ -133,12 +131,12 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
*/
*/
@Override
@Override
public
final
void
propagating
(
final
int
p
)
{
public
final
void
propagating
(
final
int
p
)
{
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
"."
+
this
.
estOrang
e
;
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
"."
+
this
.
assertiv
e
;
if
(
this
.
currentNodeName
==
null
)
{
if
(
this
.
currentNodeName
==
null
)
{
saveLine
(
lineTab
(
"\"null\" [label=\"\", shape=point]"
));
saveLine
(
lineTab
(
"\"null\" [label=\"\", shape=point]"
));
}
}
final
String
couleur
=
this
.
estOrang
e
?
"orange"
:
"green"
;
final
String
couleur
=
this
.
assertiv
e
?
"orange"
:
"green"
;
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\",shape=point, color=black]"
));
+
"\",shape=point, color=black]"
));
...
@@ -147,14 +145,14 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
...
@@ -147,14 +145,14 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
+
"\", fontcolor ="
+
couleur
+
", color = "
+
couleur
+
"\", fontcolor ="
+
couleur
+
", color = "
+
couleur
+
", style = bold]"
));
+
", style = bold]"
));
this
.
currentNodeName
=
newName
;
this
.
currentNodeName
=
newName
;
this
.
estOrang
e
=
false
;
this
.
assertiv
e
=
false
;
}
}
@Override
@Override
public
final
void
enqueueing
(
final
int
p
,
IConstr
reason
)
{
public
final
void
enqueueing
(
final
int
p
,
IConstr
reason
)
{
if
(
reason
!=
null
)
{
if
(
reason
!=
null
)
{
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
"."
String
newName
=
this
.
currentNodeName
+
"."
+
p
+
".
propagated.
"
+
this
.
estOrang
e
;
+
this
.
assertiv
e
;
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
saveLine
(
lineTab
(
"\""
+
newName
+
"\""
+
"[label=\""
+
map
(
p
)
+
"\",shape=point, color=black]"
));
+
"\",shape=point, color=black]"
));
saveLine
(
lineTab
(
"\""
+
this
.
currentNodeName
+
"\""
+
" -- "
+
"\""
saveLine
(
lineTab
(
"\""
+
this
.
currentNodeName
+
"\""
+
" -- "
+
"\""
...
@@ -173,8 +171,8 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
...
@@ -173,8 +171,8 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
@Override
@Override
public
final
void
backtracking
(
final
int
p
)
{
public
final
void
backtracking
(
final
int
p
)
{
final
String
temp
=
this
.
pile
.
last
();
final
String
temp
=
this
.
stack
.
last
();
this
.
pile
.
pop
();
this
.
stack
.
pop
();
saveLine
(
"\""
+
temp
+
"\""
+
"--"
+
"\""
+
this
.
currentNodeName
+
"\""
saveLine
(
"\""
+
temp
+
"\""
+
"--"
+
"\""
+
this
.
currentNodeName
+
"\""
+
"[label=\"\", color=red, style=dotted]"
);
+
"[label=\"\", color=red, style=dotted]"
);
this
.
currentNodeName
=
temp
;
this
.
currentNodeName
=
temp
;
...
@@ -182,7 +180,7 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
...
@@ -182,7 +180,7 @@ public class DotSearchTracing<T> extends SearchListenerAdapter<ISolverService>
@Override
@Override
public
final
void
adding
(
final
int
p
)
{
public
final
void
adding
(
final
int
p
)
{
this
.
estOrang
e
=
true
;
this
.
assertiv
e
=
true
;
}
}
/**
/**
...
...
org.sat4j.pb/src/main/java/org/sat4j/pb/reader/OPBReader2005.java
View file @
d39d0800
...
@@ -704,10 +704,9 @@ public class OPBReader2005 extends Reader implements Serializable {
...
@@ -704,10 +704,9 @@ public class OPBReader2005 extends Reader implements Serializable {
readMetaData
();
readMetaData
();
skipComments
();
if
(
mapping
!=
null
)
{
readVariablesExplanation
();
readVariablesExplanation
();
}
skipComments
();
skipComments
();
readObjective
();
readObjective
();
...
...
org.sat4j.sat/src/main/java/org/sat4j/sat/Lanceur.java
View file @
d39d0800
...
@@ -172,8 +172,7 @@ public class Lanceur extends AbstractLauncher implements ILogAble {
...
@@ -172,8 +172,7 @@ public class Lanceur extends AbstractLauncher implements ILogAble {
if
(
dotfilename
==
null
)
{
if
(
dotfilename
==
null
)
{
dotfilename
=
"sat4j.dot"
;
dotfilename
=
"sat4j.dot"
;
}
}
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
,
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
));
null
));
}
}
if
(
cmd
.
hasOption
(
"m"
))
{
if
(
cmd
.
hasOption
(
"m"
))
{
...
...
org.sat4j.sat/src/main/java/org/sat4j/sat/Solvers.java
View file @
d39d0800
...
@@ -392,8 +392,7 @@ public final class Solvers {
...
@@ -392,8 +392,7 @@ public final class Solvers {
if
(
dotfilename
==
null
)
{
if
(
dotfilename
==
null
)
{
dotfilename
=
"sat4j.dot"
;
dotfilename
=
"sat4j.dot"
;
}
}
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
,
asolver
.
setSearchListener
(
new
DotSearchTracing
(
dotfilename
));
null
));
}
}
return
asolver
;
return
asolver
;
...
...
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