Repository navigation
Conversation
Soupstraw
force-pushed
the
jj/generator-controls
branch
from
November 18, 2026 13:20
b8e9e56 to
4bcf73f
Compare
Soupstraw
force-pushed
the
jj/generator-controls
branch
from
November 18, 2026 13:49
4bcf73f to
d380eae
Compare
Soupstraw
force-pushed
the
jj/generator-controls
branch
from
November 18, 2026 13:53
d380eae to
9c7a9c9
Compare
Soupstraw
commented
Nov 18, 2026
TermGenerator for writing constrainable custom generators
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.
This PR changes how control operators are applied to rules. Previously we had a
genControlfunction which had cases for all the implemented control operator behavior. Since we want custom generators to also be able to be affected by constraints, I moved the constraint application into the generators themselves.The generators now use
TermGenerator, which has both the generator and a mutator function, which takes a constraint and applies it to the generator to produce a more constrainedTermGenerator. The users now have two different interfaces for implementing custom generators:withCBORGenandwithGenerator. ThewithCBORGenis a simpler interface, which just takes a generator, but it will fail whenever any callsite tries to apply a constraint to the rule that has awithCBORGengenerator attached to it. For rules that will need to be affected by constraints, it is possible to define custom generators usingwithGenerator.close #223