CBMC
smt_bit_vector_theory.h
Go to the documentation of this file.
1 // Author: Diffblue Ltd.
2 
3 #ifndef CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_BIT_VECTOR_THEORY_H
4 #define CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_BIT_VECTOR_THEORY_H
5 
7 
9 {
10 public:
11  struct concatt final
12  {
13  static const char *identifier();
14  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
15  static void validate(const smt_termt &lhs, const smt_termt &rhs);
16  };
18 
19  struct extractt final
20  {
21  std::size_t i;
22  std::size_t j;
23  static const char *identifier();
24  smt_sortt return_sort(const smt_termt &operand) const;
25  std::vector<smt_indext> indices() const;
26  void validate(const smt_termt &operand) const;
27  };
38  extract(std::size_t i, std::size_t j);
39 
40  // Bitwise operators
41  struct nott final
42  {
43  static const char *identifier();
44  static smt_sortt return_sort(const smt_termt &operand);
45  static void validate(const smt_termt &operand);
46  };
48 
49  struct andt final
50  {
51  static const char *identifier();
52  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
53  static void validate(const smt_termt &lhs, const smt_termt &rhs);
54  };
56 
57  struct ort final
58  {
59  static const char *identifier();
60  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
61  static void validate(const smt_termt &lhs, const smt_termt &rhs);
62  };
64 
65  struct nandt final
66  {
67  static const char *identifier();
68  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
69  static void validate(const smt_termt &lhs, const smt_termt &rhs);
70  };
72 
73  struct nort final
74  {
75  static const char *identifier();
76  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
77  static void validate(const smt_termt &lhs, const smt_termt &rhs);
78  };
80 
81  struct xort final
82  {
83  static const char *identifier();
84  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
85  static void validate(const smt_termt &lhs, const smt_termt &rhs);
86  };
88 
89  struct xnort final
90  {
91  static const char *identifier();
92  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
93  static void validate(const smt_termt &lhs, const smt_termt &rhs);
94  };
96 
97  struct comparet final
98  {
99  static const char *identifier();
100  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
101  static void validate(const smt_termt &lhs, const smt_termt &rhs);
102  };
104 
105  // Relational operator class declarations
106  struct unsigned_less_thant final
107  {
108  static const char *identifier();
109  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
110  static void validate(const smt_termt &lhs, const smt_termt &rhs);
111  };
114 
116  {
117  static const char *identifier();
118  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
119  static void validate(const smt_termt &lhs, const smt_termt &rhs);
120  };
124 
126  {
127  static const char *identifier();
128  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
129  static void validate(const smt_termt &lhs, const smt_termt &rhs);
130  };
133 
135  {
136  static const char *identifier();
137  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
138  static void validate(const smt_termt &lhs, const smt_termt &rhs);
139  };
143 
144  struct signed_less_thant final
145  {
146  static const char *identifier();
147  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
148  static void validate(const smt_termt &lhs, const smt_termt &rhs);
149  };
152 
154  {
155  static const char *identifier();
156  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
157  static void validate(const smt_termt &lhs, const smt_termt &rhs);
158  };
162 
163  struct signed_greater_thant final
164  {
165  static const char *identifier();
166  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
167  static void validate(const smt_termt &lhs, const smt_termt &rhs);
168  };
171 
173  {
174  static const char *identifier();
175  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
176  static void validate(const smt_termt &lhs, const smt_termt &rhs);
177  };
181 
182  struct addt final
183  {
184  static const char *identifier();
185  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
186  static void validate(const smt_termt &lhs, const smt_termt &rhs);
187  };
189 
190  struct subtractt final
191  {
192  static const char *identifier();
193  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
194  static void validate(const smt_termt &lhs, const smt_termt &rhs);
195  };
197 
198  struct multiplyt final
199  {
200  static const char *identifier();
201  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
202  static void validate(const smt_termt &lhs, const smt_termt &rhs);
203  };
205 
206  struct unsigned_dividet final
207  {
208  static const char *identifier();
209  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
210  static void validate(const smt_termt &lhs, const smt_termt &rhs);
211  };
214 
215  struct signed_dividet final
216  {
217  static const char *identifier();
218  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
219  static void validate(const smt_termt &lhs, const smt_termt &rhs);
220  };
223 
224  struct unsigned_remaindert final
225  {
226  static const char *identifier();
227  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
228  static void validate(const smt_termt &lhs, const smt_termt &rhs);
229  };
232 
233  struct signed_remaindert final
234  {
235  static const char *identifier();
236  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
237  static void validate(const smt_termt &lhs, const smt_termt &rhs);
238  };
241 
242  struct negatet final
243  {
244  static const char *identifier();
245  static smt_sortt return_sort(const smt_termt &operand);
246  static void validate(const smt_termt &operand);
247  };
250 
251  // Shift operations
252  struct shift_leftt final
253  {
254  static const char *identifier();
255  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
256  static void validate(const smt_termt &lhs, const smt_termt &rhs);
257  };
259 
260  struct logical_shift_rightt final
261  {
262  static const char *identifier();
263  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
264  static void validate(const smt_termt &lhs, const smt_termt &rhs);
265  };
268 
270  {
271  static const char *identifier();
272  static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs);
273  static void validate(const smt_termt &lhs, const smt_termt &rhs);
274  };
277 
278  struct repeatt final
279  {
280  std::size_t i;
281  static const char *identifier();
282  smt_sortt return_sort(const smt_termt &operand) const;
283  std::vector<smt_indext> indices() const;
284  void validate(const smt_termt &operand) const;
285  };
287  repeat(std::size_t i);
288 
289  struct zero_extendt final
290  {
291  std::size_t i;
292  static const char *identifier();
293  smt_sortt return_sort(const smt_termt &operand) const;
294  std::vector<smt_indext> indices() const;
295  static void validate(const smt_termt &operand);
296  };
298  zero_extend(std::size_t i);
299 
300  struct sign_extendt final
301  {
302  std::size_t i;
303  static const char *identifier();
304  smt_sortt return_sort(const smt_termt &operand) const;
305  std::vector<smt_indext> indices() const;
306  static void validate(const smt_termt &operand);
307  };
309  sign_extend(std::size_t i);
310 
311  struct rotate_leftt final
312  {
313  std::size_t i;
314  static const char *identifier();
315  static smt_sortt return_sort(const smt_termt &operand);
316  std::vector<smt_indext> indices() const;
317  static void validate(const smt_termt &operand);
318  };
320  rotate_left(std::size_t i);
321 
322  struct rotate_rightt final
323  {
324  std::size_t i;
325  static const char *identifier();
326  static smt_sortt return_sort(const smt_termt &operand);
327  std::vector<smt_indext> indices() const;
328  static void validate(const smt_termt &operand);
329  };
331  rotate_right(std::size_t i);
332 };
333 
334 #endif // CPROVER_SOLVERS_SMT2_INCREMENTAL_SMT_BIT_VECTOR_THEORY_H
static const smt_function_application_termt::factoryt< xnort > xnor
static const smt_function_application_termt::factoryt< ort > make_or
static const smt_function_application_termt::factoryt< unsigned_less_than_or_equalt > unsigned_less_than_or_equal
static const smt_function_application_termt::factoryt< signed_less_than_or_equalt > signed_less_than_or_equal
static const smt_function_application_termt::factoryt< nort > nor
static const smt_function_application_termt::factoryt< addt > add
static const smt_function_application_termt::factoryt< arithmetic_shift_rightt > arithmetic_shift_right
static const smt_function_application_termt::factoryt< signed_greater_than_or_equalt > signed_greater_than_or_equal
static const smt_function_application_termt::factoryt< unsigned_greater_thant > unsigned_greater_than
static const smt_function_application_termt::factoryt< unsigned_remaindert > unsigned_remainder
static const smt_function_application_termt::factoryt< unsigned_greater_than_or_equalt > unsigned_greater_than_or_equal
static const smt_function_application_termt::factoryt< xort > make_xor
static const smt_function_application_termt::factoryt< nott > make_not
static const smt_function_application_termt::factoryt< shift_leftt > shift_left
static const smt_function_application_termt::factoryt< multiplyt > multiply
static smt_function_application_termt::factoryt< sign_extendt > sign_extend(std::size_t i)
static const smt_function_application_termt::factoryt< signed_less_thant > signed_less_than
static smt_function_application_termt::factoryt< zero_extendt > zero_extend(std::size_t i)
static smt_function_application_termt::factoryt< extractt > extract(std::size_t i, std::size_t j)
Makes a factory for extract function applications.
static const smt_function_application_termt::factoryt< signed_greater_thant > signed_greater_than
static smt_function_application_termt::factoryt< rotate_rightt > rotate_right(std::size_t i)
static smt_function_application_termt::factoryt< repeatt > repeat(std::size_t i)
static const smt_function_application_termt::factoryt< nandt > nand
static const smt_function_application_termt::factoryt< logical_shift_rightt > logical_shift_right
static const smt_function_application_termt::factoryt< comparet > compare
static const smt_function_application_termt::factoryt< negatet > negate
Arithmetic negation in two's complement.
static const smt_function_application_termt::factoryt< concatt > concat
static const smt_function_application_termt::factoryt< unsigned_dividet > unsigned_divide
static const smt_function_application_termt::factoryt< unsigned_less_thant > unsigned_less_than
static const smt_function_application_termt::factoryt< signed_dividet > signed_divide
static const smt_function_application_termt::factoryt< signed_remaindert > signed_remainder
static const smt_function_application_termt::factoryt< subtractt > subtract
static const smt_function_application_termt::factoryt< andt > make_and
static smt_function_application_termt::factoryt< rotate_leftt > rotate_left(std::size_t i)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
void validate(const smt_termt &operand) const
smt_sortt return_sort(const smt_termt &operand) const
std::vector< smt_indext > indices() const
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &operand)
static smt_sortt return_sort(const smt_termt &operand)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &operand)
static void validate(const smt_termt &operand)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
std::vector< smt_indext > indices() const
smt_sortt return_sort(const smt_termt &operand) const
void validate(const smt_termt &operand) const
static void validate(const smt_termt &operand)
static smt_sortt return_sort(const smt_termt &operand)
std::vector< smt_indext > indices() const
static smt_sortt return_sort(const smt_termt &operand)
std::vector< smt_indext > indices() const
static void validate(const smt_termt &operand)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &operand)
smt_sortt return_sort(const smt_termt &operand) const
std::vector< smt_indext > indices() const
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static smt_sortt return_sort(const smt_termt &lhs, const smt_termt &rhs)
static void validate(const smt_termt &lhs, const smt_termt &rhs)
std::vector< smt_indext > indices() const
static void validate(const smt_termt &operand)
smt_sortt return_sort(const smt_termt &operand) const