.. Copyright (c) 2019-22, J. D. Mitchell

   Distributed under the terms of the GPL license version 3.

   The full license is in the file LICENSE, distributed with this software.

   This file was auto-generated by docs/generate_from_yml.py, do not edit.

Presentation
============

.. doxygenclass:: libsemigroups::Presentation
   :project: libsemigroups

.. cpp:namespace:: libsemigroups::Presentation


Member types
------------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`const_iterator`
     - Type of a const iterator to either side of a rule.


   * - :cpp:member:`iterator`
     - Type of an iterator to either side of a rule.


   * - :cpp:member:`letter_type`
     - The type of the letters in the words that constitute the rules of a :cpp:any:`Presentation`  object.


   * - :cpp:member:`size_type`
     - Size type for rules.


   * - :cpp:member:`word_type`
     - The type of the words in the rules of a :cpp:any:`Presentation`  object.



Constructors
------------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`Presentation() <Presentation::Presentation()>`
     - Default constructor.


   * - :cpp:member:`Presentation(Presentation &&) = default`
     - Default move constructor.


   * - :cpp:member:`Presentation(Presentation const &) = default`
     - Default copy constructor.


   * - :cpp:member:`clear()`
     - Remove the alphabet and all rules.


   * - :cpp:member:`operator=(Presentation &&) = default`
     - Default move assignment operator.


   * - :cpp:member:`operator=(Presentation const &) = default`
     - Default copy assignment operator.



Alphabet + letters
------------------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`alphabet() const noexcept`
     - Returns the alphabet of the presentation.


   * - :cpp:member:`alphabet(size_type)`
     - Set the alphabet by size.


   * - :cpp:member:`alphabet(word_type const&)`
     - Set the alphabet const reference.


   * - :cpp:member:`alphabet(word_type&&)`
     - Set the alphabet from rvalue reference.


   * - :cpp:member:`alphabet_from_rules()`
     - Set the alphabet to be the letters in the rules.


   * - :cpp:member:`contains_empty_word() const noexcept`
     - Check if the presentation should contain the empty word.


   * - :cpp:member:`contains_empty_word(bool) noexcept`
     - Specify that the presentation should (not) contain the empty word.


   * - :cpp:member:`in_alphabet(letter_type) const`
     - Check if a letter belongs to the alphabet or not.


   * - :cpp:member:`index(letter_type) const`
     - Get the index of a letter in the alphabet.


   * - :cpp:member:`letter(size_type) const`
     - Get a letter in the alphabet by index.



Rules
-----
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`add_rule(S,S,T,T) <template <typename S, typename T> Presentation & add_rule(S,S,T,T)>`
     - Add a rule to the presentation.


   * - :cpp:member:`add_rule_and_check(S,S,T,T) <template <typename S, typename T> Presentation & add_rule_and_check(S,S,T,T)>`
     - Add a rule to the presentation and check it is valid.


   * - :cpp:member:`rules`
     - Data member holding the rules of the presentation.



Validation
----------
.. list-table::
   :widths: 50 50
   :header-rows: 0

   * - :cpp:member:`validate() const`
     - Check if the alphabet and rules are valid.


   * - :cpp:member:`validate_alphabet() const`
     - Check if the alphabet is valid.


   * - :cpp:member:`validate_letter(letter_type) const`
     - Check if a letter belongs to the alphabet or not.


   * - :cpp:member:`validate_rules() const`
     - Check if every rule consists of letters belonging to the alphabet.


   * - :cpp:member:`validate_word(T, T) const <template <typename T> void validate_word(T, T) const>`
     - Check if every letter in a range belongs to the alphabet.



.. toctree::
   :hidden:

   libsemigroups__presentation__member_types.rst
   libsemigroups__presentation__constructors.rst
   libsemigroups__presentation__alphabet___letters.rst
   libsemigroups__presentation__rules.rst
   libsemigroups__presentation__validation.rst
