Hypothesis (language regularity) and algorithm (Lgraph to NFA) in TOC (original) (raw)

Last Updated : 10 Mar, 2026

L-graphs can generate context-sensitive languages, but programming such languages is more difficult than programming regular languages. Therefore, a hypothesis is proposed to identify the type of L-graphs that generate regular languages.A nest is a neutral path T₁ T₂ T₃ where T₁ and T₃ are cycles and T₂ is a neutral path connecting them. This path is called an iterating nest if all three paths print repetitions of the same string α.

Points defining an iterating nest:

  1. T₁ prints αᵏ
  2. T₂ prints αˡ
  3. T₃ prints αᵐ
  4. k, l, m ≥ 0
  5. α is a string of input symbols
  6. At least one of k, l, or m should be ≥ 1

Hypothesis: If all nests in a context-free L-graph G are iterating nests, then the language L(G) generated by G is a regular language. Based on this hypothesis, such L-graphs can be converted into an equivalent NFA.

So that every step above is clear I’m showing you the next example. \textbf{Example:}\\ \textbf{Input:} Context free L-graph with iterating complements G = ( \{a, b, c\}, \\*\{1, 2, 3\} \\*\{( (, ) ), ( [, ] )\}, \\*\\*\{ (: \{ 1 – a – 1 \}, \\*): \{ 2 – a – 2 \}, \\*\big[: \{ 1 – b – 2 \}, \\*\big]: \{ 2 – c – 3 \}, \\*\varepsilon: \{ 1 – a – 2 \} \}, \\*\\*1, \\*\{2, 3\} \} , which determines the language = \{a^(^2^n^+^1^) | n \geqslant 0\} \cup \{bc\} Start graph G \Sigma'' = \{a, b, c\}\\ V’’ = \varnothing\\ \lambda’’ = \varnothing Core(1, 1) = { 1 – a – 2 ; 1 – a, (1 – 1 – a – 2 – a, )1 – 2 ; 1 – b, (2 – 2 – c, )2 – 3 } Core(1, 2) = Core(1, 1) \cup { 1 – a, (1 – 1 – a, (1 – 1 – a – 2 – a, )1 – 2 – a, )1 – 2 } Step 2: Step 1’ – Step 3’ \Rightarrow\\ V’’ = \{(1, \varepsilon), (2, (_2), (3, \varepsilon), (1, (_1), (2, )_1), (2, \varepsilon)\}\\* \lambda’’ = \{ \\*(: \{ (1, \varepsilon) – a – (1, (); (1, () – a – (1, () \}, \\*): \{ (2, )) – a – (2, )); (2, )) – a – (2, \varepsilon) \}, \\*\big[: \{ (1, \varepsilon) – b – (2, [) \}, \\*\big]: \{ (2, [) – c – (3, \varepsilon) \}, \\*\varepsilon: \{ (1, \varepsilon) – a – (2, \varepsilon); (1, () – a – (2, )) \} \}\\ P’’_0 = (1, \varepsilon)\\ F’’ = \{(2, \varepsilon), (3, \varepsilon)\}\\ G’’ = (\Sigma’’, V’’, P’’, \lambda’’, P’’_0, F’’) Intermediate graph G’’ \Sigma’ = \{a, b, c\}\\ V’ = V’’ \cup \{4\}\\ P’_0 = P’’_0\\ F’ = F’’\\ \lambda’ = \{ \\*(1, \varepsilon) – a – (1, (); \\*(2, )) – a – 4; \\*4 – a – (2, )); \\*(2, )) – a – (2, \varepsilon); \\*(1, \varepsilon) – b – (2, [); \\*(2, [) – c – (3, \varepsilon); \\*(1, \varepsilon) – a – (2, \varepsilon); \\*(1, () – a – (2, )) \}\\ G’ = (\Sigma’, V’, \lambda’, P’_0, F’) NFA G’

Advantages of hypotheses

Disadvantages of hypotheses