Line data Source code
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/substitutions/sort_expression_assignment.h 10 : /// \brief add your file description here. 11 : 12 : #ifndef MCRL2_DATA_SUBSTITUTIONS_SORT_EXPRESSION_ASSIGNMENT_H 13 : #define MCRL2_DATA_SUBSTITUTIONS_SORT_EXPRESSION_ASSIGNMENT_H 14 : 15 : #include "mcrl2/data/is_simple_substitution.h" 16 : #include "mcrl2/data/undefined.h" 17 : 18 : namespace mcrl2 { 19 : 20 : namespace data { 21 : 22 : /// \brief Substitution that maps a sort expression to a sort expression. 23 : struct sort_expression_assignment 24 : { 25 : typedef sort_expression variable_type; 26 : typedef sort_expression expression_type; 27 : 28 : sort_expression lhs; 29 : sort_expression rhs; 30 : 31 6969 : sort_expression_assignment(const sort_expression& lhs_, const sort_expression& rhs_) 32 6969 : : lhs(lhs_), 33 6969 : rhs(rhs_) 34 6969 : {} 35 : 36 13384 : const sort_expression& operator()(const sort_expression& x) const 37 : { 38 13384 : if (x == lhs) 39 : { 40 71 : return rhs; 41 : } 42 13313 : return x; 43 : } 44 : }; 45 : 46 : 47 : } // namespace data 48 : 49 : } // namespace mcrl2 50 : 51 : #endif // MCRL2_DATA_SUBSTITUTIONS_SORT_EXPRESSION_ASSIGNMENT_H