mCRL2
Loading...
Searching...
No Matches
data_rewriter.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9/// \file mcrl2/data/rewriters/data_rewriter.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_DATA_REWRITERS_DATA_REWRITER_H
13#define MCRL2_DATA_REWRITERS_DATA_REWRITER_H
14
15#include "mcrl2/data/builder.h"
16#include "mcrl2/data/substitutions/no_substitution.h"
17
18namespace mcrl2 {
19
20namespace data {
21
22namespace detail {
23
24template <typename DataRewriter, typename SubstitutionFunction>
25data::data_expression data_rewrite(const data::data_expression& x, const DataRewriter& R, SubstitutionFunction& sigma)
26{
27 mCRL2log(log::trace) << "data_rewrite " << x << sigma << " -> " << R(x, sigma) << std::endl;
28 return R(x, sigma);
29}
30
31template <typename DataRewriter>
33{
34 mCRL2log(log::trace) << "data_rewrite " << x << "[]" << " -> " << R(x) << std::endl;
35 return R(x);
36}
37
38/// \brief Applies a data rewriter to data expressions appearing in a term. It works both with and without a substitution.
39template <template <class> class Builder, class Derived, class DataRewriter, class SubstitutionFunction = data::no_substitution>
40struct add_data_rewriter: public Builder<Derived>
41{
42 typedef Builder<Derived> super;
43 using super::enter;
44 using super::leave;
45 using super::operator();
46
47 const DataRewriter& R;
48 SubstitutionFunction& sigma;
49
50 add_data_rewriter(const DataRewriter& R_, SubstitutionFunction& sigma_)
51 : R(R_), sigma(sigma_)
52 {}
53
55 {
56 return data_rewrite(x, R, sigma);
57 }
58
59 template <class T>
60 void apply(T& result, const data::data_expression& x)
61 {
62 result = data_rewrite(x, R, sigma);
63 }
64
65};
66
67template <typename Derived, typename DataRewriter, typename SubstitutionFunction>
69{
71 using super::enter;
72 using super::leave;
73 using super::operator();
74
75 data_rewriter_builder(const DataRewriter& R, SubstitutionFunction& sigma)
76 : super(R, sigma)
77 {}
78};
79
80template <template <class, class, class> class Builder, class DataRewriter, class SubstitutionFunction>
82{
84 using super::enter;
85 using super::leave;
86 using super::operator();
87
88 apply_rewriter_builder(const DataRewriter& datar, SubstitutionFunction& sigma)
89 : super(datar, sigma)
90 {}
91
92#ifdef BOOST_MSVC
93#include "mcrl2/core/detail/builder_msvc.inc.h"
94#endif
95};
96
97template <template <class, class, class> class Builder, class DataRewriter, class SubstitutionFunction>
100{
101 return apply_rewriter_builder<Builder, DataRewriter, SubstitutionFunction>(datar, sigma);
102}
103
104} // namespace detail
105
106/// \brief A rewriter that applies a data rewriter to data expressions in a term.
107template <typename DataRewriter>
109{
112
113 const DataRewriter& R;
114
115 data_rewriter(const DataRewriter& R_)
116 : R(R_)
117 {}
118
120 {
121 data::no_substitution sigma;
122 return detail::make_apply_rewriter_builder<detail::data_rewriter_builder>(R, sigma)(x);
123 }
124
125 template <typename SubstitutionFunction>
126 data_expression operator()(const data_expression& x, SubstitutionFunction& sigma) const
127 {
128 return detail::make_apply_rewriter_builder<detail::data_rewriter_builder>(R, sigma)(x);
129 }
130};
131
132} // namespace data
133
134} // namespace mcrl2
135
136#endif // MCRL2_DATA_REWRITERS_DATA_REWRITER_H
aterm_string(const std::string &s)
Constructor that allows construction from a string.
A list of aterm objects.
Definition aterm_list.h:24
bool operator==(const unprotected_aterm_core &t) const
Comparison operator.
Definition aterm_core.h:83
bool defined() const
Returns true if this term is not equal to the term assigned by the default constructor of aterms,...
Definition aterm_core.h:143
bool operator!=(const unprotected_aterm_core &t) const
Inequality operator on two unprotected aterms.
Definition aterm_core.h:92
\brief Assignment of a data expression to a variable
Definition assignment.h:91
assignment(const variable &lhs, const data_expression &rhs)
\brief Constructor Z14.
Definition assignment.h:107
data_expression & operator=(const data_expression &) noexcept=default
data_expression(const data_expression &) noexcept=default
Move semantics.
The class BDD2Dot offers the ability to write binary decision diagrams to dot files....
Definition bdd2dot.h:30
std::ofstream f_dot_file
The file the output is written to.
Definition bdd2dot.h:36
std::map< atermpp::aterm, atermpp::aterm_int > f_visited
A table containing all the visited nodes. It maps these nodes to the corresponding node numbers.
Definition bdd2dot.h:39
void aux_output_bdd(const data_expression &a_bdd)
Writes the BDD it receives to BDD2Dot::f_dot_file.
Definition bdd2dot.h:50
BDD_Info f_bdd_info
A class that gives information about the structure of BDDs.
Definition bdd2dot.h:42
int f_node_number
The smallest unused node number.
Definition bdd2dot.h:33
The class BDD_Info provides information about the structure of binary decision diagrams.
Definition bdd_info.h:26
static const mcrl2::data::data_expression & get_true_branch(const mcrl2::data::data_expression &a_bdd)
Method that returns the true-branch of a BDD.
Definition bdd_info.h:50
static bool is_if_then_else(const data_expression &a_bdd)
Method that indicates wether or not the root of a BDD is a guard node.
Definition bdd_info.h:85
static bool is_false(const data_expression &a_bdd)
Method that indicates whether or not a BDD equals false.
Definition bdd_info.h:76
static const mcrl2::data::data_expression & get_guard(const mcrl2::data::data_expression &a_bdd)
Method that returns the guard of a BDD.
Definition bdd_info.h:42
static const mcrl2::data::data_expression & get_false_branch(const mcrl2::data::data_expression &a_bdd)
Method that returns the false-branch of a BDD.
Definition bdd_info.h:58
static bool is_true(const data_expression &a_bdd)
Method that indicates whether or not a BDD equals true.
Definition bdd_info.h:67
Base class for storing properties of mCRL2 types. Properties are (key, value) pairs stored as strings...
data_property_map(const std::string &text)
The strings may appear in a random order, and not all of them need to be present.
std::string print(std::string s) const
unsigned int parse_unsigned_int(std::string const &text) const
const std::map< std::string, std::string > & data() const
Returns the stored properties.
std::set< core::identifier_string > names(const Container &v) const
Collects the names of the elements of the container. The name of element x is retrieved by x....
std::string compare(const std::string &property, unsigned int x, unsigned int y) const
Compares two integers, and returns a message if they are different. If if they are equal the empty st...
std::string print(const core::identifier_string &s) const
void parse_text(const std::string &text)
Initializes the property map with text containing lines in KEY = VALUE format.
std::string print(const data::variable &v) const
std::map< std::string, std::string > m_data
Contains a normalized string representation of the properties.
std::string compare(const data_property_map &other) const
Compares this property map with another property map. The function compare_property must be defined p...
std::string compare_property(const std::string &property, const std::string &, const std::string &) const
Compares two values x and y of a given property. This function should be redefined in derived classes...
std::string operator[](const std::string &key) const
Returns the value corresponding to key. Throws an exception if the key is not found.
unsigned int max_key_length() const
Returns the maximum length of the property names.
std::string print(std::size_t n) const
std::set< std::multiset< std::string > > parse_set_multiset_string(std::string const &text) const
std::set< std::string > parse_set_string(std::string const &text) const
std::string to_string() const
Returns a string representation of the properties.
data_property_map()
Default constructor for derived types.
std::string align(const std::string &s, unsigned int n) const
std::string compare(const std::string &property, const std::set< T > &x, const std::set< T > &y) const
Compares two sets and returns a string with the differences encountered. Elements present in the firs...
static std::string add_separators(std::string const &c, typename std::enable_if< atermpp::is_set< Container >::value >::type *=nullptr)
Add start/end separators for non-set container types.
std::string print(const Container &v, typename atermpp::enable_if_container< Container >::type *=nullptr) const
std::string print(const Container &v, bool print_separators, typename atermpp::enable_if_container< Container >::type *=nullptr) const
Rewriter that operates on data expressions.
Definition rewriter.h:81
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
\brief A data variable
Definition variable.h:28
const core::identifier_string & name() const
Definition variable.h:38
const sort_expression & sort() const
Definition variable.h:43
logger(const log_level_t l)
Default constructor.
Definition logger.h:164
LPS summand containing a multi-action.
Algorithm class that can be used to apply the binary algorithm.
Definition binary.h:45
data::assignment_list replace_enumerated_parameters_in_assignments(data::assignment_list v)
Replace assignments in v that are of a finite sort with a vector of assignments to Boolean variables.
Definition binary.h:298
data::data_expression make_if_tree(data::variable_vector new_parameters, const data::data_expression_vector &enumerated_elements)
Build an if-then-else tree of enumerated elements in terms of new parameters.
Definition binary.h:77
binary_algorithm(Specification &spec, DataRewriter &r, const std::string parameter_selection="")
Constructor for binary algorithm.
Definition binary.h:395
void update_deadlock_summand(deadlock_summand &s)
Update a deadlock summand with the new Boolean parameters.
Definition binary.h:370
detail::lps_algorithm< Specification > super
Definition binary.h:47
std::map< data::variable, std::vector< data::data_expression > > m_enumerated_elements
Mapping of variables to all values they can be assigned.
Definition binary.h:62
stochastic_process_initializer update_initial_process(const data::variable_list &parameters, const stochastic_process_initializer &init)
Definition binary.h:381
Specification::process_type process_type
Definition binary.h:48
data::set_identifier_generator m_if_trees_generator
Contains the names of variables appearing in rhs of m_if_trees.
Definition binary.h:68
const std::string m_parameter_selection
Definition binary.h:56
void replace_enumerated_parameters(const std::set< data::variable > &selected_params)
Take a specification and calculate a vector of boolean variables for each process parameter in select...
Definition binary.h:160
data::data_expression_list replace_enumerated_parameters_in_initial_expressions(const data::variable_list &vl, const data::data_expression_list &el)
Replace expressions in v that are of a finite sort with a vector of assignments to Boolean variables.
Definition binary.h:236
void update_action_summand(action_summand &s)
Update an action summand with the new Boolean parameters.
Definition binary.h:355
std::set< data::variable > select_parameters(const std::string parameter_selection) const
Determine which variables should be replaced, based on parameter_selection.
Definition binary.h:119
void run()
Apply the algorithm to the specification passed in the constructor.
Definition binary.h:405
process_type::action_summand_type action_summand_type
Definition binary.h:49
data::mutable_map_substitution m_if_trees
Mapping of variables to corresponding if-tree.
Definition binary.h:65
process_initializer update_initial_process(const data::variable_list &parameters, const process_initializer &init)
Definition binary.h:376
DataRewriter m_rewriter
Rewriter.
Definition binary.h:54
std::map< data::variable, std::vector< data::variable > > m_new_parameters
Mapping of finite variables to boolean vectors.
Definition binary.h:59
void update_action_summand(stochastic_action_summand &s)
Update an action summand with the new Boolean parameters.
Definition binary.h:363
data::enumerator_list_element_with_substitution enumerator_element
Definition binary.h:46
data::enumerator_identifier_generator m_id_generator
Identifier generator for the enumerator.
Definition binary.h:71
Algorithm class for elimination of constant parameters.
Definition constelm.h:26
LPS summand containing a deadlock.
deadlock_summand(const data::variable_list &summation_variables, const data::data_expression &condition, const lps::deadlock &delta)
Constructor.
Represents a deadlock.
Definition deadlock.h:26
deadlock(data::data_expression time=data::undefined_real())
Constructor.
Definition deadlock.h:36
void save_dot_file(std::size_t a_summand_number)
process_type::action_summand_type action_summand_type
bool check_summand(const data::data_expression &a_invariant, const action_summand_type &a_summand, const std::size_t a_summand_number)
action_summand_vector_type f_summands
bool check_summands(const data::data_expression &a_invariant)
bool check_init(const data::data_expression &a_invariant)
Specification::process_type process_type
std::vector< action_summand_type > action_summand_vector_type
bool check_invariant(const data::data_expression &a_invariant)
precondition: the argument passed as parameter a_invariant is a valid expression in internal mCRL2 fo...
Algorithm class for algorithms on linear process specifications. It can be instantiated with lps::spe...
Stores the following properties of a linear process specification:
std::string compare(const specification_property_map< Specification > &other) const
specification_property_map(const Specification &spec)
Constructor Initializes the specification_property_map with a linear process specification.
std::string compare_property(std::string property, std::string x, std::string y) const
data::detail::data_property_map< specification_property_map > super
std::string print(const process::action &a) const
std::string print(const multi_action &x) const
std::string print(const std::set< std::multiset< process::action_label > > &v) const
std::set< std::multiset< process::action_label > > compute_used_multi_actions(const Specification &spec) const
specification_property_map(const std::string &text)
Constructor. The strings may appear in a random order, and not all of them need to be present.
std::string info() const
Returns a textual overview of some properties of an LPS.
std::size_t compute_tau_summand_count(const Specification &spec) const
std::string print(const process::action_label &l) const
std::set< data::variable > compute_used_free_variables(const Specification &spec) const
std::set< process::action_label > compute_used_action_labels(const Specification &spec) const
invelm_algorithm(Specification &a_lps, const data::rewriter::strategy a_rewrite_strategy=data::jitty, const int a_time_limit=0, const bool a_path_eliminator=false, const data::detail::smt_solver_type a_solver_type=data::detail::solver_type_cvc, const bool a_apply_induction=false, const bool a_simplify_all=false)
detail::lps_algorithm< Specification > super
void simplify_summands(SummandSequence &summands, const data::data_expression &invariant, bool apply_prover)
void run(const data::data_expression &invariant, bool apply_prover)
void simplify_summand(summand_base &s, const data::data_expression &invariant, bool apply_prover)
Adds an invariant to the condition of the summand s, and optionally applies the prover to it.
process_type::action_summand_type action_summand_type
data::detail::BDD_Prover f_bdd_prover
Specification::process_type process_type
\brief A timed multi-action
multi_action & operator=(const multi_action &) noexcept=default
Algorithm class for elimination of unused parameters from a linear process specification.
Definition parelm.h:66
parelm_algorithm(Specification &spec)
Constructor.
Definition parelm.h:250
std::set< data::variable > transition_variables()
Returns the data variables that are considered in the parelm algorithm.
Definition parelm.h:75
void parelm2()
Second version of parelm that builds a dependency graph.
Definition parelm.h:163
void report_results(const std::set< data::variable > &to_be_removed) const
Definition parelm.h:93
void run(bool variant1=true)
Runs the parelm algorithm.
Definition parelm.h:255
void parelm1()
First version of parelm1.
Definition parelm.h:106
lps::detail::lps_algorithm< Specification > super
Definition parelm.h:67
process_initializer(const data::data_expression_list &expressions)
Constructor.
Linear process specification.
LPS summand containing a multi-action.
stochastic_distribution & distribution()
Returns the distribution of this summand.
\brief A stochastic distribution
stochastic_distribution & operator=(const stochastic_distribution &) noexcept=default
stochastic_process_initializer(const data::data_expression_list &expressions, const stochastic_distribution &distribution)
Constructor.
const stochastic_distribution & distribution() const
process_type::action_summand_type action_summand_type
Definition suminst.h:49
DataRewriter m_rewriter
Rewriter.
Definition suminst.h:61
void run(const SummandListType &list, Container &result)
Definition suminst.h:154
std::set< data::sort_expression > m_sorts
Sorts to be instantiated.
Definition suminst.h:55
detail::lps_algorithm< Specification > super
Definition suminst.h:46
data::enumerator_identifier_generator m_id_generator
Definition suminst.h:63
Specification::process_type process_type
Definition suminst.h:48
data::enumerator_algorithm m_enumerator
Definition suminst.h:62
std::vector< action_summand_type > action_summand_vector_type
Definition suminst.h:50
std::size_t instantiate_summand(const SummandType &s, Container &result)
Definition suminst.h:71
std::size_t m_processed
Statistiscs for verbose output.
Definition suminst.h:66
bool must_instantiate(const action_summand_type &summand)
Definition suminst.h:143
bool must_instantiate(const deadlock_summand &)
Definition suminst.h:148
suminst_algorithm(Specification &spec, DataRewriter &r, std::set< data::sort_expression > sorts=std::set< data::sort_expression >(), bool tau_summands_only=false)
Definition suminst.h:181
data::enumerator_list_element_with_substitution enumerator_element
Definition suminst.h:47
bool m_tau_summands_only
Only instantiate tau summands.
Definition suminst.h:58
Base class for LPS summands.
Definition summand.h:25
data::data_expression & condition()
Returns the condition expression.
Definition summand.h:67
data::data_expression m_time_invariant
Data expression expressing the invariant for variables relating to time.
Definition untime.h:66
data::set_identifier_generator m_identifier_generator
Identifier generator, for generating fresh identifiers.
Definition untime.h:69
data::data_expression calculate_time_invariant()
Data expression expressing the invariant for variables relating to time.
Definition untime.h:76
void untime(action_summand_type &s)
Apply untime to an action summand.
Definition untime.h:134
detail::lps_algorithm< Specification > super
Definition untime.h:48
Specification::process_type process_type
Definition untime.h:49
process_type::action_summand_type action_summand_type
Definition untime.h:50
const data::rewriter & m_rewriter
Definition untime.h:55
untime_algorithm(Specification &spec, bool add_invariants, bool apply_fourier_motzkin, const data::rewriter &r)
Definition untime.h:216
data::variable m_last_action_time
Variable denoting the time at which the last action occurred.
Definition untime.h:59
\brief An action label
const core::identifier_string & name() const
Standard exception class for reporting runtime errors.
Definition exception.h:27
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:391
The main namespace for the aterm++ library.
Definition algorithm.h:21
term_list< Term > term_list_difference(const term_list< Term > &v, const term_list< Term > &w)
Returns v minus w.
std::string pp(const atermpp::aterm &t)
Transform an aterm to an ascii string.
Definition aterm.h:440
term_list< Term > term_list_union(const term_list< Term > &v, const term_list< Term > &w)
Returns the union of v and w.
std::string pp(const core::identifier_string &x)
Definition core.cpp:26
std::string pp_format_to_string(const print_format_type pp_format)
Print string representation of pretty print format.
atermpp::aterm_string identifier_string
String type of the LPS library. Identifier strings are represented internally as ATerms.
smt_solver_type
The enumeration type smt_solver_type enumerates all available SMT solvers.
Definition solver_type.h:27
data::data_expression data_rewrite(const data::data_expression &x, const DataRewriter &R, data::no_substitution &)
apply_rewriter_builder< Builder, DataRewriter, SubstitutionFunction > make_apply_rewriter_builder(const DataRewriter &datar, SubstitutionFunction &sigma)
data::data_expression data_rewrite(const data::data_expression &x, const DataRewriter &R, SubstitutionFunction &sigma)
bool compare_property_maps(const std::string &message, const PropertyMap &map1, const std::string &expected_result)
A collection of utilities for lazy expression construction.
data_expression and_(data_expression const &p, data_expression const &q)
Returns an expression equivalent to p or q.
Namespace for system defined sort bool_.
Definition bool.h:32
bool is_false_function_symbol(const atermpp::aterm &e)
Recogniser for function false.
Definition bool.h:119
application and_(const data_expression &arg0, const data_expression &arg1)
Application of function symbol &&.
Definition bool.h:260
application implies(const data_expression &arg0, const data_expression &arg1)
Application of function symbol =>.
Definition bool.h:388
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:77
Namespace for system defined sort real_.
Namespace for all data library functionality.
Definition data.cpp:22
std::vector< assignment > assignment_vector
\brief vector of assignments
Definition assignment.h:149
std::string pp(const data::variable &x)
Definition data.cpp:81
std::vector< variable > variable_vector
\brief vector of variables
Definition variable.h:89
std::vector< data_expression > data_expression_vector
\brief vector of data_expressions
atermpp::term_list< data_expression > data_expression_list
\brief list of data_expressions
application greater(const data_expression &arg0, const data_expression &arg1)
Application of function symbol >
Definition standard.h:332
atermpp::term_list< variable > variable_list
\brief list of variables
sort_expression parse_sort_expression(const std::string &text, const data_specification &data_spec=detail::default_specification())
Parses and type checks a sort expression.
Definition parse.h:399
atermpp::term_list< assignment > assignment_list
\brief list of assignments
Definition assignment.h:146
std::string pp(const data::data_expression &x)
Definition data.cpp:52
std::string pp(const data::sort_expression_vector &x)
Definition data.cpp:26
@ warning
Definition logger.h:34
@ verbose
Definition logger.h:37
std::vector< data::variable > find_matching_parameters(const data::variable_list &params, const data::data_specification &dataspec, const std::vector< std::pair< std::string, std::string > > &selections, OutputIterator o)
Find parameter declarations that match a given string.
stochastic_process_initializer make_process_initializer(const data::data_expression_list &expressions, const stochastic_process_initializer &init)
Definition untime.h:37
void collect_transition_variables(const stochastic_action_summand &s, std::set< data::variable > &result)
Definition parelm.h:41
void collect_transition_variables(const deadlock_summand &s, std::set< data::variable > &result)
Definition parelm.h:49
process_initializer make_process_initializer(const data::data_expression_list &expressions, const process_initializer &)
Definition untime.h:31
void collect_transition_variables(const action_summand &s, std::set< data::variable > &result)
Definition parelm.h:29
void find_equality_conjuncts(const data::data_expression &x, std::map< data::variable, data::data_expression > &result)
INITIALIZER make_process_initializer(const data::data_expression_list &expressions, const INITIALIZER &init)
The main namespace for the LPS library.
Definition constelm.h:21
void lpspp(const std::string &input_filename, const std::string &output_filename, bool print_summand_numbers, core::print_format_type format)
Definition tools.cpp:171
void lpssumelm(const std::string &input_filename, const std::string &output_filename, const bool decluster)
Definition tools.cpp:246
T one_point_condition_rewrite(const T &x, const DataRewriter &R, typename std::enable_if< std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Applies the one point condition rewriter to all embedded data expressions in an object x.
void txt2lps(const std::string &input_filename, const std::string &output_filename)
Definition tools.cpp:310
void lpsuntime(const std::string &input_filename, const std::string &output_filename, const bool add_invariants, const bool apply_fourier_motzkin, const data::rewriter::strategy rewrite_strategy)
Definition tools.cpp:296
std::string description(const lps_rewriter_type type)
Returns a description of a lps rewriter.
std::string pp(const lps::stochastic_specification &x)
Definition lps.cpp:37
void lpssuminst(const std::string &input_filename, const std::string &output_filename, const data::rewriter::strategy rewrite_strategy, const std::string &sorts_string, const bool finite_sorts_only, const bool tau_summands_only)
Definition tools.cpp:259
std::vector< deadlock_summand > deadlock_summand_vector
\brief vector of deadlock_summands
std::size_t nr_of_booleans_for_elements(std::size_t n)
Definition binary.h:27
bool lpsinvelm(const std::string &input_filename, const std::string &output_filename, const std::string &invariant_filename, const std::string &dot_file_name, data::rewriter::strategy rewrite_strategy, data::detail::smt_solver_type solver_type, const bool no_check, const bool no_elimination, const bool simplify_all, const bool all_violations, const bool counter_example, const bool path_eliminator, const bool apply_induction, const int time_limit)
Definition tools.cpp:86
void one_point_condition_rewrite(T &x, const DataRewriter &R, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Applies the one point condition rewriter to all embedded data expressions in an object x.
std::string pp(const lps::deadlock &x)
Definition lps.cpp:27
void lpsparelm(const std::string &input_filename, const std::string &output_filename)
Definition tools.cpp:161
std::string pp(const lps::multi_action &x)
Definition lps.cpp:30
void lpsbinary(const std::string &input_filename, const std::string &output_filename, const std::string &parameter_selection)
Definition tools.cpp:31
void parelm(Specification &spec, bool variant1=true)
Removes unused parameters from a linear process specification.
Definition parelm.h:273
std::istream & operator>>(std::istream &is, lps_rewriter_type &t)
Stream operator for rewriter type.
lps_rewriter_type
An enumerated type for the available lps rewriters.
void lpsconstelm(const std::string &input_filename, const std::string &output_filename, data::rewriter::strategy rewrite_strategy, bool instantiate_free_variables, bool ignore_conditions, bool remove_trivial_summands, bool remove_singleton_sorts)
Definition tools.cpp:43
std::set< data::sort_expression > finite_sorts(const data::data_specification &s)
Return a set with all finite sorts in data specification s.
Definition suminst.h:28
void lpsinfo(const std::string &input_filename, const std::string &input_file_message)
Definition tools.cpp:75
void parse_lps< stochastic_specification >(std::istream &from, stochastic_specification &result)
Parses a stochastic linear process specification from an input stream.
Definition parse.h:183
std::string print_lps_rewriter_type(const lps_rewriter_type type)
Prints a lps rewriter type.
void lpsrewr(const std::string &input_filename, const std::string &output_filename, const data::rewriter::strategy rewrite_strategy, const lps_rewriter_type rewriter_type)
Definition tools.cpp:213
std::string pp_with_summand_numbers(const stochastic_specification &x)
Definition lps.cpp:83
The main namespace for the Process library.
std::string pp(const process::action &x)
Definition process.cpp:35
void iota(Iter first, Iter last, T value)
Generates the sequence value, value + 1, ... and writes it to the sequence [first,...
Definition iota.h:29
std::size_t ceil_log2(std::size_t n)
Definition math.h:28
std::string trim_copy(const std::string &text)
Remove all trailing and leading spaces from the input.
std::string remove_whitespace(const std::string &text)
Removes whitespace from a string.
std::vector< std::size_t > reachable_nodes(const Graph &g, Iter first, Iter last)
Compute reachable nodes in a graph.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
A rewriter that applies a data rewriter to data expressions in a term.
data_rewriter(const DataRewriter &R_)
data_expression operator()(const data_expression &x, SubstitutionFunction &sigma) const
const DataRewriter & R
data_expression operator()(const data_expression &x) const
Applies a data rewriter to data expressions appearing in a term. It works both with and without a sub...
data_expression operator()(const data::data_expression &x)
add_data_rewriter(const DataRewriter &R_, SubstitutionFunction &sigma_)
void apply(T &result, const data::data_expression &x)
apply_rewriter_builder(const DataRewriter &datar, SubstitutionFunction &sigma)
Builder< apply_rewriter_builder< Builder, DataRewriter, SubstitutionFunction >, DataRewriter, SubstitutionFunction > super
data_rewriter_builder(const DataRewriter &R, SubstitutionFunction &sigma)
add_data_rewriter< data::data_expression_builder, Derived, DataRewriter, SubstitutionFunction > super
An empty struct that is used to denote the absence of a substitution. Used for rewriters.
A rewriter that applies a data rewriter to data expressions in a term.
data::data_expression term_type
const DataRewriter & R
data::variable variable_type
data::data_expression operator()(const data::data_expression &x) const
data_rewriter(const DataRewriter &R_)
data::data_expression operator()(const data::data_expression &x, SubstitutionFunction &sigma) const
data_rewriter_builder(const DataRewriter &R, SubstitutionFunction &sigma)
data::detail::add_data_rewriter< lps::data_expression_builder, Derived, DataRewriter, SubstitutionFunction > super
void apply(T &result, const data::data_expression &x)
lps::data_expression_builder< one_point_condition_rewrite_builder< DataRewriter > > super
std::size_t operator()(const atermpp::detail::reference_aterm< T > &t) const