Strings in short-lex order (sislo)

The function sislo can be used to iterate through strings in short-lex order in some range.

sislo(alphabet: str, first: str, last: str) Iterator

Returns an iterator to strings in short-lex order (sislo).

Parameters
  • alphabet (str) -- the alphabet

  • first (str) -- the first string

  • last (str) -- one past the last string

Returns

An iterator to strings over the alphabet alphabet in short-lex order and in the range [first, last).

>>> from libsemigroups_pybind11 import sislo
>>> list(sislo("ba", "b", "aaa"))
['b', 'a', 'bb', 'ba', 'ab', 'aa', 'bbb', 'bba', 'bab', 'baa', 'abb', 'aba', 'aab']