mCRL2
Loading...
Searching...
No Matches
lpsparunfoldlib.h
Go to the documentation of this file.
1// Author(s): Frank Stappers, Thomas Neele
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//
11
12#ifndef MCRL2_LPS_LPSPARUNFOLDLIB_H
13//Fileinfo
14#define MCRL2_LPS_LPSPARUNFOLDLIB_H
15
21
22namespace mcrl2::lps
23{
24
28{
30 mcrl2::data::basic_sort fresh_basic_sort; // new sort introduced to represent s
31 mcrl2::data::function_symbol_vector new_constructors; // constructors for fresh_basic_sort
32 mcrl2::core::identifier_string case_function_name; // name of the case function introduced to deal with sort s
33 // case functions for sort s. Note this may be more due to, e.g., adding distribution rules.
34 // invariant: case_functions.front() is the case function
35 // C: fresh_basic_sort # s # ... # s -> s
36 std::map<mcrl2::data::sort_expression, mcrl2::data::function_symbol> case_functions;
39};
40
41namespace detail
42{
49 {
50 public:
54 {}
55
58 {
60 std::map<data::sort_expression, std::size_t> used_arguments;
61 if (is_function_sort(f.sort()))
62 {
63 for(const data::sort_expression& arg_sort: atermpp::down_cast<data::function_sort>(f.sort()).domain())
64 {
65 // Check if we already used the sort for this function symbol.
66 if(used_arguments.find(arg_sort) == used_arguments.end())
67 {
68 used_arguments[arg_sort] = 0;
69 }
70
71 // Check if we need to generate a new variable.
72 if(m_variables[arg_sort].size() == used_arguments[arg_sort])
73 {
74 m_variables[arg_sort].emplace_back(m_identifier_generator("d"), arg_sort);
75 }
76
77 // Push new variable
78 result.push_back(m_variables[arg_sort].at(used_arguments[arg_sort]));
79 ++used_arguments[arg_sort];
80 }
81 }
82 return result;
83 }
84
85 protected:
87 std::map<data::sort_expression, data::variable_vector> m_variables;
88 };
89
91 {
92 private:
95 std::map< mcrl2::data::sort_expression , unfold_cache_element >& m_cache;
96
98
101
104
107
111
112 public:
113 unfold_data_manager(std::map< mcrl2::data::sort_expression , unfold_cache_element >& cache, data::data_specification& dataspec, bool possibly_inconsistent)
114 : m_cache(cache)
119 , m_possibly_inconsistent(possibly_inconsistent)
120 {}
121
123
125 {
127 }
128
129 void add_used_identifiers(const std::set<core::identifier_string>& ids)
130 {
132 }
133
135 {
137 }
138
140
141 bool is_cached(const data::sort_expression& sort) const
142 {
143 return m_cache.find(sort) != m_cache.end();
144 }
145
147 {
149 }
150
151 const std::vector<data::function_symbol>& get_constructors(const data::sort_expression& sort)
152 {
154 }
155
157 {
158 unfold_cache_element& cache_elem = get_cache_element(target.sort());
159 data::application first_arg(cache_elem.determine_function, target);
160
162 args.push_back(first_arg);
163 for (const data::data_expression& rhs: rhss)
164 {
165 args.push_back(rhs);
166 }
167
168 return data::application(cache_elem.case_functions.at(rhss.front().sort()), args);
169 }
170
172 {
174 }
175
181
189
198
199
205
212
220
226
236
240 const data::sort_expression& sort,
241 const data::function_symbol& function_for_distribution,
242 const data::function_symbol case_function);
243
244
247 const data::sort_expression& sort,
248 const data::function_symbol& case_function);
249
252
255
256 static bool char_filter(char c)
257 {
258 // Put unwanted characters here
259 return c==' ' || c==':' || c==',' || c=='|'
260 || c=='>' || c=='[' || c==']' || c=='@'
261 || c=='.' || c=='{' || c=='}' || c=='#'
262 || c=='%' || c=='&' || c=='*' || c=='!'
263 || c=='(' || c==')'
264 ;
265 }
266
267 std::string filter_illegal_characters(std::string in) const
268 {
269 in.resize(std::remove_if(in.begin(), in.end(), &char_filter) - in.begin());
270 return in;
271 }
272 };
273
277 {
278 private:
281 std::map<data::function_symbol, bool> m_is_pattern_matching;
282 std::map<data::function_symbol, data::data_equation> m_new_eqns;
283
286 {
288 for (const data::data_equation& eqn: m_datamgr.dataspec().equations())
289 {
290 if (data::detail::get_top_fs(eqn.lhs()) == f)
291 {
292 result.push_back(eqn);
293 }
294 }
295 return result;
296 }
297
300 {
301 auto find_result = m_is_pattern_matching.find(f);
302 if (find_result != m_is_pattern_matching.end())
303 {
304 return find_result->second;
305 }
307 bool result = std::all_of(eqns.begin(), eqns.end(),
308 [&](auto& eqn) { return data::is_pattern_matching_rule(m_datamgr, eqn); });
309 m_is_pattern_matching.insert_or_assign(f, result);
310 return result;
311 }
312
314 {
315 data::data_equation new_eqn;
316 auto find_result = m_new_eqns.find(f);
317 if (find_result != m_new_eqns.end())
318 {
319 new_eqn = find_result->second;
320 }
321 else
322 {
324 m_new_eqns.emplace(f, new_eqn);
325 }
326
327 std::map<data::variable, data::data_expression> sigma;
328 auto it1 = atermpp::down_cast<data::application>(new_eqn.lhs()).begin();
329 auto it2 = args.begin();
330 while (it2 != args.end())
331 {
332 sigma[atermpp::down_cast<data::variable>(*it1++)] = *it2++;
333 }
335
336
337 return data::replace_all_variables(new_eqn.rhs(), sigma1);
338 }
339
340 public:
342 : m_datamgr(datamgr)
343 , m_repgen(datamgr.dataspec())
344 {}
345
347 {
348 return m_datamgr.is_constructor(f);
349 }
350
353 bool is_det_or_pi(const data::application& expr) const
354 {
356
358 // If f is not unary, then it is certainly unequal to Det or pi
359 if (f == data::function_symbol() || expr.size() != 1)
360 {
361 return false;
362 }
363 const data::sort_expression& arg_sort = *atermpp::down_cast<data::function_sort>(f.sort()).domain().begin();
364 // The argument of f must be of an unfolded sort
365 if (!m_datamgr.is_cached(arg_sort))
366 {
367 return false;
368 }
369 const unfold_cache_element& cache_elem = m_datamgr.get_cache_element(arg_sort);
370 if (f != cache_elem.determine_function && !contains(cache_elem.projection_functions, f))
371 {
372 return false;
373 }
374
375 return true;
376 }
377
379 {
380 if (!data::is_application(x))
381 {
382 return false;
383 }
384
385 const data::function_symbol f = data::detail::get_top_fs(atermpp::down_cast<data::application>(x));
387 {
388 return false;
389 }
390 auto udm = m_datamgr.dataspec().mappings();
391 const data::data_specification& dataspec = m_datamgr.dataspec();
392 if (std::find_if(udm.begin(), udm.end(),
393 [&](const auto& f2){ return f.name() == f2.name() && dataspec.equal_sorts(f.sort(), f2.sort()); }) == udm.end())
394 {
395 // f is not a mapping, but likely a constructor
396 return false;
397 }
399 {
400 return false;
401 }
402 return true;
403 }
404
405 std::vector<std::size_t> pattern_matching_args(const data::function_symbol& f)
406 {
407 std::vector<std::size_t> result;
409 {
410 return result;
411 }
413
414 std::size_t f_num_args = atermpp::down_cast<data::function_sort>(f.sort()).domain().size();
415 for (std::size_t arg = 0; arg < f_num_args; arg++)
416 {
417 for (const data::data_equation& eq: eqns)
418 {
419 const data::application& lhs_appl = atermpp::down_cast<data::application>(eq.lhs());
420 if (!data::is_variable(lhs_appl[arg]))
421 {
422 result.push_back(arg);
423 break;
424 }
425 }
426 }
427 return result;
428 }
429
433 {
435 {
436 return true;
437 }
438
439 const data::sort_expression_list& domain = atermpp::down_cast<data::function_sort>(f.sort()).domain();
440 const data::sort_expression_vector domain_vec{domain.begin(), domain.end()};
441 for (const std::size_t i: pattern_matching_args(f))
442 {
443 if (!m_datamgr.is_cached(domain_vec[i]))
444 {
445 return false;
446 }
447 }
448 return true;
449 }
450
453 template <class T>
454 void operator()(T& result, const data::application& x)
455 {
456 const data::data_expression_vector args(x.begin(), x.end());
457 result = unfolded_expr(data::detail::get_top_fs(x), args);
458 }
459 };
460
461
462 template <template <class> class Builder>
463 struct replace_pattern_match_builder: public Builder<replace_pattern_match_builder<Builder> >
464 {
465 typedef Builder<replace_pattern_match_builder<Builder> > super;
466 using super::enter;
467 using super::leave;
468 using super::apply;
469 using super::update;
470
473 std::size_t m_current_depth = 0;
474
476 : m_unfolder(unfolder)
477 {}
478
480 {
482 const std::vector<std::size_t> pattern_matching_args = m_unfolder.pattern_matching_args(data::detail::get_top_fs(x));
483 for(const std::size_t i: pattern_matching_args)
484 {
486 {
487 return true;
488 }
489 }
490 return false;
491 }
492
493 template <class T>
494 void apply(T& result, const data::application& x)
495 {
497 {
499 {
500 // Stop recursing after unfolding three times or when meeting a constructor
501 // In the latter case, we have done enough to rewrite Det() and pi()
502 result = x;
503 return;
504 }
505 else if (data::is_if_application(x))
506 {
507 // In if-statements, do not traverse the condition
508 data::data_expression branch1;
509 super::apply(branch1, x[1]);
510 data::data_expression branch2;
511 super::apply(branch2, x[2]);
512
514 data::if_(x.sort()),
515 x[0],
516 branch1,
517 branch2
518 );
519 }
521 {
522 data::data_expression intermediate_result;
523 m_unfolder(intermediate_result, x);
524 // Recursively apply unfolding
526 super::apply(result, intermediate_result);
528 }
529 else
530 {
531 super::apply(result, x);
532 }
533 }
534 else
535 {
536 // Determine whether we see Det(f(..)) or pi(f(..))
537 // If so, unfold and start recursing
539 {
540 data::data_expression intermediate_result1, intermediate_result2;
541 m_unfolder(intermediate_result1, atermpp::down_cast<data::application>(x[0]));
542
545 super::apply(intermediate_result2, intermediate_result1);
547
548 mCRL2log(log::debug) << "Unfolded " << x[0] << " into " << intermediate_result2 << std::endl;
549 data::make_application(result, x.head(), intermediate_result2);
550 m_currently_recursing = false;
551 }
552 else
553 {
554 super::apply(result, x);
555 }
556 }
557 }
558 };
559
560 inline
562 pattern_match_unfolder& unfolder
563 )
564 {
567 return result;
568 }
569} // namespace detail
570
571class lpsparunfold: public detail::lps_algorithm<lps::stochastic_specification>
572{
574
575 public:
576
577 // old parameter, case function, determinizing parameter, replacement expressions
578 typedef std::tuple<data::variable, std::map<data::sort_expression, data::function_symbol>, data::variable, data::data_expression_vector> case_func_replacement;
579
589 std::map< data::sort_expression , unfold_cache_element >& cache,
590 bool alt_case_placement = false,
591 bool possibly_inconsistent = false,
592 bool unfold_pattern_matching = true);
593
599 void algorithm(const std::size_t parameter_at_index);
600
601 private:
605
609
612
615
618
622
623
624 //data::data_expression apply_case_function(const data::data_expression& expr, const case_func_replacement& case_funcs);
626
631 mcrl2::data::variable process_parameter_at(const std::size_t index);
632
636 std::map<mcrl2::data::variable, mcrl2::data::data_expression> parameter_substitution();
637
639
646
651 void update_linear_process(std::size_t parameter_at_index);
652
658 std::size_t parameter_at_index);
659
660 // Applies 'process unfolding' to a sequence of summands.
662};
663
664
665template <template <class> class Builder, template <template <class> class, class, class> class Binder>
667Binder<Builder, parunfold_replacement<Builder, Binder>, parunfold_replacement<Builder, Binder>>
668{
669 typedef Binder<Builder, parunfold_replacement<Builder, Binder>, parunfold_replacement<Builder, Binder>> super;
670 using super::enter;
671 using super::leave;
672 using super::apply;
673 using super::update;
674
678
680 data::set_identifier_generator& id_generator)
681 : super(sigma1)
682 , sigma1(*this, id_generator)
683 {
684 this->case_funcs = case_funcs;
685 }
686
687 template <class T>
688 void apply(T& result, const data::application& x)
689 {
690 if (current_replacement != data::data_expression() || data::is_and(x) || data::is_or(x) || data::is_not(x) || data::is_imp(x) || data::is_if_application(x))
691 {
692 // if no placement of case functions is underway, or we are still traversing the regular boolean operators, we continue as usual
693 super::apply(result, x);
694 }
695 else
696 {
697 // place the case functions here
698 apply_case_function(result, x);
699 }
700 }
701
703 {
704 auto& [par, case_f, det_f, replacements] = case_funcs;
705
706 if (data::find_free_variables(expr).count(par) == 0)
707 {
708 // variable to be replaced does not occur here
709 // make sure to still apply the substitutions necessary for the capture avoiding tricks
710 // NB: stack overflow happens if type of second argument is 'data::data_expression'.
711 super::apply(result, expr);
712 }
713 else
714 {
716 args.push_back(det_f);
717
718 for (const data::data_expression& r : replacements)
719 {
720 current_replacement = r;
722 super::apply(arg, expr);
723 args.push_back(arg);
724 }
725 current_replacement = data::data_expression();
726
727 if (case_f.find(expr.sort()) == case_f.end())
728 {
729 throw mcrl2::runtime_error("Case function with target sort " +
730 data::pp(expr.sort()) + " not declared.");
731 }
732 result = data::application(case_f[expr.sort()], args);
733 }
734 }
735
736 // Substitution application
738 {
739 if (current_replacement == data::data_expression())
740 {
741 return x;
742 }
743 if (std::get<0>(case_funcs) != x)
744 {
745 return x;
746 }
747 return current_replacement;
748 }
749};
750
751template <template <class> class Builder, template <template <class> class, class, class> class Binder>
752parunfold_replacement<Builder, Binder>
753apply_parunfold_replacement_builder(const lpsparunfold::case_func_replacement& case_funcs,
754 data::set_identifier_generator& id_generator)
755{
756 return parunfold_replacement<Builder, Binder>(case_funcs, id_generator);
757}
758
759template <typename T>
762 data::set_identifier_generator& id_generator,
763 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
764)
765{
766 apply_parunfold_replacement_builder<lps::data_expression_builder, lps::detail::add_capture_avoiding_replacement>(cfv, id_generator).update(x);
767}
768
769template <typename T>
772 typename std::enable_if<!std::is_base_of<atermpp::aterm, T>::value>::type* = nullptr
773)
774{
776 id_generator.add_identifiers(lps::find_identifiers(x));
777 auto& [par, case_f, det_f, replacements] = cfv;
778
779 // assumes all case functions have the same name and that par.sort() is in the map of case functions
780 id_generator.add_identifier(case_f.find(par.sort())->second.name());
781 id_generator.add_identifier(det_f.name());
782 for (const data::data_expression& r: replacements)
783 {
785 }
786
787 insert_case_functions(x, cfv, id_generator);
788}
789
790} // namespace mcrl2::lps
791
792
793#endif
Term containing a string.
const_iterator begin() const
Returns an iterator pointing to the first argument.
Definition aterm.h:165
A list of aterm objects.
Definition aterm_list.h:24
const_iterator end() const
Returns a const_iterator pointing to the end of the term_list.
Definition aterm_list.h:282
const_iterator begin() const
Returns a const_iterator pointing to the beginning of the term_list.
Definition aterm_list.h:275
An application of a data expression to a number of arguments.
const_iterator end() const
Returns an iterator pointing past the last argument of the application.
const_iterator begin() const
Returns an iterator pointing to the first argument of the application.
const data_expression & head() const
Get the function at the head of this expression.
std::size_t size() const
\brief A basic sort
Definition basic_sort.h:26
\brief A data equation
const data_expression & lhs() const
const data_expression & rhs() const
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
const_iterator end() const
const_iterator begin() const
const std::set< data_equation > & equations() const
Gets all equations in this specification including those that are system defined.
const function_symbol_vector & constructors() const
Gets all constructors including those that are system defined.
const function_symbol_vector & mappings() const
Gets all mappings in this specification including those that are system defined.
\brief A function symbol
const sort_expression & sort() const
Abstract base class for identifier generators. Identifier generators generate fresh names that do not...
void add_identifiers(const std::set< core::identifier_string > &ids)
Add a set of identifiers to the context.
Components for generating an arbitrary element of a sort.
Identifier generator that stores the identifiers of the context in a set. Using the operator()() and ...
void add_identifier(const core::identifier_string &s) override
Adds the identifier s to the context.
\brief A sort expression
const sort_expression & target_sort() const
Returns the target sort of this expression.
\brief A data variable
Definition variable.h:28
Fresh variable generator for the arguments of a function symbol.
data::set_identifier_generator & m_identifier_generator
std::map< data::sort_expression, data::variable_vector > m_variables
data::variable_vector arguments(const data::function_symbol &f)
Generate argument variables for f.
data_equation_argument_generator(data::set_identifier_generator &identifier_generator)
Algorithm class for algorithms on linear process specifications. It can be instantiated with lps::spe...
Class for unfolding expressions f(a1,...,an) based on the pattern-matching rewrite rules that define ...
std::map< data::function_symbol, bool > m_is_pattern_matching
bool matches_only_known_sorts(const data::function_symbol &f)
Determines whether f pattern matches on argument arg.
bool is_det_or_pi(const data::application &expr) const
Checks whether expr is of the shape Det(h(a1,...,an)) or pi(h(a1,...,an)), where h is defined by patt...
void operator()(T &result, const data::application &x)
Unfolds expr if it is of the shape h(a1,...,an) and h is defined by pattern matching.
pattern_match_unfolder(unfold_data_manager &datamgr)
data::data_expression unfolded_expr(const data::function_symbol &f, const data::data_expression_vector &args)
bool is_pattern_matching(const data::function_symbol &f)
Checks whether f is defined by pattern matching.
bool is_constructor(const data::function_symbol &f)
data::representative_generator m_repgen
std::vector< std::size_t > pattern_matching_args(const data::function_symbol &f)
std::map< data::function_symbol, data::data_equation > m_new_eqns
bool can_unfold(const data::data_expression &x)
const data::data_equation_vector find_equations(const data::function_symbol &f)
Finds all rewriting equations for f.
void add_used_identifier(const core::identifier_string &id)
data::data_specification & m_dataspec
bool m_possibly_inconsistent
Boolean indicating whether rewrite rules may be added that could make the data specification inconsis...
mcrl2::data::set_identifier_generator m_identifier_generator
set of identifiers to use during fresh variable generation
void create_determine_function(const data::sort_expression &sort)
Creates the determine function.
void add_used_identifiers(const std::set< core::identifier_string > &ids)
bool is_constructor(const data::function_symbol &f) const
unfold_cache_element & get_cache_element(const data::sort_expression &sort)
mcrl2::core::identifier_string generate_fresh_function_symbol_name(const std::string &str)
Generates a fresh name for a constructor or mapping.
void generate_case_function_equations(const data::sort_expression &sort, const data::function_symbol &case_function)
Create the data equations for case functions.
const data::data_specification & dataspec() const
data::set_identifier_generator & id_gen()
void generate_determine_function_equations(const data::sort_expression &sort)
Create the data equations for the determine function.
void generate_projection_function_equations(const data::sort_expression &sort)
Create the data equations for the projection functions.
void create_new_constructors(const data::sort_expression &sort)
Creates a set of constructors for the fresh basic sort.
std::map< mcrl2::data::sort_expression, unfold_cache_element > & m_cache
cache for previously unfolded sorts. facilitates reuse of previously introduced sorts and function sy...
std::string filter_illegal_characters(std::string in) const
mcrl2::data::variable generate_fresh_variable(std::string str, const data::sort_expression &sort)
Generates variable of type sort based on a given string str.
mcrl2::data::representative_generator m_representative_generator
a generator for default data expressions of a given sort;
mcrl2::data::basic_sort generate_fresh_basic_sort(const data::sort_expression &sort)
Generates a fresh basic sort given a sort expression.
const data::function_symbol_vector & get_projection_funcs(const data::function_symbol &f)
data::function_symbol create_case_function(const data::sort_expression &det_sort, const data::sort_expression &output_sort)
Creates the case function with number of arguments determined by the number of affected constructors,...
void create_distribution_law_over_case(const data::sort_expression &sort, const data::function_symbol &function_for_distribution, const data::function_symbol case_function)
Create distribution rules for distribution_functions over case_functions.
data::data_expression create_cases(const data::data_expression &target, const data::data_expression_vector &rhss)
unfold_data_manager(std::map< mcrl2::data::sort_expression, unfold_cache_element > &cache, data::data_specification &dataspec, bool possibly_inconsistent)
detail::data_equation_argument_generator m_data_equation_argument_generator
generator for arguments in left hand side of data equations
bool is_cached(const data::sort_expression &sort) const
const std::vector< data::function_symbol > & get_constructors(const data::sort_expression &sort)
void create_projection_functions(const data::sort_expression &sort)
Creates projection functions for the unfolded process parameter.
void determine_affected_constructors(const data::sort_expression &sort)
Determines the constructors that are affected with the unfold process parameter.
std::map< mcrl2::data::variable, mcrl2::data::data_expression > parameter_substitution()
substitute function for replacing process parameters with unfolded process parameters functions.
void update_linear_process(std::size_t parameter_at_index)
substitute unfold process parameter in the linear process
std::tuple< data::variable, std::map< data::sort_expression, data::function_symbol >, data::variable, data::data_expression_vector > case_func_replacement
void update_linear_process_initialization(std::size_t parameter_at_index)
substitute unfold process parameter in the initialization of the linear process
detail::pattern_match_unfolder m_pattern_unfolder
mcrl2::data::variable process_parameter_at(const std::size_t index)
Get the process parameter at given index.
detail::lps_algorithm< lps::stochastic_specification > super
bool m_alt_case_placement
Boolean to indicate if alternative placement of case functions should be used.
void algorithm(const std::size_t parameter_at_index)
Applies lpsparunfold algorithm on a process parameter of an mCRL2 process specification .
case_func_replacement parameter_case_function()
bool m_run_before
set to true when the algorithm has been run once; as the algorithm should run only once....
bool m_unfold_pattern_matching
Indicates whether functions defined by pattern matching that occur in the scope of a Det or pi in a s...
mcrl2::data::data_expression_vector unfold_constructor(const mcrl2::data::data_expression &de)
unfolds a data expression into a vector of process parameters
void unfold_summands(mcrl2::lps::stochastic_action_summand_vector &summands)
detail::unfold_data_manager m_datamgr
Bookkeeper for recogniser and projection functions.
data::data_expression apply_function(const data::function_symbol &f, const data::data_expression &de) const
mcrl2::data::variable m_unfold_parameter
The process parameter that needs to be unfold.
mcrl2::data::variable_vector m_injected_parameters
The process parameters that are inserted.
Standard exception class for reporting runtime errors.
Definition exception.h:27
This file contains some functions that are present in all libraries except the data library....
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
#define mCRL2log(LEVEL)
mCRL2log(LEVEL) provides the stream used to log.
Definition logger.h:391
add your file description here.
Add your file description here.
function_symbol get_top_fs(const data_expression &expr)
Get the top level function symbol f if expr is of the shape f or f(t1,...,tn)
void find_identifiers(const T &x, OutputIterator o)
Definition find.h:359
std::vector< sort_expression > sort_expression_vector
\brief vector of sort_expressions
bool is_if_application(const DataExpression &e)
Recogniser for application of if.
Definition standard.h:232
void replace_all_variables(T &x, const Substitution &sigma, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
Definition replace.h:233
std::vector< data_equation > data_equation_vector
\brief vector of data_equations
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
bool is_function_sort(const atermpp::aterm &x)
Returns true if the term t is a function sort.
bool is_application(const atermpp::aterm &x)
Returns true if the term t is an application.
std::vector< function_symbol > function_symbol_vector
\brief vector of function_symbols
function_symbol if_(const sort_expression &s)
Constructor for function symbol if.
Definition standard.h:200
data_equation unfold_pattern_matching(const function_symbol &mapping, const data_equation_vector &rewrite_rules, StructInfo &ssf, representative_generator &gen, set_identifier_generator &id_gen)
This converts a collection of rewrite rules for a give function symbol into a one-rule specification ...
bool is_variable(const atermpp::aterm &x)
Returns true if the term t is a variable.
void make_application(atermpp::aterm &result)
Make function for an application.
The main namespace for the LPS library.
std::vector< stochastic_action_summand > stochastic_action_summand_vector
\brief vector of stochastic_action_summands
void insert_case_functions(T &x, const lpsparunfold::case_func_replacement &cfv, data::set_identifier_generator &id_generator, typename std::enable_if<!std::is_base_of< atermpp::aterm, T >::value >::type *=nullptr)
void find_identifiers(const T &x, OutputIterator o)
Definition find.h:96
parunfold_replacement< Builder, Binder > apply_parunfold_replacement_builder(const lpsparunfold::case_func_replacement &case_funcs, data::set_identifier_generator &id_generator)
bool contains(const atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable > &c, const typename atermpp::indexed_set< Key, ThreadSafe, Hash, Equals, Allocator, KeyTable >::key_type &v, const std::size_t thread_index=0)
Definition indexed_set.h:86
Component for generating representatives of sorts.
Generic substitution function. The substitution is stored as a mapping of variables to expressions.
Builder< replace_pattern_match_builder< Builder > > super
void apply(T &result, const data::application &x)
bool is_applied_to_constructor(const data::application &x)
replace_pattern_match_builder(pattern_match_unfolder &unfolder)
data::data_expression current_replacement
data::detail::capture_avoiding_substitution_updater< parunfold_replacement< Builder, Binder > > sigma1
data::data_expression operator()(const data::variable &x)
parunfold_replacement(const lpsparunfold::case_func_replacement &case_funcs, data::set_identifier_generator &id_generator)
Binder< Builder, parunfold_replacement< Builder, Binder >, parunfold_replacement< Builder, Binder > > super
void apply(T &result, const data::application &x)
void apply_case_function(data::data_expression &result, const data::application &expr)
lpsparunfold::case_func_replacement case_funcs
Element in the cache that keeps track of the information for a single unfolded sort,...
std::map< mcrl2::data::sort_expression, mcrl2::data::function_symbol > case_functions
mcrl2::data::basic_sort fresh_basic_sort
mcrl2::data::function_symbol_vector affected_constructors
mcrl2::data::function_symbol determine_function
mcrl2::data::function_symbol_vector projection_functions
mcrl2::data::function_symbol_vector new_constructors
mcrl2::core::identifier_string case_function_name