cryptominisat --hhelp
(注意额外的h
!)提供以下扩展帮助:
.....
--polar arg (=auto) {true,false,rnd,auto} Selects polarity
mode. 'true' -> selects only positive
polarity when branching. 'false' ->
selects only negative polarity when
brancing. 'auto' -> selects last
polarity used (also called 'caching')
.....
我习惯--polar=false
先让cryptominisat
搜索具有false/0
变量的解决方案,因为我的示例具有大多数解决方案变量。
在源代码中,这对应于solverconf.h
:
enum class PolarityMode {
polarmode_pos
, polarmode_neg
, polarmode_rnd
, polarmode_automatic
};
相应的SolverConf
变量是PolarityMode polarity_mode
main.cpp
显示了如何在程序中设置此配置属性:
if (vm.count("polar")) {
string mode = vm["polar"].as<string>();
if (mode == "true") conf.polarity_mode = polarmode_pos;
else if (mode == "false") conf.polarity_mode = polarmode_neg;
else if (mode == "rnd") conf.polarity_mode = polarmode_rnd;
else if (mode == "auto") conf.polarity_mode = polarmode_automatic;
else throw WrongParam(mode, "unknown polarity-mode");
}
其他 SAT 求解器使用类似phase
或的术语sign
。
Microsoft Z3可以先通过命令行参数化sat.phase=always_false
尝试false phase
。请参阅相关问题。实际上,我StackOverflow
在 2012 年提出的第一个问题。
Clasp使用命令行语法--sign-def=neg
优先false polarity
。