Simplifies our computation so that preprocessed learned literals are those exactly appearing as top-level assertions only.
void PropEngine::assertInputFormulas(
const std::vector<Node>& assertions,
- std::unordered_map<size_t, Node>& skolemMap,
- const std::vector<Node>& ppl)
+ std::unordered_map<size_t, Node>& skolemMap)
{
Assert(!d_inCheckSat) << "Sat solver in solve()!";
- d_theoryProxy->notifyInputFormulas(assertions, skolemMap, ppl);
+ d_theoryProxy->notifyInputFormulas(assertions, skolemMap);
for (const Node& node : assertions)
{
Debug("prop") << "assertFormula(" << node << ")" << std::endl;
* @param skolemMap a map which says which skolem (if any) each assertion
* corresponds to. For example, if (ite C (= k a) (= k b)) is the i^th
* assertion, then skolemMap may contain the entry { i -> k }.
- * @param ppl the list of preprocessed learned literals
*/
void assertInputFormulas(const std::vector<Node>& assertions,
- std::unordered_map<size_t, Node>& skolemMap,
- const std::vector<Node>& ppl);
+ std::unordered_map<size_t, Node>& skolemMap);
/**
* Converts the given formula to CNF and assert the CNF to the SAT solver.
void TheoryProxy::notifyInputFormulas(
const std::vector<Node>& assertions,
- std::unordered_map<size_t, Node>& skolemMap,
- const std::vector<Node>& ppl)
+ std::unordered_map<size_t, Node>& skolemMap)
{
// notify the theory engine of preprocessed assertions
d_theoryEngine->notifyPreprocessedAssertions(assertions);
// determine what is learnable
if (d_zll != nullptr)
{
- d_zll->notifyInputFormulas(assertions, skolemMap, ppl);
+ d_zll->notifyInputFormulas(assertions, skolemMap);
}
}
* @param assertion The preprocessed input assertions,
* @param skolemMap Map from indices in assertion to the Skolem they are
* the definition for
- * @param ppl The preprocessed learned literals, that is, the literals that
- * hold at top-level, as computed by the circuit propagator.
*/
void notifyInputFormulas(const std::vector<Node>& assertions,
- std::unordered_map<size_t, Node>& skolemMap,
- const std::vector<Node>& ppl);
+ std::unordered_map<size_t, Node>& skolemMap);
/**
* Notify a lemma or input assertion, possibly corresponding to a skolem
* definition.
void ZeroLevelLearner::notifyInputFormulas(
const std::vector<Node>& assertions,
- std::unordered_map<size_t, Node>& skolemMap,
- const std::vector<Node>& ppl)
+ const std::unordered_map<size_t, Node>& skolemMap)
{
d_assertNoLearnCount = 0;
- // Copy the preprocessed assertions and skolem map information directly
- // Also, compute the set of literals in the preprocessed assertions
std::unordered_set<TNode> visited;
- // learned literals and d_ppnAtoms are disjoint
- for (const Node& lit : ppl)
+ // We consider top level literals of assertions to be the preprocessed
+ // learned literals only, and not the literals tracked by the preprocessor
+ // (Preprocessor::getLearnedLiterals). This means that a learned literal from
+ // e.g. circuit propagation that is not trivially a top level assertion will
+ // be considered an ordinary learned literal.
+ // Note that d_pplAtoms and d_ppnAtoms are disjoint
+ for (const Node& lit : assertions)
{
TNode atom = lit.getKind() == kind::NOT ? lit[0] : lit;
+ if (expr::isBooleanConnective(atom))
+ {
+ continue;
+ }
visited.insert(atom);
d_pplAtoms.insert(atom);
}
if (isOutputOn(OutputTag::LEARNED_LITS))
{
// output learned literals from preprocessing
- for (const Node& lit : ppl)
+ for (const Node& lit : d_pplAtoms)
{
output(OutputTag::LEARNED_LITS)
<< "(learned-lit " << SkolemManager::getOriginalForm(lit)
<< " :preprocess)" << std::endl;
}
}
+ // Compute the set of literals in the preprocessed assertions
for (const Node& a : assertions)
{
getAtoms(a, visited, d_ppnAtoms);
Trace("level-zero") << "Preprocess status:" << std::endl;
Trace("level-zero") << "#Non-learned lits = " << d_ppnAtoms.size()
<< std::endl;
- Trace("level-zero") << "#Learned lits = " << ppl.size() << std::endl;
+ Trace("level-zero") << "#Learned lits = " << d_pplAtoms.size() << std::endl;
Trace("level-zero") << "#Top level subs = "
<< d_env.getTopLevelSubstitutions().get().size()
<< std::endl;
~ZeroLevelLearner();
void notifyInputFormulas(const std::vector<Node>& assertions,
- std::unordered_map<size_t, Node>& skolemMap,
- const std::vector<Node>& ppl);
+ const std::unordered_map<size_t, Node>& skolemMap);
/**
* Notify the given literal was asserted
*/
{
d_env.verbose(2) << "converting to CNF..." << endl;
const std::vector<Node>& assertions = ap.ref();
- const std::vector<Node>& ppl = d_pp.getLearnedLiterals();
// It is important to distinguish the input assertions from the skolem
// definitions, as the decision justification heuristic treates the latter
- // specially.
+ // specially. Note that we don't pass the preprocess learned literals
+ // d_pp.getLearnedLiterals() here, since they may not exactly correspond
+ // to the actual preprocessed learned literals, as the input may have
+ // undergone further preprocessing.
preprocessing::IteSkolemMap& ism = ap.getIteSkolemMap();
- d_propEngine->assertInputFormulas(assertions, ism, ppl);
+ d_propEngine->assertInputFormulas(assertions, ism);
}
// clear the current assertions
; EXPECT: learned-lit
; EXPECT: learned-lit
; EXPECT: learned-lit
+; EXPECT: learned-lit
; EXPECT: sat
(set-logic ALL)
(declare-fun x () Int)