Rename the class taa as taa_tgba.
* src/tgba/taa.cc, src/tgba/taa.hh: Rename as ... * src/tgba/taatgba.cc, src/tgba/taatgba.hh: ... these, and rename the class taa as taa_tgba. * src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2taa.hh, src/tgbaalgos/Makefile.am: Adjust. * src/tgbatest/ltl2tgba.cc, src/tgbatest/Makefile.am: Adjust. * src/tgbatest/taa.test: Rename as ... * src/tgbatest/taatgba.test ... this. * src/tgbatest/taa.cc: Rename as ... * src/tgbatest/taatgba.cc ... this, and adjust.
This commit is contained in:
parent
d362e752d1
commit
f00aa49dc3
9 changed files with 117 additions and 101 deletions
15
ChangeLog
15
ChangeLog
|
|
@ -1,3 +1,18 @@
|
||||||
|
2009-11-27 Guillaume Sadegh <sadegh@lrde.epita.fr>
|
||||||
|
|
||||||
|
Rename the class taa as taa_tgba.
|
||||||
|
|
||||||
|
* src/tgba/taa.cc, src/tgba/taa.hh: Rename as ...
|
||||||
|
* src/tgba/taatgba.cc, src/tgba/taatgba.hh: ... these, and
|
||||||
|
rename the class taa as taa_tgba.
|
||||||
|
* src/tgbaalgos/ltl2taa.cc, src/tgbaalgos/ltl2taa.hh,
|
||||||
|
src/tgbaalgos/Makefile.am: Adjust.
|
||||||
|
* src/tgbatest/ltl2tgba.cc, src/tgbatest/Makefile.am: Adjust.
|
||||||
|
* src/tgbatest/taa.test: Rename as ...
|
||||||
|
* src/tgbatest/taatgba.test ... this.
|
||||||
|
* src/tgbatest/taa.cc: Rename as ...
|
||||||
|
* src/tgbatest/taatgba.cc ... this, and adjust.
|
||||||
|
|
||||||
2009-11-26 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
2009-11-26 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
* src/tgbatest/ltl2tgba.cc (main): Fix typo to re-enable
|
* src/tgbatest/ltl2tgba.cc (main): Fix typo to re-enable
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ tgba_HEADERS = \
|
||||||
statebdd.hh \
|
statebdd.hh \
|
||||||
succiter.hh \
|
succiter.hh \
|
||||||
succiterconcrete.hh \
|
succiterconcrete.hh \
|
||||||
taa.hh \
|
taatgba.hh \
|
||||||
tgba.hh \
|
tgba.hh \
|
||||||
tgbabddconcrete.hh \
|
tgbabddconcrete.hh \
|
||||||
tgbabddconcretefactory.hh \
|
tgbabddconcretefactory.hh \
|
||||||
|
|
@ -60,7 +60,7 @@ libtgba_la_SOURCES = \
|
||||||
futurecondcol.cc \
|
futurecondcol.cc \
|
||||||
succiterconcrete.cc \
|
succiterconcrete.cc \
|
||||||
statebdd.cc \
|
statebdd.cc \
|
||||||
taa.cc \
|
taatgba.cc \
|
||||||
tgba.cc \
|
tgba.cc \
|
||||||
tgbabddconcrete.cc \
|
tgbabddconcrete.cc \
|
||||||
tgbabddconcretefactory.cc \
|
tgbabddconcretefactory.cc \
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,15 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "tgba/formula2bdd.hh"
|
#include "tgba/formula2bdd.hh"
|
||||||
#include "misc/bddop.hh"
|
#include "misc/bddop.hh"
|
||||||
#include "taa.hh"
|
#include "taatgba.hh"
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
/*----.
|
/*--------.
|
||||||
| taa |
|
| taa_tgba |
|
||||||
`----*/
|
`--------*/
|
||||||
|
|
||||||
taa::taa(bdd_dict* dict)
|
taa_tgba::taa_tgba(bdd_dict* dict)
|
||||||
: name_state_map_(), state_name_map_(), dict_(dict),
|
: name_state_map_(), state_name_map_(), dict_(dict),
|
||||||
all_acceptance_conditions_(bddfalse),
|
all_acceptance_conditions_(bddfalse),
|
||||||
all_acceptance_conditions_computed_(false),
|
all_acceptance_conditions_computed_(false),
|
||||||
|
|
@ -42,12 +42,12 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
taa::~taa()
|
taa_tgba::~taa_tgba()
|
||||||
{
|
{
|
||||||
ns_map::iterator i;
|
ns_map::iterator i;
|
||||||
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
||||||
{
|
{
|
||||||
taa::state::iterator i2;
|
taa_tgba::state::iterator i2;
|
||||||
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
||||||
delete *i2;
|
delete *i2;
|
||||||
delete i->second;
|
delete i->second;
|
||||||
|
|
@ -59,7 +59,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
taa::set_init_state(const std::string& s)
|
taa_tgba::set_init_state(const std::string& s)
|
||||||
{
|
{
|
||||||
std::vector<std::string> v(1);
|
std::vector<std::string> v(1);
|
||||||
v[0] = s;
|
v[0] = s;
|
||||||
|
|
@ -67,14 +67,14 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
taa::set_init_state(const std::vector<std::string>& s)
|
taa_tgba::set_init_state(const std::vector<std::string>& s)
|
||||||
{
|
{
|
||||||
init_ = add_state_set(s);
|
init_ = add_state_set(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
taa::transition*
|
taa_tgba::transition*
|
||||||
taa::create_transition(const std::string& s,
|
taa_tgba::create_transition(const std::string& s,
|
||||||
const std::vector<std::string>& d)
|
const std::vector<std::string>& d)
|
||||||
{
|
{
|
||||||
state* src = add_state(s);
|
state* src = add_state(s);
|
||||||
state_set* dst = add_state_set(d);
|
state_set* dst = add_state_set(d);
|
||||||
|
|
@ -86,8 +86,8 @@ namespace spot
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
taa::transition*
|
taa_tgba::transition*
|
||||||
taa::create_transition(const std::string& s, const std::string& d)
|
taa_tgba::create_transition(const std::string& s, const std::string& d)
|
||||||
{
|
{
|
||||||
std::vector<std::string> vec;
|
std::vector<std::string> vec;
|
||||||
vec.push_back(d);
|
vec.push_back(d);
|
||||||
|
|
@ -95,14 +95,14 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
taa::add_condition(transition* t, const ltl::formula* f)
|
taa_tgba::add_condition(transition* t, const ltl::formula* f)
|
||||||
{
|
{
|
||||||
t->condition &= formula_to_bdd(f, dict_, this);
|
t->condition &= formula_to_bdd(f, dict_, this);
|
||||||
f->destroy();
|
f->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
taa::add_acceptance_condition(transition* t, const ltl::formula* f)
|
taa_tgba::add_acceptance_condition(transition* t, const ltl::formula* f)
|
||||||
{
|
{
|
||||||
if (dict_->acc_map.find(f) == dict_->acc_map.end())
|
if (dict_->acc_map.find(f) == dict_->acc_map.end())
|
||||||
{
|
{
|
||||||
|
|
@ -114,7 +114,7 @@ namespace spot
|
||||||
ns_map::iterator i;
|
ns_map::iterator i;
|
||||||
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
||||||
{
|
{
|
||||||
taa::state::iterator i2;
|
taa_tgba::state::iterator i2;
|
||||||
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
||||||
(*i2)->acceptance_conditions &= neg;
|
(*i2)->acceptance_conditions &= neg;
|
||||||
}
|
}
|
||||||
|
|
@ -130,12 +130,12 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
taa::output(std::ostream& os) const
|
taa_tgba::output(std::ostream& os) const
|
||||||
{
|
{
|
||||||
ns_map::const_iterator i;
|
ns_map::const_iterator i;
|
||||||
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
for (i = name_state_map_.begin(); i != name_state_map_.end(); ++i)
|
||||||
{
|
{
|
||||||
taa::state::const_iterator i2;
|
taa_tgba::state::const_iterator i2;
|
||||||
os << "State: " << i->first << std::endl;
|
os << "State: " << i->first << std::endl;
|
||||||
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
for (i2 = i->second->begin(); i2 != i->second->end(); ++i2)
|
||||||
{
|
{
|
||||||
|
|
@ -147,16 +147,16 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
state*
|
state*
|
||||||
taa::get_init_state() const
|
taa_tgba::get_init_state() const
|
||||||
{
|
{
|
||||||
assert(init_);
|
assert(init_);
|
||||||
return new spot::state_set(init_);
|
return new spot::state_set(init_);
|
||||||
}
|
}
|
||||||
|
|
||||||
tgba_succ_iterator*
|
tgba_succ_iterator*
|
||||||
taa::succ_iter(const spot::state* state,
|
taa_tgba::succ_iter(const spot::state* state,
|
||||||
const spot::state* global_state,
|
const spot::state* global_state,
|
||||||
const tgba* global_automaton) const
|
const tgba* global_automaton) const
|
||||||
{
|
{
|
||||||
const spot::state_set* s = dynamic_cast<const spot::state_set*>(state);
|
const spot::state_set* s = dynamic_cast<const spot::state_set*>(state);
|
||||||
assert(s);
|
assert(s);
|
||||||
|
|
@ -166,13 +166,13 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd_dict*
|
bdd_dict*
|
||||||
taa::get_dict() const
|
taa_tgba::get_dict() const
|
||||||
{
|
{
|
||||||
return dict_;
|
return dict_;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
taa::format_state(const spot::state* s) const
|
taa_tgba::format_state(const spot::state* s) const
|
||||||
{
|
{
|
||||||
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
|
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
|
||||||
assert(se);
|
assert(se);
|
||||||
|
|
@ -181,7 +181,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
taa::all_acceptance_conditions() const
|
taa_tgba::all_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
if (!all_acceptance_conditions_computed_)
|
if (!all_acceptance_conditions_computed_)
|
||||||
{
|
{
|
||||||
|
|
@ -193,21 +193,21 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
taa::neg_acceptance_conditions() const
|
taa_tgba::neg_acceptance_conditions() const
|
||||||
{
|
{
|
||||||
return neg_acceptance_conditions_;
|
return neg_acceptance_conditions_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
taa::compute_support_conditions(const spot::state* s) const
|
taa_tgba::compute_support_conditions(const spot::state* s) const
|
||||||
{
|
{
|
||||||
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
|
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
|
||||||
assert(se);
|
assert(se);
|
||||||
const state_set* ss = se->get_state();
|
const state_set* ss = se->get_state();
|
||||||
|
|
||||||
bdd res = bddtrue;
|
bdd res = bddtrue;
|
||||||
taa::state_set::const_iterator i;
|
taa_tgba::state_set::const_iterator i;
|
||||||
taa::state::const_iterator j;
|
taa_tgba::state::const_iterator j;
|
||||||
for (i = ss->begin(); i != ss->end(); ++i)
|
for (i = ss->begin(); i != ss->end(); ++i)
|
||||||
for (j = (*i)->begin(); j != (*i)->end(); ++j)
|
for (j = (*i)->begin(); j != (*i)->end(); ++j)
|
||||||
res |= (*j)->condition;
|
res |= (*j)->condition;
|
||||||
|
|
@ -215,28 +215,28 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
taa::compute_support_variables(const spot::state* s) const
|
taa_tgba::compute_support_variables(const spot::state* s) const
|
||||||
{
|
{
|
||||||
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
|
const spot::state_set* se = dynamic_cast<const spot::state_set*>(s);
|
||||||
assert(se);
|
assert(se);
|
||||||
const state_set* ss = se->get_state();
|
const state_set* ss = se->get_state();
|
||||||
|
|
||||||
bdd res = bddtrue;
|
bdd res = bddtrue;
|
||||||
taa::state_set::const_iterator i;
|
taa_tgba::state_set::const_iterator i;
|
||||||
taa::state::const_iterator j;
|
taa_tgba::state::const_iterator j;
|
||||||
for (i = ss->begin(); i != ss->end(); ++i)
|
for (i = ss->begin(); i != ss->end(); ++i)
|
||||||
for (j = (*i)->begin(); j != (*i)->end(); ++j)
|
for (j = (*i)->begin(); j != (*i)->end(); ++j)
|
||||||
res &= bdd_support((*j)->condition);
|
res &= bdd_support((*j)->condition);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
taa::state*
|
taa_tgba::state*
|
||||||
taa::add_state(const std::string& name)
|
taa_tgba::add_state(const std::string& name)
|
||||||
{
|
{
|
||||||
ns_map::iterator i = name_state_map_.find(name);
|
ns_map::iterator i = name_state_map_.find(name);
|
||||||
if (i == name_state_map_.end())
|
if (i == name_state_map_.end())
|
||||||
{
|
{
|
||||||
taa::state* s = new taa::state;
|
taa_tgba::state* s = new taa_tgba::state;
|
||||||
name_state_map_[name] = s;
|
name_state_map_[name] = s;
|
||||||
state_name_map_[s] = name;
|
state_name_map_[s] = name;
|
||||||
return s;
|
return s;
|
||||||
|
|
@ -244,8 +244,8 @@ namespace spot
|
||||||
return i->second;
|
return i->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
taa::state_set*
|
taa_tgba::state_set*
|
||||||
taa::add_state_set(const std::vector<std::string>& names)
|
taa_tgba::add_state_set(const std::vector<std::string>& names)
|
||||||
{
|
{
|
||||||
state_set* ss = new state_set;
|
state_set* ss = new state_set;
|
||||||
for (unsigned i = 0; i < names.size(); ++i)
|
for (unsigned i = 0; i < names.size(); ++i)
|
||||||
|
|
@ -255,7 +255,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
taa::format_state_set(const taa::state_set* ss) const
|
taa_tgba::format_state_set(const taa_tgba::state_set* ss) const
|
||||||
{
|
{
|
||||||
state_set::const_iterator i1 = ss->begin();
|
state_set::const_iterator i1 = ss->begin();
|
||||||
sn_map::const_iterator i2;
|
sn_map::const_iterator i2;
|
||||||
|
|
@ -286,7 +286,7 @@ namespace spot
|
||||||
| state_set |
|
| state_set |
|
||||||
`----------*/
|
`----------*/
|
||||||
|
|
||||||
const taa::state_set*
|
const taa_tgba::state_set*
|
||||||
state_set::get_state() const
|
state_set::get_state() const
|
||||||
{
|
{
|
||||||
return s_;
|
return s_;
|
||||||
|
|
@ -298,14 +298,14 @@ namespace spot
|
||||||
const state_set* o = dynamic_cast<const state_set*>(other);
|
const state_set* o = dynamic_cast<const state_set*>(other);
|
||||||
assert(o);
|
assert(o);
|
||||||
|
|
||||||
const taa::state_set* s1 = get_state();
|
const taa_tgba::state_set* s1 = get_state();
|
||||||
const taa::state_set* s2 = o->get_state();
|
const taa_tgba::state_set* s2 = o->get_state();
|
||||||
|
|
||||||
if (s1->size() != s2->size())
|
if (s1->size() != s2->size())
|
||||||
return s1->size() - s2->size();
|
return s1->size() - s2->size();
|
||||||
|
|
||||||
taa::state_set::const_iterator it1 = s1->begin();
|
taa_tgba::state_set::const_iterator it1 = s1->begin();
|
||||||
taa::state_set::const_iterator it2 = s2->begin();
|
taa_tgba::state_set::const_iterator it2 = s2->begin();
|
||||||
while (it2 != s2->end())
|
while (it2 != s2->end())
|
||||||
{
|
{
|
||||||
int i = *it1++ - *it2++;
|
int i = *it1++ - *it2++;
|
||||||
|
|
@ -319,7 +319,7 @@ namespace spot
|
||||||
state_set::hash() const
|
state_set::hash() const
|
||||||
{
|
{
|
||||||
size_t res = 0;
|
size_t res = 0;
|
||||||
taa::state_set::const_iterator it = s_->begin();
|
taa_tgba::state_set::const_iterator it = s_->begin();
|
||||||
while (it != s_->end())
|
while (it != s_->end())
|
||||||
{
|
{
|
||||||
res ^= reinterpret_cast<const char*>(*it++) - static_cast<char*>(0);
|
res ^= reinterpret_cast<const char*>(*it++) - static_cast<char*>(0);
|
||||||
|
|
@ -332,7 +332,7 @@ namespace spot
|
||||||
state_set::clone() const
|
state_set::clone() const
|
||||||
{
|
{
|
||||||
if (delete_me_ && s_)
|
if (delete_me_ && s_)
|
||||||
return new spot::state_set(new taa::state_set(*s_), true);
|
return new spot::state_set(new taa_tgba::state_set(*s_), true);
|
||||||
else
|
else
|
||||||
return new spot::state_set(s_, false);
|
return new spot::state_set(s_, false);
|
||||||
}
|
}
|
||||||
|
|
@ -341,21 +341,22 @@ namespace spot
|
||||||
| taa_succ_iter |
|
| taa_succ_iter |
|
||||||
`--------------*/
|
`--------------*/
|
||||||
|
|
||||||
taa_succ_iterator::taa_succ_iterator(const taa::state_set* s, bdd all_acc)
|
taa_succ_iterator::taa_succ_iterator(const taa_tgba::state_set* s,
|
||||||
|
bdd all_acc)
|
||||||
: all_acceptance_conditions_(all_acc), seen_()
|
: all_acceptance_conditions_(all_acc), seen_()
|
||||||
{
|
{
|
||||||
if (s->empty())
|
if (s->empty())
|
||||||
{
|
{
|
||||||
taa::transition* t = new taa::transition;
|
taa_tgba::transition* t = new taa_tgba::transition;
|
||||||
t->condition = bddtrue;
|
t->condition = bddtrue;
|
||||||
t->acceptance_conditions = bddfalse;
|
t->acceptance_conditions = bddfalse;
|
||||||
t->dst = new taa::state_set;
|
t->dst = new taa_tgba::state_set;
|
||||||
succ_.push_back(t);
|
succ_.push_back(t);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bounds_t bounds;
|
bounds_t bounds;
|
||||||
for (taa::state_set::const_iterator i = s->begin(); i != s->end(); ++i)
|
for (taa_tgba::state_set::const_iterator i = s->begin(); i != s->end(); ++i)
|
||||||
bounds.push_back(std::make_pair((*i)->begin(), (*i)->end()));
|
bounds.push_back(std::make_pair((*i)->begin(), (*i)->end()));
|
||||||
|
|
||||||
/// Sorting might make the cartesian product faster by not
|
/// Sorting might make the cartesian product faster by not
|
||||||
|
|
@ -369,15 +370,15 @@ namespace spot
|
||||||
|
|
||||||
while (pos[0] != bounds[0].second)
|
while (pos[0] != bounds[0].second)
|
||||||
{
|
{
|
||||||
taa::transition* t = new taa::transition;
|
taa_tgba::transition* t = new taa_tgba::transition;
|
||||||
t->condition = bddtrue;
|
t->condition = bddtrue;
|
||||||
t->acceptance_conditions = bddfalse;
|
t->acceptance_conditions = bddfalse;
|
||||||
taa::state_set* ss = new taa::state_set;
|
taa_tgba::state_set* ss = new taa_tgba::state_set;
|
||||||
|
|
||||||
unsigned p;
|
unsigned p;
|
||||||
for (p = 0; p < pos.size() && t->condition != bddfalse; ++p)
|
for (p = 0; p < pos.size() && t->condition != bddfalse; ++p)
|
||||||
{
|
{
|
||||||
taa::state_set::const_iterator j;
|
taa_tgba::state_set::const_iterator j;
|
||||||
for (j = (*pos[p])->dst->begin(); j != (*pos[p])->dst->end(); ++j)
|
for (j = (*pos[p])->dst->begin(); j != (*pos[p])->dst->end(); ++j)
|
||||||
if ((*j)->size() > 0) // Remove sink states.
|
if ((*j)->size() > 0) // Remove sink states.
|
||||||
ss->insert(*j);
|
ss->insert(*j);
|
||||||
|
|
@ -475,7 +476,7 @@ namespace spot
|
||||||
taa_succ_iterator::current_state() const
|
taa_succ_iterator::current_state() const
|
||||||
{
|
{
|
||||||
assert(!done());
|
assert(!done());
|
||||||
return new spot::state_set(new taa::state_set(*(*i_)->dst), true);
|
return new spot::state_set(new taa_tgba::state_set(*(*i_)->dst), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdd
|
bdd
|
||||||
|
|
@ -19,8 +19,8 @@
|
||||||
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
// 02111-1307, USA.
|
// 02111-1307, USA.
|
||||||
|
|
||||||
#ifndef SPOT_TGBA_TAA_HH
|
#ifndef SPOT_TGBA_TAATGBA_HH
|
||||||
# define SPOT_TGBA_TAA_HH
|
# define SPOT_TGBA_TAATGBA_HH
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
|
|
@ -33,10 +33,10 @@
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
/// \brief A Transition-based Alternating Automaton (TAA).
|
/// \brief A Transition-based Alternating Automaton (TAA).
|
||||||
class taa : public tgba
|
class taa_tgba : public tgba
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
taa(bdd_dict* dict);
|
taa_tgba(bdd_dict* dict);
|
||||||
|
|
||||||
struct transition;
|
struct transition;
|
||||||
typedef std::list<transition*> state;
|
typedef std::list<transition*> state;
|
||||||
|
|
@ -66,7 +66,7 @@ namespace spot
|
||||||
void output(std::ostream& os) const;
|
void output(std::ostream& os) const;
|
||||||
|
|
||||||
/// TGBA interface.
|
/// TGBA interface.
|
||||||
virtual ~taa();
|
virtual ~taa_tgba();
|
||||||
virtual spot::state* get_init_state() const;
|
virtual spot::state* get_init_state() const;
|
||||||
virtual tgba_succ_iterator*
|
virtual tgba_succ_iterator*
|
||||||
succ_iter(const spot::state* local_state,
|
succ_iter(const spot::state* local_state,
|
||||||
|
|
@ -92,14 +92,14 @@ namespace spot
|
||||||
virtual bdd compute_support_variables(const spot::state* state) const;
|
virtual bdd compute_support_variables(const spot::state* state) const;
|
||||||
|
|
||||||
typedef Sgi::hash_map<
|
typedef Sgi::hash_map<
|
||||||
const std::string, taa::state*, string_hash
|
const std::string, taa_tgba::state*, string_hash
|
||||||
> ns_map;
|
> ns_map;
|
||||||
|
|
||||||
typedef Sgi::hash_map<
|
typedef Sgi::hash_map<
|
||||||
const taa::state*, std::string, ptr_hash<taa::state>
|
const taa_tgba::state*, std::string, ptr_hash<taa_tgba::state>
|
||||||
> sn_map;
|
> sn_map;
|
||||||
|
|
||||||
typedef std::vector<taa::state_set*> ss_vec;
|
typedef std::vector<taa_tgba::state_set*> ss_vec;
|
||||||
|
|
||||||
ns_map name_state_map_;
|
ns_map name_state_map_;
|
||||||
sn_map state_name_map_;
|
sn_map state_name_map_;
|
||||||
|
|
@ -107,31 +107,31 @@ namespace spot
|
||||||
mutable bdd all_acceptance_conditions_;
|
mutable bdd all_acceptance_conditions_;
|
||||||
mutable bool all_acceptance_conditions_computed_;
|
mutable bool all_acceptance_conditions_computed_;
|
||||||
bdd neg_acceptance_conditions_;
|
bdd neg_acceptance_conditions_;
|
||||||
taa::state_set* init_;
|
taa_tgba::state_set* init_;
|
||||||
ss_vec state_set_vec_;
|
ss_vec state_set_vec_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Disallow copy.
|
// Disallow copy.
|
||||||
taa(const taa& other);
|
taa_tgba(const taa_tgba& other);
|
||||||
taa& operator=(const taa& other);
|
taa_tgba& operator=(const taa_tgba& other);
|
||||||
|
|
||||||
/// \brief Return the taa::state for \a name, creating it if it
|
/// \brief Return the taa_tgba::state for \a name, creating it if it
|
||||||
/// does not exist. The first state added is the initial state
|
/// does not exist. The first state added is the initial state
|
||||||
/// which can be overridden with set_init_state.
|
/// which can be overridden with set_init_state.
|
||||||
taa::state* add_state(const std::string& name);
|
taa_tgba::state* add_state(const std::string& name);
|
||||||
|
|
||||||
/// \brief Return the taa::state_set for \a names.
|
/// \brief Return the taa::state_set for \a names.
|
||||||
taa::state_set* add_state_set(const std::vector<std::string>& names);
|
taa_tgba::state_set* add_state_set(const std::vector<std::string>& names);
|
||||||
|
|
||||||
/// \brief Format a taa::state_set as a string for printing.
|
/// \brief Format a taa::state_set as a string for printing.
|
||||||
std::string format_state_set(const taa::state_set* ss) const;
|
std::string format_state_set(const taa_tgba::state_set* ss) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Set of states deriving from spot::state.
|
/// Set of states deriving from spot::state.
|
||||||
class state_set : public spot::state
|
class state_set : public spot::state
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
state_set(const taa::state_set* s, bool delete_me = false)
|
state_set(const taa_tgba::state_set* s, bool delete_me = false)
|
||||||
: s_(s), delete_me_(delete_me)
|
: s_(s), delete_me_(delete_me)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -146,16 +146,16 @@ namespace spot
|
||||||
delete s_;
|
delete s_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const taa::state_set* get_state() const;
|
const taa_tgba::state_set* get_state() const;
|
||||||
private:
|
private:
|
||||||
const taa::state_set* s_;
|
const taa_tgba::state_set* s_;
|
||||||
bool delete_me_;
|
bool delete_me_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class taa_succ_iterator : public tgba_succ_iterator
|
class taa_succ_iterator : public tgba_succ_iterator
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
taa_succ_iterator(const taa::state_set* s, bdd all_acc);
|
taa_succ_iterator(const taa_tgba::state_set* s, bdd all_acc);
|
||||||
virtual ~taa_succ_iterator();
|
virtual ~taa_succ_iterator();
|
||||||
|
|
||||||
virtual void first();
|
virtual void first();
|
||||||
|
|
@ -169,12 +169,12 @@ namespace spot
|
||||||
private:
|
private:
|
||||||
/// Those typedefs are used to generate all possible successors in
|
/// Those typedefs are used to generate all possible successors in
|
||||||
/// the constructor using a cartesian product.
|
/// the constructor using a cartesian product.
|
||||||
typedef taa::state::const_iterator iterator;
|
typedef taa_tgba::state::const_iterator iterator;
|
||||||
typedef std::pair<iterator, iterator> iterator_pair;
|
typedef std::pair<iterator, iterator> iterator_pair;
|
||||||
typedef std::vector<iterator_pair> bounds_t;
|
typedef std::vector<iterator_pair> bounds_t;
|
||||||
typedef Sgi::hash_multimap<
|
typedef Sgi::hash_multimap<
|
||||||
const spot::state_set*, taa::transition*, state_ptr_hash, state_ptr_equal
|
const spot::state_set*, taa_tgba::transition*, state_ptr_hash,
|
||||||
> seen_map;
|
state_ptr_equal> seen_map;
|
||||||
|
|
||||||
struct distance_sort :
|
struct distance_sort :
|
||||||
public std::binary_function<const iterator_pair&,
|
public std::binary_function<const iterator_pair&,
|
||||||
|
|
@ -188,11 +188,11 @@ namespace spot
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<taa::transition*>::const_iterator i_;
|
std::vector<taa_tgba::transition*>::const_iterator i_;
|
||||||
std::vector<taa::transition*> succ_;
|
std::vector<taa_tgba::transition*> succ_;
|
||||||
bdd all_acceptance_conditions_;
|
bdd all_acceptance_conditions_;
|
||||||
seen_map seen_;
|
seen_map seen_;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SPOT_TGBA_TAA_HH
|
#endif // SPOT_TGBA_TAATGBA_HH
|
||||||
|
|
@ -39,7 +39,7 @@ namespace spot
|
||||||
class ltl2taa_visitor : public const_visitor
|
class ltl2taa_visitor : public const_visitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ltl2taa_visitor(taa* res, language_containment_checker* lcc,
|
ltl2taa_visitor(taa_tgba* res, language_containment_checker* lcc,
|
||||||
bool refined = false, bool negated = false)
|
bool refined = false, bool negated = false)
|
||||||
: res_(res), refined_(refined), negated_(negated),
|
: res_(res), refined_(refined), negated_(negated),
|
||||||
lcc_(lcc), init_(), succ_(), to_free_()
|
lcc_(lcc), init_(), succ_(), to_free_()
|
||||||
|
|
@ -51,7 +51,7 @@ namespace spot
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
taa*
|
taa_tgba*
|
||||||
result()
|
result()
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < to_free_.size(); ++i)
|
for (unsigned i = 0; i < to_free_.size(); ++i)
|
||||||
|
|
@ -73,7 +73,7 @@ namespace spot
|
||||||
std::vector<std::string> dst;
|
std::vector<std::string> dst;
|
||||||
|
|
||||||
dst.push_back(std::string("sink"));
|
dst.push_back(std::string("sink"));
|
||||||
taa::transition* t = res_->create_transition(init_, dst);
|
taa_tgba::transition* t = res_->create_transition(init_, dst);
|
||||||
res_->add_condition(t, f->clone());
|
res_->add_condition(t, f->clone());
|
||||||
succ_state ss = { dst, f, constant::true_instance() };
|
succ_state ss = { dst, f, constant::true_instance() };
|
||||||
succ_.push_back(ss);
|
succ_.push_back(ss);
|
||||||
|
|
@ -146,7 +146,7 @@ namespace spot
|
||||||
init_ = to_string(node);
|
init_ = to_string(node);
|
||||||
std::vector<succ_state>::iterator i1;
|
std::vector<succ_state>::iterator i1;
|
||||||
std::vector<succ_state>::iterator i2;
|
std::vector<succ_state>::iterator i2;
|
||||||
taa::transition* t = 0;
|
taa_tgba::transition* t = 0;
|
||||||
bool contained = false;
|
bool contained = false;
|
||||||
switch (node->op())
|
switch (node->op())
|
||||||
{
|
{
|
||||||
|
|
@ -232,7 +232,7 @@ namespace spot
|
||||||
|
|
||||||
init_ = to_string(node);
|
init_ = to_string(node);
|
||||||
std::vector<succ_state>::iterator i;
|
std::vector<succ_state>::iterator i;
|
||||||
taa::transition* t = 0;
|
taa_tgba::transition* t = 0;
|
||||||
switch (node->op())
|
switch (node->op())
|
||||||
{
|
{
|
||||||
case multop::And:
|
case multop::And:
|
||||||
|
|
@ -305,7 +305,7 @@ namespace spot
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
taa* res_;
|
taa_tgba* res_;
|
||||||
bool refined_;
|
bool refined_;
|
||||||
bool negated_;
|
bool negated_;
|
||||||
language_containment_checker* lcc_;
|
language_containment_checker* lcc_;
|
||||||
|
|
@ -373,7 +373,7 @@ namespace spot
|
||||||
};
|
};
|
||||||
} // anonymous
|
} // anonymous
|
||||||
|
|
||||||
taa*
|
taa_tgba*
|
||||||
ltl_to_taa(const ltl::formula* f, bdd_dict* dict, bool refined_rules)
|
ltl_to_taa(const ltl::formula* f, bdd_dict* dict, bool refined_rules)
|
||||||
{
|
{
|
||||||
// TODO: s/unabbreviate_ltl/unabbreviate_logic/
|
// TODO: s/unabbreviate_ltl/unabbreviate_logic/
|
||||||
|
|
@ -381,7 +381,7 @@ namespace spot
|
||||||
const ltl::formula* f2 = ltl::negative_normal_form(f1);
|
const ltl::formula* f2 = ltl::negative_normal_form(f1);
|
||||||
f1->destroy();
|
f1->destroy();
|
||||||
|
|
||||||
spot::taa* res = new spot::taa(dict);
|
spot::taa_tgba* res = new spot::taa_tgba(dict);
|
||||||
bdd_dict b;
|
bdd_dict b;
|
||||||
language_containment_checker* lcc =
|
language_containment_checker* lcc =
|
||||||
new language_containment_checker(&b, false, false, false, false);
|
new language_containment_checker(&b, false, false, false, false);
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
# define SPOT_TGBAALGOS_LTL2TAA_HH
|
# define SPOT_TGBAALGOS_LTL2TAA_HH
|
||||||
|
|
||||||
#include "ltlast/formula.hh"
|
#include "ltlast/formula.hh"
|
||||||
#include "tgba/taa.hh"
|
#include "tgba/taatgba.hh"
|
||||||
|
|
||||||
namespace spot
|
namespace spot
|
||||||
{
|
{
|
||||||
|
|
@ -49,8 +49,8 @@ namespace spot
|
||||||
/// \param dict The spot::bdd_dict the constructed automata should use.
|
/// \param dict The spot::bdd_dict the constructed automata should use.
|
||||||
/// \param refined_rules If this parameter is set, refined rules are used.
|
/// \param refined_rules If this parameter is set, refined rules are used.
|
||||||
/// \return A spot::taa that recognizes the language of \a f.
|
/// \return A spot::taa that recognizes the language of \a f.
|
||||||
taa* ltl_to_taa(const ltl::formula* f, bdd_dict* dict,
|
taa_tgba* ltl_to_taa(const ltl::formula* f, bdd_dict* dict,
|
||||||
bool refined_rules = false);
|
bool refined_rules = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // SPOT_TGBAALGOS_LTL2TAA_HH
|
#endif // SPOT_TGBAALGOS_LTL2TAA_HH
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ check_PROGRAMS = \
|
||||||
readsave \
|
readsave \
|
||||||
reductgba \
|
reductgba \
|
||||||
reduccmp \
|
reduccmp \
|
||||||
taa \
|
taatgba \
|
||||||
tgbaread \
|
tgbaread \
|
||||||
tripprod
|
tripprod
|
||||||
|
|
||||||
|
|
@ -63,7 +63,7 @@ readsave_SOURCES = readsave.cc
|
||||||
reductgba_SOURCES = reductgba.cc
|
reductgba_SOURCES = reductgba.cc
|
||||||
reduccmp_SOURCES = reductgba.cc
|
reduccmp_SOURCES = reductgba.cc
|
||||||
reduccmp_CXXFLAGS = -DREDUCCMP
|
reduccmp_CXXFLAGS = -DREDUCCMP
|
||||||
taa_SOURCES = taa.cc
|
taatgba_SOURCES = taatgba.cc
|
||||||
tgbaread_SOURCES = tgbaread.cc
|
tgbaread_SOURCES = tgbaread.cc
|
||||||
tripprod_SOURCES = tripprod.cc
|
tripprod_SOURCES = tripprod.cc
|
||||||
|
|
||||||
|
|
@ -72,7 +72,7 @@ tripprod_SOURCES = tripprod.cc
|
||||||
TESTS = \
|
TESTS = \
|
||||||
eltl2tgba.test \
|
eltl2tgba.test \
|
||||||
explicit.test \
|
explicit.test \
|
||||||
taa.test \
|
taatgba.test \
|
||||||
tgbaread.test \
|
tgbaread.test \
|
||||||
readsave.test \
|
readsave.test \
|
||||||
ltl2tgba.test \
|
ltl2tgba.test \
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
#include "ltlenv/defaultenv.hh"
|
#include "ltlenv/defaultenv.hh"
|
||||||
#include "ltlast/allnodes.hh"
|
#include "ltlast/allnodes.hh"
|
||||||
#include "tgbaalgos/dotty.hh"
|
#include "tgbaalgos/dotty.hh"
|
||||||
#include "tgba/taa.hh"
|
#include "tgba/taatgba.hh"
|
||||||
|
|
||||||
int
|
int
|
||||||
main()
|
main()
|
||||||
|
|
@ -34,11 +34,11 @@ main()
|
||||||
|
|
||||||
spot::ltl::default_environment& e =
|
spot::ltl::default_environment& e =
|
||||||
spot::ltl::default_environment::instance();
|
spot::ltl::default_environment::instance();
|
||||||
spot::taa* a = new spot::taa(dict);
|
spot::taa_tgba* a = new spot::taa_tgba(dict);
|
||||||
|
|
||||||
typedef spot::taa::transition trans;
|
typedef spot::taa_tgba::transition trans;
|
||||||
typedef spot::taa::state state;
|
typedef spot::taa_tgba::state state;
|
||||||
typedef spot::taa::state_set state_set;
|
typedef spot::taa_tgba::state_set state_set;
|
||||||
|
|
||||||
std::string ss1_values[] = { "state 2", "state 3" };
|
std::string ss1_values[] = { "state 2", "state 3" };
|
||||||
std::vector<std::string> ss1_vector(ss1_values, ss1_values + 2);
|
std::vector<std::string> ss1_vector(ss1_values, ss1_values + 2);
|
||||||
|
|
@ -3,4 +3,4 @@
|
||||||
. ./defs || exit -1
|
. ./defs || exit -1
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
run 0 ../taa || exit 1
|
run 0 ../taatgba || exit 1
|
||||||
Loading…
Add table
Add a link
Reference in a new issue