GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/expr/metakind.cpp Lines: 616 790 78.0 %
Date: 2021-11-05 Branches: 390 833 46.8 %

Line Exec Source
1
/******************************************************************************
2
 * This file is part of the cvc5 project.
3
 *
4
 * Copyright (c) 2010-2021 by the authors listed in the file AUTHORS
5
 * in the top-level source directory and their institutional affiliations.
6
 * All rights reserved.  See the file COPYING in the top-level source
7
 * directory for licensing information.
8
 * ****************************************************************************
9
 *
10
 * This header file was automatically generated by:
11
 *
12
 *     ../../../src/expr/mkmetakind /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/expr/metakind_template.cpp /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/builtin/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/booleans/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/uf/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/arith/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/bv/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/fp/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/arrays/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/datatypes/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/sep/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/sets/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/bags/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/strings/kinds /barrett/scratch/cvc4-nightly/src/cvc5-2021-11-05/src/theory/quantifiers/kinds
13
 *
14
 * for the cvc5 project.
15
 */
16
17
/******************************************************************************
18
 * Top contributors (to current version):
19
 *   Morgan Deters, Andres Noetzli, Aina Niemetz
20
 *
21
 * This file is part of the cvc5 project.
22
 *
23
 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
24
 * in the top-level source directory and their institutional affiliations.
25
 * All rights reserved.  See the file COPYING in the top-level source
26
 * directory for licensing information.
27
 * ****************************************************************************
28
 *
29
 * [[ Add one-line brief description here ]]
30
 *
31
 * [[ Add lengthier description here ]]
32
 * \todo document this file
33
 */
34
35
#include "expr/metakind.h"
36
37
#include <iostream>
38
39
// clang-format off
40
41
// #include "theory/builtin/::cvc5::theory::builtin::TheoryBuiltin"
42
#include "expr/uninterpreted_constant.h"
43
#include "util/abstract_value.h"
44
#include "expr/kind.h"
45
// #include "theory/booleans/::cvc5::theory::booleans::TheoryBool"
46
#include "util/bool.h"
47
// #include "theory/uf/::cvc5::theory::uf::TheoryUF"
48
#include "expr/cardinality_constraint.h"
49
// #include "theory/arith/::cvc5::theory::arith::TheoryArith"
50
#include "util/divisible.h"
51
#include "util/rational.h"
52
#include "util/indexed_root_predicate.h"
53
#include "util/iand.h"
54
// #include "theory/bv/::cvc5::theory::bv::TheoryBV"
55
#include "util/bitvector.h"
56
// #include "theory/fp/::cvc5::theory::fp::TheoryFp"
57
#include "util/floatingpoint.h"
58
#include "util/roundingmode.h"
59
// #include "theory/arrays/::cvc5::theory::arrays::TheoryArrays"
60
#include "expr/array_store_all.h"
61
// #include "theory/datatypes/::cvc5::theory::datatypes::TheoryDatatypes"
62
#include "expr/datatype_index.h"
63
#include "expr/ascription_type.h"
64
#include "theory/datatypes/tuple_project_op.h"
65
#include "expr/codatatype_bound_variable.h"
66
// #include "theory/sep/::cvc5::theory::sep::TheorySep"
67
// #include "theory/sets/::cvc5::theory::sets::TheorySets"
68
#include "expr/emptyset.h"
69
#include "theory/sets/singleton_op.h"
70
// #include "theory/bags/::cvc5::theory::bags::TheoryBags"
71
#include "expr/emptybag.h"
72
#include "theory/bags/make_bag_op.h"
73
// #include "theory/strings/::cvc5::theory::strings::TheoryStrings"
74
#include "util/string.h"
75
#include "expr/sequence.h"
76
#include "util/regexp.h"
77
// #include "theory/quantifiers/::cvc5::theory::quantifiers::TheoryQuantifiers"
78
// clang-format off
79
80
namespace cvc5 {
81
namespace kind {
82
83
/**
84
 * Get the metakind for a particular kind.
85
 */
86
6173997292
MetaKind metaKindOf(Kind k)
87
{
88
  static const MetaKind metaKinds[] = {
89
      metakind::INVALID, /* UNDEFINED_KIND */
90
      metakind::INVALID, /* NULL_EXPR */
91
      // clang-format off
92
93
    /* from builtin */
94
    metakind::VARIABLE, /* SORT_TAG */
95
    metakind::PARAMETERIZED, /* SORT_TYPE */
96
    metakind::CONSTANT, /* UNINTERPRETED_CONSTANT */
97
    metakind::CONSTANT, /* ABSTRACT_VALUE */
98
    metakind::CONSTANT, /* BUILTIN */
99
    metakind::OPERATOR, /* EQUAL */
100
    metakind::OPERATOR, /* DISTINCT */
101
    metakind::VARIABLE, /* VARIABLE */
102
    metakind::VARIABLE, /* BOUND_VARIABLE */
103
    metakind::VARIABLE, /* SKOLEM */
104
    metakind::OPERATOR, /* SEXPR */
105
    metakind::OPERATOR, /* LAMBDA */
106
    metakind::OPERATOR, /* WITNESS */
107
    metakind::CONSTANT, /* TYPE_CONSTANT */
108
    metakind::OPERATOR, /* FUNCTION_TYPE */
109
110
    /* from booleans */
111
    metakind::CONSTANT, /* CONST_BOOLEAN */
112
    metakind::OPERATOR, /* NOT */
113
    metakind::OPERATOR, /* AND */
114
    metakind::OPERATOR, /* IMPLIES */
115
    metakind::OPERATOR, /* OR */
116
    metakind::OPERATOR, /* XOR */
117
    metakind::OPERATOR, /* ITE */
118
119
    /* from uf */
120
    metakind::PARAMETERIZED, /* APPLY_UF */
121
    metakind::VARIABLE, /* BOOLEAN_TERM_VARIABLE */
122
    metakind::PARAMETERIZED, /* PARTIAL_APPLY_UF */
123
    metakind::OPERATOR, /* HO_APPLY */
124
    metakind::CONSTANT, /* CARDINALITY_CONSTRAINT_OP */
125
    metakind::PARAMETERIZED, /* CARDINALITY_CONSTRAINT */
126
    metakind::CONSTANT, /* COMBINED_CARDINALITY_CONSTRAINT_OP */
127
    metakind::PARAMETERIZED, /* COMBINED_CARDINALITY_CONSTRAINT */
128
129
    /* from arith */
130
    metakind::OPERATOR, /* PLUS */
131
    metakind::OPERATOR, /* MULT */
132
    metakind::OPERATOR, /* NONLINEAR_MULT */
133
    metakind::OPERATOR, /* MINUS */
134
    metakind::OPERATOR, /* UMINUS */
135
    metakind::OPERATOR, /* DIVISION */
136
    metakind::OPERATOR, /* DIVISION_TOTAL */
137
    metakind::OPERATOR, /* INTS_DIVISION */
138
    metakind::OPERATOR, /* INTS_DIVISION_TOTAL */
139
    metakind::OPERATOR, /* INTS_MODULUS */
140
    metakind::OPERATOR, /* INTS_MODULUS_TOTAL */
141
    metakind::OPERATOR, /* ABS */
142
    metakind::PARAMETERIZED, /* DIVISIBLE */
143
    metakind::OPERATOR, /* POW */
144
    metakind::OPERATOR, /* POW2 */
145
    metakind::OPERATOR, /* EXPONENTIAL */
146
    metakind::OPERATOR, /* SINE */
147
    metakind::OPERATOR, /* COSINE */
148
    metakind::OPERATOR, /* TANGENT */
149
    metakind::OPERATOR, /* COSECANT */
150
    metakind::OPERATOR, /* SECANT */
151
    metakind::OPERATOR, /* COTANGENT */
152
    metakind::OPERATOR, /* ARCSINE */
153
    metakind::OPERATOR, /* ARCCOSINE */
154
    metakind::OPERATOR, /* ARCTANGENT */
155
    metakind::OPERATOR, /* ARCCOSECANT */
156
    metakind::OPERATOR, /* ARCSECANT */
157
    metakind::OPERATOR, /* ARCCOTANGENT */
158
    metakind::OPERATOR, /* SQRT */
159
    metakind::CONSTANT, /* DIVISIBLE_OP */
160
    metakind::CONSTANT, /* CONST_RATIONAL */
161
    metakind::OPERATOR, /* LT */
162
    metakind::OPERATOR, /* LEQ */
163
    metakind::OPERATOR, /* GT */
164
    metakind::OPERATOR, /* GEQ */
165
    metakind::CONSTANT, /* INDEXED_ROOT_PREDICATE_OP */
166
    metakind::PARAMETERIZED, /* INDEXED_ROOT_PREDICATE */
167
    metakind::OPERATOR, /* IS_INTEGER */
168
    metakind::OPERATOR, /* TO_INTEGER */
169
    metakind::OPERATOR, /* TO_REAL */
170
    metakind::OPERATOR, /* CAST_TO_REAL */
171
    metakind::NULLARY_OPERATOR, /* PI */
172
    metakind::CONSTANT, /* IAND_OP */
173
    metakind::PARAMETERIZED, /* IAND */
174
175
    /* from bv */
176
    metakind::CONSTANT, /* BITVECTOR_TYPE */
177
    metakind::CONSTANT, /* CONST_BITVECTOR */
178
    metakind::OPERATOR, /* BITVECTOR_BB_TERM */
179
    metakind::OPERATOR, /* BITVECTOR_CONCAT */
180
    metakind::OPERATOR, /* BITVECTOR_AND */
181
    metakind::OPERATOR, /* BITVECTOR_COMP */
182
    metakind::OPERATOR, /* BITVECTOR_OR */
183
    metakind::OPERATOR, /* BITVECTOR_XOR */
184
    metakind::OPERATOR, /* BITVECTOR_NOT */
185
    metakind::OPERATOR, /* BITVECTOR_NAND */
186
    metakind::OPERATOR, /* BITVECTOR_NOR */
187
    metakind::OPERATOR, /* BITVECTOR_XNOR */
188
    metakind::OPERATOR, /* BITVECTOR_MULT */
189
    metakind::OPERATOR, /* BITVECTOR_NEG */
190
    metakind::OPERATOR, /* BITVECTOR_ADD */
191
    metakind::OPERATOR, /* BITVECTOR_SUB */
192
    metakind::OPERATOR, /* BITVECTOR_UDIV */
193
    metakind::OPERATOR, /* BITVECTOR_UREM */
194
    metakind::OPERATOR, /* BITVECTOR_SDIV */
195
    metakind::OPERATOR, /* BITVECTOR_SMOD */
196
    metakind::OPERATOR, /* BITVECTOR_SREM */
197
    metakind::OPERATOR, /* BITVECTOR_ASHR */
198
    metakind::OPERATOR, /* BITVECTOR_LSHR */
199
    metakind::OPERATOR, /* BITVECTOR_SHL */
200
    metakind::OPERATOR, /* BITVECTOR_ULE */
201
    metakind::OPERATOR, /* BITVECTOR_ULT */
202
    metakind::OPERATOR, /* BITVECTOR_UGE */
203
    metakind::OPERATOR, /* BITVECTOR_UGT */
204
    metakind::OPERATOR, /* BITVECTOR_SLE */
205
    metakind::OPERATOR, /* BITVECTOR_SLT */
206
    metakind::OPERATOR, /* BITVECTOR_SGE */
207
    metakind::OPERATOR, /* BITVECTOR_SGT */
208
    metakind::OPERATOR, /* BITVECTOR_ULTBV */
209
    metakind::OPERATOR, /* BITVECTOR_SLTBV */
210
    metakind::OPERATOR, /* BITVECTOR_REDAND */
211
    metakind::OPERATOR, /* BITVECTOR_REDOR */
212
    metakind::OPERATOR, /* BITVECTOR_ITE */
213
    metakind::OPERATOR, /* BITVECTOR_TO_NAT */
214
    metakind::OPERATOR, /* BITVECTOR_ACKERMANNIZE_UDIV */
215
    metakind::OPERATOR, /* BITVECTOR_ACKERMANNIZE_UREM */
216
    metakind::OPERATOR, /* BITVECTOR_EAGER_ATOM */
217
    metakind::CONSTANT, /* BITVECTOR_BITOF_OP */
218
    metakind::PARAMETERIZED, /* BITVECTOR_BITOF */
219
    metakind::CONSTANT, /* BITVECTOR_EXTRACT_OP */
220
    metakind::PARAMETERIZED, /* BITVECTOR_EXTRACT */
221
    metakind::CONSTANT, /* BITVECTOR_REPEAT_OP */
222
    metakind::PARAMETERIZED, /* BITVECTOR_REPEAT */
223
    metakind::CONSTANT, /* BITVECTOR_ROTATE_LEFT_OP */
224
    metakind::PARAMETERIZED, /* BITVECTOR_ROTATE_LEFT */
225
    metakind::CONSTANT, /* BITVECTOR_ROTATE_RIGHT_OP */
226
    metakind::PARAMETERIZED, /* BITVECTOR_ROTATE_RIGHT */
227
    metakind::CONSTANT, /* BITVECTOR_SIGN_EXTEND_OP */
228
    metakind::PARAMETERIZED, /* BITVECTOR_SIGN_EXTEND */
229
    metakind::CONSTANT, /* BITVECTOR_ZERO_EXTEND_OP */
230
    metakind::PARAMETERIZED, /* BITVECTOR_ZERO_EXTEND */
231
    metakind::CONSTANT, /* INT_TO_BITVECTOR_OP */
232
    metakind::PARAMETERIZED, /* INT_TO_BITVECTOR */
233
234
    /* from fp */
235
    metakind::CONSTANT, /* CONST_FLOATINGPOINT */
236
    metakind::CONSTANT, /* CONST_ROUNDINGMODE */
237
    metakind::CONSTANT, /* FLOATINGPOINT_TYPE */
238
    metakind::OPERATOR, /* FLOATINGPOINT_FP */
239
    metakind::OPERATOR, /* FLOATINGPOINT_EQ */
240
    metakind::OPERATOR, /* FLOATINGPOINT_ABS */
241
    metakind::OPERATOR, /* FLOATINGPOINT_NEG */
242
    metakind::OPERATOR, /* FLOATINGPOINT_ADD */
243
    metakind::OPERATOR, /* FLOATINGPOINT_SUB */
244
    metakind::OPERATOR, /* FLOATINGPOINT_MULT */
245
    metakind::OPERATOR, /* FLOATINGPOINT_DIV */
246
    metakind::OPERATOR, /* FLOATINGPOINT_FMA */
247
    metakind::OPERATOR, /* FLOATINGPOINT_SQRT */
248
    metakind::OPERATOR, /* FLOATINGPOINT_REM */
249
    metakind::OPERATOR, /* FLOATINGPOINT_RTI */
250
    metakind::OPERATOR, /* FLOATINGPOINT_MIN */
251
    metakind::OPERATOR, /* FLOATINGPOINT_MAX */
252
    metakind::OPERATOR, /* FLOATINGPOINT_MIN_TOTAL */
253
    metakind::OPERATOR, /* FLOATINGPOINT_MAX_TOTAL */
254
    metakind::OPERATOR, /* FLOATINGPOINT_LEQ */
255
    metakind::OPERATOR, /* FLOATINGPOINT_LT */
256
    metakind::OPERATOR, /* FLOATINGPOINT_GEQ */
257
    metakind::OPERATOR, /* FLOATINGPOINT_GT */
258
    metakind::OPERATOR, /* FLOATINGPOINT_ISN */
259
    metakind::OPERATOR, /* FLOATINGPOINT_ISSN */
260
    metakind::OPERATOR, /* FLOATINGPOINT_ISZ */
261
    metakind::OPERATOR, /* FLOATINGPOINT_ISINF */
262
    metakind::OPERATOR, /* FLOATINGPOINT_ISNAN */
263
    metakind::OPERATOR, /* FLOATINGPOINT_ISNEG */
264
    metakind::OPERATOR, /* FLOATINGPOINT_ISPOS */
265
    metakind::CONSTANT, /* FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP */
266
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_FP_IEEE_BITVECTOR */
267
    metakind::CONSTANT, /* FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP */
268
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_FP_FLOATINGPOINT */
269
    metakind::CONSTANT, /* FLOATINGPOINT_TO_FP_REAL_OP */
270
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_FP_REAL */
271
    metakind::CONSTANT, /* FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP */
272
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR */
273
    metakind::CONSTANT, /* FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP */
274
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR */
275
    metakind::CONSTANT, /* FLOATINGPOINT_TO_FP_GENERIC_OP */
276
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_FP_GENERIC */
277
    metakind::CONSTANT, /* FLOATINGPOINT_TO_UBV_OP */
278
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_UBV */
279
    metakind::CONSTANT, /* FLOATINGPOINT_TO_UBV_TOTAL_OP */
280
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_UBV_TOTAL */
281
    metakind::CONSTANT, /* FLOATINGPOINT_TO_SBV_OP */
282
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_SBV */
283
    metakind::CONSTANT, /* FLOATINGPOINT_TO_SBV_TOTAL_OP */
284
    metakind::PARAMETERIZED, /* FLOATINGPOINT_TO_SBV_TOTAL */
285
    metakind::OPERATOR, /* FLOATINGPOINT_TO_REAL */
286
    metakind::OPERATOR, /* FLOATINGPOINT_TO_REAL_TOTAL */
287
    metakind::OPERATOR, /* FLOATINGPOINT_COMPONENT_NAN */
288
    metakind::OPERATOR, /* FLOATINGPOINT_COMPONENT_INF */
289
    metakind::OPERATOR, /* FLOATINGPOINT_COMPONENT_ZERO */
290
    metakind::OPERATOR, /* FLOATINGPOINT_COMPONENT_SIGN */
291
    metakind::OPERATOR, /* FLOATINGPOINT_COMPONENT_EXPONENT */
292
    metakind::OPERATOR, /* FLOATINGPOINT_COMPONENT_SIGNIFICAND */
293
    metakind::OPERATOR, /* ROUNDINGMODE_BITBLAST */
294
295
    /* from arrays */
296
    metakind::OPERATOR, /* ARRAY_TYPE */
297
    metakind::OPERATOR, /* SELECT */
298
    metakind::OPERATOR, /* STORE */
299
    metakind::OPERATOR, /* EQ_RANGE */
300
    metakind::CONSTANT, /* STORE_ALL */
301
    metakind::OPERATOR, /* ARR_TABLE_FUN */
302
    metakind::OPERATOR, /* ARRAY_LAMBDA */
303
    metakind::OPERATOR, /* PARTIAL_SELECT_0 */
304
    metakind::OPERATOR, /* PARTIAL_SELECT_1 */
305
306
    /* from datatypes */
307
    metakind::OPERATOR, /* CONSTRUCTOR_TYPE */
308
    metakind::OPERATOR, /* SELECTOR_TYPE */
309
    metakind::OPERATOR, /* TESTER_TYPE */
310
    metakind::OPERATOR, /* UPDATER_TYPE */
311
    metakind::PARAMETERIZED, /* APPLY_CONSTRUCTOR */
312
    metakind::PARAMETERIZED, /* APPLY_SELECTOR */
313
    metakind::PARAMETERIZED, /* APPLY_SELECTOR_TOTAL */
314
    metakind::PARAMETERIZED, /* APPLY_TESTER */
315
    metakind::PARAMETERIZED, /* APPLY_UPDATER */
316
    metakind::CONSTANT, /* DATATYPE_TYPE */
317
    metakind::OPERATOR, /* PARAMETRIC_DATATYPE */
318
    metakind::PARAMETERIZED, /* APPLY_TYPE_ASCRIPTION */
319
    metakind::CONSTANT, /* ASCRIPTION_TYPE */
320
    metakind::OPERATOR, /* DT_SIZE */
321
    metakind::OPERATOR, /* DT_HEIGHT_BOUND */
322
    metakind::OPERATOR, /* DT_SIZE_BOUND */
323
    metakind::OPERATOR, /* DT_SYGUS_BOUND */
324
    metakind::OPERATOR, /* DT_SYGUS_EVAL */
325
    metakind::OPERATOR, /* MATCH */
326
    metakind::OPERATOR, /* MATCH_CASE */
327
    metakind::OPERATOR, /* MATCH_BIND_CASE */
328
    metakind::CONSTANT, /* TUPLE_PROJECT_OP */
329
    metakind::PARAMETERIZED, /* TUPLE_PROJECT */
330
    metakind::CONSTANT, /* CODATATYPE_BOUND_VARIABLE */
331
332
    /* from sep */
333
    metakind::NULLARY_OPERATOR, /* SEP_NIL */
334
    metakind::NULLARY_OPERATOR, /* SEP_EMP */
335
    metakind::OPERATOR, /* SEP_PTO */
336
    metakind::OPERATOR, /* SEP_STAR */
337
    metakind::OPERATOR, /* SEP_WAND */
338
    metakind::OPERATOR, /* SEP_LABEL */
339
340
    /* from sets */
341
    metakind::CONSTANT, /* EMPTYSET */
342
    metakind::OPERATOR, /* SET_TYPE */
343
    metakind::OPERATOR, /* UNION */
344
    metakind::OPERATOR, /* INTERSECTION */
345
    metakind::OPERATOR, /* SETMINUS */
346
    metakind::OPERATOR, /* SUBSET */
347
    metakind::OPERATOR, /* MEMBER */
348
    metakind::CONSTANT, /* SINGLETON_OP */
349
    metakind::PARAMETERIZED, /* SINGLETON */
350
    metakind::OPERATOR, /* INSERT */
351
    metakind::OPERATOR, /* CARD */
352
    metakind::OPERATOR, /* COMPLEMENT */
353
    metakind::NULLARY_OPERATOR, /* UNIVERSE_SET */
354
    metakind::OPERATOR, /* COMPREHENSION */
355
    metakind::OPERATOR, /* CHOOSE */
356
    metakind::OPERATOR, /* IS_SINGLETON */
357
    metakind::OPERATOR, /* JOIN */
358
    metakind::OPERATOR, /* PRODUCT */
359
    metakind::OPERATOR, /* TRANSPOSE */
360
    metakind::OPERATOR, /* TCLOSURE */
361
    metakind::OPERATOR, /* JOIN_IMAGE */
362
    metakind::OPERATOR, /* IDEN */
363
364
    /* from bags */
365
    metakind::CONSTANT, /* EMPTYBAG */
366
    metakind::OPERATOR, /* BAG_TYPE */
367
    metakind::OPERATOR, /* UNION_MAX */
368
    metakind::OPERATOR, /* UNION_DISJOINT */
369
    metakind::OPERATOR, /* INTERSECTION_MIN */
370
    metakind::OPERATOR, /* DIFFERENCE_SUBTRACT */
371
    metakind::OPERATOR, /* DIFFERENCE_REMOVE */
372
    metakind::OPERATOR, /* SUBBAG */
373
    metakind::OPERATOR, /* BAG_COUNT */
374
    metakind::OPERATOR, /* DUPLICATE_REMOVAL */
375
    metakind::CONSTANT, /* MK_BAG_OP */
376
    metakind::PARAMETERIZED, /* MK_BAG */
377
    metakind::OPERATOR, /* BAG_IS_SINGLETON */
378
    metakind::OPERATOR, /* BAG_CARD */
379
    metakind::OPERATOR, /* BAG_FROM_SET */
380
    metakind::OPERATOR, /* BAG_TO_SET */
381
    metakind::OPERATOR, /* BAG_CHOOSE */
382
    metakind::OPERATOR, /* BAG_MAP */
383
384
    /* from strings */
385
    metakind::OPERATOR, /* STRING_CONCAT */
386
    metakind::OPERATOR, /* STRING_IN_REGEXP */
387
    metakind::OPERATOR, /* STRING_LENGTH */
388
    metakind::OPERATOR, /* STRING_SUBSTR */
389
    metakind::OPERATOR, /* STRING_UPDATE */
390
    metakind::OPERATOR, /* STRING_CHARAT */
391
    metakind::OPERATOR, /* STRING_CONTAINS */
392
    metakind::OPERATOR, /* STRING_LT */
393
    metakind::OPERATOR, /* STRING_LEQ */
394
    metakind::OPERATOR, /* STRING_INDEXOF */
395
    metakind::OPERATOR, /* STRING_INDEXOF_RE */
396
    metakind::OPERATOR, /* STRING_REPLACE */
397
    metakind::OPERATOR, /* STRING_REPLACE_ALL */
398
    metakind::OPERATOR, /* STRING_REPLACE_RE */
399
    metakind::OPERATOR, /* STRING_REPLACE_RE_ALL */
400
    metakind::OPERATOR, /* STRING_PREFIX */
401
    metakind::OPERATOR, /* STRING_SUFFIX */
402
    metakind::OPERATOR, /* STRING_IS_DIGIT */
403
    metakind::OPERATOR, /* STRING_ITOS */
404
    metakind::OPERATOR, /* STRING_STOI */
405
    metakind::OPERATOR, /* STRING_TO_CODE */
406
    metakind::OPERATOR, /* STRING_FROM_CODE */
407
    metakind::OPERATOR, /* STRING_TOLOWER */
408
    metakind::OPERATOR, /* STRING_TOUPPER */
409
    metakind::OPERATOR, /* STRING_REV */
410
    metakind::CONSTANT, /* CONST_STRING */
411
    metakind::OPERATOR, /* SEQUENCE_TYPE */
412
    metakind::CONSTANT, /* CONST_SEQUENCE */
413
    metakind::OPERATOR, /* SEQ_UNIT */
414
    metakind::OPERATOR, /* SEQ_NTH */
415
    metakind::OPERATOR, /* SEQ_NTH_TOTAL */
416
    metakind::OPERATOR, /* STRING_TO_REGEXP */
417
    metakind::OPERATOR, /* REGEXP_CONCAT */
418
    metakind::OPERATOR, /* REGEXP_UNION */
419
    metakind::OPERATOR, /* REGEXP_INTER */
420
    metakind::OPERATOR, /* REGEXP_DIFF */
421
    metakind::OPERATOR, /* REGEXP_STAR */
422
    metakind::OPERATOR, /* REGEXP_PLUS */
423
    metakind::OPERATOR, /* REGEXP_OPT */
424
    metakind::OPERATOR, /* REGEXP_RANGE */
425
    metakind::OPERATOR, /* REGEXP_COMPLEMENT */
426
    metakind::OPERATOR, /* REGEXP_EMPTY */
427
    metakind::OPERATOR, /* REGEXP_SIGMA */
428
    metakind::CONSTANT, /* REGEXP_REPEAT_OP */
429
    metakind::PARAMETERIZED, /* REGEXP_REPEAT */
430
    metakind::CONSTANT, /* REGEXP_LOOP_OP */
431
    metakind::PARAMETERIZED, /* REGEXP_LOOP */
432
    metakind::OPERATOR, /* REGEXP_RV */
433
434
    /* from quantifiers */
435
    metakind::OPERATOR, /* FORALL */
436
    metakind::OPERATOR, /* EXISTS */
437
    metakind::VARIABLE, /* INST_CONSTANT */
438
    metakind::OPERATOR, /* BOUND_VAR_LIST */
439
    metakind::OPERATOR, /* INST_PATTERN */
440
    metakind::OPERATOR, /* INST_NO_PATTERN */
441
    metakind::OPERATOR, /* INST_ATTRIBUTE */
442
    metakind::OPERATOR, /* INST_POOL */
443
    metakind::OPERATOR, /* INST_ADD_TO_POOL */
444
    metakind::OPERATOR, /* SKOLEM_ADD_TO_POOL */
445
    metakind::OPERATOR, /* INST_PATTERN_LIST */
446
  // clang-format on
447
      metakind::INVALID  /* LAST_KIND */
448
  };                     /* metaKinds[] */
449
450
6173997292
  Assert(k >= kind::NULL_EXPR && k < kind::LAST_KIND);
451
452
  // We've asserted that k >= NULL_EXPR (which is 0), but we still
453
  // handle the UNDEFINED_KIND (-1) case.  If we don't, the compiler
454
  // emits warnings for non-assertion builds, since the check isn't done.
455
6173997292
  return metaKinds[k + 1];
456
} /* metaKindOf(k) */
457
458
}  // namespace kind
459
460
namespace expr {
461
462
// clang-format off
463
464
// The reinterpret_cast of d_children to "UninterpretedConstant const*"
465
// flags a "strict aliasing" warning; it's okay, because we never access
466
// the embedded constant as a NodeValue* child, and never access an embedded
467
// NodeValue* child as a constant.
468
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
469
470
template <>
471
77935
UninterpretedConstant const& NodeValue::getConst< UninterpretedConstant >() const {
472
77935
  AssertArgument(getKind() == ::cvc5::kind::UNINTERPRETED_CONSTANT, *this,
473
                 "Improper kind for getConst<UninterpretedConstant>()");
474
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
475
  // "constructed" when initially checking them against the NodeManager
476
  // pool), we must check d_nchildren here.
477
77935
  return d_nchildren == 0
478
77935
    ? *reinterpret_cast< UninterpretedConstant const* >(d_children)
479
77935
    : *reinterpret_cast< UninterpretedConstant const* >(d_children[0]);
480
}
481
482
// re-enable the warning
483
#pragma GCC diagnostic warning "-Wstrict-aliasing"
484
485
486
// The reinterpret_cast of d_children to "AbstractValue const*"
487
// flags a "strict aliasing" warning; it's okay, because we never access
488
// the embedded constant as a NodeValue* child, and never access an embedded
489
// NodeValue* child as a constant.
490
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
491
492
template <>
493
196
AbstractValue const& NodeValue::getConst< AbstractValue >() const {
494
196
  AssertArgument(getKind() == ::cvc5::kind::ABSTRACT_VALUE, *this,
495
                 "Improper kind for getConst<AbstractValue>()");
496
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
497
  // "constructed" when initially checking them against the NodeManager
498
  // pool), we must check d_nchildren here.
499
196
  return d_nchildren == 0
500
196
    ? *reinterpret_cast< AbstractValue const* >(d_children)
501
196
    : *reinterpret_cast< AbstractValue const* >(d_children[0]);
502
}
503
504
// re-enable the warning
505
#pragma GCC diagnostic warning "-Wstrict-aliasing"
506
507
508
// The reinterpret_cast of d_children to "Kind const*"
509
// flags a "strict aliasing" warning; it's okay, because we never access
510
// the embedded constant as a NodeValue* child, and never access an embedded
511
// NodeValue* child as a constant.
512
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
513
514
template <>
515
25075484
Kind const& NodeValue::getConst< Kind >() const {
516
25075484
  AssertArgument(getKind() == ::cvc5::kind::BUILTIN, *this,
517
                 "Improper kind for getConst<Kind>()");
518
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
519
  // "constructed" when initially checking them against the NodeManager
520
  // pool), we must check d_nchildren here.
521
25075484
  return d_nchildren == 0
522
25075484
    ? *reinterpret_cast< Kind const* >(d_children)
523
25075484
    : *reinterpret_cast< Kind const* >(d_children[0]);
524
}
525
526
// re-enable the warning
527
#pragma GCC diagnostic warning "-Wstrict-aliasing"
528
529
530
// The reinterpret_cast of d_children to "TypeConstant const*"
531
// flags a "strict aliasing" warning; it's okay, because we never access
532
// the embedded constant as a NodeValue* child, and never access an embedded
533
// NodeValue* child as a constant.
534
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
535
536
template <>
537
504960473
TypeConstant const& NodeValue::getConst< TypeConstant >() const {
538
504960473
  AssertArgument(getKind() == ::cvc5::kind::TYPE_CONSTANT, *this,
539
                 "Improper kind for getConst<TypeConstant>()");
540
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
541
  // "constructed" when initially checking them against the NodeManager
542
  // pool), we must check d_nchildren here.
543
504960473
  return d_nchildren == 0
544
504960473
    ? *reinterpret_cast< TypeConstant const* >(d_children)
545
504960473
    : *reinterpret_cast< TypeConstant const* >(d_children[0]);
546
}
547
548
// re-enable the warning
549
#pragma GCC diagnostic warning "-Wstrict-aliasing"
550
551
552
// The reinterpret_cast of d_children to "bool const*"
553
// flags a "strict aliasing" warning; it's okay, because we never access
554
// the embedded constant as a NodeValue* child, and never access an embedded
555
// NodeValue* child as a constant.
556
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
557
558
template <>
559
94275822
bool const& NodeValue::getConst< bool >() const {
560
94275822
  AssertArgument(getKind() == ::cvc5::kind::CONST_BOOLEAN, *this,
561
                 "Improper kind for getConst<bool>()");
562
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
563
  // "constructed" when initially checking them against the NodeManager
564
  // pool), we must check d_nchildren here.
565
94275822
  return d_nchildren == 0
566
94275822
    ? *reinterpret_cast< bool const* >(d_children)
567
94275822
    : *reinterpret_cast< bool const* >(d_children[0]);
568
}
569
570
// re-enable the warning
571
#pragma GCC diagnostic warning "-Wstrict-aliasing"
572
573
574
// The reinterpret_cast of d_children to "CardinalityConstraint const*"
575
// flags a "strict aliasing" warning; it's okay, because we never access
576
// the embedded constant as a NodeValue* child, and never access an embedded
577
// NodeValue* child as a constant.
578
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
579
580
template <>
581
29713
CardinalityConstraint const& NodeValue::getConst< CardinalityConstraint >() const {
582
29713
  AssertArgument(getKind() == ::cvc5::kind::CARDINALITY_CONSTRAINT_OP, *this,
583
                 "Improper kind for getConst<CardinalityConstraint>()");
584
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
585
  // "constructed" when initially checking them against the NodeManager
586
  // pool), we must check d_nchildren here.
587
29713
  return d_nchildren == 0
588
29713
    ? *reinterpret_cast< CardinalityConstraint const* >(d_children)
589
29713
    : *reinterpret_cast< CardinalityConstraint const* >(d_children[0]);
590
}
591
592
// re-enable the warning
593
#pragma GCC diagnostic warning "-Wstrict-aliasing"
594
595
596
// The reinterpret_cast of d_children to "CombinedCardinalityConstraint const*"
597
// flags a "strict aliasing" warning; it's okay, because we never access
598
// the embedded constant as a NodeValue* child, and never access an embedded
599
// NodeValue* child as a constant.
600
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
601
602
template <>
603
9736
CombinedCardinalityConstraint const& NodeValue::getConst< CombinedCardinalityConstraint >() const {
604
9736
  AssertArgument(getKind() == ::cvc5::kind::COMBINED_CARDINALITY_CONSTRAINT_OP, *this,
605
                 "Improper kind for getConst<CombinedCardinalityConstraint>()");
606
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
607
  // "constructed" when initially checking them against the NodeManager
608
  // pool), we must check d_nchildren here.
609
9736
  return d_nchildren == 0
610
9736
    ? *reinterpret_cast< CombinedCardinalityConstraint const* >(d_children)
611
9736
    : *reinterpret_cast< CombinedCardinalityConstraint const* >(d_children[0]);
612
}
613
614
// re-enable the warning
615
#pragma GCC diagnostic warning "-Wstrict-aliasing"
616
617
618
// The reinterpret_cast of d_children to "Divisible const*"
619
// flags a "strict aliasing" warning; it's okay, because we never access
620
// the embedded constant as a NodeValue* child, and never access an embedded
621
// NodeValue* child as a constant.
622
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
623
624
template <>
625
91
Divisible const& NodeValue::getConst< Divisible >() const {
626
91
  AssertArgument(getKind() == ::cvc5::kind::DIVISIBLE_OP, *this,
627
                 "Improper kind for getConst<Divisible>()");
628
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
629
  // "constructed" when initially checking them against the NodeManager
630
  // pool), we must check d_nchildren here.
631
91
  return d_nchildren == 0
632
91
    ? *reinterpret_cast< Divisible const* >(d_children)
633
91
    : *reinterpret_cast< Divisible const* >(d_children[0]);
634
}
635
636
// re-enable the warning
637
#pragma GCC diagnostic warning "-Wstrict-aliasing"
638
639
640
// The reinterpret_cast of d_children to "Rational const*"
641
// flags a "strict aliasing" warning; it's okay, because we never access
642
// the embedded constant as a NodeValue* child, and never access an embedded
643
// NodeValue* child as a constant.
644
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
645
646
template <>
647
881156327
Rational const& NodeValue::getConst< Rational >() const {
648
881156327
  AssertArgument(getKind() == ::cvc5::kind::CONST_RATIONAL, *this,
649
                 "Improper kind for getConst<Rational>()");
650
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
651
  // "constructed" when initially checking them against the NodeManager
652
  // pool), we must check d_nchildren here.
653
881156327
  return d_nchildren == 0
654
881156327
    ? *reinterpret_cast< Rational const* >(d_children)
655
881156327
    : *reinterpret_cast< Rational const* >(d_children[0]);
656
}
657
658
// re-enable the warning
659
#pragma GCC diagnostic warning "-Wstrict-aliasing"
660
661
662
// The reinterpret_cast of d_children to "IndexedRootPredicate const*"
663
// flags a "strict aliasing" warning; it's okay, because we never access
664
// the embedded constant as a NodeValue* child, and never access an embedded
665
// NodeValue* child as a constant.
666
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
667
668
template <>
669
2612
IndexedRootPredicate const& NodeValue::getConst< IndexedRootPredicate >() const {
670
2612
  AssertArgument(getKind() == ::cvc5::kind::INDEXED_ROOT_PREDICATE_OP, *this,
671
                 "Improper kind for getConst<IndexedRootPredicate>()");
672
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
673
  // "constructed" when initially checking them against the NodeManager
674
  // pool), we must check d_nchildren here.
675
2612
  return d_nchildren == 0
676
2612
    ? *reinterpret_cast< IndexedRootPredicate const* >(d_children)
677
2612
    : *reinterpret_cast< IndexedRootPredicate const* >(d_children[0]);
678
}
679
680
// re-enable the warning
681
#pragma GCC diagnostic warning "-Wstrict-aliasing"
682
683
684
// The reinterpret_cast of d_children to "IntAnd const*"
685
// flags a "strict aliasing" warning; it's okay, because we never access
686
// the embedded constant as a NodeValue* child, and never access an embedded
687
// NodeValue* child as a constant.
688
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
689
690
template <>
691
1397
IntAnd const& NodeValue::getConst< IntAnd >() const {
692
1397
  AssertArgument(getKind() == ::cvc5::kind::IAND_OP, *this,
693
                 "Improper kind for getConst<IntAnd>()");
694
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
695
  // "constructed" when initially checking them against the NodeManager
696
  // pool), we must check d_nchildren here.
697
1397
  return d_nchildren == 0
698
1397
    ? *reinterpret_cast< IntAnd const* >(d_children)
699
1397
    : *reinterpret_cast< IntAnd const* >(d_children[0]);
700
}
701
702
// re-enable the warning
703
#pragma GCC diagnostic warning "-Wstrict-aliasing"
704
705
706
// The reinterpret_cast of d_children to "BitVectorSize const*"
707
// flags a "strict aliasing" warning; it's okay, because we never access
708
// the embedded constant as a NodeValue* child, and never access an embedded
709
// NodeValue* child as a constant.
710
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
711
712
template <>
713
5652492
BitVectorSize const& NodeValue::getConst< BitVectorSize >() const {
714
5652492
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_TYPE, *this,
715
                 "Improper kind for getConst<BitVectorSize>()");
716
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
717
  // "constructed" when initially checking them against the NodeManager
718
  // pool), we must check d_nchildren here.
719
5652492
  return d_nchildren == 0
720
5652492
    ? *reinterpret_cast< BitVectorSize const* >(d_children)
721
5652492
    : *reinterpret_cast< BitVectorSize const* >(d_children[0]);
722
}
723
724
// re-enable the warning
725
#pragma GCC diagnostic warning "-Wstrict-aliasing"
726
727
728
// The reinterpret_cast of d_children to "BitVector const*"
729
// flags a "strict aliasing" warning; it's okay, because we never access
730
// the embedded constant as a NodeValue* child, and never access an embedded
731
// NodeValue* child as a constant.
732
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
733
734
template <>
735
31405478
BitVector const& NodeValue::getConst< BitVector >() const {
736
31405478
  AssertArgument(getKind() == ::cvc5::kind::CONST_BITVECTOR, *this,
737
                 "Improper kind for getConst<BitVector>()");
738
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
739
  // "constructed" when initially checking them against the NodeManager
740
  // pool), we must check d_nchildren here.
741
31405478
  return d_nchildren == 0
742
31405478
    ? *reinterpret_cast< BitVector const* >(d_children)
743
31405478
    : *reinterpret_cast< BitVector const* >(d_children[0]);
744
}
745
746
// re-enable the warning
747
#pragma GCC diagnostic warning "-Wstrict-aliasing"
748
749
750
// The reinterpret_cast of d_children to "BitVectorBitOf const*"
751
// flags a "strict aliasing" warning; it's okay, because we never access
752
// the embedded constant as a NodeValue* child, and never access an embedded
753
// NodeValue* child as a constant.
754
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
755
756
template <>
757
921929
BitVectorBitOf const& NodeValue::getConst< BitVectorBitOf >() const {
758
921929
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_BITOF_OP, *this,
759
                 "Improper kind for getConst<BitVectorBitOf>()");
760
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
761
  // "constructed" when initially checking them against the NodeManager
762
  // pool), we must check d_nchildren here.
763
921929
  return d_nchildren == 0
764
921929
    ? *reinterpret_cast< BitVectorBitOf const* >(d_children)
765
921929
    : *reinterpret_cast< BitVectorBitOf const* >(d_children[0]);
766
}
767
768
// re-enable the warning
769
#pragma GCC diagnostic warning "-Wstrict-aliasing"
770
771
772
// The reinterpret_cast of d_children to "BitVectorExtract const*"
773
// flags a "strict aliasing" warning; it's okay, because we never access
774
// the embedded constant as a NodeValue* child, and never access an embedded
775
// NodeValue* child as a constant.
776
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
777
778
template <>
779
1736468
BitVectorExtract const& NodeValue::getConst< BitVectorExtract >() const {
780
1736468
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_EXTRACT_OP, *this,
781
                 "Improper kind for getConst<BitVectorExtract>()");
