61 for (
size_t i = 0; i <
sorts.size(); ++i) {
62 size_t hash_val =
sorts[i]->hash();
68 if (index >=
sorts.size()) {
75 for (
size_t i = 0; i <
sorts.size(); ++i) {
76 if (
sorts[i] == sort) {
92 size_t hash_val = sort->hash();
97 for (
const auto &pair : bucket_it->second) {
98 if (*pair.first == *sort) {
105 size_t new_index =
sorts.size();
106 sorts.push_back(sort);
115 auto sort = std::make_shared<Sort>(kind, name, arity, children);
120 auto sort = std::make_shared<Sort>(kind, name, arity);
126 auto sort = std::make_shared<Sort>(kind, name);
131 auto sort = std::make_shared<Sort>(kind);
136 auto sort = std::make_shared<Sort>(name);
141 auto sort = std::make_shared<Sort>();
149 std::make_shared<Sort>(
SORT_KIND::SK_BV,
"BV", 0, std::vector<std::shared_ptr<Sort>>{width_sort});
156 auto sort = std::make_shared<Sort>(
157 SORT_KIND::SK_FP,
"FP", 0, std::vector<std::shared_ptr<Sort>>{exp_sort, sig_sort});
162 std::shared_ptr<Sort> elem) {
164 std::make_shared<Sort>(
SORT_KIND::SK_ARRAY,
"Array", 0, std::vector<std::shared_ptr<Sort>>{index, elem});
182 const std::vector<std::shared_ptr<Sort>> ¶ms,
183 std::shared_ptr<Sort> out_sort) {
184 std::vector<std::shared_ptr<Sort>> children;
185 children.insert(children.end(), params.begin(), params.end());
186 children.push_back(out_sort);
187 auto sort = std::make_shared<Sort>(
SORT_KIND::SK_DEF, name, children.size() - 1, children);
192 return sort->getBitWidth();
196 return sort->getExponentWidth();
200 return sort->getSignificandWidth();
205 return sort->getIndexSort();
210 return sort->getElemSort();
215 return sort->getParamSort(index);
218std::vector<std::shared_ptr<Sort>>
220 return sort->getParams();
225 return sort->getOutSort();
static const std::shared_ptr< Sort > INTOREAL_SORT
std::shared_ptr< Sort > getElemSort(const std::shared_ptr< Sort > &sort)
void initializeStaticSorts()
std::shared_ptr< Sort > createBVSort(size_t width)
static const std::shared_ptr< Sort > ROUNDING_MODE_SORT
std::unordered_map< size_t, std::vector< std::pair< std::shared_ptr< Sort >, size_t > > > sort_buckets
std::shared_ptr< Sort > getOutSort(const std::shared_ptr< Sort > &sort)
static const std::shared_ptr< Sort > ALGEBRAIC_SORT
std::shared_ptr< Sort > insertSortToBucket(const std::shared_ptr< Sort > &sort)
static const std::shared_ptr< Sort > STR_SORT
static const std::shared_ptr< Sort > TRANSCENDENTAL_SORT
size_t getBitWidth(const std::shared_ptr< Sort > &sort)
std::shared_ptr< Sort > createArraySort(std::shared_ptr< Sort > index, std::shared_ptr< Sort > elem)
static const std::shared_ptr< Sort > INT_SORT
static const std::shared_ptr< Sort > FLOAT32_SORT
std::vector< std::shared_ptr< Sort > > sorts
std::shared_ptr< Sort > getParamSort(const std::shared_ptr< Sort > &sort, size_t index)
std::shared_ptr< Sort > createSort()
static const std::shared_ptr< Sort > FLOAT16_SORT
std::shared_ptr< Sort > getIndexSort(const std::shared_ptr< Sort > &sort)
std::shared_ptr< Sort > createSortDef(const std::string &name, const std::vector< std::shared_ptr< Sort > > ¶ms, std::shared_ptr< Sort > out_sort)
static const std::shared_ptr< Sort > FLOAT64_SORT
std::shared_ptr< Sort > createSortDec(const std::string &name, size_t arity)
static const std::shared_ptr< Sort > RAND_SORT
size_t getIndex(const std::shared_ptr< Sort > &sort) const
std::shared_ptr< Sort > createFPSort(size_t exp, size_t sig)
std::shared_ptr< Sort > createTupleSort(const std::vector< std::shared_ptr< Sort > > &fields)
std::vector< std::shared_ptr< Sort > > getParams(const std::shared_ptr< Sort > &sort)
std::shared_ptr< Sort > getSort(const size_t index) const
static const std::shared_ptr< Sort > REG_SORT
static const std::shared_ptr< Sort > BOOL_SORT
static const std::shared_ptr< Sort > REAL_SORT
static const std::shared_ptr< Sort > UNKNOWN_SORT
static const std::shared_ptr< Sort > EXT_SORT
static const std::shared_ptr< Sort > NULL_SORT
size_t getSignificandWidth(const std::shared_ptr< Sort > &sort)
static const std::shared_ptr< Sort > NAT_SORT
size_t getExponentWidth(const std::shared_ptr< Sort > &sort)