Skip to content

DET Module

gustavo-toro edited this page Apr 16, 2024 · 1 revision

DET module

The DET module is in charge of the determinization of the extended VA. It is defined in src/rematch/evaluation/extended_va/dfa.

Extended Det VA

The extended det VA represents the deterministic extended VA, which is the automaton evaluated by the algorithm. It is defined in extended_det_va.hpp.

The constructor of the extended det VA creates the initial state which is a set containing only the initial state of the non-deterministic extended VA.

The function get_next_states takes a extended det VA state and a char as input, and returns a vector of capture subset pairs. These pairs contain a code representing the opening or closing variables and an extended det VA state. This function has 2 steps. First, it computes the subset of non-deterministic states and the captures. Second, it converts the subset to a deterministic state.

If the resulting vector contains a pair with an empty capture, a code that represents 0 variable markers, then that pair is in the first position of the vector. By doing this, the algorithm can easily process this case first.

Additionally, the next states are cached, so that when the same state and char is passed to the function, it does not need to compute the states again. It just returns the cached result.

Clone this wiki locally