Mescal
Loading...
Searching...
No Matches
sep_group.h
Go to the documentation of this file.
1
6
7#ifndef SEP_GROUP_H
8#define SEP_GROUP_H
9
10#include "graphs_tarjan.h"
11#include "nfa.h"
12#include "nfa_intersec.h"
13#include "printing.h"
14#include "type_dlist.h"
15#include "type_partitions.h"
16#include "flint/fmpz.h"
17#include "flint/fmpz_mat.h"
18#include <stdbool.h>
19#include <stdlib.h>
20
21 /* ____ _ _ ____ */
22 /* / ___| ___ _ __ __ _ _ __ __ _| |_(_) ___ _ __ _ / ___|_ __ ___ _ __ __ */
23 /* \___ \ / _ \ '_ \ / _` | '__/ _` | __| |/ _ \| '_ \‍(_) | | _| '__/ _ \| | | | '_ \ */
24 /* ___) | __/ |_) | (_| | | | (_| | |_| | (_) | | | |_ | |_| | | | (_) | |_| | |_) | */
25 /* |____/ \___| .__/ \__,_|_| \__,_|\__|_|\___/|_| |_(_) \____|_| \___/\__,_ | .__/ */
26 /* | | __ _ _ |_| __ _ _ _ __ _ __ _ ___ ___ |_| */
27 /* | |/ _` | '_ \ / _` | | | |/ _` |/ _` |/ _ \/ __| */
28 /* | | (_| | | | | (_| | |_| | (_| | (_| | __/\__ \ */
29 /* |_|\__,_|_| |_|\__, |\__,_|\__,_|\__, |\___||___/ */
30 /* |___/ |___/ */
31
32
33/********************/
34/*+ AMT-separation +*/
35/********************/
36
37bool solve_system_amt(fmpz_mat_t MAT, int* target, uint nb_rows, uint nb_cols);
38
59typedef struct {
62 uint nb_trees;
65 uint* numtree;
66 uint* root;
70
84 parti* sccs,
85 bool* allowed
87);
88
89
95);
96
106 parti* sccs
107);
108
109
110
116 morphism*,
117 bool*,
118 uint*
119);
120
121void build_hnf_matrix_two(dgraph* g1, dgraph* g2, num_span_forest* span1, num_span_forest* span2, uint q1, uint q2, fmpz_mat_t MAT);
122
129 morphism* M,
130 num_span_forest* rspan,
131 num_span_forest* lspan,
132 uint e,
133 uint f,
134 dequeue* first,
135 dequeue* second
136);
137
138/**************************/
139/*+ Dealing with dgraphs +*/
140/**************************/
141
158 parti* sccs,
159 basis ba
160);
161
162
163
176 parti* fold,
177 parti* sccs
178);
179
193 parti* fold,
194 parti* sccs
195);
196
209 parti* fold,
210 parti* sccs
211);
212
226 parti* fold,
227 parti* sccs
228);
229
230
231
245 parti* sccs,
246 parti* fold
247);
248
250 basis ba
251);
252
253/***********************/
254/*+ Inverse extension +*/
255/***********************/
256
270);
271
276void nfa_remove_inv(nfa*
277);
278
279/***********************************/
280/*+ Separation by group languages +*/
281/***********************************/
282
294 parti*
295);
296
297
298
312 nfa*,
313 parti*
314);
315
328bool decid_grp_sep(nfa*,
329 nfa*,
330 bool,
331 FILE*
332);
333
334/************************************/
335/*+ Separation by modulo languages +*/
336/************************************/
337
346);
347
360bool decid_mod_sep(nfa*,
361 nfa*,
362 bool,
363 FILE*
364);
365
366/*************************************/
367/*+ Separation by trivial languages +*/
368/*************************************/
369
381bool decid_st_sep(nfa*,
382 nfa*,
383 FILE*
384);
385
386#endif
Implementation of Tarjan's algorithm.
Implementation of NFAs.
Intersection of NFAs.
parti * nfa_stal_fold(nfa *, parti *)
Computation of the partition obtained by the Stallings folding in SCCs.
Definition sep_group.c:914
nfa * nfa_proj_unary(nfa *)
Projection of a NFA over a one-letter alphabet.
Definition sep_group.c:1342
dfa * dfa_compute_folding(dfa *A, basis ba)
Definition sep_group.c:782
dgraph * dgraph_implement_fold(dgraph *g, parti *sccs, parti *fold)
Folds a single SCC of a dgraph according to a folding partition generated from MOD,...
Definition sep_group.c:758
bool decid_st_sep(nfa *, nfa *, FILE *)
ST-separation.
Definition sep_group.c:1484
dgraph * shrink_grp(dgraph *g, parti *fold, parti *sccs)
Computes the graph obtained by folding a right or left Cayley graph according to the Stalling partiti...
Definition sep_group.c:714
dgraph * shrink_mod_mirror(dgraph *g, parti *fold, parti *sccs)
Computes the graph obtained by folding a right or left Cayley graph according to the Stalling partiti...
Definition sep_group.c:694
void compute_amt_kernel_regular(morphism *, bool *, uint *)
Computes the regular elements of the AMT-kernel in a morphism (non-regular elements are ignored).
Definition sep_group.c:272
dgraph * shrink_mod(dgraph *g, parti *fold, parti *sccs)
Computes the graph obtained by folding a right or left Cayley graph according to the Stalling partiti...
Definition sep_group.c:674
num_span_forest * compute_span_forest(dgraph *G, parti *sccs, bool *allowed)
Computes a spanning forest from a dgraph.
Definition sep_group.c:94
parti * dgraph_amt_fold(dgraph *g, parti *sccs)
Computes the folding of a dgraph according to the AMT-separation.
Definition sep_group.c:196
void nfa_remove_inv(nfa *)
Remove all inverse transitions in an NFA.
Definition sep_group.c:901
bool decid_grp_sep(nfa *, nfa *, bool, FILE *)
GR-separation.
Definition sep_group.c:1252
dgraph * shrink_grp_mirror(dgraph *g, parti *fold, parti *sccs)
Computes the graph obtained by folding a right or left Cayley graph according to the Stalling partiti...
Definition sep_group.c:734
void delete_span_forest(num_span_forest *forest)
Deletes the structure used to store the spanning forest.
Definition sep_group.c:151
parti * dgraph_stal_fold(dgraph *G, parti *sccs, basis ba)
Computes the Stalling partition obtained from a dgraph.
Definition sep_group.c:477
parti * nfa_inv_ext(nfa *)
Computation of the inverse transitions inside the SCCs of an NFA.
Definition sep_group.c:867
void compute_amt_pairs_regular(morphism *M, num_span_forest *rspan, num_span_forest *lspan, uint e, uint f, dequeue *first, dequeue *second)
Computes the anti AMT-pairs (q,t) where q is in the R-class of e and t is in the L-class of f.
Definition sep_group.c:372
nfa * nfa_dyck_ext(nfa *, parti *)
Computation of the NFA used in the group separation algorithm by adding epsilon transitions between p...
Definition sep_group.c:1150
bool decid_mod_sep(nfa *, nfa *, bool, FILE *)
MOD-separation.
Definition sep_group.c:1377
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
Type used to represent a complete deterministic directed labeled graph.
Definition graphs.h:73
The type used to represent a morphism into a finite monoid.
Definition monoid.h:91
Type used to represent a NFA.
Definition nfa.h:43
Type used to store the information needed to solve AMT-separation on the SCCs of a dgraph.
Definition sep_group.h:59
uint * root
Array index by the trees of the spanning forest. For each tree i, root[i] is the root of the tree.
Definition sep_group.h:66
dequeue ** dropped
Indexed by the trees of the spanning forest. For each tree i dropped[i] is the list of all edges with...
Definition sep_group.h:67
uint nb_trees
Maximal number of trees in the spanning forest (at most the number of SCCs in the dgraph).
Definition sep_group.h:62
uint * numtree
Array indexed by the states of the dgraph. For each state q, num_tree[q] is the index of the tree of ...
Definition sep_group.h:65
uint size_alpha
Number of labels in the dgraph.
Definition sep_group.h:61
uint size_graph
Number of vertices in the dgraph.
Definition sep_group.h:60
int ** span_forest
The spanning forest. For each state q and each letter a, span_forest[q][a] is the number of occurrenc...
Definition sep_group.h:63
First type used to represent a partition. This is not the one used by Union-Find.
Definition type_partitions.h:36
Implementation of doubly linked lists.
Types used to represent partitions. Includes the union-find algorithm.