CBMC
goto_symex_property_decider.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: Property Decider for Goto-Symex
4 
5 Author: Daniel Kroening, Peter Schrammel
6 
7 \*******************************************************************/
8 
11 
12 #ifndef CPROVER_GOTO_CHECKER_GOTO_SYMEX_PROPERTY_DECIDER_H
13 #define CPROVER_GOTO_CHECKER_GOTO_SYMEX_PROPERTY_DECIDER_H
14 
16 
17 #include "properties.h"
18 #include "solver_factory.h"
19 
21 
24 {
25 public:
27  const optionst &options,
30  const namespacet &ns);
31 
34  void
36 
38  void convert_goals();
39 
42  std::function<bool(const irep_idt &property_id)> select_property);
43 
46 
49 
52 
55 
64  propertiest &properties,
65  std::unordered_set<irep_idt> &updated_properties,
67  bool set_pass = true) const;
68 protected:
69  const optionst &options;
72  std::unique_ptr<solver_factoryt::solvert> solver;
73 
74  struct goalt
75  {
77  std::vector<symex_target_equationt::SSA_stepst::iterator> instances;
78 
81 
82  exprt as_expr() const;
83  };
84 
88  std::map<irep_idt, goalt> goal_map;
89 };
90 
91 #endif // CPROVER_GOTO_CHECKER_GOTO_SYMEX_PROPERTY_DECIDER_H
dstringt
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:36
symex_target_equation.h
ui_message_handlert
Definition: ui_message.h:21
optionst
Definition: options.h:22
goto_symex_property_decidert::ui_message_handler
ui_message_handlert & ui_message_handler
Definition: goto_symex_property_decider.h:70
goto_symex_property_decidert::solver
std::unique_ptr< solver_factoryt::solvert > solver
Definition: goto_symex_property_decider.h:72
decision_proceduret
Definition: decision_procedure.h:20
exprt
Base class for all expressions.
Definition: expr.h:55
propertiest
std::map< irep_idt, property_infot > propertiest
A map of property IDs to property infos.
Definition: properties.h:76
goto_symex_property_decidert::solve
decision_proceduret::resultt solve()
Calls solve() on the solver instance.
Definition: goto_symex_property_decider.cpp:101
stack_decision_proceduret
Definition: stack_decision_procedure.h:57
goto_symex_property_decidert::get_equation
symex_target_equationt & get_equation() const
Return the equation associated with this instance.
Definition: goto_symex_property_decider.cpp:118
namespacet
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:90
goto_symex_property_decidert::goalt::as_expr
exprt as_expr() const
Definition: goto_symex_property_decider.cpp:33
goto_symex_property_decidert::equation
symex_target_equationt & equation
Definition: goto_symex_property_decider.h:71
goto_symex_property_decidert::goto_symex_property_decidert
goto_symex_property_decidert(const optionst &options, ui_message_handlert &ui_message_handler, symex_target_equationt &equation, const namespacet &ns)
Definition: goto_symex_property_decider.cpp:18
goto_symex_property_decidert::convert_goals
void convert_goals()
Convert the instances of a property into a goal variable.
Definition: goto_symex_property_decider.cpp:71
goto_symex_property_decidert::goal_map
std::map< irep_idt, goalt > goal_map
Maintains the relation between a property ID and the corresponding goal variable that encodes the neg...
Definition: goto_symex_property_decider.h:88
goto_symex_property_decidert::get_decision_procedure
decision_proceduret & get_decision_procedure() const
Returns the solver instance.
Definition: goto_symex_property_decider.cpp:107
goto_symex_property_decidert::get_stack_decision_procedure
stack_decision_proceduret & get_stack_decision_procedure() const
Returns the solver instance.
Definition: goto_symex_property_decider.cpp:113
solver_factory.h
goto_symex_property_decidert::add_constraint_from_goals
void add_constraint_from_goals(std::function< bool(const irep_idt &property_id)> select_property)
Add disjunction of negated selected properties to the equation.
Definition: goto_symex_property_decider.cpp:82
decision_proceduret::resultt
resultt
Result of running the decision procedure.
Definition: decision_procedure.h:43
symex_target_equationt
Inheriting the interface of symex_targett this class represents the SSA form of the input program as ...
Definition: symex_target_equation.h:33
goto_symex_property_decidert::update_properties_goals_from_symex_target_equation
void update_properties_goals_from_symex_target_equation(propertiest &properties)
Get the conditions for the properties from the equation and collect all 'instances' of the properties...
Definition: goto_symex_property_decider.cpp:43
goto_symex_property_decidert::goalt::condition
exprt condition
The goal variable.
Definition: goto_symex_property_decider.h:80
goto_symex_property_decidert::goalt::instances
std::vector< symex_target_equationt::SSA_stepst::iterator > instances
A property holds if all instances of it are true.
Definition: goto_symex_property_decider.h:77
goto_symex_property_decidert::goalt
Definition: goto_symex_property_decider.h:74
goto_symex_property_decidert::update_properties_status_from_goals
void update_properties_status_from_goals(propertiest &properties, std::unordered_set< irep_idt > &updated_properties, decision_proceduret::resultt dec_result, bool set_pass=true) const
Update the property status from the truth value of the goal variable.
Definition: goto_symex_property_decider.cpp:123
goto_symex_property_decidert
Provides management of goal variables that encode properties.
Definition: goto_symex_property_decider.h:23
properties.h
goto_symex_property_decidert::options
const optionst & options
Definition: goto_symex_property_decider.h:69