12#ifndef MCRL2_MODAL_FORMULA_REPLACE_H
13#define MCRL2_MODAL_FORMULA_REPLACE_H
15#include "mcrl2/lps/replace.h"
16#include "mcrl2/modal_formula/replace_capture_avoiding.h"
25template <
typename T,
typename Substitution>
27 const Substitution& sigma,
29 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
35template <
typename T,
typename Substitution>
37 const Substitution& sigma,
39 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
47template <
typename T,
typename Substitution>
49 const Substitution& sigma,
51 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
57template <
typename T,
typename Substitution>
59 const Substitution& sigma,
61 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
70template <
typename T,
typename Substitution>
72 const Substitution& sigma,
73 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
79template <
typename T,
typename Substitution>
81 const Substitution& sigma,
82 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
90template <
typename T,
typename Substitution>
92 const Substitution& sigma,
93 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
99template <
typename T,
typename Substitution>
101 const Substitution& sigma,
102 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
112template <
typename T,
typename Substitution>
114 const Substitution& sigma,
115 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
118 assert(
data::is_simple_substitution(sigma));
124template <
typename T,
typename Substitution>
126 const Substitution& sigma,
127 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
130 assert(
data::is_simple_substitution(sigma));
138template <
typename T,
typename Substitution,
typename VariableContainer>
140 const Substitution& sigma,
141 const VariableContainer& bound_variables,
142 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
145 assert(
data::is_simple_substitution(sigma));
151template <
typename T,
typename Substitution,
typename VariableContainer>
153 const Substitution& sigma,
154 const VariableContainer& bound_variables,
155 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
158 assert(
data::is_simple_substitution(sigma));
171template <
typename T,
typename Substitution>
173 const Substitution& sigma,
175 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
181template <
typename T,
typename Substitution>
183 const Substitution& sigma,
185 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
193template <
typename T,
typename Substitution>
195 const Substitution& sigma,
197 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
203template <
typename T,
typename Substitution>
205 const Substitution& sigma,
207 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
216template <
typename T,
typename Substitution>
218 const Substitution& sigma,
219 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
225template <
typename T,
typename Substitution>
227 const Substitution& sigma,
228 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
236template <
typename T,
typename Substitution>
238 const Substitution& sigma,
239 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
245template <
typename T,
typename Substitution>
247 const Substitution& sigma,
248 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
258template <
typename T,
typename Substitution>
260 const Substitution& sigma,
261 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
264 assert(
data::is_simple_substitution(sigma));
270template <
typename T,
typename Substitution>
272 const Substitution& sigma,
273 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
276 assert(
data::is_simple_substitution(sigma));
284template <
typename T,
typename Substitution,
typename VariableContainer>
286 const Substitution& sigma,
287 const VariableContainer& bound_variables,
288 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
291 assert(
data::is_simple_substitution(sigma));
297template <
typename T,
typename Substitution,
typename VariableContainer>
299 const Substitution& sigma,
300 const VariableContainer& bound_variables,
301 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
304 assert(
data::is_simple_substitution(sigma));
317template <
typename T,
typename Substitution>
319 const Substitution& sigma,
321 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
327template <
typename T,
typename Substitution>
329 const Substitution& sigma,
331 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
339template <
typename T,
typename Substitution>
341 const Substitution& sigma,
343 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
349template <
typename T,
typename Substitution>
351 const Substitution& sigma,
353 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
362template <
typename T,
typename Substitution>
364 const Substitution& sigma,
365 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
371template <
typename T,
typename Substitution>
373 const Substitution& sigma,
374 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
382template <
typename T,
typename Substitution>
384 const Substitution& sigma,
385 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
391template <
typename T,
typename Substitution>
393 const Substitution& sigma,
394 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
404template <
typename T,
typename Substitution>
406 const Substitution& sigma,
407 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
410 assert(
data::is_simple_substitution(sigma));
416template <
typename T,
typename Substitution>
418 const Substitution& sigma,
419 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
422 assert(
data::is_simple_substitution(sigma));
430template <
typename T,
typename Substitution,
typename VariableContainer>
432 const Substitution& sigma,
433 const VariableContainer& bound_variables,
434 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
437 assert(
data::is_simple_substitution(sigma));
443template <
typename T,
typename Substitution,
typename VariableContainer>
445 const Substitution& sigma,
446 const VariableContainer& bound_variables,
447 typename std::enable_if<std::is_base_of<atermpp::aterm, T>::value>::type* =
nullptr
450 assert(
data::is_simple_substitution(sigma));
461template <
template <
class>
class Builder,
class Substitution>
462struct substitute_state_formulas_builder:
public Builder<substitute_state_formulas_builder<Builder, Substitution> >
464 typedef Builder<substitute_state_formulas_builder<Builder, Substitution> > super;
473 substitute_state_formulas_builder(Substitution sigma_,
bool innermost_)
475 innermost(innermost_)
492template <
template <
class>
class Builder,
class Substitution>
493substitute_state_formulas_builder<Builder, Substitution>
494make_replace_state_formulas_builder(Substitution sigma,
bool innermost)
496 return substitute_state_formulas_builder<Builder, Substitution>(sigma, innermost);
502template <
typename T,
typename Substitution>
505 bool innermost =
true,
506 typename std::enable_if< !std::is_base_of< atermpp::aterm, T >::value>::type* = 0
512template <
typename T,
typename Substitution>
515 bool innermost =
true,
516 typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value>::type* =
nullptr
aterm_string(const aterm_string &t) noexcept=default
aterm()
Default constructor.
bool operator==(const unprotected_aterm_core &t) const
Comparison operator.
parse_node_unexpected_exception(const parser &p, const parse_node &node)
\brief Assignment of a data expression to a variable
assignment(const variable &lhs, const data_expression &rhs)
\brief Constructor Z14.
const sort_expression & element_sort() const
sort_expression sort() const
Returns the sort of the data expression.
void translate_user_notation()
Translate user notation within the equations of the data specification.
data_equation_vector & user_defined_equations()
data_specification()
Default constructor. Generate a data specification that contains only booleans and positive numbers.
const data_specification operator()() const
Yields a type checked data specification, provided typechecking was successful. If not successful an ...
void operator()(data_equation_vector &eqns)
Yields a type checked equation list, and sets the types in the equations right. If not successful an ...
data_type_checker(const data_specification &data_spec)
make a data type checker. Throws a mcrl2::runtime_error exception if the data_specification is not we...
const data_specification & typechecked_data_specification() const
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
\brief An untyped parameter
const core::identifier_string & name() const
const data_expression_list & arguments() const
variable(const core::identifier_string &name, const sort_expression &sort)
Constructor.
logger(const log_level_t l)
Default constructor.
Linear process specification.
Linear process specification.
stochastic_specification(const specification &other)
Constructor. This constructor is explicit as implicit conversions of this kind is a source of bugs.
\brief An untyped multi action or data application
Standard exception class for reporting runtime errors.
std::map< core::identifier_string, data::sort_expression_list > m_state_variables
bool is_declared(const core::identifier_string &name) const
data::sort_expression_list matching_state_variable_sorts(const core::identifier_string &name, const data::data_expression_list &arguments) const
void add_state_variable(const core::identifier_string &name, const data::variable_list ¶meters, const data::sort_type_checker &sort_typechecker)
Identifier generator that generates names consisting of a prefix followed by a number....
D_ParserTables parser_tables_mcrl2
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
The main namespace for the aterm++ library.
void syntax_error_fn(struct D_Parser *ap)
Custom syntax error function that prints both the line number and the column.
D_ParseNode * ambiguity_fn(struct D_Parser *, int n, struct D_ParseNode **v)
Function for resolving parser ambiguities.
void warn_left_merge_merge(const parse_node &)
Prints a warning for each occurrence of 'x ||_ y || z' in the parse tree.
std::string pp(const core::identifier_string &x)
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
void warn_and_or(const parse_node &)
Prints a warning for each occurrence of 'x && y || z' in the parse tree.
Namespace for system defined sort bag.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Namespace for system defined sort bool_.
const basic_sort & bool_()
Constructor for sort expression Bool.
application not_(const data_expression &arg0)
Application of function symbol !.
Namespace for system defined sort fbag.
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Namespace for system defined sort fset.
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
Namespace for system defined sort int_.
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
bool is_int(const sort_expression &e)
Recogniser for sort expression Int.
Namespace for system defined sort list.
application element_at(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol ..
Namespace for system defined sort nat.
bool is_nat(const sort_expression &e)
Recogniser for sort expression Nat.
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Namespace for system defined sort pos.
bool is_pos(const sort_expression &e)
Recogniser for sort expression Pos.
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Namespace for system defined sort real_.
application negate(const data_expression &arg0)
Application of function symbol -.
bool is_real(const sort_expression &e)
Recogniser for sort expression Real.
application plus(const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Namespace for system defined sort set_.
bool is_union_application(const atermpp::aterm &e)
Recogniser for application of +.
application union_(const sort_expression &s, const data_expression &arg0, const data_expression &arg1)
Application of function symbol +.
Namespace for all data library functionality.
int precedence(const data_expression &x)
bool is_data_expression(const atermpp::aterm &x)
Test for a data_expression expression.
data_specification merge_data_specifications(const data_specification &dataspec1, const data_specification &dataspec2)
Merges two data specifications. Throws an exception if conflicts are detected.
atermpp::term_list< sort_expression > sort_expression_list
\brief list of sort_expressions
std::string pp(const data::data_expression_list &x)
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
bool is_untyped_data_parameter(const atermpp::aterm &x)
atermpp::term_list< variable > variable_list
\brief list of variables
atermpp::term_list< assignment > assignment_list
\brief list of assignments
std::string pp(const data::data_expression &x)
The main namespace for the LPS library.
specification remove_stochastic_operators(const stochastic_specification &spec)
Converts a stochastic specification to a specification. Throws an exception if non-empty distribution...
The main namespace for the Process library.
action_label_list merge_action_specifications(const action_label_list &actspec1, const action_label_list &actspec2)
Merges two action specifications.
atermpp::term_list< action_label > action_label_list
\brief list of action_labels
atermpp::term_list< action > action_list
\brief list of actions
bool is_untyped_multi_action(const atermpp::aterm &x)
std::string read_text(std::istream &in)
Read text from a stream.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
expression builder that visits all sub expressions
core::identifier_string parse_Id(const parse_node &node) const
parse_node child(int i) const
std::string symbol_name(const parse_node &node) const
Wrapper for D_Parser and its corresponding D_ParserTables.
parse_node parse(const std::string &text, unsigned int start_symbol_index=0, bool partial_parses=false)
Parses a string. N.B. The user is responsible for destruction of the returned value by calling destro...
parser(D_ParserTables &tables, D_AmbiguityFn ambiguity_fn=nullptr, D_SyntaxErrorFn syntax_error_fn=nullptr, std::size_t max_error_message_count=1)
unsigned int start_symbol_index(const std::string &name) const
expression traverser that visits all sub expressions
data::data_expression parse_DataValExpr(const core::parse_node &node) const
data::data_expression parse_DataExpr(const core::parse_node &node) const
bool callback_DataSpecElement(const core::parse_node &node, untyped_data_specification &result) const
normalize_sorts_function(const sort_specification &sort_spec)
data::sort_expression parse_SortExpr(const core::parse_node &node, data::sort_expression_list *product=nullptr) const
data_specification construct_data_specification() const
multi_action_actions(const core::parser &parser_)
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const