Skip to content
Snippets Groups Projects
Commit 8fa23e33 authored by Jaime Arias's avatar Jaime Arias
Browse files

refactor: rename variable sw by current_trace

parent 862d24b2
No related branches found
No related tags found
No related merge requests found
......@@ -287,7 +287,7 @@ Set PetriNetSOG::FirableObservableTrans(const bdd &state) const {
Paths PetriNetSOG::ObservablePaths(SOG &sog, map<int, int> trans_obs) const {
Paths observable_paths;
Path sw;
Path current_trace;
Set covered_trans;
Set firable_trans;
Stack st;
......@@ -321,13 +321,13 @@ Paths PetriNetSOG::ObservablePaths(SOG &sog, map<int, int> trans_obs) const {
if (t != -1) {
old = false;
trans_obs[t]--;
sw.push_back(t);
current_trace.push_back(t);
if (trans_obs[t] == 0) {
covered_trans.insert(t);
// check if all observable transitions are covered and return the set
// of generated paths
if (covered_trans.size() == observables.size()) {
observable_paths.insert(sw);
observable_paths.insert(current_trace);
return observable_paths;
}
}
......@@ -335,7 +335,7 @@ Paths PetriNetSOG::ObservablePaths(SOG &sog, map<int, int> trans_obs) const {
// case: when there is no firable transition that is not covered, take
// the first firable transition
t = *elt.firable_trans.begin();
sw.push_back(t);
current_trace.push_back(t);
}
// remove the handled transition and put the same aggregate in the stack
......@@ -366,21 +366,21 @@ Paths PetriNetSOG::ObservablePaths(SOG &sog, map<int, int> trans_obs) const {
// if the aggregate has no firable transitions
if (firable_trans.empty()) {
if (!old) {
observable_paths.insert(sw);
observable_paths.insert(current_trace);
}
ReinitCycle(sw, trans_obs);
ReinitCycle(current_trace, trans_obs);
sw.pop_back();
current_trace.pop_back();
} else {
st.emplace(AggrPair(reached_aggr, complete_aggr), firable_trans);
}
} else { // aggregate already exists
if (!old) {
observable_paths.insert(sw);
observable_paths.insert(current_trace);
}
ReinitCycle(sw, trans_obs);
ReinitCycle(current_trace, trans_obs);
sw.pop_back();
current_trace.pop_back();
delete reached_aggr;
elt.aggr_pair.first->successors.insert(
elt.aggr_pair.first->successors.begin(), Edge(pos, t));
......@@ -390,7 +390,7 @@ Paths PetriNetSOG::ObservablePaths(SOG &sog, map<int, int> trans_obs) const {
}
}
} else {
sw.pop_back();
current_trace.pop_back();
old = true;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment