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

PCCAlgorithmOptions -> PCCompAlgorithmOptions

parent df0ff181
...@@ -43,8 +43,8 @@ struct config_t ...@@ -43,8 +43,8 @@ struct config_t
std::string output_file{}; std::string output_file{};
bool minimize{false}; bool minimize{false};
SUBool::MINIMIZE_METHOD minimize_method{SUBool::MINIMIZE_METHOD::FULL}; SUBool::MINIMIZE_METHOD minimize_method{SUBool::MINIMIZE_METHOD::FULL};
SUBool::PCCAlgorithmOptions::ALGORITHM algorithm{ SUBool::PCCompAlgorithmOptions::ALGORITHM algorithm{
SUBool::PCCAlgorithmOptions::kDefaultAlgorithm}; SUBool::PCCompAlgorithmOptions::kDefaultAlgorithm};
bool level_simplify{true}; // simplification at level increase bool level_simplify{true}; // simplification at level increase
unsigned verbosity{3}; // 0 means no output unsigned verbosity{3}; // 0 means no output
bool use_empty_initial_hypothesis{false}; // For PCLearnComp bool use_empty_initial_hypothesis{false}; // For PCLearnComp
...@@ -106,7 +106,7 @@ dump_config(const config_t &conf, unsigned level) ...@@ -106,7 +106,7 @@ dump_config(const config_t &conf, unsigned level)
<< "\tminimize: " << SUBool::bool_to_string(conf.minimize) << std::endl; << "\tminimize: " << SUBool::bool_to_string(conf.minimize) << std::endl;
SUBool::kMinimizeMethodAnnotation.DumpValue( SUBool::kMinimizeMethodAnnotation.DumpValue(
"\t", level, "minimize_method", conf.comp_base_config.minimize_method); "\t", level, "minimize_method", conf.comp_base_config.minimize_method);
SUBool::PCCAlgorithmOptions::kAlgorithmAnnotation.DumpValue( SUBool::PCCompAlgorithmOptions::kAlgorithmAnnotation.DumpValue(
"\t", level, "algorithm", conf.algorithm); "\t", level, "algorithm", conf.algorithm);
SUBool::logs.TLog(level) SUBool::logs.TLog(level)
<< "\tcomp_base_config.up_empower: " << "\tcomp_base_config.up_empower: "
...@@ -201,7 +201,7 @@ parse_arguments(int argc, char *argv[], config_t &conf) ...@@ -201,7 +201,7 @@ parse_arguments(int argc, char *argv[], config_t &conf)
SUBool::PrgOptions opts(true); SUBool::PrgOptions opts(true);
opts.SetHelpDesc(prg_help); opts.SetHelpDesc(prg_help);
opts.InputOutput(&conf.input_file, &conf.output_file); opts.InputOutput(&conf.input_file, &conf.output_file);
auto algorithm_opts = std::make_shared<SUBool::PCCAlgorithmOptions>(); auto algorithm_opts = std::make_shared<SUBool::PCCompAlgorithmOptions>();
opts.AddOptionsGroup(algorithm_opts); opts.AddOptionsGroup(algorithm_opts);
auto pclearncomp_opts = std::make_shared<SUBool::PCLearnCompOptions>(); auto pclearncomp_opts = std::make_shared<SUBool::PCLearnCompOptions>();
opts.AddOptionsGroup(pclearncomp_opts); opts.AddOptionsGroup(pclearncomp_opts);
...@@ -671,13 +671,13 @@ incremental_compiler(const config_t &conf, SUBool::CNF cnf) ...@@ -671,13 +671,13 @@ incremental_compiler(const config_t &conf, SUBool::CNF cnf)
switch (conf.algorithm) switch (conf.algorithm)
{ {
case SUBool::PCCAlgorithmOptions::ALGORITHM::INCREMENT_PC: case SUBool::PCCompAlgorithmOptions::ALGORITHM::INCREMENT_PC:
return std::make_shared<SUBool::PCComp>( return std::make_shared<SUBool::PCComp>(
std::move(cnf), std::move(a_conf)); std::move(cnf), std::move(a_conf));
case SUBool::PCCAlgorithmOptions::ALGORITHM::INCREMENT_URC_PC: case SUBool::PCCompAlgorithmOptions::ALGORITHM::INCREMENT_URC_PC:
interleave_pc = true; interleave_pc = true;
[[fallthrough]]; [[fallthrough]];
case SUBool::PCCAlgorithmOptions::ALGORITHM::INCREMENT_URC: case SUBool::PCCompAlgorithmOptions::ALGORITHM::INCREMENT_URC:
{ {
SUBool::UCComp::Config uc_conf(a_conf); SUBool::UCComp::Config uc_conf(a_conf);
uc_conf.interleave_pc = interleave_pc; uc_conf.interleave_pc = interleave_pc;
...@@ -707,7 +707,7 @@ learning_compiler(const config_t &conf, SUBool::CNF cnf) ...@@ -707,7 +707,7 @@ learning_compiler(const config_t &conf, SUBool::CNF cnf)
std::shared_ptr<SUBool::AbsComp> std::shared_ptr<SUBool::AbsComp>
compiler(const config_t &conf, SUBool::CNF cnf) compiler(const config_t &conf, SUBool::CNF cnf)
{ {
if (conf.algorithm == SUBool::PCCAlgorithmOptions::ALGORITHM::LEARNING) if (conf.algorithm == SUBool::PCCompAlgorithmOptions::ALGORITHM::LEARNING)
{ {
return learning_compiler(conf, std::move(cnf)); return learning_compiler(conf, std::move(cnf));
} }
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
#include "pc_opt.h" #include "pc_opt.h"
const SUBool::EnumAnnotation<SUBool::PCCAlgorithmOptions::ALGORITHM> const SUBool::EnumAnnotation<SUBool::PCCompAlgorithmOptions::ALGORITHM>
SUBool::PCCAlgorithmOptions::kAlgorithmAnnotation("ALGORITHM", SUBool::PCCompAlgorithmOptions::kAlgorithmAnnotation("ALGORITHM",
{// {//
{ALGORITHM::INCREMENT_PC, "incremental_pc", {ALGORITHM::INCREMENT_PC, "incremental_pc",
"heuristic algorithm based on incremental adding empowering " "heuristic algorithm based on incremental adding empowering "
...@@ -37,7 +37,7 @@ SUBool::minimize_method_opt() -> EnumOption<MINIMIZE_METHOD> ...@@ -37,7 +37,7 @@ SUBool::minimize_method_opt() -> EnumOption<MINIMIZE_METHOD>
"Minimization method", kDefaultMinimizeMethod); "Minimization method", kDefaultMinimizeMethod);
} }
SUBool::PCCAlgorithmOptions::PCCAlgorithmOptions() SUBool::PCCompAlgorithmOptions::PCCAlgorithmOptions()
: OptionsGroup("Algorithm Selection"), : OptionsGroup("Algorithm Selection"),
mAlgorithmOption(kAlgorithmAnnotation, "algorithm,a", mAlgorithmOption(kAlgorithmAnnotation, "algorithm,a",
"Algorithm used for compilation", kDefaultAlgorithm) "Algorithm used for compilation", kDefaultAlgorithm)
...@@ -46,7 +46,7 @@ SUBool::PCCAlgorithmOptions::PCCAlgorithmOptions() ...@@ -46,7 +46,7 @@ SUBool::PCCAlgorithmOptions::PCCAlgorithmOptions()
} }
bool bool
SUBool::PCCAlgorithmOptions::GetValues() SUBool::PCCompAlgorithmOptions::GetValues()
{ {
return mAlgorithmOption.GetValue(mAlgorithm); return mAlgorithmOption.GetValue(mAlgorithm);
} }
......
...@@ -20,7 +20,7 @@ namespace SUBool ...@@ -20,7 +20,7 @@ namespace SUBool
EnumOption<MINIMIZE_METHOD> minimize_method_opt(); EnumOption<MINIMIZE_METHOD> minimize_method_opt();
// Algorithm selection in pccompile // Algorithm selection in pccompile
class PCCAlgorithmOptions : public OptionsGroup class PCCompAlgorithmOptions : public OptionsGroup
{ {
public: public:
enum class ALGORITHM enum class ALGORITHM
...@@ -39,7 +39,7 @@ namespace SUBool ...@@ -39,7 +39,7 @@ namespace SUBool
ALGORITHM mAlgorithm{kDefaultAlgorithm}; ALGORITHM mAlgorithm{kDefaultAlgorithm};
public: public:
PCCAlgorithmOptions(); PCCompAlgorithmOptions();
virtual bool GetValues() override; virtual bool GetValues() override;
...@@ -71,7 +71,7 @@ namespace SUBool ...@@ -71,7 +71,7 @@ namespace SUBool
} // namespace SUBool } // namespace SUBool
inline auto inline auto
SUBool::PCCAlgorithmOptions::Algorithm() const -> ALGORITHM SUBool::PCCompAlgorithmOptions::Algorithm() const -> ALGORITHM
{ {
return mAlgorithm; return mAlgorithm;
} }
......
...@@ -51,14 +51,31 @@ LEARNING ALGORITHM ...@@ -51,14 +51,31 @@ LEARNING ALGORITHM
used as an initial list of negatives. (default: used as an initial list of negatives. (default:
all_empowering) all_empowering)
PREPROCESSING
-r, --preprocess arg Method of preprocessing. 0 = No
preprocessing. 1 = Minimize the formula before compilation.
2 = First make CNF prime with respect to
1-provability, then minimize. 3 = First make CNF
prime and then minimize. 4 = Only make CNF
prime with respect to 1-provability, no
minimization. 5 = Only make CNF prime, no minimization.
(default: 3)
--no-backbone-propagation
Do not perform backbone propagation before
preprocessing.
SOLVERS SOLVERS
--pccheck-solver arg Solver to be used for the PC check. glucose = --pccheck-solver arg Solver to be used for the PC check. glucose =
use glucose, kissat = use kissat. (default: use glucose, kissat = use kissat. (default:
glucose) glucose)
ONE PROVABILITY EMPOWEREMENT
-w, --empower arg What kind of encoding should be used for
empowerment.
ONE PROVABILITY
-1, --one-prove arg What kind of encoding should be used for -1, --one-prove arg What kind of encoding should be used for
1-provability. 1-provability.
...@@ -112,18 +129,6 @@ ONE PROVABILITY ...@@ -112,18 +129,6 @@ ONE PROVABILITY
of the logarithmic encoding is bounded to the of the logarithmic encoding is bounded to the
logarithm of the parameter rounded up. logarithm of the parameter rounded up.
(default: 0) (default: 0)
PREPROCESSING
-r, --preprocess arg Method of preprocessing. 0 = No
preprocessing. 1 = Minimize the formula before compilation.
2 = First make CNF prime with respect to
1-provability, then minimize. 3 = First make CNF
prime and then minimize. 4 = Only make CNF
prime with respect to 1-provability, no
minimization. 5 = Only make CNF prime, no minimization.
(default: 3)
--no-backbone-propagation
Do not perform backbone propagation before
preprocessing.
RANDOM PC CHECKS RANDOM PC CHECKS
-S, --seed arg Initial random seed. Current time is used, if -S, --seed arg Initial random seed. Current time is used, if
...@@ -140,10 +145,6 @@ RANDOM PC CHECKS ...@@ -140,10 +145,6 @@ RANDOM PC CHECKS
random negative example was successfully found. 0 random negative example was successfully found. 0
means no increase. (default: 1) means no increase. (default: 1)
EMPOWEREMENT
-w, --empower arg What kind of encoding should be used for
empowerment.
SIMPLIFICATION SIMPLIFICATION
......
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