cp-documentation

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub zawa-tin/cp-documentation

:heavy_check_mark: Src/Algebra/Monoid/MonoidAction.hpp

Depends on

Verified with

Code

#pragma once

#include "./MonoidConcept.hpp"

namespace zawa {

template <concepts::Monoid M>
struct AddSelfAction : public M {
    static M::Element action(M::Element a, M::Element b) {
        return M::operation(a, b);
    }
    static M::Element acted(M::Element a, M::Element b) {
        return M::operation(a, b);
    }
};

} // namespace zawa
#line 2 "Src/Algebra/Monoid/MonoidAction.hpp"

#line 2 "Src/Algebra/Monoid/MonoidConcept.hpp"

#line 2 "Src/Algebra/Semigroup/SemigroupConcept.hpp"

#include <concepts>

namespace zawa {

namespace concepts {

template <class T>
concept Semigroup = requires {
    typename T::Element;
    { T::operation(std::declval<typename T::Element>(), std::declval<typename T::Element>()) } -> std::same_as<typename T::Element>;
};

} // namespace concepts

} // namespace zawa
#line 4 "Src/Algebra/Monoid/MonoidConcept.hpp"

#line 6 "Src/Algebra/Monoid/MonoidConcept.hpp"

namespace zawa {

namespace concepts {

template <class T>
concept Identitiable = requires {
    typename T::Element;
    { T::identity() } -> std::same_as<typename T::Element>;
};

template <class T>
concept Monoid = Semigroup<T> and Identitiable<T>;

} // namespace

} // namespace zawa
#line 4 "Src/Algebra/Monoid/MonoidAction.hpp"

namespace zawa {

template <concepts::Monoid M>
struct AddSelfAction : public M {
    static M::Element action(M::Element a, M::Element b) {
        return M::operation(a, b);
    }
    static M::Element acted(M::Element a, M::Element b) {
        return M::operation(a, b);
    }
};

} // namespace zawa
Back to top page