Address several issues reported by cppcheck all over the place.
* src/bin/common_finput.cc, src/tgbaalgos/lbtt.cc: Use !empty() instead of size() > 0. * src/bin/ltl2tgta.cc, src/kripke/kripkeexplicit.cc, src/tgbatest/complementation.cc: Avoid useless assignments. * src/bin/ltlcross.cc: Correct mistaken assignment inside assert(). * src/evtgba/symbol.hh, src/tgba/tgbabddcoredata.cc, src/tgba/tgbabddcoredata.hh, src/tgba/tgbasafracomplement.cc (operator=): Do not return a const reference. * src/evtgbatest/ltl2evtgba.cc, src/evtgbatest/product.cc, src/evtgbatest/product.cc: Check indices before using them, not after. * src/kripke/kripkeexplicit.cc, src/kripke/kripkeexplicit.hh, src/tgbatest/randtgba.cc: Pass constant strings by reference. * src/kripke/kripkeprint.cc, src/tgbaalgos/simulation.cc: Remove a useless operation. * src/ltlvisit/simplify.cc: Remove a duplicate condition. * src/misc/formater.hh: Remove unused attribute. * src/misc/modgray.cc: Initialize done_ in the constructor. * src/saba/explicitstateconjunction.cc, src/saba/explicitstateconjunction.hh (operator=): Fix prototype. * src/saba/sabacomplementtgba.cc: Remove unused default constructor. * src/ta/taexplicit.cc, src/ta/taproduct.cc, src/ta/tgtaproduct.cc, src/ta/tgtaproduct.hh, src/taalgos/emptinessta.cc, src/taalgos/minimize.cc, src/taalgos/reachiter.cc, src/taalgos/tgba2ta.cc, src/tgbaalgos/cutscc.cc: Use C++ casts, and ++it instead of it++. * src/taalgos/dotty.cc, src/tgbatest/ltl2tgba.cc: Refine the scope of variables. * src/tgba/tgbakvcomplement.hh (bdd_order): Always initialize bdd_. * src/tgba/tgbasgba.cc, src/tgba/wdbacomp.cc: Use the initialization line to initialize all members.
This commit is contained in:
parent
a3b49f1108
commit
a577850eb3
36 changed files with 117 additions and 123 deletions
|
|
@ -94,7 +94,7 @@ job_processor::process_string(const std::string& input,
|
|||
spot::ltl::parse_error_list pel;
|
||||
const spot::ltl::formula* f = parse_formula(input, pel);
|
||||
|
||||
if (!f || pel.size() > 0)
|
||||
if (!f || !pel.empty())
|
||||
{
|
||||
if (filename)
|
||||
error_at_line(0, 0, filename, linenum, "parse error:");
|
||||
|
|
|
|||
|
|
@ -199,12 +199,11 @@ namespace
|
|||
|
||||
if (ta_type != TGTA)
|
||||
{
|
||||
spot::ta* testing_automaton = 0;
|
||||
testing_automaton = tgba_to_ta(aut, ap_set,
|
||||
type == spot::postprocessor::BA,
|
||||
opt_with_artificial_initial_state,
|
||||
opt_single_pass_emptiness_check,
|
||||
opt_with_artificial_livelock);
|
||||
spot::ta* testing_automaton =
|
||||
tgba_to_ta(aut, ap_set, type == spot::postprocessor::BA,
|
||||
opt_with_artificial_initial_state,
|
||||
opt_single_pass_emptiness_check,
|
||||
opt_with_artificial_livelock);
|
||||
if (level != spot::postprocessor::Low)
|
||||
{
|
||||
spot::ta* testing_automaton_nm = testing_automaton;
|
||||
|
|
|
|||
|
|
@ -744,7 +744,7 @@ namespace
|
|||
states_in_acc(neg, sspace, s);
|
||||
bool res = s.size() == states;
|
||||
state_set::iterator it;
|
||||
for (it = s.begin(); it != s.end(); it++)
|
||||
for (it = s.begin(); it != s.end(); ++it)
|
||||
(*it)->destroy();
|
||||
return res;
|
||||
}
|
||||
|
|
@ -1001,7 +1001,7 @@ print_stats_csv(const char* filename)
|
|||
|
||||
unsigned ntrans = translators.size();
|
||||
unsigned rounds = vstats.size();
|
||||
assert(rounds = formulas.size());
|
||||
assert(rounds == formulas.size());
|
||||
|
||||
*out << "\"formula\", \"tool\", ";
|
||||
statistics::fields(*out);
|
||||
|
|
@ -1039,7 +1039,7 @@ print_stats_json(const char* filename)
|
|||
|
||||
unsigned ntrans = translators.size();
|
||||
unsigned rounds = vstats.size();
|
||||
assert(rounds = formulas.size());
|
||||
assert(rounds == formulas.size());
|
||||
|
||||
*out << "{\n \"tools\": [\n \"";
|
||||
spot::escape_str(*out, translators[0]);
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ namespace spot
|
|||
return s_;
|
||||
}
|
||||
|
||||
const rsymbol&
|
||||
rsymbol&
|
||||
operator=(const rsymbol& rs)
|
||||
{
|
||||
if (this != &rs)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ main(int argc, char** argv)
|
|||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||
spot::ltl::atomic_prop_set* unobservables = new spot::ltl::atomic_prop_set;
|
||||
|
||||
while (argv[formula_index][0] == '-' && formula_index < argc)
|
||||
while (formula_index < argc && argv[formula_index][0] == '-')
|
||||
{
|
||||
if (!strcmp(argv[formula_index], "-d"))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
// Copyright (C) 2008 Laboratoire de Recherche et Développement
|
||||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2008, 2012 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris
|
||||
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
|
||||
// Université Pierre et Marie Curie.
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -47,7 +48,7 @@ main(int argc, char** argv)
|
|||
bool dotty = false;
|
||||
int filename_index = 1;
|
||||
|
||||
while (argv[filename_index][0] == '-' && filename_index < argc)
|
||||
while (filename_index < argc && argv[filename_index][0] == '-')
|
||||
{
|
||||
if (!strcmp(argv[filename_index], "-d"))
|
||||
debug = true;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2011 Laboratoire de Recherche et Developpement
|
||||
// Copyright (C) 2011, 2012 Laboratoire de Recherche et Developpement
|
||||
// de l'Epita (LRDE)
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -153,7 +153,7 @@ namespace spot
|
|||
{
|
||||
dict_->unregister_all_my_variables(this);
|
||||
std::map<const std::string, state_kripke*>::iterator it;
|
||||
for (it = ns_nodes_.begin(); it != ns_nodes_.end(); it++)
|
||||
for (it = ns_nodes_.begin(); it != ns_nodes_.end(); ++it)
|
||||
{
|
||||
state_kripke* del_me = it->second;
|
||||
delete del_me;
|
||||
|
|
@ -195,7 +195,7 @@ namespace spot
|
|||
}
|
||||
|
||||
bdd
|
||||
kripke_explicit::state_condition(const std::string name) const
|
||||
kripke_explicit::state_condition(const std::string& name) const
|
||||
{
|
||||
std::map<const std::string, state_kripke*>::const_iterator it;
|
||||
it = ns_nodes_.find(name);
|
||||
|
|
@ -247,13 +247,12 @@ namespace spot
|
|||
void kripke_explicit::add_transition(std::string source,
|
||||
std::string dest)
|
||||
{
|
||||
state_kripke* neo = 0;
|
||||
std::map<std::string, state_kripke*>::iterator destination
|
||||
= ns_nodes_.find(dest);
|
||||
|
||||
if (ns_nodes_.find(dest) == ns_nodes_.end())
|
||||
{
|
||||
neo = new state_kripke;
|
||||
state_kripke* neo = new state_kripke;
|
||||
add_state(dest, neo);
|
||||
add_transition(source, neo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ namespace spot
|
|||
/// \brief Get the condition on the state
|
||||
bdd state_condition(const state* s) const;
|
||||
/// \brief Get the condition on the state
|
||||
bdd state_condition(const std::string) const;
|
||||
bdd state_condition(const std::string&) const;
|
||||
|
||||
/// \brief Return the name of the state.
|
||||
std::string format_state(const state*) const;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2011, 2012 Laboratoire de Recherche et Developpement
|
||||
// de l'Epita (LRDE)
|
||||
//
|
||||
|
|
@ -88,7 +89,6 @@ namespace spot
|
|||
notfirst = true;
|
||||
|
||||
const bdd_dict* d = aut_->get_dict();
|
||||
std::string cur = aut_->format_state(s);
|
||||
os_ << "S" << in_s << ", \"";
|
||||
const kripke* automata = down_cast<const kripke*>(aut_);
|
||||
assert(automata);
|
||||
|
|
|
|||
|
|
@ -2388,7 +2388,6 @@ namespace spot
|
|||
&& (op != multop::AndNLM)
|
||||
&& (op != multop::OrRat)
|
||||
&& (op != multop::Concat)
|
||||
&& (op != multop::Concat)
|
||||
&& (op != multop::Fusion))
|
||||
{
|
||||
bool is_and = op == multop::And;
|
||||
|
|
@ -2442,7 +2441,7 @@ namespace spot
|
|||
else if (c_->implication_neg(*f1, *f2, is_and))
|
||||
{
|
||||
for (multop::vec::iterator j = res->begin();
|
||||
j != res->end(); j++)
|
||||
j != res->end(); ++j)
|
||||
if (*j)
|
||||
(*j)->destroy();
|
||||
delete res;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,6 @@ namespace spot
|
|||
std::vector<const printable*> call_;
|
||||
protected:
|
||||
std::ostream* output_;
|
||||
const char* pos_;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012 Laboratoire de Recherche et Développement de
|
||||
// l'Epita (LRDE).
|
||||
// Copyright (C) 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||
// et Marie Curie.
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -24,7 +27,7 @@ namespace spot
|
|||
|
||||
loopless_modular_mixed_radix_gray_code::
|
||||
loopless_modular_mixed_radix_gray_code(int n)
|
||||
: n_(n), a_(0), f_(0), m_(0), s_(0), non_one_radixes_(0)
|
||||
: n_(n), done_(false), a_(0), f_(0), m_(0), s_(0), non_one_radixes_(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// Copyright (C) 2009 Laboratoire de Recherche et Développement
|
||||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2012 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -34,7 +35,7 @@ namespace spot
|
|||
{
|
||||
}
|
||||
|
||||
explicit_state_conjunction*
|
||||
explicit_state_conjunction&
|
||||
explicit_state_conjunction::operator=(const explicit_state_conjunction& o)
|
||||
{
|
||||
if (this != &o)
|
||||
|
|
@ -42,7 +43,7 @@ namespace spot
|
|||
this->~explicit_state_conjunction();
|
||||
new (this) explicit_state_conjunction(&o);
|
||||
}
|
||||
return this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
explicit_state_conjunction::~explicit_state_conjunction()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// Copyright (C) 2009 Laboratoire de Recherche et Développement
|
||||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2012 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -37,7 +38,7 @@ namespace spot
|
|||
explicit_state_conjunction(const explicit_state_conjunction* other);
|
||||
virtual ~explicit_state_conjunction();
|
||||
|
||||
explicit_state_conjunction* operator=(const explicit_state_conjunction& o);
|
||||
explicit_state_conjunction& operator=(const explicit_state_conjunction& o);
|
||||
|
||||
/// \name Iteration
|
||||
//@{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Copyright (C) 2009, 2010, 2011 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -68,10 +69,6 @@ namespace spot
|
|||
bdd condition_;
|
||||
};
|
||||
|
||||
saba_state_complement_tgba::saba_state_complement_tgba()
|
||||
{
|
||||
}
|
||||
|
||||
saba_state_complement_tgba::saba_state_complement_tgba(shared_state state,
|
||||
rank_t rank,
|
||||
bdd condition)
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ namespace spot
|
|||
bool transition_found = false;
|
||||
|
||||
for (it_trans = trans_by_condition->begin(); (it_trans
|
||||
!= trans_by_condition->end() && !transition_found); it_trans++)
|
||||
!= trans_by_condition->end() && !transition_found); ++it_trans)
|
||||
{
|
||||
transition_found = ((*it_trans)->dest == t->dest);
|
||||
if (transition_found)
|
||||
|
|
@ -240,7 +240,7 @@ namespace spot
|
|||
int
|
||||
state_ta_explicit::compare(const spot::state* other) const
|
||||
{
|
||||
const state_ta_explicit* o = down_cast<const state_ta_explicit*> (other);
|
||||
const state_ta_explicit* o = down_cast<const state_ta_explicit*>(other);
|
||||
assert(o);
|
||||
|
||||
int compare_value = tgba_state_->compare(o->tgba_state_);
|
||||
|
|
@ -286,7 +286,8 @@ namespace spot
|
|||
state_ta_explicit* dest = (*it_trans)->dest;
|
||||
bool is_stuttering_transition = (get_tgba_condition()
|
||||
== (dest)->get_tgba_condition());
|
||||
bool dest_is_livelock_accepting = dest->is_livelock_accepting_state();
|
||||
bool dest_is_livelock_accepting =
|
||||
dest->is_livelock_accepting_state();
|
||||
|
||||
//Before deleting stuttering transitions, propaged back livelock
|
||||
//and initial state's properties
|
||||
|
|
@ -329,7 +330,7 @@ namespace spot
|
|||
// We don't destroy the transitions in the state's destructor because
|
||||
// they are not cloned.
|
||||
if (trans != 0)
|
||||
for (it_trans = trans->begin(); it_trans != trans->end(); it_trans++)
|
||||
for (it_trans = trans->begin(); it_trans != trans->end(); ++it_trans)
|
||||
{
|
||||
delete *it_trans;
|
||||
}
|
||||
|
|
@ -369,9 +370,9 @@ namespace spot
|
|||
ta_explicit::~ta_explicit()
|
||||
{
|
||||
ta::states_set_t::iterator it;
|
||||
for (it = states_set_.begin(); it != states_set_.end(); it++)
|
||||
for (it = states_set_.begin(); it != states_set_.end(); ++it)
|
||||
{
|
||||
state_ta_explicit* s = down_cast<state_ta_explicit*> (*it);
|
||||
state_ta_explicit* s = down_cast<state_ta_explicit*>(*it);
|
||||
|
||||
s->free_transitions();
|
||||
s->get_tgba_state()->destroy();
|
||||
|
|
@ -388,14 +389,13 @@ namespace spot
|
|||
std::pair<ta::states_set_t::iterator, bool> add_state_to_ta =
|
||||
states_set_.insert(s);
|
||||
|
||||
return static_cast<state_ta_explicit*> (*add_state_to_ta.first);
|
||||
return static_cast<state_ta_explicit*>(*add_state_to_ta.first);
|
||||
}
|
||||
|
||||
void
|
||||
ta_explicit::add_to_initial_states_set(state* state, bdd condition)
|
||||
{
|
||||
state_ta_explicit * s = down_cast<state_ta_explicit*> (state);
|
||||
assert(s);
|
||||
state_ta_explicit* s = down_cast<state_ta_explicit*>(state);
|
||||
s->set_initial_state(true);
|
||||
if (condition == bddfalse)
|
||||
condition = get_state_condition(s);
|
||||
|
|
@ -403,15 +403,17 @@ namespace spot
|
|||
initial_states_set_.insert(s);
|
||||
if (get_artificial_initial_state() != 0)
|
||||
if (add_state.second)
|
||||
create_transition((state_ta_explicit*) get_artificial_initial_state(),
|
||||
condition, bddfalse, s);
|
||||
|
||||
{
|
||||
state_ta_explicit* i =
|
||||
down_cast<state_ta_explicit*>(get_artificial_initial_state());
|
||||
create_transition(i, condition, bddfalse, s);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ta_explicit::delete_stuttering_and_hole_successors(spot::state* s)
|
||||
{
|
||||
state_ta_explicit * state = down_cast<state_ta_explicit*> (s);
|
||||
state_ta_explicit * state = down_cast<state_ta_explicit*>(s);
|
||||
assert(state);
|
||||
state->delete_stuttering_and_hole_successors();
|
||||
if (state->is_initial_state())
|
||||
|
|
@ -421,7 +423,8 @@ namespace spot
|
|||
|
||||
void
|
||||
ta_explicit::create_transition(state_ta_explicit* source, bdd condition,
|
||||
bdd acceptance_conditions, state_ta_explicit* dest, bool add_at_beginning)
|
||||
bdd acceptance_conditions,
|
||||
state_ta_explicit* dest, bool add_at_beginning)
|
||||
{
|
||||
state_ta_explicit::transition* t = new state_ta_explicit::transition;
|
||||
t->dest = dest;
|
||||
|
|
@ -442,7 +445,7 @@ namespace spot
|
|||
ta_explicit::get_state_condition(const spot::state* initial_state) const
|
||||
{
|
||||
const state_ta_explicit* sta =
|
||||
down_cast<const state_ta_explicit*> (initial_state);
|
||||
down_cast<const state_ta_explicit*>(initial_state);
|
||||
assert(sta);
|
||||
return sta->get_tgba_condition();
|
||||
}
|
||||
|
|
@ -450,7 +453,7 @@ namespace spot
|
|||
bool
|
||||
ta_explicit::is_accepting_state(const spot::state* s) const
|
||||
{
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*> (s);
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*>(s);
|
||||
assert(sta);
|
||||
return sta->is_accepting_state();
|
||||
}
|
||||
|
|
@ -458,7 +461,7 @@ namespace spot
|
|||
bool
|
||||
ta_explicit::is_initial_state(const spot::state* s) const
|
||||
{
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*> (s);
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*>(s);
|
||||
assert(sta);
|
||||
return sta->is_initial_state();
|
||||
}
|
||||
|
|
@ -466,7 +469,7 @@ namespace spot
|
|||
bool
|
||||
ta_explicit::is_livelock_accepting_state(const spot::state* s) const
|
||||
{
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*> (s);
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*>(s);
|
||||
assert(sta);
|
||||
return sta->is_livelock_accepting_state();
|
||||
}
|
||||
|
|
@ -474,7 +477,7 @@ namespace spot
|
|||
ta_succ_iterator*
|
||||
ta_explicit::succ_iter(const spot::state* state) const
|
||||
{
|
||||
const state_ta_explicit* s = down_cast<const state_ta_explicit*> (state);
|
||||
const state_ta_explicit* s = down_cast<const state_ta_explicit*>(state);
|
||||
assert(s);
|
||||
return new ta_explicit_succ_iterator(s);
|
||||
}
|
||||
|
|
@ -482,7 +485,7 @@ namespace spot
|
|||
ta_succ_iterator*
|
||||
ta_explicit::succ_iter(const spot::state* state, bdd condition) const
|
||||
{
|
||||
const state_ta_explicit* s = down_cast<const state_ta_explicit*> (state);
|
||||
const state_ta_explicit* s = down_cast<const state_ta_explicit*>(state);
|
||||
assert(s);
|
||||
return new ta_explicit_succ_iterator(s, condition);
|
||||
}
|
||||
|
|
@ -502,7 +505,7 @@ namespace spot
|
|||
std::string
|
||||
ta_explicit::format_state(const spot::state* s) const
|
||||
{
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*> (s);
|
||||
const state_ta_explicit* sta = down_cast<const state_ta_explicit*>(s);
|
||||
assert(sta);
|
||||
|
||||
if (sta->get_tgba_condition() == bddtrue)
|
||||
|
|
@ -517,11 +520,11 @@ namespace spot
|
|||
ta_explicit::delete_stuttering_transitions()
|
||||
{
|
||||
ta::states_set_t::iterator it;
|
||||
for (it = states_set_.begin(); it != states_set_.end(); it++)
|
||||
for (it = states_set_.begin(); it != states_set_.end(); ++it)
|
||||
{
|
||||
|
||||
const state_ta_explicit* source =
|
||||
static_cast<const state_ta_explicit*> (*it);
|
||||
static_cast<const state_ta_explicit*>(*it);
|
||||
|
||||
state_ta_explicit::transitions* trans = source->get_transitions();
|
||||
state_ta_explicit::transitions::iterator it_trans;
|
||||
|
|
|
|||
|
|
@ -288,7 +288,7 @@ namespace spot
|
|||
ta_init_states_set = ta_->get_initial_states_set();
|
||||
}
|
||||
|
||||
for (it = ta_init_states_set.begin(); it != ta_init_states_set.end(); it++)
|
||||
for (it = ta_init_states_set.begin(); it != ta_init_states_set.end(); ++it)
|
||||
{
|
||||
|
||||
if ((artificial_initial_state != 0) || (kripke_init_state_condition
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2012 Laboratoire de Recherche et Developpement
|
||||
// de l Epita (LRDE).
|
||||
//
|
||||
|
|
@ -64,8 +65,9 @@ namespace spot
|
|||
|
||||
fixed_size_pool* p = const_cast<fixed_size_pool*> (&pool_);
|
||||
|
||||
return new tgta_succ_iterator_product(s, (const kripke*) left_,
|
||||
(const tgta *) right_, p);
|
||||
return new tgta_succ_iterator_product(s,
|
||||
down_cast<const kripke*>(left_),
|
||||
down_cast<const tgta*>(right_), p);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@ namespace spot
|
|||
class tgta_product : public tgba_product
|
||||
{
|
||||
public:
|
||||
|
||||
tgta_product(const kripke* left, const tgta* right);
|
||||
|
||||
virtual state*
|
||||
|
|
@ -45,8 +44,6 @@ namespace spot
|
|||
virtual tgba_succ_iterator*
|
||||
succ_iter(const state* local_state, const state* global_state = 0,
|
||||
const tgba* global_automaton = 0) const;
|
||||
|
||||
|
||||
};
|
||||
|
||||
/// \brief Iterate over the successors of a product computed on the fly.
|
||||
|
|
@ -100,9 +97,7 @@ namespace spot
|
|||
bdd current_condition_;
|
||||
bdd current_acceptance_conditions_;
|
||||
bdd kripke_source_condition;
|
||||
state * kripke_current_dest_state;
|
||||
|
||||
|
||||
state* kripke_current_dest_state;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2010, 2012 Laboratoire de Recherche et Developpement
|
||||
// de l Epita (LRDE).
|
||||
//
|
||||
|
|
@ -40,8 +41,6 @@ namespace spot
|
|||
{
|
||||
os_ << "digraph G {" << std::endl;
|
||||
|
||||
int n = 0;
|
||||
|
||||
artificial_initial_state_ = t_automata_->get_artificial_initial_state();
|
||||
|
||||
ta::states_set_t init_states_set;
|
||||
|
|
@ -55,10 +54,10 @@ namespace spot
|
|||
}
|
||||
else
|
||||
{
|
||||
int n = 0;
|
||||
init_states_set = t_automata_->get_initial_states_set();
|
||||
|
||||
for (it = init_states_set.begin();
|
||||
it != init_states_set.end(); it++)
|
||||
it != init_states_set.end(); ++it)
|
||||
{
|
||||
bdd init_condition = t_automata_->get_state_condition(*it);
|
||||
std::string label = bdd_format_formula(t_automata_->get_dict(),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2010, 2011, 2012 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -360,7 +361,7 @@ namespace spot
|
|||
}
|
||||
|
||||
std::set<const state*, state_ptr_less_than>::const_iterator it;
|
||||
for (it = liveset_dest.begin(); it != liveset_dest.end(); it++)
|
||||
for (it = liveset_dest.begin(); it != liveset_dest.end(); ++it)
|
||||
{
|
||||
const state* succ = (*it);
|
||||
if (heuristic_livelock_detection(succ, h, h_livelock_root,
|
||||
|
|
@ -442,7 +443,7 @@ namespace spot
|
|||
|
||||
const ta::states_set_t init_states_set = a_->get_initial_states_set();
|
||||
ta::states_set_t::const_iterator it;
|
||||
for (it = init_states_set.begin(); it != init_states_set.end(); it++)
|
||||
for (it = init_states_set.begin(); it != init_states_set.end(); ++it)
|
||||
{
|
||||
state* init_state = (*it);
|
||||
ta_init_it_.push(init_state);
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ namespace spot
|
|||
|
||||
spot::state* artificial_initial_state = ta_->get_artificial_initial_state();
|
||||
|
||||
for (it = states_set.begin(); it != states_set.end(); it++)
|
||||
for (it = states_set.begin(); it != states_set.end(); ++it)
|
||||
{
|
||||
const state* s = (*it);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// Copyright (C) 2010 Laboratoire de Recherche et Developpement
|
||||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2010, 2012 Laboratoire de Recherche et Développement
|
||||
// de l Epita (LRDE).
|
||||
//
|
||||
//
|
||||
|
|
@ -66,7 +67,7 @@ namespace spot
|
|||
init_states_set = t_automata_->get_initial_states_set();
|
||||
}
|
||||
|
||||
for (it = init_states_set.begin(); it != init_states_set.end(); it++)
|
||||
for (it = init_states_set.begin(); it != init_states_set.end(); ++it)
|
||||
{
|
||||
state* init_state = (*it);
|
||||
if (want_state(init_state))
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ namespace spot
|
|||
state_ta_explicit::transitions* transitions_to_livelock_states =
|
||||
new state_ta_explicit::transitions;
|
||||
|
||||
for (it = states_set.begin(); it != states_set.end(); it++)
|
||||
for (it = states_set.begin(); it != states_set.end(); ++it)
|
||||
{
|
||||
|
||||
state_ta_explicit* source = static_cast<state_ta_explicit*> (*it);
|
||||
|
|
@ -122,8 +122,8 @@ namespace spot
|
|||
{
|
||||
state_ta_explicit::transitions::iterator it_trans;
|
||||
|
||||
for (it_trans = transitions_to_livelock_states->begin(); it_trans
|
||||
!= transitions_to_livelock_states->end(); it_trans++)
|
||||
for (it_trans = transitions_to_livelock_states->begin();
|
||||
it_trans != transitions_to_livelock_states->end(); ++it_trans)
|
||||
{
|
||||
if (artificial_livelock_accepting_state != 0)
|
||||
{
|
||||
|
|
@ -147,7 +147,7 @@ namespace spot
|
|||
}
|
||||
delete transitions_to_livelock_states;
|
||||
|
||||
for (it = states_set.begin(); it != states_set.end(); it++)
|
||||
for (it = states_set.begin(); it != states_set.end(); ++it)
|
||||
{
|
||||
|
||||
state_ta_explicit* state = static_cast<state_ta_explicit*> (*it);
|
||||
|
|
@ -196,7 +196,7 @@ compute_livelock_acceptance_states(ta_explicit* testing_automata,
|
|||
|
||||
ta::states_set_t::const_iterator it;
|
||||
ta::states_set_t init_states = testing_automata->get_initial_states_set();
|
||||
for (it = init_states.begin(); it != init_states.end(); it++)
|
||||
for (it = init_states.begin(); it != init_states.end(); ++it)
|
||||
{
|
||||
state* init_state = (*it);
|
||||
init_set.push(init_state);
|
||||
|
|
@ -610,7 +610,7 @@ compute_livelock_acceptance_states(ta_explicit* testing_automata,
|
|||
// adapt a GTA to remove acceptance conditions from states
|
||||
ta::states_set_t states_set = ta->get_states_set();
|
||||
ta::states_set_t::iterator it;
|
||||
for (it = states_set.begin(); it != states_set.end(); it++)
|
||||
for (it = states_set.begin(); it != states_set.end(); ++it)
|
||||
{
|
||||
state_ta_explicit* state = static_cast<state_ta_explicit*> (*it);
|
||||
|
||||
|
|
@ -621,7 +621,7 @@ compute_livelock_acceptance_states(ta_explicit* testing_automata,
|
|||
state_ta_explicit::transitions::iterator it_trans;
|
||||
|
||||
for (it_trans = trans->begin(); it_trans != trans->end();
|
||||
it_trans++)
|
||||
++it_trans)
|
||||
{
|
||||
(*it_trans)->acceptance_conditions
|
||||
= ta->all_acceptance_conditions();
|
||||
|
|
@ -674,7 +674,7 @@ compute_livelock_acceptance_states(ta_explicit* testing_automata,
|
|||
bdd bdd_stutering_transition = bdd_setxor(first_state_condition,
|
||||
first_state_condition);
|
||||
|
||||
for (it = states_set.begin(); it != states_set.end(); it++)
|
||||
for (it = states_set.begin(); it != states_set.end(); ++it)
|
||||
{
|
||||
state_ta_explicit* state = static_cast<state_ta_explicit*> (*it);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace spot
|
|||
assert(dict == right.dict);
|
||||
}
|
||||
|
||||
const tgba_bdd_core_data&
|
||||
tgba_bdd_core_data&
|
||||
tgba_bdd_core_data::operator=(const tgba_bdd_core_data& copy)
|
||||
{
|
||||
if (this != ©)
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ namespace spot
|
|||
tgba_bdd_core_data(const tgba_bdd_core_data& left,
|
||||
const tgba_bdd_core_data& right);
|
||||
|
||||
const tgba_bdd_core_data& operator=(const tgba_bdd_core_data& copy);
|
||||
tgba_bdd_core_data& operator=(const tgba_bdd_core_data& copy);
|
||||
|
||||
/// \brief Update the variable sets to take a new pair of variables into
|
||||
/// account.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Copyright (C) 2009, 2010 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2012 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -30,7 +31,7 @@ namespace spot
|
|||
{
|
||||
public:
|
||||
bdd_ordered()
|
||||
: order_(0)
|
||||
: bdd_(0), order_(0)
|
||||
{};
|
||||
|
||||
bdd_ordered(int bdd_, unsigned order_)
|
||||
|
|
@ -77,7 +78,7 @@ namespace spot
|
|||
/// \endverbatim
|
||||
///
|
||||
/// The original automaton is used as a States-based Generalized
|
||||
/// Büchi Automaton.
|
||||
/// Büchi Automaton.
|
||||
///
|
||||
/// The construction is done on-the-fly, by the
|
||||
/// \c tgba_kv_complement_succ_iterator class.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2010, 2011, 2012 Laboratoire de Recherche et
|
||||
// Développement de l'Epita (LRDE).
|
||||
//
|
||||
|
|
@ -104,7 +105,7 @@ namespace spot
|
|||
safra_tree(const subset_t& nodes, safra_tree* p, int n);
|
||||
~safra_tree();
|
||||
|
||||
const safra_tree& operator=(const safra_tree& other);
|
||||
safra_tree& operator=(const safra_tree& other);
|
||||
int compare(const safra_tree* other) const;
|
||||
size_t hash() const;
|
||||
|
||||
|
|
@ -177,7 +178,7 @@ namespace spot
|
|||
(*i)->destroy();
|
||||
}
|
||||
|
||||
const safra_tree&
|
||||
safra_tree&
|
||||
safra_tree::operator=(const safra_tree& other)
|
||||
{
|
||||
if (this != &other)
|
||||
|
|
@ -816,7 +817,6 @@ namespace spot
|
|||
|
||||
void print_safra_automaton(safra_tree_automaton* a)
|
||||
{
|
||||
safra_tree_automaton::automaton_t node_list = a->automaton;
|
||||
typedef safra_tree_automaton::automaton_t::reverse_iterator
|
||||
automaton_cit;
|
||||
typedef safra_tree_automaton::transition_list::const_iterator
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright (C) 2009, 2011 Laboratoire de Recherche et Développement
|
||||
// Copyright (C) 2009, 2011, 2012 Laboratoire de Recherche et Développement
|
||||
// de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
|
|
@ -101,9 +101,8 @@ namespace spot
|
|||
}
|
||||
|
||||
tgba_sgba_proxy_succ_iterator(tgba_succ_iterator* it, bdd acc)
|
||||
: it_(it), emulate_acc_cond_(true)
|
||||
: it_(it), emulate_acc_cond_(true), acceptance_condition_(acc)
|
||||
{
|
||||
acceptance_condition_ = acc;
|
||||
}
|
||||
|
||||
virtual
|
||||
|
|
|
|||
|
|
@ -166,9 +166,8 @@ namespace spot
|
|||
{
|
||||
public:
|
||||
tgba_wdba_comp_proxy(const tgba* a)
|
||||
: a_(a)
|
||||
: a_(a), the_acceptance_cond_(a->all_acceptance_conditions())
|
||||
{
|
||||
the_acceptance_cond_ = a->all_acceptance_conditions();
|
||||
if (the_acceptance_cond_ == bddfalse)
|
||||
{
|
||||
int v = get_dict()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
// Copyright (C) 2009, 2011 Laboratoire de Recherche et Developpement
|
||||
// de l'Epita (LRDE).
|
||||
// -*- coding: utf-8 -*-
|
||||
// Copyright (C) 2009, 2011, 2012 Laboratoire de Recherche et
|
||||
// Developpement de l'Epita (LRDE).
|
||||
//
|
||||
// This file is part of Spot, a model checking library.
|
||||
//
|
||||
|
|
@ -38,7 +39,7 @@ namespace spot
|
|||
std::string cur_format = a->format_state(cur);
|
||||
std::set<unsigned>::iterator it;
|
||||
// Check if we have at least one accepting SCC.
|
||||
for (it = s.begin(); it != s.end() && !m.accepting(*it); it++)
|
||||
for (it = s.begin(); it != s.end() && !m.accepting(*it); ++it)
|
||||
continue;
|
||||
assert(it != s.end());
|
||||
tovisit.push(cur);
|
||||
|
|
@ -89,10 +90,8 @@ namespace spot
|
|||
|
||||
hash_type::iterator it2;
|
||||
// Free visited states.
|
||||
for (it2 = seen.begin(); it2 != seen.end(); it2++)
|
||||
{
|
||||
for (it2 = seen.begin(); it2 != seen.end(); ++it2)
|
||||
(*it2)->destroy();
|
||||
}
|
||||
return sub_a;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ namespace spot
|
|||
std::getline(is, guard);
|
||||
ltl::parse_error_list pel;
|
||||
const ltl::formula* f = parse_lbt(guard, pel, env);
|
||||
if (!f || pel.size() > 0)
|
||||
if (!f || !pel.empty())
|
||||
{
|
||||
error += "failed to parse guard: " + guard;
|
||||
if (f)
|
||||
|
|
@ -301,7 +301,7 @@ namespace spot
|
|||
std::getline(is, guard);
|
||||
ltl::parse_error_list pel;
|
||||
const ltl::formula* f = parse_lbt(guard, pel, env);
|
||||
if (!f || pel.size() > 0)
|
||||
if (!f || !pel.empty())
|
||||
{
|
||||
error += "failed to parse guard: " + guard;
|
||||
if (f)
|
||||
|
|
|
|||
|
|
@ -286,7 +286,6 @@ namespace spot
|
|||
|
||||
// We run through the map bdd/list<state>, and we update
|
||||
// the previous_class_ with the new data.
|
||||
it_bdd = used_var_.begin();
|
||||
for (map_bdd_lstate::iterator it = bdd_lstate_.begin();
|
||||
it != bdd_lstate_.end();
|
||||
++it)
|
||||
|
|
|
|||
|
|
@ -160,10 +160,9 @@ int main(int argc, char* argv[])
|
|||
else if (print_formula)
|
||||
{
|
||||
spot::tgba* a;
|
||||
const spot::ltl::formula* f1 = 0;
|
||||
|
||||
spot::ltl::parse_error_list p1;
|
||||
f1 = spot::ltl::parse(file, p1);
|
||||
const spot::ltl::formula* f1 = spot::ltl::parse(file, p1);
|
||||
|
||||
if (spot::ltl::format_parse_errors(std::cerr, file, p1))
|
||||
return 2;
|
||||
|
|
|
|||
|
|
@ -360,12 +360,10 @@ main(int argc, char** argv)
|
|||
spot::ltl::environment& env(spot::ltl::default_environment::instance());
|
||||
spot::ltl::atomic_prop_set* unobservables = 0;
|
||||
spot::tgba* system = 0;
|
||||
const spot::tgba* product = 0;
|
||||
const spot::tgba* product_to_free = 0;
|
||||
spot::bdd_dict* dict = new spot::bdd_dict();
|
||||
spot::timer_map tm;
|
||||
bool use_timer = false;
|
||||
bool assume_sba = false;
|
||||
bool reduction_dir_sim = false;
|
||||
bool reduction_rev_sim = false;
|
||||
bool reduction_iterated_sim = false;
|
||||
|
|
@ -892,6 +890,7 @@ main(int argc, char** argv)
|
|||
const spot::tgba* to_free = 0;
|
||||
const spot::tgba* to_free2 = 0;
|
||||
spot::tgba* a = 0;
|
||||
bool assume_sba = false;
|
||||
|
||||
if (from_file)
|
||||
{
|
||||
|
|
@ -1198,10 +1197,8 @@ main(int argc, char** argv)
|
|||
|
||||
if (ta_opt)
|
||||
{
|
||||
spot::ta* testing_automaton = 0;
|
||||
|
||||
tm.start("conversion to TA");
|
||||
testing_automaton
|
||||
spot::ta* testing_automaton
|
||||
= tgba_to_ta(a, atomic_props_set_bdd, degeneralize_opt
|
||||
== DegenSBA, opt_with_artificial_initial_state,
|
||||
opt_single_pass_emptiness_check,
|
||||
|
|
@ -1286,7 +1283,8 @@ main(int argc, char** argv)
|
|||
|
||||
if (system)
|
||||
{
|
||||
product = product_to_free = a = new spot::tgba_product(system, a);
|
||||
const spot::tgba* product = product_to_free = a =
|
||||
new spot::tgba_product(system, a);
|
||||
|
||||
assume_sba = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ struct stat_collector
|
|||
|
||||
std::ostream&
|
||||
display(std::ostream& os,
|
||||
const alg_1stat_map& m, const std::string title,
|
||||
const alg_1stat_map& m, const std::string& title,
|
||||
bool total = true) const
|
||||
{
|
||||
std::ios::fmtflags old = os.flags();
|
||||
|
|
@ -418,7 +418,7 @@ ar_stats_type mar_stats; // ... about minimized accepting runs.
|
|||
|
||||
|
||||
void
|
||||
print_ar_stats(ar_stats_type& ar_stats, const std::string s)
|
||||
print_ar_stats(ar_stats_type& ar_stats, const std::string& s)
|
||||
{
|
||||
std::ios::fmtflags old = std::cout.flags();
|
||||
std::cout << std::endl << s << std::endl;
|
||||
|
|
@ -818,7 +818,7 @@ main(int argc, char** argv)
|
|||
const char** i = default_algos;
|
||||
while (*i)
|
||||
{
|
||||
ec_algo a = { *i++, 0 };
|
||||
ec_algo a = { *(i++), 0 };
|
||||
ec_algos.push_back(a);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue