modelcheck: support for twacube

* spot/ltsmin/ltsmin.cc, spot/ltsmin/ltsmin.hh,
tests/ltsmin/modelcheck.cc: here.
This commit is contained in:
Etienne Renault 2016-04-21 13:38:39 +02:00
parent 94f7c58f44
commit 9799f2884e
3 changed files with 109 additions and 6 deletions

View file

@ -42,6 +42,7 @@
#include <string.h>
#include <spot/twacube/cube.hh>
#include <spot/mc/utils.hh>
#include <spot/mc/ec.hh>
#include <bricks/brick-hashset.h>
#include <bricks/brick-hash.h>
@ -2010,6 +2011,20 @@ 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)
{
ec_renault13lpar<cspins_state, cspins_iterator,
cspins_state_hash, cspins_state_equal> ec(*sys, twa);
bool has_ctrx = ec.run();
std::string trace = "";
if (has_ctrx && compute_ctrx)
trace = ec.trace();
return std::make_tuple(has_ctrx, trace, ec.stats());
}
int ltsmin_model::state_size() const
{
return iface->get_state_size();

View file

@ -20,7 +20,10 @@
#pragma once
#include <spot/kripke/kripke.hh>
#include <spot/twacube/twacube.hh>
#include <spot/tl/apcollect.hh>
#include <tuple>
#include <spot/mc/intersect.hh>
namespace spot
{
@ -81,6 +84,14 @@ namespace spot
formula dead = formula::tt(),
int compress = 0) const;
/// \brief Check for the emptiness between a system and a twa.
/// Return a pair containing a boolean indicating wether a counterexample
/// 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);
/// Number of variables in a state
int state_size() const;
/// Name of each variable