* src/tgbaalgos/emptinesscheck.cc

(emptiness_check::tgba_emptiness_check): Do not print anything.
(emptiness_check::counter_example): Assume that tgba_emptiness_check
has already been called.
This commit is contained in:
Alexandre Duret-Lutz 2003-10-23 09:40:55 +00:00
parent 93c0732f0e
commit a11a29a1f7
2 changed files with 117 additions and 127 deletions

View file

@ -1,3 +1,10 @@
2003-10-23 Alexandre Duret-Lutz <adl@src.lip6.fr>
* src/tgbaalgos/emptinesscheck.cc
(emptiness_check::tgba_emptiness_check): Do not print anything.
(emptiness_check::counter_example): Assume that tgba_emptiness_check
has already been called.
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 * src/tgbaalgos/emptinesscheck.hh, src/tgbaalgos/emptinesscheck.cc

View file

@ -170,11 +170,8 @@ namespace spot
comp.condition |= new_condition; comp.condition |= new_condition;
if (aut_check->all_accepting_conditions() == comp.condition) if (aut_check->all_accepting_conditions() == comp.condition)
{ {
// A failure SCC is find, the automata is not empty. // A failure SCC was found, the automata is not empty.
// spot::bdd_print_dot(std::cout, aut_check->get_dict(),
// comp.condition);
root_component.push(comp); root_component.push(comp);
std::cout << "CONSISTENT AUTOMATA" << std::endl;
return false; return false;
} }
root_component.push(comp); root_component.push(comp);
@ -183,7 +180,6 @@ namespace spot
} }
} }
// The automata is empty. // The automata is empty.
std::cout << "EMPTY LANGUAGE" << std::endl;
return true; return true;
} }
@ -197,7 +193,7 @@ namespace spot
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 = suffix.begin(); for (state_sequence::const_iterator i_se = suffix.begin();
i_se != suffix.end(); i_se++) i_se != suffix.end(); ++i_se)
{ {
if (restrict) if (restrict)
{ {
@ -213,7 +209,7 @@ namespace spot
os << "Cycle:" <<std::endl; os << "Cycle:" <<std::endl;
os << "======================" << std::endl; os << "======================" << std::endl;
for (cycle_path::const_iterator it = period.begin(); for (cycle_path::const_iterator it = period.begin();
it != period.end(); it++) it != period.end(); ++it)
{ {
if (restrict) if (restrict)
{ {
@ -240,8 +236,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()) assert(!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;
@ -263,7 +259,7 @@ namespace spot
int tmp_int = 0; int tmp_int = 0;
// Fill the SCC in the stack root_component. // Fill the SCC in the stack root_component.
for (seen::iterator iter_map = seen_state_num.begin(); for (seen::iterator iter_map = seen_state_num.begin();
iter_map != seen_state_num.end(); iter_map++) iter_map != seen_state_num.end(); ++iter_map)
{ {
q_index = (*iter_map).second; q_index = (*iter_map).second;
tmp_int = 0; tmp_int = 0;
@ -275,8 +271,7 @@ 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 vec_component[comp_size - 1].state_set.insert((*iter_map).first);
.insert((*iter_map).first);
} }
} }
@ -286,7 +281,7 @@ namespace spot
tgba_succ_iterator* i = aut_counter->succ_iter(start_state); tgba_succ_iterator* i = aut_counter->succ_iter(start_state);
todo_trace.push_back(pair_state_iter(start_state, i)); todo_trace.push_back(pair_state_iter(start_state, i));
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 prefix for a counter example. // possible prefix for a counter example.
@ -360,25 +355,16 @@ namespace spot
{ {
suffix.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)
{
suffix.push_back(*it); suffix.push_back(*it);
}
}
suffix.unique(); suffix.unique();
emptiness_check::accepting_path(aut_counter, emptiness_check::accepting_path(aut_counter,
vec_component[comp_size - 1], vec_component[comp_size - 1],
suffix.back(), suffix.back(),
vec_component[comp_size - 1].condition); vec_component[comp_size - 1].condition);
} }
else
{
std::cout << "EMPTY LANGUAGE NO COUNTER EXEMPLE" << std::endl;
}
}
/// \brief complete the path build by accepting_path to get the period. /// \brief complete the path build by accepting_path to get the period.
void void
@ -460,11 +446,11 @@ namespace spot
while (!todo_path.empty()) while (!todo_path.empty())
{ {
triplet step_ = todo_path.top(); triplet step_ = todo_path.top();
tgba_succ_iterator* iter_ = (step_.first).second; tgba_succ_iterator* iter_ = step_.first.second;
if (iter_->done()) if (iter_->done())
{ {
todo_path.pop(); todo_path.pop();
seen_priority.erase((step_.first).first); seen_priority.erase(step_.first.first);
tmp_lst.pop_back(); tmp_lst.pop_back();
} }
else else
@ -504,9 +490,6 @@ namespace spot
{ {
cycle_path tmp(tmp_lst); cycle_path tmp(tmp_lst);
best_lst = tmp; best_lst = tmp;
spot::bdd_print_dot(std::cout,
aut_counter->get_dict(),
step_.second);
} }
} }
else else
@ -537,7 +520,7 @@ 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::period.push_back(*it); emptiness_check::period.push_back(*it);
if (best_acc != to_accept) if (best_acc != to_accept)