Commit a11a29a1 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

* 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.
parent 93c0732f
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>
* src/tgbaalgos/emptinesscheck.hh, src/tgbaalgos/emptinesscheck.cc
......
......@@ -170,11 +170,8 @@ namespace spot
comp.condition |= new_condition;
if (aut_check->all_accepting_conditions() == comp.condition)
{
// A failure SCC is find, the automata is not empty.
// spot::bdd_print_dot(std::cout, aut_check->get_dict(),
// comp.condition);
// A failure SCC was found, the automata is not empty.
root_component.push(comp);
std::cout << "CONSISTENT AUTOMATA" << std::endl;
return false;
}
root_component.push(comp);
......@@ -183,7 +180,6 @@ namespace spot
}
}
// The automata is empty.
std::cout << "EMPTY LANGUAGE" << std::endl;
return true;
}
......@@ -197,7 +193,7 @@ namespace spot
os << "======================" << std::endl;
const bdd_dict* d = aut->get_dict();
for (state_sequence::const_iterator i_se = suffix.begin();
i_se != suffix.end(); i_se++)
i_se != suffix.end(); ++i_se)
{
if (restrict)
{
......@@ -213,7 +209,7 @@ namespace spot
os << "Cycle:" <<std::endl;
os << "======================" << std::endl;
for (cycle_path::const_iterator it = period.begin();
it != period.end(); it++)
it != period.end(); ++it)
{
if (restrict)
{
......@@ -240,8 +236,8 @@ namespace spot
spot::state_ptr_less_than> path_state;
path_state path_map;
if (!root_component.empty())
{
assert(!root_component.empty());
int comp_size = root_component.size();
typedef std::vector<connected_component> vec_compo;
vec_compo vec_component;
......@@ -253,7 +249,7 @@ namespace spot
bdd tmp_acc = bddfalse;
std::stack<pair_state_iter> todo_accept;
for (int j = comp_size -1; j >= 0; j--)
for (int j = comp_size - 1; j >= 0; j--)
{
vec_component[j] = root_component.top();
root_component.pop();
......@@ -263,7 +259,7 @@ namespace spot
int tmp_int = 0;
// Fill the SCC in the stack root_component.
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;
tmp_int = 0;
......@@ -273,10 +269,9 @@ namespace spot
&& (vec_component[tmp_int].index <= q_index))
tmp_int = tmp_int+1;
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
vec_component[comp_size-1].state_set
.insert((*iter_map).first);
vec_component[comp_size - 1].state_set.insert((*iter_map).first);
}
}
......@@ -286,7 +281,7 @@ namespace spot
tgba_succ_iterator* i = aut_counter->succ_iter(start_state);
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
// possible prefix for a counter example.
......@@ -360,24 +355,15 @@ namespace spot
{
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();
it != vec_sequence[n_].end(); it++)
{
it != vec_sequence[n_].end(); ++it)
suffix.push_back(*it);
}
}
suffix.unique();
emptiness_check::accepting_path(aut_counter,
vec_component[comp_size-1],
vec_component[comp_size - 1],
suffix.back(),
vec_component[comp_size-1].condition);
}
else
{
std::cout << "EMPTY LANGUAGE NO COUNTER EXEMPLE" << std::endl;
}
vec_component[comp_size - 1].condition);
}
/// \brief complete the path build by accepting_path to get the period.
......@@ -450,7 +436,7 @@ namespace spot
std::stack<triplet> todo_path;
tgba_succ_iterator* t_s_i = aut_counter->succ_iter(start_path);
t_s_i->first();
todo_path.push(triplet(pair_state_iter(start_path,t_s_i), bddfalse));
todo_path.push(triplet(pair_state_iter(start_path, t_s_i), bddfalse));
bdd tmp_acc = bddfalse;
bdd best_acc = bddfalse;
cycle_path tmp_lst;
......@@ -460,11 +446,11 @@ namespace spot
while (!todo_path.empty())
{
triplet step_ = todo_path.top();
tgba_succ_iterator* iter_ = (step_.first).second;
tgba_succ_iterator* iter_ = step_.first.second;
if (iter_->done())
{
todo_path.pop();
seen_priority.erase((step_.first).first);
seen_priority.erase(step_.first.first);
tmp_lst.pop_back();
}
else
......@@ -504,9 +490,6 @@ namespace spot
{
cycle_path tmp(tmp_lst);
best_lst = tmp;
spot::bdd_print_dot(std::cout,
aut_counter->get_dict(),
step_.second);
}
}
else
......@@ -537,7 +520,7 @@ namespace spot
}
}
for (cycle_path::iterator it = best_lst.begin();
it != best_lst.end(); it++)
it != best_lst.end(); ++it)
emptiness_check::period.push_back(*it);
if (best_acc != to_accept)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment