From e09c25bd59dc0028064419c5600b3c0a75add89b Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Thu, 22 Nov 2012 16:34:24 +0000 Subject: [PATCH] remove grounding stub form lifted knowledge compilation. its hard to implement --- packages/CLPBN/horus/LiftedCircuit.cpp | 42 -------------------------- packages/CLPBN/horus/LiftedCircuit.h | 2 -- 2 files changed, 44 deletions(-) diff --git a/packages/CLPBN/horus/LiftedCircuit.cpp b/packages/CLPBN/horus/LiftedCircuit.cpp index b3f5a653a..fb7cbbfae 100644 --- a/packages/CLPBN/horus/LiftedCircuit.cpp +++ b/packages/CLPBN/horus/LiftedCircuit.cpp @@ -18,11 +18,6 @@ AndNode::weight (void) const { double lw = leftBranch_->weight(); double rw = rightBranch_->weight(); - if (Globals::logDomain) { -// cout << "andw1 = " << std::exp(lw + rw) << endl; - } else { -// cout << "andw2 = " << lw * rw << endl; - } return Globals::logDomain ? lw + rw : lw * rw; } @@ -251,10 +246,6 @@ LiftedCircuit::compile ( return; } - if (tryGrounding (follow, clauses)) { - return; - } - // assert (false); *follow = new CompilationFailedNode (clauses); } @@ -266,11 +257,8 @@ LiftedCircuit::tryUnitPropagation ( CircuitNode** follow, Clauses& clauses) { - // cout << "ALL CLAUSES:" << endl; - // Clause::printClauses (clauses); for (size_t i = 0; i < clauses.size(); i++) { if (clauses[i].isUnit()) { - // cout << clauses[i] << " is unit!" << endl; Clauses newClauses; for (size_t j = 0; j < clauses.size(); j++) { if (i != j) { @@ -557,36 +545,6 @@ LiftedCircuit::tryAtomCounting ( -bool -LiftedCircuit::tryGrounding ( - CircuitNode**, - Clauses&) -{ - return false; - /* - size_t bestClauseIdx = 0; - size_t bestLogVarIdx = 0; - unsigned minNrSymbols = Util::maxUnsigned(); - for (size_t i = 0; i < clauses.size(); i++) { - LogVarSet lvs = clauses[i].constr().logVars(); - ConstraintTree ct = clauses[i].constr(); - for (unsigned j = 0; j < lvs.size(); j++) { - unsigned nrSymbols = ct.nrSymbols (lvs[j]); - if (nrSymbols < minNrSymbols) { - minNrSymbols = nrSymbols; - bestClauseIdx = i; - bestLogVarIdx = j; - } - } - } - LogVar bestLogVar = clauses[bestClauseIdx].constr().logVars()[bestLogVarIdx]; - ConstraintTrees cts = clauses[bestClauseIdx].constr().ground (bestLogVar); - return true; - */ -} - - - void LiftedCircuit::shatterCountedLogVars (Clauses& clauses) { diff --git a/packages/CLPBN/horus/LiftedCircuit.h b/packages/CLPBN/horus/LiftedCircuit.h index b040af3c5..12af4d6ee 100644 --- a/packages/CLPBN/horus/LiftedCircuit.h +++ b/packages/CLPBN/horus/LiftedCircuit.h @@ -234,8 +234,6 @@ class LiftedCircuit bool tryAtomCounting (CircuitNode** follow, Clauses& clauses); - bool tryGrounding (CircuitNode** follow, Clauses& clauses); - void shatterCountedLogVars (Clauses& clauses); bool shatterCountedLogVarsAux (Clauses& clauses);