Skip to content

Commit ee7b98c

Browse files
committed
Remove macro-definition of signed_less_than_or_equal from X-macro.
And substitute it with a concrete class implementation.
1 parent 2b1b4e0 commit ee7b98c

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-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
@@ -160,3 +160,26 @@ void smt_bit_vector_theoryt::signed_less_thant::validate(
160160
const smt_function_application_termt::factoryt<
161161
smt_bit_vector_theoryt::signed_less_thant>
162162
smt_bit_vector_theoryt::signed_less_than{};
163+
164+
const char *smt_bit_vector_theoryt::signed_less_than_or_equalt::identifier()
165+
{
166+
return "bvsle";
167+
}
168+
169+
smt_sortt smt_bit_vector_theoryt::signed_less_than_or_equalt::return_sort(
170+
const smt_termt &lhs,
171+
const smt_termt &rhs)
172+
{
173+
return smt_bool_sortt{};
174+
}
175+
176+
void smt_bit_vector_theoryt::signed_less_than_or_equalt::validate(
177+
const smt_termt &lhs,
178+
const smt_termt &rhs)
179+
{
180+
validate_bit_vector_predicate_arguments(lhs, rhs);
181+
}
182+
183+
const smt_function_application_termt::factoryt<
184+
smt_bit_vector_theoryt::signed_less_than_or_equalt>
185+
smt_bit_vector_theoryt::signed_less_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,6 +3,5 @@
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(bvsle, signed_less_than_or_equal)
76
SMT_BITVECTOR_THEORY_PREDICATE(bvsgt, signed_greater_than)
87
SMT_BITVECTOR_THEORY_PREDICATE(bvsge, signed_greater_than_or_equal)

src/solvers/smt2_incremental/smt_bit_vector_theory.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ class smt_bit_vector_theoryt
6868
};
6969
static const smt_function_application_termt::factoryt<signed_less_thant>
7070
signed_less_than;
71+
72+
struct signed_less_than_or_equalt final
73+
{
74+
static const char *identifier();
75+
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
76+
static void validate(const smt_termt &lhs, const smt_termt &rhs);
77+
};
78+
static const smt_function_application_termt::factoryt<
79+
signed_less_than_or_equalt>
80+
signed_less_than_or_equal;
7181
};
7282

7383
#endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_BIT_VECTOR_THEORY_H

0 commit comments

Comments
 (0)