1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
// Author(s): Wieger Wesselink
// Copyright: see the accompanying file COPYING or copy at
// https://svn.win.tue.nl/trac/MCRL2/browser/trunk/COPYING
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
/// \file specification_test.cpp
/// \brief Add your file description here.
#include <iostream>
#include <string>
#include <set>
#include <iterator>
#include <boost/test/minimal.hpp>
#include "mcrl2/data/detail/print_utility.h"
#include "mcrl2/lps/print.h"
#include "mcrl2/lps/find.h"
#include "mcrl2/lps/linearise.h"
#include "mcrl2/lps/specification.h"
#include "mcrl2/lps/detail/test_input.h"
using namespace mcrl2;
using namespace mcrl2::data;
using namespace mcrl2::lps;
void test_find_sort_expressions()
{
specification spec = linearise(lps::detail::ABP_SPECIFICATION());
std::set<sort_expression> s;
lps::find_sort_expressions(spec, std::inserter(s, s.end()));
std::cout << core::detail::print_set(s) << std::endl;
}
void test_system_defined_sorts()
{
const std::string SPEC(
"act a;\n\n"
"proc X(i,j: Nat) = (i == 5) -> a. X(i,j);\n\n"
"init X(0,1);\n");
specification spec = linearise(SPEC);
function_symbol_vector r = spec.data().constructors(data::sort_nat::nat());
BOOST_CHECK(r.size() != 0);
}
int test_main(int argc, char* argv[])
{
test_find_sort_expressions();
test_system_defined_sorts();
return 0;
}
|