C# 클래스 Fare.BasicOperations

파일 보기 프로젝트 열기: moodmosaic/Fare 1 사용 예제들

공개 메소드들

메소드 설명
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.

메소드 상세

AddEpsilons() 공개 정적인 메소드

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.
리턴 void

Complement() 공개 정적인 메소드

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.
리턴 Fare.Automaton

Concatenate() 공개 정적인 메소드

public static Concatenate ( Fare.Automaton a1, Fare.Automaton a2 ) : Fare.Automaton
a1 Fare.Automaton
a2 Fare.Automaton
리턴 Fare.Automaton

Concatenate() 공개 정적인 메소드

public static Concatenate ( IList l ) : Fare.Automaton
l IList
리턴 Fare.Automaton

Determinize() 공개 정적인 메소드

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

Determinize() 공개 정적인 메소드

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.
리턴 void

Intersection() 공개 정적인 메소드

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.
리턴 Fare.Automaton

IsEmpty() 공개 정적인 메소드

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

IsEmptyString() 공개 정적인 메소드

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

Optional() 공개 정적인 메소드

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.
리턴 Fare.Automaton

Repeat() 공개 정적인 메소드

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.
리턴 Fare.Automaton

Repeat() 공개 정적인 메소드

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.
리턴 Fare.Automaton

Repeat() 공개 정적인 메소드

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.
리턴 Fare.Automaton

Run() 공개 정적인 메소드

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.
리턴 bool

Union() 공개 정적인 메소드

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.
리턴 Fare.Automaton