GCC Code Coverage Report
Directory: . Exec Total Coverage
File: build-coverage/src/expr/metakind.cpp Lines: 567 743 76.3 %
Date: 2021-05-22 Branches: 358 788 45.4 %

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