2p/srclib/minimiza.c
/**
    __update_acc (private function)
    Input:
        uint8_t ***trans_tb: original dfa transition table
        size_t nstates: number of states in trans_tb
        uint8_t state: current state to update accesibility
        size_t alph_sz: alphabet size
        uint8_t *acc: array of accesible states (indexes)
        stack *stack_acc: stack which we'll pop states from, in order to explore them

    Returns:
        void

    Advanced description:
        Pushes to the stack all the states that can be transversed from -state-,
        if they have not been pushed before.
*/


void

Advanced description:
Pushes to the stack all the states that can be transversed from -state-,
if they have not been pushed before.
void Advanced description : Pushes to the stack all the states that can be transversed from - state - if they have not been pushed before .
void __update_acc(uint8_t ***trans_tb, size_t nstates, uint8_t state, size_t alph_sz, uint8_t *acc, stack *stack_acc){
    for (size_t sym = 0; sym < alph_sz; sym++) {
        for (uint8_t j = 0; j < nstates; j++) {
            if(trans_tb[state][sym][j]){
                if (!acc[j]){
                    acc[j] = 1;
                    stack_push(stack_acc, &j);
                }
                break;
            }
        }
    }
}
void __update_acc ( uint8_t * * * trans_tb , size_t nstates , uint8_t state , size_t alph_sz , uint8_t * acc , stack * stack_acc ) { for ( size_t sym = 0 ; sym < alph_sz ; sym ++ ) { for ( uint8_t j = 0 ; j < nstates ; j ++ ) { if ( trans_tb [ state ] [ sym ] [ j ] ) { if ( ! acc [ j ] ) { acc [ j ] = 1 ; stack_push ( stack_acc , & j ) ; } break ; } } } }
__update_acc (private function)
Input:
uint8_t ***trans_tb: original dfa transition table
size_t nstates: number of states in trans_tb
uint8_t state: current state to update accesibility
size_t alph_sz: alphabet size
uint8_t *acc: array of accesible states (indexes)
stack *stack_acc: stack which we'll pop states from, in order to explore them
__update_acc ( private function ) Input : uint8_t *** trans_tb : original dfa transition table size_t nstates : number of states in trans_tb uint8_t state : current state to update accesibility size_t alph_sz : alphabet size uint8_t * acc : array of accesible states ( indexes ) stack * stack_acc : stack which we ' ll pop states from in order to explore them
// There is a transition from current state to state j with symbol sym
 // Setting state j as accesible
 // Since its accesible, it is inserted into the stack
 // to explore it later
