本文整理汇总了C++中literalt::is_constant方法的典型用法代码示例。如果您正苦于以下问题:C++ literalt::is_constant方法的具体用法?C++ literalt::is_constant怎么用?C++ literalt::is_constant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类literalt
的用法示例。
在下文中一共展示了literalt::is_constant方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_frozen
void satcheck_glucose_simplifiert::set_frozen(literalt a)
{
if(!a.is_constant())
{
add_variables();
solver->setFrozen(a.var_no(), true);
}
}
示例2: assert
void satcheck_minisat2_baset<T>::set_assignment(literalt a, bool value)
{
assert(!a.is_constant());
unsigned v=a.var_no();
bool sign=a.sign();
// MiniSat2 kills the model in case of UNSAT
solver->model.growTo(v+1);
value^=sign;
solver->model[v]=Minisat::lbool(value);
}
示例3: l_get
tvt satcheck_precosatt::l_get(literalt a) const
{
if(a.is_constant())
return tvt(a.sign());
tvt result;
if(a.var_no()>solver->getMaxVar())
return tvt(tvt::tv_enumt::TV_UNKNOWN);
const int val=solver->val(precosat_lit(a));
if(val>0)
result=tvt(true);
else if(val<0)
result=tvt(false);
else
return tvt(tvt::tv_enumt::TV_UNKNOWN);
return result;
}
示例4: set_literal
void boolbv_mapt::set_literal(
const irep_idt &identifier,
const unsigned bit,
const typet &type,
literalt literal)
{
assert(literal.is_constant() ||
literal.var_no()<prop.no_variables());
map_entryt &map_entry=get_map_entry(identifier, type);
assert(bit<map_entry.literal_map.size());
if(map_entry.literal_map[bit].is_set)
{
prop.set_equal(map_entry.literal_map[bit].l, literal);
return;
}
map_entry.literal_map[bit].is_set=true;
map_entry.literal_map[bit].l=literal;
}
示例5: is_eliminated
bool satcheck_minisat_simplifiert::is_eliminated(literalt a) const
{
assert(!a.is_constant());
return solver->isEliminated(a.var_no());
}
示例6: set_frozen
void satcheck_minisat_simplifiert::set_frozen(literalt a)
{
assert(!a.is_constant());
add_variables();
solver->setFrozen(a.var_no(), true);
}
示例7: is_in_conflict
/// Returns true if an assumed literal is in conflict if the formula is UNSAT.
///
/// NOTE: if the literal is not in the assumption it causes an
/// assertion failure in lingeling.
bool satcheck_lingelingt::is_in_conflict(literalt a) const
{
assert(!a.is_constant());
return lglfailed(solver, a.dimacs())!=0;
}
示例8: set_frozen
void satcheck_lingelingt::set_frozen(literalt a)
{
if(!a.is_constant())
lglfreeze(solver, a.dimacs());
}
示例9:
void bv_refinementt::approximationt::add_under_assumption(literalt l)
{
// if it's a constant already, give up
if(!l.is_constant())
under_assumptions.push_back(l);
}