GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/expr/metakind.cpp Lines: 580 743 78.1 %
Date: 2021-08-16 Branches: 366 786 46.6 %

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