LCOV - code coverage report
Current view: top level - bes/include/mcrl2/bes/detail - io.h (source / functions) Hit Total Coverage
Test: mcrl2_coverage.info.cleaned Lines: 10 10 100.0 %
Date: 2020-02-28 00:44:21 Functions: 2 2 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/detail/io.h
      10             : /// \brief add your file description here.
      11             : 
      12             : #ifndef MCRL2_BES_DETAIL_IO_H
      13             : #define MCRL2_BES_DETAIL_IO_H
      14             : 
      15             : #include "mcrl2/atermpp/algorithm.h"
      16             : #include "mcrl2/bes/boolean_expression.h"
      17             : 
      18             : namespace mcrl2 {
      19             : 
      20             : namespace bes {
      21             : 
      22             : namespace detail {
      23             : 
      24             : // transforms BooleanVariable to BooleanVariableNoIndex
      25          87 : static atermpp::aterm_appl remove_index_impl(const atermpp::aterm_appl& x)
      26             : {
      27          87 :   if (x.function() == core::detail::function_symbol_BooleanVariable())
      28             :   {
      29          15 :     return atermpp::aterm_appl(core::detail::function_symbol_BooleanVariableNoIndex(), x.begin(), --x.end());
      30             :   }
      31          72 :   return x;
      32             : }
      33             : 
      34             : // transforms BooleanVariableNoIndex to BooleanVariable
      35          14 : static atermpp::aterm_appl add_index_impl(const atermpp::aterm_appl& x)
      36             : {
      37          14 :   if (x.function() == core::detail::function_symbol_BooleanVariableNoIndex())
      38             :   {
      39           2 :     const bes::boolean_variable& y = atermpp::down_cast<const bes::boolean_variable>(x);
      40           2 :     std::size_t index = core::index_traits<bes::boolean_variable, bes::boolean_variable_key_type, 1>::insert(y.name());
      41           2 :     return atermpp::aterm_appl(core::detail::function_symbol_BooleanVariable(), x[0], atermpp::aterm_int(index));
      42             :   }
      43          12 :   return x;
      44             : }
      45             : 
      46             : 
      47             : 
      48             : } // namespace detail
      49             : 
      50             : } // namespace bes
      51             : 
      52             : } // namespace mcrl2
      53             : 
      54             : #endif // MCRL2_BES_DETAIL_IO_H

Generated by: LCOV version 1.13