TaPAS
0.2
|
Data Structures | |
struct | sataf_mao_methods_st |
Structure gathering the methods applied to a Marked Automaton Object. More... | |
Typedefs | |
typedef struct sataf_mao_st | sataf_mao |
Type of a Marked Automaton Object (MAO). More... | |
typedef struct sataf_mao_methods_st | sataf_mao_methods |
Type of the data structure gathering methods that a Marked Automaton Object has to implement. This structure can be embedded in a larger one (as the first field) in order to create an inheritance of class interfaces. | |
Functions | |
sataf_mao * | sataf_mao_create (size_t size, const sataf_mao_methods *methods) |
Allocation and initialization of a MAO. More... | |
static sataf_mao * | sataf_mao_add_reference (sataf_mao *a) |
Increments the number of references to this MAP. More... | |
static void | sataf_mao_del_reference (sataf_mao *a) |
Decrements the number of references to the given MAO. More... | |
char * | sataf_mao_to_string (sataf_mao *self) |
Translate the MAO into a human readable form. More... | |
static const char * | sataf_mao_get_type (sataf_mao *self) |
Return the type of the MAO self. More... | |
void | sataf_mao_is_root_of_scc (sataf_mao *self, sataf_sa *sa, int q0) |
Notify the MAO that it has been identified as the root of a SCC. More... | |
int | sataf_mao_no_cache (sataf_mao *self) |
Return if caching this object is interesting or not. More... | |
sataf_msa * | sataf_mao_simplify (sataf_mao *self) |
Return the MSA corresponding to the MAO self if it is computable without the canonization algorithm. This function returns the result of the simplify method if it is implemented or NULL if not. More... | |
uint32_t | sataf_mao_get_alphabet_size (sataf_mao *self) |
The size of the alphabet used by self. More... | |
sataf_mao * | sataf_mao_succ (sataf_mao *self, uint32_t letter) |
Return the successor MAO of self by letter. More... | |
int | sataf_mao_is_final (sataf_mao *self) |
Return if the Marked Automaton is accepting. More... | |
int | sataf_mao_equals (sataf_mao *self, sataf_mao *other) |
Check if two MAO are equal. More... | |
unsigned int | sataf_mao_hashcode (sataf_mao *self) |
Compute an hashcode for this MAO. More... | |
void | sataf_mao_to_dot (ccl_log_type log, sataf_mao *self, const char **alphabet, const char *graph_name, const char *graph_type) |
Display a MAO in DOT file format. More... | |
void | sataf_mao_default_to_dot (ccl_log_type log, sataf_mao *self, const char **alphabet, const char *graph_name, const char *graph_type) |
Display a MAO in DOT file format. More... | |
sataf_mao * | sataf_mao_create_zero (uint32_t alphabet_size) |
Create a MAO encoding the empty language for a reference alphabet of size alphabet_size. More... | |
sataf_mao * | sataf_mao_create_one (uint32_t alphabet_size) |
Create a MAO recognizing . More... | |
sataf_mao * | sataf_mao_create_epsilon (uint32_t alphabet_size) |
Create a MAO recognizing the singleton for a reference alphabet of size alphabet_size. More... | |
sataf_mao * | sataf_mao_create_letter (uint32_t alphabet_size, uint32_t a) |
Create a MAO recognizing the singleton for a reference alphabet of size alphabet_size and one of its letter a. More... | |
sataf_mao * | sataf_mao_create_alphabet (uint32_t alphabet_size) |
Create a MAO recognizing the entire alphabet that has a size equal to alphabet_size. More... | |
sataf_mao * | sataf_mao_create_from_arrays (uint32_t nb_states, uint32_t alphabet_size, uint32_t s0, const uint8_t *is_final, const uint32_t *succ) |
Create a MAO encoding an automaton given its transition function and its acceptance condition. More... | |
sataf_mao * | sataf_mao_create_ite (sataf_mao *i, sataf_mao *t, sataf_mao *e) |
Create a MAO encoding the language if-then-else(i,t,e) More... | |
sataf_mao * | sataf_mao_create_not (sataf_mao *a) |
Create a MAO encoding the complement of a. More... | |
sataf_mao * | sataf_mao_create_or (sataf_mao *a1, sataf_mao *a2) |
Create a MAO encoding the union of two languages. More... | |
sataf_mao * | sataf_mao_create_and (sataf_mao *a1, sataf_mao *a2) |
Create a MAO encoding the intersection of two languages. More... | |
sataf_mao * | sataf_mao_create_multi_or (ccl_list *operands) |
Create a MAO encoding the union of a finite set of languages. More... | |
sataf_mao * | sataf_mao_create_multi_and (ccl_list *operands) |
Create a MAO encoding the intersection of a finite set of languages. More... | |
sataf_mao * | sataf_mao_create_imply (sataf_mao *a1, sataf_mao *a2) |
Create a MAO encoding . More... | |
sataf_mao * | sataf_mao_create_equiv (sataf_mao *a1, sataf_mao *a2) |
Create a MAO encoding . More... | |
sataf_mao * | sataf_mao_create_forall (sataf_mao *a) |
Create a MAO encoding the intersection of residues of . More... | |
sataf_mao * | sataf_mao_create_exists (sataf_mao *a) |
Create a MAO encoding the union of residues of . More... | |
sataf_mao_memorizer * | sataf_mao_memorizer_create (size_t memo_size, sataf_mao_memo_init_proc *init, void *init_data, sataf_mao_memo_clean_proc *clean) |
Create a new memorizer. More... | |
typedef struct sataf_mao_st sataf_mao |
Increments the number of references to this MAP.
This macro increments the counter of references of the considered object and returns the address of the object.
a | the referenced MAO |
sataf_mao* sataf_mao_create | ( | size_t | size, |
const sataf_mao_methods * | methods | ||
) |
Allocation and initialization of a MAO.
size | the size in bytes required to store the object |
methods | the pointers to the MAO methods |
sataf_mao* sataf_mao_create_alphabet | ( | uint32_t | alphabet_size | ) |
Create a MAO recognizing the entire alphabet that has a size equal to alphabet_size.
alphabet_size | the size of the alphabet |
Create a MAO encoding the intersection of two languages.
a1 | the first language |
a2 | the second language |
sataf_mao* sataf_mao_create_epsilon | ( | uint32_t | alphabet_size | ) |
Create a MAO recognizing the singleton for a reference alphabet of size alphabet_size.
alphabet_size | the size of the alphabet |
Create a MAO encoding .
a1 | the first MAO argument |
a2 | the first MAO argument |
Create a MAO encoding the union of residues of .
a | the MAO argument |
Create a MAO encoding the intersection of residues of .
a | the MAO argument |
sataf_mao* sataf_mao_create_from_arrays | ( | uint32_t | nb_states, |
uint32_t | alphabet_size, | ||
uint32_t | s0, | ||
const uint8_t * | is_final, | ||
const uint32_t * | succ | ||
) |
Create a MAO encoding an automaton given its transition function and its acceptance condition.
This function creates a MAO encoding an automaton with nb_states, recognizing from the state s0 words over an alphabet of size alphabet_size. The acceptance condition is given by an array of Booleans is_final: the state i is accepting iff "is_final[i]" is non-null. The transition function of the resulting automaton is given by the array succ of size nb_states alphabet_size and such that succ[s alphabet_size+a] is the successor of the state s by the letter a.
alphabet_size | the size of the reference alphabet |
is_final | the acceptance condition |
nb_states | the number of states if the automaton |
s0 | the index of the initial state |
succ | the transition function |
Create a MAO encoding .
a1 | the first MAO argument |
a2 | the first MAO argument |
Create a MAO encoding the language if-then-else(i,t,e)
i | the 'if' argument |
t | the 'then' argument |
e | the 'else' argument |
sataf_mao* sataf_mao_create_letter | ( | uint32_t | alphabet_size, |
uint32_t | a | ||
) |
Create a MAO recognizing the singleton for a reference alphabet of size alphabet_size and one of its letter a.
alphabet_size | the size of the alphabet |
a | the recognized letter |
Create a MAO encoding the intersection of a finite set of languages.
operands | the set of languages |
Create a MAO encoding the union of a finite set of languages.
operands | the set of languages |
Create a MAO encoding the complement of a.
a | the complemented MAO |
sataf_mao* sataf_mao_create_one | ( | uint32_t | alphabet_size | ) |
Create a MAO recognizing .
alphabet_size | the size of the alphabet |
Create a MAO encoding the union of two languages.
a1 | the first language |
a2 | the second language |
sataf_mao* sataf_mao_create_zero | ( | uint32_t | alphabet_size | ) |
Create a MAO encoding the empty language for a reference alphabet of size alphabet_size.
alphabet_size | the size of the reference alphabet |
void sataf_mao_default_to_dot | ( | ccl_log_type | log, |
sataf_mao * | self, | ||
const char ** | alphabet, | ||
const char * | graph_name, | ||
const char * | graph_type | ||
) |
Display a MAO in DOT file format.
The nodes are labelled by the result of the to_string method; if this one is not implemented then a unique integer is used. The array alphabet is used to label transition; if the array is NULL then the index of the letter is used.
log | the CCL output stream |
self | the MAO translated into DOT |
alphabet | an array of strings used as letters |
graph_name | used to name the graph in the DOT file format |
graph_type | the DOT keyword defining the type of the graph (digraph or graph). |
|
inlinestatic |
Decrements the number of references to the given MAO.
This macro decrements the counter of references of the considered object. If this counter falls to zero then, if it is implemented, the destroy method is called on the object. The memory occupied by the object is then freed.
a | the dereferenced MAO |
Check if two MAO are equal.
Two MAOs are equal:
self | the MAO argument |
other | the MAO argument |
uint32_t sataf_mao_get_alphabet_size | ( | sataf_mao * | self | ) |
The size of the alphabet used by self.
self | the MAO argument |
|
inlinestatic |
Return the type of the MAO self.
The type of a MAO is a constant string assigned to the static member type of the object. This type is used to compare objects (see sataf_mao_equals).
self | the MAO argument |
unsigned int sataf_mao_hashcode | ( | sataf_mao * | self | ) |
Compute an hashcode for this MAO.
If the MAO does not implement the hashcode function the address self is returned.
self | the MAO argument |
int sataf_mao_is_final | ( | sataf_mao * | self | ) |
Return if the Marked Automaton is accepting.
self | the MAO argument |
Notify the MAO that it has been identified as the root of a SCC.
This method indicates to the implementation of the MAO that the sharing algorithm has identified this node to be the root of some SCC i.e. a shared automaton.
self | the MAO argument |
sa | the shared automaton pointing the SCC |
q0 | the entry point in the SCC |
sataf_mao_memorizer* sataf_mao_memorizer_create | ( | size_t | memo_size, |
sataf_mao_memo_init_proc * | init, | ||
void * | init_data, | ||
sataf_mao_memo_clean_proc * | clean | ||
) |
Create a new memorizer.
memo_size | the size of the entries |
init | a pointer to the function initializing entries |
init_data | a pointer to data used bu the init function |
clean | a pointer to a function used to free resources allocated to an entry. |
int sataf_mao_no_cache | ( | sataf_mao * | self | ) |
Return if caching this object is interesting or not.
This function returns the result of the no_cache method or 0 if it is no implemented.
self | the MAO argument |
Return the MSA corresponding to the MAO self if it is computable without the canonization algorithm. This function returns the result of the simplify method if it is implemented or NULL if not.
self | the simplified MAO |
Return the successor MAO of self by letter.
self | the MAO argument |
letter | the letter labelling the transition |
void sataf_mao_to_dot | ( | ccl_log_type | log, |
sataf_mao * | self, | ||
const char ** | alphabet, | ||
const char * | graph_name, | ||
const char * | graph_type | ||
) |
Display a MAO in DOT file format.
If the object does not implement the to_dot method then the sataf_mao_default_to_dot is called.
log | the CCL output stream |
self | the MAO translated into DOT |
alphabet | an array of strings used as letters |
graph_name | used to name the graph in the DOT file format |
graph_type | the DOT keyword defining the type of the graph (digraph or graph). |
char* sataf_mao_to_string | ( | sataf_mao * | self | ) |
Translate the MAO into a human readable form.
This funciton returns the result of the to_string method applied to self. If the MAO does not implement it then the string "\a type@ \a addr" is returned, where type is the result of sataf_mao_get_type and addr is the address of self.
self | the MAO argument |