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

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

(emptiness_check::seq_counter, emptiness_check::periode): Rename as ...
(emptiness_check::prefix, emptiness_check::period): ... these.
parent 3784895e
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
(emptiness_check::tgba_emptiness_check,
emptiness_check::accepting_path): Simplify BDD operations.
......
......@@ -196,8 +196,8 @@ namespace spot
os << "Prefix:" << std::endl;
os << "======================" << std::endl;
const bdd_dict* d = aut->get_dict();
for (state_sequence::const_iterator i_se = seq_counter.begin();
i_se != seq_counter.end(); i_se++)
for (state_sequence::const_iterator i_se = suffix.begin();
i_se != suffix.end(); i_se++)
{
if (restrict)
{
......@@ -212,8 +212,8 @@ namespace spot
os << "======================" << std::endl;
os << "Cycle:" <<std::endl;
os << "======================" << std::endl;
for (cycle_path::const_iterator it = periode.begin();
it != periode.end(); it++)
for (cycle_path::const_iterator it = period.begin();
it != period.end(); it++)
{
if (restrict)
{
......@@ -231,7 +231,7 @@ namespace spot
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
emptiness_check::counter_example(const spot::tgba* aut_counter)
{
......@@ -240,7 +240,8 @@ namespace spot
spot::state_ptr_less_than> path_state;
path_state path_map;
if (!root_component.empty()){
if (!root_component.empty())
{
int comp_size = root_component.size();
typedef std::vector<connected_component> vec_compo;
vec_compo vec_component;
......@@ -274,7 +275,8 @@ namespace spot
if (tmp_int < comp_size)
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,8 +288,8 @@ namespace spot
for (int k = 0; k < comp_size-1; k++)
{
// We build a path trought all SCC in the stack : a
// possible prefixe for a counter example.
// We build a path trought all SCC in the stack: a
// possible prefix for a counter example.
while (!todo_trace.empty())
{
pair_state_iter started_from = todo_trace.front();
......@@ -356,18 +358,21 @@ namespace spot
}
else
{
seq_counter.push_front(start_state);
suffix.push_front(start_state);
}
for (int n_ = 0; n_ < comp_size-1; n_++)
{
for (state_sequence::iterator it = vec_sequence[n_].begin();
it != vec_sequence[n_].end(); it++)
{
seq_counter.push_back(*it);
suffix.push_back(*it);
}
}
seq_counter.unique();
emptiness_check::accepting_path(aut_counter, vec_component[comp_size-1], seq_counter.back(),vec_component[comp_size-1].condition);
suffix.unique();
emptiness_check::accepting_path(aut_counter,
vec_component[comp_size-1],
suffix.back(),
vec_component[comp_size-1].condition);
}
else
{
......@@ -414,7 +419,7 @@ namespace spot
complete_map[curr_father].second));
curr_father = complete_map[curr_father].first;
}
emptiness_check::periode.splice(periode.end(),
emptiness_check::period.splice(period.end(),
tmp_comp);
todo_complete.clear();
break;
......@@ -533,22 +538,22 @@ namespace spot
}
for (cycle_path::iterator it = best_lst.begin();
it != best_lst.end(); it++)
emptiness_check::periode.push_back(*it);
emptiness_check::period.push_back(*it);
if (best_acc != to_accept)
{
bdd rec_to_acc = to_accept - best_acc;
emptiness_check::accepting_path(aut_counter, comp_path,
periode.back().first, rec_to_acc);
period.back().first, rec_to_acc);
}
else
{
if (!periode.empty())
if (!period.empty())
{
/// The path contains all accepting conditions. Then we
///complete the cycle in this SCC by calling complete_cycle.
complete_cycle(aut_counter, comp_path, periode.back().first,
seq_counter.back());
complete_cycle(aut_counter, comp_path, period.back().first,
suffix.back());
}
}
}
......
......@@ -93,8 +93,8 @@ namespace spot
std::stack<bdd> arc_accepting;
std::stack<connected_component> root_component;
seen seen_state_num;
state_sequence seq_counter;
cycle_path periode;
state_sequence suffix;
cycle_path period;
private:
std::stack<pair_state_iter> todo;
std::vector<state_sequence> vec_sequence;
......@@ -102,8 +102,7 @@ namespace spot
/// Called by counter_example to find a path which traverses all
/// accepting conditions in the accepted SCC.
void
accepting_path (const spot::tgba* aut_counter,
void accepting_path (const spot::tgba* aut_counter,
const connected_component& comp_path,
const spot::state* start_path, bdd 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