* iface/gspn/gspn.cc, src/ltlvisit/basicreduce.cc,
src/ltlvisit/destroy.cc, src/ltlvisit/dotty.cc,
src/ltlvisit/dump.cc, src/ltlvisit/length.cc,
src/ltlvisit/nenoform.cc, src/ltlvisit/reduce.cc,
src/ltlvisit/syntimpl.cc, src/ltlvisit/tostring.cc,
src/tgba/formula2bdd.cc, src/tgba/tgbabddconcreteproduct.cc,
src/tgba/tgbatba.cc, src/tgbaalgos/dotty.cc,
src/tgbaalgos/dupexp.cc, src/tgbaalgos/lbtt.cc,
src/tgbaalgos/ltl2tgba_lacim.cc, src/tgbaalgos/neverclaim.cc,
src/tgbaalgos/save.cc, src/tgbaalgos/stats.cc,
src/tgbaalgos/gtec/nsheap.cc, src/tgbaalgos/gtec/nsheap.hh:
Declare private classes and helper function in anonymous namespaces.
* HACKING, src/sanity/style.test: Document and check this.
Also check for trailing { after namespace or class.
* src/ltlast/predecl.hh, src/ltlast/visitor.hh,
src/tgba/tgbareduc.hh: Fix trailing {.
This commit is contained in:
parent
5176caf4d2
commit
7d27fd3796
28 changed files with 3128 additions and 3025 deletions
|
|
@ -28,72 +28,73 @@
|
|||
|
||||
namespace spot
|
||||
{
|
||||
|
||||
class save_bfs : public tgba_reachable_iterator_breadth_first
|
||||
namespace
|
||||
{
|
||||
public:
|
||||
save_bfs(const tgba* a, std::ostream& os)
|
||||
: tgba_reachable_iterator_breadth_first(a), os_(os)
|
||||
class save_bfs: public tgba_reachable_iterator_breadth_first
|
||||
{
|
||||
}
|
||||
public:
|
||||
save_bfs(const tgba* a, std::ostream& os)
|
||||
: tgba_reachable_iterator_breadth_first(a), os_(os)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
start()
|
||||
{
|
||||
os_ << "acc =";
|
||||
print_acc(automata_->all_acceptance_conditions()) << ";" << std::endl;
|
||||
}
|
||||
void
|
||||
start()
|
||||
{
|
||||
os_ << "acc =";
|
||||
print_acc(automata_->all_acceptance_conditions()) << ";" << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
process_state(const state* s, int, tgba_succ_iterator* si)
|
||||
{
|
||||
const bdd_dict* d = automata_->get_dict();
|
||||
std::string cur = automata_->format_state(s);
|
||||
for (si->first(); !si->done(); si->next())
|
||||
{
|
||||
state* dest = si->current_state();
|
||||
os_ << "\"" << cur << "\", \""
|
||||
<< automata_->format_state(dest) << "\", \"";
|
||||
escape_str(os_, bdd_format_formula(d, si->current_condition()));
|
||||
os_ << "\",";
|
||||
print_acc(si->current_acceptance_conditions()) << ";" << std::endl;
|
||||
delete dest;
|
||||
}
|
||||
}
|
||||
void
|
||||
process_state(const state* s, int, tgba_succ_iterator* si)
|
||||
{
|
||||
const bdd_dict* d = automata_->get_dict();
|
||||
std::string cur = automata_->format_state(s);
|
||||
for (si->first(); !si->done(); si->next())
|
||||
{
|
||||
state* dest = si->current_state();
|
||||
os_ << "\"" << cur << "\", \""
|
||||
<< automata_->format_state(dest) << "\", \"";
|
||||
escape_str(os_, bdd_format_formula(d, si->current_condition()));
|
||||
os_ << "\",";
|
||||
print_acc(si->current_acceptance_conditions()) << ";" << std::endl;
|
||||
delete dest;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
std::ostream& os_;
|
||||
|
||||
std::ostream&
|
||||
print_acc(bdd acc)
|
||||
{
|
||||
const bdd_dict* d = automata_->get_dict();
|
||||
while (acc != bddfalse)
|
||||
{
|
||||
bdd cube = bdd_satone(acc);
|
||||
acc -= cube;
|
||||
while (cube != bddtrue)
|
||||
{
|
||||
assert(cube != bddfalse);
|
||||
// Display the first variable that is positive.
|
||||
// There should be only one per satisfaction.
|
||||
if (bdd_high(cube) != bddfalse)
|
||||
{
|
||||
int v = bdd_var(cube);
|
||||
bdd_dict::vf_map::const_iterator vi =
|
||||
d->acc_formula_map.find(v);
|
||||
assert(vi != d->acc_formula_map.end());
|
||||
os_ << " \"";
|
||||
escape_str(os_, ltl::to_string(vi->second)) << "\"";
|
||||
break;
|
||||
}
|
||||
cube = bdd_low(cube);
|
||||
}
|
||||
}
|
||||
return os_;
|
||||
}
|
||||
};
|
||||
private:
|
||||
std::ostream& os_;
|
||||
|
||||
std::ostream&
|
||||
print_acc(bdd acc)
|
||||
{
|
||||
const bdd_dict* d = automata_->get_dict();
|
||||
while (acc != bddfalse)
|
||||
{
|
||||
bdd cube = bdd_satone(acc);
|
||||
acc -= cube;
|
||||
while (cube != bddtrue)
|
||||
{
|
||||
assert(cube != bddfalse);
|
||||
// Display the first variable that is positive.
|
||||
// There should be only one per satisfaction.
|
||||
if (bdd_high(cube) != bddfalse)
|
||||
{
|
||||
int v = bdd_var(cube);
|
||||
bdd_dict::vf_map::const_iterator vi =
|
||||
d->acc_formula_map.find(v);
|
||||
assert(vi != d->acc_formula_map.end());
|
||||
os_ << " \"";
|
||||
escape_str(os_, ltl::to_string(vi->second)) << "\"";
|
||||
break;
|
||||
}
|
||||
cube = bdd_low(cube);
|
||||
}
|
||||
}
|
||||
return os_;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
std::ostream&
|
||||
tgba_save_reachable(std::ostream& os, const tgba* g)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue