mCRL2
Loading...
Searching...
No Matches
mcrl2::pbes_system::explorer Class Reference

#include <pbes_explorer.h>

Public Types

typedef parity_game_generator::operation_type operation_type
 The expression type of the equation.
 

Public Member Functions

 explorer (const std::string &filename, const std::string &rewrite_strategy, bool reset_flag, bool always_split_flag)
 Constructor.
 
 explorer (const pbes &p_, const std::string &rewrite_strategy, bool reset_flag, bool always_split_flag)
 Constructor.
 
 ~explorer ()
 Destructor.
 
lts_infoget_info () const
 Returns the PBES_Info object.
 
ltsmin_state get_initial_state () const
 Returns the initial state.
 
void initial_state (int *state)
 
int get_index (int type_no, const std::string &s)
 Returns the index of value in the local store for the data type with number type_no. Type 0 is reserved for the string representations of variable names. The value is added to the store if it is not already present.
 
int get_string_index (const std::string &s)
 Returns the index of s in the local store for string values. This store is reserved for the string representations of variable names. The value is added to the store if it is not already present.
 
void to_state_vector (const ltsmin_state &dst_state, int *dst, const ltsmin_state &src_state, int *const &src)
 Transforms a PBES state to a state vector, represented by an array of integers.
 
std::string get_value (int type_no, int index)
 Returns the value at position index in the local store for the data type with number type_no. Type 0 is reserved for the string representations of variable names. An exception is thrown if the index does not exist in the store.
 
const std::string & get_string_value (int index)
 Returns the string at position index in the local store for string values. An exception is thrown if the index does not exist in the store.
 
ltsmin_state from_state_vector (int *const &src)
 Transforms a state vector src into a PBES_State object object containing the variable and parameter values that are represented by the indices in src.
 
std::vector< ltsmin_stateget_successors (const ltsmin_state &state)
 Computes successor states for a state. Serves as a wrapper around the get_successors function of the pbes_greybox_interface.
 
template<typename callback >
void next_state_all (int *const &src, callback &cb)
 Iterates over the successors of a state and invokes a callback function for each successor state.
 
std::vector< ltsmin_stateget_successors (const ltsmin_state &state, int group)
 Computes successor states for a state as defined in transition group group. Serves as a wrapper around the get_successors function of the pbes_greybox_interface.
 
template<typename callback >
void next_state_long (int *const &src, int group, callback &cb)
 Iterates over the successors of a state for a certain transition group and invokes a callback function for each successor state.
 

Static Public Member Functions

static ltsmin_state true_state ()
 Returns the state representing true.
 
static ltsmin_state false_state ()
 Returns the state representing false.
 

Protected Member Functions

ltsmin_state get_state (const propositional_variable_instantiation &expr) const
 Returns a PBES_State object for expr.
 
std::string data_to_string (const data::data_expression &e)
 Returns a string representation for the data expression e.
 
data::data_expression string_to_data (const std::string &s)
 Returns a data expression for the string representation s.
 
int get_value_index (int type_no, const data_expression &value)
 Returns the index of value in the local store for the data type with number type_no. The value is added to the store if it is not already present.
 
const data_expressionget_data_value (int type_no, int index)
 Returns the value at position index in the local store for the data type with number type_no. An exception is thrown if the index does not exist in the store.
 

Protected Attributes

detail::pbes_greybox_interfacepgg
 the PBES greybox interface
 

Private Attributes

pbes p
 
lts_infoinfo
 
std::map< std::string, int > localmap_string2int
 
std::vector< std::string > localmap_int2string
 
std::vector< std::map< data_expression, int > > localmaps_data2int
 
std::vector< std::vector< data_expression > > localmaps_int2data
 

Detailed Description

Definition at line 433 of file pbes_explorer.h.

Member Typedef Documentation

◆ operation_type

The expression type of the equation.

Definition at line 437 of file pbes_explorer.h.

Constructor & Destructor Documentation

◆ explorer() [1/2]

mcrl2::pbes_system::explorer::explorer ( const std::string &  filename,
const std::string &  rewrite_strategy = "jittyc",
bool  reset_flag = false,
bool  always_split_flag = false 
)

Constructor.

explorer

Parameters
filenamethe name of a PBES file.
rewrite_strategythe name of the data rewrite strategy to use.
reset_flagif set, irrelevant parts of the state vector will be reset to a default value
always_split_flagif set, equations will always be split into conjuncts or disjuncts to form transition groups, if not set (default) the explorer assumes the pbes to be generated with lps2pbes -p and splits accordingly.

Definition at line 1289 of file pbes_explorer.cpp.

