Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <probing.h>
Public Member Functions | |
Prober (Model *model) | |
bool | ProbeBooleanVariables (double deterministic_time_limit) |
bool | ProbeBooleanVariables (double deterministic_time_limit, absl::Span< const BooleanVariable > bool_vars) |
bool | ProbeOneVariable (BooleanVariable b) |
bool | ProbeDnf (absl::string_view name, absl::Span< const std::vector< Literal > > dnf) |
int | num_decisions () const |
int | num_new_literals_fixed () const |
int | num_new_binary_clauses () const |
void | SetPropagationCallback (std::function< void(Literal decision)> f) |
|
explicit |
Definition at line 48 of file probing.cc.
|
inline |
Statistics. They are reset each time ProbleBooleanVariables() is called. Note however that we do not reset them on a call to ProbeOneVariable().
|
inline |
|
inline |
bool operations_research::sat::Prober::ProbeBooleanVariables | ( | double | deterministic_time_limit | ) |
Fixes Booleans variables to true/false and see what is propagated. This can:
Returns false if the problem was proved INFEASIBLE during probing.
Definition at line 59 of file probing.cc.
bool operations_research::sat::Prober::ProbeBooleanVariables | ( | double | deterministic_time_limit, |
absl::Span< const BooleanVariable > | bool_vars ) |
Same as above method except it probes only on the variables given in 'bool_vars'.
Reset statistics.
Resize the propagated sparse bitset.
Reset the solver in case it was already used.
Propagate b=1 and then b=0.
Update stats.
Display stats.
Definition at line 220 of file probing.cc.
bool operations_research::sat::Prober::ProbeDnf | ( | absl::string_view | name, |
absl::Span< const std::vector< Literal > > | dnf ) |
Probes the given problem DNF (disjunction of conjunctions). Since one of the conjunction must be true, we might be able to fix literal or improve integer bounds if all conjunction propagate the same thing.
Reset the solver in case it was already used.
We can exit safely as nothing will be propagated.
If the literal has been pushed without any conflict, the level should have been increased.
Process propagated literals.
Process propagated integer bounds.
Fix literals implied by the dnf.
Fix integer bounds implied by the dnf.
Definition at line 302 of file probing.cc.
bool operations_research::sat::Prober::ProbeOneVariable | ( | BooleanVariable | b | ) |
Resize the propagated sparse bitset.
Reset the solver in case it was already used.
Statistics
Definition at line 203 of file probing.cc.
|
inline |
Register a callback that will be called on each "propagation". One can inspect the VariablesAssignment to see what are the inferred literals.