* src/tgbatest/spotlbtt.test: We don't check the post-reduction
with scc and delayed simulation. * src/tgbatest/ltl2tgba.cc: Adjust parameters. * src/tgbatest/reductgba.cc, src/tgbatest/Makefile.am: More Test. * src/tgbaalgos/reductgba_sim_del.cc: Not finish, lot of bugs. * src/tgbaalgos/reductgba_sim.hh, src/tgbaalgos/reductgba_sim.cc: Remove some useless comments. * src/tgba/tgbareduc.cc, src/tgba/tgbareduc.hh: Bug in SCC. * src/ltlvisit/reducform.cc: Correct some bug for multop. * src/ltltest/reduccmp.test: More Test. * src/ltltest/reduc.cc: Thinko * src/ltltest/equals.cc: Reduction compare
This commit is contained in:
parent
84e72c8764
commit
c769f74750
16 changed files with 429 additions and 250 deletions
|
|
@ -33,7 +33,6 @@ namespace spot
|
|||
{
|
||||
num_ = num;
|
||||
sc_ = new state_couple(d_node, s_node);
|
||||
//lnode_succ = new Sgi::vector<spoiler_node*>;
|
||||
lnode_succ = new sn_v;
|
||||
lnode_pred = new sn_v;
|
||||
this->not_win = false;
|
||||
|
|
@ -48,33 +47,48 @@ namespace spot
|
|||
delete sc_;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
spoiler_node::add_succ(spoiler_node* n)
|
||||
{
|
||||
/*
|
||||
bool exist = false;
|
||||
for (sn_v::iterator i = lnode_succ->begin();
|
||||
i != lnode_succ->end();)
|
||||
if (*i == n)
|
||||
exist = true;
|
||||
if (exist)
|
||||
return false;
|
||||
*/
|
||||
lnode_succ->push_back(n);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
spoiler_node::del_succ(spoiler_node* n)
|
||||
{
|
||||
//std::cout << "del_succ : begin" << std::endl;
|
||||
for (sn_v::iterator i = lnode_succ->begin();
|
||||
i != lnode_succ->end();)
|
||||
{
|
||||
if (*i == n)
|
||||
{
|
||||
//std::cout << "erase" << std::endl;
|
||||
i = lnode_succ->erase(i);
|
||||
}
|
||||
else
|
||||
++i;
|
||||
}
|
||||
//std::cout << "del_succ : end" << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
spoiler_node::add_pred(spoiler_node* n)
|
||||
{
|
||||
/*
|
||||
bool exist = false;
|
||||
for (sn_v::iterator i = lnode_pred->begin();
|
||||
i != lnode_pred->end();)
|
||||
if (*i == n)
|
||||
exist = true;
|
||||
if (!exist)
|
||||
*/
|
||||
lnode_pred->push_back(n);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,10 @@ namespace spot
|
|||
int num);
|
||||
virtual ~spoiler_node();
|
||||
|
||||
void add_succ(spoiler_node* n);
|
||||
/// \brief Add a successor.
|
||||
/// Return true if \a n wasn't yet in the list of successor,
|
||||
/// false eitherwise.
|
||||
bool add_succ(spoiler_node* n);
|
||||
void del_succ(spoiler_node* n);
|
||||
virtual void add_pred(spoiler_node* n);
|
||||
virtual void del_pred();
|
||||
|
|
@ -300,7 +303,8 @@ namespace spot
|
|||
virtual void build_couple();
|
||||
virtual void build_link();
|
||||
void build_recurse_successor_spoiler(spoiler_node* sn);
|
||||
void build_recurse_successor_duplicator(duplicator_node* dn);
|
||||
void build_recurse_successor_duplicator(duplicator_node* dn,
|
||||
spoiler_node* sn);
|
||||
|
||||
/// \brief The Jurdzinski's lifting algorithm.
|
||||
void lift();
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ namespace spot
|
|||
*/
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void
|
||||
parity_game_graph_delayed::build_couple()
|
||||
{
|
||||
|
|
@ -512,8 +512,8 @@ namespace spot
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
// We build only node which are reachable
|
||||
void
|
||||
parity_game_graph_delayed::build_couple()
|
||||
|
|
@ -546,13 +546,15 @@ namespace spot
|
|||
// We create when it's possible a duplicator node
|
||||
// and recursively his successor.
|
||||
|
||||
spot::state* s1 = NULL;
|
||||
bool exist_pred = false;
|
||||
//spot::state* s1 = NULL;
|
||||
//bool exist_pred = false;
|
||||
|
||||
sn_v::iterator i1;
|
||||
for (i1 = spoiler_vertice_.begin(); i1 != spoiler_vertice_.end(); ++i1)
|
||||
{
|
||||
/*
|
||||
exist_pred = false;
|
||||
|
||||
// We check if there is a predecessor only if the duplicator
|
||||
// is the initial state.
|
||||
s1 = automata_->get_init_state();
|
||||
|
|
@ -577,6 +579,7 @@ namespace spot
|
|||
|
||||
if (!exist_pred)
|
||||
continue;
|
||||
*/
|
||||
|
||||
// We add a link between a spoiler and a (new) duplicator.
|
||||
// The acc of the duplicator must contains the
|
||||
|
|
@ -590,10 +593,15 @@ namespace spot
|
|||
void
|
||||
parity_game_graph_delayed::build_recurse_successor_spoiler(spoiler_node* sn)
|
||||
{
|
||||
std::cout << "build_recurse_successor_spoiler" << std::endl;
|
||||
|
||||
tgba_succ_iterator* si = automata_->succ_iter(sn->get_spoiler_node());
|
||||
|
||||
int i = 0;
|
||||
for (si->first(); !si->done(); si->next())
|
||||
{
|
||||
std::cout << "transition " << i++ << std::endl;
|
||||
|
||||
bdd btmp = si->current_acceptance_conditions() |
|
||||
dynamic_cast<spoiler_node_delayed*>(sn)->
|
||||
get_acceptance_condition_visited();
|
||||
|
|
@ -614,10 +622,18 @@ namespace spot
|
|||
nb_node_parity_game++);
|
||||
duplicator_vertice_.push_back(dn);
|
||||
|
||||
sn->add_succ(dn);
|
||||
// dn is already a successor of sn.
|
||||
if (!(sn->add_succ(dn)))
|
||||
continue;
|
||||
(dn)->add_pred(sn);
|
||||
|
||||
build_recurse_successor_duplicator(dn);
|
||||
/* TEST
|
||||
bdd btmp2 =
|
||||
dynamic_cast<spoiler_node_delayed*>(sn)->
|
||||
get_acceptance_condition_visited();
|
||||
*/
|
||||
|
||||
build_recurse_successor_duplicator(dn, sn);
|
||||
}
|
||||
delete s;
|
||||
}
|
||||
|
|
@ -629,12 +645,18 @@ namespace spot
|
|||
|
||||
void
|
||||
parity_game_graph_delayed::
|
||||
build_recurse_successor_duplicator(duplicator_node* dn)
|
||||
build_recurse_successor_duplicator(duplicator_node* dn,
|
||||
spoiler_node* sn)
|
||||
{
|
||||
tgba_succ_iterator* si = automata_->succ_iter(sn->get_spoiler_node());
|
||||
std::cout << "build_recurse_successor_duplicator" << std::endl;
|
||||
|
||||
tgba_succ_iterator* si = automata_->succ_iter(dn->get_duplicator_node());
|
||||
|
||||
int i = 0;
|
||||
for (si->first(); !si->done(); si->next())
|
||||
{
|
||||
std::cout << "transition " << i++ << std::endl;
|
||||
|
||||
bdd btmp =
|
||||
dynamic_cast<spoiler_node_delayed*>(sn)->
|
||||
get_acceptance_condition_visited();
|
||||
|
|
@ -648,17 +670,19 @@ namespace spot
|
|||
s = si->current_state();
|
||||
if (s->compare(*i1) == 0)
|
||||
{
|
||||
spoiler_node_delayed* sn
|
||||
spoiler_node_delayed* sn_n
|
||||
= new spoiler_node_delayed(sn->get_spoiler_node(),
|
||||
*i1,
|
||||
bddtmp2,
|
||||
btmp2,
|
||||
nb_node_parity_game++);
|
||||
spoiler_vertice_.push_back(n1);
|
||||
spoiler_vertice_.push_back(sn_n);
|
||||
|
||||
sn->add_succ(dn);
|
||||
(dn)->add_pred(sn);
|
||||
// dn is already a successor of sn.
|
||||
if (!(dn->add_succ(sn_n)))
|
||||
continue;
|
||||
(sn_n)->add_pred(dn);
|
||||
|
||||
build_recurse_successor_spoiler(sn);
|
||||
build_recurse_successor_spoiler(sn_n);
|
||||
|
||||
}
|
||||
delete s;
|
||||
|
|
@ -668,7 +692,7 @@ namespace spot
|
|||
delete si;
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
parity_game_graph_delayed::add_dup_node(state*,
|
||||
|
|
@ -686,6 +710,7 @@ namespace spot
|
|||
|
||||
while (change)
|
||||
{
|
||||
std::cout << "prune::change = true" << std::endl;
|
||||
change = false;
|
||||
for (Sgi::vector<duplicator_node*>::iterator i
|
||||
= duplicator_vertice_.begin();
|
||||
|
|
@ -716,7 +741,7 @@ namespace spot
|
|||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "prune::change = false" << std::endl;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -728,6 +753,7 @@ namespace spot
|
|||
|
||||
while (change)
|
||||
{
|
||||
std::cout << "lift::change = true" << std::endl;
|
||||
change = false;
|
||||
for (Sgi::vector<duplicator_node*>::iterator i
|
||||
= duplicator_vertice_.begin();
|
||||
|
|
@ -742,7 +768,7 @@ namespace spot
|
|||
change |= (*i)->set_win();
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "lift::change = false" << std::endl;
|
||||
}
|
||||
|
||||
simulation_relation*
|
||||
|
|
@ -792,10 +818,15 @@ namespace spot
|
|||
return;
|
||||
this->build_sub_set_acc_cond();
|
||||
*/
|
||||
std::cout << "build couple" << std::endl;
|
||||
this->build_couple();
|
||||
std::cout << "build link" << std::endl;
|
||||
this->build_link();
|
||||
std::cout << "prune" << std::endl;
|
||||
this->prune();
|
||||
std::cout << "lift" << std::endl;
|
||||
this->lift();
|
||||
std::cout << "END" << std::endl;
|
||||
//this->print(std::cout);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue