@@ -37,9 +37,9 @@ namespace libsemigroups {
37
37
void bind_stephen (py::module & m, std::string const & name) {
38
38
using Stephen_ = Stephen<PresentationType>;
39
39
40
- py::class_<Stephen_, Runner> stephen (m,
41
- name.c_str (),
42
- R"pbdoc(
40
+ py::class_<Stephen_, Runner> thing (m,
41
+ name.c_str (),
42
+ R"pbdoc(
43
43
Class template for constructing a word graph of left factors a word in a f.p. semigroup.
44
44
45
45
This page describes the class :any:`Stephen` which implements Stephen's
@@ -66,27 +66,27 @@ originates in :cite:`Stephen1987aa`.
66
66
>>> stephen.accepts(s, [])
67
67
False
68
68
)pbdoc" );
69
- stephen .def (" __repr__" , [](Stephen_ const & stephen) {
69
+ thing .def (" __repr__" , [](Stephen_ const & stephen) {
70
70
return to_human_readable_repr (stephen);
71
71
});
72
- stephen .def (" __copy__" ,
73
- [](Stephen_ const & self) { return Stephen_ (self); });
72
+ thing .def (" __copy__" ,
73
+ [](Stephen_ const & self) { return Stephen_ (self); });
74
74
// Not directly usable so not included
75
- // stephen .def(py::init<>(), R"pbdoc(
75
+ // thing .def(py::init<>(), R"pbdoc(
76
76
// This function default constructs an empty instance of :any:`Stephen`.
77
77
// Use :py:meth:`~Stephen.init` and :py:meth:`~Stephen.set_word` to
78
78
// specify the presentation and the word, respectively. )pbdoc");
79
- stephen .def (py::init<PresentationType const &>(),
80
- py::arg (" p" ),
81
- R"pbdoc(
79
+ thing .def (py::init<PresentationType const &>(),
80
+ py::arg (" p" ),
81
+ R"pbdoc(
82
82
:sig=(self: Stephen, p: Presentation) -> None:
83
83
84
84
This function constructs :any:`Stephen` from a presentation.
85
85
86
86
:param p: the presentation.
87
87
:type p: Presentation
88
88
)pbdoc" );
89
- stephen .def (
89
+ thing .def (
90
90
" copy" ,
91
91
[](Stephen_ const & self) { return Stephen_ (self); },
92
92
R"pbdoc(
@@ -97,9 +97,9 @@ This function costructs a :any:`Stephen` object by copying another :any:`Stephen
97
97
:param s: the :any:`Stephen` object to copy.
98
98
:type s: Stephen
99
99
)pbdoc" );
100
- stephen .def (" accept_state" ,
101
- &Stephen_::accept_state,
102
- R"pbdoc(
100
+ thing .def (" accept_state" ,
101
+ &Stephen_::accept_state,
102
+ R"pbdoc(
103
103
:sig=(self: Stephen) -> int:
104
104
105
105
This function gets the accept state of the word graph. Running this function
@@ -119,7 +119,7 @@ already), and then returns the accept state of the produced word graph.
119
119
this function may never terminate.
120
120
)pbdoc" );
121
121
// The next one is complicated to use/doc so omitted.
122
- // stephen .def(
122
+ // thing .def(
123
123
// "init",
124
124
// [](Stephen_& self) -> Stephen_& { return self.init(); },
125
125
// R"pbdoc(
@@ -133,7 +133,7 @@ already), and then returns the accept state of the produced word graph.
133
133
// :returns: ``self``.
134
134
// :rtype: Stephen
135
135
// )pbdoc");
136
- stephen .def (
136
+ thing .def (
137
137
" init" ,
138
138
[](Stephen_& self, PresentationType const & p) -> Stephen_& {
139
139
return self.init (p);
@@ -152,9 +152,9 @@ had been newly constructed from the presentation *p*.
152
152
:returns: ``self``.
153
153
:rtype: Stephen
154
154
)pbdoc" );
155
- stephen .def (" is_word_set" ,
156
- &Stephen_::is_word_set,
157
- R"pbdoc(
155
+ thing .def (" is_word_set" ,
156
+ &Stephen_::is_word_set,
157
+ R"pbdoc(
158
158
:sig=(self: Stephen) -> bool:
159
159
Check if the initial word is set.
160
160
@@ -164,7 +164,7 @@ the last presentation change and ``False`` otherwise.
164
164
:returns: A bool.
165
165
:rtype: bool
166
166
)pbdoc" );
167
- stephen .def (
167
+ thing .def (
168
168
" __imul__" ,
169
169
[](Stephen_& self, Stephen_& other) -> Stephen_& {
170
170
self *= other;
@@ -196,13 +196,13 @@ scratch.
196
196
:raises LibsemigroupsError:
197
197
if the presentations for *self* and *other* differ.
198
198
)pbdoc" );
199
- stephen .def (
199
+ thing .def (
200
200
" __eq__" ,
201
201
[](Stephen_& self, Stephen_& other) { return self == other; },
202
202
py::arg (" other" ));
203
- stephen .def (" presentation" ,
204
- &Stephen_::presentation,
205
- R"pbdoc(
203
+ thing .def (" presentation" ,
204
+ &Stephen_::presentation,
205
+ R"pbdoc(
206
206
:sig=(self: Stephen) -> Presentation | InversePresentation:
207
207
Get the input presentation.
208
208
@@ -211,7 +211,7 @@ Get the input presentation.
211
211
)pbdoc" );
212
212
// TODO(2): Change to support std::string once we have that implemented
213
213
// in libsemigroups itself
214
- stephen .def (
214
+ thing .def (
215
215
" set_word" ,
216
216
[](Stephen_& self, word_type const & word) -> Stephen_& {
217
217
return stephen::set_word (self, word);
@@ -234,9 +234,9 @@ This function sets the word whose left factors, or equivalent words, are sought.
234
234
if any of the values in *word* are out of range, i.e. they do not belong to
235
235
the alphabet of :any:`Stephen.presentation`.
236
236
)pbdoc" );
237
- stephen .def (" word" ,
238
- &Stephen_::word,
239
- R"pbdoc(
237
+ thing .def (" word" ,
238
+ &Stephen_::word,
239
+ R"pbdoc(
240
240
:sig=(self: Stephen) -> List[int]:
241
241
242
242
Get the initial word.
@@ -251,9 +251,9 @@ Returns the word set by :py:meth:`~Stephen.set_word`.
251
251
with :py:meth:`~Stephen.init` or if no word was set with
252
252
:py:meth:`~Stephen.set_word`.
253
253
)pbdoc" );
254
- stephen .def (" word_graph" ,
255
- &Stephen_::word_graph,
256
- R"pbdoc(
254
+ thing .def (" word_graph" ,
255
+ &Stephen_::word_graph,
256
+ R"pbdoc(
257
257
:sig=(self: Stephen) -> WordGraph:
258
258
259
259
Get the word graph.
@@ -269,9 +269,9 @@ implemented in this class is not triggered by calls to this function.
269
269
with :py:meth:`~Stephen.init` or if no word was set with
270
270
:py:meth:`~Stephen.set_word`.
271
271
)pbdoc" );
272
- stephen .def_static (" initial_state" ,
273
- &Stephen_::initial_state,
274
- R"pbdoc(
272
+ thing .def_static (" initial_state" ,
273
+ &Stephen_::initial_state,
274
+ R"pbdoc(
275
275
:sig=(self: Stephen) -> int:
276
276
277
277
Get the initial state of the word graph.
@@ -281,7 +281,7 @@ Get the initial state of the word graph.
281
281
)pbdoc" );
282
282
283
283
// Helpers
284
- m.def (" accepts " ,
284
+ m.def (" stephen_accepts " ,
285
285
&stephen::accepts<PresentationType>,
286
286
py::arg (" s" ),
287
287
py::arg (" w" ),
@@ -321,7 +321,7 @@ word *w* is accepted if and only if :math:`uu^{-1}w` is equivalent to
321
321
Termination of the Stephen algorithm is undecidable in general, and
322
322
this function may never terminate.
323
323
)pbdoc" );
324
- m.def (" dot " ,
324
+ m.def (" stephen_dot " ,
325
325
&stephen::dot<PresentationType>,
326
326
py::arg (" s" ),
327
327
R"pbdoc(
@@ -337,7 +337,7 @@ Return a :any:`Dot` object representing the underlying word graph of the
337
337
:returns: A :any:`Dot` object.
338
338
:rtype: Dot
339
339
)pbdoc" );
340
- m.def (" is_left_factor " ,
340
+ m.def (" stephen_is_left_factor " ,
341
341
&stephen::is_left_factor<PresentationType>,
342
342
py::arg (" s" ),
343
343
py::arg (" w" ),
@@ -370,7 +370,7 @@ it labels a path in :any:`Stephen.word_graph` with source ``0``.
370
370
Termination of the Stephen algorithm is undecidable in general, and
371
371
this function may never terminate.
372
372
)pbdoc" );
373
- m.def (" left_factors " ,
373
+ m.def (" stephen_left_factors " ,
374
374
&stephen::left_factors<PresentationType>,
375
375
py::arg (" s" ),
376
376
R"pbdoc(
@@ -395,7 +395,7 @@ This function triggers the algorithm implemented in this class (if it hasn't bee
395
395
Termination of the Stephen algorithm is undecidable in general, and
396
396
this function may never terminate.
397
397
)pbdoc" );
398
- m.def (" number_of_left_factors " ,
398
+ m.def (" stephen_number_of_left_factors " ,
399
399
&stephen::number_of_left_factors<PresentationType>,
400
400
py::arg (" s" ),
401
401
py::arg (" min" ) = 0 ,
@@ -434,7 +434,7 @@ in the range *min* to *max*.
434
434
Termination of the Stephen algorithm is undecidable in general, and
435
435
this function may never terminate.
436
436
)pbdoc" );
437
- m.def (" number_of_words_accepted " ,
437
+ m.def (" stephen_number_of_words_accepted " ,
438
438
&stephen::number_of_words_accepted<PresentationType>,
439
439
py::arg (" s" ),
440
440
py::arg (" min" ) = 0 ,
@@ -483,7 +483,7 @@ equivalent to :math:`u` in the semigroup defined by
483
483
Termination of the Stephen algorithm is undecidable in general, and
484
484
this function may never terminate.
485
485
)pbdoc" );
486
- m.def (" words_accepted " ,
486
+ m.def (" stephen_words_accepted " ,
487
487
&stephen::words_accepted<PresentationType>,
488
488
py::arg (" s" ),
489
489
R"pbdoc(
0 commit comments