mCRL2
Loading...
Searching...
No Matches
mcrl2::pbes_system::detail::parity_game_output Class Reference

#include <parity_game_output.h>

Inheritance diagram for mcrl2::pbes_system::detail::parity_game_output:
mcrl2::pbes_system::parity_game_generator

Public Member Functions

 parity_game_output (pbes &p, bool min_parity_game=true)
 
std::string python_graph ()
 Returns a representation of the parity game in python format. This code is used as input for a python parity game solver.
 
std::string pgsolver_graph ()
 Returns a representation of the parity game in Alpaga format.
 
void run ()
 Generates the parity game graph.
 
- Public Member Functions inherited from mcrl2::pbes_system::parity_game_generator
 parity_game_generator (pbes &p, bool true_false_dependencies=false, bool is_min_parity=true, data::rewriter::strategy rewrite_strategy=data::rewrite_strategy::jitty)
 Constructor.
 
virtual ~parity_game_generator ()=default
 
virtual propositional_variable_instantiation get_initial_state ()
 Returns the (rewritten) initial state.
 
virtual operation_type get_operation (std::size_t index)
 Returns the vertex type.
 
virtual operation_type get_expression_operation (const pbes_expression &phi)
 Returns the vertex type.
 
virtual std::size_t get_priority (std::size_t index)
 Returns the priority of a vertex. The priority of the first equation is 0 if it is a maximal fixpoint, and 1 if it is a minimal fixpoint.
 
virtual std::set< std::size_t > get_initial_values ()
 Returns the vertices for which a solution is requested. By default a set containing the values 0, 1 and 2 is returned, corresponding to the expressions true, false and the initial state of the PBES.
 
virtual std::set< std::size_t > get_dependencies (std::size_t index)
 Returns the successors of a vertex in the graph.
 
virtual void print_variable_mapping ()
 Prints the mapping from BES variables to the corresponding PBES expressions.
 

Protected Member Functions

std::string vertex (std::size_t i) const
 Returns the quoted name of the vertex, for example "X1".
 
std::string edge (std::pair< std::size_t, std::size_t > e) const
 Returns a tuple representing an edge, for example ("X1", "X2")
 
std::string priority (std::pair< std::size_t, std::size_t > p) const
 Returns a string representing a priority, for example "X1":0.
 
template<typename Container , typename Function >
std::vector< std::string > apply (const Container &c, const Function &f) const
 Applies a function to the elements of a container.
 
template<typename Container >
std::string join (const Container &c, const std::string &sep) const
 Prints the elements of a container with a separator between them.
 
std::string python_set (const std::vector< std::string > &elements) const
 Wraps a sequence of strings in a Python set.
 
void print_set (const std::string &name, const std::set< std::size_t > &todo) const
 Prints the todo list.
 
- Protected Member Functions inherited from mcrl2::pbes_system::parity_game_generator
std::size_t add_bes_equation (pbes_expression t, std::size_t priority)
 Adds a BES equation for a given PBES expression, if it not already exists.
 
void make_substitution (const data::variable_list &v, const data::data_expression_list &e, substitution_function &sigma) const
 Generates a substitution function for the pbesinst rewriter.
 
pbes_expression expand_rhs (const pbes_expression &psi)
 
void compute_equation_index_map ()
 Compute equation index map.
 
void compute_priorities (const std::vector< pbes_equation > &equations)
 Compute priorities of PBES propositional variables.
 
virtual std::string print_bes_equation (std::size_t index, const std::set< std::size_t > &rhs)
 
std::string print_equation_count (std::size_t size, std::size_t step=1000) const
 Prints a log message for every step-th equation.
 
virtual void initialize_generation ()
 

Protected Attributes

std::set< std::size_t > V
 The vertices of the parity game graph.
 
std::set< std::pair< std::size_t, std::size_t > > E
 The edges of the parity game graph.
 
std::map< std::size_t, std::size_t > priorities
 The vertex priorities of the parity game graph.
 
std::set< std::size_t > even_vertices
 The even vertices of the parity game graph.
 
std::set< std::size_t > odd_vertices
 The odd vertices of the parity game graph.
 
- Protected Attributes inherited from mcrl2::pbes_system::parity_game_generator
bool m_initialized = false
 Mark whether initialization has been initialized. Needed to properly cope with virtual inheritance!
 
pbes & m_pbes
 The PBES that is being solved.
 
data::rewriter datar
 Data rewriter.
 
pbes_system::enumerate_quantifiers_rewriter R
 PBES rewriter.
 
std::map< core::identifier_string, std::vector< pbes_equation >::const_iterator > m_pbes_equation_index
 Maps propositional variables to corresponding PBES equations.
 
std::map< core::identifier_string, std::size_t > m_priorities
 Maps propositional variables to corresponding priorities.
 
std::map< pbes_expression, std::size_t > m_pbes_expression_index
 Maps PBES closed expressions to corresponding BES variables.
 
std::vector< std::pair< pbes_expression, std::size_t > > m_bes
 Contains intermediate results of the BES that is being generated. m_bes[i] represents a BES equation corresponding to BES variable i. m_bes[i].first is the right hand side of the BES equation m_bes[i].second is the block nesting depth of the corresponding PBES variable.
 
