SMTStabilizer API
Public API documentation for SMTStabilizer
Loading...
Searching...
No Matches
sort.h
Go to the documentation of this file.
1/* -*- Header -*-
2 *
3 * The Sort Class
4 *
5 * Author: Fuqi Jia <jiafq@ios.ac.cn>
6 *
7 * Copyright (C) 2025 Fuqi Jia
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
26 */
27// Modified by Xiang Zhang, 2026
28// Additional changes licensed under the MIT License
29#ifndef _SORT_H
30#define _SORT_H
31
32#include <functional>
33#include <memory>
34#include <string>
35#include <unordered_map>
36#include <vector>
37
38#include "asserting.h"
39#include "kind.h"
40
41namespace stabilizer::parser {
42
43// supported const/variable types
44enum class SORT_KIND {
45 SK_NULL = 0,
47 SK_BOOL,
48 SK_INT,
49 SK_REAL,
50 SK_BV,
51 SK_FP,
52 SK_STR,
55 SK_SET,
57 SK_BAG,
58 SK_SEQ,
60 SK_UF,
61 SK_REG, // regular expression
62 SK_EXT, // extended real
63 SK_RAT, // rational number
64 SK_NAT, // natural number
65 SK_ALGEBRAIC, // algebraic number
66 SK_TRANSCENDENTAL, // transcendental number
67 SK_RAND, // random number
68 SK_INTOREAL, // int or real, for constant
69 SK_DEC, // declare-sort
70 SK_DEF, // define-sort
71 SK_ROUNDING_MODE // rounding mode for floating point operations
72};
73
74class Sort {
75 public:
77 std::string name;
78 size_t arity;
79 std::vector<std::shared_ptr<Sort>> children;
80 Sort(SORT_KIND kind, std::string name, size_t arity, std::vector<std::shared_ptr<Sort>> children)
82 Sort(SORT_KIND kind, std::string name, size_t arity)
83 : kind(kind), name(name), arity(arity) {}
84 Sort(SORT_KIND kind, std::string name) : kind(kind), name(name), arity(0) {}
86 Sort(std::string name) : kind(SORT_KIND::SK_UNKNOWN), name(name), arity(0) {}
90
91 // check the type of the sort
92 bool isNull() const { return kind == SORT_KIND::SK_NULL; }
93 bool isUnknown() const { return kind == SORT_KIND::SK_UNKNOWN; }
94 bool isBool() const { return kind == SORT_KIND::SK_BOOL; }
95 // it is an integer but can also be a real
96 bool isIntOrReal() const { return kind == SORT_KIND::SK_INTOREAL; }
97 bool isInt() const { return kind == SORT_KIND::SK_INT; }
98 bool isReal() const { return kind == SORT_KIND::SK_REAL; }
99 bool isAlgebraic() const { return kind == SORT_KIND::SK_ALGEBRAIC; }
101 bool isBv() const { return kind == SORT_KIND::SK_BV; }
102 bool isFp() const { return kind == SORT_KIND::SK_FP; }
103 bool isStr() const { return kind == SORT_KIND::SK_STR; }
104 bool isReg() const { return kind == SORT_KIND::SK_REG; }
105 bool isExt() const { return kind == SORT_KIND::SK_EXT; }
106 bool isArray() const { return kind == SORT_KIND::SK_ARRAY; }
107 bool isDatatype() const { return kind == SORT_KIND::SK_DATATYPE; }
108 bool isSet() const { return kind == SORT_KIND::SK_SET; }
109 bool isRelation() const { return kind == SORT_KIND::SK_RELATION; }
110 bool isBag() const { return kind == SORT_KIND::SK_BAG; }
111 bool isSeq() const { return kind == SORT_KIND::SK_SEQ; }
112 bool isTuple() const { return kind == SORT_KIND::SK_TUPLE; }
113 bool isUF() const { return kind == SORT_KIND::SK_UF; }
114 bool isNat() const { return kind == SORT_KIND::SK_NAT; }
115 bool isRand() const { return kind == SORT_KIND::SK_RAND; }
116 bool isDec() const { return kind == SORT_KIND::SK_DEC; }
117 bool isDef() const { return kind == SORT_KIND::SK_DEF; }
119
120 void setName(const std::string &n) { name = n; }
121
122 // compare two sorts
123 bool operator==(const Sort &other) const {
124 // same sort name and arity
125 if ((isDef() || isDec()) && (other.isDef() || other.isDec()) &&
126 name == other.name && arity == other.arity) {
127 return true;
128 }
129
130 // int or real
131 if ((isInt() && other.isIntOrReal()) || (isIntOrReal() && other.isInt())) {
132 return true;
133 }
134 else if ((isReal() && other.isIntOrReal()) ||
135 (isIntOrReal() && other.isReal())) {
136 return true;
137 }
138
139 // floating point
140 else if (isFp() && other.isFp()) {
141 // For floating point types, compare exponent and significand widths
142 return getExponentWidth() == other.getExponentWidth() &&
143 getSignificandWidth() == other.getSignificandWidth();
144 }
145
146 // other sorts
147 else {
148 return kind == other.kind && name == other.name && arity == other.arity;
149 }
150 }
151 bool operator!=(const Sort &other) const { return !(*this == other); }
152
153 // print the sort
154 std::string toString() const {
155 switch (kind) {
157 return "Bool";
159 return "Int";
161 return "Real";
162 case SORT_KIND::SK_BV:
163 return "(_ BitVec " + std::to_string(children[0]->arity) + ")";
164 case SORT_KIND::SK_FP:
165 return "(_ FloatingPoint " + std::to_string(children[0]->arity) + " " +
166 std::to_string(children[1]->arity) + ")";
168 return "String";
170 return "(Array " + children[0]->toString() + " " +
171 children[1]->toString() + ")";
173 return "Datatype";
175 return "Set";
177 return "Relation";
179 return "Bag";
181 return "Sequence";
182 case SORT_KIND::SK_TUPLE: {
183 if (children.empty())
184 return "UnitTuple";
185 std::string s = "(Tuple";
186 for (const auto &ch : children) {
187 s += " " + ch->toString();
188 }
189 s += ")";
190 return s;
191 }
192 case SORT_KIND::SK_UF:
193 return "UF";
195 return "RegLan";
197 return "ExtReal";
199 return "Natural";
201 return "Random";
203 return "IntOrReal";
205 return "Algebraic";
207 return "Transcendental";
209 return name;
211 return name;
213 return "RoundingMode";
214 default:
215 return "Unknown";
216 }
217 }
218
219 size_t getBitWidth() const {
221 "Cannot get bit width of non-bitvector sort");
222 return children[0]->arity;
223 }
224
225 size_t getExponentWidth() const {
227 "Cannot get exponent width of non-floating-point sort");
228 return children[0]->arity;
229 }
230
231 size_t getSignificandWidth() const {
233 "Cannot get significand width of non-floating-point sort");
234 return children[1]->arity;
235 }
236
237 std::shared_ptr<Sort> getIndexSort() const {
239 "Cannot get index sort of non-array sort");
240 return children[0];
241 }
242
243 std::shared_ptr<Sort> getElemSort() const {
245 "Cannot get element sort of non-array sort");
246 return children[1];
247 }
248
249 std::shared_ptr<Sort> getParamSort(size_t index) const {
251 "Cannot get parameter sort of non-define-sort sort");
252 return children[index];
253 }
254
255 std::vector<std::shared_ptr<Sort>> getParams() const {
257 "Cannot get parameters of non-define-sort sort");
258 return std::vector<std::shared_ptr<Sort>>(children.begin(),
259 children.end() - 1);
260 }
261
262 std::shared_ptr<Sort> getOutSort() const {
264 "Cannot get output sort of non-define-sort sort");
265 return children[children.size() - 1];
266 }
267
268 bool isEqTo(const Sort &other) const { return *this == other; }
269
270 bool isEqTo(const std::shared_ptr<Sort> &other) const {
271 return *this == *other;
272 }
273
274 // Hash function for Sort deduplication
275 size_t hash() const {
276 size_t result = std::hash<int>{}(static_cast<int>(kind));
277 result ^= std::hash<std::string>{}(name) + 0x9e3779b9 + (result << 6) +
278 (result >> 2);
279 result ^=
280 std::hash<size_t>{}(arity) + 0x9e3779b9 + (result << 6) + (result >> 2);
281
282 // Hash children
283 for (const auto &child : children) {
284 if (child) {
285 result ^= child->hash() + 0x9e3779b9 + (result << 6) + (result >> 2);
286 }
287 }
288
289 return result;
290 }
291
292 size_t hash_without_name() const {
293 size_t result = std::hash<int>{}(static_cast<int>(kind));
294 result ^= ((isDec() || isDef()) ? 0 : std::hash<std::string>{}(name)) +
295 0x9e3779b9 + (result << 6) + (result >> 2);
296 result ^=
297 std::hash<size_t>{}(arity) + 0x9e3779b9 + (result << 6) + (result >> 2);
298
299 // Hash children
300 for (const auto &child : children) {
301 if (child) {
302 result ^= child->hash_without_name() + 0x9e3779b9 + (result << 6) +
303 (result >> 2);
304 }
305 }
306
307 return result;
308 }
309};
310
311// Sort Manager for managing and deduplicating Sort instances
313 private:
314 std::vector<std::shared_ptr<Sort>> sorts;
315 std::unordered_map<size_t,
316 std::vector<std::pair<std::shared_ptr<Sort>, size_t>>>
318
319 public:
320 SortManager();
321 ~SortManager();
322
323 std::shared_ptr<Sort> getSort(const size_t index) const;
324 size_t getIndex(const std::shared_ptr<Sort> &sort) const;
325 size_t size() const;
326
327 // createSort methods corresponding to Sort constructors
328 std::shared_ptr<Sort> createSort(SORT_KIND kind, std::string name, size_t arity, std::vector<std::shared_ptr<Sort>> children);
329 std::shared_ptr<Sort> createSort(SORT_KIND kind, std::string name, size_t arity);
330 std::shared_ptr<Sort> createSort(SORT_KIND kind, std::string name);
331 std::shared_ptr<Sort> createSort(SORT_KIND kind);
332 std::shared_ptr<Sort> createSort(std::string name);
333 std::shared_ptr<Sort> createSort();
334
335 // Specific sort creation methods (replacing global mk* functions)
336 std::shared_ptr<Sort> createBVSort(size_t width);
337 std::shared_ptr<Sort> createFPSort(size_t exp, size_t sig);
338 std::shared_ptr<Sort> createArraySort(std::shared_ptr<Sort> index,
339 std::shared_ptr<Sort> elem);
340 std::shared_ptr<Sort>
341 createTupleSort(const std::vector<std::shared_ptr<Sort>> &fields);
342 std::shared_ptr<Sort> createSortDec(const std::string &name, size_t arity);
343 std::shared_ptr<Sort>
344 createSortDef(const std::string &name,
345 const std::vector<std::shared_ptr<Sort>> &params,
346 std::shared_ptr<Sort> out_sort);
347
348 void clear();
349
350 // Getter functions for static constant sorts
351 static std::shared_ptr<Sort> getNull() { return NULL_SORT; }
352 static std::shared_ptr<Sort> getUnknown() { return UNKNOWN_SORT; }
353 static std::shared_ptr<Sort> getBool() { return BOOL_SORT; }
354 static std::shared_ptr<Sort> getInt() { return INT_SORT; }
355 static std::shared_ptr<Sort> getReal() { return REAL_SORT; }
356 static std::shared_ptr<Sort> getAlgebraic() { return ALGEBRAIC_SORT; }
357 static std::shared_ptr<Sort> getTranscendental() {
358 return TRANSCENDENTAL_SORT;
359 }
360 static std::shared_ptr<Sort> getStr() { return STR_SORT; }
361 static std::shared_ptr<Sort> getReg() { return REG_SORT; }
362 static std::shared_ptr<Sort> getExt() { return EXT_SORT; }
363 static std::shared_ptr<Sort> getNat() { return NAT_SORT; }
364 static std::shared_ptr<Sort> getRand() { return RAND_SORT; }
365 static std::shared_ptr<Sort> getIntOrReal() { return INTOREAL_SORT; }
366 static std::shared_ptr<Sort> getFloat64() { return FLOAT64_SORT; }
367 static std::shared_ptr<Sort> getFloat32() { return FLOAT32_SORT; }
368 static std::shared_ptr<Sort> getFloat16() { return FLOAT16_SORT; }
369 static std::shared_ptr<Sort> getRoundingMode() { return ROUNDING_MODE_SORT; }
370
371 size_t getBitWidth(const std::shared_ptr<Sort> &sort);
372 size_t getExponentWidth(const std::shared_ptr<Sort> &sort);
373 size_t getSignificandWidth(const std::shared_ptr<Sort> &sort);
374 std::shared_ptr<Sort> getIndexSort(const std::shared_ptr<Sort> &sort);
375 std::shared_ptr<Sort> getElemSort(const std::shared_ptr<Sort> &sort);
376 std::shared_ptr<Sort> getParamSort(const std::shared_ptr<Sort> &sort,
377 size_t index);
378 std::vector<std::shared_ptr<Sort>>
379 getParams(const std::shared_ptr<Sort> &sort);
380 std::shared_ptr<Sort> getOutSort(const std::shared_ptr<Sort> &sort);
381
382 public:
383 // static constant sorts (inline for guaranteed initialization order)
384 inline static const std::shared_ptr<Sort> NULL_SORT =
385 std::make_shared<Sort>(SORT_KIND::SK_NULL, "Null", 0);
386 inline static const std::shared_ptr<Sort> UNKNOWN_SORT =
387 std::make_shared<Sort>(SORT_KIND::SK_UNKNOWN, "Unknown", 0);
388 inline static const std::shared_ptr<Sort> BOOL_SORT =
389 std::make_shared<Sort>(SORT_KIND::SK_BOOL, "Bool", 0);
390 inline static const std::shared_ptr<Sort> INT_SORT =
391 std::make_shared<Sort>(SORT_KIND::SK_INT, "Int", 0);
392 inline static const std::shared_ptr<Sort> REAL_SORT =
393 std::make_shared<Sort>(SORT_KIND::SK_REAL, "Real", 0);
394 inline static const std::shared_ptr<Sort> ALGEBRAIC_SORT =
395 std::make_shared<Sort>(SORT_KIND::SK_ALGEBRAIC, "Algebraic", 0);
396 inline static const std::shared_ptr<Sort> TRANSCENDENTAL_SORT =
397 std::make_shared<Sort>(SORT_KIND::SK_TRANSCENDENTAL, "Transcendental", 0);
398 inline static const std::shared_ptr<Sort> STR_SORT =
399 std::make_shared<Sort>(SORT_KIND::SK_STR, "String", 0);
400 inline static const std::shared_ptr<Sort> REG_SORT =
401 std::make_shared<Sort>(SORT_KIND::SK_REG, "Reg", 0);
402 inline static const std::shared_ptr<Sort> EXT_SORT =
403 std::make_shared<Sort>(SORT_KIND::SK_EXT, "ExtReal", 0);
404 inline static const std::shared_ptr<Sort> NAT_SORT =
405 std::make_shared<Sort>(SORT_KIND::SK_NAT, "Natural", 0);
406 inline static const std::shared_ptr<Sort> RAND_SORT =
407 std::make_shared<Sort>(SORT_KIND::SK_RAND, "Random", 0);
408 inline static const std::shared_ptr<Sort> INTOREAL_SORT =
409 std::make_shared<Sort>(SORT_KIND::SK_INTOREAL, "IntOrReal", 0);
410 inline static const std::shared_ptr<Sort> FLOAT64_SORT =
411 std::make_shared<Sort>(
412 SORT_KIND::SK_FP, "Float64", 0, std::vector<std::shared_ptr<Sort>>{std::make_shared<Sort>(SORT_KIND::SK_NULL, "Exp", 11), std::make_shared<Sort>(SORT_KIND::SK_NULL, "Sig", 53)});
413 inline static const std::shared_ptr<Sort> FLOAT32_SORT =
414 std::make_shared<Sort>(
415 SORT_KIND::SK_FP, "Float32", 0, std::vector<std::shared_ptr<Sort>>{std::make_shared<Sort>(SORT_KIND::SK_NULL, "Exp", 8), std::make_shared<Sort>(SORT_KIND::SK_NULL, "Sig", 24)});
416 inline static const std::shared_ptr<Sort> FLOAT16_SORT =
417 std::make_shared<Sort>(
418 SORT_KIND::SK_FP, "Float16", 0, std::vector<std::shared_ptr<Sort>>{std::make_shared<Sort>(SORT_KIND::SK_NULL, "Exp", 5), std::make_shared<Sort>(SORT_KIND::SK_NULL, "Sig", 11)});
419 inline static const std::shared_ptr<Sort> ROUNDING_MODE_SORT =
420 std::make_shared<Sort>(SORT_KIND::SK_ROUNDING_MODE, "RoundingMode", 0);
421
422 private:
424 std::shared_ptr<Sort> insertSortToBucket(const std::shared_ptr<Sort> &sort);
425};
426
427// smart pointer
428typedef std::shared_ptr<Sort> SortPtr;
429typedef std::shared_ptr<SortManager> SortManagerPtr;
430} // namespace stabilizer::parser
431#endif
#define condAssert(cond, msg)
Definition asserting.h:35
static const std::shared_ptr< Sort > INTOREAL_SORT
Definition sort.h:408
std::shared_ptr< Sort > getElemSort(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:209
static std::shared_ptr< Sort > getFloat64()
Definition sort.h:366
static std::shared_ptr< Sort > getStr()
Definition sort.h:360
std::shared_ptr< Sort > createBVSort(size_t width)
Definition sort.cpp:146
static const std::shared_ptr< Sort > ROUNDING_MODE_SORT
Definition sort.h:419
std::unordered_map< size_t, std::vector< std::pair< std::shared_ptr< Sort >, size_t > > > sort_buckets
Definition sort.h:317
std::shared_ptr< Sort > getOutSort(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:224
static const std::shared_ptr< Sort > ALGEBRAIC_SORT
Definition sort.h:394
std::shared_ptr< Sort > insertSortToBucket(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:91
static const std::shared_ptr< Sort > STR_SORT
Definition sort.h:398
static const std::shared_ptr< Sort > TRANSCENDENTAL_SORT
Definition sort.h:396
size_t getBitWidth(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:191
std::shared_ptr< Sort > createArraySort(std::shared_ptr< Sort > index, std::shared_ptr< Sort > elem)
Definition sort.cpp:161
static const std::shared_ptr< Sort > INT_SORT
Definition sort.h:390
static const std::shared_ptr< Sort > FLOAT32_SORT
Definition sort.h:413
std::vector< std::shared_ptr< Sort > > sorts
Definition sort.h:314
static std::shared_ptr< Sort > getRand()
Definition sort.h:364
std::shared_ptr< Sort > getParamSort(const std::shared_ptr< Sort > &sort, size_t index)
Definition sort.cpp:214
std::shared_ptr< Sort > createSort()
Definition sort.cpp:140
static std::shared_ptr< Sort > getFloat32()
Definition sort.h:367
static const std::shared_ptr< Sort > FLOAT16_SORT
Definition sort.h:416
static std::shared_ptr< Sort > getReal()
Definition sort.h:355
static std::shared_ptr< Sort > getRoundingMode()
Definition sort.h:369
std::shared_ptr< Sort > getIndexSort(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:204
std::shared_ptr< Sort > createSortDef(const std::string &name, const std::vector< std::shared_ptr< Sort > > &params, std::shared_ptr< Sort > out_sort)
Definition sort.cpp:181
static const std::shared_ptr< Sort > FLOAT64_SORT
Definition sort.h:410
std::shared_ptr< Sort > createSortDec(const std::string &name, size_t arity)
Definition sort.cpp:174
static std::shared_ptr< Sort > getExt()
Definition sort.h:362
static const std::shared_ptr< Sort > RAND_SORT
Definition sort.h:406
size_t getIndex(const std::shared_ptr< Sort > &sort) const
Definition sort.cpp:74
static std::shared_ptr< Sort > getUnknown()
Definition sort.h:352
std::shared_ptr< Sort > createFPSort(size_t exp, size_t sig)
Definition sort.cpp:153
std::shared_ptr< Sort > createTupleSort(const std::vector< std::shared_ptr< Sort > > &fields)
Definition sort.cpp:169
std::vector< std::shared_ptr< Sort > > getParams(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:219
static std::shared_ptr< Sort > getNull()
Definition sort.h:351
std::shared_ptr< Sort > getSort(const size_t index) const
Definition sort.cpp:67
static const std::shared_ptr< Sort > REG_SORT
Definition sort.h:400
static std::shared_ptr< Sort > getInt()
Definition sort.h:354
static const std::shared_ptr< Sort > BOOL_SORT
Definition sort.h:388
static const std::shared_ptr< Sort > REAL_SORT
Definition sort.h:392
static const std::shared_ptr< Sort > UNKNOWN_SORT
Definition sort.h:386
static const std::shared_ptr< Sort > EXT_SORT
Definition sort.h:402
static std::shared_ptr< Sort > getIntOrReal()
Definition sort.h:365
static std::shared_ptr< Sort > getReg()
Definition sort.h:361
static const std::shared_ptr< Sort > NULL_SORT
Definition sort.h:384
size_t getSignificandWidth(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:199
static const std::shared_ptr< Sort > NAT_SORT
Definition sort.h:404
static std::shared_ptr< Sort > getFloat16()
Definition sort.h:368
static std::shared_ptr< Sort > getAlgebraic()
Definition sort.h:356
static std::shared_ptr< Sort > getTranscendental()
Definition sort.h:357
static std::shared_ptr< Sort > getNat()
Definition sort.h:363
size_t getExponentWidth(const std::shared_ptr< Sort > &sort)
Definition sort.cpp:195
static std::shared_ptr< Sort > getBool()
Definition sort.h:353
size_t getSignificandWidth() const
Definition sort.h:231
size_t hash_without_name() const
Definition sort.h:292
bool isTuple() const
Definition sort.h:112
bool isReal() const
Definition sort.h:98
bool isDef() const
Definition sort.h:117
bool isTranscendental() const
Definition sort.h:100
bool isAlgebraic() const
Definition sort.h:99
bool isReg() const
Definition sort.h:104
bool isBool() const
Definition sort.h:94
bool isExt() const
Definition sort.h:105
std::shared_ptr< Sort > getOutSort() const
Definition sort.h:262
std::shared_ptr< Sort > getIndexSort() const
Definition sort.h:237
bool isBag() const
Definition sort.h:110
size_t getExponentWidth() const
Definition sort.h:225
Sort(SORT_KIND kind, std::string name)
Definition sort.h:84
bool isNull() const
Definition sort.h:92
bool isIntOrReal() const
Definition sort.h:96
std::shared_ptr< Sort > getParamSort(size_t index) const
Definition sort.h:249
bool isRoundingMode() const
Definition sort.h:118
bool isEqTo(const Sort &other) const
Definition sort.h:268
bool operator!=(const Sort &other) const
Definition sort.h:151
size_t hash() const
Definition sort.h:275
void setName(const std::string &n)
Definition sort.h:120
bool isSet() const
Definition sort.h:108
std::shared_ptr< Sort > getElemSort() const
Definition sort.h:243
std::string toString() const
Definition sort.h:154
bool isNat() const
Definition sort.h:114
std::vector< std::shared_ptr< Sort > > getParams() const
Definition sort.h:255
bool isStr() const
Definition sort.h:103
bool isDec() const
Definition sort.h:116
Sort(SORT_KIND kind, std::string name, size_t arity)
Definition sort.h:82
Sort(SORT_KIND kind)
Definition sort.h:85
size_t getBitWidth() const
Definition sort.h:219
bool isRand() const
Definition sort.h:115
bool isUnknown() const
Definition sort.h:93
bool isArray() const
Definition sort.h:106
bool isUF() const
Definition sort.h:113
bool isInt() const
Definition sort.h:97
Sort(SORT_KIND kind, std::string name, size_t arity, std::vector< std::shared_ptr< Sort > > children)
Definition sort.h:80
bool isBv() const
Definition sort.h:101
bool isDatatype() const
Definition sort.h:107
bool operator==(const Sort &other) const
Definition sort.h:123
Sort(const Sort &other)
Definition sort.h:88
bool isSeq() const
Definition sort.h:111
bool isRelation() const
Definition sort.h:109
bool isEqTo(const std::shared_ptr< Sort > &other) const
Definition sort.h:270
std::string name
Definition sort.h:77
bool isFp() const
Definition sort.h:102
std::vector< std::shared_ptr< Sort > > children
Definition sort.h:79
Sort(std::string name)
Definition sort.h:86
std::shared_ptr< Sort > SortPtr
Definition sort.h:428
std::shared_ptr< SortManager > SortManagerPtr
Definition sort.h:429