782
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
783
  // "constructed" when initially checking them against the NodeManager
784
  // pool), we must check d_nchildren here.
785
1736468
  return d_nchildren == 0
786
1736468
    ? *reinterpret_cast< BitVectorExtract const* >(d_children)
787
1736468
    : *reinterpret_cast< BitVectorExtract const* >(d_children[0]);
788
}
789
790
// re-enable the warning
791
#pragma GCC diagnostic warning "-Wstrict-aliasing"
792
793
794
// The reinterpret_cast of d_children to "BitVectorRepeat const*"
795
// flags a "strict aliasing" warning; it's okay, because we never access
796
// the embedded constant as a NodeValue* child, and never access an embedded
797
// NodeValue* child as a constant.
798
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
799
800
template <>
801
9098
BitVectorRepeat const& NodeValue::getConst< BitVectorRepeat >() const {
802
9098
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_REPEAT_OP, *this,
803
                 "Improper kind for getConst<BitVectorRepeat>()");
804
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
805
  // "constructed" when initially checking them against the NodeManager
806
  // pool), we must check d_nchildren here.
807
9098
  return d_nchildren == 0
808
9098
    ? *reinterpret_cast< BitVectorRepeat const* >(d_children)
809
9098
    : *reinterpret_cast< BitVectorRepeat const* >(d_children[0]);
810
}
811
812
// re-enable the warning
813
#pragma GCC diagnostic warning "-Wstrict-aliasing"
814
815
816
// The reinterpret_cast of d_children to "BitVectorRotateLeft const*"
817
// flags a "strict aliasing" warning; it's okay, because we never access
818
// the embedded constant as a NodeValue* child, and never access an embedded
819
// NodeValue* child as a constant.
820
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
821
822
template <>
823
4724
BitVectorRotateLeft const& NodeValue::getConst< BitVectorRotateLeft >() const {
824
4724
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_ROTATE_LEFT_OP, *this,
825
                 "Improper kind for getConst<BitVectorRotateLeft>()");
826
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
827
  // "constructed" when initially checking them against the NodeManager
828
  // pool), we must check d_nchildren here.
829
4724
  return d_nchildren == 0
830
4724
    ? *reinterpret_cast< BitVectorRotateLeft const* >(d_children)
831
4724
    : *reinterpret_cast< BitVectorRotateLeft const* >(d_children[0]);
832
}
833
834
// re-enable the warning
835
#pragma GCC diagnostic warning "-Wstrict-aliasing"
836
837
838
// The reinterpret_cast of d_children to "BitVectorRotateRight const*"
839
// flags a "strict aliasing" warning; it's okay, because we never access
840
// the embedded constant as a NodeValue* child, and never access an embedded
841
// NodeValue* child as a constant.
842
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
843
844
template <>
845
5785
BitVectorRotateRight const& NodeValue::getConst< BitVectorRotateRight >() const {
846
5785
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_ROTATE_RIGHT_OP, *this,
847
                 "Improper kind for getConst<BitVectorRotateRight>()");
848
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
849
  // "constructed" when initially checking them against the NodeManager
850
  // pool), we must check d_nchildren here.
851
5785
  return d_nchildren == 0
852
5785
    ? *reinterpret_cast< BitVectorRotateRight const* >(d_children)
853
5785
    : *reinterpret_cast< BitVectorRotateRight const* >(d_children[0]);
854
}
855
856
// re-enable the warning
857
#pragma GCC diagnostic warning "-Wstrict-aliasing"
858
859
860
// The reinterpret_cast of d_children to "BitVectorSignExtend const*"
861
// flags a "strict aliasing" warning; it's okay, because we never access
862
// the embedded constant as a NodeValue* child, and never access an embedded
863
// NodeValue* child as a constant.
864
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
865
866
template <>
867
103868
BitVectorSignExtend const& NodeValue::getConst< BitVectorSignExtend >() const {
868
103868
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_SIGN_EXTEND_OP, *this,
869
                 "Improper kind for getConst<BitVectorSignExtend>()");
870
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
871
  // "constructed" when initially checking them against the NodeManager
872
  // pool), we must check d_nchildren here.
873
103868
  return d_nchildren == 0
874
103868
    ? *reinterpret_cast< BitVectorSignExtend const* >(d_children)
875
103868
    : *reinterpret_cast< BitVectorSignExtend const* >(d_children[0]);
876
}
877
878
// re-enable the warning
879
#pragma GCC diagnostic warning "-Wstrict-aliasing"
880
881
882
// The reinterpret_cast of d_children to "BitVectorZeroExtend const*"
883
// flags a "strict aliasing" warning; it's okay, because we never access
884
// the embedded constant as a NodeValue* child, and never access an embedded
885
// NodeValue* child as a constant.
886
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
887
888
template <>
889
143359
BitVectorZeroExtend const& NodeValue::getConst< BitVectorZeroExtend >() const {
890
143359
  AssertArgument(getKind() == ::cvc5::kind::BITVECTOR_ZERO_EXTEND_OP, *this,
891
                 "Improper kind for getConst<BitVectorZeroExtend>()");
892
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
893
  // "constructed" when initially checking them against the NodeManager
894
  // pool), we must check d_nchildren here.
895
143359
  return d_nchildren == 0
896
143359
    ? *reinterpret_cast< BitVectorZeroExtend const* >(d_children)
897
143359
    : *reinterpret_cast< BitVectorZeroExtend const* >(d_children[0]);
898
}
899
900
// re-enable the warning
901
#pragma GCC diagnostic warning "-Wstrict-aliasing"
902
903
904
// The reinterpret_cast of d_children to "IntToBitVector const*"
905
// flags a "strict aliasing" warning; it's okay, because we never access
906
// the embedded constant as a NodeValue* child, and never access an embedded
907
// NodeValue* child as a constant.
908
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
909
910
template <>
911
4608
IntToBitVector const& NodeValue::getConst< IntToBitVector >() const {
912
4608
  AssertArgument(getKind() == ::cvc5::kind::INT_TO_BITVECTOR_OP, *this,
913
                 "Improper kind for getConst<IntToBitVector>()");
914
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
915
  // "constructed" when initially checking them against the NodeManager
916
  // pool), we must check d_nchildren here.
917
4608
  return d_nchildren == 0
918
4608
    ? *reinterpret_cast< IntToBitVector const* >(d_children)
919
4608
    : *reinterpret_cast< IntToBitVector const* >(d_children[0]);
920
}
921
922
// re-enable the warning
923
#pragma GCC diagnostic warning "-Wstrict-aliasing"
924
925
926
// The reinterpret_cast of d_children to "FloatingPoint const*"
927
// flags a "strict aliasing" warning; it's okay, because we never access
928
// the embedded constant as a NodeValue* child, and never access an embedded
929
// NodeValue* child as a constant.
930
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
931
932
template <>
933
12757
FloatingPoint const& NodeValue::getConst< FloatingPoint >() const {
934
12757
  AssertArgument(getKind() == ::cvc5::kind::CONST_FLOATINGPOINT, *this,
935
                 "Improper kind for getConst<FloatingPoint>()");
936
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
937
  // "constructed" when initially checking them against the NodeManager
938
  // pool), we must check d_nchildren here.
939
12757
  return d_nchildren == 0
940
12757
    ? *reinterpret_cast< FloatingPoint const* >(d_children)
941
12757
    : *reinterpret_cast< FloatingPoint const* >(d_children[0]);
942
}
943
944
// re-enable the warning
945
#pragma GCC diagnostic warning "-Wstrict-aliasing"
946
947
948
// The reinterpret_cast of d_children to "RoundingMode const*"
949
// flags a "strict aliasing" warning; it's okay, because we never access
950
// the embedded constant as a NodeValue* child, and never access an embedded
951
// NodeValue* child as a constant.
952
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
953
954
template <>
955
147290
RoundingMode const& NodeValue::getConst< RoundingMode >() const {
956
147290
  AssertArgument(getKind() == ::cvc5::kind::CONST_ROUNDINGMODE, *this,
957
                 "Improper kind for getConst<RoundingMode>()");
958
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
959
  // "constructed" when initially checking them against the NodeManager
960
  // pool), we must check d_nchildren here.
961
147290
  return d_nchildren == 0
962
147290
    ? *reinterpret_cast< RoundingMode const* >(d_children)
963
147290
    : *reinterpret_cast< RoundingMode const* >(d_children[0]);
964
}
965
966
// re-enable the warning
967
#pragma GCC diagnostic warning "-Wstrict-aliasing"
968
969
970
// The reinterpret_cast of d_children to "FloatingPointSize const*"
971
// flags a "strict aliasing" warning; it's okay, because we never access
972
// the embedded constant as a NodeValue* child, and never access an embedded
973
// NodeValue* child as a constant.
974
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
975
976
template <>
977
115950
FloatingPointSize const& NodeValue::getConst< FloatingPointSize >() const {
978
115950
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TYPE, *this,
979
                 "Improper kind for getConst<FloatingPointSize>()");
980
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
981
  // "constructed" when initially checking them against the NodeManager
982
  // pool), we must check d_nchildren here.
983
115950
  return d_nchildren == 0
984
115950
    ? *reinterpret_cast< FloatingPointSize const* >(d_children)
985
115950
    : *reinterpret_cast< FloatingPointSize const* >(d_children[0]);
986
}
987
988
// re-enable the warning
989
#pragma GCC diagnostic warning "-Wstrict-aliasing"
990
991
992
// The reinterpret_cast of d_children to "FloatingPointToFPIEEEBitVector const*"
993
// flags a "strict aliasing" warning; it's okay, because we never access
994
// the embedded constant as a NodeValue* child, and never access an embedded
995
// NodeValue* child as a constant.
996
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
997
998
template <>
999
9448
FloatingPointToFPIEEEBitVector const& NodeValue::getConst< FloatingPointToFPIEEEBitVector >() const {
1000
9448
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP, *this,
1001
                 "Improper kind for getConst<FloatingPointToFPIEEEBitVector>()");
1002
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1003
  // "constructed" when initially checking them against the NodeManager
1004
  // pool), we must check d_nchildren here.
1005
9448
  return d_nchildren == 0
1006
9448
    ? *reinterpret_cast< FloatingPointToFPIEEEBitVector const* >(d_children)
1007
9448
    : *reinterpret_cast< FloatingPointToFPIEEEBitVector const* >(d_children[0]);
1008
}
1009
1010
// re-enable the warning
1011
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1012
1013
1014
// The reinterpret_cast of d_children to "FloatingPointToFPFloatingPoint const*"
1015
// flags a "strict aliasing" warning; it's okay, because we never access
1016
// the embedded constant as a NodeValue* child, and never access an embedded
1017
// NodeValue* child as a constant.
1018
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1019
1020
template <>
1021
155
FloatingPointToFPFloatingPoint const& NodeValue::getConst< FloatingPointToFPFloatingPoint >() const {
1022
155
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP, *this,
1023
                 "Improper kind for getConst<FloatingPointToFPFloatingPoint>()");
1024
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1025
  // "constructed" when initially checking them against the NodeManager
1026
  // pool), we must check d_nchildren here.
1027
155
  return d_nchildren == 0
1028
155
    ? *reinterpret_cast< FloatingPointToFPFloatingPoint const* >(d_children)
1029
155
    : *reinterpret_cast< FloatingPointToFPFloatingPoint const* >(d_children[0]);
1030
}
1031
1032
// re-enable the warning
1033
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1034
1035
1036
// The reinterpret_cast of d_children to "FloatingPointToFPReal const*"
1037
// flags a "strict aliasing" warning; it's okay, because we never access
1038
// the embedded constant as a NodeValue* child, and never access an embedded
1039
// NodeValue* child as a constant.
1040
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1041
1042
template <>
1043
432
FloatingPointToFPReal const& NodeValue::getConst< FloatingPointToFPReal >() const {
1044
432
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_FP_REAL_OP, *this,
1045
                 "Improper kind for getConst<FloatingPointToFPReal>()");
1046
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1047
  // "constructed" when initially checking them against the NodeManager
1048
  // pool), we must check d_nchildren here.
1049
432
  return d_nchildren == 0
1050
432
    ? *reinterpret_cast< FloatingPointToFPReal const* >(d_children)
1051
432
    : *reinterpret_cast< FloatingPointToFPReal const* >(d_children[0]);
1052
}
1053
1054
// re-enable the warning
1055
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1056
1057
1058
// The reinterpret_cast of d_children to "FloatingPointToFPSignedBitVector const*"
1059
// flags a "strict aliasing" warning; it's okay, because we never access
1060
// the embedded constant as a NodeValue* child, and never access an embedded
1061
// NodeValue* child as a constant.
1062
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1063
1064
template <>
1065
177
FloatingPointToFPSignedBitVector const& NodeValue::getConst< FloatingPointToFPSignedBitVector >() const {
1066
177
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP, *this,
1067
                 "Improper kind for getConst<FloatingPointToFPSignedBitVector>()");
1068
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1069
  // "constructed" when initially checking them against the NodeManager
1070
  // pool), we must check d_nchildren here.
1071
177
  return d_nchildren == 0
1072
177
    ? *reinterpret_cast< FloatingPointToFPSignedBitVector const* >(d_children)
1073
177
    : *reinterpret_cast< FloatingPointToFPSignedBitVector const* >(d_children[0]);
1074
}
1075
1076
// re-enable the warning
1077
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1078
1079
1080
// The reinterpret_cast of d_children to "FloatingPointToFPUnsignedBitVector const*"
1081
// flags a "strict aliasing" warning; it's okay, because we never access
1082
// the embedded constant as a NodeValue* child, and never access an embedded
1083
// NodeValue* child as a constant.
1084
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1085
1086
template <>
1087
320
FloatingPointToFPUnsignedBitVector const& NodeValue::getConst< FloatingPointToFPUnsignedBitVector >() const {
1088
320
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP, *this,
1089
                 "Improper kind for getConst<FloatingPointToFPUnsignedBitVector>()");
1090
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1091
  // "constructed" when initially checking them against the NodeManager
1092
  // pool), we must check d_nchildren here.
1093
320
  return d_nchildren == 0
1094
320
    ? *reinterpret_cast< FloatingPointToFPUnsignedBitVector const* >(d_children)
1095
320
    : *reinterpret_cast< FloatingPointToFPUnsignedBitVector const* >(d_children[0]);
1096
}
1097
1098
// re-enable the warning
1099
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1100
1101
1102
// The reinterpret_cast of d_children to "FloatingPointToFPGeneric const*"
1103
// flags a "strict aliasing" warning; it's okay, because we never access
1104
// the embedded constant as a NodeValue* child, and never access an embedded
1105
// NodeValue* child as a constant.
1106
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1107
1108
template <>
1109
759
FloatingPointToFPGeneric const& NodeValue::getConst< FloatingPointToFPGeneric >() const {
1110
759
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_FP_GENERIC_OP, *this,
1111
                 "Improper kind for getConst<FloatingPointToFPGeneric>()");
1112
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1113
  // "constructed" when initially checking them against the NodeManager
1114
  // pool), we must check d_nchildren here.
1115
759
  return d_nchildren == 0
1116
759
    ? *reinterpret_cast< FloatingPointToFPGeneric const* >(d_children)
1117
759
    : *reinterpret_cast< FloatingPointToFPGeneric const* >(d_children[0]);
1118
}
1119
1120
// re-enable the warning
1121
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1122
1123
1124
// The reinterpret_cast of d_children to "FloatingPointToUBV const*"
1125
// flags a "strict aliasing" warning; it's okay, because we never access
1126
// the embedded constant as a NodeValue* child, and never access an embedded
1127
// NodeValue* child as a constant.
1128
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1129
1130
template <>
1131
51
FloatingPointToUBV const& NodeValue::getConst< FloatingPointToUBV >() const {
1132
51
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_UBV_OP, *this,
1133
                 "Improper kind for getConst<FloatingPointToUBV>()");
