Skip to content

Commit ca76cbb

Browse files
committed
Remove macro-definition of unsigned_greater_than_or_equal from X-macro.
And substitute it with a concrete class implementation.
1 parent 1dd4463 commit ca76cbb

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

src/solvers/smt2_incremental/smt_bit_vector_theory.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,27 @@ void smt_bit_vector_theoryt::unsigned_greater_thant::validate(
113113
const smt_function_application_termt::factoryt<
114114
smt_bit_vector_theoryt::unsigned_greater_thant>
115115
smt_bit_vector_theoryt::unsigned_greater_than{};
116+
117+
const char *
118+
smt_bit_vector_theoryt::unsigned_greater_than_or_equalt::identifier()
119+
{
120+
return "bvuge";
121+
}
122+
123+
smt_sortt smt_bit_vector_theoryt::unsigned_greater_than_or_equalt::return_sort(
124+
const smt_termt &lhs,
125+
const smt_termt &rhs)
126+
{
127+
return smt_bool_sortt{};
128+
}
129+
130+
void smt_bit_vector_theoryt::unsigned_greater_than_or_equalt::validate(
131+
const smt_termt &lhs,
132+
const smt_termt &rhs)
133+
{
134+
validate_bit_vector_predicate_arguments(lhs, rhs);
135+
}
136+
137+
const smt_function_application_termt::factoryt<
138+
smt_bit_vector_theoryt::unsigned_greater_than_or_equalt>
139+
smt_bit_vector_theoryt::unsigned_greater_than_or_equal{};

src/solvers/smt2_incremental/smt_bit_vector_theory.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/// [X-macro](https://en.wikipedia.org/wiki/X_Macro) pattern. These define the
44
/// set of bitvector theory functions which are implemented and it is used to
55
/// automate repetitive parts of the implementation.
6-
SMT_BITVECTOR_THEORY_PREDICATE(bvuge, unsigned_greater_than_or_equal)
76
SMT_BITVECTOR_THEORY_PREDICATE(bvslt, signed_less_than)
87
SMT_BITVECTOR_THEORY_PREDICATE(bvsle, signed_less_than_or_equal)
98
SMT_BITVECTOR_THEORY_PREDICATE(bvsgt, signed_greater_than)

src/solvers/smt2_incremental/smt_bit_vector_theory.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,16 @@ class smt_bit_vector_theoryt
4949
};
5050
static const smt_function_application_termt::factoryt<unsigned_greater_thant>
5151
unsigned_greater_than;
52+
53+
struct unsigned_greater_than_or_equalt final
54+
{
55+
static const char *identifier();
56+
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
57+
static void validate(const smt_termt &lhs, const smt_termt &rhs);
58+
};
59+
static const smt_function_application_termt::factoryt<
60+
unsigned_greater_than_or_equalt>
61+
unsigned_greater_than_or_equal;
5262
};
5363

5464
#endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_BIT_VECTOR_THEORY_H

0 commit comments

Comments
 (0)