Mescal
|
Implementation of morphisms into finite monoids. More...
#include "graphs.h"
#include "nfa.h"
#include "tools.h"
#include "type_abr.h"
#include "type_basic.h"
#include "type_binheap.h"
#include "type_dequeue.h"
#include "type_dequeue_gen.h"
#include "graphs_tarjan.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
Go to the source code of this file.
Classes | |
struct | green |
Type used to represent the Green relations of a finite monoid. More... | |
struct | morphism |
The type used to represent a morphism into a finite monoid. More... | |
Macros | |
#define | max(a, b) |
#define | min(a, b) |
#define | ONE 0 |
In every monoid, the neutral element is at index 0. | |
Functions | |
void | delete_green (green *) |
Release of the Green relations. | |
void | delete_morphism (morphism *) |
Release of a morphism. | |
letter * | mor_duplicate_alpha (const morphism *) |
Copy the alphabet of a morphism. | |
uint | mor_letter_index (const morphism *, letter) |
Retrieves the index of a letter in the alphabet of a morphism. | |
uint | mor_regular_jclass (const morphism *, uint) |
Given as input a regular element, retrieves the index of the. | |
void | mor_compute_leftcayley (morphism *) |
Computation of the left Cayley graph of a morphism. | |
uint * | green_sorted_jclass (green *, uint) |
Computes an array containing all elements in a given J-class sorted according to the indices of their R-class (first) and L-classes (second). | |
void | h_green_compute (green *) |
Computation of the relation H from J, L and R (which must be already computed). | |
void | gr_green_compute (uint *, uint, green *) |
Computation of informations on regular elements and groups (the Green relations themselves must be already computed). | |
void | mor_compute_rep (morphism *) |
Computation of list of representative idempotents for the morphism. | |
void | mor_compute_green (morphism *) |
Allocates and computes the Green relations of a morphism. | |
void | mor_compute_min_regular_jcl (morphism *) |
Computation of the number of strict J-classes. | |
morphism * | dfa_to_morphism (dfa *, bool, int *, uint **) |
Computation of the transition morphism associated to a complete DFA. | |
uint | dfa_to_morphism_size (dfa *A) |
Computes the size of the morphism associated to a complete DFA without storing the actual morphism. | |
dfa * | morphism_to_dfa (morphism *) |
Computation of a complete DFA from the right Cayley graph of a morphism. | |
dfa * | left_morphism_to_dfa (morphism *) |
Computation of a complete DFA from the left Cayley graph of a morphism. | |
void | mor_compute_mult (morphism *) |
Computation of the multiplication table of a morphism. | |
lgraph * | mor_rmirror (morphism *) |
Computation of the mirror of the right Cayley graph. | |
lgraph * | mor_lmirror (morphism *) |
Computation of the mirror of the left Cayley graph. | |
dequeue ** | mor_compute_order (morphism *) |
Computation of the syntactic order table of a morphism. | |
dequeue * | mor_name (morphism *, uint) |
Return the name of an element (product of generators) in a dequeue. | |
uint | mor_mult (morphism *, uint, uint) |
Multiplication of two elements. | |
uint | mor_mult_gen (morphism *, uint,...) |
Multiplication of an arbitrary number of elements. | |
uint | mor_omega (morphism *, uint) |
Computes the omega power of an element. | |
bool | mor_num_idem (morphism *, uint, uint *) |
Computes the index of an idempotent element. | |
bool | mor_neutral_letter (morphism *, FILE *) |
Tests if there exists a letter mapped to the neutral element. | |
bool | mor_nonempty_neutral (morphism *) |
Tests if there exists a nonempty antecedent of the neutral element in a morphism. | |
bool | mor_all_regular (morphism *) |
Tests if all elements in a morphism are regular. | |
uint | mor_compute_image (morphism *, word *) |
Computes the image of a word. | |
dgraph * | mor_extract_rcl (morphism *M, uint rcl) |
Returns the graph of a single R-class. | |
Implementation of morphisms into finite monoids.
Contains the definition of the types "green" and "morphism". The type "green" is used to represent the Green relations of a finite monoid. The type "morphism" is used to represent a morphism into a finite monoid (it includes the Green relations of this monoid). Includes the functions used to create new morphisms and their Green relations from a complete DFA as well as the function manipulating morphisms.
#define max | ( | a, | |
b ) |
#define min | ( | a, | |
b ) |
void delete_green | ( | green * | G | ) |
Release of the Green relations.
G | The Green relations. |
void delete_morphism | ( | morphism * | M | ) |
Release of a morphism.
M | The morphism. |
Computation of the transition morphism associated to a complete DFA.
A | The complete DFA. |
order | Should the ordering on the elements of the morphism be computed ? (only works for minimal input DFAs) |
funs | A pointer to return function table used to construct the monoid (NULL if not used). |
uint dfa_to_morphism_size | ( | dfa * | A | ) |
Computes the size of the morphism associated to a complete DFA without storing the actual morphism.
A | The complete DFA. |
void gr_green_compute | ( | uint * | idem_list, |
uint | nb_idems, | ||
green * | G ) |
Computation of informations on regular elements and groups (the Green relations themselves must be already computed).
idem_list | The list of idempotents. |
nb_idems | The number of idempotents. |
G | The Green relations. |
uint * green_sorted_jclass | ( | green * | G, |
uint | i ) |
Computes an array containing all elements in a given J-class sorted according to the indices of their R-class (first) and L-classes (second).
G | The Green relations. |
i | The index of the J-class. |
void h_green_compute | ( | green * | GREL | ) |
Computation of the relation H from J, L and R (which must be already computed).
GREL | The Green relations (J, R et L must be computed). |
Computation of a complete DFA from the left Cayley graph of a morphism.
M | The morphism. |
bool mor_all_regular | ( | morphism * | M | ) |
Tests if all elements in a morphism are regular.
M | The morphism. |
void mor_compute_green | ( | morphism * | M | ) |
Allocates and computes the Green relations of a morphism.
M | The morphism. |
Computes the image of a word.
M | The morphism. |
w | The word. |
void mor_compute_leftcayley | ( | morphism * | M | ) |
Computation of the left Cayley graph of a morphism.
M | The morphism. |
void mor_compute_min_regular_jcl | ( | morphism * | ) |
Computation of the number of strict J-classes.
void mor_compute_mult | ( | morphism * | M | ) |
Computation of the multiplication table of a morphism.
M | The morphism. |
Computation of the syntactic order table of a morphism.
M | The morphism. |
void mor_compute_rep | ( | morphism * | M | ) |
Computation of list of representative idempotents for the morphism.
Copy the alphabet of a morphism.
M | The morphism. |
Returns the graph of a single R-class.
M | The morphism. |
rcl | The index of the R-class. |
Retrieves the index of a letter in the alphabet of a morphism.
M | The morphism. |
l | The letter. |
Computation of the mirror of the left Cayley graph.
M | The morphism. |
uint mor_mult | ( | morphism * | M, |
uint | s, | ||
uint | t ) |
Multiplication of two elements.
M | The morphism. |
s | First element. |
t | Second element. |
uint mor_mult_gen | ( | morphism * | M, |
uint | n, | ||
... ) |
Multiplication of an arbitrary number of elements.
M | The morphism. |
n | The number of elements to multiply. |
... | The elements. |
Return the name of an element (product of generators) in a dequeue.
M | The morphism. |
q | The element. |
bool mor_neutral_letter | ( | morphism * | M, |
FILE * | out ) |
Tests if there exists a letter mapped to the neutral element.
M | The morphism. |
out | The stream (NULL if no display is desired). |
bool mor_nonempty_neutral | ( | morphism * | M | ) |
Tests if there exists a nonempty antecedent of the neutral element in a morphism.
M | The morphism. |
bool mor_num_idem | ( | morphism * | M, |
uint | s, | ||
uint * | res ) |
Computes the index of an idempotent element.
Returns false if the element given as input is not an idempotent. The index is returned using the third parameter.
M | The morphism. |
s | The element. |
res | A pointer used to return the index of the idempotent. |
uint mor_omega | ( | morphism * | M, |
uint | s ) |
Computes the omega power of an element.
M | The morphism. |
s | The element. |
Computation of the mirror of the right Cayley graph.
M | The morphism. |