mCRL2
Loading...
Searching...
No Matches
function_update.h
Go to the documentation of this file.
1// Author(s): Jan Friso Groote
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//
12
13#ifndef MCRL2_DATA_DETAIL_FUNCTION_UPDATE_H
14#define MCRL2_DATA_DETAIL_FUNCTION_UPDATE_H
15
16#include "mcrl2/data/find.h"
17
18namespace mcrl2
19{
20namespace data
21{
22
23// Prototype.
24inline function_symbol function_update(const sort_expression& s, const sort_expression& t);
25inline function_symbol function_update_stable(const sort_expression& s, const sort_expression& t);
26
27
29{
30 function_sort sort=atermpp::down_cast<function_sort>(f.sort());
31 assert(sort.domain().front().size()==1);
32
33 std::set<function_symbol> function_symbol_set = find_function_symbols(f);
34 if (function_symbol_set.count(function_update_stable(sort.domain().front(), sort.codomain()))==0 &&
35 function_symbol_set.count(function_update(sort.domain().front(), sort.codomain()))==0)
36 {
37 std::set<variable> variable_set = find_free_variables(f);
38 if (variable_set.size()==0)
39 {
40 result=sort_bool::true_();
41 return;
42 }
43 }
44 result=sort_bool::false_();
45 return;
46}
47
49{
50 if (b==sort_bool::true_())
51 {
52 result=e1;
53 return;
54 }
55 result=e2;
56 return;
57}
58
59} // namespace data
60} // namespace mcrl2
61
62#endif // MCRL2_DATA_DETAIL_FUNCTION_UPDATE_H
const Term & front() const
Returns the first element of the list.
Definition aterm_list.h:239
sort_expression sort() const
Returns the sort of the data expression.
Definition data.cpp:108
\brief A function sort
const sort_expression & codomain() const
const sort_expression_list & domain() const
Search functions of the data library.
const function_symbol & false_()
Constructor for function symbol false.
Definition bool.h:109
const function_symbol & true_()
Constructor for function symbol true.
Definition bool.h:77
void if_always_else_manual_implementation(data_expression &result, const data_expression &b, const data_expression &e1, const data_expression &e2)
The data expression of an application of the function symbol @if_always_else.
std::set< data::function_symbol > find_function_symbols(const data::data_equation &x)
Definition data.cpp:101
std::set< data::variable > find_free_variables(const data::data_expression &x)
Definition data.cpp:99
void is_not_a_function_update_manual_implementation(data_expression &result, const data_expression &f)
The data expression of an application of the function symbol @is_not_an_update.
function_symbol function_update_stable(const sort_expression &s, const sort_expression &t)
Constructor for function symbol @func_update_stable.
function_symbol function_update(const sort_expression &s, const sort_expression &t)
Constructor for function symbol @func_update.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72