CBMC
satcheck_glucose.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 
10 #ifndef CPROVER_SOLVERS_SAT_SATCHECK_GLUCOSE_H
11 #define CPROVER_SOLVERS_SAT_SATCHECK_GLUCOSE_H
12 
13 #include "cnf.h"
14 
16 
17 #include <memory>
18 
19 // Select one: basic solver or with simplification.
20 // Note that the solver with simplifier isn't really robust
21 // when used incrementally, as variables may disappear
22 // unless set to 'frozen'.
23 
24 namespace Glucose // NOLINT(readability/namespace)
25 {
26 class Solver; // NOLINT(readability/identifiers)
27 class SimpSolver; // NOLINT(readability/identifiers)
28 }
29 
30 template <typename T>
32 {
33 public:
34  explicit satcheck_glucose_baset(message_handlert &message_handler);
38 
39  tvt l_get(literalt a) const override;
40 
41  void lcnf(const bvt &bv) override;
42  void set_assignment(literalt a, bool value) override;
43 
44  // extra MiniSat feature: default branching decision
45  void set_polarity(literalt a, bool value);
46 
47  bool is_in_conflict(literalt a) const override;
48  bool has_assumptions() const override
49  {
50  return true;
51  }
52  bool has_is_in_conflict() const override
53  {
54  return true;
55  }
56 
57 protected:
58  resultt do_prop_solve(const bvt &assumptions) override;
59 
60  std::unique_ptr<T> solver;
61 
62  void add_variables();
63 };
64 
66  public satcheck_glucose_baset<Glucose::Solver>
67 {
68 public:
70  std::string solver_text() const override;
71 };
72 
74  public satcheck_glucose_baset<Glucose::SimpSolver>
75 {
76 public:
78  std::string solver_text() const override;
79  void set_frozen(literalt a) override;
80  bool is_eliminated(literalt a) const;
81 };
82 
83 #endif // CPROVER_SOLVERS_SAT_SATCHECK_GLUCOSE_H
bool is_in_conflict(literalt a) const override
Returns true if an assumption is in the final conflict.
~satcheck_glucose_baset() override
A default destructor defined in the .cpp is used to ensure the unique_ptr to the solver is correctly ...
void lcnf(const bvt &bv) override
std::unique_ptr< T > solver
void set_polarity(literalt a, bool value)
satcheck_glucose_baset(message_handlert &message_handler)
tvt l_get(literalt a) const override
bool has_is_in_conflict() const override
resultt do_prop_solve(const bvt &assumptions) override
void set_assignment(literalt a, bool value) override
bool has_assumptions() const override
std::string solver_text() const override
void set_frozen(literalt a) override
std::string solver_text() const override
bool is_eliminated(literalt a) const
Definition: threeval.h:20
CNF Generation, via Tseitin.
Capability to collect the statistics of the complexity of individual solver queries.
std::vector< literalt > bvt
Definition: literal.h:201
resultt
The result of goto verifying.
Definition: properties.h:45