Public Member Functions | |
Database (Domain *const &d, const Array< bool > &closedWorld, const bool &storeGndPreds) | |
Database (const Database &db) | |
~Database () | |
void | compress () |
void | printInfo () |
void | setLazyFlag () |
void | setLazyFlag (const bool &lf) |
bool | setPerformingInference (bool pi) |
const Domain * | getDomain () const |
TruthValue | getValue (const Predicate *const &pred) const |
Get the truth value of a predicate in this database. | |
TruthValue | getValue (const GroundPredicate *const &pred) const |
Get the truth value of a predicate (in GroundPredicate representation) in this database. | |
bool | getActiveStatus (const Predicate *const &pred) const |
Get the active status of a predicate in this database. | |
bool | getActiveStatus (const GroundPredicate *const &pred) const |
Get the active status of a predicate (in GroundPredicate representation) in this database. | |
bool | getDeactivatedStatus (const Predicate *const &pred) const |
Get the deactivated status of a predicate in this database. | |
bool | getDeactivatedStatus (const GroundPredicate *const &pred) const |
Get the deactivated status of a predicate (in GroundPredicate representation) in this database. | |
bool | getEvidenceStatus (const Predicate *const &pred) const |
Get the evidence status of a predicate in this database. | |
bool | getEvidenceStatus (const GroundPredicate *const &pred) const |
Get the evidence status of a predicate (in GroundPredicate representation) in this database. | |
string | getValueAsString (const Predicate *const &pred) const |
TruthValue | setValue (const Predicate *const &pred, const TruthValue &tv) |
Sets the value of a predicate in this database. | |
TruthValue | setValue (const GroundPredicate *const &pred, const TruthValue &tv) |
Sets the value of a predicate (in GroundPredicate representation) in this database. | |
TruthValue | flipValue (const Predicate *const &pred) |
Flips the value of a predicate in this database. | |
TruthValue | flipValue (const GroundPredicate *const &pred) |
Flips the value of a predicate (in GroundPredicate representation) in this database. | |
bool | setActiveStatus (const Predicate *const &pred, const bool &as) |
Sets the active status of a predicate in this database. | |
bool | setActiveStatus (const GroundPredicate *const &pred, const bool &as) |
Sets the active status of a predicate (in GroundPredicate representation) in this database. | |
void | resetActiveStatus () |
bool | setDeactivatedStatus (const Predicate *const &pred, const bool &das) |
Sets the deactivated status of a predicate in this database. | |
bool | setDeactivatedStatus (const GroundPredicate *const &pred, const bool &das) |
Sets the deactivated status of a predicate (in GroundPredicate representation) in this database. | |
void | resetDeactivatedStatus () |
bool | setEvidenceStatus (const Predicate *const &pred, const bool &es) |
Sets the evidence status of a predicate in this database. | |
bool | setEvidenceStatus (const GroundPredicate *const &pred, const bool &es) |
Sets the evidence status of a predicate (in GroundPredicate representation) in this database. | |
void | setValuesToUnknown (const Array< Predicate * > *const &gndPreds, Array< TruthValue > *const &prevValues) |
void | setValuesToUnknown (const GroundPredicateHashArray *const &gndPreds, Array< TruthValue > *const &prevValues) |
void | setValuesToGivenValues (const Array< Predicate * > *const &gndPreds, const Array< TruthValue > *const &values) |
void | setValuesToGivenValues (const GroundPredicateHashArray *const &gndPreds, const Array< TruthValue > *const &values) |
void | alterTruthValue (const Array< Predicate * > *const &gndPreds, const TruthValue &tobeAlteredVal, const TruthValue &newVal, Array< TruthValue > *const &gndPredValues) |
void | addEvidenceGroundPredicate (Predicate *const &pred) |
void | addPredToEvidenceIndex (Predicate *const &pred, const bool &sense) |
Adds a grounding to the evidence inverted index. | |
int | getNumGroundings (const int &predId) const |
int | getNumEvidenceGndPreds (const int &predId) const |
int | getNumTrueGndPreds (const int &predId) const |
int | getNumFalseGndPreds (const int &predId) const |
int | getNumUnknownGndPreds (const int &predId) const |
int | getNumPredIds () const |
bool | isClosedWorld (const int &predId) const |
void | setClosedWorld (const int &predId, const bool &b) |
const Array< bool > & | getClosedWorld () const |
void | getTrueGndings (int predId, Array< Predicate * > *const &indexedGndings) |
Gets true groundings of a predicate. | |
void | getIndexedGndings (Array< Predicate * > *const &indexedGndings, Predicate *const &pred, bool const &ignoreActivePreds, bool const &trueGndings) |
Retrieves indexed groundings of a predicate. | |
void | changeConstantsToNewIds (hash_map< int, int > &oldToNewConstIds) |
Reindexes all predicates with new constant ids. | |
Static Public Member Functions | |
static bool | sameTruthValueAndSense (const TruthValue &tv, const bool &sense) |
Definition at line 123 of file database.h.
TruthValue Database::setValue | ( | const Predicate *const & | pred, | |
const TruthValue & | tv | |||
) | [inline] |
Sets the value of a predicate in this database.
Caller is responsible for deleting pred.
flip | If true, value of predicate is flipped. | |
ttv | TruthValue to which the predicate is set (This is ignored if flip is true) |
Definition at line 618 of file database.h.
Referenced by addEvidenceGroundPredicate(), alterTruthValue(), Clause::countDiffNumTrueGroundings(), RRF::getExactZ(), RRF::getLogPseudoLikelihood(), VariableState::saveLowStateToDB(), HVariableState::saveLowStateToDB(), VariableState::setAsEvidence(), VariableState::setValueOfAtom(), HVariableState::setValueOfAtom(), setValuesToGivenValues(), and setValuesToUnknown().
TruthValue Database::setValue | ( | const GroundPredicate *const & | pred, | |
const TruthValue & | tv | |||
) | [inline] |
Sets the value of a predicate (in GroundPredicate representation) in this database.
Caller is responsible for deleting pred.
flip | If true, value of predicate is flipped. | |
ttv | TruthValue to which the predicate is set (This is ignored if flip is true) |
Definition at line 631 of file database.h.
TruthValue Database::flipValue | ( | const Predicate *const & | pred | ) | [inline] |
Flips the value of a predicate in this database.
Caller is responsible for deleting pred.
Definition at line 642 of file database.h.
TruthValue Database::flipValue | ( | const GroundPredicate *const & | pred | ) | [inline] |
Flips the value of a predicate (in GroundPredicate representation) in this database.
Caller is responsible for deleting pred.
Definition at line 651 of file database.h.
bool Database::setActiveStatus | ( | const Predicate *const & | pred, | |
const bool & | as | |||
) | [inline] |
Sets the active status of a predicate in this database.
Caller is responsible for deleting pred.
Definition at line 660 of file database.h.
References getEvidenceStatus(), Predicate::getId(), and Predicate::isEqualPredWithType().
Referenced by VariableState::activateAtom(), HVariableState::activateAtom(), VariableState::fixAtom(), HVariableState::fixAtom(), HVariableState::HVariableState(), VariableState::setActive(), setActiveStatus(), and VariableState::VariableState().
00661 { 00662 if (dbdebug >= 1) cout << "Calling database::setActiveStatus" << endl; 00663 if (pred->isEqualPredWithType()) 00664 { 00665 if (dbdebug >= 1) cout << "Returning false" << endl; 00666 return false; 00667 } 00668 // Active preds can not be evidence 00669 if (as) assert(!getEvidenceStatus(pred)); 00670 00671 assert(lazyFlag_); 00672 assert(((Predicate*)pred)->isGrounded()); 00673 00674 int predId = pred->getId(); 00675 unsigned long long idx = getIdxOfGndPredValues(pred); 00676 return setActiveStatus(idx, predId, as, pred, NULL); 00677 }
bool Database::setActiveStatus | ( | const GroundPredicate *const & | pred, | |
const bool & | as | |||
) | [inline] |
Sets the active status of a predicate (in GroundPredicate representation) in this database.
Caller is responsible for deleting pred.
Definition at line 685 of file database.h.
References getEvidenceStatus(), GroundPredicate::getId(), and setActiveStatus().
00686 { 00687 if (dbdebug >= 1) cout << "Calling database::setActiveStatus" << endl; 00688 // Active preds can not be evidence 00689 if (as) assert(!getEvidenceStatus(pred)); 00690 assert(lazyFlag_); 00691 00692 int predId = pred->getId(); 00693 unsigned long long idx = getIdxOfGndPredValues(pred); 00694 return setActiveStatus(idx, predId, as, NULL, pred); 00695 }
bool Database::setDeactivatedStatus | ( | const Predicate *const & | pred, | |
const bool & | das | |||
) | [inline] |
Sets the deactivated status of a predicate in this database.
Caller is responsible for deleting pred.
Definition at line 710 of file database.h.
References getEvidenceStatus(), Predicate::getId(), and Predicate::isEqualPredWithType().
Referenced by setDeactivatedStatus().
00711 { 00712 if (dbdebug >= 1) cout << "Calling database::setDeactivatedStatus" << endl; 00713 if (pred->isEqualPredWithType()) 00714 { 00715 if (dbdebug >= 1) cout << "Returning false" << endl; 00716 return false; 00717 } 00718 //deactivated preds can not be evidence 00719 if (das) assert(!getEvidenceStatus(pred)); 00720 00721 assert(lazyFlag_); 00722 assert(((Predicate*)pred)->isGrounded()); 00723 00724 int predId = pred->getId(); 00725 unsigned long long idx = getIdxOfGndPredValues(pred); 00726 return setDeactivatedStatus(idx, predId, das); 00727 }
bool Database::setDeactivatedStatus | ( | const GroundPredicate *const & | pred, | |
const bool & | das | |||
) | [inline] |
Sets the deactivated status of a predicate (in GroundPredicate representation) in this database.
Caller is responsible for deleting pred.
Definition at line 735 of file database.h.
References getEvidenceStatus(), GroundPredicate::getId(), and setDeactivatedStatus().
00737 { 00738 if (dbdebug >= 1) cout << "Calling database::setDeactivatedStatus" << endl; 00739 // Deactivated preds can not be evidence 00740 if (das) assert(!getEvidenceStatus(pred)); 00741 assert(lazyFlag_); 00742 00743 int predId = pred->getId(); 00744 unsigned long long idx = getIdxOfGndPredValues(pred); 00745 return setDeactivatedStatus(idx, predId, das); 00746 }
bool Database::setEvidenceStatus | ( | const Predicate *const & | pred, | |
const bool & | es | |||
) | [inline] |
Sets the evidence status of a predicate in this database.
Caller is responsible for deleting pred.
Definition at line 761 of file database.h.
References getActiveStatus(), Predicate::getId(), and Predicate::isEqualPredWithType().
Referenced by addEvidenceGroundPredicate(), VariableState::setAsQuery(), and setEvidenceStatus().
00762 { 00763 if (dbdebug >= 1) cout << "Calling database::setEvidenceStatus" << endl; 00764 if (pred->isEqualPredWithType()) 00765 { 00766 if (dbdebug >= 1) cout << "Returning true" << endl; 00767 return true; 00768 } 00769 //active preds can not be evidence 00770 if (es) assert(!getActiveStatus(pred)); 00771 00772 assert(lazyFlag_); 00773 assert(((Predicate*)pred)->isGrounded()); 00774 00775 int predId = pred->getId(); 00776 unsigned long long idx = getIdxOfGndPredValues(pred); 00777 return setEvidenceStatus(idx, predId, es); 00778 }
bool Database::setEvidenceStatus | ( | const GroundPredicate *const & | pred, | |
const bool & | es | |||
) | [inline] |
Sets the evidence status of a predicate (in GroundPredicate representation) in this database.
Caller is responsible for deleting pred.
Definition at line 786 of file database.h.
References getActiveStatus(), GroundPredicate::getId(), and setEvidenceStatus().
00787 { 00788 if (dbdebug >= 1) cout << "Calling database::setEvidenceStatus" << endl; 00789 // Active preds can not be evidence 00790 if (es) assert(!getActiveStatus(pred)); 00791 assert(lazyFlag_); 00792 00793 int predId = pred->getId(); 00794 unsigned long long idx = getIdxOfGndPredValues(pred); 00795 return setEvidenceStatus(idx, predId, es); 00796 }
void Database::addPredToEvidenceIndex | ( | Predicate *const & | pred, | |
const bool & | sense | |||
) | [inline] |
Adds a grounding to the evidence inverted index.
Assumption is that evidence groundings have already been added to the db so their truth values can bee looked up.
pred | Predicate* being added to the inverted index. | |
sense | If true, grounding occurs as pos. literal in clause; otherwise, it occurs as neg. literal. |
Definition at line 888 of file database.h.
References getValue().
00889 { 00890 TruthValue tv = getValue(pred); 00891 unsigned long long idx = getIdxOfGndPredValues(pred); 00892 // Occurs as pos. lit. and false evidence 00893 if (sense && tv == FALSE) 00894 addToInvertedIndex(pred, idx, F_INDEX); 00895 // Occurs as neg. lit. and true evidence 00896 else if (!sense && tv == TRUE) 00897 addToInvertedIndex(pred, idx, T_INDEX); 00898 }
Gets true groundings of a predicate.
predId | Id of predicate whose true groundings are being retrieved. | |
indexedGndings | True groundings are put here |
Definition at line 1010 of file database.h.
References Array< Type >::append(), and Domain::getPredicateTemplate().
01011 { 01012 // True gndings from truePredIdxSet_ 01013 LongLongHashSet::const_iterator it = (*truePredIdxSet_)[predId].begin(); 01014 for (; it != (*truePredIdxSet_)[predId].end(); it++) { 01015 Predicate* p = getPredFromIdx((*it), domain_->getPredicateTemplate(predId)); 01016 indexedGndings->append(p); 01017 } 01018 }
void Database::getIndexedGndings | ( | Array< Predicate * > *const & | indexedGndings, | |
Predicate *const & | pred, | |||
bool const & | ignoreActivePreds, | |||
bool const & | trueGndings | |||
) | [inline] |
Retrieves indexed groundings of a predicate.
The indexed groundings are the true (and false and active) groundings of the (possibly partially grounded) predicate. Caller should delete indexedGndings and elements of indexedGndings, if necessary.
indexedGndings | Groundings found are appended here. | |
pred | Predicate whose groundings are found. | |
ignoreActivePreds | If true, only true groundings are retrieved; otherwise, groundings which are false and active are retrieved as well. | |
trueGndings | If true, true indexed groundings are retrieved; otherwise, false ones are retrieved. |
Definition at line 1033 of file database.h.
References Array< Type >::append(), Predicate::containsConstants(), Predicate::createAllGroundings(), getActiveStatus(), Term::getId(), Predicate::getId(), Predicate::getNumTerms(), Predicate::getTemplate(), Predicate::getTerm(), getValue(), Predicate::isGrounded(), and Array< Type >::size().
01037 { 01038 int predId = pred->getId(); 01039 // All terms are grounded: just return itself 01040 if (pred->isGrounded()) 01041 { 01042 // Check if pred is true/false or, if getting active preds, active 01043 TruthValue tv = getValue(pred); 01044 if ((trueGndings && tv == TRUE) || 01045 (!trueGndings && tv == FALSE) || 01046 (!ignoreActivePreds && getActiveStatus(pred))) 01047 { 01048 Predicate* p = new Predicate(*pred); 01049 indexedGndings->append(p); 01050 } 01051 return; 01052 } 01053 01054 // No terms are grounded: Return activePredIdxSet_ and 01055 // truePredIdxSet_ / falsePredIdxSet_ 01056 if (!pred->containsConstants()) 01057 { 01058 if (trueGndings) 01059 { 01060 // True gndings from truePredIdxSet_ 01061 LongLongHashSet::const_iterator it = (*truePredIdxSet_)[predId].begin(); 01062 for (; it != (*truePredIdxSet_)[predId].end(); it++) 01063 { 01064 Predicate* p = getPredFromIdx((*it), pred->getTemplate()); 01065 indexedGndings->append(p); 01066 } 01067 } 01068 else 01069 { 01070 if (closedWorld_[predId]) 01071 { 01072 // False groundings is the complement of truePredIdxSet_ 01073 // Generate all groundings and omit true ones 01074 Array<Predicate*> predArr; 01075 Predicate::createAllGroundings(predId, domain_, predArr); 01076 int numPreds = predArr.size(); 01077 for (int i = 0; i < numPreds; i++) 01078 { 01079 Predicate* newPred = predArr[i]; 01080 // Check if in true groundings 01081 LongLongHashSet::const_iterator it; 01082 if ((it = (*truePredIdxSet_)[predId].find(i)) != 01083 (*truePredIdxSet_)[predId].end()) 01084 delete newPred; 01085 else 01086 indexedGndings->append(newPred); 01087 } 01088 } 01089 else 01090 { 01091 LongLongHashSet::const_iterator it = 01092 (*falsePredIdxSet_)[predId].begin(); 01093 for (; it != (*falsePredIdxSet_)[predId].end(); it++) 01094 { 01095 Predicate* p = getPredFromIdx((*it), pred->getTemplate()); 01096 indexedGndings->append(p); 01097 } 01098 } 01099 } 01100 // active gndings from activePredIdxSet_ 01101 if (!ignoreActivePreds) 01102 { 01103 // Active gndings from activePredIdxSet_ 01104 LongLongHashSet::const_iterator ait = 01105 (*activePredIdxSet_)[predId].begin(); 01106 for (; ait != (*activePredIdxSet_)[predId].end(); ait++) 01107 { 01108 Predicate* p = getPredFromIdx((*ait), pred->getTemplate()); 01109 indexedGndings->append(p); 01110 } 01111 } 01112 return; 01113 } 01114 01115 // Not all terms are grounded: Compute intersection of index sets 01116 assert(predId < trueEvIndex_->size()); 01117 assert(predId < falseEvIndex_->size()); 01118 // Only true OR false gndings are retrieved 01119 set<unsigned long long> trueOrFalseIntersection; 01120 set<unsigned long long> activeIntersection; 01121 bool initial = true; 01122 // For each constant, retrieve the groundings and merge them 01123 for (int term = 0; term < pred->getNumTerms(); term++) 01124 { 01125 int constantId = pred->getTerm(term)->getId(); 01126 // If at a variable, do nothing 01127 if (constantId < 0) continue; 01128 pair<unsigned int, unsigned int> placeAndConstant(term, constantId); 01129 // True index 01130 if (initial) 01131 { 01132 if (trueGndings) 01133 trueOrFalseIntersection = ((*trueEvIndex_)[predId])[placeAndConstant]; 01134 else 01135 trueOrFalseIntersection = 01136 ((*falseEvIndex_)[predId])[placeAndConstant]; 01137 } 01138 else 01139 { 01140 set<unsigned long long> tmpTrueOrFalseIntersection; 01141 if (trueGndings) 01142 set_intersection(trueOrFalseIntersection.begin(), 01143 trueOrFalseIntersection.end(), 01144 ((*trueEvIndex_)[predId])[placeAndConstant].begin(), 01145 ((*trueEvIndex_)[predId])[placeAndConstant].end(), 01146 inserter(tmpTrueOrFalseIntersection, 01147 tmpTrueOrFalseIntersection.begin())); 01148 else 01149 set_intersection(trueOrFalseIntersection.begin(), 01150 trueOrFalseIntersection.end(), 01151 ((*falseEvIndex_)[predId])[placeAndConstant].begin(), 01152 ((*falseEvIndex_)[predId])[placeAndConstant].end(), 01153 inserter(tmpTrueOrFalseIntersection, 01154 tmpTrueOrFalseIntersection.begin())); 01155 trueOrFalseIntersection = tmpTrueOrFalseIntersection; 01156 //cout << "db size " << trueOrFalseIntersection.size() << endl; 01157 } 01158 // Active index 01159 if (!ignoreActivePreds) 01160 { 01161 if (initial) 01162 activeIntersection = ((*activeIndex_)[predId])[placeAndConstant]; 01163 else 01164 { 01165 set<unsigned long long> tmpActiveIntersection; 01166 set_intersection(activeIntersection.begin(), 01167 activeIntersection.end(), 01168 ((*activeIndex_)[predId])[placeAndConstant].begin(), 01169 ((*activeIndex_)[predId])[placeAndConstant].end(), 01170 inserter(tmpActiveIntersection, 01171 tmpActiveIntersection.begin())); 01172 activeIntersection = tmpActiveIntersection; 01173 } 01174 } 01175 initial = false; 01176 } 01177 01178 // Now, intersection sets contain the intersections of groundings 01179 // Make preds and append them to return array 01180 // True intersection 01181 set<unsigned long long>::const_iterator it = 01182 trueOrFalseIntersection.begin(); 01183 for (; it != trueOrFalseIntersection.end(); it++) 01184 { 01185 Predicate* p = getPredFromIdx((*it), pred->getTemplate()); 01186 indexedGndings->append(p); 01187 } 01188 // active intersection 01189 if (!ignoreActivePreds) 01190 { 01191 it = activeIntersection.begin(); 01192 for (; it != activeIntersection.end(); it++) 01193 { 01194 Predicate* p = getPredFromIdx((*it), pred->getTemplate()); 01195 indexedGndings->append(p); 01196 } 01197 } 01198 return; 01199 }
void Database::changeConstantsToNewIds | ( | hash_map< int, int > & | oldToNewConstIds | ) | [inline] |
Reindexes all predicates with new constant ids.
This is necessary after constant ids have been changed.
oldToNewConstIds | Mapping of old to new constant ids. |
Definition at line 1208 of file database.h.
References Array< Type >::empty(), Domain::getConstantsByTypeWithExt(), Domain::getNumConstantsByTypeWithExt(), Domain::getNumPredicates(), Domain::getNumTypes(), Domain::getPredicateTemplate(), Domain::getPredicateTermTypesAsInt(), Array< Type >::growToSize(), Domain::isType(), and Array< Type >::size().
Referenced by Domain::updatePerOldToNewIds().
01209 { 01210 // Change in all Arrays of hash_sets 01211 // - compute new first-const/multi, but do not overwrite old struc yet 01212 // - update predIdSet 01213 // . calls getIdOfGndValues/getPredFromIdx w. old first-const/multi 01214 // . compute new hashcode w. new first-const/multi 01215 // . update hashcode 01216 // - update first-const/multi 01217 01218 // compute new first-const 01219 int numTypes = domain_->getNumTypes(); 01220 Array<unsigned int> newfirstConstIdByType; 01221 newfirstConstIdByType.growToSize(numTypes); 01222 for (int i = 0; i < numTypes; i++) 01223 { 01224 assert(domain_->isType(i)); 01225 const Array<int>* constIds = domain_->getConstantsByTypeWithExt(i); 01226 //const Array<int>* constIds = domain_->getConstantsByType(i); 01227 if (constIds->empty()) newfirstConstIdByType[i] = (unsigned int)0; 01228 else newfirstConstIdByType[i] = (*constIds)[0]; 01229 } 01230 01231 // compute new termMultByPred_ 01232 int numFOPreds = domain_->getNumPredicates(); 01233 Array<Array<MultAndType>*> newtermMultByPred; 01234 newtermMultByPred.growToSize(numFOPreds, NULL); 01235 for (int i = 0; i < numFOPreds; i++) 01236 { 01237 // if this is a '=' pred, leave termMultByPred_[i] as NULL 01238 const PredicateTemplate* t = domain_->getPredicateTemplate(i); 01239 if (t->isEqualPredWithType()) continue; 01240 01241 const Array<int>* termTypes = domain_->getPredicateTermTypesAsInt(i); 01242 Array<MultAndType>* matArr = new Array<MultAndType>; 01243 int numTermTypes = termTypes->size(); 01244 matArr->growToSize(numTermTypes); 01245 unsigned long long curMult = 1; 01246 for (int j = numTermTypes - 1; j >= 0; j--) 01247 { 01248 int typeId = (*termTypes)[j]; 01249 (*matArr)[j] = MultAndType(curMult, typeId); 01250 curMult *= domain_->getNumConstantsByTypeWithExt(typeId); 01251 //curMult *= domain_->getNumConstantsByType(typeId); 01252 } 01253 //delete termMultByPred_[i]; 01254 newtermMultByPred[i] = matArr; 01255 } 01256 01257 // update predIdSet: retrieve w. old DS, compute hashcode w. new DS 01258 changeConstantsToNewIds(truePredIdxSet_, oldToNewConstIds, 01259 newfirstConstIdByType, newtermMultByPred); 01260 changeConstantsToNewIds(falsePredIdxSet_, oldToNewConstIds, 01261 newfirstConstIdByType, newtermMultByPred); 01262 changeConstantsToNewIds(activePredIdxSet_, oldToNewConstIds, 01263 newfirstConstIdByType, newtermMultByPred); 01264 changeConstantsToNewIds(evidencePredIdxSet_, oldToNewConstIds, 01265 newfirstConstIdByType, newtermMultByPred); 01266 changeConstantsToNewIds(deactivatedPredIdxSet_, oldToNewConstIds, 01267 newfirstConstIdByType, newtermMultByPred); 01268 changeConstantsToNewIds(trueEvIndex_, oldToNewConstIds, 01269 newfirstConstIdByType, newtermMultByPred); 01270 changeConstantsToNewIds(falseEvIndex_, oldToNewConstIds, 01271 newfirstConstIdByType, newtermMultByPred); 01272 changeConstantsToNewIds(activeIndex_, oldToNewConstIds, 01273 newfirstConstIdByType, newtermMultByPred); 01274 01275 // update first-const/multi 01276 firstConstIdByType_ = newfirstConstIdByType; 01277 for (int i = 0; i < numFOPreds; i++) 01278 { 01279 delete termMultByPred_[i]; 01280 } 01281 termMultByPred_ = newtermMultByPred; 01282 }