Skip to content

Commit 43bce36

Browse files
committed
Remove macro-definition of signed_greater_than from X-macro.
And substitute it with a concrete class implementation.
1 parent ee7b98c commit 43bce36

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

src/solvers/smt2_incremental/smt_bit_vector_theory.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,26 @@ void smt_bit_vector_theoryt::signed_less_than_or_equalt::validate(
183183
const smt_function_application_termt::factoryt<
184184
smt_bit_vector_theoryt::signed_less_than_or_equalt>
185185
smt_bit_vector_theoryt::signed_less_than_or_equal{};
186+
187+
const char *smt_bit_vector_theoryt::signed_greater_thant::identifier()
188+
{
189+
return "bvsgt";
190+
}
191+
192+
smt_sortt smt_bit_vector_theoryt::signed_greater_thant::return_sort(
193+
const smt_termt &lhs,
194+
const smt_termt &rhs)
195+
{
196+
return smt_bool_sortt{};
197+
}
198+
199+
void smt_bit_vector_theoryt::signed_greater_thant::validate(
200+
const smt_termt &lhs,
201+
const smt_termt &rhs)
202+
{
203+
validate_bit_vector_predicate_arguments(lhs, rhs);
204+
}
205+
206+
const smt_function_application_termt::factoryt<
207+
smt_bit_vector_theoryt::signed_greater_thant>
208+
smt_bit_vector_theoryt::signed_greater_than{};

src/solvers/smt2_incremental/smt_bit_vector_theory.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
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(bvsgt, signed_greater_than)
76
SMT_BITVECTOR_THEORY_PREDICATE(bvsge, signed_greater_than_or_equal)

src/solvers/smt2_incremental/smt_bit_vector_theory.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ class smt_bit_vector_theoryt
7878
static const smt_function_application_termt::factoryt<
7979
signed_less_than_or_equalt>
8080
signed_less_than_or_equal;
81+
82+
struct signed_greater_thant final
83+
{
84+
static const char *identifier();
85+
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
86+
static void validate(const smt_termt &lhs, const smt_termt &rhs);
87+
};
88+
static const smt_function_application_termt::factoryt<signed_greater_thant>
89+
signed_greater_than;
8190
};
8291

8392
#endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_BIT_VECTOR_THEORY_H

0 commit comments

Comments
 (0)