19 #ifndef SPOT_FASTTGBAALGOS_EC_UNION_FIND_HH
20 # define SPOT_FASTTGBAALGOS_EC_UNION_FIND_HH
22 #include "misc/hash.hh"
23 #include "fasttgba/fasttgba.hh"
24 #include "boost/tuple/tuple.hpp"
31 #include <unordered_map>
33 #include "deadstore.hh"
92 enum color {Alive, Dead, Unknown};
105 virtual unsigned int size ();
107 virtual unsigned int dead_size ();
112 virtual int root (
int i);
142 mutable std::vector<int> id;
143 mutable std::vector<int> rk;
147 virtual int root(
int i);
154 virtual unsigned int size ();
156 virtual unsigned int dead_size ();
171 int maxDepth()
const;
193 mutable std::vector<int> id;
197 virtual int root(
int i);
206 virtual unsigned int size ();
208 virtual unsigned int dead_size ();
223 int maxDepth()
const;
270 mutable std::vector<idpair> id;
277 virtual int root(
int i);
286 virtual unsigned int size ();
288 virtual unsigned int dead_size ();
303 int maxDepth()
const;
320 unsigned int max_alive_;
324 #endif // SPOT_FASTTGBAALGOS_EC_UNION_FIND_HH
virtual bool is_dead(const fasttgba_state *e)
check wether the root of the set containing this scc is dead.
virtual unsigned int size()
The current size of the union find.
virtual markset get_acc(const fasttgba_state *)
return the acceptance set of the partition containing s
this class propose an union find based on a deadstore. The idea is to used a dedicated map for the st...
Definition: union_find.hh:255
virtual bool contains(const fasttgba_state *e)
Return wether a state belong to the Union-Find structure.
virtual bool add(const fasttgba_state *e)
Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge ...
Definition: union_find.hh:136
virtual bool contains(const fasttgba_state *e)
Return wether a state belong to the Union-Find structure.
virtual unsigned int size()
The current size of the union find.
This class act as an interface for all classes.
Definition: fasttgba_state.hh:30
acc_dict & acc_
The acceptance dictionary.
Definition: union_find.hh:130
virtual void add_acc(const fasttgba_state *, markset)
Add the acceptance set to the partition that contains the state s.
virtual void make_dead(const fasttgba_state *s)
perform a union with dead
std::vector< int > idneg
For each element store the id of the parent.
Definition: union_find.hh:124
Abstract class for states.
Definition: state.hh:40
virtual void unite(const fasttgba_state *e1, const fasttgba_state *e2)
Perform the union of the two partition containing left and right. No assumptions over the resulting p...
uf_map el
the structure used to the storage An element is associated to an integer
Definition: union_find.hh:121
virtual markset get_acc(const fasttgba_state *)
return the acceptance set of the partition containing s
virtual bool add(const fasttgba_state *e)
Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge ...
virtual void add_acc(const fasttgba_state *, markset)
Add the acceptance set to the partition that contains the state s.
color
The color for a new State.
Definition: union_find.hh:92
virtual bool add(const fasttgba_state *e)
Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge ...
virtual unsigned int size()
The current size of the union find.
virtual void make_dead(const fasttgba_state *e)
perform a union with dead
virtual void unite(const fasttgba_state *e1, const fasttgba_state *e2)
Perform the union of the two partition containing left and right. No assumptions over the resulting p...
virtual int root(int i)
grab the id of the root associated to an element.
virtual ~union_find()
A simple destructor.
virtual bool add(const fasttgba_state *s)
Add a partition that contains only s Suppose a clone() has been done and the union-find is in charge ...
Definition: union_find.hh:188
virtual bool same_partition(const fasttgba_state *e1, const fasttgba_state *e2)
Return true if the partition of left is the same that the partition of right.
union_find(acc_dict &acc)
The constructor for the Union-Find structure acc the acceptance dictionary.
virtual void make_dead(const fasttgba_state *e)
perform a union with dead
virtual void add_acc(const fasttgba_state *, markset)
Add the acceptance set to the partition that contains the state s.
virtual bool contains(const fasttgba_state *e)
Return wether a state belong to the Union-Find structure.
virtual unsigned int size()
The current size of the union find.
Definition: fasttgba_state.hh:76
markset empty
Avoid to re-create some elements.
Definition: union_find.hh:133
virtual bool same_partition(const fasttgba_state *e1, const fasttgba_state *e2)
Return true if the partition of left is the same that the partition of right.
virtual markset get_acc(const fasttgba_state *)
return the acceptance set of the partition containing s
virtual bool same_partition(const fasttgba_state *left, const fasttgba_state *right)
Return true if the partition of left is the same that the partition of right.
virtual markset get_acc(const fasttgba_state *s)
return the acceptance set of the partition containing s
virtual bool is_dead(const fasttgba_state *e)
check wether the root of the set containing this scc is dead.
This class represents a set of acceptance marks.
Definition: markset.hh:35
This class represent a dead store. For now it's just a set but it can be combined with bitstate hasin...
Definition: deadstore.hh:41
virtual bool contains(const fasttgba_state *s)
Return wether a state belong to the Union-Find structure.
Definition: acc_dict.hh:31
Definition: fasttgba_state.hh:88
virtual void add_acc(const fasttgba_state *s, markset m)
Add the acceptance set to the partition that contains the state s.
Definition: union_find.hh:46
virtual void make_dead(const fasttgba_state *e)
perform a union with dead
virtual bool same_partition(const fasttgba_state *e1, const fasttgba_state *e2)
Return true if the partition of left is the same that the partition of right.
virtual bool is_dead(const fasttgba_state *e)
check wether the root of the set containing this scc is dead.
std::vector< markset * > accp
Acceptance associated to each element.
Definition: union_find.hh:127
virtual void unite(const fasttgba_state *left, const fasttgba_state *right)
Perform the union of the two partition containing left and right. No assumptions over the resulting p...
virtual bool is_dead(const fasttgba_state *s)
check wether the root of the set containing this scc is dead.
virtual void unite(const fasttgba_state *e1, const fasttgba_state *e2)
Perform the union of the two partition containing left and right. No assumptions over the resulting p...