mCRL2
Loading...
Searching...
No Matches
expression_traits.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/expression_traits.h
10/// \brief Contains term traits for data_expression.
11
12#ifndef MCRL2_DATA_EXPRESSION_TRAITS_H
13#define MCRL2_DATA_EXPRESSION_TRAITS_H
14
15#include "mcrl2/core/term_traits.h"
16#include "mcrl2/data/bool.h"
17#include "mcrl2/data/exists.h"
18#include "mcrl2/data/forall.h"
19#include "mcrl2/data/detail/data_sequence_algorithm.h"
20
21
22
23namespace mcrl2::core
24{
25
26/// \brief Contains type information for data expressions.
27template <>
28struct term_traits<data::data_expression>
29{
30 /// \brief The term type
31 using term_type = data::data_expression;
32
33 /// \brief The variable type
34 using variable_type = data::variable;
35
36 /// \brief The variable sequence type
37 using variable_sequence_type = data::variable_list;
38
39 /// \brief The value true
40 /// \return The value true
41 static inline
42 const term_type& true_()
43 {
45 }
46
47 /// \brief The value false
48 /// \return The value false
49 static inline
50 const term_type& false_()
51 {
53 }
54
55 /// \brief Operator not
56 /// \param p A term
57 /// \return Operator not applied to p
58 static inline
59 term_type not_(const term_type& p)
60 {
62 }
63
64 /// \brief Operator not
65 /// \param result Operator not applied to p
66 /// \param p A term
67 static inline
68 void make_not(term_type& result, const term_type& p)
69 {
71 }
72
73 /// \brief Operator and
74 /// \param p A term
75 /// \param q A term
76 /// \return Operator and applied to p and q
77 static inline
78 term_type and_(const term_type& p, const term_type& q)
79 {
81 }
82
83 /// \brief Operator and
84 /// \param result Operator and applied to p and q
85 /// \param p A term
86 /// \param q A term
87 static inline
88 void make_and(term_type& result, const term_type& p, const term_type& q)
89 {
91 }
92
93 /// \brief Operator or
94 /// \param p A term
95 /// \param q A term
96 /// \return Operator or applied to p and q
97 static inline
98 term_type or_(const term_type& p, const term_type& q)
99 {
100 return data::sort_bool::or_(p, q);
101 }
102
103 /// \brief Operator or
104 /// \param result Operator or applied to p and q
105 /// \param p A term
106 /// \param q A term
107 static inline
108 void make_or(term_type& result, const term_type& p, const term_type& q)
109 {
111 }
112
113 /// \brief Operator imp
114 /// \param p A term
115 /// \param q A term
116 /// \return Operator or applied to p and q
117 static inline
118 term_type imp(const term_type& p, const term_type& q)
119 {
121 }
122
123 /// \brief Operator imp
124 /// \param result Operator and applied to p and q
125 /// \param p A term
126 /// \param q A term
127 static inline
128 void make_imp(term_type& result, const term_type& p, const term_type& q)
129 {
131 }
132
133 /// \brief Operator forall
134 /// \param d A sequence of variables
135 /// \param p A term
136 /// \return Operator forall applied to d and p
137 static inline
138 term_type forall(const variable_sequence_type& d, const term_type& p)
139 {
140 return data::forall(d, p);
141 }
142
143 /// \brief Construct a forall.
144 /// \param result Place where the forall is put.
145 /// \param d A sequence of variables
146 /// \param p A term
147 static inline
148 void make_forall(term_type& result, const variable_sequence_type& d, const term_type& p)
149 {
150 data::make_forall(result, d, p);
151 }
152
153 /// \brief Operator exists
154 /// \param d A sequence of variables
155 /// \param p A term
156 /// \return Operator exists applied to d and p
157 static inline
158 term_type exists(const variable_sequence_type& d, const term_type& p)
159 {
160 return data::exists(d, p);
161 }
162
163 /// \brief Construct an exists.
164 /// \param result Place where the forall is put.
165 /// \param d A sequence of variables
166 /// \param p A term
167 static inline
168 void make_exists(term_type& result, const variable_sequence_type& d, const term_type& p)
169 {
170 data::make_exists(result, d, p);
171 }
172
173 /// \brief Test for value true
174 /// \param t A term
175 /// \return True if the term has the value true
176 static inline
177 bool is_true(const term_type& t)
178 {
179 return t == data::sort_bool::true_();
180 }
181
182 /// \brief Test for value false
183 /// \param t A term
184 /// \return True if the term has the value false
185 static inline
186 bool is_false(const term_type& t)
187 {
188 return t == data::sort_bool::false_();
189 }
190
191 /// \brief Test for operator not
192 /// \param t A term
193 /// \return True if the term is of type not
194 static inline
195 bool is_not(const term_type& t)
196 {
198 }
199
200 /// \brief Test for operator and
201 /// \param t A term
202 /// \return True if the term is of type and
203 static inline
204 bool is_and(const term_type& t)
205 {
207 }
208
209 /// \brief Test for operator or
210 /// \param t A term
211 /// \return True if the term is of type or
212 static inline
213 bool is_or(const term_type& t)
214 {
216 }
217
218 /// \brief Test for implication
219 /// \param t A term
220 /// \return True if the term is an implication
221 static inline
222 bool is_imp(const term_type& t)
223 {
225 }
226
227 /// \brief Test for universal quantification
228 /// \param t A term
229 /// \return True if the term is an universal quantification
230 static inline
231 bool is_forall(const term_type& t)
232 {
233 return data::is_forall(t);
234 }
235
236 /// \brief Test for existential quantification
237 /// \param t A term
238 /// \return True if the term is an existential quantification
239 static inline
240 bool is_exists(const term_type& t)
241 {
242 return data::is_exists(t);
243 }
244
245 /// \brief Test for lambda abstraction
246 /// \param t A term
247 /// \return True if the term is a lambda expression
248 static inline
249 bool is_lambda(const term_type& t)
250 {
251 return data::is_lambda(t);
252 }
253
254 /// \brief Conversion from variable to term
255 /// \param v A variable
256 /// \return The converted variable
257 static inline
258 const term_type& variable2term(const variable_type& v)
259 {
260 return v;
261 }
262
263 /// \brief Test if a term is a variable
264 /// \param t A term
265 /// \return True if the term is a variable
266 static inline
267 bool is_variable(const term_type& t)
268 {
269 return data::is_variable(t);
270 }
271
272 /// \brief Get the n-th argument of a data expression, provided it is an application.
273 /// \param t A term which is an application.
274 /// \param n The index of the argument. The first index has number 0.
275 /// \return the n-th argument of t.
276 /// \details This function is linear in n.
277 static inline
278 const term_type& argument(const term_type& t, const std::size_t n)
279 {
280 assert(data::is_application(t));
281 const data::application& a=atermpp::down_cast<data::application>(t);
282 assert(a.size()>n);
283 data::application::const_iterator i=a.begin();
284 for(std::size_t j=0; j<n; ++j, ++i)
285 {
286 assert(i!=a.end());
287 }
288 assert(i!=a.end());
289 return *i;
290 }
291
292 static inline
293 const term_type& left(const term_type& t)
294 {
295 assert(data::is_application(t));
296 const data::application& a=atermpp::down_cast<data::application>(t);
297 assert(a.size() == 2);
298 return *(a.begin());
299 }
300
301 static inline
302 const term_type& right(const term_type& t)
303 {
304 assert(data::is_application(t));
305 const data::application& a=atermpp::down_cast<data::application>(t);
306 assert(a.size() == 2);
307 return *(++(a.begin()));
308 }
309
310 static inline
311 const term_type& not_arg(const term_type& t)
312 {
313 assert(is_not(t));
314 assert(data::is_application(t));
315 const data::application& a=atermpp::down_cast<data::application>(t);
316 assert(a.size() == 1);
317 return *(a.begin());
318 }
319
320 /// \brief Pretty print function
321 /// \param t A term
322 /// \return A pretty print representation of the term
323 static inline
324 std::string pp(const term_type& t)
325 {
326 return data::pp(t);
327 }
328
329 // \brief A function that calculates the intersection of two variable lists.
330 // \param x A list.
331 // \param y Another list.
332 // \return The intersection of the two lists.
333 static inline
334 data::variable_list set_intersection(const data::variable_list& x, const std::set<data::variable>& y)
335 {
336 return data::detail::set_intersection(x, y);
337 }
338
339 // \brief Find the free variables in a term.
340 // \param x The input term.
341 // \return The set of free variables in a term.
342 static inline
343 std::set<data::variable> find_free_variables(const data::data_expression& x)
344 {
345 return data::find_free_variables(x);
346 }
347};
348
349} // namespace mcrl2::core
350
351
352
353#endif // MCRL2_DATA_EXPRESSION_TRAITS_H
aterm()
Default constructor.
Definition aterm.h:51
A unordered_map class in which aterms can be stored.
An abstraction expression.
Definition abstraction.h:23
const variable_list & variables() const
Definition abstraction.h:60
abstraction(const binder_type &binding_operator, const variable_list &variables, const data_expression &body)
Constructor.
Definition abstraction.h:39
const data_expression & body() const
Definition abstraction.h:65
const binder_type & binding_operator() const
Definition abstraction.h:55
Rewriter class for the mCRL2 Library. It only works for terms of type data_expression and data_expres...
Definition rewriter.h:26
const data::enumerator_identifier_generator & identifier_generator() const
Expose the identifier generator present in m_rewriter.
Definition rewriter.h:44
basic_rewriter(const data_specification &d, const used_data_equation_selector &equation_selector, const strategy s=rewrite_strategy::jitty)
Constructor.
Definition rewriter.h:71
basic_rewriter(const std::shared_ptr< detail::Rewriter > &r)
Constructor.
Definition rewriter.h:53
basic_rewriter(const basic_rewriter &other)=default
Copy Constructor.
basic_rewriter & operator=(const basic_rewriter &other)=default
Assignment operator.
std::shared_ptr< detail::Rewriter > m_rewriter
The wrapped Rewriter.
Definition rewriter.h:33
basic_rewriter(const data_specification &d, const strategy s=rewrite_strategy::jitty)
Constructor.
Definition rewriter.h:66
\brief A data equation
const data_expression & lhs() const
const variable_list & variables() const
data_expression & operator=(const data_expression &) noexcept=default
data_expression & operator=(data_expression &&) noexcept=default
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:107
The class BDD_Info provides information about the structure of binary decision diagrams.
Definition bdd_info.h:22
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:43
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:78
static bool is_false(const data_expression &a_bdd)
Method that indicates whether or not a BDD equals false.
Definition bdd_info.h:69
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:35
static const mcrl2::data::data_expression & argument(const mcrl2::data::data_expression &x, std::size_t n)
Definition bdd_info.h:24
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:51
static bool is_true(const data_expression &a_bdd)
Method that indicates whether or not a BDD equals true.
Definition bdd_info.h:60
Base class for eliminating inconsistent paths from BDDs.
data_expression simplify(const data_expression &a_bdd) override
Returns a BDD without inconsistent paths, equivalent to a_bdd. precondition: The argument passed as p...
data_expression aux_simplify(const data_expression &a_bdd, const data_expression_list &a_path)
Simplifies the BDD a_bdd using path a_path. Paths whose guards in conjunction with the guards in.
BDD_Info f_bdd_info
Class that provides information about the structure of BDDs.
SMT_Solver * f_smt_solver
Pointer to an SMT solver used to determine whether or not a path is inconsistent.
bool variables_overlap(const data_expression &a_expression_1, const data_expression &a_expression_2)
Returns true if the expression a_expression_1 has variables in common with expression a_expression_2.
BDD_Path_Eliminator(smt_solver_type a_solver_type)
Constructor that initializes the field BDD_Path_Eliminator::f_smt_solver.
data_expression_list create_condition(data_expression_list a_path, const data_expression &a_guard, bool a_minimal)
Returns a list representing the conjunction of all guards in a_path and the guard a_guard.
bool get_branch(const data_expression &a_bdd, const bool a_polarity, data_expression &result)
Returns branch of the BDD a_bdd, depending on the polarity a_polarity.
Definition bdd_prover.h:423
Induction f_induction
Class that creates all statements needed to prove a given property using induction.
Definition bdd_prover.h:144
strategy rewriter_strategy() const
Returns the strategy of the rewriter used inside this proving rewriter.
Definition bdd_prover.h:618
std::vector< variable > f_variables
The variables in the expression in order.
Definition bdd_prover.h:130
std::shared_ptr< BDD_Simplifier > f_bdd_simplifier
Class that simplifies a BDD.
Definition bdd_prover.h:141
static constexpr bool f_reverse
Flag indicating whether or not the result of the comparison between the first two arguments.
Definition bdd_prover.h:94
void set_substitution(substitution_type &sigma)
Set the substitution to be used to construct the BDD.
Definition bdd_prover.h:523
void set_formula(const data_expression &formula)
Sets Prover::f_formula to formula. precondition: the argument passed as parameter formula is an expre...
Definition bdd_prover.h:625
std::string indent(size_t n)
Definition bdd_prover.h:178
bool smallest(const data_expression &formula, data_expression &result)
Returns the smallest guard in the formula formula.
Definition bdd_prover.h:338
data_expression f_bdd
A binary decision diagram in the internal representation of mCRL2.
Definition bdd_prover.h:467
const Info f_info
A class that provides information about expressions.
Definition bdd_prover.h:105
data_expression bdd_down(const data_expression &formula, const size_t a_indent=0)
Creates the EQ-BDD corresponding to the formula formula.
Definition bdd_prover.h:184
static constexpr bool f_full
Flag indicating whether or not the arguments of equality functions are taken into account.
Definition bdd_prover.h:98
void eliminate_paths()
Removes all inconsistent paths from the BDD BDD_Prover::f_bdd.
Definition bdd_prover.h:248
BDD_Prover(const rewriter &r, double time_limit=0, bool apply_induction=false)
Definition bdd_prover.h:513
data_expression get_counter_example()
Returns all the guards on a path in the BDD that leads to a leaf labelled "false",...
Definition bdd_prover.h:584
substitution_type bdd_sigma
A binary decision diagram in the internal representation of the rewriter.
Definition bdd_prover.h:464
Answer f_tautology
A flag that indicates whether or not the formala Prover::f_formula is a tautology.
Definition bdd_prover.h:114
Answer is_contradiction()
Indicates whether or not the formula Prover::f_formula is a contradiction.
Definition bdd_prover.h:542
data_expression f_formula
An expression of sort Bool.
Definition bdd_prover.h:102
std::chrono::milliseconds f_deadline
A timestamp representing the moment when the maximal amount of milliseconds has been spent on process...
Definition bdd_prover.h:123
bool f_processed
A flag that indicates whether or not the formala Prover::f_formula has been processed.
Definition bdd_prover.h:111
void update_answers()
Updates the values of Prover::f_tautology and Prover::f_contradiction.
Definition bdd_prover.h:266
std::shared_ptr< detail::Rewriter > get_rewriter()
Returns the rewriter used by this prover (i.e. it returns Prover::f_rewriter).
Definition bdd_prover.h:612
const double f_time_limit
An integer representing the maximal amount of seconds to be spent on processing a formula.
Definition bdd_prover.h:120
Manipulator f_manipulator
A class that can be used to manipulate expressions.
Definition bdd_prover.h:108
bool f_apply_induction
A flag indicating whether or not induction on lists is applied.
Definition bdd_prover.h:127
void build_bdd()
Constructs the EQ-BDD corresponding to the formula Prover::f_formula.
Definition bdd_prover.h:147
std::unordered_map< data_expression, data_expression > f_smallest
A hashtable that maps formulas to the smallest guard occuring in those formulas.
Definition bdd_prover.h:138
Answer f_contradiction
A flag that indicates whether or not the formala Prover::f_formula is a contradiction.
Definition bdd_prover.h:117
std::unordered_map< data_expression, data_expression > f_formula_to_bdd
A hashtable that maps formulas to BDDs.
Definition bdd_prover.h:134
data_expression get_bdd()
Returns the BDD BDD_Prover::f_bdd.
Definition bdd_prover.h:549
data_expression get_witness()
Returns all the guards on a path in the BDD that leads to a leaf labelled "true", if such a leaf exis...
Definition bdd_prover.h:556
void set_substitution_internal(substitution_type &sigma)
Set the substitution in internal format to be used to construct the BDD.
Definition bdd_prover.h:529
Answer is_tautology()
Indicates whether or not the formula Prover::f_formula is a tautology.
Definition bdd_prover.h:535
BDD_Prover(const data_specification &data_spec, const used_data_equation_selector &equations_selector, mcrl2::data::rewriter::strategy a_rewrite_strategy=mcrl2::data::rewrite_strategy::jitty, double a_time_limit=0, bool a_path_eliminator=false, smt_solver_type a_solver_type=smt_solver_type::solver_type_cvc, bool a_apply_induction=false)
Definition bdd_prover.h:470
A base class for simplifying binary decision diagrams.
void set_time_limit(time_t a_time_limit)
Sets the attribute BDD_Simplifier::f_deadline.
virtual data_expression simplify(const data_expression &a_bdd)
Returns a simplified BDD, equivalent to the bdd a_bdd. precondition: The argument passed as parameter...
virtual ~BDD_Simplifier()=default
Destructor without any additional functionality.
time_t f_deadline
An integer representing the moment in time when the maximal amount of seconds has been spent on simpl...
The class Induction generates statements corresponding to.
Definition induction.h:25
Base class for classes that provide information about the structure of.
Definition info.h:32
data_expression get_operator(const data_expression &term) const
Returns the main operator of the term term;.
Definition info.h:236
constexpr Info(bool a_full, bool a_reverse)
Constructor that initializes the rewriter.
Definition info.h:181
Compare_Result compare_term_free_variables(const data_expression &term1, const data_expression &term2) const
Definition info.h:136
Compare_Result compare_guard_equality(const data_expression &guard1, const data_expression &guard2) const
Compares two guards by their arguments.
Definition info.h:114
Compare_Result compare_address(const atermpp::aterm &term1, const atermpp::aterm &term2) const
Definition info.h:51
static bool occurs(const data_expression &t1, const data_expression &t2)
Definition info.h:187
Compare_Result lexico(const Compare_Result &a_result1, const Compare_Result &a_result2) const
Definition info.h:44
Compare_Result compare_term_type(const data_expression &term1, const data_expression &term2) const
Compares terms by their type.
Definition info.h:152
std::size_t get_number_of_arguments(const data_expression &a_term) const
Returns the number of arguments of the main operator of a term.
Definition info.h:223
double get_guard_structure(const data_expression &guard, const std::vector< variable > &f_variables) const
Returns an integer corresponding to the structure of the guard passed as argument guard.
Definition info.h:68
Compare_Result compare_term_occurs(const data_expression &term1, const data_expression &term2) const
Compares terms by checking whether one is a part of the other.
Definition info.h:166
const bool f_full
Flag indicating whether or not the arguments of equality functions are taken into account.
Definition info.h:37
Compare_Result compare_guard_structure(const data_expression &guard1, const data_expression &guard2, const std::vector< variable > &f_variables) const
Compares the structure of two guards.
Definition info.h:100
Compare_Result compare_term(const data_expression &term1, const data_expression &term2) const
Compares two terms.
Definition info.h:205
Compare_Result compare_guard(const data_expression &guard1, const data_expression &guard2, const std::vector< variable > &f_variables) const
Compares two guards.
Definition info.h:193
const bool f_reverse
Flag indicating whether or not the result of the comparison between the first two arguments.
Definition info.h:42
Base class for classes that provide functionality to modify or create terms.
Definition manipulator.h:23
data_expression orient(const data_expression &a_term)
Orients the term a_term such that all equations of the form t1 == t2 are.
Manipulator(const Info &a_info)
Constructor initializing the rewriter and the field f_info.
data_expression set_true(const data_expression &a_formula, const data_expression &a_guard) const
Initializes the table Manipulator::f_set_true and calls.
std::unordered_map< data_expression, data_expression > f_orient
A table used by the method Manipulator::orient. The method Manipulator::orient stores resulting terms...
Definition manipulator.h:33
data_expression set_false(const data_expression &a_formula, const data_expression &a_guard) const
Initializes the table Manipulator::f_set_false and calls the method.
const Info & f_info
A class that provides information on the structure of expressions in one of the.
Definition manipulator.h:27
static data_expression make_reduced_if_then_else(const data_expression &a_expr, const data_expression &a_high, const data_expression &a_low)
Returns an expression in the internal format of the rewriter with the jitty strategy.
data_expression set_false_auxiliary(const data_expression &a_formula, const data_expression &a_guard, std::unordered_map< data_expression, data_expression > &f_set_false) const
Replaces all occurences of a_guard in a_formula by false.
Definition manipulator.h:98
data_expression set_true_auxiliary(const data_expression &a_formula, const data_expression &a_guard, std::unordered_map< data_expression, data_expression > &f_set_true) const
Replaces all occurences of a_guard in a_formula by true. Additionally, if the variable.
Definition manipulator.h:38
RewriterProver(const data_specification &data_spec, mcrl2::data::rewriter::strategy strat, const used_data_equation_selector &equations_selector)
Definition with_prover.h:28
RewriterProver(const RewriterProver &other)=delete
data_expression rewrite(const data_expression &t, substitution_type &sigma) override
Rewrite an mCRL2 data term.
Definition with_prover.h:68
rewrite_strategy getStrategy() override
Get rewriter strategy that is used.
Definition with_prover.h:38
void rewrite(data_expression &result, const data_expression &t, substitution_type &sigma) override
Rewrite an mCRL2 data term.
Definition with_prover.h:53
RewriterProver(const RewriterProver &rewr, BDD_Prover prover_obj_)
Definition with_prover.h:88
std::shared_ptr< Rewriter > clone() override
Clone a rewriter.
Definition with_prover.h:96
Rewriter interface class.
Definition rewrite.h:39
void rewrite_where(data_expression &result, const where_clause &term, substitution_type &sigma)
Definition rewrite.cpp:61
virtual void thread_initialise()
Definition rewrite.h:164
Rewriter(const data_specification &data_spec, const used_data_equation_selector &eq_selector)
Constructor. Do not use directly; use createRewriter() function instead.
Definition rewrite.h:60
A strategy is a list of rules and the number of variables that occur in it.
An enumerator algorithm that generates solutions of a condition.
Definition enumerator.h:599
The default element for the todo list of the enumerator.
Definition enumerator.h:229
Rewriter that operates on data expressions.
Definition rewriter.h:84
void operator()(data_expression &result, const data_expression &d) const
Rewrites a data expression.
Definition rewriter.h:169
rewriter(const std::shared_ptr< detail::Rewriter > &r)
Constructor for internal use.
Definition rewriter.h:108
static const data_specification & default_specification()
Default specification used if no specification is specified at construction.
Definition rewriter.h:100
void operator()(data_expression &result, const data_expression &d, substitution_type &sigma) const
Rewrites the data expression d, and on the fly applies a substitution function to data variables.
Definition rewriter.h:225
void thread_initialise()
Initialises this rewriter with thread dependent information.
Definition rewriter.h:153
data_expression operator()(const data_expression &d, substitution_type &sigma) const
Rewrites the data expression d, and on the fly applies a substitution function to data variables.
Definition rewriter.h:211
static substitution_type & empty_substitution()
Definition rewriter.h:87
rewriter clone()
Create a clone of the rewriter in which the underlying rewriter is copied, and not passed as a shared...
Definition rewriter.h:143
rewriter(const data_specification &d=rewriter::default_specification(), const strategy s=rewrite_strategy::jitty)
Constructor.
Definition rewriter.h:126
rewriter(const rewriter &r)=default
Constructor.
void operator()(data_expression &result, const data_expression &d, const SubstitutionFunction &sigma) const
Rewrites the data expression d, and on the fly applies a substitution function. to data variables.
Definition rewriter.h:193
data_expression operator()(const data_expression &d, const SubstitutionFunction &sigma) const
Rewrites the data expression d, and on the fly applies a substitution function. to data variables.
Definition rewriter.h:180
rewriter(const data_specification &d, const EquationSelector &selector, const strategy s=rewrite_strategy::jitty)
Constructor.
Definition rewriter.h:135
data_expression operator()(const data_expression &d) const
Rewrites a data expression.
Definition rewriter.h:161
Component for selecting a subset of equations that are actually used in an encompassing specification...
Definition selection.h:37
\brief A data variable
Definition variable.h:25
variable(const variable &) noexcept=default
Move semantics.
\brief A where expression
const assignment_list & assignments() const
const data_expression & body() 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:435
void CheckRewriteRule(const data_equation &data_eqn)
Check that an mCRL2 data equation is a valid rewrite rule. If not, an runtime_error is thrown indicat...
Definition rewrite.cpp:603
static void checkPattern(const data_expression &p)
Definition rewrite.cpp:588
static void check_vars(application::const_iterator begin, const application::const_iterator &end, const std::set< variable > &vars, std::set< variable > &used_vars)
Definition rewrite.cpp:545
void set_enumerator_iteration_limit(std::size_t size)
bool isValidRewriteRule(const data_equation &data_eqn)
Check whether or not an mCRL2 data equation is a valid rewrite rule.
Definition rewrite.cpp:661
static bool occur_check(const variable &v, const atermpp::aterm &e)
Definition rewrite.cpp:44
static void checkPattern(application::const_iterator begin, const application::const_iterator &end)
Definition rewrite.cpp:579
Answer
A prover that uses EQ-BDDs.
Definition bdd_prover.h:77
static void check_vars(const data_expression &expr, const std::set< variable > &vars, std::set< variable > &used_vars)
Definition rewrite.cpp:556
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:29
void make_not(data_expression &result, const data_expression &arg0)
Make an application of function symbol !.
Definition bool.h:204
bool is_false_function_symbol(const atermpp::aterm &e)
Recogniser for function false.
Definition bool.h:116
void make_and(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol &&.
Definition bool.h:268
bool is_or_application(const atermpp::aterm &e)
Recogniser for application of ||.
Definition bool.h:342
const basic_sort & bool_()
Constructor for sort expression Bool.
Definition bool.h:41
bool is_implies_application(const atermpp::aterm &e)
Recogniser for application of =>.
Definition bool.h:406
application not_(const data_expression &arg0)
Application of function symbol !.
Definition bool.h:194
application and_(const data_expression &arg0, const data_expression &arg1)
Application of function symbol &&.
Definition bool.h:257
application implies(const data_expression &arg0, const data_expression &arg1)
Application of function symbol =>.
Definition bool.h:385
application or_(const data_expression &arg0, const data_expression &arg1)
Application of function symbol ||.
Definition bool.h:321
const function_symbol & false_()
Constructor for function symbol false.
Definition bool.h:106
bool is_and_application(const atermpp::aterm &e)
Recogniser for application of &&.
Definition bool.h:278
void make_or(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol ||.
Definition bool.h:332
bool is_true_function_symbol(const atermpp::aterm &e)
Recogniser for function true.
Definition bool.h:84
bool is_not_application(const atermpp::aterm &e)
Recogniser for application of !.
Definition bool.h:214
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:74
void make_implies(data_expression &result, const data_expression &arg0, const data_expression &arg1)
Make an application of function symbol =>.
Definition bool.h:396
bool is_application(const data_expression &t)
Returns true if the term t is an application.
bool is_where_clause(const atermpp::aterm &x)
Returns true if the term t is a where clause.
bool is_abstraction(const atermpp::aterm &x)
Returns true if the term t is an abstraction.
application if_(const data_expression &arg0, const data_expression &arg1, const data_expression &arg2)
Application of function symbol if.
Definition standard.h:224
bool is_forall(const atermpp::aterm &x)
Returns true if the term t is a universal quantification.
bool is_function_symbol(const atermpp::aterm &x)
Returns true if the term t is a function symbol.
std::set< data::variable > find_free_variables(const data::data_expression &x)
Definition data.cpp:98
bool is_exists(const atermpp::aterm &x)
Returns true if the term t is an existential quantification.
bool is_machine_number(const atermpp::aterm &x)
Returns true if the term t is a machine_number.
bool is_lambda(const atermpp::aterm &x)
Returns true if the term t is a lambda abstraction.
bool is_variable(const atermpp::aterm &x)
Returns true if the term t is a variable.
bool operator()(const atermpp::aterm &t) const
Definition rewrite.cpp:37