◆ explorer() [2/2]

mcrl2::pbes_system::explorer::explorer ( const pbes p_,
const std::string &  rewrite_strategy = "jittyc",
bool  reset_flag = false,
bool  always_split_flag = false 
)

Constructor.

Parameters
p_a PBES.
rewrite_strategyString representing the rewrite strategy to use for the data rewriter.
reset_flagif set, irrelevant parts of the state vector will be reset to a default value
always_split_flagif set, equations will always be split into conjuncts or disjuncts to form transition groups, if not set (default) the explorer assumes the pbes to be generated with lps2pbes -p and splits accordingly.

Definition at line 1316 of file pbes_explorer.cpp.

◆ ~explorer()

mcrl2::pbes_system::explorer::~explorer ( )

Destructor.

Definition at line 1332 of file pbes_explorer.cpp.

Member Function Documentation

◆ data_to_string()

std::string mcrl2::pbes_system::explorer::data_to_string ( const data::data_expression e)
protected

Returns a string representation for the data expression e.

Parameters
ea PBES expression that may be in internal format.
Returns
a string representation without internal rewriter quirks.

◆ false_state()

ltsmin_state mcrl2::pbes_system::explorer::false_state ( )
inlinestatic

Returns the state representing false.

Definition at line 1379 of file pbes_explorer.cpp.

◆ from_state_vector()

ltsmin_state mcrl2::pbes_system::explorer::from_state_vector ( int *const &  src)

Transforms a state vector src into a PBES_State object object containing the variable and parameter values that are represented by the indices in src.

Parameters
srcan int array containg the indices of the state values.
Returns
a PBES_State object containing the variable and parameter values that are represented by the indices in src.

Definition at line 1579 of file pbes_explorer.cpp.

◆ get_data_value()

const data_expression & mcrl2::pbes_system::explorer::get_data_value ( int  type_no,
int  index 
)
protected

Returns the value at position index in the local store for the data type with number type_no. An exception is thrown if the index does not exist in the store.

Parameters
type_nothe number of the value type.
indexan index.
Returns
the value at position index in local store type_no.

Definition at line 1567 of file pbes_explorer.cpp.

◆ get_index()

int mcrl2::pbes_system::explorer::get_index ( int  type_no,
const std::string &  s 
)

Returns the index of value in the local store for the data type with number type_no. Type 0 is reserved for the string representations of variable names. The value is added to the store if it is not already present.

Parameters
type_noThe number of the value type.
sA string representation of the data value.
Returns
The index of value in local store type_no.

Definition at line 1392 of file pbes_explorer.cpp.

◆ get_info()

lts_info * mcrl2::pbes_system::explorer::get_info ( ) const

Returns the PBES_Info object.

Definition at line 1339 of file pbes_explorer.cpp.

◆ get_initial_state()

ltsmin_state mcrl2::pbes_system::explorer::get_initial_state ( ) const

Returns the initial state.

Definition at line 1345 of file pbes_explorer.cpp.

◆ get_state()

ltsmin_state mcrl2::pbes_system::explorer::get_state ( const propositional_variable_instantiation expr) const
protected

Returns a PBES_State object for expr.

Parameters
expra propositional variable instantiation expression.

Definition at line 1360 of file pbes_explorer.cpp.

◆ get_string_index()

int mcrl2::pbes_system::explorer::get_string_index ( const std::string &  s)

Returns the index of s in the local store for string values. This store is reserved for the string representations of variable names. The value is added to the store if it is not already present.

Parameters
sThe string for which the index needs to be retrieved.
Returns
the index of s in the local store for string values.

Definition at line 1406 of file pbes_explorer.cpp.

◆ get_string_value()

const std::string & mcrl2::pbes_system::explorer::get_string_value ( int  index)

Returns the string at position index in the local store for string values. An exception is thrown if the index does not exist in the store.

Parameters
indexan index.
Returns
the string value at position index in the local store for string values.

Definition at line 1557 of file pbes_explorer.cpp.

◆ get_successors() [1/2]

std::vector< ltsmin_state > mcrl2::pbes_system::explorer::get_successors ( const ltsmin_state state)

Computes successor states for a state. Serves as a wrapper around the get_successors function of the pbes_greybox_interface.

Parameters
statethe source state.
Returns
a list of successor states.

Definition at line 1625 of file pbes_explorer.cpp.

◆ get_successors() [2/2]

std::vector< ltsmin_state > mcrl2::pbes_system::explorer::get_successors ( const ltsmin_state state,
int  group 
)

Computes successor states for a state as defined in transition group group. Serves as a wrapper around the get_successors function of the pbes_greybox_interface.

