Skip to content

Commit

Permalink
Clarifying comments and removed unnecessary code in transition relation.
Browse files Browse the repository at this point in the history
  • Loading branch information
speckdavid committed Apr 22, 2024
1 parent 6000975 commit e9f7d72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/search/symbolic/transition_relation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ TransitionRelation::TransitionRelation(
void TransitionRelation::init() {
OperatorProxy op = task_proxy.get_operators()[ops_ids.begin()->get_index()];

for (auto const &pre : op.get_preconditions()) { // Put precondition of label
for (auto const &pre : op.get_preconditions()) {
FactPair fact = pre.get_pair();
tBDD *= sV->get_axiom_compiliation()->get_primary_representation(
fact.var, fact.value);
Expand Down Expand Up @@ -60,7 +60,6 @@ void TransitionRelation::init() {
}

// Add effects to the tBDD
int counter = 0;
for (auto it = effects.rbegin(); it != effects.rend(); ++it) {
int var = it->first;
BDD effectBDD = it->second;
Expand All @@ -71,7 +70,6 @@ void TransitionRelation::init() {
effectBDD += (effect_conditions[var] * sV->biimp(var));
}
tBDD *= effectBDD;
counter++;
}
if (tBDD.IsZero()) {
utils::g_log << "Operator is empty: " << op.get_name() << endl;
Expand Down Expand Up @@ -143,7 +141,6 @@ void TransitionRelation::merge(const TransitionRelation &t2, int maxNodes) {
utils::exit_with(utils::ExitCode::SEARCH_CRITICAL_ERROR);
}

// utils::g_log << "set_union" << endl;
// Attempt to generate the new tBDD
vector<int> newEffVars;
set_union(effVars.begin(), effVars.end(), t2.effVars.begin(),
Expand All @@ -152,7 +149,6 @@ void TransitionRelation::merge(const TransitionRelation &t2, int maxNodes) {
BDD newTBDD = tBDD;
BDD newTBDD2 = t2.tBDD;

// utils::g_log << "Eff vars" << endl;
vector<int>::const_iterator var1 = effVars.begin();
vector<int>::const_iterator var2 = t2.effVars.begin();
for (vector<int>::const_iterator var = newEffVars.begin();
Expand Down
13 changes: 3 additions & 10 deletions src/search/symbolic/transition_relation.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,21 @@ class OriginalStateSpace;

/*
* Represents a symbolic transition.
* It has two differentiated parts: label and abstract state transitions
* Label refers to variables not considered in the merge-and-shrink
* Each label has one or more abstract state transitions
*/
class TransitionRelation {
SymVariables *sV; // To call basic BDD creation methods
// Use task_proxy to access task information.
TaskProxy task_proxy;
TaskProxy task_proxy; // Use task_proxy to access task information.
int cost; // transition cost
BDD tBDD; // bdd for making the relprod

std::vector<int> effVars; // FD Index of eff variables. Must be sorted!!
BDD existsVars, existsBwVars; // Cube with variables to existentialize
std::vector<BDD> swapVarsS,
swapVarsSp; // Swap variables s to sp and viceversa
std::vector<BDD> swapVarsS, swapVarsSp; // Swap variables s to sp and viceversa

std::set<OperatorID> ops_ids; // List of operators represented by the TR

public:
// Constructor for transitions irrelevant for the abstraction
TransitionRelation(SymVariables *sVars, OperatorID op_id,
const std::shared_ptr<AbstractTask> &task);
TransitionRelation(SymVariables *sVars, OperatorID op_id, const std::shared_ptr<AbstractTask> &task);
void init();
void init_from_tr(const TransitionRelation &other);

Expand Down

0 comments on commit e9f7d72

Please sign in to comment.