Safe Haskell | None |
---|---|
Language | Haskell98 |
This module and the accompanying genex
program finds all permutations
of strings that matches every input regular expressions, ordered from
shortest to longest, with full support for back references ('\1' .. '\9')
and word boundaries ('\b').
It requires the z3
or yices
binary in PATH. The latter may be downloaded from:
http://yices.csl.sri.com/download-yices2.shtml
- data Model = Model {
- modelChars :: [Word8]
- modelRank :: Word64
- genex :: [String] -> IO [String]
- genexPure :: [String] -> [String]
- genexPrint :: [String] -> IO ()
- genexModels :: [String] -> IO [Model]
- genexWith :: (?maxRepeat :: Int, Monoid a) => ([SatResult] -> Hits -> (Hits -> IO a) -> IO a) -> [[Char]] -> IO a
- regexMatch :: (?maxRepeat :: Int) => [[Char]] -> Str -> Symbolic SBool
Documentation
A match consists of a string (list of codepoints), and a rank representing alternation order.
Model | |
|
genex :: [String] -> IO [String] Source
Given a list of regular repressions, returns all possible strings that matches every one of them. Guarantees to return shorter strings before longer ones.
genexPure :: [String] -> [String] Source
A pure and much faster variant of genex
, but without support for
back-references, anchors or word boundaries.
Does not guarantee orders about length of strings.
Does not depend on the external yices
SMT solver.
genexPrint :: [String] -> IO () Source
Same as genexModels
, but print the models to standard output instead.
genexModels :: [String] -> IO [Model] Source
Same as genex
, but with the entire model returned instead.