1 package org.sat4j.tools;
2
3 import java.io.FileNotFoundException;
4 import java.io.FileOutputStream;
5 import java.io.PrintStream;
6
7 import org.sat4j.specs.IConstr;
8 import org.sat4j.specs.Lbool;
9 import org.sat4j.specs.SearchListener;
10
11
12
13
14 public class DecisionLevelTracing implements SearchListener {
15
16
17
18
19 private static final long serialVersionUID = 1L;
20
21 private final String filename;
22 private PrintStream out;
23
24 public DecisionLevelTracing(String filename) {
25 this.filename = filename;
26 updateWriter();
27 }
28
29 private void updateWriter() {
30 try {
31 out = new PrintStream(new FileOutputStream(filename + ".dat"));
32 } catch (FileNotFoundException e) {
33 out = System.out;
34 }
35 }
36
37 public void adding(int p) {
38
39
40 }
41
42 public void assuming(int p) {
43
44 }
45
46 public void backtracking(int p) {
47
48
49 }
50
51 public void beginLoop() {
52
53
54 }
55
56 public void conflictFound(IConstr confl, int dlevel, int trailLevel) {
57
58 }
59
60 public void conflictFound(int p) {
61
62
63 }
64
65 public void delete(int[] clause) {
66
67
68 }
69
70 public void end(Lbool result) {
71 out.close();
72 }
73
74 public void learn(IConstr c) {
75
76
77 }
78
79 public void propagating(int p, IConstr reason) {
80
81
82 }
83
84 public void solutionFound() {
85
86
87 }
88
89 public void start() {
90
91 }
92
93 public void restarting() {
94 }
95
96 public void backjump(int backjumpLevel) {
97 out.println(backjumpLevel);
98 }
99
100 }