* src/ltlvisit/reducform.cc, src/tgba/tgbareduc.cc,

src/tgbaalgos/reductgba_sim.cc, src/tgbaalgos/reductgba_sim.hh
src/tgbaalgos/reductgba_sim_del.cc, src/tgbatest/reduccmp.test,
src/tgbatest/reductgba.cc: 80 columns and style.
This commit is contained in:
martinez 2004-06-22 17:24:46 +00:00
parent f61b69ef3d
commit 2f1a67d927
8 changed files with 84 additions and 86 deletions

View file

@ -54,23 +54,11 @@ namespace spot
bool exist = false;
for (sn_v::iterator i = lnode_succ->begin();
i != lnode_succ->end(); ++i)
// Be careful, we have to compare two duplicator node
if (*i == n)
if ((*i)->compare(n) == true)
exist = true;
if (exist)
return false;
// TO TEST FOR THE DIRECT SIMULATION //
/*
bool exist = false;
for (sn_v::iterator i = lnode_succ->begin();
i != lnode_succ->end(); ++i)
// Be careful, we have to compare two duplicator node
if (dynamic_cast<duplicator_node*>(*i)->compare(n) == 0)
exist = true;
if (exist)
return false;
*/
///////////////
lnode_succ->push_back(n);
return true;
}
@ -93,14 +81,12 @@ namespace spot
void
spoiler_node::add_pred(spoiler_node* n)
{
// TO TEST FOR THE DIRECT SIMULATION //
bool exist = false;
for (sn_v::iterator i = lnode_pred->begin();
i != lnode_pred->end(); ++i)
if ((*i)->compare(n) == 0)
exist = true;
if (!exist)
///////////////
lnode_pred->push_back(n);
}
@ -121,7 +107,7 @@ namespace spot
{
not_win |= (*i)->not_win;
}
return (change != not_win);
return change != not_win;
}
std::string
@ -218,7 +204,7 @@ namespace spot
}
}
return (change != not_win);
return change != not_win;
}
std::string
@ -407,12 +393,12 @@ namespace spot
void
parity_game_graph_direct::build_couple()
{
tgba_succ_iterator* si = NULL;
tgba_succ_iterator* si = 0;
typedef Sgi::pair<bdd, bdd> couple_bdd;
couple_bdd *p = NULL;
Sgi::vector<couple_bdd*>* trans = NULL;
couple_bdd *p = 0;
Sgi::vector<couple_bdd*>* trans = 0;
bool exist = false;
spot::state* s = NULL;
spot::state* s = 0;
for (Sgi::vector<const state*>::iterator i = tgba_state_.begin();
i != tgba_state_.end(); ++i)
@ -469,11 +455,13 @@ namespace spot
s != tgba_state_.end(); ++s)
{
duplicator_node* n2
= new duplicator_node(*i,
*s,
si->current_condition(),
si->current_acceptance_conditions(),
nb_node_parity_game++);
= new
duplicator_node(*i,
*s,
si->current_condition(),
si
->current_acceptance_conditions(),
nb_node_parity_game++);
duplicator_vertice_.push_back(n2);
}
}
@ -498,7 +486,7 @@ namespace spot
{
int nb_ds = 0;
int nb_sd = 0;
spot::state* s = NULL;
spot::state* s = 0;
// for each couple of (spoiler, duplicator)
for (Sgi::vector<spoiler_node*>::iterator i
@ -509,7 +497,8 @@ namespace spot
j != duplicator_vertice_.end(); ++j)
{
// We add a link between a duplicator and a spoiler.
if ((*j)->get_spoiler_node()->compare((*i)->get_spoiler_node()) == 0)
if ((*j)->get_spoiler_node()
->compare((*i)->get_spoiler_node()) == 0)
{
tgba_succ_iterator* si
= automata_->succ_iter((*j)->get_duplicator_node());
@ -529,7 +518,8 @@ namespace spot
}
// We add a link between a spoiler and a duplicator.
if ((*j)->get_duplicator_node()->compare((*i)->get_duplicator_node()) == 0)
if ((*j)->get_duplicator_node()
->compare((*i)->get_duplicator_node()) == 0)
{
tgba_succ_iterator* si
= automata_->succ_iter((*i)->get_spoiler_node());
@ -579,7 +569,7 @@ namespace spot
parity_game_graph_direct::get_relation()
{
simulation_relation* rel = new simulation_relation();
state_couple* p = NULL;
state_couple* p = 0;
seen_map::iterator j;
for (Sgi::vector<spoiler_node*>::iterator i
@ -638,7 +628,7 @@ namespace spot
void
free_relation_simulation(simulation_relation* rel)
{
if (rel == NULL)
if (rel == 0)
return;
Sgi::hash_map<const spot::state*, int,
@ -658,13 +648,13 @@ namespace spot
delete *i;
}
delete rel;
rel = NULL;
rel = 0;
for (j = seen.begin(); j != seen.end();)
{
const state* ptr = j->first;
++j;
delete(ptr);
delete ptr;
}
}

View file

@ -63,7 +63,7 @@ namespace spot
/// Compute a delayed simulation relation on state of tgba \a f.
/// FIXME : this method is incorrect !!
/// Don't use it !!
simulation_relation* get_delayed_relation_simulation(const tgba* a,
simulation_relation* get_delayed_relation_simulation(const tgba* a,
int opt = -1);
/// To free a simulation relation.

View file

@ -331,12 +331,12 @@ namespace spot
nb_spoiler = 0;
nb_duplicator = 0;
tgba_succ_iterator* si = NULL;
tgba_succ_iterator* si = 0;
typedef Sgi::pair<bdd, bdd> couple_bdd;
couple_bdd *p = NULL;
Sgi::vector<couple_bdd*>* trans = NULL;
couple_bdd *p = 0;
Sgi::vector<couple_bdd*>* trans = 0;
bool exist = false;
spot::state* s = NULL;
spot::state* s = 0;
s_v::iterator i;
for (i = tgba_state_.begin(); i != tgba_state_.end(); ++i)
@ -448,7 +448,7 @@ namespace spot
//std::cout << "build link" << std::endl;
int nb_ds = 0;
int nb_sd = 0;
spot::state* s = NULL;
spot::state* s = 0;
// for each couple of (spoiler, duplicator)
sn_v::iterator i;
@ -557,7 +557,7 @@ namespace spot
// We create when it's possible a duplicator node
// and recursively his successor.
//spot::state* s1 = NULL;
//spot::state* s1 = 0;
//bool exist_pred = false;
sn_v::iterator i1;
@ -574,7 +574,7 @@ namespace spot
{
tgba_succ_iterator* si;
s_v::iterator i2;
spot::state* s2 = NULL;
spot::state* s2 = 0;
for (i2 = tgba_state_.begin();
i2 != tgba_state_.end(); ++i2)
{
@ -634,10 +634,10 @@ namespace spot
btmp,
nb_node_parity_game++);
// dn is already a successor of sn.
std::cout << "spoiler call add_succ" << std::endl;
if (!(sn->add_succ(dn)))
{
// dn is already a successor of sn.
std::cout << "dn is already a successor of sn."
<< std::endl;
continue;
@ -645,12 +645,6 @@ namespace spot
std::cout << "dn is a new successor of sn." << std::endl;
(dn)->add_pred(sn);
/* TEST
bdd btmp2 =
dynamic_cast<spoiler_node_delayed*>(sn)->
get_acceptance_condition_visited();
*/
build_recurse_successor_duplicator(dn, sn);
}
delete s;
@ -664,7 +658,7 @@ namespace spot
void
parity_game_graph_delayed::
build_recurse_successor_duplicator(duplicator_node* dn,
spoiler_node* sn)
spoiler_node*)
{
std::cout << "build_recurse_successor_duplicator" << std::endl;
@ -675,9 +669,13 @@ namespace spot
{
std::cout << "transition " << i++ << std::endl;
/*
bdd btmp =
dynamic_cast<spoiler_node_delayed*>(sn)->
get_acceptance_condition_visited();
*/
bdd btmp = dn->get_acc();
bdd btmp2 = btmp - si->current_acceptance_conditions();
/*
@ -694,7 +692,7 @@ namespace spot
if (s->compare(*i1) == 0)
{
spoiler_node_delayed* sn_n
= add_spoiler_node_delayed(sn->get_spoiler_node(),
= add_spoiler_node_delayed(dn->get_spoiler_node(),
*i1,
btmp2,
nb_node_parity_game++);
@ -737,7 +735,7 @@ namespace spot
= duplicator_vertice_.begin();
i != duplicator_vertice_.end(); ++i)
{
std::cout << "COMPARE" << std::endl;
//std::cout << "COMPARE" << std::endl;
if (dn_n->compare(*i))
{
exist = true;
@ -768,7 +766,7 @@ namespace spot
= spoiler_vertice_.begin();
i != spoiler_vertice_.end(); ++i)
{
std::cout << "COMPARE" << std::endl;
//std::cout << "COMPARE" << std::endl;
if (sn_n->compare(*i))
{
exist = true;
@ -873,7 +871,7 @@ namespace spot
parity_game_graph_delayed::get_relation()
{
simulation_relation* rel = new simulation_relation();
state_couple* p = NULL;
state_couple* p = 0;
seen_map::iterator j;
for (Sgi::vector<spoiler_node*>::iterator i
@ -922,7 +920,7 @@ namespace spot
this->build_link();
std::cout << "prune" << std::endl;
this->prune();
std::cout << "lift" << std::endl;
std::cout << "lift : " << nb_spoiler_loose_ << std::endl;
this->lift();
std::cout << "END" << std::endl;
//this->print(std::cout);
@ -934,15 +932,18 @@ namespace spot
{
/// FIXME : this method is incorrect !!
/// Don't use it !!
/*
parity_game_graph_delayed* G = new parity_game_graph_delayed(f);
simulation_relation* rel = G->get_relation();
if (opt == 1)
parity_game_graph_delayed* G = new parity_game_graph_delayed(f);
simulation_relation* rel = G->get_relation();
if ((opt == 1) || (opt == -1))
G->print(std::cout);
delete G;
delete G;
return rel;
/*
return get_direct_relation_simulation(f, opt);
*/
return get_direct_relation_simulation(f, opt);
}
}