CBMC
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
bv_refinement.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Abstraction Refinement Loop
4
5Author: Daniel Kroening, kroening@kroening.com
6
7\*******************************************************************/
8
11
12#ifndef CPROVER_SOLVERS_REFINEMENT_BV_REFINEMENT_H
13#define CPROVER_SOLVERS_REFINEMENT_BV_REFINEMENT_H
14
16
17#define MAX_STATE 10000
18
20{
21private:
22 struct configt
23 {
24 bool output_xml = false;
28 bool refine_arrays=true;
31 };
32public:
33 struct infot:public configt
34 {
35 const namespacet *ns=nullptr;
36 propt *prop=nullptr;
38 };
39
40 explicit bv_refinementt(const infot &info);
41
43
44 std::string decision_procedure_text() const override
45 {
46 return "refinement loop with "+prop.solver_text();
47 }
48
49protected:
50
51 // Refine array
52 void finish_eager_conversion_arrays() override;
53
54 // Refine arithmetic
55 bvt convert_mult(const mult_exprt &expr) override;
56 bvt convert_div(const div_exprt &expr) override;
57 bvt convert_mod(const mod_exprt &expr) override;
59
60private:
61 // the list of operator approximations
62 struct approximationt final
63 {
64 public:
65 explicit approximationt(std::size_t _id_nr):
66 no_operands(0),
67 under_state(0),
68 over_state(0),
70 {
71 }
72
74 std::size_t no_operands;
75
78
79 std::vector<exprt> under_assumptions;
80 std::vector<exprt> over_assumptions;
81
82 // the kind of under- or over-approximation
84
85 std::string as_string() const;
86
89
90 std::size_t id_nr;
91 };
92
94 approximationt &add_approximation(const exprt &expr, bvt &bv);
100 void check_SAT();
101 void check_UNSAT();
104
105 // MEMBERS
106
108 std::list<approximationt> approximations;
109
110protected:
111 // use gui format
113};
114
115#endif // CPROVER_SOLVERS_REFINEMENT_BV_REFINEMENT_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
bvt convert_mult(const mult_exprt &expr) override
decision_proceduret::resultt dec_solve(const exprt &) override
Implementation of the decision procedure.
bvt convert_div(const div_exprt &expr) override
std::string decision_procedure_text() const override
Return a textual description of the decision procedure.
bool conflicts_with(approximationt &approximation)
check if an under-approximation is part of the conflict
approximationt & add_approximation(const exprt &expr, bvt &bv)
void freeze_lazy_constraints()
freeze symbols for incremental solving
void arrays_overapproximated()
check whether counterexample is spurious
void get_values(approximationt &approximation)
void finish_eager_conversion_arrays() override
generate array constraints
bvt convert_mod(const mod_exprt &expr) override
bvt convert_floatbv_op(const ieee_float_op_exprt &) override
void initialize(approximationt &approximation)
std::list< approximationt > approximations
resultt
Result of running the decision procedure.
Division.
Definition std_expr.h:1157
Base class for all expressions.
Definition expr.h:56
IEEE floating-point operations These have two data operands (op0 and op1) and one rounding mode (op2)...
Modulo defined as lhs-(rhs * truncate(lhs/rhs)).
Definition std_expr.h:1228
Binary multiplication Associativity is not specified.
Definition std_expr.h:1107
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
TO_BE_DOCUMENTED.
Definition prop.h:25
virtual std::string solver_text() const =0
std::vector< literalt > bvt
Definition literal.h:201
resultt
The result of goto verifying.
Definition properties.h:45
std::vector< exprt > over_assumptions
std::vector< exprt > under_assumptions
approximationt(std::size_t _id_nr)
unsigned max_node_refinement
Max number of times we refine a formula node.
bool refine_arrays
Enable array refinement.
bool refine_arithmetic
Enable arithmetic refinement.
const namespacet * ns
message_handlert * message_handler