Exemplo n.º 1
0
/*
 * Collect the root classes (and sort them)
 */
static void collect_root_classes(egraph_t *egraph, int_hset_t *roots) {
  uint32_t i, n;
  n = egraph->terms.nterms;
  for (i=0; i<n; i++) {
    if (egraph->terms.body[i] != NULL) {
      int_hset_add(roots, egraph_term_class(egraph, i));
    }
  }
  int_hset_close(roots);

  // coercion to (int32_t *) is safe since class_ids are less than INT32_MAX
  int_array_sort((int32_t *)roots->data, roots->nelems);
}
Exemplo n.º 2
0
static void show_cset(cset_t *c) {
  ivector_t aux;
  uint32_t i, n;

  init_ivector(&aux, 10);
  cset_extract(c, &aux);
  int_array_sort(aux.data, aux.size);
  printf("{");
  n = aux.size;
  for (i=0; i<n; i++) {
    printf(" %"PRIu32, aux.data[i]);
  }
  printf(" }");
  delete_ivector(&aux);
}
Exemplo n.º 3
0
static void bset_sort(bset_t *s) {
  int_array_sort((int32_t*) s->data, s->card);
}