|
CBMC
|
#include <prop_conv_solver.h>
Inheritance diagram for prop_conv_solvert:
Collaboration diagram for prop_conv_solvert:Public Types | |
| typedef std::map< irep_idt, literalt > | symbolst |
| typedef std::unordered_map< exprt, literalt, irep_hash > | cachet |
Public Types inherited from decision_proceduret | |
| enum | resultt { resultt::D_SATISFIABLE, resultt::D_UNSATISFIABLE, resultt::D_ERROR } |
| Result of running the decision procedure. More... | |
Public Member Functions | |
| prop_conv_solvert (propt &_prop, message_handlert &message_handler) | |
| virtual | ~prop_conv_solvert ()=default |
| virtual void | finish_eager_conversion () |
| decision_proceduret::resultt | dec_solve () override |
| Run the decision procedure to solve the problem. More... | |
| void | print_assignment (std::ostream &out) const override |
Print satisfying assignment to out. More... | |
| std::string | decision_procedure_text () const override |
| Return a textual description of the decision procedure. More... | |
| exprt | get (const exprt &expr) const override |
Return expr with variables replaced by values from satisfying assignment if available. More... | |
| tvt | l_get (literalt a) const override |
Return value of literal l from satisfying assignment. More... | |
| exprt | handle (const exprt &expr) override |
| Generate a handle, which is an expression that has the same value as the argument in any model that is generated; this offers an efficient way to refer to the expression in subsequent calls to get or set_to. More... | |
| void | set_frozen (literalt) |
| void | set_frozen (const bvt &) |
| void | set_all_frozen () |
| literalt | convert (const exprt &expr) override |
| Convert a Boolean expression and return the corresponding literal. More... | |
| bool | is_in_conflict (const exprt &expr) const override |
| Returns true if an expression is in the final conflict leading to UNSAT. More... | |
| void | set_to (const exprt &expr, bool value) override |
For a Boolean expression expr, add the constraint 'current_context => expr' if value is true, otherwise add 'current_context => not expr'. More... | |
| void | push () override |
| Push a new context on the stack This context becomes a child context nested in the current context. More... | |
| void | push (const std::vector< exprt > &assumptions) override |
Push assumptions in form of literal_exprt More... | |
| void | pop () override |
| Pop whatever is on top of the stack. More... | |
| virtual void | clear_cache () |
| const cachet & | get_cache () const |
| const symbolst & | get_symbols () const |
| void | set_time_limit_seconds (uint32_t lim) override |
| Set the limit for the solver to time out in seconds. More... | |
| std::size_t | get_number_of_solver_calls () const override |
| Return the number of incremental solver calls. More... | |
| hardness_collectort * | get_hardness_collector () |
Public Member Functions inherited from conflict_providert | |
| virtual | ~conflict_providert ()=default |
Public Member Functions inherited from prop_convt | |
| virtual | ~prop_convt () |
Public Member Functions inherited from stack_decision_proceduret | |
| virtual | ~stack_decision_proceduret ()=default |
Public Member Functions inherited from decision_proceduret | |
| void | set_to_true (const exprt &expr) |
For a Boolean expression expr, add the constraint 'expr'. More... | |
| void | set_to_false (const exprt &expr) |
For a Boolean expression expr, add the constraint 'not expr'. More... | |
| resultt | operator() () |
| Run the decision procedure to solve the problem. More... | |
| virtual | ~decision_proceduret () |
Public Member Functions inherited from solver_resource_limitst | |
| virtual | ~solver_resource_limitst ()=default |
Public Attributes | |
| bool | use_cache = true |
| bool | equality_propagation = true |
| bool | freeze_all = false |
Protected Member Functions | |
| virtual optionalt< bool > | get_bool (const exprt &expr) const |
| Get a boolean value from the model if the formula is satisfiable. More... | |
| virtual literalt | convert_rest (const exprt &expr) |
| virtual literalt | convert_bool (const exprt &expr) |
| virtual bool | set_equality_to_true (const equal_exprt &expr) |
| virtual literalt | get_literal (const irep_idt &symbol) |
| virtual void | ignoring (const exprt &expr) |
Protected Attributes | |
| bool | post_processing_done = false |
| symbolst | symbols |
| cachet | cache |
| propt & | prop |
| messaget | log |
| bvt | assumption_stack |
| Assumptions on the stack. More... | |
| std::size_t | context_literal_counter = 0 |
| To generate unique literal names for contexts. More... | |
| std::vector< size_t > | context_size_stack |
assumption_stack is segmented in contexts; Number of assumptions in each context on the stack More... | |
Static Protected Attributes | |
| static const char * | context_prefix = "prop_conv::context$" |
Private Member Functions | |
| void | add_constraints_to_prop (const exprt &expr, bool value) |
Helper method used by set_to for adding the constraints to prop. More... | |
Definition at line 27 of file prop_conv_solver.h.
| typedef std::unordered_map<exprt, literalt, irep_hash> prop_conv_solvert::cachet |
Definition at line 84 of file prop_conv_solver.h.
| typedef std::map<irep_idt, literalt> prop_conv_solvert::symbolst |
Definition at line 83 of file prop_conv_solver.h.
|
inline |
Definition at line 32 of file prop_conv_solver.h.
|
virtualdefault |
|
private |
Helper method used by set_to for adding the constraints to prop.
This method is private because it must not be used by derived classes.
Definition at line 348 of file prop_conv_solver.cpp.
|
inlinevirtual |
Reimplemented in boolbvt.
Definition at line 78 of file prop_conv_solver.h.
Convert a Boolean expression and return the corresponding literal.
Implements prop_convt.
Definition at line 156 of file prop_conv_solver.cpp.
Definition at line 192 of file prop_conv_solver.cpp.
Reimplemented in boolbvt, and bv_pointerst.
Definition at line 315 of file prop_conv_solver.cpp.
|
overridevirtual |
Run the decision procedure to solve the problem.
Implements decision_proceduret.
Reimplemented in string_refinementt, and bv_refinementt.
Definition at line 444 of file prop_conv_solver.cpp.
|
overridevirtual |
Return a textual description of the decision procedure.
Implements decision_proceduret.
Reimplemented in string_refinementt, and bv_refinementt.
Definition at line 566 of file prop_conv_solver.cpp.
|
virtual |
Reimplemented in boolbvt, arrayst, equalityt, and bv_pointerst.
Definition at line 440 of file prop_conv_solver.cpp.
Return expr with variables replaced by values from satisfying assignment if available.
Return nil if not available
Implements decision_proceduret.
Reimplemented in string_refinementt.
Definition at line 477 of file prop_conv_solver.cpp.
Get a boolean value from the model if the formula is satisfiable.
If the argument is not a boolean expression from the formula, {} is returned.
Definition at line 79 of file prop_conv_solver.cpp.
|
inline |
Definition at line 86 of file prop_conv_solver.h.
|
inline |
Definition at line 102 of file prop_conv_solver.h.
Definition at line 62 of file prop_conv_solver.cpp.
|
overridevirtual |
Return the number of incremental solver calls.
Implements decision_proceduret.
Definition at line 507 of file prop_conv_solver.cpp.
|
inline |
Definition at line 90 of file prop_conv_solver.h.
Generate a handle, which is an expression that has the same value as the argument in any model that is generated; this offers an efficient way to refer to the expression in subsequent calls to get or set_to.
The returned expression may be the expression itself or a more compact but solver-specific representation.
Implements decision_proceduret.
Definition at line 40 of file prop_conv_solver.cpp.
|
protectedvirtual |
Definition at line 433 of file prop_conv_solver.cpp.
|
overridevirtual |
Returns true if an expression is in the final conflict leading to UNSAT.
The argument can be a Boolean expression or something more solver-specific, e.g. a literal_exprt.
Implements conflict_providert.
Definition at line 18 of file prop_conv_solver.cpp.
Return value of literal l from satisfying assignment.
Return tvt::UNKNOWN if not available
Implements prop_convt.
Definition at line 48 of file prop_conv_solver.h.
|
overridevirtual |
Pop whatever is on top of the stack.
Popping from the empty stack results in an invariant violation.
Implements stack_decision_proceduret.
Definition at line 552 of file prop_conv_solver.cpp.
|
overridevirtual |
Print satisfying assignment to out.
Implements decision_proceduret.
Definition at line 501 of file prop_conv_solver.cpp.
|
overridevirtual |
Push a new context on the stack This context becomes a child context nested in the current context.
Implements stack_decision_proceduret.
Definition at line 540 of file prop_conv_solver.cpp.
|
overridevirtual |
Push assumptions in form of literal_exprt
Implements stack_decision_proceduret.
Definition at line 529 of file prop_conv_solver.cpp.
| void prop_conv_solvert::set_all_frozen | ( | ) |
Definition at line 35 of file prop_conv_solver.cpp.
|
protectedvirtual |
Definition at line 322 of file prop_conv_solver.cpp.
| void prop_conv_solvert::set_frozen | ( | const bvt & | bv | ) |
Definition at line 23 of file prop_conv_solver.cpp.
| void prop_conv_solvert::set_frozen | ( | literalt | a | ) |
Definition at line 30 of file prop_conv_solver.cpp.
|
inlineoverridevirtual |
Set the limit for the solver to time out in seconds.
Implements solver_resource_limitst.
Definition at line 95 of file prop_conv_solver.h.
|
overridevirtual |
For a Boolean expression expr, add the constraint 'current_context => expr' if value is true, otherwise add 'current_context => not expr'.
Implements decision_proceduret.
Reimplemented in string_refinementt.
Definition at line 514 of file prop_conv_solver.cpp.
|
protected |
Assumptions on the stack.
Definition at line 137 of file prop_conv_solver.h.
|
protected |
Definition at line 126 of file prop_conv_solver.h.
|
protected |
To generate unique literal names for contexts.
Definition at line 140 of file prop_conv_solver.h.
|
staticprotected |
Definition at line 134 of file prop_conv_solver.h.
|
protected |
assumption_stack is segmented in contexts; Number of assumptions in each context on the stack
Definition at line 144 of file prop_conv_solver.h.
| bool prop_conv_solvert::equality_propagation = true |
Definition at line 75 of file prop_conv_solver.h.
| bool prop_conv_solvert::freeze_all = false |
Definition at line 76 of file prop_conv_solver.h.
|
protected |
Definition at line 132 of file prop_conv_solver.h.
|
protected |
Definition at line 108 of file prop_conv_solver.h.
|
protected |
Definition at line 130 of file prop_conv_solver.h.
|
protected |
Definition at line 121 of file prop_conv_solver.h.
| bool prop_conv_solvert::use_cache = true |
Definition at line 74 of file prop_conv_solver.h.