12#ifndef MCRL2_DATA_DETAIL_SEQUENCE_ALGORITHM_H
13#define MCRL2_DATA_DETAIL_SEQUENCE_ALGORITHM_H
33template <
typename Iterator>
37 std::set<typename std::iterator_traits<Iterator>::value_type> s(first, last);
38 return s.size() <
static_cast <std::size_t
>(std::distance(first, last));
47template <
typename Iterator1,
typename Iterator2>
50 typedef typename std::iterator_traits<Iterator1>::value_type value_type;
51 std::set<value_type> s1(first1, last1);
52 std::set<value_type> s2(first2, last2);
53 std::vector<value_type> intersection;
54 std::set_intersection(s1.begin(), s1.end(), s2.begin(), s2.end(), std::back_inserter(intersection));
55 return !intersection.
empty();
63template <
typename Iterator,
typename T>
66 for (Iterator i = first; i != last; ++i)
68 if (s.find(*i) == s.end())
79template <
class Container>
80std::set<typename Container::value_type>
make_set(
const Container& c)
82 std::set<typename Container::value_type> result;
83 std::copy(c.begin(), c.end(), std::inserter(result, result.begin()));
91template <
typename Sequence>
94 for (
typename Sequence::const_iterator i = s1.begin(); i != s1.end(); ++i)
96 if (std::find(s2.begin(), s2.end(), *i) != s2.end())
bool empty() const
Returns true if the term has no arguments.
bool sequence_empty_intersection(Sequence s1, Sequence s2)
Determines if the unordered sequences s1 and s2 have an empty intersection.
bool sequence_contains_duplicates(Iterator first, Iterator last)
Returns true if the sequence [first, last) contains duplicates.
bool sequence_is_subset_of_set(Iterator first, Iterator last, const std::set< T > &s)
Returns true if all elements of the range [first, last) are element of the set s.
bool sequences_do_overlap(Iterator1 first1, Iterator1 last1, Iterator2 first2, Iterator2 last2)
Returns true if the two sequences [first1, last1) and [first2, last2) have a non empty intersection.
std::set< typename Container::value_type > make_set(const Container &c)
Makes a set of the given container.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...