bool m_true_false_dependencies
 Determines what kind of BES equations are generated for true and false.
 
bool m_is_min_parity_game
 True if it is a min-parity game.
 
std::size_t m_max_priority = 0
 The maximum priority value of the game.
 

Additional Inherited Members

- Public Types inherited from mcrl2::pbes_system::parity_game_generator
enum class  operation_type { PGAME_OR , PGAME_AND }
 The operation type of the vertices. More...
 
- Protected Types inherited from mcrl2::pbes_system::parity_game_generator
using substitution_function = data::rewriter::substitution_type
 Substitution function type used by the PBES rewriter.
 

Detailed Description

A class that generates python code for a parity game, such that it can be solved with a parity game solver written in python.

Definition at line 28 of file parity_game_output.h.

Constructor & Destructor Documentation

◆ parity_game_output()

mcrl2::pbes_system::detail::parity_game_output::parity_game_output ( pbes &  p,
bool  min_parity_game = true 
)
inlineexplicit

Definition at line 122 of file parity_game_output.h.

Member Function Documentation

◆ apply()

template<typename Container , typename Function >
std::vector< std::string > mcrl2::pbes_system::detail::parity_game_output::apply ( const Container &  c,
const Function &  f 
) const
inlineprotected

Applies a function to the elements of a container.

Parameters
cA container
fA function
Returns
The transformed container

Definition at line 75 of file parity_game_output.h.

◆ edge()

std::string mcrl2::pbes_system::detail::parity_game_output::edge ( std::pair< std::size_t, std::size_t >  e) const
inlineprotected

Returns a tuple representing an edge, for example ("X1", "X2")

Parameters
eAn edge
Returns
A tuple representing an edge, for example ("X1", "X2")

Definition at line 57 of file parity_game_output.h.

◆ join()

template<typename Container >
std::string mcrl2::pbes_system::detail::parity_game_output::join ( const Container &  c,
const std::string &  sep 
) const
inlineprotected

Prints the elements of a container with a separator between them.

Parameters
cA container
sepA string
Returns
The joined elements

Definition at line 90 of file parity_game_output.h.

◆ pgsolver_graph()

std::string mcrl2::pbes_system::detail::parity_game_output::pgsolver_graph ( )
inline

Returns a representation of the parity game in Alpaga format.

Returns
A representation of the parity game in Alpaga format.

Definition at line 154 of file parity_game_output.h.

◆ print_set()

void mcrl2::pbes_system::detail::parity_game_output::print_set ( const std::string &  name,
const std::set< std::size_t > &  todo 
) const
inlineprotected

Prints the todo list.

Parameters
nameA string
todoA todo list

Definition at line 111 of file parity_game_output.h.

◆ priority()

std::string mcrl2::pbes_system::detail::parity_game_output::priority ( std::pair< std::size_t, std::size_t >  p) const
inlineprotected

Returns a string representing a priority, for example "X1":0.

Parameters
pA pair of integers
Returns
A string representing a priority, for example "X1":0

Definition at line 65 of file parity_game_output.h.

◆ python_graph()

std::string mcrl2::pbes_system::detail::parity_game_output::python_graph ( )
inline

Returns a representation of the parity game in python format. This code is used as input for a python parity game solver.

Returns
A representation of the parity game in python format.

Definition at line 141 of file parity_game_output.h.

◆ python_set()

std::string mcrl2::pbes_system::detail::parity_game_output::python_set ( const std::vector< std::string > &  elements) const
inlineprotected

Wraps a sequence of strings in a Python set.

Parameters
elementsA vector of strings
Returns
The Python set representation

Definition at line 103 of file parity_game_output.h.

◆ run()

void mcrl2::pbes_system::detail::parity_game_output::run ( )
inline

Generates the parity game graph.

Definition at line 172 of file parity_game_output.h.

◆ vertex()

std::string mcrl2::pbes_system::detail::parity_game_output::vertex ( std::size_t  i) const
inlineprotected

Returns the quoted name of the vertex, for example "X1".

Parameters
iA positive integer
Returns
The quoted name of the vertex, for example "X1"

Definition at line 49 of file parity_game_output.h.

Member Data Documentation

◆ E

std::set<std::pair<std::size_t, std::size_t> > mcrl2::pbes_system::detail::parity_game_output::E
protected

The edges of the parity game graph.

Definition at line 35 of file parity_game_output.h.

◆ even_vertices

std::set<std::size_t> mcrl2::pbes_system::detail::parity_game_output::even_vertices
protected

The even vertices of the parity game graph.

Definition at line 41 of file parity_game_output.h.

◆ odd_vertices

std::set<std::size_t> mcrl2::pbes_system::detail::parity_game_output::odd_vertices
protected

The odd vertices of the parity game graph.

Definition at line 44 of file parity_game_output.h.

◆ priorities

std::map<std::size_t, std::size_t> mcrl2::pbes_system::detail::parity_game_output::priorities
protected

The vertex priorities of the parity game graph.

Definition at line 38 of file parity_game_output.h.

◆ V

std::set<std::size_t> mcrl2::pbes_system::detail::parity_game_output::V
protected

The vertices of the parity game graph.

Definition at line 32 of file parity_game_output.h.


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