|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
Path-condition guard container. More...
#include <irep2_guard.h>
Public Member Functions | |
| guard2tc ()=default | |
| guard2tc (const guard2tc &)=default | |
| guard2tc (guard2tc &&) noexcept=default | |
| guard2tc & | operator= (const guard2tc &)=default |
| guard2tc & | operator= (guard2tc &&) noexcept=default |
| void | add (const expr2tc &expr) |
| void | append (const guard2tc &other) |
| expr2tc | as_expr () const |
| void | guard_expr (expr2tc &dest) const |
| bool | disjunction_may_simplify (const guard2tc &other) const |
| bool | is_true () const |
| bool | is_false () const |
| void | make_true () |
| void | make_false () |
| void | swap (guard2tc &)=delete |
| Deleted. | |
| void | dump () const |
| Public Member Functions inherited from irep_container< expr2t > | |
| constexpr | irep_container () noexcept |
| irep_container (const irep_container &ref) noexcept | |
| irep_container (irep_container &&ref) noexcept | |
| ~irep_container () | |
| irep_container & | operator= (const irep_container &ref) noexcept |
| irep_container & | operator= (irep_container &&ref) noexcept |
| const expr2t & | operator* () const noexcept |
| const expr2t * | operator-> () const noexcept |
| const expr2t * | get () const noexcept |
| expr2t * | get () |
| expr2t & | operator* () |
| expr2t * | operator-> () |
| operator bool () const noexcept | |
| void | reset () noexcept |
| void | detach () |
| void | swap (irep_container &b) noexcept |
| irep_container | simplify () const |
| size_t | crc () const |
Public Attributes | |
| guard_seq | guard_list |
Friends | |
| guard2tc & | operator-= (guard2tc &g1, const guard2tc &g2) |
| guard2tc & | operator|= (guard2tc &g1, const guard2tc &g2) |
| bool | operator== (const guard2tc &g1, const guard2tc &g2) |
Path-condition guard container.
guard2tc extends expr2tc with a flat list of conjuncts (guard_list) accumulated along an execution path. Wherever an expr2tc is expected, a guard2tc works directly because it is an expr2tc.
Mutators maintain the expr2tc base incrementally as the and-chain of the current conjuncts (matching the historic guardt::g_expr/build_guard_expr split), so as_expr() and implicit conversions are pure reads. goto_symext::prefix_index keys a cache on this chain's nodes and relies on it being left-leaning. A default-constructed guard has an empty list and a nil base; as_expr() then short-circuits to gen_true_expr() without touching the base.
Invariant: guard_list is treated as a set of conjuncts — no duplicates are expected since x && x ≡ x. operator-= and operator|= use hash-set membership probes which give set rather than multiset semantics; symex's natural pattern of adding fresh branch symbols preserves uniqueness. Injecting the same conjunct twice leaves a logically-redundant duplicate in the list and weakens the set-op equality guarantees but does not produce unsound path conditions.
|
default |
|
default |
|
defaultnoexcept |
| void guard2tc::add | ( | const expr2tc & | expr | ) |
| void guard2tc::append | ( | const guard2tc & | other | ) |
| expr2tc guard2tc::as_expr | ( | ) | const |
| void guard2tc::dump | ( | ) | const |
| void guard2tc::guard_expr | ( | expr2tc & | dest | ) | const |
| bool guard2tc::is_false | ( | ) | const |
| bool guard2tc::is_true | ( | ) | const |
| void guard2tc::make_false | ( | ) |
| void guard2tc::make_true | ( | ) |
|
delete |
Deleted.
The inherited irep_container::swap would silently swap only the expr2tc base and leave guard_list desynced — use g = std::move(other) instead, which moves both members atomically and is one-way (cheaper than swap when the source goes out of scope immediately after).
| guard_seq guard2tc::guard_list |