Exemple #1
0
static void *
btor_lingeling_init (BtorSATMgr * smgr)
{
  BtorLGL * res;
  if (smgr->verbosity >= 1) {
    lglbnr ("Lingeling", "[lingeling] ", stdout);
    fflush (stdout);
  }
  BTOR_CNEW (smgr->mm, res);
  res->lgl =  lglminit (smgr->mm,
			(lglalloc) btor_malloc,
			(lglrealloc) btor_realloc,
			(lgldealloc) btor_free);
  res->blimit = BTOR_LGL_MIN_BLIMIT;
  assert (res);
  if (smgr->optstr)
    btor_passdown_lingeling_options (smgr, smgr->optstr, res->lgl);
  return res;
}
static BtorSMTDumpContext *
new_smt_dump_context (Btor * btor, FILE * file)
{
  BtorSMTDumpContext * sdc;
  BTOR_CNEW (btor->mm, sdc);

  sdc->btor = btor;
  sdc->dump =
    btor_new_ptr_hash_table (btor->mm,
      (BtorHashPtr) btor_hash_exp_by_id,
      (BtorCmpPtr) btor_compare_exp_by_id);
  sdc->dumped =
    btor_new_ptr_hash_table (btor->mm,
      (BtorHashPtr) btor_hash_exp_by_id,
      (BtorCmpPtr) btor_compare_exp_by_id);
  sdc->boolean =
    btor_new_ptr_hash_table (btor->mm,
      (BtorHashPtr) btor_hash_exp_by_id,
      (BtorCmpPtr) btor_compare_exp_by_id);
  sdc->stores =
    btor_new_ptr_hash_table (btor->mm,
      (BtorHashPtr) btor_hash_exp_by_id,
      (BtorCmpPtr) btor_compare_exp_by_id);
  sdc->idtab =
    btor_new_ptr_hash_table (btor->mm,
      (BtorHashPtr) btor_hash_exp_by_id,
      (BtorCmpPtr) btor_compare_exp_by_id);
  sdc->const_cache =
    btor_new_ptr_hash_table (btor->mm,
      (BtorHashPtr) btor_hash_str,
      (BtorCmpPtr) strcmp);
  /* use pointer for hashing and comparison */
  sdc->roots = btor_new_ptr_hash_table (btor->mm, 0, 0);
  sdc->file = file;
  sdc->maxid = 1;
  sdc->pretty_print = btor->options.pretty_print.val;
  return sdc;
}