mCRL2
Loading...
Searching...
No Matches
mcrl2::pbes_system::detail::bqnf2ppg_rewriter Struct Reference

#include <bqnf2ppg_rewriter.h>

Inheritance diagram for mcrl2::pbes_system::detail::bqnf2ppg_rewriter:
mcrl2::pbes_system::detail::bqnf_visitor

Public Types

using equation_type = pbes_equation
 The equation type.
 
using term_type = pbes_expression
 The expression type of the equation.
 

Public Member Functions

 bqnf2ppg_rewriter (const pbes &p)
 Constructor.
 
virtual std::vector< equation_type > result ()
 Returns the result of the transformation.
 
virtual std::string fresh_variable_name (const std::string &s)
 Generates a fresh variable name, based on s (extending s).
 
virtual bool visit_inner_implies (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e, const data::variable_list &qvars, const term_type &qexpr)
 Visits a disjunctive expression qexpr within a bounded universal quantifier expression e. Rewrites the expression qexpr to PPG form and adds a universal quantifier over the variables qvars. The resulting equations are added to the sequence of result equations.
 
bool visit_bounded_forall (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e) override
 Visits a bounded universal quantifier expression. Rewrites the expression to PPG form by collecting quantified variables and calling visit_inner_implies. The resulting equations are added to the sequence of result equations.
 
virtual bool visit_inner_and_quantified (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e, const data::variable_list &qvars, const term_type &qexpr)
 Visits a conjunctive expression qexpr within a bounded existential quantifier expression e. Rewrites the expression qexpr to PPG form and adds a existential quantifier over the variables qvars. The resulting equations are added to the sequence of result equations.
 
bool visit_bounded_exists (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e) override
 Visits a bounded existential quantifier expression. Rewrites the expression to PPG form by collecting quantified variables and calling visit_inner_and. The resulting equations are added to the sequence of result equations.
 
virtual std::pair< term_type, equation_type > rewrite_inner_bounded_forall (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e, const equation_type &dummy)
 Rewrites an inner bounded universal quantifier expression to PPG form. Returns the rewritten expression and possibly a newly introduced equation. The new equation is itself not rewritten yet.
 
bool visit_and (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e) override
 Visits a conjunctive expression. Rewrites the expression to PPG form. The resulting equations are added to the sequence of result equations.
 
virtual std::pair< term_type, equation_type > rewrite_inner_bounded_exists (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e, const equation_type &dummy)
 Rewrites an inner bounded existential quantifier expression to PPG form. Returns the rewritten expression and possibly a newly introduced equation. The new equation is itself not rewritten yet.
 
bool visit_or (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e) override
 Visits a disjunctive expression. Rewrites the expression to PPG form. The resulting equations are added to the sequence of result equations.
 
bool visit_bqnf_expression (const fixpoint_symbol &sigma, const propositional_variable &var, const term_type &e) override
 Visits a BQNF expression. Rewrites the expression to PPG form. The resulting equations are added to the sequence of result equations.
 
bool visit_bqnf_equation (const equation_type &eqn) override
 Visits a BQNF equation. Rewrites the equation to a PPG equation. The resulting equations are added to the sequence of result equations.
 
- Public Member Functions inherited from mcrl2::pbes_system::detail::bqnf_visitor
virtual ~bqnf_visitor ()=default
 Destructor.
 
