Commit 1119ef8e authored by Kučera Petr RNDr. Ph.D.'s avatar Kučera Petr RNDr. Ph.D.
Browse files

Fixes in pccheck and pccompile

parent 4efb5e12
......@@ -110,12 +110,10 @@ dump_config(const config_t &conf, unsigned level)
SUBool::dump_enum_value(
"\t", level, "impl_system", conf.impl_system, SUBool::kImplSystemNames);
SUBool::logs.TLog(level) << "\tgoal: " << goal_name(conf) << std::endl;
SUBool::logs.DumpValue("\t", level, "amo_encoding",
SUBool::AmoEncoder::kEncodingNames.at(
static_cast<unsigned>(conf.amo_encoding)));
SUBool::logs.DumpValue("\t", level, "exone_encoding",
SUBool::ExOneEncoder::kEncodingNames.at(
static_cast<unsigned>(conf.exone_encoding)));
SUBool::AmoEncoder::kKindAnnotation.DumpValue(
"\t", level, "amo_encoding", conf.amo_encoding);
SUBool::ExOneEncoder::kKindAnnotation.DumpValue(
"\t", level, "exone_encoding", conf.exone_encoding);
SUBool::dump_enum_value(
"\t", level, "solver_type", conf.solver_type, SUBool::kSolverTypeNames);
SUBool::logs.TLog(level) << "END" << std::endl;
......@@ -330,16 +328,14 @@ parse_arguments(int argc, char *argv[], config_t &conf)
"repr = use the representation, "
"seq = use the sequential encoding.",
cxxopts::value<std::string>(amo_encoding)
->default_value(
SUBool::AmoEncoder::kEncodingNames[static_cast<unsigned>(
conf.amo_encoding)]))("exactly-one",
->default_value(SUBool::AmoEncoder::kKindAnnotation.Name(
conf.amo_encoding)))("exactly-one",
"Which encoding to use for the exactly-one constraint. "
"repr = use the representation, "
"split = use the splitting encoding.",
cxxopts::value<std::string>(exone_encoding)
->default_value(
SUBool::ExOneEncoder::kEncodingNames[static_cast<unsigned>(
conf.exone_encoding)]))("positional",
->default_value(SUBool::ExOneEncoder::kKindAnnotation.Name(
conf.exone_encoding)))("positional",
"Positional arguments: these are the arguments that are entered "
"without an option",
cxxopts::value<std::vector<std::string>>());
......@@ -374,10 +370,10 @@ parse_arguments(int argc, char *argv[], config_t &conf)
SUBool::AbsEncoder::ParseUPOneProve(up_one_prove);
conf.up_empower =
SUBool::enum_of_int<SUBool::PCEncoder::UP_EMPOWER>(up_empower);
conf.amo_encoding = SUBool::enum_of_name<SUBool::AmoEncoder::KIND>(
amo_encoding, SUBool::AmoEncoder::kEncodingNames);
conf.exone_encoding = SUBool::enum_of_name<SUBool::ExOneEncoder::KIND>(
exone_encoding, SUBool::ExOneEncoder::kEncodingNames);
conf.amo_encoding =
SUBool::AmoEncoder::kKindAnnotation.Parse(amo_encoding);
conf.exone_encoding =
SUBool::ExOneEncoder::kKindAnnotation.Parse(exone_encoding);
conf.impl_system = SUBool::enum_of_name<SUBool::LIT_IMPL_SYSTEM>(
impl_system, SUBool::kImplSystemNames);
if (SUBool::AbsEncoder::AbsConfig::OneProveRequiresImplSystem(
......
......@@ -180,12 +180,10 @@ dump_config(const config_t &conf, unsigned level)
<< "\tgoal: " << (conf.goal == GOAL::PC ? "PC" : "UC") << std::endl;
SUBool::logs.TLog(level) << "\tenc_conf:" << std::endl;
conf.comp_base_config.enc_conf.Dump("\t\t", level);
SUBool::logs.DumpValue("\t", level, "amo_encoding",
SUBool::AmoEncoder::kEncodingNames.at(
static_cast<unsigned>(conf.amo_encoding)));
SUBool::logs.DumpValue("\t", level, "exone_encoding",
SUBool::ExOneEncoder::kEncodingNames.at(
static_cast<unsigned>(conf.exone_encoding)));
SUBool::AmoEncoder::kKindAnnotation.DumpValue(
"\t", level, "amo_encoding", conf.amo_encoding);
SUBool::ExOneEncoder::kKindAnnotation.DumpValue(
"\t", level, "exone_encoding", conf.exone_encoding);
SUBool::logs.TLog(level) << "END" << std::endl;
}
......@@ -513,16 +511,14 @@ parse_arguments(int argc, char *argv[], config_t &conf)
"repr = use the representation, "
"seq = use the sequential encoding.",
cxxopts::value<std::string>(amo_encoding)
->default_value(
SUBool::AmoEncoder::kEncodingNames[static_cast<unsigned>(
conf.amo_encoding)]))("exactly-one",
->default_value(SUBool::AmoEncoder::kKindAnnotation.Name(
conf.amo_encoding)))("exactly-one",
"Which encoding to use for the exactly-one constraint. "
"repr = use the representation, "
"split = use the splitting encoding.",
cxxopts::value<std::string>(exone_encoding)
->default_value(
SUBool::ExOneEncoder::kEncodingNames[static_cast<unsigned>(
conf.exone_encoding)]));
->default_value(SUBool::ExOneEncoder::kKindAnnotation.Name(
conf.exone_encoding)));
options.parse_positional({"input", "output", "positional"});
auto result = options.parse(argc, argv);
if (result.count("help"))
......@@ -572,10 +568,10 @@ parse_arguments(int argc, char *argv[], config_t &conf)
SUBool::enum_of_name<SUBool::PCLearnComp::INITIAL_NEGATIVES>(
initial_negatives,
SUBool::PCLearnComp::cInitialNegativesNames);
conf.amo_encoding = SUBool::enum_of_name<SUBool::AmoEncoder::KIND>(
amo_encoding, SUBool::AmoEncoder::kEncodingNames);
conf.exone_encoding = SUBool::enum_of_name<SUBool::ExOneEncoder::KIND>(
exone_encoding, SUBool::ExOneEncoder::kEncodingNames);
conf.amo_encoding =
SUBool::AmoEncoder::kKindAnnotation.Parse(amo_encoding);
conf.exone_encoding =
SUBool::ExOneEncoder::kKindAnnotation.Parse(exone_encoding);
conf.comp_base_config.minimize_method =
SUBool::enum_of_name<SUBool::MINIMIZE_METHOD>(
minimize_method, SUBool::kMinimizeMethodNames);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment