You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The goal is to support array-based indexing for regular expressions with unbounded repeats. Currently, the max_repeats parameter limits the number of times any sequence can be repeated, making it so that there are always a finite number of strings which can be generated from a regex.
After this change, the user will be able to choose between (1) specifying max_repeats and having a finite set of strings or (2) not specifying max_repeats and having an infinite set of strings they can iterate over and/or index into.
Repeat
Modify the Repeat class to apply Cantor's pairing function when max_repeat is not specified.
x -> (a, b) # decompose the index into two values
b -> interpret this as the length of repeated sequence
a -> (a1, a2, a3, ... a_b) # convert it into `b` values
a_i -> the integer index of the `i`th element in the sequence
Note that the length attribute will be set to float(-inf).
Choice
Modify the Choice class to handle both finite nodes and infinite nodes. It should assign the smallest integers to the finite nodes; then, once those are all assigned, it should start handling the infinite nodes by rotating between them.
The text was updated successfully, but these errors were encountered:
The goal is to support array-based indexing for regular expressions with unbounded repeats. Currently, the
max_repeats
parameter limits the number of times any sequence can be repeated, making it so that there are always a finite number of strings which can be generated from a regex.After this change, the user will be able to choose between (1) specifying max_repeats and having a finite set of strings or (2) not specifying max_repeats and having an infinite set of strings they can iterate over and/or index into.
Repeat
Modify the
Repeat
class to apply Cantor's pairing function whenmax_repeat
is not specified.Note that the length attribute will be set to
float(-inf)
.Choice
Modify the
Choice
class to handle both finite nodes and infinite nodes. It should assign the smallest integers to the finite nodes; then, once those are all assigned, it should start handling the infinite nodes by rotating between them.The text was updated successfully, but these errors were encountered: