History_Fa Documentation

This page contains the History_Fa Package documentation.

The history_fa Module

class netbench.pattern_match.algorithms.history_fa.history_fa.HistoryFA

Bases: netbench.pattern_match.b_dfa.b_dfa

Class for HistoryFA.

Based on

For how to use this class see ‘example_of_use.py’ or look inside tests correctly method compute().

compute(NFA)

Fuction for make HistoryFA.

Parameter:NFA (nfa_data) – NFA
Rises deterministic_error:
 Automat must be Deterministic before calling compute()
report_memory_naive()

Report consumed memory in bytes. Naive mapping algorithm is used (2D array). Basic algorithm for this variant of mapping is: M = |states| * |alphabet| * ceil(log(|states| + 1, 2) / 8) For History is: basic + Mem(Flags) + (State * Sym * Flags * 2)

Returns:Returns number of bytes.
Return type:int
report_memory_optimal()

Report consumed memory in bytes. Optimal mapping algorithm is used (with oracle). Basic algorithm for this variant of mapping is: M = |transitions| * ceil(log(|states|, 2) / 8). For History is: basic + Mem(Flags) + (Tran*Flags*2).

Returns:Returns number of bytes.
Return type:int
search(input_string)

This function will find patterns in the given string by the approach.

Parameters:
  • input_string – Input string.
  • input_string – string
Returns:

Bitmap of matched regular expressions.

Return type:

list(int)

The test_history_fa Module

class netbench.pattern_match.algorithms.history_fa.test_history_fa.test_HistoryFA(methodName='runTest')

Bases: unittest.TestCase

Test module for class HistoryFA.

test__discover_closure_states()
_discover_closure_states(NFA)
test__identify_fading_states()
_identify_fading_states(nfa_closure_states)
test__pruning_process()
_pruning_process()
test__remove_fading_dfa_states()
_remove_fading_dfa_states(dfa_fading_states)
test_compute()
compute()
test_report_memory_naive()
report_memory_naive()
test_report_memory_optimal()
report_memory_optimal()
search()

Table Of Contents

Previous topic

Clark_Nfa Documentation

Next topic

Hybrid_Fa Documentation

This Page