ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
smt_conv.h
Go to the documentation of this file.
1#ifndef _ESBMC_PROP_SMT_SMT_CONV_H_
2#define _ESBMC_PROP_SMT_SMT_CONV_H_
3
4#include <memory>
5#include <string>
6#include <unordered_set>
7#include <irep2/irep2.h>
10
11// Forward declaration only: the full solver implementation lives in
12// smt_solver.h and is deliberately NOT pulled in here, so that including
13// smt_conv.h does not expose smt_astt / smt_sortt / ast_vec or the AST/sort
14// construction machinery to the rest of ESBMC.
16
30{
31public:
32 explicit smt_convt(std::unique_ptr<smt_solver_baset> impl);
34
35 // --- Minimal external API, forwarded to the implementation ---
36
37 void push_ctx();
38 void pop_ctx();
42 smt_resultt dec_solve_assuming(const std::vector<expr2tc> &assumptions);
43 bool supports_assumptions() const;
44 void pre_solve();
45 const std::string solver_text();
46
51 void convert_ast(const expr2tc &expr);
52 void convert_assign(const expr2tc &expr);
55 void define(const expr2tc &expr);
56
59 const expr2tc &guard,
60 const expr2tc &addr_symbol,
61 const expr2tc &new_size);
62
64 expr2tc get(const expr2tc &expr);
65 expr2tc get_by_type(const expr2tc &expr);
66 expr2tc get_by_ast(const expr2tc &expr);
67
69 tvt l_get(const expr2tc &expr);
70
74 bool has_model() const;
75
77 void assert_expr(const expr2tc &e);
84 const expr2tc &expr,
85 std::unordered_set<const expr2t *> &seen);
89 void begin_step(const expr2tc &guard, const expr2tc &cond);
90 void note_assignment(const expr2tc &lhs, const expr2tc &rhs);
91 void end_step();
92
94 void dump_expr(const expr2tc &expr);
95 std::string dump_smt();
96 void print_model();
97
98private:
99 std::unique_ptr<smt_solver_baset> solver_impl;
100};
101
102#endif /* _ESBMC_PROP_SMT_SMT_CONV_H_ */
void note_assignment(const expr2tc &lhs, const expr2tc &rhs)
Definition smt_conv.cpp:97
tvt l_get(const expr2tc &expr)
Boolean model value of an expression.
Definition smt_conv.cpp:70
const std::string solver_text()
Definition smt_conv.cpp:50
void convert_ast(const expr2tc &expr)
Encode an expression into the solver context.
Definition smt_conv.cpp:107
smt_resultt dec_solve_assuming(const std::vector< expr2tc > &assumptions)
Solve with each boolean expression in assumptions held true for this query only.
Definition smt_conv.cpp:27
void print_model()
Definition smt_conv.cpp:137
void push_ctx()
Definition smt_conv.cpp:11
void pop_ctx()
Definition smt_conv.cpp:16
void convert_assign(const expr2tc &expr)
Definition smt_conv.cpp:114
expr2tc get(const expr2tc &expr)
Fetch the model value of an expression.
Definition smt_conv.cpp:55
expr2tc get_by_type(const expr2tc &expr)
Definition smt_conv.cpp:60
expr2tc get_by_ast(const expr2tc &expr)
Definition smt_conv.cpp:65
void note_division_operands(const expr2tc &expr, std::unordered_set< const expr2t * > &seen)
Record divisions in expr so the modulus conversion can lower a remainder compositionally exactly when...
Definition smt_conv.cpp:85
void dump_expr(const expr2tc &expr)
Convert and dump an expression in SMT format (–ssa-smt-trace).
Definition smt_conv.cpp:127
bool supports_assumptions() const
Definition smt_conv.cpp:40
void pre_solve()
Definition smt_conv.cpp:45
bool has_model() const
Whether a satisfiable result can be turned into a model.
Definition smt_conv.cpp:75
void assert_expr(const expr2tc &e)
Assert a boolean expression into the solver context.
Definition smt_conv.cpp:80
smt_convt(std::unique_ptr< smt_solver_baset > impl)
Definition smt_conv.cpp:4
void define(const expr2tc &expr)
Like convert_assign, but only binds the symbol to its value; nothing is asserted.
Definition smt_conv.cpp:35
void begin_step(const expr2tc &guard, const expr2tc &cond)
Bracket the conversion of one SSA step by its guard and condition, and name the assignment it makes,...
Definition smt_conv.cpp:92
void renumber_symbol_address(const expr2tc &guard, const expr2tc &addr_symbol, const expr2tc &new_size)
Re-register the address-space entry for a renumbered dynamic object.
Definition smt_conv.cpp:119
smt_resultt dec_solve()
Definition smt_conv.cpp:21
void end_step()
Definition smt_conv.cpp:102
std::string dump_smt()
Definition smt_conv.cpp:132
The base SMT-conversion class/interface.
Definition smt_solver.h:170
Definition threeval.h:10
pthread_cond_t cond
Definition cuda.h:50
Classes and definitions for non-stringy internal representation.
irep_container< expr2t > expr2tc
Definition irep2.h:431
smt_resultt
Result of a call to dec_solve.
Definition smt_result.h:7