Skip to content

Commit 13f5f0c

Browse files
Do not expose set_frozen
Is only used inside the prop_conv_solvert hierarchy anymore.
1 parent a951d96 commit 13f5f0c

File tree

9 files changed

+31
-44
lines changed

9 files changed

+31
-44
lines changed

src/goto-checker/bmc_util.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,6 @@ std::chrono::duration<double> prepare_property_decider(
365365
property_decider.update_properties_goals_from_symex_target_equation(
366366
properties);
367367
property_decider.convert_goals();
368-
property_decider.freeze_goal_variables();
369368

370369
auto solver_stop = std::chrono::steady_clock::now();
371370
return std::chrono::duration<double>(solver_stop - solver_start);

src/goto-checker/goto_symex_property_decider.cpp

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,7 @@ void goto_symex_property_decidert::convert_goals()
7474
// Our goal is to falsify a property, i.e., we will
7575
// add the negation of the property as goal.
7676
goal_pair.second.condition =
77-
!solver->prop_conv().convert(goal_pair.second.as_expr());
78-
}
79-
}
80-
81-
void goto_symex_property_decidert::freeze_goal_variables()
82-
{
83-
for(const auto &goal_pair : goal_map)
84-
{
85-
if(!goal_pair.second.condition.is_constant())
86-
solver->prop_conv().set_frozen(goal_pair.second.condition);
77+
solver->prop_conv().handle(not_exprt(goal_pair.second.as_expr()));
8778
}
8879
}
8980

@@ -98,7 +89,7 @@ void goto_symex_property_decidert::add_constraint_from_goals(
9889
select_property(goal_pair.first) &&
9990
!goal_pair.second.condition.is_false())
10091
{
101-
disjuncts.push_back(literal_exprt(goal_pair.second.condition));
92+
disjuncts.push_back(goal_pair.second.condition);
10293
}
10394
}
10495

@@ -134,7 +125,7 @@ void goto_symex_property_decidert::update_properties_status_from_goals(
134125
{
135126
auto &status = properties.at(goal_pair.first).status;
136127
if(
137-
solver->prop_conv().l_get(goal_pair.second.condition).is_true() &&
128+
solver->prop_conv().get(goal_pair.second.condition).is_true() &&
138129
status != property_statust::FAIL)
139130
{
140131
status |= property_statust::FAIL;

src/goto-checker/goto_symex_property_decider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class goto_symex_property_decidert
7979
std::vector<symex_target_equationt::SSA_stepst::iterator> instances;
8080

8181
/// The goal variable
82-
literalt condition;
82+
exprt condition;
8383

8484
exprt as_expr() const;
8585
};

src/solvers/decision_procedure.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ class decision_proceduret
3030
/// For a Boolean expression \p expr, add the constraint 'not expr'
3131
void set_to_false(const exprt &expr);
3232

33-
/// Generate a handle for an expression; this offers an efficient way
33+
/// Generate a handle, which is an expression that
34+
/// has the same value as the argument in any model
35+
/// that is generated; this offers an efficient way
3436
/// to refer to the expression in subsequent calls to \ref get or
35-
/// \ref set_to
37+
/// \ref set_to.
38+
/// The returned expression may be the expression itself or a more compact
39+
/// but solver-specific representation.
3640
virtual exprt handle(const exprt &expr) = 0;
3741

3842
/// Result of running the decision procedure

src/solvers/prop/prop_conv.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,3 @@ void prop_convt::set_assumptions(const bvt &)
1818
{
1919
UNREACHABLE;
2020
}
21-
22-
void prop_convt::set_frozen(const literalt)
23-
{
24-
UNREACHABLE;
25-
}
26-
27-
void prop_convt::set_frozen(const bvt &bv)
28-
{
29-
for(const auto &bit : bv)
30-
if(!bit.is_constant())
31-
set_frozen(bit);
32-
}

src/solvers/prop/prop_conv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,8 @@ class prop_convt:public decision_proceduret
3434
virtual tvt l_get(literalt l) const = 0;
3535

3636
// incremental solving
37-
virtual void set_frozen(literalt a);
38-
virtual void set_frozen(const bvt &);
3937
virtual void set_assumptions(const bvt &_assumptions);
4038
virtual bool has_set_assumptions() const { return false; }
41-
virtual void set_all_frozen() {}
4239
};
4340

4441
#endif // CPROVER_SOLVERS_PROP_PROP_CONV_H

src/solvers/prop/prop_conv_solver.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,23 @@ bool prop_conv_solvert::is_in_conflict(const exprt &expr) const
1515
return prop.is_in_conflict(to_literal_expr(expr).get_literal());
1616
}
1717

18+
void prop_conv_solvert::set_frozen(const bvt &bv)
19+
{
20+
for(const auto &bit : bv)
21+
if(!bit.is_constant())
22+
set_frozen(bit);
23+
}
24+
25+
void prop_conv_solvert::set_frozen(literalt a)
26+
{
27+
prop.set_frozen(a);
28+
}
29+
30+
void prop_conv_solvert::set_all_frozen()
31+
{
32+
freeze_all = true;
33+
}
34+
1835
exprt prop_conv_solvert::handle(const exprt &expr)
1936
{
2037
// We can only improve Booleans.

src/solvers/prop/prop_conv_solver.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,10 @@ class prop_conv_solvert : public conflict_providert,
4646
}
4747
exprt get(const exprt &expr) const override;
4848

49-
// overloading from prop_convt
50-
using prop_convt::set_frozen;
5149
tvt l_get(literalt a) const override
5250
{
5351
return prop.l_get(a);
5452
}
55-
void set_frozen(literalt a) override
56-
{
57-
prop.set_frozen(a);
58-
}
5953
void set_assumptions(const bvt &_assumptions) override
6054
{
6155
prop.set_assumptions(_assumptions);
@@ -67,10 +61,10 @@ class prop_conv_solvert : public conflict_providert,
6761

6862
exprt handle(const exprt &expr) override;
6963

70-
void set_all_frozen() override
71-
{
72-
freeze_all = true;
73-
}
64+
void set_frozen(literalt);
65+
void set_frozen(const bvt &);
66+
void set_all_frozen();
67+
7468
literalt convert(const exprt &expr) override;
7569
bool is_in_conflict(const exprt &expr) const override;
7670

src/solvers/smt2/smt2_conv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ class smt2_convt:public prop_convt
115115

116116
exprt handle(const exprt &expr) override;
117117
literalt convert(const exprt &expr) override;
118-
void set_frozen(literalt) override
119-
{ /* not needed */
120-
}
121118
void set_to(const exprt &expr, bool value) override;
122119
exprt get(const exprt &expr) const override;
123120
std::string decision_procedure_text() const override

0 commit comments

Comments
 (0)