C# Class Fare.BasicOperations

Afficher le fichier Open project: moodmosaic/Fare Class Usage Examples

Méthodes publiques

Méthode Description
AddEpsilons ( Fare.Automaton a, ICollection pairs ) : void

Adds epsilon transitions to the given automaton. This method adds extra character interval transitions that are equivalent to the given set of epsilon transitions.

Complement ( Fare.Automaton a ) : Fare.Automaton

Returns a (deterministic) automaton that accepts the complement of the language of the given automaton.

Complexity: linear in number of states (if already deterministic).

Concatenate ( Fare.Automaton a1, Fare.Automaton a2 ) : Fare.Automaton
Concatenate ( IList l ) : Fare.Automaton
Determinize ( Fare.Automaton a ) : void

Determinizes the specified automaton.

Complexity: exponential in number of states.

Determinize ( Fare.Automaton a, List initialset ) : void

Determinizes the given automaton using the given set of initial states.

Intersection ( Fare.Automaton a1, Fare.Automaton a2 ) : Fare.Automaton

Returns an automaton that accepts the intersection of the languages of the given automata. Never modifies the input automata languages.

IsEmpty ( Fare.Automaton a ) : bool

Determines whether the given automaton accepts no strings.

IsEmptyString ( Fare.Automaton a ) : bool

Determines whether the given automaton accepts the empty string and nothing else.

Optional ( Fare.Automaton a ) : Fare.Automaton

Returns an automaton that accepts the union of the empty string and the language of the given automaton.

Complexity: linear in number of states.

Repeat ( Fare.Automaton a ) : Fare.Automaton

Accepts the Kleene star (zero or more concatenated repetitions) of the language of the given automaton. Never modifies the input automaton language.

Complexity: linear in number of states.

Repeat ( Fare.Automaton a, int min ) : Fare.Automaton

Accepts min or more concatenated repetitions of the language of the given automaton.

Complexity: linear in number of states and in min.

Repeat ( Fare.Automaton a, int min, int max ) : Fare.Automaton

Accepts between min and max (including both) concatenated repetitions of the language of the given automaton.

Complexity: linear in number of states and in min and max.

Run ( Fare.Automaton a, string s ) : bool

Returns true if the given string is accepted by the automaton.

Complexity: linear in the length of the string. For full performance, use the RunAutomaton class.

Union ( IList automatons ) : Fare.Automaton

Returns an automaton that accepts the union of the languages of the given automata.

Complexity: linear in number of states.

Method Details

AddEpsilons() public static méthode

Adds epsilon transitions to the given automaton. This method adds extra character interval transitions that are equivalent to the given set of epsilon transitions.
public static AddEpsilons ( Fare.Automaton a, ICollection pairs ) : void
a Fare.Automaton The automaton.
pairs ICollection A collection of objects representing pairs of /// source/destination states where epsilon transitions should be added.
Résultat void

Complement() public static méthode

Returns a (deterministic) automaton that accepts the complement of the language of the given automaton.
Complexity: linear in number of states (if already deterministic).
public static Complement ( Fare.Automaton a ) : Fare.Automaton
a Fare.Automaton The automaton.
Résultat Fare.Automaton

Concatenate() public static méthode

public static Concatenate ( Fare.Automaton a1, Fare.Automaton a2 ) : Fare.Automaton
a1 Fare.Automaton
a2 Fare.Automaton
Résultat Fare.Automaton

Concatenate() public static méthode

public static Concatenate ( IList l ) : Fare.Automaton
l IList
Résultat Fare.Automaton

Determinize() public static méthode

Determinizes the specified automaton.
Complexity: exponential in number of states.
public static Determinize ( Fare.Automaton a ) : void
a Fare.Automaton The automaton.
Résultat void

Determinize() public static méthode

Determinizes the given automaton using the given set of initial states.
public static Determinize ( Fare.Automaton a, List initialset ) : void
a Fare.Automaton The automaton.
initialset List The initial states.
Résultat void

Intersection() public static méthode

Returns an automaton that accepts the intersection of the languages of the given automata. Never modifies the input automata languages.
public static Intersection ( Fare.Automaton a1, Fare.Automaton a2 ) : Fare.Automaton
a1 Fare.Automaton The a1.
a2 Fare.Automaton The a2.
Résultat Fare.Automaton

IsEmpty() public static méthode

Determines whether the given automaton accepts no strings.
public static IsEmpty ( Fare.Automaton a ) : bool
a Fare.Automaton The automaton.
Résultat bool

IsEmptyString() public static méthode

Determines whether the given automaton accepts the empty string and nothing else.
public static IsEmptyString ( Fare.Automaton a ) : bool
a Fare.Automaton The automaton.
Résultat bool

Optional() public static méthode

Returns an automaton that accepts the union of the empty string and the language of the given automaton.
Complexity: linear in number of states.
public static Optional ( Fare.Automaton a ) : Fare.Automaton
a Fare.Automaton The automaton.
Résultat Fare.Automaton

Repeat() public static méthode

Accepts the Kleene star (zero or more concatenated repetitions) of the language of the given automaton. Never modifies the input automaton language.
Complexity: linear in number of states.
public static Repeat ( Fare.Automaton a ) : Fare.Automaton
a Fare.Automaton The automaton.
Résultat Fare.Automaton

Repeat() public static méthode

Accepts min or more concatenated repetitions of the language of the given automaton.
Complexity: linear in number of states and in min.
public static Repeat ( Fare.Automaton a, int min ) : Fare.Automaton
a Fare.Automaton The automaton.
min int The minimum concatenated repetitions of the language of the given /// automaton.
Résultat Fare.Automaton

Repeat() public static méthode

Accepts between min and max (including both) concatenated repetitions of the language of the given automaton.
Complexity: linear in number of states and in min and max.
public static Repeat ( Fare.Automaton a, int min, int max ) : Fare.Automaton
a Fare.Automaton The automaton.
min int The minimum concatenated repetitions of the language of the given /// automaton.
max int The maximum concatenated repetitions of the language of the given /// automaton.
Résultat Fare.Automaton

Run() public static méthode

Returns true if the given string is accepted by the automaton.
Complexity: linear in the length of the string. For full performance, use the RunAutomaton class.
public static Run ( Fare.Automaton a, string s ) : bool
a Fare.Automaton The automaton.
s string The string.
Résultat bool

Union() public static méthode

Returns an automaton that accepts the union of the languages of the given automata.
Complexity: linear in number of states.
public static Union ( IList automatons ) : Fare.Automaton
automatons IList The l.
Résultat Fare.Automaton