Repository navigation
Conversation
A class whose basis is closed under rotation (moving the first entry of a pattern to the end) is closed under rotation too, so it has n times as many permutations of length n as its min cut, the class of the permutations p with 1 + p in the class, has of length n - 1. The new fast enumeration strategy checks this for the basis and its symmetries, gives the min and max cuts, follows the cuts while they are rotationally stable again, and counts the class through them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Implements the model of Domagalski et al., "Cyclic Pattern Containment and Avoidance" (arXiv:2106.02534): a cyclic permutation is the class of all rotations of a permutation, stored by its rotation that starts with its minimum, so [sigma] contains [p] when that rotation of sigma contains some rotation of p. The tests check Callan's enumeration of the single patterns of length 4, three-pattern results of Domagalski et al., the cyclic Erdos-Szekeres bound, the trivial Wilf-equivalences, that the number of cyclic descents does not depend on the rotation, and that [42351] contains [1234] though 42351 avoids 1234. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All rotations of a set of cyclic patterns are a rotationally stable basis, whose class has n times as many permutations of length n as there are cyclic permutations of length n avoiding the patterns. Checked for every cyclic pattern of length 4 or 5 and every pair of length 4, to length 7. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ulfarsson
requested review from
ReedActon,
akc and
christianbean
and removed request for
akc and
christianbean
October 16, 2026 17:04
CyclicPerm keeps its representative in the slot _rep, set in __new__ on the new object, so mypy never learned the attribute and failed with 27 errors. A class annotation declares it. With _rep typed as a Perm, whose slices mypy takes for empty tuples, sigma now drops the first entry with itertools.islice, as Perm itself does. reverse, complement, reverse_complement, avoids_set and count_occurrences_of get the docstrings pylint asks for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…arPatt pylint 4 counts a method that only raises NotImplementedError as abstract, and flags the subclasses that do not override it, on develop too. BivincularPatt leaves unrank and of_length unimplemented on purpose, and so do these two subclasses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Functionality for circular patterns and a new strategy to simplify rotationally stable normal permtuation classes.