mCRL2
Loading...
Searching...
No Matches
test_utility.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
2// Copyright: see the accompanying file COPYING.
3//
4// Distributed under the Boost Software License, Version 1.0.
5// (See accompanying file LICENSE_1_0.txt or copy at
6// http://www.boost.org/LICENSE_1_0.txt)
7//
8/// \file test_utility.h
9/// \brief Utility functions for testing.
10
11#ifndef MCRL2_PBES_DETAIL_TEST_UTILITY_H
12#define MCRL2_PBES_DETAIL_TEST_UTILITY_H
13
14#include "mcrl2/pbes/pbes.h"
15
16
17
18
19
20namespace mcrl2::pbes_system::detail
21{
22
23/// \brief Returns a data variable of type Nat with a given name
24/// \param name A string
25/// \return A data variable of type Nat with a given name
26inline data::variable nat(const std::string& name)
27{
28 return data::variable(core::identifier_string(name), data::sort_nat::nat());
29}
30
31/// \brief Returns a data variable of type Pos with a given name
32/// \param name A string
33/// \return A data variable of type Pos with a given name
34inline data::variable pos(const std::string& name)
35{
36 return data::variable(core::identifier_string(name), data::sort_pos::pos());
37}
38
39/// \brief Returns a data variable of type Bool with a given name
40/// \param name A string
41/// \return A data variable of type Bool with a given name
42inline data::variable bool_(const std::string& name)
43{
44 return data::variable(core::identifier_string(name), data::sort_bool::bool_());
45}
46
47/// \brief Returns a propositional variable declaration with the given name and parameters
48/// \param name A string
49/// \param parameters A sequence of data variables
50/// \return A propositional variable declaration with the given name and parameters
51inline propositional_variable propvar(const std::string& name, const data::variable_list& parameters)
52{
53 return propositional_variable(core::identifier_string(name), parameters);
54}
55
56/// \brief Returns a propositional variable instantiation with the given name and parameters
57/// \param name A string
58/// \param parameters A sequence of data expressions
59/// \return A propositional variable instantiation with the given name and parameters
61 const data::data_expression_list& parameters)
62{
63 return propositional_variable_instantiation(core::identifier_string(name), parameters);
64}
65
66} // namespace mcrl2::pbes_system::detail
67
68
69
70
71
72#endif // MCRL2_PBES_DETAIL_TEST_UTILITY_H
\brief A data variable
Definition variable.h:25
\brief A propositional variable instantiation
\brief A propositional variable declaration
data::variable pos(const std::string &name)
Returns a data variable of type Pos with a given name.
propositional_variable_instantiation propvarinst(const std::string &name, const data::data_expression_list &parameters)
Returns a propositional variable instantiation with the given name and parameters.
data::variable bool_(const std::string &name)
Returns a data variable of type Bool with a given name.
propositional_variable propvar(const std::string &name, const data::variable_list &parameters)
Returns a propositional variable declaration with the given name and parameters.
data::variable nat(const std::string &name)
Returns a data variable of type Nat with a given name.