Mescal
Loading...
Searching...
No Matches
nfa_minimization.h
Go to the documentation of this file.
1
9
10#ifndef MINIMIZATION_H
11#define MINIMIZATION_H
12
13 /* _ _ _____ _ __ __ _ _ _ _ _ */
14 /* | \ | | ___/ \ _ | \/ (_)_ __ (_)_ __ ___ (_)______ _| |_(_) ___ _ __ */
15 /* | \| | |_ / _ \ (_) | |\/| | | '_ \| | '_ ` _ \| |_ / _` | __| |/ _ \| '_ \ */
16 /* | |\ | _/ ___ \ _ | | | | | | | | | | | | | | |/ / (_| | |_| | (_) | | | | */
17 /* |_| \_|_|/_/ \_(_) |_| |_|_|_| |_|_|_| |_| |_|_/___\__,_|\__|_|\___/|_| |_| */
18
19
20#include "nfa_determi.h"
21#include "printing.h"
22
23/***************/
24/*+ Auxiliary +*/
25/***************/
26
39);
40
41
42/****************/
43/*+ Brzozowski +*/
44/****************/
45
54);
55
56
65);
66
67
68/**************/
69/*+ Hopcroft +*/
70/**************/
71
76typedef struct {
77 uint size_set;
78 uint size_par;
79 uint* classes;
80 uint* parray;
81 uint* parray_i;
82 uint* rindex;
83 uint* lindex;
85
86
87
101 uint*,
102 uint
103);
104
114);
115
121);
122
131);
132
133
134/************************/
136/************************/
137
149);
150
151
152
153#endif
Determinization and complementation of NFAs.
dfa * dfa_hopcroft(dfa *)
Hopcroft's minimization algorithm.
Definition nfa_minimization.c:209
dfa * dfa_brzozowski(dfa *)
Brzozowski's minimization algorithm (fo rinput DFAs)
Definition nfa_minimization.c:69
hopcroft_partition * dfa_hopcroft_initial(uint, uint *, uint)
Computes the initial partition of the states in Hopcroft's algorithm. The set of final states is assu...
Definition nfa_minimization.c:91
void dfa_hopcroft_free(hopcroft_partition *)
Release of a Hopcroft's partition.
Definition nfa_minimization.c:183
dfa * dfa_hopcroft_genauto(dfa *, hopcroft_partition *)
Computation of the minimal automaton from the partition computed by the Hopcroft's algorithm.
Definition nfa_minimization.c:138
dfa * nfa_brzozowski(nfa *)
Brzozowski's minimization algorithm (for input NFAs)
Definition nfa_minimization.c:60
void dfa_mini_canonical_ordering(dfa *)
Computes the canonical ordering of the states of a minimal DFA.
Definition nfa_minimization.c:406
dfa * dfa_mini_canonical_copy(dfa *)
Makes a copy of a minimal DFA. The ordering between the states is changed to make the copy canonical.
Definition nfa_minimization.c:7
Type used to represent a complete DFA.
Definition nfa.h:61
Type used to represent the state partition used in the Hopcroft algorithm.
Definition nfa_minimization.h:76
uint size_set
The size of the partitioned set.
Definition nfa_minimization.h:77
uint * parray_i
Inverse of the previous array: each element in the set is mapped to each index in parray.
Definition nfa_minimization.h:81
uint * rindex
Array indexed by the classes: each class is mapped to the index following this class in parray.
Definition nfa_minimization.h:82
uint size_par
The size of the partition.
Definition nfa_minimization.h:78
uint * classes
Array of classes: maps each element to its class.
Definition nfa_minimization.h:79
uint * parray
Array containing all elements of the set grouped by classes (elements belonging to the same class are...
Definition nfa_minimization.h:80
uint * lindex
Array indexed by the classes: each class is mapped to the index at which this class starts in parray.
Definition nfa_minimization.h:83
Type used to represent a NFA.
Definition nfa.h:43