本文整理汇总了C++中Watched::isClause方法的典型用法代码示例。如果您正苦于以下问题:C++ Watched::isClause方法的具体用法?C++ Watched::isClause怎么用?C++ Watched::isClause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Watched
的用法示例。
在下文中一共展示了Watched::isClause方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: str_and_sub_using_watch
void DistillerLongWithImpl::str_and_sub_using_watch(
Clause& cl
, const Lit lit
, const bool alsoStrengthen
) {
//Go through the watchlist
watch_subarray thisW = solver->watches[lit];
timeAvailable -= (long)thisW.size()*2 + 5;
for(Watched* wit = thisW.begin(), *wend = thisW.end()
; wit != wend
; wit++
) {
//Can't do anything with a clause
if (wit->isClause())
continue;
timeAvailable -= 5;
if (alsoStrengthen) {
strengthen_clause_with_watch(lit, wit);
}
const bool subsumed = subsume_clause_with_watch(lit, wit, cl);
if (subsumed)
return;
}
}
示例2: redundant
bool CNF::redundant(const Watched& ws) const
{
return ( (ws.isBin() && ws.red())
|| (ws.isTri() && ws.red())
|| (ws.isClause()
&& cl_alloc.ptr(ws.get_offset())->red()
)
);
}
示例3: redundant
bool CNF::redundant(const Watched& ws) const
{
return ( (ws.isBinary() && ws.red())
|| (ws.isTri() && ws.red())
|| (ws.isClause()
&& clAllocator.getPointer(ws.getOffset())->red()
)
);
}
示例4: redundant_or_removed
bool CNF::redundant_or_removed(const Watched& ws) const
{
if (ws.isBin() || ws.isTri()) {
return ws.red();
}
assert(ws.isClause());
const Clause* cl = cl_alloc.ptr(ws.get_offset());
return cl->red() || cl->getRemoved();
}
示例5: redundant_or_removed
bool CNF::redundant_or_removed(const Watched& ws) const
{
if (ws.isBinary() || ws.isTri()) {
return ws.red();
}
assert(ws.isClause());
const Clause* cl = clAllocator.getPointer(ws.getOffset());
return cl->red() || cl->getRemoved();
}
示例6: find_pair_for_and_gate_reduction
ClOffset GateFinder::find_pair_for_and_gate_reduction(
const Watched& ws
, const size_t minSize
, const size_t maxSize
, const cl_abst_type general_abst
, const OrGate& gate
, const bool only_irred
) {
//Only long clauses
if (!ws.isClause())
return CL_OFFSET_MAX;
const ClOffset this_cl_offs = ws.get_offset();
Clause& this_cl = *solver->cl_alloc.ptr(this_cl_offs);
if ((ws.getAbst() | general_abst) != general_abst
|| (this_cl.red() && only_irred)
|| (!this_cl.red() && gate.red)
|| this_cl.size() > solver->conf.maxGateBasedClReduceSize
|| this_cl.size() > maxSize //Size must be smaller or equal to maxSize
|| this_cl.size() < minSize //Size must be larger or equal than minsize
|| sizeSortedOcc[this_cl.size()].empty()) //this bracket for sizeSortedOcc must be non-empty
{
//cout << "Not even possible, this clause cannot match any other" << endl;
return CL_OFFSET_MAX;
}
if (!check_seen_and_gate_against_cl(this_cl, gate))
return CL_OFFSET_MAX;
const cl_abst_type this_cl_abst = calc_abst_and_set_seen(this_cl, gate);
const ClOffset other_cl_offs = findAndGateOtherCl(
sizeSortedOcc[this_cl.size()] //in this occur list that contains clauses of specific size
, ~(gate.lit2) //this is the LIT that is meant to be in the clause
, this_cl_abst //clause MUST match this abst
, gate.red
, only_irred
);
//Clear 'seen' from bits set
*(simplifier->limit_to_decrease) -= this_cl.size();
for (const Lit lit: this_cl) {
seen[lit.toInt()] = 0;
}
return other_cl_offs;
}
示例7: prop_larger_than_bin_cl_dfs
Lit HyperEngine::prop_larger_than_bin_cl_dfs(
StampType stampType
, PropBy& confl
, Lit& root
, bool& restart
) {
PropResult ret = PROP_NOTHING;
const Lit p = toPropNorm.top();
watch_subarray ws = watches[~p];
propStats.bogoProps += 1;
Watched* i = ws.begin();
Watched* j = ws.begin();
Watched* end = ws.end();
for(; i != end; i++) {
propStats.bogoProps += 1;
if (i->isBin()) {
*j++ = *i;
continue;
}
if (i->isTri()) {
*j++ = *i;
ret = prop_tri_clause_with_acestor_info(i, p, confl);
if (ret == PROP_SOMETHING || ret == PROP_FAIL) {
i++;
break;
} else {
assert(ret == PROP_NOTHING);
continue;
}
}
if (i->isClause()) {
ret = prop_normal_cl_with_ancestor_info(i, j, p, confl);
if (ret == PROP_SOMETHING || ret == PROP_FAIL) {
i++;
break;
} else {
assert(ret == PROP_NOTHING);
continue;
}
}
}
while(i != end)
*j++ = *i++;
ws.shrink_(end-j);
switch(ret) {
case PROP_FAIL:
close_all_timestamps(stampType);
return analyzeFail(confl);
case PROP_SOMETHING:
propStats.bogoProps += 8;
stamp.stampingTime++;
#ifdef DEBUG_STAMPING
cout
<< "From (long-reduced) " << p << " enqueued << " << trail.back()
<< " for stamp.stampingTime " << stamp.stampingTime
<< endl;
#endif
stamp.tstamp[trail.back().toInt()].start[stampType] = stamp.stampingTime;
if (stampType == STAMP_IRRED) {
//Root for literals propagated afterwards will be this literal
root = trail.back();
toPropRedBin.push(trail.back());
}
toPropNorm.push(trail.back());
toPropBin.push(trail.back());
propStats.bogoProps += ws.size()*8;
restart = true;
return lit_Undef;
case PROP_NOTHING:
break;
default:
assert(false);
break;
}
//Finished with this literal
propStats.bogoProps += ws.size()*8;
toPropNorm.pop();
return lit_Undef;
}
示例8: propagate_bfs
//.........这里部分代码省略.........
; k != end
; k++
) {
//If something other than irred binary, skip
if (!k->isBin() || k->red())
continue;
ret = prop_bin_with_ancestor_info(p, k, confl);
if (ret == PROP_FAIL)
return analyzeFail(confl);
}
propStats.bogoProps += ws.size()*4;
}
//Propagate binary redundant
ret = PROP_NOTHING;
while (lBinQHead < trail.size()) {
const Lit p = trail[lBinQHead];
watch_subarray_const ws = watches[~p];
propStats.bogoProps += 1;
size_t done = 0;
for(const Watched *k = ws.begin(), *end = ws.end(); k != end; k++, done++) {
//If something other than redundant binary, skip
if (!k->isBin() || !k->red())
continue;
ret = prop_bin_with_ancestor_info(p, k, confl);
if (ret == PROP_FAIL) {
return analyzeFail(confl);
} else if (ret == PROP_SOMETHING) {
propStats.bogoProps += done*4;
goto start;
} else {
assert(ret == PROP_NOTHING);
}
}
lBinQHead++;
propStats.bogoProps += done*4;
}
ret = PROP_NOTHING;
while (qhead < trail.size()) {
const Lit p = trail[qhead];
watch_subarray ws = watches[~p];
propStats.bogoProps += 1;
Watched* i = ws.begin();
Watched* j = ws.begin();
Watched* end = ws.end();
for(; i != end; i++) {
if (i->isBin()) {
*j++ = *i;
continue;
}
if (i->isTri()) {
*j++ = *i;
ret = prop_tri_clause_with_acestor_info(i, p, confl);
if (ret == PROP_SOMETHING || ret == PROP_FAIL) {
i++;
break;
} else {
assert(ret == PROP_NOTHING);
continue;
}
}
if (i->isClause()) {
ret = prop_normal_cl_with_ancestor_info(i, j, p, confl);
if (ret == PROP_SOMETHING || ret == PROP_FAIL) {
i++;
break;
} else {
assert(ret == PROP_NOTHING);
continue;
}
}
}
propStats.bogoProps += ws.size()*4;
while(i != end)
*j++ = *i++;
ws.shrink_(end-j);
if (ret == PROP_FAIL) {
return analyzeFail(confl);
} else if (ret == PROP_SOMETHING) {
propStats.bogoProps += ws.size()*4;
goto start;
}
qhead++;
propStats.bogoProps += ws.size()*4;
}
return lit_Undef;
}