C# Class Microsoft.Automata.Rex.RexEngine

Provides a member generator for regexes
显示文件 Open project: AutomataDotNet/Automata Class Usage Examples

Public Methods

Method Description
AreEquivalent ( Automaton aut1, Automaton aut2 ) : bool

Returns true iff aut1 and aut2 accept the same set of strings.

Complement ( Automaton aut ) : Automaton

Complement the automaton

CreateFromRegexes ( ) : Automaton

Create a product of the automata of the given regexes.

CreateFromRegexes ( RegexOptions options ) : Automaton

Create a product of the automata of the given regexes.

Describe ( BDD label ) : string
DeserializeDAG ( string dag ) : Automaton

Recreate an automaton from a string that has been produced with SerializeDAG.

Escape ( char c ) : string

Make an escaped string from a character

Escape ( string s ) : string

Make an escaped string from a string

GenerateMember ( Automaton fa ) : string

Gets the random seed of the generator

Generates a random member accepted by fa. Assumes that fa has no dead states, or else termination is not guaranteed.

GenerateMemberUniformly ( Automaton fa ) : string

Generates a random member accepted by fa with uniform distribution among strings accepted by the sfa. Assumes that the fa is deterministic and loopfree.

GenerateMembers ( Automaton sfa, int k ) : IEnumerable

Generates at most k distinct strings in the language of the sfa. The enumeration is empty if the language is empty.

GenerateMembers ( RegexOptions options, int k ) : IEnumerable

Generates at most k distinct strings that match all the given regexes. The enumeration is empty if there are no strings that match all the regexes.

Intersect ( ) : Automaton

Intersect two (or more) automata.

IsMatch ( string input, string regex, RegexOptions options ) : bool

Invokes System.Text.RegularExpressions.Regex.IsMatch(input, regex, options)

Minimize ( Automaton aut ) : Automaton

Minimize the automaton

RexEngine ( BitWidth encoding ) : System

Create a regex member generator for the given character encoding and the given random seed

Create a regex member generator for the given character encoding.

SerializeDAG ( Automaton aut ) : string

Create a string encoding of the given automaton with probabilities.

Private Methods

Method Description
RexEngine ( CharSetSolver solver ) : System
ToUnicodeRepr ( int i ) : string

Method Details

AreEquivalent() public method

Returns true iff aut1 and aut2 accept the same set of strings.
public AreEquivalent ( Automaton aut1, Automaton aut2 ) : bool
aut1 Automaton
aut2 Automaton
return bool

Complement() public method

Complement the automaton
public Complement ( Automaton aut ) : Automaton
aut Automaton
return Automaton

CreateFromRegexes() public method

Create a product of the automata of the given regexes.
public CreateFromRegexes ( ) : Automaton
return Automaton

CreateFromRegexes() public method

Create a product of the automata of the given regexes.
public CreateFromRegexes ( RegexOptions options ) : Automaton
options RegexOptions
return Automaton

Describe() public method

public Describe ( BDD label ) : string
label BDD
return string

DeserializeDAG() public method

Recreate an automaton from a string that has been produced with SerializeDAG.
public DeserializeDAG ( string dag ) : Automaton
dag string string encoding of a deterministic and loopfree automaton with probabilities
return Automaton

Escape() public static method

Make an escaped string from a character
public static Escape ( char c ) : string
c char
return string

Escape() public static method

Make an escaped string from a string
public static Escape ( string s ) : string
s string
return string

GenerateMember() public method

Gets the random seed of the generator Generates a random member accepted by fa. Assumes that fa has no dead states, or else termination is not guaranteed.
public GenerateMember ( Automaton fa ) : string
fa Automaton
return string

GenerateMemberUniformly() public method

Generates a random member accepted by fa with uniform distribution among strings accepted by the sfa. Assumes that the fa is deterministic and loopfree.
public GenerateMemberUniformly ( Automaton fa ) : string
fa Automaton
return string

GenerateMembers() public method

Generates at most k distinct strings in the language of the sfa. The enumeration is empty if the language is empty.
public GenerateMembers ( Automaton sfa, int k ) : IEnumerable
sfa Automaton
k int
return IEnumerable

GenerateMembers() public method

Generates at most k distinct strings that match all the given regexes. The enumeration is empty if there are no strings that match all the regexes.
public GenerateMembers ( RegexOptions options, int k ) : IEnumerable
options RegexOptions regular expression options
k int number of members to be generated
return IEnumerable

Intersect() public method

Intersect two (or more) automata.
public Intersect ( ) : Automaton
return Automaton

IsMatch() public static method

Invokes System.Text.RegularExpressions.Regex.IsMatch(input, regex, options)
public static IsMatch ( string input, string regex, RegexOptions options ) : bool
input string
regex string
options RegexOptions
return bool

Minimize() public method

Minimize the automaton
public Minimize ( Automaton aut ) : Automaton
aut Automaton
return Automaton

RexEngine() public method

Create a regex member generator for the given character encoding and the given random seed Create a regex member generator for the given character encoding.
public RexEngine ( BitWidth encoding ) : System
encoding BitWidth character encoding
return System

SerializeDAG() public method

Create a string encoding of the given automaton with probabilities.
public SerializeDAG ( Automaton aut ) : string
aut Automaton deterministic and loopfree automaton
return string