Skip to content

Commit bc7b25c

Browse files
committed
Promote set_all_frozen to decision_proceduret to remove a dynamic_cast
We can safely implement this as a no-op.
1 parent 2e6200a commit bc7b25c

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/goto-checker/single_loop_incremental_symex_checker.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ single_loop_incremental_symex_checkert::single_loop_incremental_symex_checkert(
4242
{
4343
setup_symex(symex, ns, options, ui_message_handler);
4444

45-
// Freeze all symbols if we are using a prop_conv_solvert
46-
prop_conv_solvert *prop_conv_solver = dynamic_cast<prop_conv_solvert *>(
47-
&property_decider.get_decision_procedure());
48-
if(prop_conv_solver != nullptr)
49-
prop_conv_solver->set_all_frozen();
45+
// Freeze all symbols (will be a no-op unless we are using a
46+
// prop_conv_solvert)
47+
property_decider.get_decision_procedure().set_all_frozen();
5048
}
5149

5250
void output_incremental_status(

src/solvers/decision_procedure.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ class decision_proceduret
4040
/// but solver-specific representation.
4141
virtual exprt handle(const exprt &) = 0;
4242

43+
/// Make sure simplification steps internal to the decision procedure do not
44+
/// result in variables being removed.
45+
virtual void set_all_frozen()
46+
{
47+
}
48+
4349
/// Result of running the decision procedure
4450
enum class resultt
4551
{

src/solvers/prop/prop_conv_solver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class prop_conv_solvert : public conflict_providert,
5454

5555
void set_frozen(literalt);
5656
void set_frozen(const bvt &);
57-
void set_all_frozen();
57+
void set_all_frozen() override;
5858

5959
literalt convert(const exprt &expr) override;
6060
bool is_in_conflict(const exprt &expr) const override;

0 commit comments

Comments
 (0)