Promote use of shared_ptr

* spot/kripke/kripke.hh, spot/ltsmin/ltsmin.cc,
spot/ltsmin/ltsmin.hh, spot/mc/ec.hh, spot/mc/intersect.hh,
spot/mc/utils.hh, spot/twacube/Makefile.am,
spot/twacube/fwd.hh, spot/twacube/twacube.hh,
spot/twacube_algos/convert.cc, spot/twacube_algos/convert.hh,
tests/core/twacube.cc, tests/ltsmin/modelcheck.cc: here.
This commit is contained in:
Etienne Renault 2016-04-25 15:36:26 +02:00
parent 7d2abe229b
commit 765bb8a7c4
13 changed files with 64 additions and 31 deletions

View file

@ -1938,7 +1938,7 @@ namespace spot
throw std::runtime_error(err.str());
}
spot::kripkecube<spot::cspins_state, spot::cspins_iterator>*
ltsmin_kripkecube_ptr
ltsmin_model::kripkecube(const atomic_prop_set* to_observe,
const formula dead, int compress) const
{
@ -1975,7 +1975,8 @@ namespace spot
observed.push_back(dead_ap);
// Finally build the system.
return new spot::kripkecube<spot::cspins_state, spot::cspins_iterator>
return std::make_shared<spot::kripkecube<spot::cspins_state,
spot::cspins_iterator>>
(iface, compress, observed, selfloopize, dead_ap);
}
@ -2012,9 +2013,8 @@ namespace spot
}
std::tuple<bool, std::string, istats>
ltsmin_model::modelcheck(spot::kripkecube<spot::cspins_state,
spot::cspins_iterator>* sys,
spot::twacube* twa, bool compute_ctrx)
ltsmin_model::modelcheck(ltsmin_kripkecube_ptr sys,
spot::twacube_ptr twa, bool compute_ctrx)
{
ec_renault13lpar<cspins_state, cspins_iterator,
cspins_state_hash, cspins_state_equal> ec(*sys, twa);

View file

@ -31,6 +31,10 @@ namespace spot
class cspins_iterator;
typedef int* cspins_state;
typedef std::shared_ptr<spot::kripkecube<spot::cspins_state,
spot::cspins_iterator>>
ltsmin_kripkecube_ptr;
class SPOT_API ltsmin_model final
{
public:
@ -79,7 +83,7 @@ namespace spot
// \brief The same as above but returns a kripkecube, i.e. a kripke
// that can be use in parallel. Moreover, it support more ellaborated
// atomic propositions such as "P.a == P.c"
spot::kripkecube<spot::cspins_state, spot::cspins_iterator>*
ltsmin_kripkecube_ptr
kripkecube(const atomic_prop_set* to_observe,
formula dead = formula::tt(),
int compress = 0) const;
@ -89,8 +93,8 @@ namespace spot
/// has been found and a string representing the counterexample if the
/// computation have been required
static std::tuple<bool, std::string, istats>
modelcheck(spot::kripkecube<spot::cspins_state, spot::cspins_iterator>* sys,
spot::twacube* twa, bool compute_ctrx = false);
modelcheck(ltsmin_kripkecube_ptr sys,
spot::twacube_ptr twa, bool compute_ctrx = false);
/// Number of variables in a state
int state_size() const;