本文整理汇总了C++中param_descrs类的典型用法代码示例。如果您正苦于以下问题:C++ param_descrs类的具体用法?C++ param_descrs怎么用?C++ param_descrs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了param_descrs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: throw_unknown_parameter
void throw_unknown_parameter(symbol const & param_name, param_descrs const& d, symbol const & mod_name) {
if (mod_name == symbol::null) {
char const * new_name = get_new_param_name(param_name);
if (new_name) {
std::stringstream strm;
strm << "the parameter '" << param_name
<< "', invoke 'z3 -p' to obtain the new parameter list, and 'z3 -pp:" << new_name
<< "' for the full description of the parameter";
throw exception(strm.str());
}
else if (is_old_param_name(param_name)) {
std::stringstream strm;
strm << "unknown parameter '" << param_name
<< "', this is an old parameter name, invoke 'z3 -p' to obtain the new parameter list";
throw default_exception(strm.str());
}
else {
std::stringstream strm;
strm << "unknown parameter '" << param_name << "'\n";
strm << "Legal parameters are:\n";
d.display(strm, 2, false, false);
throw default_exception(strm.str());
}
}
else {
std::stringstream strm;
strm << "unknown parameter '" << param_name << "' ";
strm << "at module '" << mod_name << "'\n";
strm << "Legal parameters are:\n";
d.display(strm, 2, false, false);
throw default_exception(strm.str());
}
}
开发者ID:levnach,项目名称:z3,代码行数:33,代码来源:gparams.cpp
示例2: init_pdescrs
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
th_rewriter::get_param_descrs(p);
insert_timeout(p);
p.insert("print", CPK_BOOL, "(default: true) print the simplified term.");
p.insert("print_proofs", CPK_BOOL, "(default: false) print a proof showing the original term is equal to the resultant one.");
p.insert("print_statistics", CPK_BOOL, "(default: false) print statistics.");
}
开发者ID:CHolmes3,项目名称:z3,代码行数:7,代码来源:simplify_cmd.cpp
示例3: init_pdescrs
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
m_dl_ctx->get_dl_context().collect_params(p);
insert_timeout(p);
p.insert(":print-answer", CPK_BOOL, "(default: false) print answer instance(s) to query.");
p.insert(":print-certificate", CPK_BOOL, "(default: false) print certificate for reachability or non-reachability.");
p.insert(":print-statistics", CPK_BOOL, "(default: false) print statistics.");
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:7,代码来源:dl_cmds.cpp
示例4: collect_param_descrs
static void collect_param_descrs(param_descrs & d) {
d.insert("max_memory", CPK_UINT, "maximum amount of memory in megabytes", "4294967295","nnf");
d.insert("sk_hack", CPK_BOOL, "hack for VCC", "false","nnf");
d.insert("mode", CPK_SYMBOL, "NNF translation mode: skolem (skolem normal form), quantifiers (skolem normal form + quantifiers in NNF), full", "skolem","nnf");
d.insert("ignore_labels", CPK_BOOL, "remove/ignore labels in the input formula, this option is ignored if proofs are enabled", "false","nnf");
d.insert("skolemize", CPK_BOOL, "skolemize (existential force) quantifiers", "true","nnf");
}
开发者ID:killbug2004,项目名称:Snippets,代码行数:7,代码来源:nnf_params.hpp
示例5: get_default
std::string get_default(param_descrs const & d, symbol const & p, symbol const & m) {
if (!d.contains(p)) {
throw_unknown_parameter(p, d, m);
}
char const * r = d.get_default(p);
if (r == nullptr)
return "default";
return r;
}
开发者ID:levnach,项目名称:z3,代码行数:9,代码来源:gparams.cpp
示例6: timeout
void context_params::collect_param_descrs(param_descrs & d) {
d.insert("timeout", CPK_UINT, "default timeout (in milliseconds) used for solvers", "4294967295");
d.insert("well_sorted_check", CPK_BOOL, "type checker", "true");
d.insert("type_check", CPK_BOOL, "type checker (alias for well_sorted_check)", "true");
d.insert("auto_config", CPK_BOOL, "use heuristics to automatically select solver and configure it", "true");
d.insert("model_validate", CPK_BOOL, "validate models produced by solvers", "false");
d.insert("trace", CPK_BOOL, "trace generation for VCC", "false");
d.insert("trace_file_name", CPK_STRING, "trace out file name (see option 'trace')", "z3.log");
d.insert("debug_ref_count", CPK_BOOL, "debug support for AST reference counting", "false");
d.insert("smtlib2_compliant", CPK_BOOL, "enable/disable SMT-LIB 2.0 compliance", "false");
collect_solver_param_descrs(d);
}
开发者ID:Jornason,项目名称:z3,代码行数:12,代码来源:context_params.cpp
示例7: display_smt2
void display_smt2(std::ostream & out, char const* module, param_descrs& descrs) const {
svector<params::entry>::const_iterator it = m_entries.begin();
svector<params::entry>::const_iterator end = m_entries.end();
for (; it != end; ++it) {
if (!descrs.contains(it->first)) continue;
out << "(set-option :";
out << module << ".";
out << it->first;
switch (it->second.m_kind) {
case CPK_BOOL:
out << " " << (it->second.m_bool_value?"true":"false");
break;
case CPK_UINT:
out << " " <<it->second.m_uint_value;
break;
case CPK_DOUBLE:
out << " " << it->second.m_double_value;
break;
case CPK_NUMERAL:
out << " " << *(it->second.m_rat_value);
break;
case CPK_SYMBOL:
out << " " << symbol::mk_symbol_from_c_ptr(it->second.m_sym_value);
break;
case CPK_STRING:
out << " " << it->second.m_str_value;
break;
default:
UNREACHABLE();
break;
}
out << ")\n";
}
}
开发者ID:greatmazinger,项目名称:z3,代码行数:34,代码来源:params.cpp
示例8: validate_type
void validate_type(symbol const& name, char const* value, param_descrs const& d) {
param_kind k = d.get_kind(name);
std::stringstream strm;
char const* _value = value;
switch (k) {
case CPK_UINT:
for (; *value; ++value) {
if (!('0' <= *value && *value <= '9')) {
strm << "Expected values for parameter " << name
<< " is an unsigned integer. It was given argument '" << _value << "'";
throw default_exception(strm.str());
}
}
break;
case CPK_DOUBLE:
for (; *value; ++value) {
if (!('0' <= *value && *value <= '9') && *value != '.' && *value != '-' && *value != '/') {
strm << "Expected values for parameter " << name
<< " is a double. It was given argument '" << _value << "'";
throw default_exception(strm.str());
}
}
break;
case CPK_BOOL:
if (strcmp(value, "true") != 0 && strcmp(value, "false") != 0) {
strm << "Expected values for parameter " << name
<< " are 'true' or 'false'. It was given argument '" << value << "'";
throw default_exception(strm.str());
}
break;
default:
break;
}
}
开发者ID:levnach,项目名称:z3,代码行数:35,代码来源:gparams.cpp
示例9: set
void set(param_descrs const & d, symbol const & param_name, char const * value, symbol const & mod_name) {
param_kind k = d.get_kind(param_name);
params_ref & ps = get_params(mod_name);
if (k == CPK_INVALID) {
throw_unknown_parameter(param_name, d, mod_name);
}
else if (k == CPK_UINT) {
long val = strtol(value, nullptr, 10);
ps.set_uint(param_name, static_cast<unsigned>(val));
}
else if (k == CPK_DOUBLE) {
char * aux;
double val = strtod(value, &aux);
ps.set_double(param_name, val);
}
else if (k == CPK_BOOL) {
if (strcmp(value, "true") == 0) {
ps.set_bool(param_name, true);
}
else if (strcmp(value, "false") == 0) {
ps.set_bool(param_name, false);
}
else {
std::stringstream strm;
strm << "invalid value '" << value << "' for Boolean parameter '" << param_name << "'";
if (mod_name == symbol::null) {
strm << " at module '" << mod_name << "'";
}
throw default_exception(strm.str());
}
}
else if (k == CPK_SYMBOL) {
ps.set_sym(param_name, symbol(value));
}
else if (k == CPK_STRING) {
// There is no guarantee that (external) callers will not delete value after invoking gparams::set.
// I see two solutions:
// 1) Modify params_ref to create a copy of set_str parameters.
// This solution is not nice since we create copies and move the params_ref around.
// We would have to keep copying the strings.
// Moreover, when we use params_ref internally, the value is usually a static value.
// So, we would be paying this price for nothing.
// 2) "Copy" value by transforming it into a symbol.
// I'm using this solution for now.
ps.set_str(param_name, symbol(value).bare_str());
}
else {
std::stringstream strm;
strm << "unsupported parameter type '" << param_name << "'";
if (mod_name == symbol::null) {
strm << " at module '" << mod_name << "'";
}
throw exception(strm.str());
}
}
开发者ID:levnach,项目名称:z3,代码行数:55,代码来源:gparams.cpp
示例10: collect_param_descrs
static void collect_param_descrs(param_descrs & d) {
d.insert("max_memory", CPK_UINT, "maximum amount of memory in megabytes", "4294967295","rewriter");
d.insert("max_steps", CPK_UINT, "maximum number of steps", "4294967295","rewriter");
d.insert("flat", CPK_BOOL, "create nary applications for and,or,+,*,bvadd,bvmul,bvand,bvor,bvxor", "true","rewriter");
d.insert("push_ite_arith", CPK_BOOL, "push if-then-else over arithmetic terms.", "false","rewriter");
d.insert("push_ite_bv", CPK_BOOL, "push if-then-else over bit-vector terms.", "false","rewriter");
d.insert("pull_cheap_ite", CPK_BOOL, "pull if-then-else terms when cheap.", "false","rewriter");
d.insert("cache_all", CPK_BOOL, "cache all intermediate results.", "false","rewriter");
}
开发者ID:killbug2004,项目名称:Snippets,代码行数:9,代码来源:rewriter_params.hpp
示例11: validate
void validate(param_descrs const & p) const {
svector<params::entry>::const_iterator it = m_entries.begin();
svector<params::entry>::const_iterator end = m_entries.end();
for (; it != end; ++it) {
param_kind expected = p.get_kind(it->first);
if (expected == CPK_INVALID)
throw default_exception("unknown parameter '%s'", it->first.str().c_str());
if (it->second.m_kind != expected)
throw default_exception("parameter kind mismatch '%s'", it->first.str().c_str());
}
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:11,代码来源:params.cpp
示例12: validate
void validate(param_descrs const & p) {
svector<params::entry>::iterator it = m_entries.begin();
svector<params::entry>::iterator end = m_entries.end();
symbol suffix, prefix;
for (; it != end; ++it) {
param_kind expected = p.get_kind_in_module(it->first);
if (expected == CPK_INVALID) {
std::stringstream strm;
strm << "unknown parameter '" << it->first.str() << "'\n";
strm << "Legal parameters are:\n";
p.display(strm, 2, false, false);
throw default_exception(strm.str());
}
if (it->second.m_kind != expected &&
!(it->second.m_kind == CPK_UINT && expected == CPK_NUMERAL)) {
std::stringstream strm;
strm << "Parameter " << it->first.str() << " was given argument of type ";
strm << it->second.m_kind << ", expected " << expected;
throw default_exception(strm.str());
}
}
}
开发者ID:greatmazinger,项目名称:z3,代码行数:22,代码来源:params.cpp
示例13: insert_timeout
void insert_timeout(param_descrs & r) {
r.insert(":timeout", CPK_UINT, "(default: infty) timeout in milliseconds.");
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:3,代码来源:params.cpp
示例14: insert_produce_proofs
void insert_produce_proofs(param_descrs & r) {
r.insert(":produce-proofs", CPK_BOOL, "(default: false) proof generation.");
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:3,代码来源:params.cpp
示例15: insert_produce_models
void insert_produce_models(param_descrs & r) {
r.insert(":produce-models", CPK_BOOL, "(default: false) model generation.");
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:3,代码来源:params.cpp
示例16: insert_max_steps
void insert_max_steps(param_descrs & r) {
r.insert(":max-steps", CPK_UINT, "(default: infty) maximum number of steps.");
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:3,代码来源:params.cpp
示例17: insert_max_memory
void insert_max_memory(param_descrs & r) {
r.insert(":max-memory", CPK_UINT, "(default: infty) maximum amount of memory in megabytes.");
}
开发者ID:sukwon0709,项目名称:byterun,代码行数:3,代码来源:params.cpp
示例18: get_param_descrs
void bound_propagator::get_param_descrs(param_descrs & r) {
r.insert("bound_max_refinements", CPK_UINT, "(default: 16) maximum number of bound refinements (per round) for unbounded variables.");
r.insert("bound_threshold", CPK_DOUBLE, "(default: 0.05) bound propagation improvement threshold ratio.");
}
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:4,代码来源:bound_propagator.cpp
示例19: init_pdescrs
virtual void init_pdescrs(cmd_context & ctx, param_descrs & p) {
p.insert("weight", CPK_NUMERAL, "(default: 1) penalty of not satisfying constraint.");
p.insert("id", CPK_SYMBOL, "(default: null) partition identifier for soft constraints.");
}
开发者ID:AleksandarZeljic,项目名称:z3,代码行数:4,代码来源:opt_cmds.cpp
示例20: collect_param_descrs
static void collect_param_descrs(param_descrs & d) {
d.insert("asymm_branch", CPK_BOOL, "asymmetric branching", "true","sat");
d.insert("asymm_branch.rounds", CPK_UINT, "maximum number of rounds of asymmetric branching", "32","sat");
d.insert("asymm_branch.limit", CPK_UINT, "approx. maximum number of literals visited during asymmetric branching", "100000000","sat");
}
开发者ID:killbug2004,项目名称:Snippets,代码行数:5,代码来源:sat_asymm_branch_params.hpp
注:本文中的param_descrs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论