/* * Initialization */ void init_flattener(flattener_t *flat, term_manager_t *mngr) { flat->terms = term_manager_get_terms(mngr); flat->manager = mngr; init_int_queue(&flat->queue, 0); init_int_hset(&flat->cache, 128); init_ivector(&flat->resu, 64); }
/* * Get the internal cache. * Allocate and initialize it if needed. */ static int_hset_t *intern_tbl_get_cache(intern_tbl_t *tbl) { int_hset_t *tmp; tmp = tbl->cache; if (tmp == NULL) { tmp = (int_hset_t *) safe_malloc(sizeof(int_hset_t)); init_int_hset(tmp, 128); tbl->cache = tmp; } return tmp; }
void print_egraph_root_classes_details(FILE *f, egraph_t *egraph) { uint32_t i, n; int_hset_t roots; init_int_hset(&roots, 0); collect_root_classes(egraph, &roots); n = roots.nelems; for (i=0; i<n; i++) { print_class_details(f, egraph, roots.data[i]); } delete_int_hset(&roots); }