ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
simplification_equivalence.h
Go to the documentation of this file.
1#ifndef _ESBMC_PROP_SMT_SIMPLIFICATION_EQUIVALENCE_H_
2#define _ESBMC_PROP_SMT_SIMPLIFICATION_EQUIVALENCE_H_
3
4#include <atomic>
5#include <map>
6#include <memory>
7#include <mutex>
8#include <string>
9#include <thread>
10#include <irep2/irep2_expr.h>
12#include <util/config/options.h>
13
27
28class smt_convt;
29
46{
47public:
49 const namespacet &ns,
50 const optionst &options);
52
56 const expr2tc &before,
57 const expr2tc &after,
58 std::string *witness = nullptr);
59
60private:
64 void record_witness(
65 const expr2tc &before,
66 const expr2tc &after,
67 smt_convt &ctx,
68 std::string &witness);
69
71 smt_convt &solver();
74 void drop_solver();
75
76 namespacet ns;
77 optionst options;
78 std::mutex solvers_mutex;
79 std::map<std::thread::id, std::unique_ptr<smt_convt>> solvers;
80};
81
84 const expr2tc &before,
85 const expr2tc &after,
86 const namespacet &ns,
87 const optionst &options);
88
93 const namespacet &ns,
94 const optionst &options);
95
105
110{
111extern std::atomic<unsigned long> proved;
112extern std::atomic<unsigned long> declined;
116extern std::atomic<unsigned long> ill_sorted;
119extern std::atomic<unsigned long> violations;
120
121void report();
122} // namespace simplification_check_stats
123
124#endif
Definition namespace.h:10
Definition options.h:11
simplification_equivalencet check(const expr2tc &before, const expr2tc &after, std::string *witness=nullptr)
Definition simplification_equivalence.cpp:409
simplification_equivalence_checkert(const namespacet &ns, const optionst &options)
Definition simplification_equivalence.cpp:336
Slim, frontend-facing SMT interface.
Definition smt_conv.h:30
irep_container< expr2t > expr2tc
Definition irep2.h:431
How much check() actually decided, over every caller.
Definition simplification_equivalence.cpp:547
std::atomic< unsigned long > violations
Rewrites the check rejected.
Definition simplification_equivalence.cpp:551
void report()
Definition simplification_equivalence.cpp:553
std::atomic< unsigned long > declined
Definition simplification_equivalence.cpp:549
std::atomic< unsigned long > proved
Definition simplification_equivalence.cpp:548
std::atomic< unsigned long > ill_sorted
Of the declines, those whose before was already ill-sorted – a defect elsewhere in ESBMC rather than ...
Definition simplification_equivalence.cpp:550
simplification_equivalencet check_simplification_equivalence(const expr2tc &before, const expr2tc &after, const namespacet &ns, const optionst &options)
One-shot convenience over the above; builds and discards a solver.
Definition simplification_equivalence.cpp:481
void install_simplification_equivalence_check(const namespacet &ns, const optionst &options)
Install the above as simplify()'s checker for the rest of the run: every rewrite is proved,...
Definition simplification_equivalence.cpp:490
simplification_equivalencet
Verdict on one simplifier rewrite (esbmc/esbmc#4625).
Definition simplification_equivalence.h:16
@ differs
The solver found a valuation where they differ: a simplifier bug.
Definition simplification_equivalence.h:20
@ malformed
after has operands whose sorts disagree: also a simplifier bug, and one that would abort any backend ...
Definition simplification_equivalence.h:23
@ equivalent
The solver proved before == after for every valuation.
Definition simplification_equivalence.h:18
@ skipped
Not decided – a shape the check declines, or a solver failure.
Definition simplification_equivalence.h:25
Reports the stats and uninstalls the checker when it goes out of scope.
Definition simplification_equivalence.h:102
~simplification_check_scopet()
Definition simplification_equivalence.cpp:534