File tree 2 files changed +23
-2
lines changed 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ void satcheck_glucose_baset<T>::lcnf(const bvt &bv)
121
121
122
122
solver->addClause_ (c);
123
123
124
+ with_solver_hardness (
125
+ [&bv](solver_hardnesst &hardness) { hardness.register_clause (bv); });
126
+
124
127
clause_counter++;
125
128
}
126
129
catch (Glucose::OutOfMemoryException)
Original file line number Diff line number Diff line change 12
12
13
13
#include " cnf.h"
14
14
15
+ #include < solvers/hardness_collector.h>
16
+
15
17
// Select one: basic solver or with simplification.
16
18
// Note that the solver with simplifier isn't really robust
17
19
// when used incrementally, as variables may disappear
@@ -23,8 +25,8 @@ class Solver; // NOLINT(readability/identifiers)
23
25
class SimpSolver ; // NOLINT(readability/identifiers)
24
26
}
25
27
26
- template <typename T>
27
- class satcheck_glucose_baset : public cnf_solvert
28
+ template <typename T>
29
+ class satcheck_glucose_baset : public cnf_solvert , public hardness_collectort
28
30
{
29
31
public:
30
32
satcheck_glucose_baset (T *, message_handlert &message_handler);
@@ -51,13 +53,29 @@ class satcheck_glucose_baset:public cnf_solvert
51
53
return true ;
52
54
}
53
55
56
+ void
57
+ with_solver_hardness (std::function<void (solver_hardnesst &)> handler) override
58
+ {
59
+ if (solver_hardness.has_value ())
60
+ {
61
+ handler (solver_hardness.value ());
62
+ }
63
+ }
64
+
65
+ void enable_hardness_collection () override
66
+ {
67
+ solver_hardness = solver_hardnesst{};
68
+ }
69
+
54
70
protected:
55
71
resultt do_prop_solve () override ;
56
72
57
73
T *solver;
58
74
59
75
void add_variables ();
60
76
bvt assumptions;
77
+
78
+ optionalt<solver_hardnesst> solver_hardness;
61
79
};
62
80
63
81
class satcheck_glucose_no_simplifiert :
You can’t perform that action at this time.
0 commit comments