1134
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1135
  // "constructed" when initially checking them against the NodeManager
1136
  // pool), we must check d_nchildren here.
1137
51
  return d_nchildren == 0
1138
51
    ? *reinterpret_cast< FloatingPointToUBV const* >(d_children)
1139
51
    : *reinterpret_cast< FloatingPointToUBV const* >(d_children[0]);
1140
}
1141
1142
// re-enable the warning
1143
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1144
1145
1146
// The reinterpret_cast of d_children to "FloatingPointToUBVTotal const*"
1147
// flags a "strict aliasing" warning; it's okay, because we never access
1148
// the embedded constant as a NodeValue* child, and never access an embedded
1149
// NodeValue* child as a constant.
1150
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1151
1152
template <>
1153
FloatingPointToUBVTotal const& NodeValue::getConst< FloatingPointToUBVTotal >() const {
1154
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_UBV_TOTAL_OP, *this,
1155
                 "Improper kind for getConst<FloatingPointToUBVTotal>()");
1156
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1157
  // "constructed" when initially checking them against the NodeManager
1158
  // pool), we must check d_nchildren here.
1159
  return d_nchildren == 0
1160
    ? *reinterpret_cast< FloatingPointToUBVTotal const* >(d_children)
1161
    : *reinterpret_cast< FloatingPointToUBVTotal const* >(d_children[0]);
1162
}
1163
1164
// re-enable the warning
1165
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1166
1167
1168
// The reinterpret_cast of d_children to "FloatingPointToSBV const*"
1169
// flags a "strict aliasing" warning; it's okay, because we never access
1170
// the embedded constant as a NodeValue* child, and never access an embedded
1171
// NodeValue* child as a constant.
1172
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1173
1174
template <>
1175
90
FloatingPointToSBV const& NodeValue::getConst< FloatingPointToSBV >() const {
1176
90
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_SBV_OP, *this,
1177
                 "Improper kind for getConst<FloatingPointToSBV>()");
1178
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1179
  // "constructed" when initially checking them against the NodeManager
1180
  // pool), we must check d_nchildren here.
1181
90
  return d_nchildren == 0
1182
90
    ? *reinterpret_cast< FloatingPointToSBV const* >(d_children)
1183
90
    : *reinterpret_cast< FloatingPointToSBV const* >(d_children[0]);
