* src/tgbaalgos/emptinesscheck.hh, src/tgbaalgos/emptinesscheck.cc

(emptiness_check::seq_counter, emptiness_check::periode): Rename as ...
(emptiness_check::prefix, emptiness_check::period): ... these.
This commit is contained in:
Alexandre Duret-Lutz 2003-10-22 15:25:05 +00:00
parent 3784895ec7
commit 93c0732f0e
3 changed files with 148 additions and 140 deletions

View file

@ -1,5 +1,9 @@
2003-10-22 Alexandre Duret-Lutz <adl@src.lip6.fr> 2003-10-22 Alexandre Duret-Lutz <adl@src.lip6.fr>
* src/tgbaalgos/emptinesscheck.hh, src/tgbaalgos/emptinesscheck.cc
(emptiness_check::seq_counter, emptiness_check::periode): Rename as ...
(emptiness_check::prefix, emptiness_check::period): ... these.
* src/tgbaalgos/emptinesscheck.cc * src/tgbaalgos/emptinesscheck.cc
(emptiness_check::tgba_emptiness_check, (emptiness_check::tgba_emptiness_check,
emptiness_check::accepting_path): Simplify BDD operations. emptiness_check::accepting_path): Simplify BDD operations.

View file

@ -196,8 +196,8 @@ namespace spot
os << "Prefix:" << std::endl; os << "Prefix:" << std::endl;
os << "======================" << std::endl; os << "======================" << std::endl;
const bdd_dict* d = aut->get_dict(); const bdd_dict* d = aut->get_dict();
for (state_sequence::const_iterator i_se = seq_counter.begin(); for (state_sequence::const_iterator i_se = suffix.begin();
i_se != seq_counter.end(); i_se++) i_se != suffix.end(); i_se++)
{ {
if (restrict) if (restrict)
{ {
@ -212,8 +212,8 @@ namespace spot
os << "======================" << std::endl; os << "======================" << std::endl;
os << "Cycle:" <<std::endl; os << "Cycle:" <<std::endl;
os << "======================" << std::endl; os << "======================" << std::endl;
for (cycle_path::const_iterator it = periode.begin(); for (cycle_path::const_iterator it = period.begin();
it != periode.end(); it++) it != period.end(); it++)
{ {
if (restrict) if (restrict)
{ {
@ -231,7 +231,7 @@ namespace spot
return os; return os;
} }
/// \brief Build a possible prefixe and period for a counter example. /// \brief Build a possible prefix and period for a counter example.
void void
emptiness_check::counter_example(const spot::tgba* aut_counter) emptiness_check::counter_example(const spot::tgba* aut_counter)
{ {
@ -240,7 +240,8 @@ namespace spot
spot::state_ptr_less_than> path_state; spot::state_ptr_less_than> path_state;
path_state path_map; path_state path_map;
if (!root_component.empty()){ if (!root_component.empty())
{
int comp_size = root_component.size(); int comp_size = root_component.size();
typedef std::vector<connected_component> vec_compo; typedef std::vector<connected_component> vec_compo;
vec_compo vec_component; vec_compo vec_component;
@ -274,7 +275,8 @@ namespace spot
if (tmp_int < comp_size) if (tmp_int < comp_size)
vec_component[tmp_int-1].state_set.insert((*iter_map).first); vec_component[tmp_int-1].state_set.insert((*iter_map).first);
else else
vec_component[comp_size-1].state_set.insert((*iter_map).first); vec_component[comp_size-1].state_set
.insert((*iter_map).first);
} }
} }
@ -287,7 +289,7 @@ namespace spot
for (int k = 0; k < comp_size-1; k++) for (int k = 0; k < comp_size-1; k++)
{ {
// We build a path trought all SCC in the stack: a // We build a path trought all SCC in the stack: a
// possible prefixe for a counter example. // possible prefix for a counter example.
while (!todo_trace.empty()) while (!todo_trace.empty())
{ {
pair_state_iter started_from = todo_trace.front(); pair_state_iter started_from = todo_trace.front();
@ -356,18 +358,21 @@ namespace spot
} }
else else
{ {
seq_counter.push_front(start_state); suffix.push_front(start_state);
} }
for (int n_ = 0; n_ < comp_size-1; n_++) for (int n_ = 0; n_ < comp_size-1; n_++)
{ {
for (state_sequence::iterator it = vec_sequence[n_].begin(); for (state_sequence::iterator it = vec_sequence[n_].begin();
it != vec_sequence[n_].end(); it++) it != vec_sequence[n_].end(); it++)
{ {
seq_counter.push_back(*it); suffix.push_back(*it);
} }
} }
seq_counter.unique(); suffix.unique();
emptiness_check::accepting_path(aut_counter, vec_component[comp_size-1], seq_counter.back(),vec_component[comp_size-1].condition); emptiness_check::accepting_path(aut_counter,
vec_component[comp_size-1],
suffix.back(),
vec_component[comp_size-1].condition);
} }
else else
{ {
@ -414,7 +419,7 @@ namespace spot
complete_map[curr_father].second)); complete_map[curr_father].second));
curr_father = complete_map[curr_father].first; curr_father = complete_map[curr_father].first;
} }
emptiness_check::periode.splice(periode.end(), emptiness_check::period.splice(period.end(),
tmp_comp); tmp_comp);
todo_complete.clear(); todo_complete.clear();
break; break;
@ -533,22 +538,22 @@ namespace spot
} }
for (cycle_path::iterator it = best_lst.begin(); for (cycle_path::iterator it = best_lst.begin();
it != best_lst.end(); it++) it != best_lst.end(); it++)
emptiness_check::periode.push_back(*it); emptiness_check::period.push_back(*it);
if (best_acc != to_accept) if (best_acc != to_accept)
{ {
bdd rec_to_acc = to_accept - best_acc; bdd rec_to_acc = to_accept - best_acc;
emptiness_check::accepting_path(aut_counter, comp_path, emptiness_check::accepting_path(aut_counter, comp_path,
periode.back().first, rec_to_acc); period.back().first, rec_to_acc);
} }
else else
{ {
if (!periode.empty()) if (!period.empty())
{ {
/// The path contains all accepting conditions. Then we /// The path contains all accepting conditions. Then we
///complete the cycle in this SCC by calling complete_cycle. ///complete the cycle in this SCC by calling complete_cycle.
complete_cycle(aut_counter, comp_path, periode.back().first, complete_cycle(aut_counter, comp_path, period.back().first,
seq_counter.back()); suffix.back());
} }
} }
} }

View file

@ -93,8 +93,8 @@ namespace spot
std::stack<bdd> arc_accepting; std::stack<bdd> arc_accepting;
std::stack<connected_component> root_component; std::stack<connected_component> root_component;
seen seen_state_num; seen seen_state_num;
state_sequence seq_counter; state_sequence suffix;
cycle_path periode; cycle_path period;
private: private:
std::stack<pair_state_iter> todo; std::stack<pair_state_iter> todo;
std::vector<state_sequence> vec_sequence; std::vector<state_sequence> vec_sequence;
@ -102,8 +102,7 @@ namespace spot
/// Called by counter_example to find a path which traverses all /// Called by counter_example to find a path which traverses all
/// accepting conditions in the accepted SCC. /// accepting conditions in the accepted SCC.
void void accepting_path (const spot::tgba* aut_counter,
accepting_path (const spot::tgba* aut_counter,
const connected_component& comp_path, const connected_component& comp_path,
const spot::state* start_path, bdd to_accept); const spot::state* start_path, bdd to_accept);