Exemplo n.º 1
0
// all elements of v should be in the same class: check wether that's true
// in the equality queue
static void check_good_class(test_bench_t *bench, int32_t *v) {
  active_poly_table_t *table;
  equality_queue_t *queue;
  polynomial_t *p;
  uint32_t i, n;
  int32_t k, x, y;

  queue = &bench->equeue;
  table = &bench->act;

  n = iv_size(v);
  assert(n >= 2);
  k = v[0];
  assert(0 <= k && k < table->npolys);
  x = table->id[k];

  for (i=1; i<n; i++) {
    k = v[i];
    assert(0 <= k && k < table->npolys);
    y = table->id[k];

    if (root_of_var(queue, x) != root_of_var(queue, y)) {
      printf("BUG: MISSED Propagation: x%"PRId32" and x%"PRId32" should be equal\n\n", x, y);
      printf("  act[%"PRId32"]: x%"PRId32, v[0], x);
      p = bench->ptable->poly[x];
      if (p != NULL) {
	printf(" = ");
	print_poly(p);
      }
      printf("\n");
      printf("  act[%"PRId32"]: x%"PRId32, k, y);
      p = bench->ptable->poly[y];
      if (p != NULL) {
	printf(" = ");
	print_poly(p);
      }
      printf("\n\n");
      print_all_equalities(bench);
      printf("  norm(x%"PRId32") = ", x);
      print_normal_form(bench->act.norm[v[0]]);
      printf("\n");
      printf("  norm(x%"PRId32") = ", y);
      print_normal_form(bench->act.norm[k]);
      printf("\n\n");
      fflush(stdout);
      exit(1);
    }
  }
}
Exemplo n.º 2
0
static void print_ptable(offset_manager_t *mngr) {
  offset_poly_table_t *table;
  uint32_t i, n;

  table = &mngr->ptable;
  printf("===== ptable ====\n");
  n = table->npolys;
  for (i=0; i<n; i++) {
    printf("poly[%"PRIu32"] := ", i);
    show_poly(table->def[i]);
    printf("        (eterm: t!%"PRId32, table->eterm[i]);
    printf(", active: ");
    print_flag(tst_bit(table->active, i));
    printf(", mark: ");
    print_flag(tst_bit(table->mark, i));
    printf(")\n");
    printf("   normal form: ");
    print_normal_form(&mngr->vtable, table->def[i]);
    printf("\n");
    printf("   vars: ");
    print_var_array(table->vars[i]);
    printf("\n");
  }
  printf("\n");
}
Exemplo n.º 3
0
static void print_normal_forms(test_bench_t *bench) {
  uint32_t i, n;
  int32_t idx;

  n = bench->act.npolys;
  for (i=0; i<n; i++) {
    idx = bench->act.id[i];
    printf("  norm(x%"PRId32") = ", idx);
    print_normal_form(bench->act.norm[i]);
    printf("\n");
  }
  printf("\n");
}