1184
}
1185
1186
// re-enable the warning
1187
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1188
1189
1190
// The reinterpret_cast of d_children to "FloatingPointToSBVTotal const*"
1191
// flags a "strict aliasing" warning; it's okay, because we never access
1192
// the embedded constant as a NodeValue* child, and never access an embedded
1193
// NodeValue* child as a constant.
1194
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1195
1196
template <>
1197
37
FloatingPointToSBVTotal const& NodeValue::getConst< FloatingPointToSBVTotal >() const {
1198
37
  AssertArgument(getKind() == ::cvc5::kind::FLOATINGPOINT_TO_SBV_TOTAL_OP, *this,
1199
                 "Improper kind for getConst<FloatingPointToSBVTotal>()");
1200
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1201
  // "constructed" when initially checking them against the NodeManager
1202
  // pool), we must check d_nchildren here.
1203
37
  return d_nchildren == 0
1204
37
    ? *reinterpret_cast< FloatingPointToSBVTotal const* >(d_children)
1205
37
    : *reinterpret_cast< FloatingPointToSBVTotal const* >(d_children[0]);
1206
}
1207
1208
// re-enable the warning
1209
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1210
1211
1212
// The reinterpret_cast of d_children to "ArrayStoreAll const*"
1213
// flags a "strict aliasing" warning; it's okay, because we never access
1214
// the embedded constant as a NodeValue* child, and never access an embedded
1215
// NodeValue* child as a constant.
1216
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1217
1218
template <>
1219
31342
ArrayStoreAll const& NodeValue::getConst< ArrayStoreAll >() const {
1220
31342
  AssertArgument(getKind() == ::cvc5::kind::STORE_ALL, *this,
1221
                 "Improper kind for getConst<ArrayStoreAll>()");
1222
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1223
  // "constructed" when initially checking them against the NodeManager
1224
  // pool), we must check d_nchildren here.
1225
31342
  return d_nchildren == 0
1226
31342
    ? *reinterpret_cast< ArrayStoreAll const* >(d_children)
1227
31342
    : *reinterpret_cast< ArrayStoreAll const* >(d_children[0]);
1228
}
1229
1230
// re-enable the warning
1231
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1232
1233
1234
// The reinterpret_cast of d_children to "DatatypeIndexConstant const*"
1235
// flags a "strict aliasing" warning; it's okay, because we never access
1236
// the embedded constant as a NodeValue* child, and never access an embedded
1237
// NodeValue* child as a constant.
1238
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1239
1240
template <>
1241
7138174
DatatypeIndexConstant const& NodeValue::getConst< DatatypeIndexConstant >() const {
1242
7138174
  AssertArgument(getKind() == ::cvc5::kind::DATATYPE_TYPE, *this,
1243
                 "Improper kind for getConst<DatatypeIndexConstant>()");
1244
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1245
  // "constructed" when initially checking them against the NodeManager
1246
  // pool), we must check d_nchildren here.
1247
7138174
  return d_nchildren == 0
1248
7138174
    ? *reinterpret_cast< DatatypeIndexConstant const* >(d_children)
1249
7138174
    : *reinterpret_cast< DatatypeIndexConstant const* >(d_children[0]);
1250
}
1251
1252
// re-enable the warning
1253
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1254
1255
1256
// The reinterpret_cast of d_children to "AscriptionType const*"
1257
// flags a "strict aliasing" warning; it's okay, because we never access
1258
// the embedded constant as a NodeValue* child, and never access an embedded
1259
// NodeValue* child as a constant.
1260
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1261
1262
template <>
1263
5134
AscriptionType const& NodeValue::getConst< AscriptionType >() const {
1264
5134
  AssertArgument(getKind() == ::cvc5::kind::ASCRIPTION_TYPE, *this,
1265
                 "Improper kind for getConst<AscriptionType>()");
1266
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1267
  // "constructed" when initially checking them against the NodeManager
1268
  // pool), we must check d_nchildren here.
1269
5134
  return d_nchildren == 0
1270
5134
    ? *reinterpret_cast< AscriptionType const* >(d_children)
1271
5134
    : *reinterpret_cast< AscriptionType const* >(d_children[0]);
1272
}
1273
1274
// re-enable the warning
1275
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1276
1277
1278
// The reinterpret_cast of d_children to "TupleProjectOp const*"
1279
// flags a "strict aliasing" warning; it's okay, because we never access
1280
// the embedded constant as a NodeValue* child, and never access an embedded
1281
// NodeValue* child as a constant.
1282
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1283
1284
template <>
1285
314
TupleProjectOp const& NodeValue::getConst< TupleProjectOp >() const {
1286
314
  AssertArgument(getKind() == ::cvc5::kind::TUPLE_PROJECT_OP, *this,
1287
                 "Improper kind for getConst<TupleProjectOp>()");
1288
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1289
  // "constructed" when initially checking them against the NodeManager
1290
  // pool), we must check d_nchildren here.
1291
314
  return d_nchildren == 0
1292
314
    ? *reinterpret_cast< TupleProjectOp const* >(d_children)
1293
314
    : *reinterpret_cast< TupleProjectOp const* >(d_children[0]);
1294
}
1295
1296
// re-enable the warning
1297
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1298
1299
1300
// The reinterpret_cast of d_children to "CodatatypeBoundVariable const*"
1301
// flags a "strict aliasing" warning; it's okay, because we never access
1302
// the embedded constant as a NodeValue* child, and never access an embedded
1303
// NodeValue* child as a constant.
1304
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1305
1306
template <>
1307
4719
CodatatypeBoundVariable const& NodeValue::getConst< CodatatypeBoundVariable >() const {
1308
4719
  AssertArgument(getKind() == ::cvc5::kind::CODATATYPE_BOUND_VARIABLE, *this,
1309
                 "Improper kind for getConst<CodatatypeBoundVariable>()");
1310
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1311
  // "constructed" when initially checking them against the NodeManager
1312
  // pool), we must check d_nchildren here.
1313
4719
  return d_nchildren == 0
1314
4719
    ? *reinterpret_cast< CodatatypeBoundVariable const* >(d_children)
1315
4719
    : *reinterpret_cast< CodatatypeBoundVariable const* >(d_children[0]);
1316
}
1317
1318
// re-enable the warning
1319
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1320
1321
1322
// The reinterpret_cast of d_children to "EmptySet const*"
1323
// flags a "strict aliasing" warning; it's okay, because we never access
1324
// the embedded constant as a NodeValue* child, and never access an embedded
1325
// NodeValue* child as a constant.
1326
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1327
1328
template <>
1329
32281
EmptySet const& NodeValue::getConst< EmptySet >() const {
1330
32281
  AssertArgument(getKind() == ::cvc5::kind::EMPTYSET, *this,
1331
                 "Improper kind for getConst<EmptySet>()");
1332
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1333
  // "constructed" when initially checking them against the NodeManager
1334
  // pool), we must check d_nchildren here.
1335
32281
  return d_nchildren == 0
1336
32281
    ? *reinterpret_cast< EmptySet const* >(d_children)
1337
32281
    : *reinterpret_cast< EmptySet const* >(d_children[0]);
1338
}
1339
1340
// re-enable the warning
1341
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1342
1343
1344
// The reinterpret_cast of d_children to "SingletonOp const*"
1345
// flags a "strict aliasing" warning; it's okay, because we never access
1346
// the embedded constant as a NodeValue* child, and never access an embedded
1347
// NodeValue* child as a constant.
1348
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1349
1350
template <>
1351
53413
SingletonOp const& NodeValue::getConst< SingletonOp >() const {
1352
53413
  AssertArgument(getKind() == ::cvc5::kind::SINGLETON_OP, *this,
1353
                 "Improper kind for getConst<SingletonOp>()");
1354
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1355
  // "constructed" when initially checking them against the NodeManager
1356
  // pool), we must check d_nchildren here.
1357
53413
  return d_nchildren == 0
1358
53413
    ? *reinterpret_cast< SingletonOp const* >(d_children)
1359
53413
    : *reinterpret_cast< SingletonOp const* >(d_children[0]);
1360
}
1361
1362
// re-enable the warning
1363
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1364
1365
1366
// The reinterpret_cast of d_children to "EmptyBag const*"
1367
// flags a "strict aliasing" warning; it's okay, because we never access
1368
// the embedded constant as a NodeValue* child, and never access an embedded
1369
// NodeValue* child as a constant.
1370
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1371
1372
template <>
1373
26093
EmptyBag const& NodeValue::getConst< EmptyBag >() const {
1374
26093
  AssertArgument(getKind() == ::cvc5::kind::EMPTYBAG, *this,
1375
                 "Improper kind for getConst<EmptyBag>()");
1376
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1377
  // "constructed" when initially checking them against the NodeManager
1378
  // pool), we must check d_nchildren here.
1379
26093
  return d_nchildren == 0
1380
26093
    ? *reinterpret_cast< EmptyBag const* >(d_children)
1381
26093
    : *reinterpret_cast< EmptyBag const* >(d_children[0]);
1382
}
1383
1384
// re-enable the warning
1385
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1386
1387
1388
// The reinterpret_cast of d_children to "MakeBagOp const*"
1389
// flags a "strict aliasing" warning; it's okay, because we never access
1390
// the embedded constant as a NodeValue* child, and never access an embedded
1391
// NodeValue* child as a constant.
1392
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1393
1394
template <>
1395
1569
MakeBagOp const& NodeValue::getConst< MakeBagOp >() const {
1396
1569
  AssertArgument(getKind() == ::cvc5::kind::MK_BAG_OP, *this,
1397
                 "Improper kind for getConst<MakeBagOp>()");
1398
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1399
  // "constructed" when initially checking them against the NodeManager
1400
  // pool), we must check d_nchildren here.
1401
1569
  return d_nchildren == 0
1402
1569
    ? *reinterpret_cast< MakeBagOp const* >(d_children)
1403
1569
    : *reinterpret_cast< MakeBagOp const* >(d_children[0]);
1404
}
1405
1406
// re-enable the warning
1407
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1408
1409
1410
// The reinterpret_cast of d_children to "String const*"
1411
// flags a "strict aliasing" warning; it's okay, because we never access
1412
// the embedded constant as a NodeValue* child, and never access an embedded
1413
// NodeValue* child as a constant.
1414
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1415
1416
template <>
1417
8794160
String const& NodeValue::getConst< String >() const {
1418
8794160
  AssertArgument(getKind() == ::cvc5::kind::CONST_STRING, *this,
1419
                 "Improper kind for getConst<String>()");
1420
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1421
  // "constructed" when initially checking them against the NodeManager
1422
  // pool), we must check d_nchildren here.
1423
8794160
  return d_nchildren == 0
1424
8794160
    ? *reinterpret_cast< String const* >(d_children)
1425
8794160
    : *reinterpret_cast< String const* >(d_children[0]);
1426
}
1427
1428
// re-enable the warning
1429
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1430
1431
1432
// The reinterpret_cast of d_children to "Sequence const*"
1433
// flags a "strict aliasing" warning; it's okay, because we never access
1434
// the embedded constant as a NodeValue* child, and never access an embedded
1435
// NodeValue* child as a constant.
1436
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1437
1438
template <>
1439
55188
Sequence const& NodeValue::getConst< Sequence >() const {
1440
55188
  AssertArgument(getKind() == ::cvc5::kind::CONST_SEQUENCE, *this,
1441
                 "Improper kind for getConst<Sequence>()");
1442
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1443
  // "constructed" when initially checking them against the NodeManager
1444
  // pool), we must check d_nchildren here.
1445
55188
  return d_nchildren == 0
1446
55188
    ? *reinterpret_cast< Sequence const* >(d_children)
1447
55188
    : *reinterpret_cast< Sequence const* >(d_children[0]);
1448
}
1449
1450
// re-enable the warning
1451
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1452
1453
1454
// The reinterpret_cast of d_children to "RegExpRepeat const*"
1455
// flags a "strict aliasing" warning; it's okay, because we never access
1456
// the embedded constant as a NodeValue* child, and never access an embedded
1457
// NodeValue* child as a constant.
1458
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1459
1460
template <>
1461
65
RegExpRepeat const& NodeValue::getConst< RegExpRepeat >() const {
1462
65
  AssertArgument(getKind() == ::cvc5::kind::REGEXP_REPEAT_OP, *this,
1463
                 "Improper kind for getConst<RegExpRepeat>()");
1464
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1465
  // "constructed" when initially checking them against the NodeManager
1466
  // pool), we must check d_nchildren here.
1467
65
  return d_nchildren == 0
1468
65
    ? *reinterpret_cast< RegExpRepeat const* >(d_children)
1469
65
    : *reinterpret_cast< RegExpRepeat const* >(d_children[0]);
1470
}
1471
1472
// re-enable the warning
1473
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1474
1475
1476
// The reinterpret_cast of d_children to "RegExpLoop const*"
1477
// flags a "strict aliasing" warning; it's okay, because we never access
1478
// the embedded constant as a NodeValue* child, and never access an embedded
1479
// NodeValue* child as a constant.
1480
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
1481
1482
template <>
1483
458
RegExpLoop const& NodeValue::getConst< RegExpLoop >() const {
1484
458
  AssertArgument(getKind() == ::cvc5::kind::REGEXP_LOOP_OP, *this,
1485
                 "Improper kind for getConst<RegExpLoop>()");
1486
  // To support non-inlined CONSTANT-kinded NodeValues (those that are
1487
  // "constructed" when initially checking them against the NodeManager
1488
  // pool), we must check d_nchildren here.
1489
458
  return d_nchildren == 0
1490
458
    ? *reinterpret_cast< RegExpLoop const* >(d_children)
1491
458
    : *reinterpret_cast< RegExpLoop const* >(d_children[0]);
1492
}
1493
1494
// re-enable the warning
1495
#pragma GCC diagnostic warning "-Wstrict-aliasing"
1496
1497
1498
// clang-format on
1499
1500
}  // namespace expr
1501
1502
namespace kind {
1503
namespace metakind {
1504
1505
258485014
size_t NodeValueCompare::constHash(const ::cvc5::expr::NodeValue* nv)
1506
{
1507
258485014
  Assert(nv->getMetaKind() == kind::metakind::CONSTANT);
1508
1509
258485014
  switch (nv->d_kind)
1510
  {
1511
// clang-format off
1512
1513
25255
  case kind::UNINTERPRETED_CONSTANT:
1514
25255
    return ::cvc5::UninterpretedConstantHashFunction()(nv->getConst< UninterpretedConstant >());
1515
1516
100
  case kind::ABSTRACT_VALUE:
1517
100
    return ::cvc5::AbstractValueHashFunction()(nv->getConst< AbstractValue >());
1518
1519
13857585
  case kind::BUILTIN:
1520
13857585
    return ::cvc5::kind::KindHashFunction()(nv->getConst< Kind >());
1521
1522
31908132
  case kind::TYPE_CONSTANT:
1523
31908132
    return ::cvc5::TypeConstantHashFunction()(nv->getConst< TypeConstant >());
1524
1525
46405609
  case kind::CONST_BOOLEAN:
1526
46405609
    return ::cvc5::BoolHashFunction()(nv->getConst< bool >());
1527
1528
4782
  case kind::CARDINALITY_CONSTRAINT_OP:
1529
4782
    return ::cvc5::CardinalityConstraintHashFunction()(nv->getConst< CardinalityConstraint >());
1530
1531
3370
  case kind::COMBINED_CARDINALITY_CONSTRAINT_OP:
1532
3370
    return ::cvc5::CombinedCardinalityConstraintHashFunction()(nv->getConst< CombinedCardinalityConstraint >());
1533
1534
48
  case kind::DIVISIBLE_OP:
1535
48
    return ::cvc5::DivisibleHashFunction()(nv->getConst< Divisible >());
1536
1537
157900381
  case kind::CONST_RATIONAL:
1538
157900381
    return ::cvc5::RationalHashFunction()(nv->getConst< Rational >());
1539
1540
1313
  case kind::INDEXED_ROOT_PREDICATE_OP:
1541
1313
    return ::cvc5::IndexedRootPredicateHashFunction()(nv->getConst< IndexedRootPredicate >());
1542
1543
406
  case kind::IAND_OP:
1544
406
    return ::cvc5::UnsignedHashFunction< ::cvc5::IntAnd >()(nv->getConst< IntAnd >());
1545
1546
596028
  case kind::BITVECTOR_TYPE:
1547
596028
    return ::cvc5::UnsignedHashFunction< ::cvc5::BitVectorSize >()(nv->getConst< BitVectorSize >());
1548
1549
3618662
  case kind::CONST_BITVECTOR:
1550
3618662
    return ::cvc5::BitVectorHashFunction()(nv->getConst< BitVector >());
1551
1552
380025
  case kind::BITVECTOR_BITOF_OP:
1553
380025
    return ::cvc5::BitVectorBitOfHashFunction()(nv->getConst< BitVectorBitOf >());
1554
1555
341002
  case kind::BITVECTOR_EXTRACT_OP:
1556
341002
    return ::cvc5::BitVectorExtractHashFunction()(nv->getConst< BitVectorExtract >());
1557
1558
3834
  case kind::BITVECTOR_REPEAT_OP:
1559
3834
    return ::cvc5::UnsignedHashFunction< ::cvc5::BitVectorRepeat >()(nv->getConst< BitVectorRepeat >());
1560
1561
2002
  case kind::BITVECTOR_ROTATE_LEFT_OP:
1562
2002
    return ::cvc5::UnsignedHashFunction< ::cvc5::BitVectorRotateLeft >()(nv->getConst< BitVectorRotateLeft >());
1563
1564
2464
  case kind::BITVECTOR_ROTATE_RIGHT_OP:
1565
2464
    return ::cvc5::UnsignedHashFunction< ::cvc5::BitVectorRotateRight >()(nv->getConst< BitVectorRotateRight >());
1566
1567
32174
  case kind::BITVECTOR_SIGN_EXTEND_OP:
1568
32174
    return ::cvc5::UnsignedHashFunction< ::cvc5::BitVectorSignExtend >()(nv->getConst< BitVectorSignExtend >());
1569
1570
56758
  case kind::BITVECTOR_ZERO_EXTEND_OP:
1571
56758
    return ::cvc5::UnsignedHashFunction< ::cvc5::BitVectorZeroExtend >()(nv->getConst< BitVectorZeroExtend >());
1572
1573
1690
  case kind::INT_TO_BITVECTOR_OP:
1574
1690
    return ::cvc5::UnsignedHashFunction< ::cvc5::IntToBitVector >()(nv->getConst< IntToBitVector >());
1575
1576
4138
  case kind::CONST_FLOATINGPOINT:
1577
4138
    return ::cvc5::FloatingPointHashFunction()(nv->getConst< FloatingPoint >());
1578
1579
79319
  case kind::CONST_ROUNDINGMODE:
1580
79319
    return ::cvc5::RoundingModeHashFunction()(nv->getConst< RoundingMode >());
1581
1582
57612
  case kind::FLOATINGPOINT_TYPE:
1583
57612
    return ::cvc5::FloatingPointSizeHashFunction()(nv->getConst< FloatingPointSize >());
1584
1585
4323
  case kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP:
1586
4323
    return ::cvc5::FloatingPointConvertSortHashFunction<0x1>()(nv->getConst< FloatingPointToFPIEEEBitVector >());
1587
1588
62
  case kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP:
1589
62
    return ::cvc5::FloatingPointConvertSortHashFunction<0x2>()(nv->getConst< FloatingPointToFPFloatingPoint >());
1590
1591
144
  case kind::FLOATINGPOINT_TO_FP_REAL_OP:
1592
144
    return ::cvc5::FloatingPointConvertSortHashFunction<0x4>()(nv->getConst< FloatingPointToFPReal >());
1593
1594
70
  case kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP:
1595
70
    return ::cvc5::FloatingPointConvertSortHashFunction<0x8>()(nv->getConst< FloatingPointToFPSignedBitVector >());
1596
1597
98
  case kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP:
1598
98
    return ::cvc5::FloatingPointConvertSortHashFunction<0x10>()(nv->getConst< FloatingPointToFPUnsignedBitVector >());
1599
1600
251
  case kind::FLOATINGPOINT_TO_FP_GENERIC_OP:
1601
251
    return ::cvc5::FloatingPointConvertSortHashFunction<0x11>()(nv->getConst< FloatingPointToFPGeneric >());
1602
1603
26
  case kind::FLOATINGPOINT_TO_UBV_OP:
1604
26
    return ::cvc5::FloatingPointToBVHashFunction<0x1>()(nv->getConst< FloatingPointToUBV >());
1605
1606
  case kind::FLOATINGPOINT_TO_UBV_TOTAL_OP:
1607
    return ::cvc5::FloatingPointToBVHashFunction<0x4>()(nv->getConst< FloatingPointToUBVTotal >());
1608
1609
41
  case kind::FLOATINGPOINT_TO_SBV_OP:
1610
41
    return ::cvc5::FloatingPointToBVHashFunction<0x2>()(nv->getConst< FloatingPointToSBV >());
1611
1612
16
  case kind::FLOATINGPOINT_TO_SBV_TOTAL_OP:
1613
16
    return ::cvc5::FloatingPointToBVHashFunction<0x8>()(nv->getConst< FloatingPointToSBVTotal >());
1614
1615
8416
  case kind::STORE_ALL:
1616
8416
    return ::cvc5::ArrayStoreAllHashFunction()(nv->getConst< ArrayStoreAll >());
1617
1618
39972
  case kind::DATATYPE_TYPE:
1619
39972
    return ::cvc5::DatatypeIndexConstantHashFunction()(nv->getConst< DatatypeIndexConstant >());
1620
1621
2535
  case kind::ASCRIPTION_TYPE:
1622
2535
    return ::cvc5::AscriptionTypeHashFunction()(nv->getConst< AscriptionType >());
1623
1624
110
  case kind::TUPLE_PROJECT_OP:
1625
110
    return ::cvc5::TupleProjectOpHashFunction()(nv->getConst< TupleProjectOp >());
1626
1627
2106
  case kind::CODATATYPE_BOUND_VARIABLE:
1628
2106
    return ::cvc5::CodatatypeBoundVariableHashFunction()(nv->getConst< CodatatypeBoundVariable >());
1629
1630
16041
  case kind::EMPTYSET:
1631
16041
    return ::cvc5::EmptySetHashFunction()(nv->getConst< EmptySet >());
1632
1633
25136
  case kind::SINGLETON_OP:
1634
25136
    return ::cvc5::SingletonOpHashFunction()(nv->getConst< SingletonOp >());
1635
1636
13041
  case kind::EMPTYBAG:
1637
13041
    return ::cvc5::EmptyBagHashFunction()(nv->getConst< EmptyBag >());
1638
1639
664
  case kind::MK_BAG_OP:
1640
664
    return ::cvc5::MakeBagOpHashFunction()(nv->getConst< MakeBagOp >());
1641
1642
3064991
  case kind::CONST_STRING:
1643
3064991
    return ::cvc5::strings::StringHashFunction()(nv->getConst< String >());
1644
1645
24070
  case kind::CONST_SEQUENCE:
1646
24070
    return ::cvc5::SequenceHashFunction()(nv->getConst< Sequence >());
1647
1648
30
  case kind::REGEXP_REPEAT_OP:
1649
30
    return ::cvc5::RegExpRepeatHashFunction()(nv->getConst< RegExpRepeat >());
1650
1651
182
  case kind::REGEXP_LOOP_OP:
1652
182
    return ::cvc5::RegExpLoopHashFunction()(nv->getConst< RegExpLoop >());
1653
1654
// clang-format on
1655
default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv->d_kind);
1656
  }
1657
}
1658
1659
template <bool pool>
1660
776472780
bool NodeValueCompare::compare(const ::cvc5::expr::NodeValue* nv1,
1661
                               const ::cvc5::expr::NodeValue* nv2)
1662
{
1663
776472780
  if(nv1->d_kind != nv2->d_kind) {
1664
215465843
    return false;
1665
  }
1666
1667
561006937
  if (nv1->getMetaKind() == kind::metakind::CONSTANT)
1668
  {
1669
275439885
    switch (nv1->d_kind)
1670
    {
1671
// clang-format off
1672
1673
41564
    case kind::UNINTERPRETED_CONSTANT:
1674
41564
      return NodeValueConstCompare< kind::UNINTERPRETED_CONSTANT, pool >::compare(nv1, nv2);
1675
1676
46
    case kind::ABSTRACT_VALUE:
1677
46
      return NodeValueConstCompare< kind::ABSTRACT_VALUE, pool >::compare(nv1, nv2);
1678
1679
5543034
    case kind::BUILTIN:
1680
5543034
      return NodeValueConstCompare< kind::BUILTIN, pool >::compare(nv1, nv2);
1681
1682
31773441
    case kind::TYPE_CONSTANT:
1683
31773441
      return NodeValueConstCompare< kind::TYPE_CONSTANT, pool >::compare(nv1, nv2);
1684
1685
46353541
    case kind::CONST_BOOLEAN:
1686
46353541
      return NodeValueConstCompare< kind::CONST_BOOLEAN, pool >::compare(nv1, nv2);
1687
1688
2055
    case kind::CARDINALITY_CONSTRAINT_OP:
1689
2055
      return NodeValueConstCompare< kind::CARDINALITY_CONSTRAINT_OP, pool >::compare(nv1, nv2);
1690
1691
1460
    case kind::COMBINED_CARDINALITY_CONSTRAINT_OP:
1692
1460
      return NodeValueConstCompare< kind::COMBINED_CARDINALITY_CONSTRAINT_OP, pool >::compare(nv1, nv2);
1693
1694
21
    case kind::DIVISIBLE_OP:
1695
21
      return NodeValueConstCompare< kind::DIVISIBLE_OP, pool >::compare(nv1, nv2);
1696
1697
166121041
    case kind::CONST_RATIONAL:
1698
166121041
      return NodeValueConstCompare< kind::CONST_RATIONAL, pool >::compare(nv1, nv2);
1699
1700
1271
    case kind::INDEXED_ROOT_PREDICATE_OP:
1701
1271
      return NodeValueConstCompare< kind::INDEXED_ROOT_PREDICATE_OP, pool >::compare(nv1, nv2);
1702
1703
163
    case kind::IAND_OP:
1704
163
      return NodeValueConstCompare< kind::IAND_OP, pool >::compare(nv1, nv2);
1705
1706
570741
    case kind::BITVECTOR_TYPE:
1707
570741
      return NodeValueConstCompare< kind::BITVECTOR_TYPE, pool >::compare(nv1, nv2);
1708
1709
21212662
    case kind::CONST_BITVECTOR:
1710
21212662
      return NodeValueConstCompare< kind::CONST_BITVECTOR, pool >::compare(nv1, nv2);
1711
1712
283377
    case kind::BITVECTOR_BITOF_OP:
1713
283377
      return NodeValueConstCompare< kind::BITVECTOR_BITOF_OP, pool >::compare(nv1, nv2);
1714
1715
319711
    case kind::BITVECTOR_EXTRACT_OP:
1716
319711
      return NodeValueConstCompare< kind::BITVECTOR_EXTRACT_OP, pool >::compare(nv1, nv2);
1717
1718
3243
    case kind::BITVECTOR_REPEAT_OP:
1719
3243
      return NodeValueConstCompare< kind::BITVECTOR_REPEAT_OP, pool >::compare(nv1, nv2);
1720
1721
1543
    case kind::BITVECTOR_ROTATE_LEFT_OP:
1722
1543
      return NodeValueConstCompare< kind::BITVECTOR_ROTATE_LEFT_OP, pool >::compare(nv1, nv2);
1723
1724
1906
    case kind::BITVECTOR_ROTATE_RIGHT_OP:
1725
1906
      return NodeValueConstCompare< kind::BITVECTOR_ROTATE_RIGHT_OP, pool >::compare(nv1, nv2);
1726
1727
28352
    case kind::BITVECTOR_SIGN_EXTEND_OP:
1728
28352
      return NodeValueConstCompare< kind::BITVECTOR_SIGN_EXTEND_OP, pool >::compare(nv1, nv2);
1729
1730
52333
    case kind::BITVECTOR_ZERO_EXTEND_OP:
1731
52333
      return NodeValueConstCompare< kind::BITVECTOR_ZERO_EXTEND_OP, pool >::compare(nv1, nv2);
1732
1733
1024
    case kind::INT_TO_BITVECTOR_OP:
1734
1024
      return NodeValueConstCompare< kind::INT_TO_BITVECTOR_OP, pool >::compare(nv1, nv2);
1735
1736
3003
    case kind::CONST_FLOATINGPOINT:
1737
3003
      return NodeValueConstCompare< kind::CONST_FLOATINGPOINT, pool >::compare(nv1, nv2);
1738
1739
40697
    case kind::CONST_ROUNDINGMODE:
1740
40697
      return NodeValueConstCompare< kind::CONST_ROUNDINGMODE, pool >::compare(nv1, nv2);
1741
1742
26604
    case kind::FLOATINGPOINT_TYPE:
1743
26604
      return NodeValueConstCompare< kind::FLOATINGPOINT_TYPE, pool >::compare(nv1, nv2);
1744
1745
4203
    case kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP:
1746
4203
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP, pool >::compare(nv1, nv2);
1747
1748
26
    case kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP:
1749
26
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP, pool >::compare(nv1, nv2);
1750
1751
87
    case kind::FLOATINGPOINT_TO_FP_REAL_OP:
1752
87
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_FP_REAL_OP, pool >::compare(nv1, nv2);
1753
1754
34
    case kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP:
1755
34
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP, pool >::compare(nv1, nv2);
1756
1757
56
    case kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP:
1758
56
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP, pool >::compare(nv1, nv2);
1759
1760
146
    case kind::FLOATINGPOINT_TO_FP_GENERIC_OP:
1761
146
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_FP_GENERIC_OP, pool >::compare(nv1, nv2);
1762
1763
11
    case kind::FLOATINGPOINT_TO_UBV_OP:
1764
11
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_UBV_OP, pool >::compare(nv1, nv2);
1765
1766
    case kind::FLOATINGPOINT_TO_UBV_TOTAL_OP:
1767
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_UBV_TOTAL_OP, pool >::compare(nv1, nv2);
1768
1769
17
    case kind::FLOATINGPOINT_TO_SBV_OP:
1770
17
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_SBV_OP, pool >::compare(nv1, nv2);
1771
1772
7
    case kind::FLOATINGPOINT_TO_SBV_TOTAL_OP:
1773
7
      return NodeValueConstCompare< kind::FLOATINGPOINT_TO_SBV_TOTAL_OP, pool >::compare(nv1, nv2);
1774
1775
6187
    case kind::STORE_ALL:
1776
6187
      return NodeValueConstCompare< kind::STORE_ALL, pool >::compare(nv1, nv2);
1777
1778
18058
    case kind::DATATYPE_TYPE:
1779
18058
      return NodeValueConstCompare< kind::DATATYPE_TYPE, pool >::compare(nv1, nv2);
1780
1781
2217
    case kind::ASCRIPTION_TYPE:
1782
2217
      return NodeValueConstCompare< kind::ASCRIPTION_TYPE, pool >::compare(nv1, nv2);
1783
1784
60
    case kind::TUPLE_PROJECT_OP:
1785
60
      return NodeValueConstCompare< kind::TUPLE_PROJECT_OP, pool >::compare(nv1, nv2);
1786
1787
1710
    case kind::CODATATYPE_BOUND_VARIABLE:
1788
1710
      return NodeValueConstCompare< kind::CODATATYPE_BOUND_VARIABLE, pool >::compare(nv1, nv2);
1789
1790
7185
    case kind::EMPTYSET:
1791
7185
      return NodeValueConstCompare< kind::EMPTYSET, pool >::compare(nv1, nv2);
1792
1793
23183
    case kind::SINGLETON_OP:
1794
23183
      return NodeValueConstCompare< kind::SINGLETON_OP, pool >::compare(nv1, nv2);
1795
1796
5304
    case kind::EMPTYBAG:
1797
5304
      return NodeValueConstCompare< kind::EMPTYBAG, pool >::compare(nv1, nv2);
1798
1799
460
    case kind::MK_BAG_OP:
1800
460
      return NodeValueConstCompare< kind::MK_BAG_OP, pool >::compare(nv1, nv2);
1801
1802
2969255
    case kind::CONST_STRING:
1803
2969255
      return NodeValueConstCompare< kind::CONST_STRING, pool >::compare(nv1, nv2);
1804
1805
18760
    case kind::CONST_SEQUENCE:
1806
18760
      return NodeValueConstCompare< kind::CONST_SEQUENCE, pool >::compare(nv1, nv2);
1807
1808
12
    case kind::REGEXP_REPEAT_OP:
1809
12
      return NodeValueConstCompare< kind::REGEXP_REPEAT_OP, pool >::compare(nv1, nv2);
1810
1811
74
    case kind::REGEXP_LOOP_OP:
1812
74
      return NodeValueConstCompare< kind::REGEXP_LOOP_OP, pool >::compare(nv1, nv2);
1813
1814
// clang-format on
1815
default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv1->d_kind);
1816
    }
1817
  }
1818
1819
285567052
  if(nv1->d_nchildren != nv2->d_nchildren) {
1820
    return false;
1821
  }
1822
1823
285567052
  ::cvc5::expr::NodeValue::const_nv_iterator i = nv1->nv_begin();
1824
285567052
  ::cvc5::expr::NodeValue::const_nv_iterator j = nv2->nv_begin();
1825
285567052
  ::cvc5::expr::NodeValue::const_nv_iterator i_end = nv1->nv_end();
1826
1827
1518939146
  while(i != i_end) {
1828
619074238
    if((*i) != (*j)) {
1829
2388191
      return false;
1830
    }
1831
616686047
    ++i;
1832
616686047
    ++j;
1833
  }
1834
1835
283178861
  return true;
1836
}
1837
1838
template bool NodeValueCompare::compare<true>(
1839
    const ::cvc5::expr::NodeValue* nv1, const ::cvc5::expr::NodeValue* nv2);
1840
template bool NodeValueCompare::compare<false>(
1841
    const ::cvc5::expr::NodeValue* nv1, const ::cvc5::expr::NodeValue* nv2);
1842
1843
10
void NodeValueConstPrinter::toStream(std::ostream& out,
1844
                                     const ::cvc5::expr::NodeValue* nv)
1845
{
1846
10
  Assert(nv->getMetaKind() == kind::metakind::CONSTANT);
1847
1848
10
  switch (nv->d_kind)
1849
  {
1850
// clang-format off
1851
1852
  case kind::UNINTERPRETED_CONSTANT:
1853
    out << nv->getConst< UninterpretedConstant >();
1854
    break;
1855
1856
8
  case kind::ABSTRACT_VALUE:
1857
8
    out << nv->getConst< AbstractValue >();
1858
8
    break;
1859
1860
  case kind::BUILTIN:
1861
    out << nv->getConst< Kind >();
1862
    break;
1863
1864
  case kind::TYPE_CONSTANT:
1865
    out << nv->getConst< TypeConstant >();
1866
    break;
1867
1868
  case kind::CONST_BOOLEAN:
1869
    out << nv->getConst< bool >();
1870
    break;
1871
1872
  case kind::CARDINALITY_CONSTRAINT_OP:
1873
    out << nv->getConst< CardinalityConstraint >();
1874
    break;
1875
1876
  case kind::COMBINED_CARDINALITY_CONSTRAINT_OP:
1877
    out << nv->getConst< CombinedCardinalityConstraint >();
1878
    break;
1879
1880
  case kind::DIVISIBLE_OP:
1881
    out << nv->getConst< Divisible >();
1882
    break;
1883
1884
2
  case kind::CONST_RATIONAL:
1885
2
    out << nv->getConst< Rational >();
1886
2
    break;
1887
1888
  case kind::INDEXED_ROOT_PREDICATE_OP:
1889
    out << nv->getConst< IndexedRootPredicate >();
1890
    break;
1891
1892
  case kind::IAND_OP:
1893
    out << nv->getConst< IntAnd >();
1894
    break;
1895
1896
  case kind::BITVECTOR_TYPE:
1897
    out << nv->getConst< BitVectorSize >();
1898
    break;
1899
1900
  case kind::CONST_BITVECTOR:
1901
    out << nv->getConst< BitVector >();
1902
    break;
1903
1904
  case kind::BITVECTOR_BITOF_OP:
1905
    out << nv->getConst< BitVectorBitOf >();
1906
    break;
1907
1908
  case kind::BITVECTOR_EXTRACT_OP:
1909
    out << nv->getConst< BitVectorExtract >();
1910
    break;
1911
1912
  case kind::BITVECTOR_REPEAT_OP:
1913
    out << nv->getConst< BitVectorRepeat >();
1914
    break;
1915
1916
  case kind::BITVECTOR_ROTATE_LEFT_OP:
1917
    out << nv->getConst< BitVectorRotateLeft >();
1918
    break;
1919
1920
  case kind::BITVECTOR_ROTATE_RIGHT_OP:
1921
    out << nv->getConst< BitVectorRotateRight >();
1922
    break;
1923
1924
  case kind::BITVECTOR_SIGN_EXTEND_OP:
1925
    out << nv->getConst< BitVectorSignExtend >();
1926
    break;
1927
1928
  case kind::BITVECTOR_ZERO_EXTEND_OP:
1929
    out << nv->getConst< BitVectorZeroExtend >();
1930
    break;
1931
1932
  case kind::INT_TO_BITVECTOR_OP:
1933
    out << nv->getConst< IntToBitVector >();
1934
    break;
1935
1936
  case kind::CONST_FLOATINGPOINT:
1937
    out << nv->getConst< FloatingPoint >();
1938
    break;
1939
1940
  case kind::CONST_ROUNDINGMODE:
1941
    out << nv->getConst< RoundingMode >();
1942
    break;
1943
1944
  case kind::FLOATINGPOINT_TYPE:
1945
    out << nv->getConst< FloatingPointSize >();
1946
    break;
1947
1948
  case kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP:
1949
    out << nv->getConst< FloatingPointToFPIEEEBitVector >();
1950
    break;
1951
1952
  case kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP:
1953
    out << nv->getConst< FloatingPointToFPFloatingPoint >();
1954
    break;
1955
1956
  case kind::FLOATINGPOINT_TO_FP_REAL_OP:
1957
    out << nv->getConst< FloatingPointToFPReal >();
1958
    break;
1959
1960
  case kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP:
1961
    out << nv->getConst< FloatingPointToFPSignedBitVector >();
1962
    break;
1963
1964
  case kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP:
1965
    out << nv->getConst< FloatingPointToFPUnsignedBitVector >();
1966
    break;
1967
1968
  case kind::FLOATINGPOINT_TO_FP_GENERIC_OP:
1969
    out << nv->getConst< FloatingPointToFPGeneric >();
1970
    break;
1971
1972
  case kind::FLOATINGPOINT_TO_UBV_OP:
1973
    out << nv->getConst< FloatingPointToUBV >();
1974
    break;
1975
1976
  case kind::FLOATINGPOINT_TO_UBV_TOTAL_OP:
1977
    out << nv->getConst< FloatingPointToUBVTotal >();
1978
    break;
1979
1980
  case kind::FLOATINGPOINT_TO_SBV_OP:
1981
    out << nv->getConst< FloatingPointToSBV >();
1982
    break;
1983
1984
  case kind::FLOATINGPOINT_TO_SBV_TOTAL_OP:
1985
    out << nv->getConst< FloatingPointToSBVTotal >();
1986
    break;
1987
1988
  case kind::STORE_ALL:
1989
    out << nv->getConst< ArrayStoreAll >();
1990
    break;
1991
1992
  case kind::DATATYPE_TYPE:
1993
    out << nv->getConst< DatatypeIndexConstant >();
1994
    break;
1995
1996
  case kind::ASCRIPTION_TYPE:
1997
    out << nv->getConst< AscriptionType >();
1998
    break;
1999
2000
  case kind::TUPLE_PROJECT_OP:
2001
    out << nv->getConst< TupleProjectOp >();
2002
    break;
2003
2004
  case kind::CODATATYPE_BOUND_VARIABLE:
2005
    out << nv->getConst< CodatatypeBoundVariable >();
2006
    break;
2007
2008
  case kind::EMPTYSET:
2009
    out << nv->getConst< EmptySet >();
2010
    break;
2011
2012
  case kind::SINGLETON_OP:
2013
    out << nv->getConst< SingletonOp >();
2014
    break;
2015
2016
  case kind::EMPTYBAG:
2017
    out << nv->getConst< EmptyBag >();
2018
    break;
2019
2020
  case kind::MK_BAG_OP:
2021
    out << nv->getConst< MakeBagOp >();
2022
    break;
2023
2024
  case kind::CONST_STRING:
2025
    out << nv->getConst< String >();
2026
    break;
2027
2028
  case kind::CONST_SEQUENCE:
2029
    out << nv->getConst< Sequence >();
2030
    break;
2031
2032
  case kind::REGEXP_REPEAT_OP:
2033
    out << nv->getConst< RegExpRepeat >();
2034
    break;
2035
2036
  case kind::REGEXP_LOOP_OP:
2037
    out << nv->getConst< RegExpLoop >();
2038
    break;
2039
2040
// clang-format on
2041
default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv->d_kind);
2042
  }
2043
10
}
2044
2045
10
void NodeValueConstPrinter::toStream(std::ostream& out, TNode n) {
2046
10
  toStream(out, n.d_nv);
2047
10
}
2048
2049
// The reinterpret_cast of d_children to various constant payload types
2050
// in deleteNodeValueConstant(), below, can flag a "strict aliasing"
2051
// warning; it should actually be okay, because we never access the
2052
// embedded constant as a NodeValue* child, and never access an embedded
2053
// NodeValue* child as a constant.
2054
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
2055
2056
/**
2057
 * Cleanup to be performed when a NodeValue zombie is collected, and
2058
 * it has CONSTANT metakind.  This calls the destructor for the underlying
2059
 * C++ type representing the constant value.  See
2060
 * NodeManager::reclaimZombies() for more information.
2061
 *
2062
 * This doesn't support "non-inlined" NodeValues, which shouldn't need this
2063
 * kind of cleanup.
2064
 */
