spot
0.8.1
|
A state for spot::tgba_product.This state is in fact a pair of state: the state from the left automaton and that of the right. More...
#include <tgba/tgbaproduct.hh>
Public Member Functions | |
state_product (state *left, state *right, fixed_size_pool *pool) | |
Constructor. | |
virtual void | destroy () const |
Release a state. | |
state * | left () const |
state * | right () const |
virtual int | compare (const state *other) const |
Compares two states (that come from the same automaton). | |
virtual size_t | hash () const |
Hash a state. | |
virtual state_product * | clone () const |
Duplicate a state. | |
Private Member Functions | |
virtual | ~state_product () |
state_product (const state_product &o) | |
Private Attributes | |
state * | left_ |
State from the left automaton. | |
state * | right_ |
State from the right automaton. | |
unsigned | count_ |
fixed_size_pool * | pool_ |
A state for spot::tgba_product.
This state is in fact a pair of state: the state from the left automaton and that of the right.
spot::state_product::state_product | ( | state * | left, |
state * | right, | ||
fixed_size_pool * | pool | ||
) | [inline] |
Constructor.
left | The state from the left automaton. |
right | The state from the right automaton. |
pool | The pool from which the state was allocated. These states are acquired by spot::state_product, and will be destroyed on destruction. |
virtual spot::state_product::~state_product | ( | ) | [private, virtual] |
spot::state_product::state_product | ( | const state_product & | o | ) | [private] |
virtual state_product* spot::state_product::clone | ( | ) | const [virtual] |
Duplicate a state.
Implements spot::state.
virtual int spot::state_product::compare | ( | const state * | other | ) | const [virtual] |
Compares two states (that come from the same automaton).
This method returns an integer less than, equal to, or greater than zero if this is found, respectively, to be less than, equal to, or greater than other according to some implicit total order.
This method should not be called to compare states from different automata.
Implements spot::state.
virtual void spot::state_product::destroy | ( | ) | const [virtual] |
Release a state.
Methods from the tgba or tgba_succ_iterator always return a new state that you should deallocate with this function. Before Spot 0.7, you had to "delete" your state directly. Starting with Spot 0.7, you update your code to this function instead (which simply calls "delete"). In a future version, some subclasses will redefine destroy() to allow better memory management (e.g. no memory allocation for explicit automata).
Reimplemented from spot::state.
virtual size_t spot::state_product::hash | ( | ) | const [virtual] |
Hash a state.
This method returns an integer that can be used as a hash value for this state.
Note that the hash value is guaranteed to be unique for all equal states (in compare()'s sense) for only has long has one of these states exists. So it's OK to use a spot::state as a key in a hash_map
because the mere use of the state as a key in the hash will ensure the state continues to exist.
However if you create the state, get its hash key, delete the state, recreate the same state, and get its hash key, you may obtain two different hash keys if the same state were not already used elsewhere. In practice this weird situation can occur only when the state is BDD-encoded, because BDD numbers (used to build the hash value) can be reused for other formulas. That probably doesn't matter, since the hash value is meant to be used in a hash_map
, but it had to be noted.
Implements spot::state.
state* spot::state_product::left | ( | ) | const [inline] |
References left_.
state* spot::state_product::right | ( | ) | const [inline] |
References right_.
unsigned spot::state_product::count_ [mutable, private] |
state* spot::state_product::left_ [private] |
State from the left automaton.
Referenced by left().
fixed_size_pool* spot::state_product::pool_ [private] |
state* spot::state_product::right_ [private] |
State from the right automaton.
Referenced by right().