forgex_nfa_state_set_m Module

forgex_nfa_m module defines a derived-type which is the set of NFA nodes. nfa_state_set_t represents a set of NFA nodes for the power set construction method.



Derived Types

type, public ::  nfa_state_set_t

The nfa_state_set_t type represents set of NFA states.

Components

Type Visibility Attributes Name Initial
logical, public, allocatable :: vec(:)

Functions

public pure function check_nfa_state(state_set, state_index)

This function checks if the arguement 'state' (set of NFA state) includes state 's'.

Arguments

Type IntentOptional Attributes Name
type(nfa_state_set_t), intent(in) :: state_set
integer(kind=int32), intent(in) :: state_index

Return Value logical

public pure elemental function equivalent_nfa_state_set(a, b) result(res)

This function determines if two NFA state sets (logical vectors) are equivalent.

Read more…

Arguments

Type IntentOptional Attributes Name
type(nfa_state_set_t), intent(in) :: a
type(nfa_state_set_t), intent(in) :: b

Return Value logical


Subroutines

public pure subroutine add_nfa_state(state_set, s)

This subroutine adds a specified state (s) to an NFA state set state_set by setting the corresponding element in state%vec to true.

Arguments

Type IntentOptional Attributes Name
type(nfa_state_set_t), intent(inout) :: state_set
integer(kind=int32), intent(in) :: s

public pure subroutine collect_epsilon_transition(nfa_graph, nfa_top, nfa_set)

This subroutine collects all states reachable by empty transition starting from a given state set in an NFA.

Arguments

Type IntentOptional Attributes Name
type(nfa_state_node_t), intent(in) :: nfa_graph(:)
integer(kind=int32), intent(in) :: nfa_top
type(nfa_state_set_t), intent(inout) :: nfa_set

public pure subroutine init_state_set(state_set, ntop)

Arguments

Type IntentOptional Attributes Name
type(nfa_state_set_t), intent(inout) :: state_set
integer(kind=int32), intent(in) :: ntop

public subroutine print_nfa_state_set(set, top, uni)

Arguments

Type IntentOptional Attributes Name
type(nfa_state_set_t), intent(in) :: set
integer(kind=int32), intent(in) :: top
integer(kind=int32), intent(in) :: uni

private pure recursive subroutine mark_epsilon_transition(nfa_graph, nfa_top, nfa_set, nfa_i)

This subroutine recursively marks empty transitions from a given NFA state index.

Arguments

Type IntentOptional Attributes Name
type(nfa_state_node_t), intent(in) :: nfa_graph(NFA_STATE_BASE:NFA_STATE_LIMIT)
integer(kind=int32), intent(in) :: nfa_top
type(nfa_state_set_t), intent(inout) :: nfa_set
integer(kind=int32), intent(in) :: nfa_i