virtual bool visit_simple_expression (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a simple expression. An expression is simple if it does not contain propositional variables.
 
virtual bool visit_propositional_variable (const fixpoint_symbol &, const propositional_variable &, const pbes_expression &e)
 Visits a propositional variable expression.
 
virtual bool visit_inner_and (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a conjunctive expression within an inner existential quantifier expression.
 
virtual bool visit_inner_bounded_exists (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a bounded existential quantifier expression within a disjunctive expression.
 
virtual bool visit_or (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a disjunctive expression.
 
virtual bool visit_inner_bounded_forall (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a bounded universal quantifier expression within a conjunctive expression.
 
virtual bool visit_and (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a conjunctive expression.
 
virtual bool visit_bounded_forall (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a bounded universal quantifier expression.
 
virtual bool visit_bounded_exists (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a bounded existential quantifier expression.
 
virtual bool visit_bounded_quantifier (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a bounded quantifier expression.
 
virtual bool visit_bqnf_expression (const fixpoint_symbol &sigma, const propositional_variable &var, const pbes_expression &e)
 Visits a BQNF expression.
 
virtual bool visit_bqnf_expression (const pbes_expression &e)
 Visits a BQNF expression. In the current BQNF visitor sigma and var parameters are added for use in bqnf2ppg_rewriter. This functions adds dummy values for sigma and var.
 
virtual bool visit_bqnf_equation (const pbes_equation &eqn)
 Visits a BQNF equation.
 
virtual bool visit_bqnf_equation_debug (const pbes_equation &eqn)
 Visits a BQNF equation in debug mode.
 

Public Attributes

std::set< std::string > variable_names
 The set of variable names already in use.
 
std::map< std::string, int > variable_name_suffix
 A map from variable name prefix to the last suffix that has been added.
 
std::vector< equation_type > equations
 The sequence of equations resulting from the transformation.
 
- Public Attributes inherited from mcrl2::pbes_system::detail::bqnf_visitor
bool debug = false
 flag that indicates if debug output should be printed.
 

Additional Inherited Members

- Static Public Member Functions inherited from mcrl2::pbes_system::detail::bqnf_visitor
static std::string print_brief (const pbes_expression &e)
 Returns a string representation of the type of the root node of the expression.
 
static bool is_inner_and (const pbes_expression &e)
 Determines if an expression if of the form phi /\ psi where phi is a simple expression and psi is an arbitrary expression.
 
static bool is_inner_implies (const pbes_expression &e)
 Determines if an expression if of the form phi => psi or of the form phi \/ psi where phi is a simple expression and psi is an arbitrary expression.
 

Detailed Description

Definition at line 28 of file bqnf2ppg_rewriter.h.

Member Typedef Documentation

◆ equation_type

◆ term_type

The expression type of the equation.

Definition at line 33 of file bqnf2ppg_rewriter.h.

Constructor & Destructor Documentation

◆ bqnf2ppg_rewriter()

mcrl2::pbes_system::detail::bqnf2ppg_rewriter::bqnf2ppg_rewriter ( const pbes &  p)
inline

Constructor.

Parameters
pThe PBES of which the equation is part. Used to avoid name clashes when introducing new variables.

Definition at line 44 of file bqnf2ppg_rewriter.h.

Member Function Documentation

◆ fresh_variable_name()

virtual std::string mcrl2::pbes_system::detail::bqnf2ppg_rewriter::fresh_variable_name ( const std::string &  s)
inlinevirtual

Generates a fresh variable name, based on s (extending s).

Parameters
sA string.
Returns
a fresh variable name.

Definition at line 63 of file bqnf2ppg_rewriter.h.

◆ result()

virtual std::vector< equation_type > mcrl2::pbes_system::detail::bqnf2ppg_rewriter::result ( )
inlinevirtual

Returns the result of the transformation.

Returns
the sequence of equations resulting from the transformation.

Definition at line 55 of file bqnf2ppg_rewriter.h.

◆ rewrite_inner_bounded_exists()

virtual std::pair< term_type, equation_type > mcrl2::pbes_system::detail::bqnf2ppg_rewriter::rewrite_inner_bounded_exists ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e,
const equation_type &  dummy 
)
inlinevirtual

Rewrites an inner bounded existential quantifier expression to PPG form. Returns the rewritten expression and possibly a newly introduced equation. The new equation is itself not rewritten yet.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ea PBES expression.
dummydummy equation, returned as equation if no equation is generated.
Returns
a pair consisting of the expression that replaces the original expression e and an equation that is possibly introduced as result of the transformation (or the dummy equation if no new equation is created).

Definition at line 408 of file bqnf2ppg_rewriter.h.

◆ rewrite_inner_bounded_forall()

virtual std::pair< term_type, equation_type > mcrl2::pbes_system::detail::bqnf2ppg_rewriter::rewrite_inner_bounded_forall ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e,
const equation_type &  dummy 
)
inlinevirtual

Rewrites an inner bounded universal quantifier expression to PPG form. Returns the rewritten expression and possibly a newly introduced equation. The new equation is itself not rewritten yet.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ea PBES expression.
dummydummy equation, returned as equation if no equation is generated.
Returns
a pair consisting of the expression that replaces the original expression e and an equation that is possibly introduced as result of the transformation (or the dummy equation if no new equation is created).

Definition at line 297 of file bqnf2ppg_rewriter.h.

◆ visit_and()

bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_and ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e 
)
inlineoverridevirtual

Visits a conjunctive expression. Rewrites the expression to PPG form. The resulting equations are added to the sequence of result equations.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ea PBES expression.
Returns
true if the expression e conforms to BQNF.

Reimplemented from mcrl2::pbes_system::detail::bqnf_visitor.

Definition at line 367 of file bqnf2ppg_rewriter.h.

◆ visit_bounded_exists()

bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_bounded_exists ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e 
)
inlineoverridevirtual

Visits a bounded existential quantifier expression. Rewrites the expression to PPG form by collecting quantified variables and calling visit_inner_and. The resulting equations are added to the sequence of result equations.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ea PBES expression.
Returns
true if the expression e conforms to BQNF.

Reimplemented from mcrl2::pbes_system::detail::bqnf_visitor.

Definition at line 268 of file bqnf2ppg_rewriter.h.

◆ visit_bounded_forall()

bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_bounded_forall ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e 
)
inlineoverridevirtual

Visits a bounded universal quantifier expression. Rewrites the expression to PPG form by collecting quantified variables and calling visit_inner_implies. The resulting equations are added to the sequence of result equations.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ea PBES expression.
Returns
true if the expression e conforms to BQNF.

Reimplemented from mcrl2::pbes_system::detail::bqnf_visitor.

Definition at line 168 of file bqnf2ppg_rewriter.h.

◆ visit_bqnf_equation()

bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_bqnf_equation ( const equation_type &  eqn)
inlineoverridevirtual

Visits a BQNF equation. Rewrites the equation to a PPG equation. The resulting equations are added to the sequence of result equations.

Parameters
eqna PBES equation
Returns
true if the right hand side of the equation is in BQNF.

Reimplemented from mcrl2::pbes_system::detail::bqnf_visitor.

Definition at line 533 of file bqnf2ppg_rewriter.h.

◆ visit_bqnf_expression()

bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_bqnf_expression ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e 
)
inlineoverridevirtual

Visits a BQNF expression. Rewrites the expression to PPG form. The resulting equations are added to the sequence of result equations.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ea PBES expression.
Returns
true if the right hand side of the equation is in BQNF.

Reimplemented from mcrl2::pbes_system::detail::bqnf_visitor.

Definition at line 508 of file bqnf2ppg_rewriter.h.

◆ visit_inner_and_quantified()

virtual bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_inner_and_quantified ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e,
const data::variable_list &  qvars,
const term_type &  qexpr 
)
inlinevirtual

Visits a conjunctive expression qexpr within a bounded existential quantifier expression e. Rewrites the expression qexpr to PPG form and adds a existential quantifier over the variables qvars. The resulting equations are added to the sequence of result equations.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ethe parent PBES expression.
qvarsthe quantifier variables of the quantifier in the parent expression.
qexprthe PBES expression within the quantifier expression.
Returns
true if the expression qexpr conforms to BQNF.

Definition at line 198 of file bqnf2ppg_rewriter.h.

◆ visit_inner_implies()

virtual bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_inner_implies ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e,
const data::variable_list &  qvars,
const term_type &  qexpr 
)
inlinevirtual

Visits a disjunctive expression qexpr within a bounded universal quantifier expression e. Rewrites the expression qexpr to PPG form and adds a universal quantifier over the variables qvars. The resulting equations are added to the sequence of result equations.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ethe parent PBES expression.
qvarsthe quantifier variables of the quantifier in the parent expression.
qexprthe PBES expression within the quantifier expression.
Returns
true if the expression qexpr conforms to BQNF.

Definition at line 90 of file bqnf2ppg_rewriter.h.

◆ visit_or()

bool mcrl2::pbes_system::detail::bqnf2ppg_rewriter::visit_or ( const fixpoint_symbol &  sigma,
const propositional_variable &  var,
const term_type &  e 
)
inlineoverridevirtual

Visits a disjunctive expression. Rewrites the expression to PPG form. The resulting equations are added to the sequence of result equations.

Parameters
sigmafixpoint symbol of the parent equation.
varpropositional variable of the parent equation.
ea PBES expression.
Returns
true if the expression e conforms to BQNF.

Reimplemented from mcrl2::pbes_system::detail::bqnf_visitor.

Definition at line 470 of file bqnf2ppg_rewriter.h.

Member Data Documentation

◆ equations

std::vector<equation_type> mcrl2::pbes_system::detail::bqnf2ppg_rewriter::equations

The sequence of equations resulting from the transformation.

Definition at line 40 of file bqnf2ppg_rewriter.h.

◆ variable_name_suffix

std::map<std::string,int> mcrl2::pbes_system::detail::bqnf2ppg_rewriter::variable_name_suffix

A map from variable name prefix to the last suffix that has been added.

Definition at line 38 of file bqnf2ppg_rewriter.h.

◆ variable_names

std::set<std::string> mcrl2::pbes_system::detail::bqnf2ppg_rewriter::variable_names

The set of variable names already in use.

Definition at line 36 of file bqnf2ppg_rewriter.h.


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