Implementation of graphs.
Computation of transitive closures in graphs.
nfa * create_emptylang(void)
Computes a NFA recognizing the empty language.
Definition nfa.c:400
bool nfa_accepts(nfa *, word *)
Tests if a word is accepted by a NFA.
Definition nfa.c:1359
nfa * create_sing_letter(letter)
Computes a NFA recognizing a singleton language {a} containing a single letter word.
Definition nfa.c:420
nfa * dfa_star(dfa *)
Kleene star of a DFA.
Definition nfa.c:682
nfa * nfa_plus(nfa *)
Kleene plus of a NFA.
Definition nfa.c:715
nfa * nfa_concat(void *I1, bool is_dfa_I1, void *I2, bool is_dfa_I2)
Concatenation of two NFAs.
Definition nfa.c:566
bool dfa_exists_path(dfa *, uint, uint, bool *)
Checks if there exists a path between two states in a DFA.
Definition nfa.c:1398
nfa * nfa_merge_states(nfa *, parti *)
Merges the states of a NFA according to the partition given as input.
Definition nfa.c:1455
dfa * dfa_direct_product(dfa *A, dfa *B)
Definition nfa.c:1124
nfa * nfa_random(uint, uint, uint)
Generates a random NFA.
Definition nfa.c:1190
int nfa_nb_trans(nfa *)
Computes the number of transitions in a NFA.
Definition nfa.c:1314
nfa * nfa_copy_exalpha(nfa *, letter *, uint)
Copies an NFA with an extended alphabet.
Definition nfa.c:249
void nfa_trim_mod(nfa *)
Elimination of all states that are not simultaneously reachable from an initial state and co-reachabl...
Definition nfa.c:1036
dfa * dfa_copy(dfa *A)
Copies a DFA.
Definition nfa.c:167
void dfa_print_state(const dfa *, uint, FILE *)
Displays the name of a state in a DFA on a given stream.
Definition nfa.c:29
void nfa_reset_state_names(nfa *)
Release the state names in a NFA (if there are states names).
Definition nfa.c:41
nfa * create_sing_epsilon(void)
Computes a NFA recognizing the singleton language {ε}.
Definition nfa.c:409
void nfa_overwrite(nfa *, nfa *)
Overwrites a NFA by copying another NFA and releasing this other NFA.
Definition nfa.c:365
void dfa_reset_state_names(dfa *A)
Release the state names in a DFA (if there are states names).
Definition nfa.c:54
bool nfa_is_empty(nfa *)
Tests if a NFA recognizes the empty language.
Definition nfa.c:1352
bool nfa_is_det(nfa *)
Tests if a NFA is deterministic.
Definition nfa.c:1324
nfa * nfa_union(void *I1, bool is_dfa_I1, void *I2, bool is_dfa_I2)
Union of two automata (NFAs or DFAs) into a single NFA.
Definition nfa.c:501
dfa * dfa_copy_exalpha(dfa *A, letter *alpha, uint size)
Copies a DFA with an extended alphabet.
Definition nfa.c:305
nfa * nfa_star(nfa *)
Kleene star of a NFA.
Definition nfa.c:632
nfa * dfa_to_nfa_exalpha(dfa *A, letter *alpha, uint size)
Converts a DFA into a NFA with an extended alphabet.
Definition nfa.c:1639
void nfa_delete(nfa *)
Release of a NFA.
Definition nfa.c:85
nfa * nfa_mirror(nfa *)
Mirror of a NFA.
Definition nfa.c:764
dfa * dfa_trim(dfa *A)
Removes all non-accessible states from a DFA.
Definition nfa.c:961
void dfa_delete(dfa *A)
Deletes a DFA.
Definition nfa.c:114
nfa * dfa_mirror(dfa *)
Mirror of a DFA.
Definition nfa.c:788
nfa * dfa_to_nfa(dfa *A)
Converts a DFA into a NFA.
Definition nfa.c:1593
bool nfa_is_comp(nfa *)
Tests if a NFA is complete.
Definition nfa.c:1338
dfa * dfa_random(uint, uint, uint)
Generates a random DFA.
Definition nfa.c:1249
dequeue * nfa_compute_runs(nfa *, word *)
Computes the set of states reached by a word in a NFA.
Definition nfa.c:1370
void nfa_print_state(const nfa *, uint, FILE *)
Displays the name of a state in a NFA on a given stream.
Definition nfa.c:16
nfa * nfa_elimeps(nfa *)
Elimination of the epsilon transitions in a NFA.
Definition nfa.c:1042
dfa * detnfa_to_dfa(nfa *A)
Converts a NFA which is deterministic into the complete DFA representation.
Definition nfa.c:1552
nfa * nfa_trim(nfa *)
Elimination of all states that are not simultaneously reachable from an initial state and co-reachabl...
Definition nfa.c:815
void nfa_elimeps_mod(nfa *)
Elimination of the epsilon transitions in a NFA. Overwrites the input NFA.
Definition nfa.c:1117
char ** copy_all_names(char **names, uint size)
Returns a copy of the array of state names.
Definition nfa.c:66
nfa * nfa_copy(nfa *)
Copy of a NFA.
Definition nfa.c:132
uint dfa_compute_run(dfa *A, word *w)
Computes the run of a DFA on a word.
Definition nfa.c:1434
nfa * create_sing_word(word *)
Computes a NFA recognizing a singleton language {w} for some input word w.
Definition nfa.c:434
Type used to represent a dequeue of unsigned integers.
Definition type_dequeue.h:26
Type used to represent a complete DFA.
Definition nfa.h:61
char ** state_names
Array of state names (only utilized when displaying the DFA). Each state is mapped to its name (NULL ...
Definition nfa.h:70
uint * finals
Array of final states (sorted in increasing order).
Definition nfa.h:66
letter * alphabet
Array indexed by the indices of letters. Maps each index to its actual letter (NULL if the alphabet i...
Definition nfa.h:67
uint initial
The index of the initial state.
Definition nfa.h:64
bool ** order
The canonical order of the states (NULL if not used). The order is defined by the indices of the stat...
Definition nfa.h:71
uint nb_finals
Number of final states.
Definition nfa.h:65
dgraph * trans
Graph of transitions (also stores the number of states and the size of the alphabet)....
Definition nfa.h:63
Type used to represent a complete deterministic directed labeled graph.
Definition graphs.h:73
Type used to represent a directed unlabeled graph.
Definition graphs.h:42
The type used to represent a letter.
Definition words.h:33
Type used to represent a directed labeled graph.
Definition graphs.h:57
Type used to represent a NFA.
Definition nfa.h:43
lgraph * trans_i
Graph of inverse transitions (NULL if there are no such transitions).
Definition nfa.h:52
lgraph * trans
Graph of transitions (also stores the number of states and the size of the alphabet).
Definition nfa.h:45
char ** state_names
Array of state names (only utilized when displaying the NFA). Each state is mapped to its name (NULL ...
Definition nfa.h:53
dequeue * initials
The list of initial states (sorted in increasing order).
Definition nfa.h:46
graph * trans_e
Graph of espilon transitions (NULL if there are no such transitions).
Definition nfa.h:51
letter * alphabet
Array indexed by the indices of letters. Maps each index to its actual letter (NULL if the alphabet i...
Definition nfa.h:48
dequeue * finals
The list of final states (sorted in increasing order).
Definition nfa.h:47
First type used to represent a partition. This is not the one used by Union-Find.
Definition type_partitions.h:36
The type used to represent a word.
Definition words.h:143
Implementation of AVLs for representing sets of objects.
Implementation of generic binary heaps.
Implementation of Boolean arrays.
Implementation of dequeues of unsigned integers.
Implementation of letters and words.