<commit_before>#ifndef _SDD_HOM_ID_HH_
#define _SDD_HOM_ID_HH_

#include <cassert>
#include <iosfwd>

#include "sdd/dd/definition.hh"
#include "sdd/hom/context_fwd.hh"
#include "sdd/hom/definition_fwd.hh"

namespace sdd { namespace hom {

/*-------------------------------------------------------------------------------------------*/

/// @cond INTERNAL_DOC

/// @brief Return its operand.
template <typename C>
struct identity
{
  /// @brief Evaluation.
  ///
  /// This is an error to arrive here as the identity is computed before calling the cache.
  SDD<C>
  operator()(context<C>&, const SDD<C>&)
  const noexcept
  {
    assert(false);
    __builtin_unreachable();
  }

  /// @brief Skip variable predicate.
  constexpr bool
  skip(const typename C::Variable& v)
  const noexcept
  {
    return true;
  }

  /// @brief Selector predicate
  constexpr bool
  selector()
  const noexcept
  {
    return true;
  }
};

/*-------------------------------------------------------------------------------------------*/

/// @brief Equality of two identity homomorphisms.
/// @related identity
template <typename C>
inline
constexpr bool
operator==(const identity<C>&, const identity<C>&)
noexcept
{
  return true;
}

/// @related identity
template <typename C>
std::ostream&
operator<<(std::ostream& os, const identity<C>&)
{
  return os << "Id";
}

/// @endcond

/*-------------------------------------------------------------------------------------------*/

/// @brief Create the Identity homomorphism.
/// @related homomorphism
template <typename C>
homomorphism<C>
Id()
{
  static homomorphism<C> id = homomorphism<C>::create(internal::mem::construct<identity<C>>());
  return id;
}

/*-------------------------------------------------------------------------------------------*/

}} // namespace sdd::hom

namespace std {

/*-------------------------------------------------------------------------------------------*/

/// @cond INTERNAL_DOC

/// @brief Hash specialization for sdd::hom::identity.
template <typename C>
struct hash<sdd::hom::identity<C>>
{
  constexpr
  std::size_t
  operator()(const sdd::hom::identity<C>&)
  const noexcept
  {
    return 607769;
  }
};

/// @endcond

/*-------------------------------------------------------------------------------------------*/

} // namespace std


#endif // _SDD_HOM_ID_HH_
<commit_msg>Whitespaces and unused parameter.<commit_after>#ifndef _SDD_HOM_ID_HH_
#define _SDD_HOM_ID_HH_

#include <cassert>
#include <iosfwd>

#include "sdd/dd/definition.hh"
#include "sdd/hom/context_fwd.hh"
#include "sdd/hom/definition_fwd.hh"

namespace sdd { namespace hom {

/*-------------------------------------------------------------------------------------------*/

/// @cond INTERNAL_DOC

/// @brief Return its operand.
template <typename C>
struct identity
{
  /// @brief Evaluation.
  ///
  /// This is an error to arrive here as the identity is computed before calling the cache.
  SDD<C>
  operator()(context<C>&, const SDD<C>&)
  const noexcept
  {
    assert(false);
    __builtin_unreachable();
  }

  /// @brief Skip variable predicate.
  constexpr bool
  skip(const typename C::Variable&)
  const noexcept
  {
    return true;
  }

  /// @brief Selector predicate
  constexpr bool
  selector()
  const noexcept
  {
    return true;
  }
};

/*-------------------------------------------------------------------------------------------*/

/// @brief Equality of two identity homomorphisms.
/// @related identity
template <typename C>
inline
constexpr bool
operator==(const identity<C>&, const identity<C>&)
noexcept
{
  return true;
}

/// @related identity
template <typename C>
std::ostream&
operator<<(std::ostream& os, const identity<C>&)
{
  return os << "Id";
}

/// @endcond

/*-------------------------------------------------------------------------------------------*/

/// @brief Create the Identity homomorphism.
/// @related homomorphism
template <typename C>
homomorphism<C>
Id()
{
  static homomorphism<C> id = homomorphism<C>::create(internal::mem::construct<identity<C>>());
  return id;
}

/*-------------------------------------------------------------------------------------------*/

}} // namespace sdd::hom

namespace std {

/*-------------------------------------------------------------------------------------------*/

/// @cond INTERNAL_DOC

/// @brief Hash specialization for sdd::hom::identity.
template <typename C>
struct hash<sdd::hom::identity<C>>
{
  constexpr
  std::size_t
  operator()(const sdd::hom::identity<C>&)
  const noexcept
  {
    return 607769;
  }
};

/// @endcond

/*-------------------------------------------------------------------------------------------*/

} // namespace std

#endif // _SDD_HOM_ID_HH_

{'fraction_non_alphanumeric': 0.3491626033495866, 'fraction_numerical': 0.0025439898240407037, 'mean_word_length': 1.4949762030671603, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5141541', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1270, 'n_words': 324}