* 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
|
|
@ -25,73 +25,77 @@
|
|||
#include <map>
|
||||
#include "reachiter.hh"
|
||||
|
||||
namespace spot {
|
||||
|
||||
template <class T>
|
||||
class dupexp_iter: public T
|
||||
namespace spot
|
||||
{
|
||||
namespace
|
||||
{
|
||||
public:
|
||||
dupexp_iter(const tgba* a)
|
||||
: T(a), out_(new tgba_explicit(a->get_dict()))
|
||||
template <class T>
|
||||
class dupexp_iter: public T
|
||||
{
|
||||
}
|
||||
public:
|
||||
dupexp_iter(const tgba* a)
|
||||
: T(a), out_(new tgba_explicit(a->get_dict()))
|
||||
{
|
||||
}
|
||||
|
||||
tgba_explicit*
|
||||
result()
|
||||
{
|
||||
return out_;
|
||||
}
|
||||
tgba_explicit*
|
||||
result()
|
||||
{
|
||||
return out_;
|
||||
}
|
||||
|
||||
void
|
||||
process_state(const state* s, int n, tgba_succ_iterator*)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "(#" << n << ") " << this->automata_->format_state(s);
|
||||
name_[n] = os.str();
|
||||
}
|
||||
void
|
||||
process_state(const state* s, int n, tgba_succ_iterator*)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "(#" << n << ") " << this->automata_->format_state(s);
|
||||
name_[n] = os.str();
|
||||
}
|
||||
|
||||
std::string
|
||||
declare_state(const state* s, int n)
|
||||
{
|
||||
std::string str;
|
||||
name_map_::const_iterator i = name_.find(n);
|
||||
if (i == name_.end())
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "(#" << n << ") " << this->automata_->format_state(s);
|
||||
name_[n] = str = os.str();
|
||||
}
|
||||
else
|
||||
{
|
||||
str = i->second;
|
||||
}
|
||||
delete s;
|
||||
return str;
|
||||
}
|
||||
std::string
|
||||
declare_state(const state* s, int n)
|
||||
{
|
||||
std::string str;
|
||||
name_map_::const_iterator i = name_.find(n);
|
||||
if (i == name_.end())
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << "(#" << n << ") " << this->automata_->format_state(s);
|
||||
name_[n] = str = os.str();
|
||||
}
|
||||
else
|
||||
{
|
||||
str = i->second;
|
||||
}
|
||||
delete s;
|
||||
return str;
|
||||
}
|
||||
|
||||
void
|
||||
process_link(int in, int out, const tgba_succ_iterator* si)
|
||||
{
|
||||
// We might need to format out before process_state is called.
|
||||
name_map_::const_iterator i = name_.find(out);
|
||||
if (i == name_.end())
|
||||
{
|
||||
const state* s = si->current_state();
|
||||
process_state(s, out, 0);
|
||||
delete s;
|
||||
}
|
||||
void
|
||||
process_link(int in, int out, const tgba_succ_iterator* si)
|
||||
{
|
||||
// We might need to format out before process_state is called.
|
||||
name_map_::const_iterator i = name_.find(out);
|
||||
if (i == name_.end())
|
||||
{
|
||||
const state* s = si->current_state();
|
||||
process_state(s, out, 0);
|
||||
delete s;
|
||||
}
|
||||
|
||||
tgba_explicit::transition* t =
|
||||
out_->create_transition(name_[in], name_[out]);
|
||||
out_->add_conditions(t, si->current_condition());
|
||||
out_->add_acceptance_conditions(t, si->current_acceptance_conditions());
|
||||
}
|
||||
tgba_explicit::transition* t =
|
||||
out_->create_transition(name_[in], name_[out]);
|
||||
out_->add_conditions(t, si->current_condition());
|
||||
out_->add_acceptance_conditions(t, si->current_acceptance_conditions());
|
||||
}
|
||||
|
||||
private:
|
||||
tgba_explicit* out_;
|
||||
typedef std::map<int, std::string> name_map_;
|
||||
std::map<int, std::string> name_;
|
||||
};
|
||||
private:
|
||||
tgba_explicit* out_;
|
||||
typedef std::map<int, std::string> name_map_;
|
||||
std::map<int, std::string> name_;
|
||||
};
|
||||
|
||||
} // anonymous
|
||||
|
||||
tgba_explicit*
|
||||
tgba_dupexp_bfs(const tgba* aut)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue