Beispiel #1
0
/*
 * Free all memory used by the printer
 * - also call free on all the pending_tokens
 */
static void delete_printer(printer_t *p) {
  pvector_t *v;
  uint32_t i, n;

  delete_pp_stack(&p->stack);
  v = &p->pending_tokens;
  n = v->size;
  for (i=0; i<n; i++) {
    free_token(p, v->data[i]);
  }
  delete_pvector(v);
}
Beispiel #2
0
void print_egraph_congruence_roots(FILE *f, egraph_t *egraph) {
  uint32_t i, n;
  pvector_t v;

  init_pvector(&v, 10);
  collect_congruence_roots(&egraph->ctable, &v);
  n = v.size;
  if (n > 0) {
    fputs("--- Congruence roots ---\n", f);
    for (i=0; i<n; i++) {
      print_congruence_root(f, v.data[i]);
    }
  } else {
    fputs("--- Empty congruence table ---\n", f);
  }

  delete_pvector(&v);
}