Пример #1
0
/*
 * Copy the assignment of u[0 ... n-1] into a[0 ... n-1]
 */
static void pseudo_convert(uint32_t n, literal_t *u, literal_t *a) {
  uint32_t i;

  for (i=0; i<n; i++) {
    a[i] = eval_literal(remap_table_find(&remap, u[i]));
  }
}
Пример #2
0
/*
 * Print the literal mapped to s in the table
 * - if nothing is mapped to s, print "_"
 */
void dimacs_print_pseudo_literal(FILE *f, remap_table_t *table, literal_t s) {
  if (s != null_literal) {
    s = remap_table_find(table, s);
  }

  if (s == null_literal) {
    fputs("_", f);
  } else {
    dimacs_print_literal(f, s);
  }
}
Пример #3
0
/*
 * Pseudo literal s: print the literal mapped to s
 */
static void print_pseudo_literal(FILE *f, remap_table_t *table, literal_t s) {
  if (s != null_literal) {
    s = remap_table_find(table, s);
  }
  if (s == null_literal) {
    fputs("?", f);
  } else if (s == true_literal) {
    fputs("t", f);
  } else if (s == false_literal) {
    fputs("f", f);
  } else {
    if (is_neg(s)) fputc('~', f);
    fprintf(f, "p!%"PRId32, var_of(s));
  }
}