Parameters
statethe source state.
groupthe group for which the successor states are computed.
Returns
a list of successor states.

Definition at line 1669 of file pbes_explorer.cpp.

◆ get_value()

std::string mcrl2::pbes_system::explorer::get_value ( int  type_no,
int  index 
)

Returns the value at position index in the local store for the data type with number type_no. Type 0 is reserved for the string representations of variable names. An exception is thrown if the index does not exist in the store.

Parameters
type_nothe number of the value type.
indexan index.
Returns
a string representation of the value at position index in local store type_no.

Definition at line 1537 of file pbes_explorer.cpp.

◆ get_value_index()

int mcrl2::pbes_system::explorer::get_value_index ( int  type_no,
const data_expression value 
)
protected

Returns the index of value in the local store for the data type with number type_no. The value is added to the store if it is not already present.

Parameters
type_nothe number of the value type.
valuethe data value.
Returns
the index of value in local store type_no.

Definition at line 1423 of file pbes_explorer.cpp.

◆ initial_state()

void mcrl2::pbes_system::explorer::initial_state ( int *  state)

Definition at line 1352 of file pbes_explorer.cpp.

◆ next_state_all()

template<typename callback >
void mcrl2::pbes_system::explorer::next_state_all ( int *const &  src,
callback &  cb 
)
inline

Iterates over the successors of a state and invokes a callback function for each successor state.

Parameters
srcan int array containg the indices of the state values.
cba callback function that must provide the function operator() with the following interface:
void operator()(int* const& next_state, int group);

where

  • next_state is the target state of the transition
  • group is the number of the transition group, or -1 if it is unknown which group

Definition at line 580 of file pbes_explorer.h.

◆ next_state_long()

template<typename callback >
void mcrl2::pbes_system::explorer::next_state_long ( int *const &  src,
int  group,
callback &  cb 
)
inline

Iterates over the successors of a state for a certain transition group and invokes a callback function for each successor state.

Parameters
srcan int array containg the indices of the state values.
groupthe transition group
cba callback function that must provide the function operator() with the following interface:
void operator()(int* const& next_state, int group);

where

  • next_state is the target state of the transition
  • group is the number of the transition group, or -1 if it is unknown which group

Definition at line 616 of file pbes_explorer.h.

◆ string_to_data()

data::data_expression mcrl2::pbes_system::explorer::string_to_data ( const std::string &  s)
protected

Returns a data expression for the string representation s.

Parameters
sa string representation of a data expression.
Returns
the data expression (possibly in internal format) that s represents.

Definition at line 1385 of file pbes_explorer.cpp.

◆ to_state_vector()

void mcrl2::pbes_system::explorer::to_state_vector ( const ltsmin_state dst_state,
int *  dst,
const ltsmin_state src_state,
int *const &  src 
)

Transforms a PBES state to a state vector, represented by an array of integers.

Parameters
dst_statethe new PBES state object
dstthe int array to which the state vector is written
src_statethe source PBES state object, used to check which fields have been changed.
srcan array which is used for default values, to prevent unused variables for being reset. the non-resetting behaviour can be turned off by the –reset option.

Definition at line 1442 of file pbes_explorer.cpp.

◆ true_state()

ltsmin_state mcrl2::pbes_system::explorer::true_state ( )
inlinestatic

Returns the state representing true.

Definition at line 1373 of file pbes_explorer.cpp.

Member Data Documentation

◆ info

lts_info* mcrl2::pbes_system::explorer::info
private

Definition at line 441 of file pbes_explorer.h.

◆ localmap_int2string

std::vector<std::string> mcrl2::pbes_system::explorer::localmap_int2string
private

Definition at line 443 of file pbes_explorer.h.

◆ localmap_string2int

std::map<std::string,int> mcrl2::pbes_system::explorer::localmap_string2int
private

Definition at line 442 of file pbes_explorer.h.

◆ localmaps_data2int

std::vector<std::map<data_expression,int> > mcrl2::pbes_system::explorer::localmaps_data2int
private

Definition at line 444 of file pbes_explorer.h.

◆ localmaps_int2data

std::vector<std::vector<data_expression> > mcrl2::pbes_system::explorer::localmaps_int2data
private

Definition at line 445 of file pbes_explorer.h.

◆ p

pbes mcrl2::pbes_system::explorer::p
private

Definition at line 440 of file pbes_explorer.h.

◆ pgg

detail::pbes_greybox_interface* mcrl2::pbes_system::explorer::pgg
protected

the PBES greybox interface

Definition at line 479 of file pbes_explorer.h.


The documentation for this class was generated from the following files: