add inital smoothing of the circuit

This commit is contained in:
Tiago Gomes
2012-10-24 21:22:49 +01:00
parent 0cfc64d068
commit eac6b954a8
4 changed files with 295 additions and 81 deletions

View File

@@ -150,7 +150,7 @@ LiftedWCNF::LiftedWCNF (const ParfactorList& pfList)
{
addIndicatorClauses (pfList);
addParameterClauses (pfList);
printFormulasToIndicators();
printFormulaIndicators();
printClauses();
}
@@ -163,6 +163,31 @@ LiftedWCNF::~LiftedWCNF (void)
Clause
LiftedWCNF::createClauseForLiteral (LiteralId lid) const
{
for (size_t i = 0; i < clauses_.size(); i++) {
const Literals& literals = clauses_[i].literals();
for (size_t j = 0; j < literals.size(); j++) {
if (literals[j].lid() == lid) {
ConstraintTree* ct = new ConstraintTree (*clauses_[i].constr());
ct->project (literals[j].logVars());
Clause clause (ct);
clause.addLiteral (literals[j]);
return clause;
}
}
}
// FIXME
Clause c (new ConstraintTree({}));
c.addLiteral (Literal (lid,{}));
return c;
//assert (false);
//return Clause (0);
}
void
LiftedWCNF::addIndicatorClauses (const ParfactorList& pfList)
{
@@ -245,7 +270,7 @@ LiftedWCNF::printClauses (void) const
void
LiftedWCNF::printFormulasToIndicators (void) const
LiftedWCNF::printFormulaIndicators (void) const
{
set<PrvGroup> allGroups;
ParfactorList::const_iterator it = pfList_.begin();