Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

pn_succ_iterator Class Reference

Implementation of a spot::tgba_succ_iterator for a marking. More...

Inheritance diagram for pn_succ_iterator:

Inheritance graph
[legend]
Collaboration diagram for pn_succ_iterator:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 pn_succ_iterator (const petri_net &n, const marking *m, const bdd &cond)
 Construct an iterator over the successors of the marking m in the Petri net n. The marking m satisfies the atomic propositions represented by cond.
virtual ~pn_succ_iterator ()
 Destructor.
void first ()
 Position the iterator on the first successor (if any).
void next ()
 Jump to the next successor (if any).
bool done () const
 Check whether the iteration is finished.
spot::statecurrent_state () const
 Get the state of the current successor.
bdd current_condition () const
 Get the condition on the transition leading to this successor. This model checker is base on state properties and then all the outgoing arcs are labelled by the conditions of the source state.
bdd current_acceptance_conditions () const
 Get the acceptance conditions on the transition leading to this successor. Here no acceptance conditions are taken into account. The method returns false.
std::string format_transition () const
 Return the transition name of the current successor for printing.

Private Member Functions

 pn_succ_iterator (const pn_succ_iterator &s)
 not implemented (assert(false))
pn_succ_iteratoroperator= (const pn_succ_iterator &s)
 not implemented (assert(false))

Private Attributes

const petri_netnet
 Designate the associated Petri net.
const markingmark
 Point to the marking for which we iterate.
std::list< int > * fir
 Point to the list of transitions firable from *mark in net.
std::list< int >::const_iterator it
 Designate the current successor.
bdd condition
 Condition satisfied by *mark.

Detailed Description

Implementation of a spot::tgba_succ_iterator for a marking.

Definition at line 36 of file pnsucciter.hh.


Constructor & Destructor Documentation

pn_succ_iterator::pn_succ_iterator const petri_net n,
const marking m,
const bdd &  cond
 

Construct an iterator over the successors of the marking m in the Petri net n. The marking m satisfies the atomic propositions represented by cond.

Notice that the constructed instance takes the control of the marking pointed by m. In particular, this marking will be deallocated automatically at the destruction.

pn_succ_iterator::pn_succ_iterator(const petri_net& n, 
                                        const marking* m, const bdd& cond)
: net(n), mark(m), fir(n.firable(*m)), condition(cond) {
  it = fir->end(); // => done()
} //

virtual pn_succ_iterator::~pn_succ_iterator  )  [virtual]
 

Destructor.

pn_succ_iterator::~pn_succ_iterator() {
  delete mark;
  delete fir;
} //

pn_succ_iterator::pn_succ_iterator const pn_succ_iterator s  )  [private]
 

not implemented (assert(false))


Member Function Documentation

bdd pn_succ_iterator::current_acceptance_conditions  )  const [virtual]
 

Get the acceptance conditions on the transition leading to this successor. Here no acceptance conditions are taken into account. The method returns false.

Implements spot::tgba_succ_iterator.

bdd pn_succ_iterator::current_condition  )  const [virtual]
 

Get the condition on the transition leading to this successor. This model checker is base on state properties and then all the outgoing arcs are labelled by the conditions of the source state.

bdd pn_succ_iterator::current_condition() const {
  assert(!done());
  return condition;
} //

Implements spot::tgba_succ_iterator.

spot::state* pn_succ_iterator::current_state  )  const [virtual]
 

Get the state of the current successor.

The state has been allocated with new. It is the responsability of the caller to delete it when no longer needed.

spot::state* pn_succ_iterator::current_state() const {
  assert(!done());
  marking* m = net.successor(*mark, *it);
  pn_state* res = new pn_state(*m);
  delete m;
  return res;
} //

Implements spot::tgba_succ_iterator.

bool pn_succ_iterator::done  )  const [virtual]
 

Check whether the iteration is finished.

bool pn_succ_iterator::done() const {
  return it==fir->end();
} //

Implements spot::tgba_succ_iterator.

void pn_succ_iterator::first  )  [virtual]
 

Position the iterator on the first successor (if any).

void pn_succ_iterator::first() {
  it = fir->begin();
} //

Implements spot::tgba_succ_iterator.

std::string pn_succ_iterator::format_transition  )  const
 

Return the transition name of the current successor for printing.

std::string pn_succ_iterator::format_transition() const {
  assert(!done());
  return net.get_transition_name(*it);
} //

void pn_succ_iterator::next  )  [virtual]
 

Jump to the next successor (if any).

void pn_succ_iterator::next() {
  assert(!done());
  it++;
} //

Implements spot::tgba_succ_iterator.

pn_succ_iterator& pn_succ_iterator::operator= const pn_succ_iterator s  )  [private]
 

not implemented (assert(false))


Member Data Documentation

bdd pn_succ_iterator::condition [private]
 

Condition satisfied by *mark.

Definition at line 131 of file pnsucciter.hh.

std::list<int>* pn_succ_iterator::fir [private]
 

Point to the list of transitions firable from *mark in net.

Definition at line 125 of file pnsucciter.hh.

std::list<int>::const_iterator pn_succ_iterator::it [private]
 

Designate the current successor.

Definition at line 128 of file pnsucciter.hh.

const marking* pn_succ_iterator::mark [private]
 

Point to the marking for which we iterate.

Definition at line 122 of file pnsucciter.hh.

const petri_net& pn_succ_iterator::net [private]
 

Designate the associated Petri net.

Definition at line 119 of file pnsucciter.hh.


The documentation for this class was generated from the following file:
Please comment this page and report errors about it on the RefDocComments page.
Generated on Tue Nov 9 16:24:02 2004 for checkpn by doxygen 1.3.8