Exemple #1
0
cbmc_solverst::solvert* cbmc_solverst::get_dimacs()
{
  no_beautification();
  no_incremental_check();

  dimacs_cnft *prop=new dimacs_cnft();
  prop->set_message_handler(get_message_handler());

  std::string filename=options.get_option("outfile");

  return new solvert(new cbmc_dimacst(ns, *prop, filename), prop);
}
Exemple #2
0
std::unique_ptr<cbmc_solverst::solvert> cbmc_solverst::get_dimacs()
{
  no_beautification();
  no_incremental_check();

  auto prop=util_make_unique<dimacs_cnft>();
  prop->set_message_handler(get_message_handler());

  std::string filename=options.get_option("outfile");

  auto cbmc_dimacs=util_make_unique<cbmc_dimacst>(ns, *prop, filename);
  return util_make_unique<solvert>(std::move(cbmc_dimacs), std::move(prop));
}
Exemple #3
0
std::unique_ptr<cbmc_solverst::solvert> cbmc_solverst::get_smt1(
  smt1_dect::solvert solver)
{
  no_beautification();
  no_incremental_check();

  const std::string &filename=options.get_option("outfile");

  if(filename=="")
  {
    if(solver==smt1_dect::solvert::GENERIC)
    {
      error() << "please use --outfile" << eom;
      throw 0;
    }

    auto smt1_dec=
      util_make_unique<smt1_dect>(
        ns,
        "cbmc",
        "Generated by CBMC " CBMC_VERSION,
        "QF_AUFBV",
        solver);

    return util_make_unique<solvert>(std::move(smt1_dec));
  }
  else if(filename=="-")
  {
    auto smt1_conv=
      util_make_unique<smt1_convt>(
        ns,
        "cbmc",
        "Generated by CBMC " CBMC_VERSION,
        "QF_AUFBV",
        solver,
        std::cout);

    smt1_conv->set_message_handler(get_message_handler());

    return util_make_unique<solvert>(std::move(smt1_conv));
  }
  else
  {
    #ifdef _MSC_VER
    auto out=util_make_unique<std::ofstream>(widen(filename));
    #else
    auto out=util_make_unique<std::ofstream>(filename);
    #endif

    if(!out)
    {
      error() << "failed to open " << filename << eom;
      throw 0;
    }

    auto smt1_conv=
      util_make_unique<smt1_convt>(
        ns,
        "cbmc",
        "Generated by CBMC " CBMC_VERSION,
        "QF_AUFBV",
        solver,
        *out);

    smt1_conv->set_message_handler(get_message_handler());

    return util_make_unique<solvert>(std::move(smt1_conv), std::move(out));
  }
}
Exemple #4
0
cbmc_solverst::solvert* cbmc_solverst::get_smt1(smt1_dect::solvert solver)
{
  no_beautification();
  no_incremental_check();

  const std::string &filename=options.get_option("outfile");

  if(filename=="")
  {
    if(solver==smt1_dect::solvert::GENERIC)
    {
      error() << "please use --outfile" << eom;
      throw 0;
    }

    smt1_dect *smt1_dec=
      new smt1_dect(
        ns,
        "cbmc",
        "Generated by CBMC " CBMC_VERSION,
        "QF_AUFBV",
        solver);

    return new solvert(smt1_dec);
  }
  else if(filename=="-")
  {
    smt1_convt *smt1_conv=
      new smt1_convt(
        ns,
        "cbmc",
        "Generated by CBMC " CBMC_VERSION,
        "QF_AUFBV",
        solver,
        std::cout);

    smt1_conv->set_message_handler(get_message_handler());

    return new solvert(smt1_conv);
  }
  else
  {
    #ifdef _MSC_VER
    std::ofstream *out=new std::ofstream(widen(filename));
    #else
    std::ofstream *out=new std::ofstream(filename);
    #endif

    if(!out)
    {
      error() << "failed to open " << filename << eom;
      throw 0;
    }

    smt1_convt *smt1_conv=
      new smt1_convt(
        ns,
        "cbmc",
        "Generated by CBMC " CBMC_VERSION,
        "QF_AUFBV",
        solver,
        *out);

    smt1_conv->set_message_handler(get_message_handler());

    return new solvert(smt1_conv, out);
  }
}