Public Member Functions | |
Clause () | |
Clause (const double &wt) | |
Clause (const Clause &c) | |
~Clause () | |
double | sizeMB () const |
void | compress () |
bool | same (Clause *const &c) |
size_t | hashCode () |
int | getNumPredicates () const |
double | getWt () const |
const double * | getWtPtr () const |
void | setWt (const double &wt) |
void | addWt (const double &wt) |
void | setDirty () |
bool | isDirty () const |
Predicate * | getPredicate (const int &idx) const |
const Array< Predicate * > * | getPredicates () const |
bool | containsPredicate (const Predicate *const &pred) const |
int | getNumVariables () const |
int | getNumVariablesAssumeCanonicalized () const |
bool | isHardClause () const |
void | setIsHardClause (const bool &b) |
bool | isLocked () const |
void | lock () |
void | unlock () |
void | appendPredicate (Predicate *const &p) |
Predicate * | removePredicate (const int &i) |
Removes a predicate from this clause. | |
bool | hasRedundantPredicates () |
returns true if this clause contains redundant predicates. | |
bool | removeRedundantPredicates () |
void | removeRedundantPredicatesAndCanonicalize () |
void | canonicalize (Array< int > *const &oldVarIdToNewVarId=NULL) |
bool | checkPredsAreConnected () |
void | canonicalizeWithoutVariables () |
AuxClauseData * | getAuxClauseData () const |
void | setAuxClauseData (AuxClauseData *const &acd) |
void | newAuxClauseData () |
bool | containsConstants () const |
void | trackConstants () |
void | newCache (const int &numDomains, const int &numPreds) |
void | translateConstants (const Domain *const &orig, const Domain *const &nnew) |
Array< Array< int > * > * | getTypeIdToVarIdsMapAndSmallestVarId (int &smallestVarId) |
ostream & | print (ostream &out, const Domain *const &domain, const bool &withWt, const bool &asInt, const bool &withStrVar) const |
ostream & | printAsInt (ostream &out) const |
ostream & | printWithoutWt (ostream &out, const Domain *const &domain) const |
ostream & | printWithoutWtWithStrVar (ostream &out, const Domain *const &domain) const |
ostream & | printWithWtAndStrVar (ostream &out, const Domain *const &domain) const |
ostream & | print (ostream &out, const Domain *const &domain) const |
ostream & | printWithoutWtWithStrVarAndPeriod (ostream &out, const Domain *const &domain) const |
void | addUnknownClauses (const Domain *const &domain, const Database *const &db, const int &gndPredIdx, const GroundPredicate *const &groundPred, const AddGroundClauseStruct *const &agcs) |
void | getUnknownClauses (const Domain *const &domain, const Database *const &db, const int &gndPredIdx, const GroundPredicate *const &groundPred, const Predicate *const &gndPred, Array< GroundClause * > *const &unknownGndClauses, Array< Clause * > *const &unknownClauses) |
bool | isSatisfiable (const Domain *const &domain, const Database *const &db, const bool &hasUnknownPreds) |
double | getNumGroundings (const Domain *const &domain) |
double | getNumTrueGroundings (const Domain *const &domain, const Database *const &db, const bool &hasUnknownPreds) |
void | getNumTrueUnknownGroundings (const Domain *const &domain, const Database *const &db, const bool &hasUnknownPreds, double &numTrue, double &numUnknown) |
double | getNumUnknownGroundings (const Domain *const &domain, const Database *const &db, const bool &hasUnknownPreds) |
void | getNumTrueFalseUnknownGroundings (const Domain *const &domain, const Database *const &db, const bool &hasUnknownPreds, double &numTrue, double &numFalse, double &numUnknown) |
double | countDiffNumTrueGroundings (Predicate *const &gndPred, const Domain *const &domain, Database *const &db, const bool &hasUnknownPreds, const bool &sampleClauses, const int &combo) |
bool | getActiveClauses (Predicate *const &gndPred, const Domain *const &domain, Array< GroundClause * > *const &activeGroundClauses, GroundPredicateHashArray *const &seenGndPreds, bool const &ignoreActivePreds) |
Retrieves active clauses unifying with the given predicate - if ignoreActivePreds is true, this is equivalent to getting all the unsatisfied clauses. | |
int | getActiveClauseCnt (Predicate *const &gndPred, const Domain *const &domain, bool const &ignoreActivePreds) |
double | getConstantTuples (const Domain *const &domain, const Database *const &db, Array< int > *const &mlnClauseTermIds, const Clause *const &varClause, PredicateTermToVariable *const &ptermToVar, ClauseToSuperClauseMap *const &clauseToSuperClause, bool useImplicit) |
void | addConstantTuple (const Domain *const &domain, const Database *const &db, const Clause *const &origClauseLits, Array< int > *const &constants, Array< Variable * > *const &eqVars, ClauseToSuperClauseMap *const &clauseToSuperClause, bool useImplicit) |
Array< int > * | updateToVarClause () |
void | removeAllPredicates () |
Static Public Member Functions | |
static void | computeFixedSizeB () |
static bool | moveTermsFromUnseenToSeen (Array< Term * > *const &terms, PredicateHashArray &unseenPreds, Array< Predicate * > &seenPreds) |
static void | setClauseSampler (ClauseSampler *const &cs) |
static const ClauseSampler * | getClauseSampler () |
static void | sortByLen (Array< Clause * > &ca) |
static string | getOpAsString (const int &op) |
Friends | |
class | ClauseSampler |
Definition at line 117 of file clause.h.
Predicate* Clause::removePredicate | ( | const int & | i | ) | [inline] |
Removes a predicate from this clause.
After removing a predicate, the clause is no longer canonicalized, so canonicalize() must be called.
i | Index of predicate to be removed. |
Definition at line 346 of file clause.h.
References Array< Type >::removeItemFastDisorder(), and setDirty().
Referenced by ClauseFactory::removePredicateFromClause().
00347 { 00348 if (0 <= i && i < predicates_->size()) 00349 { setDirty(); return predicates_->removeItemFastDisorder(i); } 00350 return NULL; 00351 }
bool Clause::getActiveClauses | ( | Predicate *const & | gndPred, | |
const Domain *const & | domain, | |||
Array< GroundClause * > *const & | activeGroundClauses, | |||
GroundPredicateHashArray *const & | seenGndPreds, | |||
bool const & | ignoreActivePreds | |||
) | [inline] |
Retrieves active clauses unifying with the given predicate - if ignoreActivePreds is true, this is equivalent to getting all the unsatisfied clauses.
Returns the groundClauses in activeGroundClauses
gndPred | Predicate with which clauses must unify. | |
domain | Domain in which the clauses occur | |
activeGroundClauses | Array to hold the retrieved clauses. | |
seenGndPreds | HashArray of seen ground predicates. | |
ignoreActivePreds | If true active predicates are ignored and only unsatisfied clauses are retrieved. |
Definition at line 2829 of file clause.h.
Referenced by VariableState::getActiveClauses(), and HVariableState::getActiveClauses().
02834 { 02835 int cnt = 0; 02836 bool getSatisfied = false; 02837 return getActiveClausesAndCnt(gndPred, domain, activeGroundClauses, cnt, 02838 seenGndPreds, ignoreActivePreds, getSatisfied); 02839 }