Skip to content

Commit c372326

Browse files
Stop propt inheriting from messaget
No functional changes. A propt object should not be used as a messaget so the messaget should rather be a field.
1 parent f7d2983 commit c372326

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

src/solvers/flattening/arrays.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ literalt arrayst::record_array_equality(
4848
// check types
4949
if(!base_type_eq(op0.type(), op1.type(), ns))
5050
{
51-
prop.error() << equality.pretty() << messaget::eom;
51+
prop.message.error() << equality.pretty() << messaget::eom;
5252
DATA_INVARIANT(
5353
false,
5454
"record_array_equality got equality without matching types");
@@ -117,7 +117,7 @@ void arrayst::collect_arrays(const exprt &a)
117117
// check types
118118
if(!base_type_eq(array_type, with_expr.old().type(), ns))
119119
{
120-
prop.error() << a.pretty() << messaget::eom;
120+
prop.message.error() << a.pretty() << messaget::eom;
121121
DATA_INVARIANT(false, "collect_arrays got 'with' without matching types");
122122
}
123123

@@ -135,7 +135,7 @@ void arrayst::collect_arrays(const exprt &a)
135135
// check types
136136
if(!base_type_eq(array_type, update_expr.old().type(), ns))
137137
{
138-
prop.error() << a.pretty() << messaget::eom;
138+
prop.message.error() << a.pretty() << messaget::eom;
139139
DATA_INVARIANT(
140140
false,
141141
"collect_arrays got 'update' without matching types");
@@ -157,14 +157,14 @@ void arrayst::collect_arrays(const exprt &a)
157157
// check types
158158
if(!base_type_eq(array_type, if_expr.true_case().type(), ns))
159159
{
160-
prop.error() << a.pretty() << messaget::eom;
160+
prop.message.error() << a.pretty() << messaget::eom;
161161
DATA_INVARIANT(false, "collect_arrays got if without matching types");
162162
}
163163

164164
// check types
165165
if(!base_type_eq(array_type, if_expr.false_case().type(), ns))
166166
{
167-
prop.error() << a.pretty() << messaget::eom;
167+
prop.message.error() << a.pretty() << messaget::eom;
168168
DATA_INVARIANT(false, "collect_arrays got if without matching types");
169169
}
170170

@@ -518,7 +518,7 @@ void arrayst::add_array_constraints_with(
518518

519519
if(index_expr.type()!=value.type())
520520
{
521-
prop.error() << expr.pretty() << messaget::eom;
521+
prop.message.error() << expr.pretty() << messaget::eom;
522522
DATA_INVARIANT(
523523
false,
524524
"with-expression operand should match array element type");
@@ -588,7 +588,7 @@ void arrayst::add_array_constraints_update(
588588

589589
if(index_expr.type()!=value.type())
590590
{
591-
prop.error() << expr.pretty() << messaget::eom;
591+
prop.message.error() << expr.pretty() << messaget::eom;
592592
DATA_INVARIANT(
593593
false,
594594
"update operand should match array element type");

src/solvers/prop/prop.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ Author: Daniel Kroening, [email protected]
2121

2222
/*! \brief TO_BE_DOCUMENTED
2323
*/
24-
class propt:public messaget
24+
class propt
2525
{
2626
public:
27+
messaget message;
2728
propt() { }
2829
virtual ~propt() { }
2930

@@ -113,7 +114,7 @@ class propt:public messaget
113114
// Resource limits:
114115
virtual void set_time_limit_seconds(uint32_t)
115116
{
116-
warning() << "CPU limit ignored (not implemented)" << eom;
117+
message.warning() << "CPU limit ignored (not implemented)" << messaget::eom;
117118
}
118119

119120
protected:

src/solvers/prop/prop_conv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ class prop_conv_solvert:public prop_convt
117117
typedef std::map<irep_idt, literalt> symbolst;
118118
typedef std::unordered_map<exprt, literalt, irep_hash> cachet;
119119

120-
const cachet &get_cache() const { return cache; }
121120
const symbolst &get_symbols() const { return symbols; }
122121

123122
void set_time_limit_seconds(uint32_t lim) override

src/solvers/qbf/qbf_quantor.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ const std::string qbf_quantort::solver_text()
3434
propt::resultt qbf_quantort::prop_solve()
3535
{
3636
{
37-
messaget::status() <<
37+
message.status() <<
3838
"Quantor: " <<
3939
no_variables() << " variables, " <<
40-
no_clauses() << " clauses" << eom;
40+
no_clauses() << " clauses" << messaget::eom;
4141
}
4242

4343
std::string qbf_tmp_file="quantor.qdimacs";
@@ -87,19 +87,19 @@ propt::resultt qbf_quantort::prop_solve()
8787

8888
if(!result_found)
8989
{
90-
messaget::error() << "Quantor failed: unknown result" << eom;
90+
message.error() << "Quantor failed: unknown result" << messaget::eom;
9191
return resultt::P_ERROR;
9292
}
9393
}
9494

9595
if(result)
9696
{
97-
messaget::status() << "Quantor: TRUE" << eom;
97+
message.status() << "Quantor: TRUE" << messaget::eom;
9898
return resultt::P_SATISFIABLE;
9999
}
100100
else
101101
{
102-
messaget::status() << "Quantor: FALSE" << eom;
102+
message.status() << "Quantor: FALSE" << messaget::eom;
103103
return resultt::P_UNSATISFIABLE;
104104
}
105105

src/solvers/qbf/qbf_qube.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ propt::resultt qbf_qubet::prop_solve()
4040
return resultt::P_SATISFIABLE;
4141

4242
{
43-
messaget::status() <<
43+
message.status() <<
4444
"QuBE: " <<
4545
no_variables() << " variables, " <<
46-
no_clauses() << " clauses" << eom;
46+
no_clauses() << " clauses" << messaget::eom;
4747
}
4848

4949
std::string qbf_tmp_file="qube.qdimacs";
@@ -95,19 +95,19 @@ propt::resultt qbf_qubet::prop_solve()
9595

9696
if(!result_found)
9797
{
98-
messaget::error() << "QuBE failed: unknown result" << eom;
98+
message.error() << "QuBE failed: unknown result" << messaget::eom;
9999
return resultt::P_ERROR;
100100
}
101101
}
102102

103103
if(result)
104104
{
105-
messaget::status() << "QuBE: TRUE" << eom;
105+
message.status() << "QuBE: TRUE" << messaget::eom;
106106
return resultt::P_SATISFIABLE;
107107
}
108108
else
109109
{
110-
messaget::status() << "QuBE: FALSE" << eom;
110+
message.status() << "QuBE: FALSE" << messaget::eom;
111111
return resultt::P_UNSATISFIABLE;
112112
}
113113

0 commit comments

Comments
 (0)