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

pn_tgba Class Reference

Encapsulation of a petri_net in a spot::tgba. More...

Inheritance diagram for pn_tgba:

Inheritance graph
[legend]
Collaboration diagram for pn_tgba:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 pn_tgba (const petri_net *pn, const spot::ltl::atomic_prop_set *sap=0, spot::bdd_dict *dict=0)
 Construct a tgba view of pn where the set of atomic propositions which are obseved are in sap. The constructor registers these propositions in dict.
bdd current_condition (const marking &m) const
 Return the bdd corresponding to the values of the observed atomic propositions in the marking m.
virtual ~pn_tgba ()
 Unregister all the used propositions.
spot::stateget_init_state () const
 Get the initial state of the automaton.
spot::tgba_succ_iteratorsucc_iter (const spot::state *local_state, const spot::state *, const spot::tgba *) const
 Get an iterator over the successors of local_state.
spot::bdd_dictget_dict () const
 Get the dictionary associated to the automaton.
std::string format_state (const spot::state *state) const
 Format the state as a string for printing.
std::string transition_annotation (const spot::tgba_succ_iterator *t) const
 Format the pointed transition as a string for printing.
bdd all_acceptance_conditions () const
 Return the empty set (false) as the Petri net accepts all infinite sequences. Take care that blocking sequences are not taken into account here.
bdd neg_acceptance_conditions () const
 Return true.

Protected Member Functions

bdd compute_support_conditions (const spot::state *state) const
 Do the actual computation of tgba::support_conditions(). Return true.
bdd compute_support_variables (const spot::state *state) const
 Do the actual computation of tgba::support_variables(). Return true.

Private Member Functions

 pn_tgba (const pn_tgba &p)
 not implemented (assert(false))
pn_tgbaoperator= (const pn_tgba &p)
 not implemented (assert(false))

Private Attributes

const petri_netpn
 Reference the encapsulated Petri net.
spot::bdd_dictdict
 Point to the associated dictionnary.
std::map< int, int > mplace_at_prop

Detailed Description

Encapsulation of a petri_net in a spot::tgba.

Definition at line 43 of file pntgba.hh.


Constructor & Destructor Documentation

pn_tgba::pn_tgba const petri_net pn,
const spot::ltl::atomic_prop_set sap = 0,
spot::bdd_dict dict = 0
 

Construct a tgba view of pn where the set of atomic propositions which are obseved are in sap. The constructor registers these propositions in dict.

sap can be a null pointer if the tgba will not be used for checking. In this case, dict can also be a null pointer. The pointers pn and dict (if not null) are supposed to be valide during all the live of the constructed instance.

pn_tgba::pn_tgba(const petri_net* p,
        const spot::ltl::atomic_prop_set* sap,
        spot::bdd_dict* dic) : pn(*p) {
  assert(!sap || dic);

  dict = dic;
  if (sap) {
    spot::ltl::atomic_prop_set::iterator it;
    for(it=sap->begin(); it!=sap->end(); ++it) {
      mplace_at_prop[pn.get_place_num((*it)->name())] =
                      dict->register_proposition(*it, this);
    }
  }
} //

virtual pn_tgba::~pn_tgba  )  [virtual]
 

Unregister all the used propositions.

pn_tgba::~pn_tgba() {
  if (dict)
    dict->unregister_all_my_variables(this);
} //

pn_tgba::pn_tgba const pn_tgba p  )  [private]
 

not implemented (assert(false))


Member Function Documentation

bdd pn_tgba::all_acceptance_conditions  )  const [virtual]
 

Return the empty set (false) as the Petri net accepts all infinite sequences. Take care that blocking sequences are not taken into account here.

Implements spot::tgba.

bdd pn_tgba::compute_support_conditions const spot::state state  )  const [protected]
 

Do the actual computation of tgba::support_conditions(). Return true.

bdd pn_tgba::compute_support_variables const spot::state state  )  const [protected]
 

Do the actual computation of tgba::support_variables(). Return true.

bdd pn_tgba::current_condition const marking m  )  const
 

Return the bdd corresponding to the values of the observed atomic propositions in the marking m.

bdd pn_tgba::current_condition(const marking& m) const {
  bdd res = bddtrue;
  std::map<int, int>::const_iterator it;
  for(it=mplace_at_prop.begin(); it!=mplace_at_prop.end();it++)
    if (m.get(it->first) > 0)
      res &= bdd_ithvar(it->second);
    else
      res &= bdd_nithvar(it->second);
  return res;
} //

std::string pn_tgba::format_state const spot::state state  )  const
 

Format the state as a string for printing.

std::string pn_tgba::format_state(const spot::state* state) const {
  const pn_state* s = dynamic_cast<const pn_state*>(state);
  assert(s);
  marking* m = s->get_marking().expand();
  std::string res = pn.format_marking(*m);
  delete m;
  return res;
} //

spot::bdd_dict* pn_tgba::get_dict  )  const [virtual]
 

Get the dictionary associated to the automaton.

spot::bdd_dict* pn_tgba::get_dict() const {
  return dict;
} //

Implements spot::tgba.

spot::state* pn_tgba::get_init_state  )  const [virtual]
 

Get the initial state of the automaton.

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

spot::state* pn_tgba::get_init_state() const {
  marking* m0 = pn.get_initial_marking();
  pn_state* res = new pn_state(*m0);
  delete m0;
  return res;
} //

Implements spot::tgba.

bdd pn_tgba::neg_acceptance_conditions  )  const [virtual]
 

Return true.

Implements spot::tgba.

pn_tgba& pn_tgba::operator= const pn_tgba p  )  [private]
 

not implemented (assert(false))

spot::tgba_succ_iterator* pn_tgba::succ_iter const spot::state local_state,
const spot::state ,
const spot::tgba
const
 

Get an iterator over the successors of local_state.

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

The two last parameters are not used here

spot::tgba_succ_iterator* pn_tgba::succ_iter (const spot::state* local_state,
        const spot::state*, const spot::tgba*) const {
  const pn_state* s = dynamic_cast<const pn_state*>(local_state);
  assert(s);
  marking* m = s->get_marking().expand();
  return new pn_succ_iterator(pn, m, current_condition(*m));
} //

std::string pn_tgba::transition_annotation const spot::tgba_succ_iterator t  )  const
 

Format the pointed transition as a string for printing.

Parameters:
t a non-done pn_succ_iterator for this automata
std::string pn_tgba::transition_annotation(const spot::tgba_succ_iterator* t)
const {
  assert(!t->done());
  return (dynamic_cast<const pn_succ_iterator*>(t))->format_transition();
} //


Member Data Documentation

spot::bdd_dict* pn_tgba::dict [private]
 

Point to the associated dictionnary.

Definition at line 150 of file pntgba.hh.

std::map<int, int> pn_tgba::mplace_at_prop [private]
 

Map the indexes of places used as atomic propositions to the corresponding indexes of bdd variables.

Definition at line 154 of file pntgba.hh.

const petri_net& pn_tgba::pn [private]
 

Reference the encapsulated Petri net.

Definition at line 147 of file pntgba.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 Mon Jan 31 15:17:17 2005 for checkpn by doxygen 1.4.0