Skip to content

Commit 7f8dd5e

Browse files
committed
Finish docs
1 parent 652aece commit 7f8dd5e

4 files changed

Lines changed: 32 additions & 29 deletions

File tree

docs/source/main-algorithms/stephen/stephen-helpers.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,22 @@
77
This file only exists because Breathe always displays all members when
88
documenting a namespace, and this is nicer for now.
99
10-
.. currentmodule:: _libsemigroups_pybind11
11-
1210
Helpers functions for Stephen's procedure
1311
=========================================
1412

1513
This page contains the documentation for various helper functions for
16-
manipulating ``Stephen`` objects.
17-
All such functions are contained in the submodule
18-
``libsemigroups_pybind11.stephen``.
19-
14+
manipulating :any:`StephenPresentationWords` objects.
2015

2116
Contents
2217
--------
2318

2419
.. currentmodule:: libsemigroups_pybind11.stephen
2520

2621
.. autosummary::
27-
:nosignatures:
22+
:signatures: short
2823

2924
accepts
25+
dot
3026
is_left_factor
3127
left_factors
3228
number_of_left_factors
@@ -35,7 +31,10 @@ Contents
3531

3632
Full API
3733
--------
34+
35+
.. currentmodule:: libsemigroups_pybind11
36+
3837
.. automodule:: libsemigroups_pybind11.stephen
3938
:members:
40-
:imported-members:
4139
:exclude-members: Stephen
40+
:imported-members:

docs/source/main-algorithms/stephen/stephen.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,25 @@ The Stephen class
1313
:doc-only:
1414
:class-doc-from: class
1515

16-
17-
.. toctree::
18-
:maxdepth: 1
19-
2016
Contents
2117
--------
2218

2319
.. autosummary::
24-
:nosignatures:
20+
:signatures: short
2521

2622
~StephenPresentationWords
23+
StephenPresentationWords.accept_state
24+
StephenPresentationWords.init
25+
StephenPresentationWords.is_word_set
26+
StephenPresentationWords.presentation
27+
StephenPresentationWords.set_word
28+
StephenPresentationWords.word
29+
StephenPresentationWords.word_graph
30+
StephenPresentationWords.initial_state
2731

2832
Full API
2933
--------
3034

3135
.. autoclass:: StephenPresentationWords
3236
:class-doc-from: init
3337
:members:
34-
:inherited-members:

libsemigroups_pybind11/stephen.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
StephenPresentationWords as _StephenPresentationWords,
2020
StephenInversePresentationWords as _StephenInversePresentationWords,
2121
accepts,
22+
dot,
2223
is_left_factor,
2324
left_factors,
2425
number_of_left_factors,
@@ -28,6 +29,8 @@
2829

2930

3031
# TODO(2): Make this work with string presentations once it works
32+
# TODO(0): Change this to a proper class similar to what's done with Kambites
33+
# (once Kambites is merged)
3134
def Stephen(*args): # pylint: disable=invalid-name
3235
"""Construct a Stephen instance of the type specified by its arguments.
3336

src/stephen.cpp

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ namespace libsemigroups {
5252
py::class_<Stephen_, Runner> stephen(m,
5353
name.c_str(),
5454
R"pbdoc(
55-
Class template for constructing a word graph of left factors of a word in an
56-
f.p. semigroup.
55+
Class template for constructing a word graph of left factors a word in a f.p. semigroup.
5756
5857
This page describes the class :any:`StephenPresentationWords` which implements Stephen's
5958
procedure for constructing the :any:`WordGraph` corresponding to the left
@@ -115,7 +114,7 @@ This function gets the accept state of the word graph. Running this function
115114
triggers the algorithm implemented in this class (if it hasn't been triggered
116115
already), and then returns the accept state of the produced word graph.
117116
118-
:returns: A :any:`node_type`.
117+
:returns: the node.
119118
:rtype: node_type
120119
121120
:raises LibsemigroupsError:
@@ -261,8 +260,7 @@ This function sets the word whose left factors, or equivalent words, are sought.
261260
262261
:raises LibsemigroupsError:
263262
if any of the values pointed at by the iterators
264-
is out of range, i.e. they do not belong to ``presentation().alphabet()``
265-
and ``Presentation::validate_word`` throws.
263+
is out of range, i.e. they do not belong to ``presentation().alphabet()``.
266264
)pbdoc");
267265
stephen.def("word",
268266
&Stephen_::word,
@@ -299,7 +297,7 @@ class is not triggered by calls to this function.
299297
R"pbdoc(
300298
Get the initial state of the word graph.
301299
302-
:returns: A :any:`node_type`.
300+
:returns: the node.
303301
:rtype: node_type
304302
)pbdoc");
305303

@@ -319,12 +317,12 @@ word ``w`` labels a path in
319317
:any:`StephenPresentationWords.word_graph` with source ``0`` and target
320318
:any:`StephenPresentationWords.accept_state`.
321319
322-
For a :any:`StephenPresentationWords` instance constructed from a :any:`Presentation`,
320+
For a :any:`StephenPresentationWords` instance constructed from a :any:`PresentationStrings`,
323321
a word ``w`` is accepted if and
324322
only if ``w`` is equivalent to :any:`StephenPresentationWords.word` in the semigroup defined by
325323
:any:`StephenPresentationWords.presentation`.
326324
327-
For a :any:`StephenPresentationWords` instance constructed from a :any:`InversePresentation`,
325+
For a :any:`StephenPresentationWords` instance constructed from a :any:`InversePresentationStrings`,
328326
a word ``w`` is accepted
329327
if and only if :math:`uu^{-1}w` is equivalent to :math:`u` in the semigroup
330328
defined by :any:`StephenPresentationWords.presentation`, where :math:`u` is the value of
@@ -369,7 +367,7 @@ Return a :any:`Dot` object representing the underlying word graph of the :any:`S
369367
R"pbdoc(
370368
:sig=(s: StephenPresentationWords, w: List[int]) -> bool:
371369
:only-document-once:
372-
Check if a word is a left factor of Stephen::word.
370+
Check if a word is a left factor of :any:`StephenPresentationWords.word`.
373371
374372
This function triggers the algorithm implemented in this class (if it hasn't
375373
been triggered already), and then returns ``True`` if the input
@@ -403,7 +401,7 @@ in :any:`StephenPresentationWords.word_graph` with source ``0``.
403401
R"pbdoc(
404402
:sig=(s: StephenPresentationWords) -> Paths:
405403
:only-document-once:
406-
Returns a :any:`Paths` object containing all the words (in short-lex order) that are left factors of Stephen::word.
404+
Returns a :any:`Paths` object containing all the words (in short-lex order) that are left factors of :any:`StephenPresentationWords.word`.
407405
408406
This function triggers the algorithm implemented in this class (if it hasn't been triggered already).
409407
@@ -435,8 +433,8 @@ Returns the number of left factors with length in a given range.
435433
This function returns the number of left factors of the
436434
:any:`StephenPresentationWords.word` in the instance ``s`` with
437435
length between ``min`` and ``max`` . This is the same as the number
438-
of paths in :any:`StephenPresentationWords.word_graph` (if
439-
:any:`StephenPresentationWords.run` has been called) with source
436+
of paths in :any:`StephenPresentationWords.word_graph` (if the inherited
437+
:any:`Runner.run` method of ``s`` has been called) with source
440438
``0`` and length in the range ``min`` to ``max``.
441439
442440
:param s: the Stephen instance.
@@ -476,11 +474,11 @@ in :any:`StephenPresentationWords.word_graph` with source ``0``, target
476474
:any:`StephenPresentationWords.accept_state`, and length in the
477475
range ``min`` to ``max``.
478476
479-
For a :any:`StephenPresentationWords` instance constructed from a :any:`Presentation`
477+
For a :any:`StephenPresentationWords` instance constructed from a :any:`PresentationStrings`
480478
this is the same as the number of words that are equivalent to
481-
Stephen::word with length between ``min`` and ``max``.
479+
:any:`StephenPresentationWords.word` with length between ``min`` and ``max``.
482480
483-
For a :any:`StephenPresentationWords` instance constructed from a :any:`InversePresentation`,
481+
For a :any:`StephenPresentationWords` instance constructed from a :any:`InversePresentationStrings`,
484482
this is the same as the number of words ``w`` such that
485483
:math:`uu^{-1}w` is equivalent to :math:`u` in the semigroup
486484
defined by :any:`StephenPresentationWords.presentation`, where :math:`u` is the value of

0 commit comments

Comments
 (0)