2065
3376982
void deleteNodeValueConstant(::cvc5::expr::NodeValue* nv)
2066
{
2067
3376982
  Assert(nv->getMetaKind() == kind::metakind::CONSTANT);
2068
2069
3376982
  switch (nv->d_kind)
2070
  {
2071
// clang-format off
2072
2073
1934
  case kind::UNINTERPRETED_CONSTANT:
2074
1934
    std::destroy_at(reinterpret_cast< UninterpretedConstant* >(nv->d_children));
2075
1934
    break;
2076
2077
18
  case kind::ABSTRACT_VALUE:
2078
18
    std::destroy_at(reinterpret_cast< AbstractValue* >(nv->d_children));
2079
18
    break;
2080
2081
2771517
  case kind::BUILTIN:
2082
2771517
    std::destroy_at(reinterpret_cast< Kind* >(nv->d_children));
2083
2771517
    break;
2084
2085
44892
  case kind::TYPE_CONSTANT:
2086
44892
    std::destroy_at(reinterpret_cast< TypeConstant* >(nv->d_children));
2087
44892
    break;
2088
2089
14604
  case kind::CONST_BOOLEAN:
2090
14604
    std::destroy_at(reinterpret_cast< bool* >(nv->d_children));
2091
14604
    break;
2092
2093
909
  case kind::CARDINALITY_CONSTRAINT_OP:
2094
909
    std::destroy_at(reinterpret_cast< CardinalityConstraint* >(nv->d_children));
2095
909
    break;
2096
2097
641
  case kind::COMBINED_CARDINALITY_CONSTRAINT_OP:
2098
641
    std::destroy_at(reinterpret_cast< CombinedCardinalityConstraint* >(nv->d_children));
2099
641
    break;
2100
2101
9
  case kind::DIVISIBLE_OP:
2102
9
    std::destroy_at(reinterpret_cast< Divisible* >(nv->d_children));
2103
9
    break;
2104
2105
341410
  case kind::CONST_RATIONAL:
2106
341410
    std::destroy_at(reinterpret_cast< Rational* >(nv->d_children));
2107
341410
    break;
2108
2109
14
  case kind::INDEXED_ROOT_PREDICATE_OP:
2110
14
    std::destroy_at(reinterpret_cast< IndexedRootPredicate* >(nv->d_children));
2111
14
    break;
2112
2113
81
  case kind::IAND_OP:
2114
81
    std::destroy_at(reinterpret_cast< IntAnd* >(nv->d_children));
2115
81
    break;
2116
2117
8429
  case kind::BITVECTOR_TYPE:
2118
8429
    std::destroy_at(reinterpret_cast< BitVectorSize* >(nv->d_children));
2119
8429
    break;
2120
2121
75683
  case kind::CONST_BITVECTOR:
2122
75683
    std::destroy_at(reinterpret_cast< BitVector* >(nv->d_children));
2123
75683
    break;
2124
2125
32216
  case kind::BITVECTOR_BITOF_OP:
2126
32216
    std::destroy_at(reinterpret_cast< BitVectorBitOf* >(nv->d_children));
2127
32216
    break;
2128
2129
7119
  case kind::BITVECTOR_EXTRACT_OP:
2130
7119
    std::destroy_at(reinterpret_cast< BitVectorExtract* >(nv->d_children));
2131
7119
    break;
2132
2133
197
  case kind::BITVECTOR_REPEAT_OP:
2134
197
    std::destroy_at(reinterpret_cast< BitVectorRepeat* >(nv->d_children));
2135
197
    break;
2136
2137
153
  case kind::BITVECTOR_ROTATE_LEFT_OP:
2138
153
    std::destroy_at(reinterpret_cast< BitVectorRotateLeft* >(nv->d_children));
2139
153
    break;
2140
2141
186
  case kind::BITVECTOR_ROTATE_RIGHT_OP:
2142
186
    std::destroy_at(reinterpret_cast< BitVectorRotateRight* >(nv->d_children));
2143
186
    break;
2144
2145
1274
  case kind::BITVECTOR_SIGN_EXTEND_OP:
2146
1274
    std::destroy_at(reinterpret_cast< BitVectorSignExtend* >(nv->d_children));
2147
1274
    break;
2148
2149
1475
  case kind::BITVECTOR_ZERO_EXTEND_OP:
2150
1475
    std::destroy_at(reinterpret_cast< BitVectorZeroExtend* >(nv->d_children));
2151
1475
    break;
2152
2153
222
  case kind::INT_TO_BITVECTOR_OP:
2154
222
    std::destroy_at(reinterpret_cast< IntToBitVector* >(nv->d_children));
2155
222
    break;
2156
2157
431
  case kind::CONST_FLOATINGPOINT:
2158
431
    std::destroy_at(reinterpret_cast< FloatingPoint* >(nv->d_children));
2159
431
    break;
2160
2161
12874
  case kind::CONST_ROUNDINGMODE:
2162
12874
    std::destroy_at(reinterpret_cast< RoundingMode* >(nv->d_children));
2163
12874
    break;
2164
2165
10336
  case kind::FLOATINGPOINT_TYPE:
2166
10336
    std::destroy_at(reinterpret_cast< FloatingPointSize* >(nv->d_children));
2167
10336
    break;
2168
2169
40
  case kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP:
2170
40
    std::destroy_at(reinterpret_cast< FloatingPointToFPIEEEBitVector* >(nv->d_children));
2171
40
    break;
2172
2173
12
  case kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP:
2174
12
    std::destroy_at(reinterpret_cast< FloatingPointToFPFloatingPoint* >(nv->d_children));
2175
12
    break;
2176
2177
19
  case kind::FLOATINGPOINT_TO_FP_REAL_OP:
2178
19
    std::destroy_at(reinterpret_cast< FloatingPointToFPReal* >(nv->d_children));
2179
19
    break;
2180
2181
12
  case kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP:
2182
12
    std::destroy_at(reinterpret_cast< FloatingPointToFPSignedBitVector* >(nv->d_children));
2183
12
    break;
2184
2185
14
  case kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP:
2186
14
    std::destroy_at(reinterpret_cast< FloatingPointToFPUnsignedBitVector* >(nv->d_children));
2187
14
    break;
2188
2189
35
  case kind::FLOATINGPOINT_TO_FP_GENERIC_OP:
2190
35
    std::destroy_at(reinterpret_cast< FloatingPointToFPGeneric* >(nv->d_children));
2191
35
    break;
2192
2193
5
  case kind::FLOATINGPOINT_TO_UBV_OP:
2194
5
    std::destroy_at(reinterpret_cast< FloatingPointToUBV* >(nv->d_children));
2195
5
    break;
2196
2197
  case kind::FLOATINGPOINT_TO_UBV_TOTAL_OP:
2198
    std::destroy_at(reinterpret_cast< FloatingPointToUBVTotal* >(nv->d_children));
2199
    break;
2200
2201
8
  case kind::FLOATINGPOINT_TO_SBV_OP:
2202
8
    std::destroy_at(reinterpret_cast< FloatingPointToSBV* >(nv->d_children));
2203
8
    break;
2204
2205
3
  case kind::FLOATINGPOINT_TO_SBV_TOTAL_OP:
2206
3
    std::destroy_at(reinterpret_cast< FloatingPointToSBVTotal* >(nv->d_children));
2207
3
    break;
2208
2209
743
  case kind::STORE_ALL:
2210
743
    std::destroy_at(reinterpret_cast< ArrayStoreAll* >(nv->d_children));
2211
743
    break;
2212
2213
7690
  case kind::DATATYPE_TYPE:
2214
7690
    std::destroy_at(reinterpret_cast< DatatypeIndexConstant* >(nv->d_children));
2215
7690
    break;
2216
2217
106
  case kind::ASCRIPTION_TYPE:
2218
106
    std::destroy_at(reinterpret_cast< AscriptionType* >(nv->d_children));
2219
106
    break;
2220
2221
22
  case kind::TUPLE_PROJECT_OP:
2222
22
    std::destroy_at(reinterpret_cast< TupleProjectOp* >(nv->d_children));
2223
22
    break;
2224
2225
132
  case kind::CODATATYPE_BOUND_VARIABLE:
2226
132
    std::destroy_at(reinterpret_cast< CodatatypeBoundVariable* >(nv->d_children));
2227
132
    break;
2228
2229
2952
  case kind::EMPTYSET:
2230
2952
    std::destroy_at(reinterpret_cast< EmptySet* >(nv->d_children));
2231
2952
    break;
2232
2233
651
  case kind::SINGLETON_OP:
2234
651
    std::destroy_at(reinterpret_cast< SingletonOp* >(nv->d_children));
2235
651
    break;
2236
2237
2579
  case kind::EMPTYBAG:
2238
2579
    std::destroy_at(reinterpret_cast< EmptyBag* >(nv->d_children));
2239
2579
    break;
2240
2241
68
  case kind::MK_BAG_OP:
2242
68
    std::destroy_at(reinterpret_cast< MakeBagOp* >(nv->d_children));
2243
68
    break;
2244
2245
31907
  case kind::CONST_STRING:
2246
31907
    std::destroy_at(reinterpret_cast< String* >(nv->d_children));
2247
31907
    break;
2248
2249
3318
  case kind::CONST_SEQUENCE:
2250
3318
    std::destroy_at(reinterpret_cast< Sequence* >(nv->d_children));
2251
3318
    break;
2252
2253
6
  case kind::REGEXP_REPEAT_OP:
2254
6
    std::destroy_at(reinterpret_cast< RegExpRepeat* >(nv->d_children));
2255
6
    break;
2256
2257
36
  case kind::REGEXP_LOOP_OP:
2258
36
    std::destroy_at(reinterpret_cast< RegExpLoop* >(nv->d_children));
2259
36
    break;
2260
2261
// clang-format on
2262
default: Unhandled() << ::cvc5::expr::NodeValue::dKindToKind(nv->d_kind);
2263
  }
2264
3376982
}
2265
2266
// re-enable the strict-aliasing warning
2267
# pragma GCC diagnostic warning "-Wstrict-aliasing"
2268
2269
256578836
uint32_t getMinArityForKind(::cvc5::Kind k)
2270
{
2271
  static const unsigned lbs[] = {
2272
    0, /* NULL_EXPR */
2273
// clang-format off
2274
2275
    0, /* SORT_TAG */
2276
    0, /* SORT_TYPE */
2277
    0, /* UNINTERPRETED_CONSTANT */
2278
    0, /* ABSTRACT_VALUE */
2279
    0, /* BUILTIN */
2280
    2, /* EQUAL */
2281
    2, /* DISTINCT */
2282
    0, /* VARIABLE */
2283
    0, /* BOUND_VARIABLE */
2284
    0, /* SKOLEM */
2285
    0, /* SEXPR */
2286
    2, /* LAMBDA */
2287
    2, /* WITNESS */
2288
    0, /* TYPE_CONSTANT */
2289
    2, /* FUNCTION_TYPE */
2290
    0, /* CONST_BOOLEAN */
2291
    1, /* NOT */
2292
    2, /* AND */
2293
    2, /* IMPLIES */
2294
    2, /* OR */
2295
    2, /* XOR */
2296
    3, /* ITE */
2297
    1, /* APPLY_UF */
2298
    0, /* BOOLEAN_TERM_VARIABLE */
2299
    1, /* PARTIAL_APPLY_UF */
2300
    2, /* HO_APPLY */
2301
    0, /* CARDINALITY_CONSTRAINT_OP */
2302
    0, /* CARDINALITY_CONSTRAINT */
2303
    0, /* COMBINED_CARDINALITY_CONSTRAINT_OP */
2304
    0, /* COMBINED_CARDINALITY_CONSTRAINT */
2305
    2, /* PLUS */
2306
    2, /* MULT */
2307
    2, /* NONLINEAR_MULT */
2308
    2, /* MINUS */
2309
    1, /* UMINUS */
2310
    2, /* DIVISION */
2311
    2, /* DIVISION_TOTAL */
2312
    2, /* INTS_DIVISION */
2313
    2, /* INTS_DIVISION_TOTAL */
2314
    2, /* INTS_MODULUS */
2315
    2, /* INTS_MODULUS_TOTAL */
2316
    1, /* ABS */
2317
    1, /* DIVISIBLE */
2318
    2, /* POW */
2319
    1, /* POW2 */
2320
    1, /* EXPONENTIAL */
2321
    1, /* SINE */
2322
    1, /* COSINE */
2323
    1, /* TANGENT */
2324
    1, /* COSECANT */
2325
    1, /* SECANT */
2326
    1, /* COTANGENT */
2327
    1, /* ARCSINE */
2328
    1, /* ARCCOSINE */
2329
    1, /* ARCTANGENT */
2330
    1, /* ARCCOSECANT */
2331
    1, /* ARCSECANT */
2332
    1, /* ARCCOTANGENT */
2333
    1, /* SQRT */
2334
    0, /* DIVISIBLE_OP */
2335
    0, /* CONST_RATIONAL */
2336
    2, /* LT */
2337
    2, /* LEQ */
2338
    2, /* GT */
2339
    2, /* GEQ */
2340
    0, /* INDEXED_ROOT_PREDICATE_OP */
2341
    2, /* INDEXED_ROOT_PREDICATE */
2342
    1, /* IS_INTEGER */
2343
    1, /* TO_INTEGER */
2344
    1, /* TO_REAL */
2345
    1, /* CAST_TO_REAL */
2346
    0, /* PI */
2347
    0, /* IAND_OP */
2348
    2, /* IAND */
2349
    0, /* BITVECTOR_TYPE */
2350
    0, /* CONST_BITVECTOR */
2351
    1, /* BITVECTOR_BB_TERM */
2352
    2, /* BITVECTOR_CONCAT */
2353
    2, /* BITVECTOR_AND */
2354
    2, /* BITVECTOR_COMP */
2355
    2, /* BITVECTOR_OR */
2356
    2, /* BITVECTOR_XOR */
2357
    1, /* BITVECTOR_NOT */
2358
    2, /* BITVECTOR_NAND */
2359
    2, /* BITVECTOR_NOR */
2360
    2, /* BITVECTOR_XNOR */
2361
    2, /* BITVECTOR_MULT */
2362
    1, /* BITVECTOR_NEG */
2363
    2, /* BITVECTOR_ADD */
2364
    2, /* BITVECTOR_SUB */
2365
    2, /* BITVECTOR_UDIV */
2366
    2, /* BITVECTOR_UREM */
2367
    2, /* BITVECTOR_SDIV */
2368
    2, /* BITVECTOR_SMOD */
2369
    2, /* BITVECTOR_SREM */
2370
    2, /* BITVECTOR_ASHR */
2371
    2, /* BITVECTOR_LSHR */
2372
    2, /* BITVECTOR_SHL */
2373
    2, /* BITVECTOR_ULE */
2374
    2, /* BITVECTOR_ULT */
2375
    2, /* BITVECTOR_UGE */
2376
    2, /* BITVECTOR_UGT */
2377
    2, /* BITVECTOR_SLE */
2378
    2, /* BITVECTOR_SLT */
2379
    2, /* BITVECTOR_SGE */
2380
    2, /* BITVECTOR_SGT */
2381
    2, /* BITVECTOR_ULTBV */
2382
    2, /* BITVECTOR_SLTBV */
2383
    1, /* BITVECTOR_REDAND */
2384
    1, /* BITVECTOR_REDOR */
2385
    3, /* BITVECTOR_ITE */
2386
    1, /* BITVECTOR_TO_NAT */
2387
    1, /* BITVECTOR_ACKERMANNIZE_UDIV */
2388
    1, /* BITVECTOR_ACKERMANNIZE_UREM */
2389
    1, /* BITVECTOR_EAGER_ATOM */
2390
    0, /* BITVECTOR_BITOF_OP */
2391
    1, /* BITVECTOR_BITOF */
2392
    0, /* BITVECTOR_EXTRACT_OP */
2393
    1, /* BITVECTOR_EXTRACT */
2394
    0, /* BITVECTOR_REPEAT_OP */
2395
    1, /* BITVECTOR_REPEAT */
2396
    0, /* BITVECTOR_ROTATE_LEFT_OP */
2397
    1, /* BITVECTOR_ROTATE_LEFT */
2398
    0, /* BITVECTOR_ROTATE_RIGHT_OP */
2399
    1, /* BITVECTOR_ROTATE_RIGHT */
2400
    0, /* BITVECTOR_SIGN_EXTEND_OP */
2401
    1, /* BITVECTOR_SIGN_EXTEND */
2402
    0, /* BITVECTOR_ZERO_EXTEND_OP */
2403
    1, /* BITVECTOR_ZERO_EXTEND */
2404
    0, /* INT_TO_BITVECTOR_OP */
2405
    1, /* INT_TO_BITVECTOR */
2406
    0, /* CONST_FLOATINGPOINT */
2407
    0, /* CONST_ROUNDINGMODE */
2408
    0, /* FLOATINGPOINT_TYPE */
2409
    3, /* FLOATINGPOINT_FP */
2410
    2, /* FLOATINGPOINT_EQ */
2411
    1, /* FLOATINGPOINT_ABS */
2412
    1, /* FLOATINGPOINT_NEG */
2413
    3, /* FLOATINGPOINT_ADD */
2414
    3, /* FLOATINGPOINT_SUB */
2415
    3, /* FLOATINGPOINT_MULT */
2416
    3, /* FLOATINGPOINT_DIV */
2417
    4, /* FLOATINGPOINT_FMA */
2418
    2, /* FLOATINGPOINT_SQRT */
2419
    2, /* FLOATINGPOINT_REM */
2420
    2, /* FLOATINGPOINT_RTI */
2421
    2, /* FLOATINGPOINT_MIN */
2422
    2, /* FLOATINGPOINT_MAX */
2423
    3, /* FLOATINGPOINT_MIN_TOTAL */
2424
    3, /* FLOATINGPOINT_MAX_TOTAL */
2425
    2, /* FLOATINGPOINT_LEQ */
2426
    2, /* FLOATINGPOINT_LT */
2427
    2, /* FLOATINGPOINT_GEQ */
2428
    2, /* FLOATINGPOINT_GT */
2429
    1, /* FLOATINGPOINT_ISN */
2430
    1, /* FLOATINGPOINT_ISSN */
2431
    1, /* FLOATINGPOINT_ISZ */
2432
    1, /* FLOATINGPOINT_ISINF */
2433
    1, /* FLOATINGPOINT_ISNAN */
2434
    1, /* FLOATINGPOINT_ISNEG */
2435
    1, /* FLOATINGPOINT_ISPOS */
2436
    0, /* FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP */
2437
    1, /* FLOATINGPOINT_TO_FP_IEEE_BITVECTOR */
2438
    0, /* FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP */
2439
    2, /* FLOATINGPOINT_TO_FP_FLOATINGPOINT */
2440
    0, /* FLOATINGPOINT_TO_FP_REAL_OP */
2441
    2, /* FLOATINGPOINT_TO_FP_REAL */
2442
    0, /* FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP */
2443
    2, /* FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR */
2444
    0, /* FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP */
2445
    2, /* FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR */
2446
    0, /* FLOATINGPOINT_TO_FP_GENERIC_OP */
2447
    1, /* FLOATINGPOINT_TO_FP_GENERIC */
2448
    0, /* FLOATINGPOINT_TO_UBV_OP */
2449
    2, /* FLOATINGPOINT_TO_UBV */
2450
    0, /* FLOATINGPOINT_TO_UBV_TOTAL_OP */
2451
    3, /* FLOATINGPOINT_TO_UBV_TOTAL */
2452
    0, /* FLOATINGPOINT_TO_SBV_OP */
2453
    2, /* FLOATINGPOINT_TO_SBV */
2454
    0, /* FLOATINGPOINT_TO_SBV_TOTAL_OP */
2455
    3, /* FLOATINGPOINT_TO_SBV_TOTAL */
2456
    1, /* FLOATINGPOINT_TO_REAL */
2457
    2, /* FLOATINGPOINT_TO_REAL_TOTAL */
2458
    1, /* FLOATINGPOINT_COMPONENT_NAN */
2459
    1, /* FLOATINGPOINT_COMPONENT_INF */
2460
    1, /* FLOATINGPOINT_COMPONENT_ZERO */
2461
    1, /* FLOATINGPOINT_COMPONENT_SIGN */
2462
    1, /* FLOATINGPOINT_COMPONENT_EXPONENT */
2463
    1, /* FLOATINGPOINT_COMPONENT_SIGNIFICAND */
2464
    1, /* ROUNDINGMODE_BITBLAST */
2465
    2, /* ARRAY_TYPE */
2466
    2, /* SELECT */
2467
    3, /* STORE */
2468
    4, /* EQ_RANGE */
2469
    0, /* STORE_ALL */
2470
    4, /* ARR_TABLE_FUN */
2471
    1, /* ARRAY_LAMBDA */
2472
    0, /* PARTIAL_SELECT_0 */
2473
    0, /* PARTIAL_SELECT_1 */
2474
    1, /* CONSTRUCTOR_TYPE */
2475
    2, /* SELECTOR_TYPE */
2476
    1, /* TESTER_TYPE */
2477
    2, /* UPDATER_TYPE */
2478
    0, /* APPLY_CONSTRUCTOR */
2479
    1, /* APPLY_SELECTOR */
2480
    1, /* APPLY_SELECTOR_TOTAL */
2481
    1, /* APPLY_TESTER */
2482
    2, /* APPLY_UPDATER */
2483
    0, /* DATATYPE_TYPE */
2484
    1, /* PARAMETRIC_DATATYPE */
2485
    1, /* APPLY_TYPE_ASCRIPTION */
2486
    0, /* ASCRIPTION_TYPE */
2487
    1, /* DT_SIZE */
2488
    2, /* DT_HEIGHT_BOUND */
2489
    2, /* DT_SIZE_BOUND */
2490
    2, /* DT_SYGUS_BOUND */
2491
    1, /* DT_SYGUS_EVAL */
2492
    2, /* MATCH */
2493
    2, /* MATCH_CASE */
2494
    3, /* MATCH_BIND_CASE */
2495
    0, /* TUPLE_PROJECT_OP */
2496
    1, /* TUPLE_PROJECT */
2497
    0, /* CODATATYPE_BOUND_VARIABLE */
2498
    0, /* SEP_NIL */
2499
    0, /* SEP_EMP */
2500
    2, /* SEP_PTO */
2501
    2, /* SEP_STAR */
2502
    2, /* SEP_WAND */
2503
    2, /* SEP_LABEL */
2504
    0, /* EMPTYSET */
2505
    1, /* SET_TYPE */
2506
    2, /* UNION */
2507
    2, /* INTERSECTION */
2508
    2, /* SETMINUS */
2509
    2, /* SUBSET */
2510
    2, /* MEMBER */
2511
    0, /* SINGLETON_OP */
2512
    1, /* SINGLETON */
2513
    2, /* INSERT */
2514
    1, /* CARD */
2515
    1, /* COMPLEMENT */
2516
    0, /* UNIVERSE_SET */
2517
    3, /* COMPREHENSION */
2518
    1, /* CHOOSE */
2519
    1, /* IS_SINGLETON */
2520
    2, /* JOIN */
2521
    2, /* PRODUCT */
2522
    1, /* TRANSPOSE */
2523
    1, /* TCLOSURE */
2524
    2, /* JOIN_IMAGE */
2525
    1, /* IDEN */
2526
    0, /* EMPTYBAG */
2527
    1, /* BAG_TYPE */
2528
    2, /* UNION_MAX */
2529
    2, /* UNION_DISJOINT */
2530
    2, /* INTERSECTION_MIN */
2531
    2, /* DIFFERENCE_SUBTRACT */
2532
    2, /* DIFFERENCE_REMOVE */
2533
    2, /* SUBBAG */
2534
    2, /* BAG_COUNT */
2535
    1, /* DUPLICATE_REMOVAL */
2536
    0, /* MK_BAG_OP */
2537
    2, /* MK_BAG */
2538
    1, /* BAG_IS_SINGLETON */
2539
    1, /* BAG_CARD */
2540
    1, /* BAG_FROM_SET */
2541
    1, /* BAG_TO_SET */
2542
    1, /* BAG_CHOOSE */
2543
    2, /* BAG_MAP */
2544
    2, /* STRING_CONCAT */
2545
    2, /* STRING_IN_REGEXP */
2546
    1, /* STRING_LENGTH */
2547
    3, /* STRING_SUBSTR */
2548
    3, /* STRING_UPDATE */
2549
    2, /* STRING_CHARAT */
2550
    2, /* STRING_CONTAINS */
2551
    2, /* STRING_LT */
2552
    2, /* STRING_LEQ */
2553
    3, /* STRING_INDEXOF */
2554
    3, /* STRING_INDEXOF_RE */
2555
    3, /* STRING_REPLACE */
2556
    3, /* STRING_REPLACE_ALL */
2557
    3, /* STRING_REPLACE_RE */
2558
    3, /* STRING_REPLACE_RE_ALL */
2559
    2, /* STRING_PREFIX */
2560
    2, /* STRING_SUFFIX */
2561
    1, /* STRING_IS_DIGIT */
2562
    1, /* STRING_ITOS */
2563
    1, /* STRING_STOI */
2564
    1, /* STRING_TO_CODE */
2565
    1, /* STRING_FROM_CODE */
2566
    1, /* STRING_TOLOWER */
2567
    1, /* STRING_TOUPPER */
2568
    1, /* STRING_REV */
2569
    0, /* CONST_STRING */
2570
    1, /* SEQUENCE_TYPE */
2571
    0, /* CONST_SEQUENCE */
2572
    1, /* SEQ_UNIT */
2573
    2, /* SEQ_NTH */
2574
    2, /* SEQ_NTH_TOTAL */
2575
    1, /* STRING_TO_REGEXP */
2576
    2, /* REGEXP_CONCAT */
2577
    2, /* REGEXP_UNION */
2578
    2, /* REGEXP_INTER */
2579
    2, /* REGEXP_DIFF */
2580
    1, /* REGEXP_STAR */
2581
    1, /* REGEXP_PLUS */
2582
    1, /* REGEXP_OPT */
2583
    2, /* REGEXP_RANGE */
2584
    1, /* REGEXP_COMPLEMENT */
2585
    0, /* REGEXP_EMPTY */
2586
    0, /* REGEXP_SIGMA */
2587
    0, /* REGEXP_REPEAT_OP */
2588
    1, /* REGEXP_REPEAT */
2589
    0, /* REGEXP_LOOP_OP */
2590
    1, /* REGEXP_LOOP */
2591
    1, /* REGEXP_RV */
2592
    2, /* FORALL */
2593
    2, /* EXISTS */
2594
    0, /* INST_CONSTANT */
2595
    1, /* BOUND_VAR_LIST */
2596
    1, /* INST_PATTERN */
2597
    1, /* INST_NO_PATTERN */
2598
    1, /* INST_ATTRIBUTE */
2599
    1, /* INST_POOL */
2600
    2, /* INST_ADD_TO_POOL */
2601
    2, /* SKOLEM_ADD_TO_POOL */
2602
    1, /* INST_PATTERN_LIST */
2603
// clang-format on
2604
2605
    0 /* LAST_KIND */
2606
  };
2607
2608
256578836
  return lbs[k];
2609
}
2610
2611
257568744
uint32_t getMaxArityForKind(::cvc5::Kind k)
2612
{
2613
  static const unsigned ubs[] = {
2614
    0, /* NULL_EXPR */
2615
// clang-format off
2616
2617
    0, /* SORT_TAG */
2618
    expr::NodeValue::MAX_CHILDREN, /* SORT_TYPE */
2619
    0, /* UNINTERPRETED_CONSTANT */
2620
    0, /* ABSTRACT_VALUE */
2621
    0, /* BUILTIN */
2622
    2, /* EQUAL */
2623
    expr::NodeValue::MAX_CHILDREN, /* DISTINCT */
2624
    0, /* VARIABLE */
2625
    0, /* BOUND_VARIABLE */
2626
    0, /* SKOLEM */
2627
    expr::NodeValue::MAX_CHILDREN, /* SEXPR */
2628
    2, /* LAMBDA */
2629
    2, /* WITNESS */
2630
    0, /* TYPE_CONSTANT */
2631
    expr::NodeValue::MAX_CHILDREN, /* FUNCTION_TYPE */
2632
    0, /* CONST_BOOLEAN */
2633
    1, /* NOT */
2634
    expr::NodeValue::MAX_CHILDREN, /* AND */
2635
    2, /* IMPLIES */
2636
    expr::NodeValue::MAX_CHILDREN, /* OR */
2637
    2, /* XOR */
2638
    3, /* ITE */
2639
    expr::NodeValue::MAX_CHILDREN, /* APPLY_UF */
2640
    0, /* BOOLEAN_TERM_VARIABLE */
2641
    expr::NodeValue::MAX_CHILDREN, /* PARTIAL_APPLY_UF */
2642
    2, /* HO_APPLY */
2643
    0, /* CARDINALITY_CONSTRAINT_OP */
2644
    0, /* CARDINALITY_CONSTRAINT */
2645
    0, /* COMBINED_CARDINALITY_CONSTRAINT_OP */
2646
    0, /* COMBINED_CARDINALITY_CONSTRAINT */
2647
    expr::NodeValue::MAX_CHILDREN, /* PLUS */
2648
    expr::NodeValue::MAX_CHILDREN, /* MULT */
2649
    expr::NodeValue::MAX_CHILDREN, /* NONLINEAR_MULT */
2650
    2, /* MINUS */
2651
    1, /* UMINUS */
2652
    2, /* DIVISION */
2653
    2, /* DIVISION_TOTAL */
2654
    2, /* INTS_DIVISION */
2655
    2, /* INTS_DIVISION_TOTAL */
2656
    2, /* INTS_MODULUS */
2657
    2, /* INTS_MODULUS_TOTAL */
2658
    1, /* ABS */
2659
    1, /* DIVISIBLE */
2660
    2, /* POW */
2661
    1, /* POW2 */
2662
    1, /* EXPONENTIAL */
2663
    1, /* SINE */
2664
    1, /* COSINE */
2665
    1, /* TANGENT */
2666
    1, /* COSECANT */
2667
    1, /* SECANT */
2668
    1, /* COTANGENT */
2669
    1, /* ARCSINE */
2670
    1, /* ARCCOSINE */
2671
    1, /* ARCTANGENT */
2672
    1, /* ARCCOSECANT */
2673
    1, /* ARCSECANT */
2674
    1, /* ARCCOTANGENT */
2675
    1, /* SQRT */
2676
    0, /* DIVISIBLE_OP */
2677
    0, /* CONST_RATIONAL */
2678
    2, /* LT */
2679
    2, /* LEQ */
2680
    2, /* GT */
2681
    2, /* GEQ */
2682
    0, /* INDEXED_ROOT_PREDICATE_OP */
2683
    2, /* INDEXED_ROOT_PREDICATE */
2684
    1, /* IS_INTEGER */
2685
    1, /* TO_INTEGER */
2686
    1, /* TO_REAL */
2687
    1, /* CAST_TO_REAL */
2688
    0, /* PI */
2689
    0, /* IAND_OP */
2690
    2, /* IAND */
2691
    0, /* BITVECTOR_TYPE */
2692
    0, /* CONST_BITVECTOR */
2693
    expr::NodeValue::MAX_CHILDREN, /* BITVECTOR_BB_TERM */
2694
    expr::NodeValue::MAX_CHILDREN, /* BITVECTOR_CONCAT */
2695
    expr::NodeValue::MAX_CHILDREN, /* BITVECTOR_AND */
2696
    2, /* BITVECTOR_COMP */
2697
    expr::NodeValue::MAX_CHILDREN, /* BITVECTOR_OR */
2698
    expr::NodeValue::MAX_CHILDREN, /* BITVECTOR_XOR */
2699
    1, /* BITVECTOR_NOT */
2700
    2, /* BITVECTOR_NAND */
2701
    2, /* BITVECTOR_NOR */
2702
    2, /* BITVECTOR_XNOR */
2703
    expr::NodeValue::MAX_CHILDREN, /* BITVECTOR_MULT */
2704
    1, /* BITVECTOR_NEG */
2705
    expr::NodeValue::MAX_CHILDREN, /* BITVECTOR_ADD */
2706
    2, /* BITVECTOR_SUB */
2707
    2, /* BITVECTOR_UDIV */
2708
    2, /* BITVECTOR_UREM */
2709
    2, /* BITVECTOR_SDIV */
2710
    2, /* BITVECTOR_SMOD */
2711
    2, /* BITVECTOR_SREM */
2712
    2, /* BITVECTOR_ASHR */
2713
    2, /* BITVECTOR_LSHR */
2714
    2, /* BITVECTOR_SHL */
2715
    2, /* BITVECTOR_ULE */
2716
    2, /* BITVECTOR_ULT */
2717
    2, /* BITVECTOR_UGE */
2718
    2, /* BITVECTOR_UGT */
2719
    2, /* BITVECTOR_SLE */
2720
    2, /* BITVECTOR_SLT */
2721
    2, /* BITVECTOR_SGE */
2722
    2, /* BITVECTOR_SGT */
2723
    2, /* BITVECTOR_ULTBV */
2724
    2, /* BITVECTOR_SLTBV */
2725
    1, /* BITVECTOR_REDAND */
2726
    1, /* BITVECTOR_REDOR */
2727
    3, /* BITVECTOR_ITE */
2728
    1, /* BITVECTOR_TO_NAT */
2729
    1, /* BITVECTOR_ACKERMANNIZE_UDIV */
2730
    1, /* BITVECTOR_ACKERMANNIZE_UREM */
2731
    1, /* BITVECTOR_EAGER_ATOM */
2732
    0, /* BITVECTOR_BITOF_OP */
2733
    1, /* BITVECTOR_BITOF */
2734
    0, /* BITVECTOR_EXTRACT_OP */
2735
    1, /* BITVECTOR_EXTRACT */
2736
    0, /* BITVECTOR_REPEAT_OP */
2737
    1, /* BITVECTOR_REPEAT */
2738
    0, /* BITVECTOR_ROTATE_LEFT_OP */
2739
    1, /* BITVECTOR_ROTATE_LEFT */
2740
    0, /* BITVECTOR_ROTATE_RIGHT_OP */
2741
    1, /* BITVECTOR_ROTATE_RIGHT */
2742
    0, /* BITVECTOR_SIGN_EXTEND_OP */
2743
    1, /* BITVECTOR_SIGN_EXTEND */
2744
    0, /* BITVECTOR_ZERO_EXTEND_OP */
2745
    1, /* BITVECTOR_ZERO_EXTEND */
2746
    0, /* INT_TO_BITVECTOR_OP */
2747
    1, /* INT_TO_BITVECTOR */
2748
    0, /* CONST_FLOATINGPOINT */
2749
    0, /* CONST_ROUNDINGMODE */
2750
    0, /* FLOATINGPOINT_TYPE */
2751
    3, /* FLOATINGPOINT_FP */
2752
    expr::NodeValue::MAX_CHILDREN, /* FLOATINGPOINT_EQ */
2753
    1, /* FLOATINGPOINT_ABS */
2754
    1, /* FLOATINGPOINT_NEG */
2755
    3, /* FLOATINGPOINT_ADD */
2756
    3, /* FLOATINGPOINT_SUB */
2757
    3, /* FLOATINGPOINT_MULT */
2758
    3, /* FLOATINGPOINT_DIV */
2759
    4, /* FLOATINGPOINT_FMA */
2760
    2, /* FLOATINGPOINT_SQRT */
2761
    2, /* FLOATINGPOINT_REM */
2762
    2, /* FLOATINGPOINT_RTI */
2763
    2, /* FLOATINGPOINT_MIN */
2764
    2, /* FLOATINGPOINT_MAX */
2765
    3, /* FLOATINGPOINT_MIN_TOTAL */
2766
    3, /* FLOATINGPOINT_MAX_TOTAL */
2767
    expr::NodeValue::MAX_CHILDREN, /* FLOATINGPOINT_LEQ */
2768
    expr::NodeValue::MAX_CHILDREN, /* FLOATINGPOINT_LT */
2769
    expr::NodeValue::MAX_CHILDREN, /* FLOATINGPOINT_GEQ */
2770
    expr::NodeValue::MAX_CHILDREN, /* FLOATINGPOINT_GT */
2771
    1, /* FLOATINGPOINT_ISN */
2772
    1, /* FLOATINGPOINT_ISSN */
2773
    1, /* FLOATINGPOINT_ISZ */
2774
    1, /* FLOATINGPOINT_ISINF */
2775
    1, /* FLOATINGPOINT_ISNAN */
2776
    1, /* FLOATINGPOINT_ISNEG */
2777
    1, /* FLOATINGPOINT_ISPOS */
2778
    0, /* FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP */
2779
    1, /* FLOATINGPOINT_TO_FP_IEEE_BITVECTOR */
2780
    0, /* FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP */
2781
    2, /* FLOATINGPOINT_TO_FP_FLOATINGPOINT */
2782
    0, /* FLOATINGPOINT_TO_FP_REAL_OP */
2783
    2, /* FLOATINGPOINT_TO_FP_REAL */
2784
    0, /* FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP */
2785
    2, /* FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR */
2786
    0, /* FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP */
2787
    2, /* FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR */
2788
    0, /* FLOATINGPOINT_TO_FP_GENERIC_OP */
2789
    2, /* FLOATINGPOINT_TO_FP_GENERIC */
2790
    0, /* FLOATINGPOINT_TO_UBV_OP */
2791
    2, /* FLOATINGPOINT_TO_UBV */
2792
    0, /* FLOATINGPOINT_TO_UBV_TOTAL_OP */
2793
    3, /* FLOATINGPOINT_TO_UBV_TOTAL */
2794
    0, /* FLOATINGPOINT_TO_SBV_OP */
2795
    2, /* FLOATINGPOINT_TO_SBV */
2796
    0, /* FLOATINGPOINT_TO_SBV_TOTAL_OP */
2797
    3, /* FLOATINGPOINT_TO_SBV_TOTAL */
2798
    1, /* FLOATINGPOINT_TO_REAL */
2799
    2, /* FLOATINGPOINT_TO_REAL_TOTAL */
2800
    1, /* FLOATINGPOINT_COMPONENT_NAN */
2801
    1, /* FLOATINGPOINT_COMPONENT_INF */
2802
    1, /* FLOATINGPOINT_COMPONENT_ZERO */
2803
    1, /* FLOATINGPOINT_COMPONENT_SIGN */
2804
    1, /* FLOATINGPOINT_COMPONENT_EXPONENT */
2805
    1, /* FLOATINGPOINT_COMPONENT_SIGNIFICAND */
2806
    1, /* ROUNDINGMODE_BITBLAST */
2807
    2, /* ARRAY_TYPE */
2808
    2, /* SELECT */
2809
    3, /* STORE */
2810
    4, /* EQ_RANGE */
2811
    0, /* STORE_ALL */
2812
    4, /* ARR_TABLE_FUN */
2813
    1, /* ARRAY_LAMBDA */
2814
    2, /* PARTIAL_SELECT_0 */
2815
    2, /* PARTIAL_SELECT_1 */
2816
    expr::NodeValue::MAX_CHILDREN, /* CONSTRUCTOR_TYPE */
2817
    2, /* SELECTOR_TYPE */
2818
    1, /* TESTER_TYPE */
2819
    2, /* UPDATER_TYPE */
2820
    expr::NodeValue::MAX_CHILDREN, /* APPLY_CONSTRUCTOR */
2821
    1, /* APPLY_SELECTOR */
2822
    1, /* APPLY_SELECTOR_TOTAL */
2823
    1, /* APPLY_TESTER */
2824
    2, /* APPLY_UPDATER */
2825
    0, /* DATATYPE_TYPE */
2826
    expr::NodeValue::MAX_CHILDREN, /* PARAMETRIC_DATATYPE */
2827
    1, /* APPLY_TYPE_ASCRIPTION */
2828
    0, /* ASCRIPTION_TYPE */
2829
    1, /* DT_SIZE */
2830
    2, /* DT_HEIGHT_BOUND */
2831
    2, /* DT_SIZE_BOUND */
2832
    2, /* DT_SYGUS_BOUND */
2833
    expr::NodeValue::MAX_CHILDREN, /* DT_SYGUS_EVAL */
2834
    expr::NodeValue::MAX_CHILDREN, /* MATCH */
2835
    2, /* MATCH_CASE */
2836
    3, /* MATCH_BIND_CASE */
2837
    0, /* TUPLE_PROJECT_OP */
2838
    1, /* TUPLE_PROJECT */
2839
    0, /* CODATATYPE_BOUND_VARIABLE */
2840
    0, /* SEP_NIL */
2841
    0, /* SEP_EMP */
2842
    2, /* SEP_PTO */
2843
    expr::NodeValue::MAX_CHILDREN, /* SEP_STAR */
2844
    2, /* SEP_WAND */
2845
    2, /* SEP_LABEL */
2846
    0, /* EMPTYSET */
2847
    1, /* SET_TYPE */
2848
    2, /* UNION */
2849
    2, /* INTERSECTION */
2850
    2, /* SETMINUS */
2851
    2, /* SUBSET */
2852
    2, /* MEMBER */
2853
    0, /* SINGLETON_OP */
2854
    1, /* SINGLETON */
2855
    expr::NodeValue::MAX_CHILDREN, /* INSERT */
2856
    1, /* CARD */
2857
    1, /* COMPLEMENT */
2858
    0, /* UNIVERSE_SET */
2859
    3, /* COMPREHENSION */
2860
    1, /* CHOOSE */
2861
    1, /* IS_SINGLETON */
2862
    2, /* JOIN */
2863
    2, /* PRODUCT */
2864
    1, /* TRANSPOSE */
2865
    1, /* TCLOSURE */
2866
    2, /* JOIN_IMAGE */
2867
    1, /* IDEN */
2868
    0, /* EMPTYBAG */
2869
    1, /* BAG_TYPE */
2870
    2, /* UNION_MAX */
2871
    2, /* UNION_DISJOINT */
2872
    2, /* INTERSECTION_MIN */
2873
    2, /* DIFFERENCE_SUBTRACT */
2874
    2, /* DIFFERENCE_REMOVE */
2875
    2, /* SUBBAG */
2876
    2, /* BAG_COUNT */
2877
    1, /* DUPLICATE_REMOVAL */
2878
    0, /* MK_BAG_OP */
2879
    2, /* MK_BAG */
2880
    1, /* BAG_IS_SINGLETON */
2881
    1, /* BAG_CARD */
2882
    1, /* BAG_FROM_SET */
2883
    1, /* BAG_TO_SET */
2884
    1, /* BAG_CHOOSE */
2885
    2, /* BAG_MAP */
2886
    expr::NodeValue::MAX_CHILDREN, /* STRING_CONCAT */
2887
    2, /* STRING_IN_REGEXP */
2888
    1, /* STRING_LENGTH */
2889
    3, /* STRING_SUBSTR */
2890
    3, /* STRING_UPDATE */
2891
    2, /* STRING_CHARAT */
2892
    2, /* STRING_CONTAINS */
2893
    2, /* STRING_LT */
2894
    2, /* STRING_LEQ */
2895
    3, /* STRING_INDEXOF */
2896
    3, /* STRING_INDEXOF_RE */
2897
    3, /* STRING_REPLACE */
2898
    3, /* STRING_REPLACE_ALL */
2899
    3, /* STRING_REPLACE_RE */
2900
    3, /* STRING_REPLACE_RE_ALL */
2901
    2, /* STRING_PREFIX */
2902
    2, /* STRING_SUFFIX */
2903
    1, /* STRING_IS_DIGIT */
2904
    1, /* STRING_ITOS */
2905
    1, /* STRING_STOI */
2906
    1, /* STRING_TO_CODE */
2907
    1, /* STRING_FROM_CODE */
2908
    1, /* STRING_TOLOWER */
2909
    1, /* STRING_TOUPPER */
2910
    1, /* STRING_REV */
2911
    0, /* CONST_STRING */
2912
    1, /* SEQUENCE_TYPE */
2913
    0, /* CONST_SEQUENCE */
2914
    1, /* SEQ_UNIT */
2915
    2, /* SEQ_NTH */
2916
    2, /* SEQ_NTH_TOTAL */
2917
    1, /* STRING_TO_REGEXP */
2918
    expr::NodeValue::MAX_CHILDREN, /* REGEXP_CONCAT */
2919
    expr::NodeValue::MAX_CHILDREN, /* REGEXP_UNION */
2920
    expr::NodeValue::MAX_CHILDREN, /* REGEXP_INTER */
2921
    2, /* REGEXP_DIFF */
2922
    1, /* REGEXP_STAR */
2923
    1, /* REGEXP_PLUS */
2924
    1, /* REGEXP_OPT */
2925
    2, /* REGEXP_RANGE */
2926
    1, /* REGEXP_COMPLEMENT */
2927
    0, /* REGEXP_EMPTY */
2928
    0, /* REGEXP_SIGMA */
2929
    0, /* REGEXP_REPEAT_OP */
2930
    1, /* REGEXP_REPEAT */
2931
    0, /* REGEXP_LOOP_OP */
2932
    1, /* REGEXP_LOOP */
2933
    1, /* REGEXP_RV */
2934
    3, /* FORALL */
2935
    3, /* EXISTS */
2936
    0, /* INST_CONSTANT */
2937
    expr::NodeValue::MAX_CHILDREN, /* BOUND_VAR_LIST */
2938
    expr::NodeValue::MAX_CHILDREN, /* INST_PATTERN */
2939
    1, /* INST_NO_PATTERN */
2940
    expr::NodeValue::MAX_CHILDREN, /* INST_ATTRIBUTE */
2941
    expr::NodeValue::MAX_CHILDREN, /* INST_POOL */
2942
    2, /* INST_ADD_TO_POOL */
2943
    2, /* SKOLEM_ADD_TO_POOL */
2944
    expr::NodeValue::MAX_CHILDREN, /* INST_PATTERN_LIST */
2945
// clang-format on
2946
2947
    0, /* LAST_KIND */
2948
  };
2949
2950
257568744
  return ubs[k];
2951
}
2952
}  // namespace metakind
2953
2954
/**
2955
 * Map a kind of the operator to the kind of the enclosing expression. For
2956
 * example, since the kind of functions is just VARIABLE, it should map
2957
 * VARIABLE to APPLY_UF.
2958
 */
