This module defines the data type of internal regular expression pattern, | as well as the partial derivative operations for regular expression patterns.
regular expression patterns
|PVar Int [Range] Pat|
pattern without binder
|PPair Pat Pat|
|PChoice [Pat] GFlag|
|PStar Pat GFlag|
|PPlus Pat Pat|
plus pattern, it is used internally to indicate that it is unrolled from a PStar
empty pattern, it is used intermally to indicate that mkEmpty function has been applied.
The Eq instance for Pat data type NOTE: We ignore the 'consumed word' when comparing patterns (ie we only compare the pattern structure). Essential for later comparisons among patterns.
mainly interested in simplifying epsilon, p --> p could be made more optimal, e.g. (epsilon, epsilon) --> epsilon
Binder type denotes a set of (pattern var * range) pairs
type Binder = [(Int, [Range])]