LCOV - code coverage report
Current view: top level - bes/include/mcrl2/bes - join.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 12 12 100.0 %
Date: 2020-10-20 00:45:57 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          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/bes/join.h
      10             : /// \brief add your file description here.
      11             : 
      12             : #ifndef MCRL2_BES_JOIN_H
      13             : #define MCRL2_BES_JOIN_H
      14             : 
      15             : #include "mcrl2/bes/boolean_expression.h"
      16             : #include "mcrl2/utilities/detail/join.h"
      17             : 
      18             : namespace mcrl2 {
      19             : 
      20             : namespace bes {
      21             : 
      22             : /// \brief Returns or applied to the sequence of boolean expressions [first, last)
      23             : /// \param first Start of a sequence of boolean expressions
      24             : /// \param last End of a sequence of of boolean expressions
      25             : /// \return Or applied to the sequence of boolean expressions [first, last)
      26             : template <typename FwdIt>
      27             : inline
      28          41 : boolean_expression join_or(FwdIt first, FwdIt last)
      29             : {
      30             :   typedef core::term_traits<boolean_expression> tr;
      31          41 :   return utilities::detail::join(first, last, tr::or_, tr::false_());
      32             : }
      33             : 
      34             : /// \brief Returns and applied to the sequence of boolean expressions [first, last)
      35             : /// \param first Start of a sequence of boolean expressions
      36             : /// \param last End of a sequence of of boolean expressions
      37             : /// \return And applied to the sequence of boolean expressions [first, last)
      38             : template <typename FwdIt>
      39             : inline
      40          88 : boolean_expression join_and(FwdIt first, FwdIt last)
      41             : {
      42             :   typedef core::term_traits<boolean_expression> tr;
      43          88 :   return utilities::detail::join(first, last, tr::and_, tr::true_());
      44             : }
      45             : 
      46             : /// \brief Splits a disjunction into a sequence of operands
      47             : /// Given a boolean expression of the form p1 || p2 || .... || pn, this will yield a
      48             : /// set of the form { p1, p2, ..., pn }, assuming that pi does not have a || as main
      49             : /// function symbol.
      50             : /// \param expr A boolean expression
      51             : /// \return A sequence of operands
      52             : inline
      53           1 : std::set<boolean_expression> split_or(const boolean_expression& expr)
      54             : {
      55             :   using namespace accessors;
      56           1 :   std::set<boolean_expression> result;
      57           1 :   utilities::detail::split(expr, std::insert_iterator<std::set<boolean_expression> >(result, result.begin()), is_or, left, right);
      58           1 :   return result;
      59             : }
      60             : 
      61             : /// \brief Splits a conjunction into a sequence of operands
      62             : /// Given a boolean expression of the form p1 && p2 && .... && pn, this will yield a
      63             : /// set of the form { p1, p2, ..., pn }, assuming that pi does not have a && as main
      64             : /// function symbol.
      65             : /// \param expr A boolean expression
      66             : /// \return A sequence of operands
      67             : inline
      68           1 : std::set<boolean_expression> split_and(const boolean_expression& expr)
      69             : {
      70             :   using namespace accessors;
      71           1 :   std::set<boolean_expression> result;
      72           1 :   utilities::detail::split(expr, std::insert_iterator<std::set<boolean_expression> >(result, result.begin()), is_and, left, right);
      73           1 :   return result;
      74             : }
      75             : 
      76             : } // namespace bes
      77             : 
      78             : } // namespace mcrl2
      79             : 
      80             : #endif // MCRL2_BES_JOIN_H

Generated by: LCOV version 1.13