2959
621547
Kind operatorToKind(::cvc5::expr::NodeValue* nv)
2960
{
2961
621547
  if(nv->getKind() == kind::BUILTIN) {
2962
131831
    return nv->getConst<Kind>();
2963
489716
  } else if(nv->getKind() == kind::LAMBDA) {
2964
1685
    return kind::APPLY_UF;
2965
  }
2966
2967
488031
  switch (Kind k CVC5_UNUSED = nv->getKind())
2968
  {
2969
// clang-format off
2970
2971
2972
    /* from builtin */
2973
    case kind::SORT_TAG: return kind::SORT_TYPE;
2974
2975
    /* from booleans */
2976
2977
    /* from uf */
2978
    case kind::VARIABLE: return kind::APPLY_UF;
2979
    case kind::APPLY_UF: return kind::PARTIAL_APPLY_UF;
2980
    case kind::CARDINALITY_CONSTRAINT_OP: return kind::CARDINALITY_CONSTRAINT;
2981
    case kind::COMBINED_CARDINALITY_CONSTRAINT_OP: return kind::COMBINED_CARDINALITY_CONSTRAINT;
2982
2983
    /* from arith */
2984
    case kind::DIVISIBLE_OP: return kind::DIVISIBLE;
2985
    case kind::INDEXED_ROOT_PREDICATE_OP: return kind::INDEXED_ROOT_PREDICATE;
2986
    case kind::IAND_OP: return kind::IAND;
2987
2988
    /* from bv */
2989
251161
    case kind::BITVECTOR_BITOF_OP: return kind::BITVECTOR_BITOF;
2990
72661
    case kind::BITVECTOR_EXTRACT_OP: return kind::BITVECTOR_EXTRACT;
2991
    case kind::BITVECTOR_REPEAT_OP: return kind::BITVECTOR_REPEAT;
2992
    case kind::BITVECTOR_ROTATE_LEFT_OP: return kind::BITVECTOR_ROTATE_LEFT;
2993
    case kind::BITVECTOR_ROTATE_RIGHT_OP: return kind::BITVECTOR_ROTATE_RIGHT;
2994
371
    case kind::BITVECTOR_SIGN_EXTEND_OP: return kind::BITVECTOR_SIGN_EXTEND;
2995
58
    case kind::BITVECTOR_ZERO_EXTEND_OP: return kind::BITVECTOR_ZERO_EXTEND;
2996
343
    case kind::INT_TO_BITVECTOR_OP: return kind::INT_TO_BITVECTOR;
2997
2998
    /* from fp */
2999
4157
    case kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR_OP: return kind::FLOATINGPOINT_TO_FP_IEEE_BITVECTOR;
3000
8
    case kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT_OP: return kind::FLOATINGPOINT_TO_FP_FLOATINGPOINT;
3001
21
    case kind::FLOATINGPOINT_TO_FP_REAL_OP: return kind::FLOATINGPOINT_TO_FP_REAL;
3002
16
    case kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR_OP: return kind::FLOATINGPOINT_TO_FP_SIGNED_BITVECTOR;
3003
24
    case kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR_OP: return kind::FLOATINGPOINT_TO_FP_UNSIGNED_BITVECTOR;
3004
    case kind::FLOATINGPOINT_TO_FP_GENERIC_OP: return kind::FLOATINGPOINT_TO_FP_GENERIC;
3005
    case kind::FLOATINGPOINT_TO_UBV_OP: return kind::FLOATINGPOINT_TO_UBV;
3006
    case kind::FLOATINGPOINT_TO_UBV_TOTAL_OP: return kind::FLOATINGPOINT_TO_UBV_TOTAL;
3007
    case kind::FLOATINGPOINT_TO_SBV_OP: return kind::FLOATINGPOINT_TO_SBV;
3008
4
    case kind::FLOATINGPOINT_TO_SBV_TOTAL_OP: return kind::FLOATINGPOINT_TO_SBV_TOTAL;
3009
3010
    /* from arrays */
3011
3012
    /* from datatypes */
3013
2
    case kind::APPLY_TYPE_ASCRIPTION: return kind::APPLY_CONSTRUCTOR;
3014
    case kind::SELECTOR_TYPE: return kind::APPLY_SELECTOR;
3015
    case kind::TESTER_TYPE: return kind::APPLY_TESTER;
3016
    case kind::UPDATER_TYPE: return kind::APPLY_UPDATER;
3017
    case kind::ASCRIPTION_TYPE: return kind::APPLY_TYPE_ASCRIPTION;
3018
    case kind::TUPLE_PROJECT_OP: return kind::TUPLE_PROJECT;
3019
3020
    /* from sep */
3021
3022
    /* from sets */
3023
    case kind::SINGLETON_OP: return kind::SINGLETON;
3024
3025
    /* from bags */
3026
    case kind::MK_BAG_OP: return kind::MK_BAG;
3027
3028
    /* from strings */
3029
2
    case kind::REGEXP_REPEAT_OP: return kind::REGEXP_REPEAT;
3030
2
    case kind::REGEXP_LOOP_OP: return kind::REGEXP_LOOP;
3031
3032
    /* from quantifiers */
3033
// clang-format on
3034
3035
159201
    default: return kind::UNDEFINED_KIND; /* LAST_KIND */
3036
  };
3037
}
3038
3039
}  // namespace kind
3040
31131
}  // namespace cvc5