21 #include <spot/bricks/brick-hash>
22 #include <spot/bricks/brick-hashset>
23 #include <spot/kripke/kripke.hh>
24 #include <spot/ltsmin/spins_interface.hh>
25 #include <spot/misc/fixpool.hh>
26 #include <spot/misc/mspool.hh>
27 #include <spot/misc/intvcomp.hh>
28 #include <spot/misc/intvcmp2.hh>
29 #include <spot/twacube/cube.hh>
56 return 0 == memcmp(lhs, rhs, (2+rhs[1])*
sizeof(
int));
107 const unsigned int state_size_;
108 void (*fn_compress_)(
const int*, size_t,
int*,
size_t&);
109 void (*fn_decompress_)(
const int*, size_t,
int*, size_t);
117 std::vector<cspins_state>*
succ;
168 unsigned compute_index()
const;
180 std::vector<cspins_state> successors_;
181 unsigned int current_;
225 typedef std::vector<one_prop> prop_set;
231 std::vector<std::string> visible_aps,
232 bool selfloopize, std::string dead_prop,
233 unsigned int nb_threads);
246 const std::vector<std::string>
ap();
254 void match_aps(std::vector<std::string>& aps, std::string dead_prop);
266 std::vector<std::vector<cspins_iterator*>> recycle_;
272 std::vector<std::string> aps_;
273 unsigned int nb_threads_;
284 #include <spot/ltsmin/spins_kripke.hxx>
This class provides an iterator over the successors of a state. All successors are computed once when...
Definition: spins_kripke.hh:130
bool done() const
Whether all successors were visited.
void next()
Move to the next successor.
void recycle(cspins_iterator_param &p)
Recycle an iterator from parameters.
cspins_iterator(cspins_iterator_param &p)
Build an iterator from parameters.
cspins_state state() const
Return the current successor state.
cube condition() const
Return the current transition condition.
The management of states (i.e. allocation/deallocation) can be painless since every time we have to c...
Definition: spins_kripke.hh:76
void dealloc(cspins_state s)
Help the manager to reclaim the memory of a state.
void decompress(cspins_state s, int *uncompressed, unsigned size) const
Helper to decompress a state.
cspins_state alloc_setup(int *dst, int *cmp, size_t cmpsize)
Builder for a state from a raw description given in dst.
cspins_state_manager(unsigned int state_size, int compress)
Build a manager for a state of state_size variables and indicate wether compression should be used:
int * unbox_state(cspins_state s) const
Get Rid of the internal representation of the state.
unsigned int size() const
The size of a state.
Manager for allocating and manipulating cubes (bit-encoded partial assignments over APs).
Definition: cube.hh:72
std::string to_string(const cspins_state s, unsigned tid=0) const
Convert a state to a string.
kripkecube(spins_interface_ptr sip, bool compress, std::vector< std::string > visible_aps, bool selfloopize, std::string dead_prop, unsigned int nb_threads)
Build a kripkecube from a Spins interface.
cspins_state initial(unsigned tid)
Return the initial state for thread tid.
cspins_iterator * succ(const cspins_state s, unsigned tid)
Return the iterator for a state.
void recycle(cspins_iterator *it, unsigned tid)
Recycle an iterator.
const std::vector< std::string > ap()
List the atomic propositions used by this kripke.
~kripkecube()
Destroy the kripkecube.
unsigned get_threads()
The number of thread used by this kripke.
This class is a template representation of a Kripke structure. It is composed of two template paramet...
Definition: kripke.hh:40
A multiple-size memory pool implementation.
Definition: mspool.hh:35
Implementation of the PINS interface. This class is a wrapper that, given a file, will compile it w....
Definition: spins_interface.hh:48
std::shared_ptr< const spins_interface > spins_interface_ptr
Shared pointer to a Spins interface.
Definition: spins_interface.hh:84
int * cspins_state
A Spins state is represented as an array of integer Note that this array has two reserved slots (posi...
Definition: spins_kripke.hh:47
std::shared_ptr< spot::kripkecube< spot::cspins_state, spot::cspins_iterator > > ltsmin_kripkecube_ptr
shortcut to manipulate the kripke below
Definition: spins_kripke.hh:279
op
Operator types.
Definition: formula.hh:85
unsigned * cube
A cube is only a set of bits in memory.
Definition: cube.hh:66
Definition: automata.hh:26
Arguments bundle passed to construct or recycle a cspins_iterator.
Definition: spins_kripke.hh:135
bool compress
Whether compression is used.
Definition: spins_kripke.hh:141
spot::cubeset & cubeset
Cube set.
Definition: spins_kripke.hh:143
cspins_state s
Current state.
Definition: spins_kripke.hh:136
cube cond
Current cube condition.
Definition: spins_kripke.hh:140
bool selfloopize
Whether to selfloopize.
Definition: spins_kripke.hh:142
cspins_state_manager & manager
State manager.
Definition: spins_kripke.hh:138
int dead_idx
Deadlock AP index.
Definition: spins_kripke.hh:144
unsigned tid
Thread identifier.
Definition: spins_kripke.hh:145
const spot::spins_interface * d
Spins interface.
Definition: spins_kripke.hh:137
inner_callback_parameters & inner
Callback arguments.
Definition: spins_kripke.hh:139
This class provides the ability to compare two states.
Definition: spins_kripke.hh:52
bool operator()(const cspins_state lhs, const cspins_state rhs) const
Compare two states for equality.
Definition: spins_kripke.hh:54
This class provides the ability to hash a state.
Definition: spins_kripke.hh:63
size_t operator()(const cspins_state that) const
Return the cached hash of a state.
Definition: spins_kripke.hh:65
Parameters passed to callbacks when generating successor states from the shared library produced by L...
Definition: spins_kripke.hh:115
std::vector< cspins_state > * succ
Successors of a state.
Definition: spins_kripke.hh:117
bool selfloopize
Whether to selfloopize.
Definition: spins_kripke.hh:121
int * compressed
Buffer for compressed states.
Definition: spins_kripke.hh:118
bool compress
Whether compression is used.
Definition: spins_kripke.hh:120
int * uncompressed
Buffer for uncompressed states.
Definition: spins_kripke.hh:119
cspins_state_manager * manager
State manager.
Definition: spins_kripke.hh:116