tgbadigraph: delegate useful graph methods
* src/tgba/tgbagraph.hh (new_state, new_states, new_transitions, out, trans_data): Delegate these useful graph methods so we do not have to call get_graph(). * src/graphtest/tgbagraph.cc, src/tgbaalgos/dtbasat.cc, src/tgbaalgos/dtgbasat.cc, src/tgbaalgos/dupexp.cc, src/tgbaalgos/emptiness.cc, src/tgbaalgos/lbtt.cc, src/tgbaalgos/powerset.cc, src/tgbaalgos/randomgraph.cc, src/tgbaalgos/sccfilter.cc, src/tgbaalgos/sccinfo.cc,src/tgbaalgos/simulation.cc: Simplify.
This commit is contained in:
parent
18f6fe772b
commit
1a93166d15
12 changed files with 92 additions and 75 deletions
|
|
@ -55,14 +55,13 @@ namespace spot
|
|||
auto res = new tgba_digraph(d);
|
||||
d->register_all_variables_of(aut, res);
|
||||
d->unregister_all_typed_variables(bdd_dict::acc, res);
|
||||
auto& g = res->get_graph();
|
||||
|
||||
{
|
||||
power_state ps;
|
||||
const state* s = pm.canonicalize(aut->get_init_state());
|
||||
ps.insert(s);
|
||||
todo.push_back(ps);
|
||||
unsigned num = g.new_state();
|
||||
unsigned num = res->new_state();
|
||||
seen[ps] = num;
|
||||
pm.map_[num] = ps;
|
||||
}
|
||||
|
|
@ -101,12 +100,12 @@ namespace spot
|
|||
}
|
||||
else
|
||||
{
|
||||
dest_num = g.new_state();
|
||||
dest_num = res->new_state();
|
||||
seen[dest] = dest_num;
|
||||
pm.map_[dest_num] = dest;
|
||||
todo.push_back(dest);
|
||||
}
|
||||
g.new_transition(seen[src], dest_num, cond);
|
||||
res->new_transition(seen[src], dest_num, cond);
|
||||
}
|
||||
}
|
||||
if (merge)
|
||||
|
|
@ -180,15 +179,14 @@ namespace spot
|
|||
|
||||
// Build an automaton representing this loop.
|
||||
tgba_digraph loop_a(aut_->get_dict());
|
||||
auto& g = loop_a.get_graph();
|
||||
int loop_size = std::distance(begin, dfs_.end());
|
||||
g.new_states(loop_size);
|
||||
loop_a.new_states(loop_size);
|
||||
int n;
|
||||
cycle_iter i;
|
||||
for (n = 1, i = begin; n <= loop_size; ++n, ++i)
|
||||
{
|
||||
trans* t = &a->trans_data(i->succ);
|
||||
g.new_transition(n - 1, n % loop_size, t->cond);
|
||||
loop_a.new_transition(n - 1, n % loop_size, t->cond);
|
||||
if (reject_.find(t) == reject_.end())
|
||||
ts.insert(t);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue