Skip to content

Commit 9c2b1e9

Browse files
rebuilding site Thu 23 Mar 2023 14:32:43 GMT
1 parent f28664e commit 9c2b1e9

80 files changed

Lines changed: 2452 additions & 179 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_sources/changelog.rst.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
Changelog
88
=========
99

10+
v0.10.0 (released 23/03/2023)
11+
-----------------------------
12+
13+
This is a minor release adding some new functionality from ``libsemigroups``:
14+
15+
* ukkonen: add support for ``Ukkonen`` + helpers by @james-d-mitchell in
16+
https://github.com/libsemigroups/libsemigroups_pybind11/pull/132
17+
* present: add further manip. funcs by @james-d-mitchell in
18+
https://github.com/libsemigroups/libsemigroups_pybind11/pull/136
19+
1020
v0.9.2 (released 22/03/2023)
1121
----------------------------
1222

_sources/index.rst.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
libsemigroups_pybind11 - Version 0.9.2
2-
======================================
1+
libsemigroups_pybind11 - Version 0.10.0
2+
=======================================
33

44
python bindings for the C++ library libsemigroups
55
-------------------------------------------------

_sources/install.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The full license is in the file LICENSE, distributed with this software.
66
7-
.. |libsemigroups-pybind11-version| replace:: 0.9.2
7+
.. |libsemigroups-pybind11-version| replace:: 0.10.0
88

99
Installation
1010
============

_sources/misc.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ In this section we describe some miscellaneous functionality in
1414
:maxdepth: 1
1515

1616
report
17+
ukkonen/index

_sources/presentations/present-helpers.rst.txt

Lines changed: 80 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ Contents
5454
- Greedily reduce the length of the presentation using
5555
:py:func:`longest_common_subword`.
5656

57+
* - :py:func:`is_strongly_compressible`
58+
- Returns ``True`` if a :math:`1`-relation presentation can be strongly
59+
compressed.
60+
5761
* - :py:func:`length`
5862
- Return the sum of the lengths of the rules.
5963

@@ -85,6 +89,10 @@ Contents
8589
\rvert < \lvert v \rvert`, then replace :math:`u = v` with :math:`u =
8690
w`.
8791

92+
* - :py:func:`reduce_to_2_generators`
93+
- Reduce the number of generators in a :math:`1`-relation presentation to
94+
``2``.
95+
8896
* - :py:func:`redundant_rule`
8997
- Returns the index of the left hand side of a redundant rule.
9098

@@ -120,6 +128,9 @@ Contents
120128
- Sort the rules :math:`u_1 = v_1, \ldots, u_n = v_n` so that :math:`u_1
121129
v_1 < \cdots < u_n v_n`, where :math:`<` is the shortlex order.
122130

131+
* - :py:func:`strongly_compress`
132+
- Strongly compress a :math:`1`-relation presentation.
133+
123134
Full API
124135
--------
125136

@@ -367,6 +378,28 @@ Full API
367378
if :py:func:`longest_common_subword` or :py:func:`replace_word` does.
368379
369380
381+
.. py:function:: is_strongly_compressible(p: Presentation) -> bool
382+
383+
Returns ``True`` if the :math:`1`-relation presentation can be strongly
384+
compressed.
385+
386+
A :math:`1`-relation presentation is *strongly compressible* if both
387+
relation words start with the same letter and end with the same letter.
388+
In other words, if the alphabet of the presentation ``p`` is :math:`A` and
389+
the relation words are of the form :math:`aub = avb` where :math:`a, b\in A`
390+
(possibly :math:`a = b`) and :math:`u, v\in A^*`, then ``p`` is strongly
391+
compressible. See `Section 3.2`_ for details.
392+
393+
.. _Section 3.2: https://doi.org/10.1007/s00233-021-10216-8
394+
395+
:param p: the presentation
396+
:type p: Presentation
397+
398+
:returns: A value of type ``bool``.
399+
400+
.. seealso:: :py:func:`strongly_compress`
401+
402+
370403
.. py:function:: length(p: Presentation) -> int
371404
372405
Return the sum of the lengths of the rules.
@@ -534,6 +567,35 @@ Full API
534567
['a', 'aaa', 'a', 'aaaaa']
535568
536569
570+
.. py:function:: reduce_to_2_generators(p: Presentation) -> None
571+
572+
Reduce the number of generators in a :math:`1`-relation presentation to
573+
``2``.
574+
575+
Returns ``True`` if the :math:`1`-relation presentation ``p`` has been
576+
modified and ``False`` if not.
577+
578+
A :math:`1`-relation presentation is *left cycle-free* if the relation
579+
words start with distinct letters. In other words, if the alphabet of the
580+
presentation ``p`` is :math:`A` and the relation words are of the form
581+
:math:`au = bv` where :math:`a, b\in A` with :math:`a \neq b` and
582+
:math:`u, v \in A^*`, then ``p`` is left cycle-free. The word problem for
583+
a left cycle-free :math:`1`-relation monoid is solvable if the word
584+
problem for the modified version obtained from this function is solvable.
585+
586+
:param p: the presentation
587+
:type p: Presentation
588+
:param x:
589+
determines the choice of letter to use, ``0`` uses
590+
``p.rules[0].front()`` and ``1`` uses ``p.rules[1].front()`` (defaults to:
591+
``0``).
592+
:type x: int
593+
594+
:returns: A value of type ``bool``.
595+
596+
:raises RuntimeError: if ``index`` is not ``0`` or ``1``.
597+
598+
537599
.. py:function:: redundant_rule(p: Presentation, t: datetime.timedelta) -> int
538600
539601
Return the index of the the left hand side of a redundant rule.
@@ -573,9 +635,9 @@ Full API
573635
>>> presentation.add_rule(p, "ab", "ba")
574636
>>> presentation.add_rule(p, "bab", "abb")
575637
>>> t = timedelta(seconds = 1)
576-
>>> p.rules
638+
>>> p.rules
577639
['ab', 'ba', 'bab', 'abb']
578-
>>> presentation.redundant_rule(p, t)
640+
>>> presentation.redundant_rule(p, t)
579641
2
580642
581643
@@ -770,3 +832,19 @@ Full API
770832
:type p: Presentation
771833
772834
:returns: None
835+
836+
837+
.. py:function:: strongly_compress(p: Presentation) -> None
838+
839+
Strongly compress a :math:`1`-relation presentation.
840+
841+
Returns ``True`` if the :math:`1`-relation presentation ``p`` has been
842+
modified and ``False`` if not. The word problem is solvable for the input
843+
presentation if it is solvable for the modified version.
844+
845+
:param p: the presentation
846+
:type p: Presentation
847+
848+
:returns: A value of type ``bool``.
849+
850+
.. seealso:: :py:func:`is_strongly_compressible`

_sources/ukkonen/index.rst.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. Copyright (c) 2023, J. D. Mitchell
2+
3+
Distributed under the terms of the GPL license version 3.
4+
5+
The full license is in the file LICENSE, distributed with this software.
6+
7+
Ukkonen
8+
=======
9+
10+
This page describes the functionality related to Ukkonen's algorithm and
11+
generalised suffix trees in ``libsemigroups_pybind11``.
12+
13+
14+
.. toctree::
15+
:maxdepth: 1
16+
17+
ukkonen
18+
ukkonen-helpers
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
.. Copyright (c) 2023, J. D. Mitchell
2+
3+
Distributed under the terms of the GPL license version 3.
4+
5+
The full license is in the file LICENSE, distributed with this software.
6+
7+
.. currentmodule:: _libsemigroups_pybind11
8+
9+
Ukkonen helper functions
10+
========================
11+
12+
This page contains the documentation for various helper functions for
13+
manipulating ``Ukkonen`` objects. All such functions are contained in the
14+
submodule ``libsemigroups_pybind11.ukkonen``.
15+
16+
Contents
17+
--------
18+
19+
.. list-table::
20+
:widths: 50 50
21+
:header-rows: 0
22+
23+
* - :py:func:`add_words_no_checks`
24+
- Add all words in a ``list`` to a :py:class:`Ukkonen` object.
25+
* - :py:func:`add_words`
26+
- Add all words in a ``list`` to a :py:class:`Ukkonen` object.
27+
* - :py:func:`dot`
28+
- Returns a string containing a `GraphViz <https://graphviz.org>`_
29+
representation of a suffix tree.
30+
* - :py:func:`is_piece_no_checks`
31+
- Check if a word is a piece.
32+
* - :py:func:`is_piece`
33+
- Check if a word is a piece.
34+
* - :py:func:`is_subword_no_checks`
35+
- Check if a word is a subword of any word in a suffix tree.
36+
* - :py:func:`is_subword`
37+
- Check if a word is a subword of any word in a suffix tree.
38+
* - :py:func:`is_suffix_no_checks`
39+
- Check if a word is a suffix of any word in a suffix tree.
40+
* - :py:func:`is_suffix`
41+
- Check if a word is a suffix of any word in a suffix tree.
42+
* - :py:func:`maximal_piece_prefix_no_checks`
43+
- Find the maximal piece prefix of a word.
44+
* - :py:func:`maximal_piece_prefix`
45+
- Find the maximal piece prefix of a word.
46+
* - :py:func:`maximal_piece_suffix_no_checks`
47+
- Find the maximal piece suffix of a word.
48+
* - :py:func:`maximal_piece_suffix`
49+
- Find the maximal piece suffix of a word.
50+
* - :py:func:`number_of_distinct_subwords`
51+
- Returns the number of distinct subwords of the words in a suffix tree.
52+
* - :py:func:`number_of_pieces_no_checks`
53+
- Find the number of pieces in a decomposition of a word (if any).
54+
* - :py:func:`number_of_pieces`
55+
- Find the number of pieces in a decomposition of a word (if any).
56+
* - :py:func:`pieces_no_checks`
57+
- Find the pieces in a decomposition of a word (if any).
58+
* - :py:func:`pieces`
59+
- Find the pieces in a decomposition of a word (if any).
60+
61+
Full API
62+
--------
63+
64+
.. autofunction:: add_words_no_checks
65+
.. autofunction:: add_words
66+
.. autofunction:: libsemigroups_pybind11.ukkonen.dot
67+
.. autofunction:: is_piece_no_checks
68+
.. autofunction:: is_piece
69+
.. autofunction:: is_subword_no_checks
70+
.. autofunction:: is_subword
71+
.. autofunction:: is_suffix_no_checks
72+
.. autofunction:: is_suffix
73+
.. autofunction:: maximal_piece_prefix_no_checks
74+
.. autofunction:: maximal_piece_prefix
75+
.. autofunction:: maximal_piece_suffix_no_checks
76+
.. autofunction:: maximal_piece_suffix
77+
.. autofunction:: number_of_distinct_subwords
78+
.. autofunction:: number_of_pieces_no_checks
79+
.. autofunction:: number_of_pieces
80+
.. autofunction:: pieces_no_checks
81+
.. autofunction:: pieces

_sources/ukkonen/ukkonen.rst.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. Copyright (c) 2023, J. D. Mitchell
2+
3+
Distributed under the terms of the GPL license version 3.
4+
5+
The full license is in the file LICENSE, distributed with this software.
6+
7+
.. currentmodule:: _libsemigroups_pybind11
8+
9+
Ukkonen
10+
=======
11+
12+
This page describes the functionality in the ``Ukkonen`` class.
13+
14+
``Ukkonen`` instance can be used to construction generalised suffix trees using
15+
Ukkonen's algorithm. Some related functionality is available in
16+
``libsemigroups_pybind11.ukkonen``.
17+
18+
Contents
19+
--------
20+
21+
.. autosummary::
22+
:nosignatures:
23+
24+
~Ukkonen
25+
Ukkonen.add_word
26+
Ukkonen.add_word_no_checks
27+
Ukkonen.is_unique_letter
28+
Ukkonen.length_of_distinct_words
29+
Ukkonen.length_of_words
30+
Ukkonen.max_word_length
31+
Ukkonen.multiplicity
32+
Ukkonen.number_of_distinct_words
33+
Ukkonen.number_of_words
34+
Ukkonen.unique_letter
35+
Ukkonen.validate_word
36+
Ukkonen.word_index
37+
38+
Full API
39+
--------
40+
41+
.. autoclass:: Ukkonen
42+
:members:

_static/documentation_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var DOCUMENTATION_OPTIONS = {
22
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
3-
VERSION: '0.9.2',
3+
VERSION: '0.10.0',
44
LANGUAGE: 'python',
55
COLLAPSE_INDEX: false,
66
BUILDER: 'html',

api/PPerm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
55

66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Partial perms &mdash; libsemigroups_pybind11 0.9.2 documentation</title>
7+
<title>Partial perms &mdash; libsemigroups_pybind11 0.10.0 documentation</title>
88
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
99
<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
1010
<link rel="stylesheet" href="../_static/copybutton.css" type="text/css" />
@@ -37,7 +37,7 @@
3737
<a href="../index.html" class="icon icon-home"> libsemigroups_pybind11
3838
</a>
3939
<div class="version">
40-
0.9.2
40+
0.10.0
4141
</div>
4242
<div role="search">
4343
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">

0 commit comments

Comments
 (0)