From 79c0dd3c98b8522d37eb12515b1c7e2794414615 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 11 Feb 2026 01:47:48 +0300 Subject: [PATCH 01/71] Add Regexp-Regexp Concat operator for Grammar DSL --- .../org/ucfs/grammar/combinator/extension/StringExtension.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt b/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt index 738cfc41a..8b4154f9e 100644 --- a/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt +++ b/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt @@ -12,6 +12,7 @@ object StringExtension { .fold(initial) { acc: Regexp, i: Term -> Alternative.makeAlternative(acc, i) } } infix operator fun Regexp.times(other: String): Concat = Concat(head = this, Term(other)) + infix operator fun Regexp.times(other: Regexp): Concat = Concat(head = this, other) infix operator fun String.times(other: String): Concat = Concat(head = Term(this), Term(other)) infix operator fun String.times(other: Regexp): Concat = Concat(head = Term(this), other) From 36a33ce238c64b4d6e421a75db1561b893084bef Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 11 Feb 2026 01:54:30 +0300 Subject: [PATCH 02/71] Add paths extraction app --- cfpq-app/build.gradle.kts | 21 +++++++ cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 70 +++++++++++++++++++++ cfpq-app/src/main/resources/graph_1.dot | 12 ++++ settings.gradle.kts | 3 +- 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 cfpq-app/build.gradle.kts create mode 100644 cfpq-app/src/main/kotlin/me/vkutuev/Main.kt create mode 100644 cfpq-app/src/main/resources/graph_1.dot diff --git a/cfpq-app/build.gradle.kts b/cfpq-app/build.gradle.kts new file mode 100644 index 000000000..d7c338601 --- /dev/null +++ b/cfpq-app/build.gradle.kts @@ -0,0 +1,21 @@ +plugins { + kotlin("jvm") version "2.3.0" + application +} + +repositories { + mavenCentral() +} + +dependencies { + implementation(kotlin("stdlib")) + implementation(project(":solver")) +} + +kotlin { + jvmToolchain(11) +} + +application { + mainClass = "me.vkutuev.MainKt" +} diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt new file mode 100644 index 000000000..282703535 --- /dev/null +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -0,0 +1,70 @@ +package me.vkutuev + +import org.ucfs.grammar.combinator.Grammar +import org.ucfs.grammar.combinator.extension.StringExtension.many +import org.ucfs.grammar.combinator.extension.StringExtension.or +import org.ucfs.grammar.combinator.extension.StringExtension.times +import org.ucfs.grammar.combinator.regexp.Nt +import org.ucfs.grammar.combinator.regexp.many +import org.ucfs.input.DotParser +import org.ucfs.input.InputGraph +import org.ucfs.input.TerminalInputLabel +import org.ucfs.parser.Gll +import org.ucfs.sppf.node.* + +data class Input(val graphDot: String, val grammar: Grammar) + +class RequestGrammar : Grammar() { + val S by Nt().asStart() + val R by Nt(many("assign_r" or "load_0_r" or "load_1_r")) + + init { + S /= many("assign") * many(R * ("store_0" or "store_1")) * "pt" + } +} + +fun getInput(name: String): InputGraph { + val dotGraph = object {}.javaClass.getResource("/$name")?.readText() + ?: throw RuntimeException("File $name not found in resources") + val dotParser = DotParser() + return dotParser.parseDot(dotGraph) +} + +data class OutEgde(val start: Int, val symbol: String, val end: Int) + +fun getPathFromSppf(node: RangeSppfNode): List { + when (val nodeType = node.type) { + is TerminalType<*> -> { + val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") + return listOf(OutEgde(range.from, nodeType.terminal.toString(), range.to)) + } + + is NonterminalType if nodeType.startState.nonterminal.name == "R" -> { + val range = node.inputRange ?: throw RuntimeException("Null inputRange for R Nonterminal node of SPPF") + return listOf(OutEgde(range.from, "R", range.to)) + } + + is EpsilonNonterminalType -> { + return emptyList() + } + + is EmptyType -> { + throw RuntimeException("SPPF cannot contain EmptyRange") + } + + else -> { + return node.children.flatMap { getPathFromSppf(it) } + } + } +} + +fun main() { + val graph = getInput("graph_1.dot") + val grammar = RequestGrammar() + val gll = Gll.gll(grammar.rsm, graph) + val sppf = gll.parse() + println("Result length ${sppf.size}") + sppf.forEach { + println(getPathFromSppf(it).toString()) + } +} diff --git a/cfpq-app/src/main/resources/graph_1.dot b/cfpq-app/src/main/resources/graph_1.dot new file mode 100644 index 000000000..171c4f28d --- /dev/null +++ b/cfpq-app/src/main/resources/graph_1.dot @@ -0,0 +1,12 @@ +digraph { + start -> 1; + 1 -> 0 [label = "pt"]; + 2 -> 1 [label = "assign"]; + 1 -> 2 [label = "assign_r"]; + 2 -> 3 [label = "store_0"]; + 3 -> 4 [label = "pt"]; + 5 -> 3 [label = "assign"]; + 3 -> 5 [label = "assign_r"]; + 5 -> 6 [label = "store_1"]; + 6 -> 7 [label = "pt"]; +} diff --git a/settings.gradle.kts b/settings.gradle.kts index a77d71c5f..3e92e4f30 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,4 +4,5 @@ plugins { rootProject.name = "ucfs" include("solver") include("generator") -include("test-shared") \ No newline at end of file +include("test-shared") +include("cfpq-app") From 5ece2aeceb656906bf6bed7db170632e992c7be5 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 11 Feb 2026 02:51:36 +0300 Subject: [PATCH 03/71] Add more examples --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 50 ++++++++++++++++----- cfpq-app/src/main/resources/graph_2.dot | 12 +++++ cfpq-app/src/main/resources/graph_3.dot | 9 ++++ 3 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 cfpq-app/src/main/resources/graph_2.dot create mode 100644 cfpq-app/src/main/resources/graph_3.dot diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 282703535..2c28510b5 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -10,11 +10,15 @@ import org.ucfs.input.DotParser import org.ucfs.input.InputGraph import org.ucfs.input.TerminalInputLabel import org.ucfs.parser.Gll +import org.ucfs.sppf.getSppfDot import org.ucfs.sppf.node.* +import java.nio.file.Files +import java.nio.file.Path +import kotlin.collections.flatten data class Input(val graphDot: String, val grammar: Grammar) -class RequestGrammar : Grammar() { +class PointsToGrammar : Grammar() { val S by Nt().asStart() val R by Nt(many("assign_r" or "load_0_r" or "load_1_r")) @@ -23,7 +27,7 @@ class RequestGrammar : Grammar() { } } -fun getInput(name: String): InputGraph { +fun readGraph(name: String): InputGraph { val dotGraph = object {}.javaClass.getResource("/$name")?.readText() ?: throw RuntimeException("File $name not found in resources") val dotParser = DotParser() @@ -32,7 +36,10 @@ fun getInput(name: String): InputGraph { data class OutEgde(val start: Int, val symbol: String, val end: Int) -fun getPathFromSppf(node: RangeSppfNode): List { +fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List? { + if (maxDepth == 0) { + return null + } when (val nodeType = node.type) { is TerminalType<*> -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") @@ -52,19 +59,40 @@ fun getPathFromSppf(node: RangeSppfNode): List { throw RuntimeException("SPPF cannot contain EmptyRange") } + is IntermediateType<*>, is NonterminalType -> { + val subPaths = node.children.map { getPathFromSppf(it, maxDepth - 1) } + if (subPaths.any { it == null }) { + return null + } + return subPaths.filterNotNull().flatten() + } + + is Range -> { + node.children.forEach { + getPathFromSppf(it, maxDepth - 1)?.let { path -> + return@getPathFromSppf path + } + } + return null + } + else -> { - return node.children.flatMap { getPathFromSppf(it) } + println("Type of node is ${node.type.javaClass}") + throw RuntimeException("Unknown RangeType in SPPF") } } } fun main() { - val graph = getInput("graph_1.dot") - val grammar = RequestGrammar() - val gll = Gll.gll(grammar.rsm, graph) - val sppf = gll.parse() - println("Result length ${sppf.size}") - sppf.forEach { - println(getPathFromSppf(it).toString()) + listOf("graph_1.dot", "graph_2.dot", "graph_3.dot").forEach { graphName -> + val graph = readGraph(graphName) + val grammar = PointsToGrammar() + val gll = Gll.gll(grammar.rsm, graph) + val sppf = gll.parse() + println("Founded paths in $graphName") + sppf.forEach { + println(getPathFromSppf(it, maxDepth = 10).toString()) + } + println() } } diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-app/src/main/resources/graph_2.dot new file mode 100644 index 000000000..69bb715ea --- /dev/null +++ b/cfpq-app/src/main/resources/graph_2.dot @@ -0,0 +1,12 @@ +digraph { + start -> 0; + 0 -> 1 [label = "pt"]; + 2 -> 0 [label = "assign"]; + 0 -> 2 [label = "assign_r"]; + 2 -> 3 [label = "store_0"]; + 3 -> 4 [label = "pt"]; + 2 -> 5 [label = "assign"]; + 5 -> 2 [label = "assign_r"]; + 5 -> 2 [label = "load_0"]; + 2 -> 5 [label = "load_0_r"]; +} diff --git a/cfpq-app/src/main/resources/graph_3.dot b/cfpq-app/src/main/resources/graph_3.dot new file mode 100644 index 000000000..7684868c8 --- /dev/null +++ b/cfpq-app/src/main/resources/graph_3.dot @@ -0,0 +1,9 @@ +digraph { + start -> 0; + 1 -> 0 [label = "assign"]; + 0 -> 1 [label = "assign_r"]; + 1 -> 2 [label = "store_0"]; + 1 -> 2 [label = "assign"]; + 2 -> 1 [label = "assign_r"]; + 2 -> 3 [label = "pt"]; +} From 38dd6a033fda1268f108c3c6db4e3e0e00025d28 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 11 Feb 2026 03:02:15 +0300 Subject: [PATCH 04/71] Optimize imports in path extractor --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 2c28510b5..9f721bbff 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -10,11 +10,7 @@ import org.ucfs.input.DotParser import org.ucfs.input.InputGraph import org.ucfs.input.TerminalInputLabel import org.ucfs.parser.Gll -import org.ucfs.sppf.getSppfDot import org.ucfs.sppf.node.* -import java.nio.file.Files -import java.nio.file.Path -import kotlin.collections.flatten data class Input(val graphDot: String, val grammar: Grammar) From 8672268026d53d3f8e6b7152a35725e7d56f8aaf Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 11 Feb 2026 03:05:10 +0300 Subject: [PATCH 05/71] Remove unneeded class in path extractor --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 9f721bbff..176e8b261 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -12,8 +12,6 @@ import org.ucfs.input.TerminalInputLabel import org.ucfs.parser.Gll import org.ucfs.sppf.node.* -data class Input(val graphDot: String, val grammar: Grammar) - class PointsToGrammar : Grammar() { val S by Nt().asStart() val R by Nt(many("assign_r" or "load_0_r" or "load_1_r")) From 573f321ef96b08220a1282034512a5993d60ed43 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 11 Feb 2026 11:51:55 +0300 Subject: [PATCH 06/71] Add sppf saving to path extractor --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 176e8b261..6f83a5df8 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -10,7 +10,10 @@ import org.ucfs.input.DotParser import org.ucfs.input.InputGraph import org.ucfs.input.TerminalInputLabel import org.ucfs.parser.Gll +import org.ucfs.sppf.getSppfDot import org.ucfs.sppf.node.* +import java.nio.file.Files +import java.nio.file.Path class PointsToGrammar : Grammar() { val S by Nt().asStart() @@ -77,6 +80,17 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List? { } } +fun saveSppf(name: String, sppf: Set>) { + val graphName = name.removeSuffix(".dot") + val genPath = Path.of("gen", "sppf") + Files.createDirectories(genPath) + val file = genPath.resolve("${graphName}_sppf.dot").toFile() + + file.printWriter().use { out -> + out.println(getSppfDot(sppf)) + } +} + fun main() { listOf("graph_1.dot", "graph_2.dot", "graph_3.dot").forEach { graphName -> val graph = readGraph(graphName) @@ -88,5 +102,6 @@ fun main() { println(getPathFromSppf(it, maxDepth = 10).toString()) } println() + saveSppf(graphName, sppf) } } From 7e7ea1156cfd35c24197a65cfaf5dc00914cda4c Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 15:40:17 +0300 Subject: [PATCH 07/71] Corrected grammar. More examples. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 9 ++--- cfpq-app/src/main/resources/graph_2.dot | 8 +++++ cfpq-app/src/main/resources/graph_4.dot | 37 +++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 cfpq-app/src/main/resources/graph_4.dot diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 6f83a5df8..43bb861ae 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -5,6 +5,7 @@ import org.ucfs.grammar.combinator.extension.StringExtension.many import org.ucfs.grammar.combinator.extension.StringExtension.or import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt +import org.ucfs.grammar.combinator.regexp.Option import org.ucfs.grammar.combinator.regexp.many import org.ucfs.input.DotParser import org.ucfs.input.InputGraph @@ -17,10 +18,10 @@ import java.nio.file.Path class PointsToGrammar : Grammar() { val S by Nt().asStart() - val R by Nt(many("assign_r" or "load_0_r" or "load_1_r")) + val R by Nt(Option("pt" * "pt_r")) init { - S /= many("assign") * many(R * ("store_0" or "store_1")) * "pt" + S /= R * many("assign_r" * ("store_0" or "store_1" or "store_2" or "store_3")) * "pt" } } @@ -92,14 +93,14 @@ fun saveSppf(name: String, sppf: Set>) { } fun main() { - listOf("graph_1.dot", "graph_2.dot", "graph_3.dot").forEach { graphName -> + listOf("graph_1.dot", "graph_2.dot", "graph_3.dot", "graph_4.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToGrammar() val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() println("Founded paths in $graphName") sppf.forEach { - println(getPathFromSppf(it, maxDepth = 10).toString()) + println(getPathFromSppf(it, maxDepth = 100).toString()) } println() saveSppf(graphName, sppf) diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-app/src/main/resources/graph_2.dot index 69bb715ea..5d854d177 100644 --- a/cfpq-app/src/main/resources/graph_2.dot +++ b/cfpq-app/src/main/resources/graph_2.dot @@ -1,12 +1,20 @@ digraph { start -> 0; 0 -> 1 [label = "pt"]; + 1 -> 0 [label = "pt_r"]; 2 -> 0 [label = "assign"]; 0 -> 2 [label = "assign_r"]; + 2 -> 1 [label = "pt"]; + 1 -> 2 [label = "pt_r"]; 2 -> 3 [label = "store_0"]; 3 -> 4 [label = "pt"]; + 4 -> 3 [label = "pt"]; 2 -> 5 [label = "assign"]; 5 -> 2 [label = "assign_r"]; 5 -> 2 [label = "load_0"]; 2 -> 5 [label = "load_0_r"]; + 2 -> 4 [label = "pt"]; + 4 -> 2 [label = "pt"]; + 5 -> 4 [label = "pt"]; + 4 -> 5 [label = "pt"]; } diff --git a/cfpq-app/src/main/resources/graph_4.dot b/cfpq-app/src/main/resources/graph_4.dot new file mode 100644 index 000000000..f622ad4ad --- /dev/null +++ b/cfpq-app/src/main/resources/graph_4.dot @@ -0,0 +1,37 @@ +digraph { + start -> 1; + start -> 8; + 1 -> 0 [label = "alloc"]; + 1 -> 0 [label = "pt"]; + 0 -> 1 [label = "pt_r"]; + 4 -> 2 [label = "alloc"]; + 4 -> 2 [label = "pt"]; + 2 -> 4 [label = "pt_r"]; + 5 -> 3 [label = "alloc"]; + 5 -> 3 [label = "pt"]; + 3 -> 5 [label = "pt_r"]; + 10 -> 12 [label = "alloc"]; + 10 -> 12 [label = "pt"]; + 12 -> 10 [label = "pt_r"]; + 11 -> 13 [label = "alloc"]; + 11 -> 13 [label = "pt"]; + 13 -> 11 [label = "pt_r"]; + 8 -> 6 [label = "assign"]; + 6 -> 8 [label = "assign_r"]; + 9 -> 7 [label = "assign"]; + 7 -> 9 [label = "assign_r"]; + 4 -> 1 [label = "store_0"]; + 5 -> 1 [label = "store_1"]; + 8 -> 10 [label = "store_2"]; + 9 -> 11 [label = "store_3"]; + 6 -> 4 [label = "load_0"]; + 7 -> 5 [label = "load_1"]; + 6 -> 0 [label = "pt"]; + 0 -> 6 [label = "pt_r"]; + 8 -> 0 [label = "pt"]; + 0 -> 8 [label = "pt_r"]; + 7 -> 0 [label = "pt"]; + 0 -> 7 [label = "pt_r"]; + 9 -> 0 [label = "pt"]; + 0 -> 9 [label = "pt_r"]; +} From 0f275893417796fa084a3521ec8380e5251d7c5e Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 16:52:22 +0300 Subject: [PATCH 08/71] Multiple paths from loops. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 28 ++++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 43bb861ae..a7b827efa 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -34,19 +34,19 @@ fun readGraph(name: String): InputGraph { data class OutEgde(val start: Int, val symbol: String, val end: Int) -fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List? { +fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { if (maxDepth == 0) { return null } when (val nodeType = node.type) { is TerminalType<*> -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") - return listOf(OutEgde(range.from, nodeType.terminal.toString(), range.to)) + return listOf(listOf(OutEgde(range.from, nodeType.terminal.toString(), range.to))) } is NonterminalType if nodeType.startState.nonterminal.name == "R" -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for R Nonterminal node of SPPF") - return listOf(OutEgde(range.from, "R", range.to)) + return listOf(listOf(OutEgde(range.from, "R", range.to))) } is EpsilonNonterminalType -> { @@ -62,16 +62,18 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List? { if (subPaths.any { it == null }) { return null } - return subPaths.filterNotNull().flatten() + val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> + acc.flatMap { list -> lst.map { element -> list + element } } + } + return paths } is Range -> { - node.children.forEach { - getPathFromSppf(it, maxDepth - 1)?.let { path -> - return@getPathFromSppf path - } - } - return null + val paths = node.children.map { + getPathFromSppf(it, maxDepth - 1)?.filterNotNull() + }.filterNotNull().flatten() + if (paths.isEmpty()){return null} + return paths } else -> { @@ -94,13 +96,15 @@ fun saveSppf(name: String, sppf: Set>) { fun main() { listOf("graph_1.dot", "graph_2.dot", "graph_3.dot", "graph_4.dot").forEach { graphName -> + //listOf("graph_3.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToGrammar() val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() println("Founded paths in $graphName") - sppf.forEach { - println(getPathFromSppf(it, maxDepth = 100).toString()) + sppf.forEach { getPathFromSppf(it, maxDepth = 30)?.forEach{ + println(it.toString()) + } } println() saveSppf(graphName, sppf) From 38072c46eb0a7bd4fa55bc2e0b91b1bb81921842 Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 17:03:48 +0300 Subject: [PATCH 09/71] Corrected grammar. Corrected examples. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 4 ++-- cfpq-app/src/main/resources/graph_2.dot | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index a7b827efa..85a68c000 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -18,10 +18,10 @@ import java.nio.file.Path class PointsToGrammar : Grammar() { val S by Nt().asStart() - val R by Nt(Option("pt" * "pt_r")) + val R by Nt(Option("pt" * "pt_r") * many("assign_r")) init { - S /= R * many("assign_r" * ("store_0" or "store_1" or "store_2" or "store_3")) * "pt" + S /= many( R * ("store_0" or "store_1" or "store_2" or "store_3")) * "pt" } } diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-app/src/main/resources/graph_2.dot index 5d854d177..362b85f7d 100644 --- a/cfpq-app/src/main/resources/graph_2.dot +++ b/cfpq-app/src/main/resources/graph_2.dot @@ -8,13 +8,13 @@ digraph { 1 -> 2 [label = "pt_r"]; 2 -> 3 [label = "store_0"]; 3 -> 4 [label = "pt"]; - 4 -> 3 [label = "pt"]; + 4 -> 3 [label = "pt_r"]; 2 -> 5 [label = "assign"]; 5 -> 2 [label = "assign_r"]; 5 -> 2 [label = "load_0"]; 2 -> 5 [label = "load_0_r"]; 2 -> 4 [label = "pt"]; - 4 -> 2 [label = "pt"]; + 4 -> 2 [label = "pt_r"]; 5 -> 4 [label = "pt"]; - 4 -> 5 [label = "pt"]; + 4 -> 5 [label = "pt_r"]; } From 0cc147c579de1b9ec9d98f90c1f441ba6d2f9e5f Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 18:01:38 +0300 Subject: [PATCH 10/71] Brief readme. --- cfpq-app/README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 cfpq-app/README.md diff --git a/cfpq-app/README.md b/cfpq-app/README.md new file mode 100644 index 000000000..f3bbd2b5a --- /dev/null +++ b/cfpq-app/README.md @@ -0,0 +1,69 @@ +>[!CAUTION] +>For demo purposes only! +>Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). + +Requirements: 11 java + +To run (from project root): + +```bash +./gradlew :cfpq-app:run +``` + +Input graphs: src/main/resources/ +We assume that points-to analysis is performed as a first step, so points-to edges (```pt``` and ```pt_r```) are explicitly represented in the input graphs. + +Grammar and SPPF traversal: src/main/kotlin/me/vkutuev/Main.kt +SPPF is a derivation-tree-like structure that represents **all** possible paths satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. + +>[!NOTE] +> We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. + +## Examples + +Code snippet for related graphs. + +Graph 1: +```java +val n = new X() +val y = new Y() +val z = new Z() +val l = n +val t = y +z.u = y +t.v = z +``` + +Graph 2: +```java +val n = new X() +val l = n +while (...){ + val t = new X() + l.next = t + l = t +} +``` + +Graph 3: +```java +val n = new X() +val l = n +while (...){ + l.next = new X() + l = l.next +} +``` + +Graph 4: +```java +val n = new X() +val z = new Z() +val u = new U() +z.x = n +u.y = n +val v = z.x +v.p = new Y() +val r = u.y +r.q = new P() +``` \ No newline at end of file From dc6ab72baf553f9e012767cf16ad22e30b0b9266 Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 18:01:59 +0300 Subject: [PATCH 11/71] Small code cleanup. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 23 ++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 85a68c000..4652abac5 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -32,21 +32,22 @@ fun readGraph(name: String): InputGraph { return dotParser.parseDot(dotGraph) } -data class OutEgde(val start: Int, val symbol: String, val end: Int) +data class OutEdge(val start: Int, val symbol: String, val end: Int) -fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { +fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { if (maxDepth == 0) { return null } when (val nodeType = node.type) { is TerminalType<*> -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") - return listOf(listOf(OutEgde(range.from, nodeType.terminal.toString(), range.to))) + return listOf(listOf(OutEdge(range.from, nodeType.terminal.toString(), range.to))) } + //Do not extract subpaths for non-terminal R because they are useless. is NonterminalType if nodeType.startState.nonterminal.name == "R" -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for R Nonterminal node of SPPF") - return listOf(listOf(OutEgde(range.from, "R", range.to))) + return listOf(listOf(OutEdge(range.from, "R", range.to))) } is EpsilonNonterminalType -> { @@ -62,7 +63,7 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List if (subPaths.any { it == null }) { return null } - val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> + val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> acc.flatMap { list -> lst.map { element -> list + element } } } return paths @@ -72,8 +73,10 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List val paths = node.children.map { getPathFromSppf(it, maxDepth - 1)?.filterNotNull() }.filterNotNull().flatten() - if (paths.isEmpty()){return null} - return paths + if (paths.isEmpty()) { + return null + } + return paths } else -> { @@ -96,16 +99,12 @@ fun saveSppf(name: String, sppf: Set>) { fun main() { listOf("graph_1.dot", "graph_2.dot", "graph_3.dot", "graph_4.dot").forEach { graphName -> - //listOf("graph_3.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToGrammar() val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() println("Founded paths in $graphName") - sppf.forEach { getPathFromSppf(it, maxDepth = 30)?.forEach{ - println(it.toString()) - } - } + sppf.forEach { getPathFromSppf(it, maxDepth = 30)?.forEach { println(it.toString()) } } println() saveSppf(graphName, sppf) } From 77f2a5e4070ad05212851dbcfc55c51e3f1775a8 Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 15:40:17 +0300 Subject: [PATCH 12/71] Corrected grammar. More examples. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 9 ++--- cfpq-app/src/main/resources/graph_2.dot | 8 +++++ cfpq-app/src/main/resources/graph_4.dot | 37 +++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 cfpq-app/src/main/resources/graph_4.dot diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 6f83a5df8..43bb861ae 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -5,6 +5,7 @@ import org.ucfs.grammar.combinator.extension.StringExtension.many import org.ucfs.grammar.combinator.extension.StringExtension.or import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt +import org.ucfs.grammar.combinator.regexp.Option import org.ucfs.grammar.combinator.regexp.many import org.ucfs.input.DotParser import org.ucfs.input.InputGraph @@ -17,10 +18,10 @@ import java.nio.file.Path class PointsToGrammar : Grammar() { val S by Nt().asStart() - val R by Nt(many("assign_r" or "load_0_r" or "load_1_r")) + val R by Nt(Option("pt" * "pt_r")) init { - S /= many("assign") * many(R * ("store_0" or "store_1")) * "pt" + S /= R * many("assign_r" * ("store_0" or "store_1" or "store_2" or "store_3")) * "pt" } } @@ -92,14 +93,14 @@ fun saveSppf(name: String, sppf: Set>) { } fun main() { - listOf("graph_1.dot", "graph_2.dot", "graph_3.dot").forEach { graphName -> + listOf("graph_1.dot", "graph_2.dot", "graph_3.dot", "graph_4.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToGrammar() val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() println("Founded paths in $graphName") sppf.forEach { - println(getPathFromSppf(it, maxDepth = 10).toString()) + println(getPathFromSppf(it, maxDepth = 100).toString()) } println() saveSppf(graphName, sppf) diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-app/src/main/resources/graph_2.dot index 69bb715ea..5d854d177 100644 --- a/cfpq-app/src/main/resources/graph_2.dot +++ b/cfpq-app/src/main/resources/graph_2.dot @@ -1,12 +1,20 @@ digraph { start -> 0; 0 -> 1 [label = "pt"]; + 1 -> 0 [label = "pt_r"]; 2 -> 0 [label = "assign"]; 0 -> 2 [label = "assign_r"]; + 2 -> 1 [label = "pt"]; + 1 -> 2 [label = "pt_r"]; 2 -> 3 [label = "store_0"]; 3 -> 4 [label = "pt"]; + 4 -> 3 [label = "pt"]; 2 -> 5 [label = "assign"]; 5 -> 2 [label = "assign_r"]; 5 -> 2 [label = "load_0"]; 2 -> 5 [label = "load_0_r"]; + 2 -> 4 [label = "pt"]; + 4 -> 2 [label = "pt"]; + 5 -> 4 [label = "pt"]; + 4 -> 5 [label = "pt"]; } diff --git a/cfpq-app/src/main/resources/graph_4.dot b/cfpq-app/src/main/resources/graph_4.dot new file mode 100644 index 000000000..f622ad4ad --- /dev/null +++ b/cfpq-app/src/main/resources/graph_4.dot @@ -0,0 +1,37 @@ +digraph { + start -> 1; + start -> 8; + 1 -> 0 [label = "alloc"]; + 1 -> 0 [label = "pt"]; + 0 -> 1 [label = "pt_r"]; + 4 -> 2 [label = "alloc"]; + 4 -> 2 [label = "pt"]; + 2 -> 4 [label = "pt_r"]; + 5 -> 3 [label = "alloc"]; + 5 -> 3 [label = "pt"]; + 3 -> 5 [label = "pt_r"]; + 10 -> 12 [label = "alloc"]; + 10 -> 12 [label = "pt"]; + 12 -> 10 [label = "pt_r"]; + 11 -> 13 [label = "alloc"]; + 11 -> 13 [label = "pt"]; + 13 -> 11 [label = "pt_r"]; + 8 -> 6 [label = "assign"]; + 6 -> 8 [label = "assign_r"]; + 9 -> 7 [label = "assign"]; + 7 -> 9 [label = "assign_r"]; + 4 -> 1 [label = "store_0"]; + 5 -> 1 [label = "store_1"]; + 8 -> 10 [label = "store_2"]; + 9 -> 11 [label = "store_3"]; + 6 -> 4 [label = "load_0"]; + 7 -> 5 [label = "load_1"]; + 6 -> 0 [label = "pt"]; + 0 -> 6 [label = "pt_r"]; + 8 -> 0 [label = "pt"]; + 0 -> 8 [label = "pt_r"]; + 7 -> 0 [label = "pt"]; + 0 -> 7 [label = "pt_r"]; + 9 -> 0 [label = "pt"]; + 0 -> 9 [label = "pt_r"]; +} From 85a5231080502ff88e1d984e25b482e5c8a2893d Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 16:52:22 +0300 Subject: [PATCH 13/71] Multiple paths from loops. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 28 ++++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 43bb861ae..a7b827efa 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -34,19 +34,19 @@ fun readGraph(name: String): InputGraph { data class OutEgde(val start: Int, val symbol: String, val end: Int) -fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List? { +fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { if (maxDepth == 0) { return null } when (val nodeType = node.type) { is TerminalType<*> -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") - return listOf(OutEgde(range.from, nodeType.terminal.toString(), range.to)) + return listOf(listOf(OutEgde(range.from, nodeType.terminal.toString(), range.to))) } is NonterminalType if nodeType.startState.nonterminal.name == "R" -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for R Nonterminal node of SPPF") - return listOf(OutEgde(range.from, "R", range.to)) + return listOf(listOf(OutEgde(range.from, "R", range.to))) } is EpsilonNonterminalType -> { @@ -62,16 +62,18 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List? { if (subPaths.any { it == null }) { return null } - return subPaths.filterNotNull().flatten() + val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> + acc.flatMap { list -> lst.map { element -> list + element } } + } + return paths } is Range -> { - node.children.forEach { - getPathFromSppf(it, maxDepth - 1)?.let { path -> - return@getPathFromSppf path - } - } - return null + val paths = node.children.map { + getPathFromSppf(it, maxDepth - 1)?.filterNotNull() + }.filterNotNull().flatten() + if (paths.isEmpty()){return null} + return paths } else -> { @@ -94,13 +96,15 @@ fun saveSppf(name: String, sppf: Set>) { fun main() { listOf("graph_1.dot", "graph_2.dot", "graph_3.dot", "graph_4.dot").forEach { graphName -> + //listOf("graph_3.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToGrammar() val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() println("Founded paths in $graphName") - sppf.forEach { - println(getPathFromSppf(it, maxDepth = 100).toString()) + sppf.forEach { getPathFromSppf(it, maxDepth = 30)?.forEach{ + println(it.toString()) + } } println() saveSppf(graphName, sppf) From 03b25824087ade54e81f36c351bc7fbdad6e2439 Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 17:03:48 +0300 Subject: [PATCH 14/71] Corrected grammar. Corrected examples. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 4 ++-- cfpq-app/src/main/resources/graph_2.dot | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index a7b827efa..85a68c000 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -18,10 +18,10 @@ import java.nio.file.Path class PointsToGrammar : Grammar() { val S by Nt().asStart() - val R by Nt(Option("pt" * "pt_r")) + val R by Nt(Option("pt" * "pt_r") * many("assign_r")) init { - S /= R * many("assign_r" * ("store_0" or "store_1" or "store_2" or "store_3")) * "pt" + S /= many( R * ("store_0" or "store_1" or "store_2" or "store_3")) * "pt" } } diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-app/src/main/resources/graph_2.dot index 5d854d177..362b85f7d 100644 --- a/cfpq-app/src/main/resources/graph_2.dot +++ b/cfpq-app/src/main/resources/graph_2.dot @@ -8,13 +8,13 @@ digraph { 1 -> 2 [label = "pt_r"]; 2 -> 3 [label = "store_0"]; 3 -> 4 [label = "pt"]; - 4 -> 3 [label = "pt"]; + 4 -> 3 [label = "pt_r"]; 2 -> 5 [label = "assign"]; 5 -> 2 [label = "assign_r"]; 5 -> 2 [label = "load_0"]; 2 -> 5 [label = "load_0_r"]; 2 -> 4 [label = "pt"]; - 4 -> 2 [label = "pt"]; + 4 -> 2 [label = "pt_r"]; 5 -> 4 [label = "pt"]; - 4 -> 5 [label = "pt"]; + 4 -> 5 [label = "pt_r"]; } From b813da6cff31c24c645c8c37e80abc0b9ca3c876 Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 18:01:38 +0300 Subject: [PATCH 15/71] Brief readme. --- cfpq-app/README.md | 69 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 cfpq-app/README.md diff --git a/cfpq-app/README.md b/cfpq-app/README.md new file mode 100644 index 000000000..f3bbd2b5a --- /dev/null +++ b/cfpq-app/README.md @@ -0,0 +1,69 @@ +>[!CAUTION] +>For demo purposes only! +>Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). + +Requirements: 11 java + +To run (from project root): + +```bash +./gradlew :cfpq-app:run +``` + +Input graphs: src/main/resources/ +We assume that points-to analysis is performed as a first step, so points-to edges (```pt``` and ```pt_r```) are explicitly represented in the input graphs. + +Grammar and SPPF traversal: src/main/kotlin/me/vkutuev/Main.kt +SPPF is a derivation-tree-like structure that represents **all** possible paths satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. + +>[!NOTE] +> We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. + +## Examples + +Code snippet for related graphs. + +Graph 1: +```java +val n = new X() +val y = new Y() +val z = new Z() +val l = n +val t = y +z.u = y +t.v = z +``` + +Graph 2: +```java +val n = new X() +val l = n +while (...){ + val t = new X() + l.next = t + l = t +} +``` + +Graph 3: +```java +val n = new X() +val l = n +while (...){ + l.next = new X() + l = l.next +} +``` + +Graph 4: +```java +val n = new X() +val z = new Z() +val u = new U() +z.x = n +u.y = n +val v = z.x +v.p = new Y() +val r = u.y +r.q = new P() +``` \ No newline at end of file From 19c1444bbc5831f3331096a6e16e698069987161 Mon Sep 17 00:00:00 2001 From: gsv Date: Wed, 11 Feb 2026 18:01:59 +0300 Subject: [PATCH 16/71] Small code cleanup. --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 23 ++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 85a68c000..4652abac5 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -32,21 +32,22 @@ fun readGraph(name: String): InputGraph { return dotParser.parseDot(dotGraph) } -data class OutEgde(val start: Int, val symbol: String, val end: Int) +data class OutEdge(val start: Int, val symbol: String, val end: Int) -fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { +fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { if (maxDepth == 0) { return null } when (val nodeType = node.type) { is TerminalType<*> -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") - return listOf(listOf(OutEgde(range.from, nodeType.terminal.toString(), range.to))) + return listOf(listOf(OutEdge(range.from, nodeType.terminal.toString(), range.to))) } + //Do not extract subpaths for non-terminal R because they are useless. is NonterminalType if nodeType.startState.nonterminal.name == "R" -> { val range = node.inputRange ?: throw RuntimeException("Null inputRange for R Nonterminal node of SPPF") - return listOf(listOf(OutEgde(range.from, "R", range.to))) + return listOf(listOf(OutEdge(range.from, "R", range.to))) } is EpsilonNonterminalType -> { @@ -62,7 +63,7 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List if (subPaths.any { it == null }) { return null } - val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> + val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> acc.flatMap { list -> lst.map { element -> list + element } } } return paths @@ -72,8 +73,10 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List val paths = node.children.map { getPathFromSppf(it, maxDepth - 1)?.filterNotNull() }.filterNotNull().flatten() - if (paths.isEmpty()){return null} - return paths + if (paths.isEmpty()) { + return null + } + return paths } else -> { @@ -96,16 +99,12 @@ fun saveSppf(name: String, sppf: Set>) { fun main() { listOf("graph_1.dot", "graph_2.dot", "graph_3.dot", "graph_4.dot").forEach { graphName -> - //listOf("graph_3.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToGrammar() val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() println("Founded paths in $graphName") - sppf.forEach { getPathFromSppf(it, maxDepth = 30)?.forEach{ - println(it.toString()) - } - } + sppf.forEach { getPathFromSppf(it, maxDepth = 30)?.forEach { println(it.toString()) } } println() saveSppf(graphName, sppf) } From ff151983aeee133bf6e47629639e0817faab9da0 Mon Sep 17 00:00:00 2001 From: gsv Date: Fri, 20 Feb 2026 10:40:15 +0300 Subject: [PATCH 17/71] Fix examples. Not finished. --- cfpq-app/README.md | 17 +++++++++-------- cfpq-app/src/main/resources/graph_1.dot | 15 +++++++++++++++ cfpq-app/src/main/resources/graph_2.dot | 9 +++++++++ cfpq-app/src/main/resources/graph_3.dot | 11 +++++++++++ cfpq-app/src/main/resources/graph_4.dot | 11 ++++++----- 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/cfpq-app/README.md b/cfpq-app/README.md index f3bbd2b5a..564750d1f 100644 --- a/cfpq-app/README.md +++ b/cfpq-app/README.md @@ -30,18 +30,18 @@ val y = new Y() val z = new Z() val l = n val t = y -z.u = y +l.u = y t.v = z ``` + Graph 2: ```java val n = new X() val l = n -while (...){ - val t = new X() - l.next = t - l = t +while (...){ + l.next = new X() + l = l.next } ``` @@ -49,9 +49,10 @@ Graph 3: ```java val n = new X() val l = n -while (...){ - l.next = new X() - l = l.next +while (...){ + val t = new X() + l.next = t + l = t } ``` diff --git a/cfpq-app/src/main/resources/graph_1.dot b/cfpq-app/src/main/resources/graph_1.dot index 171c4f28d..1dfb32c0f 100644 --- a/cfpq-app/src/main/resources/graph_1.dot +++ b/cfpq-app/src/main/resources/graph_1.dot @@ -1,12 +1,27 @@ digraph { start -> 1; 1 -> 0 [label = "pt"]; + 0 -> 1 [label = "pt_r"]; 2 -> 1 [label = "assign"]; 1 -> 2 [label = "assign_r"]; 2 -> 3 [label = "store_0"]; + 3 -> 2 [label = "store_0_r"]; 3 -> 4 [label = "pt"]; + 4 -> 3 [label = "pt_r"]; 5 -> 3 [label = "assign"]; 3 -> 5 [label = "assign_r"]; 5 -> 6 [label = "store_1"]; + 6 -> 5 [label = "store_1_r"]; 6 -> 7 [label = "pt"]; + 7 -> 6 [label = "pt_r"]; + + 0[label = "new X()"] + 1[label = "n"] + 2[label = "l"] + 3[label = "y"] + 4[label = "new Y()"] + 5[label = "t"] + 6[label = "z"] + 7[label = "new Z()"] + } diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-app/src/main/resources/graph_2.dot index 362b85f7d..56dee54b1 100644 --- a/cfpq-app/src/main/resources/graph_2.dot +++ b/cfpq-app/src/main/resources/graph_2.dot @@ -7,6 +7,7 @@ digraph { 2 -> 1 [label = "pt"]; 1 -> 2 [label = "pt_r"]; 2 -> 3 [label = "store_0"]; + 3 -> 2 [label = "store_0_r"]; 3 -> 4 [label = "pt"]; 4 -> 3 [label = "pt_r"]; 2 -> 5 [label = "assign"]; @@ -17,4 +18,12 @@ digraph { 4 -> 2 [label = "pt_r"]; 5 -> 4 [label = "pt"]; 4 -> 5 [label = "pt_r"]; + + 0[label = "n"] + 1[label = "new X() // line 1"] + 2[label = "l"] + 3[label = "tmp1 // line 4"] + 4[label = "new X() // line 4"] + 5[label = "tmp2 // line 5"] + } diff --git a/cfpq-app/src/main/resources/graph_3.dot b/cfpq-app/src/main/resources/graph_3.dot index 7684868c8..ee7945d40 100644 --- a/cfpq-app/src/main/resources/graph_3.dot +++ b/cfpq-app/src/main/resources/graph_3.dot @@ -3,7 +3,18 @@ digraph { 1 -> 0 [label = "assign"]; 0 -> 1 [label = "assign_r"]; 1 -> 2 [label = "store_0"]; + 2 -> 1 [label = "store_0_r"]; 1 -> 2 [label = "assign"]; 2 -> 1 [label = "assign_r"]; 2 -> 3 [label = "pt"]; + 3 -> 2 [label = "pt_r"]; + 0 -> 4 [label = "pt"]; + 4 -> 0 [label = "pt_r"]; + + + 0[label = "n"] + 1[label = "l"] + 2[label = "t" ] + 3[label = "new X() // line 4"] + 4[label = "new X() // line 1"] } diff --git a/cfpq-app/src/main/resources/graph_4.dot b/cfpq-app/src/main/resources/graph_4.dot index f622ad4ad..a7bdd0be2 100644 --- a/cfpq-app/src/main/resources/graph_4.dot +++ b/cfpq-app/src/main/resources/graph_4.dot @@ -1,19 +1,14 @@ digraph { start -> 1; start -> 8; - 1 -> 0 [label = "alloc"]; 1 -> 0 [label = "pt"]; 0 -> 1 [label = "pt_r"]; - 4 -> 2 [label = "alloc"]; 4 -> 2 [label = "pt"]; 2 -> 4 [label = "pt_r"]; - 5 -> 3 [label = "alloc"]; 5 -> 3 [label = "pt"]; 3 -> 5 [label = "pt_r"]; - 10 -> 12 [label = "alloc"]; 10 -> 12 [label = "pt"]; 12 -> 10 [label = "pt_r"]; - 11 -> 13 [label = "alloc"]; 11 -> 13 [label = "pt"]; 13 -> 11 [label = "pt_r"]; 8 -> 6 [label = "assign"]; @@ -21,11 +16,17 @@ digraph { 9 -> 7 [label = "assign"]; 7 -> 9 [label = "assign_r"]; 4 -> 1 [label = "store_0"]; + 1 -> 4 [label = "store_0_r"]; 5 -> 1 [label = "store_1"]; + 1 -> 5 [label = "store_1_r"]; 8 -> 10 [label = "store_2"]; + 10 -> 8 [label = "store_2_r"]; 9 -> 11 [label = "store_3"]; + 11 -> 9 [label = "store_3_r"]; 6 -> 4 [label = "load_0"]; + 4 -> 6 [label = "load_0_r"]; 7 -> 5 [label = "load_1"]; + 5 -> 7 [label = "load_1_r"]; 6 -> 0 [label = "pt"]; 0 -> 6 [label = "pt_r"]; 8 -> 0 [label = "pt"]; From 5ca7f8a29631ffada5f92746b1a2e842de2dd91c Mon Sep 17 00:00:00 2001 From: gsv Date: Fri, 20 Feb 2026 14:04:48 +0300 Subject: [PATCH 18/71] Added explicit Points-to analysis --- cfpq-app/src/main/kotlin/me/vkutuev/Main.kt | 37 +++++++++++++----- cfpq-app/src/main/resources/graph_1.dot | 12 +++--- cfpq-app/src/main/resources/graph_2.dot | 16 +++----- cfpq-app/src/main/resources/graph_3.dot | 8 ++-- cfpq-app/src/main/resources/graph_4.dot | 43 ++++++++++++--------- 5 files changed, 68 insertions(+), 48 deletions(-) diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt index 4652abac5..a13f0e0a6 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt @@ -7,6 +7,7 @@ import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt import org.ucfs.grammar.combinator.regexp.Option import org.ucfs.grammar.combinator.regexp.many +import org.ucfs.grammar.combinator.regexp.or import org.ucfs.input.DotParser import org.ucfs.input.InputGraph import org.ucfs.input.TerminalInputLabel @@ -18,10 +19,20 @@ import java.nio.file.Path class PointsToGrammar : Grammar() { val S by Nt().asStart() - val R by Nt(Option("pt" * "pt_r") * many("assign_r")) - + val Alias by Nt() + val PointsTo by Nt(many("assign" or ("load_0" * Alias * "store_0") + or ("load_1" * Alias * "store_1") + or ("load_2" * Alias * "store_2") + or ("load_3" * Alias * "store_3") + ) * "alloc") + val FlowsTo by Nt("alloc_r" * many("assign_r" or ("store_0_r" * Alias * "load_0_r") + or ("store_1_r" * Alias * "load_1_r") + or ("store_2_r" * Alias * "load_2_r") + or ("store_3_r" * Alias * "load_3_r"))) + init { - S /= many( R * ("store_0" or "store_1" or "store_2" or "store_3")) * "pt" + Alias /= PointsTo * FlowsTo + S /= many( Option(Alias) * ("store_0" or "store_1" or "store_2" or "store_3")) * PointsTo } } @@ -32,7 +43,9 @@ fun readGraph(name: String): InputGraph { return dotParser.parseDot(dotGraph) } -data class OutEdge(val start: Int, val symbol: String, val end: Int) +data class OutEdge(val start: Int, val symbol: String, val end: Int){ + override fun toString(): String = "(" + start.toString() + "-" + symbol + "->" + end.toString() + ")" +} fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { if (maxDepth == 0) { @@ -44,14 +57,20 @@ fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List return listOf(listOf(OutEdge(range.from, nodeType.terminal.toString(), range.to))) } - //Do not extract subpaths for non-terminal R because they are useless. - is NonterminalType if nodeType.startState.nonterminal.name == "R" -> { - val range = node.inputRange ?: throw RuntimeException("Null inputRange for R Nonterminal node of SPPF") - return listOf(listOf(OutEdge(range.from, "R", range.to))) + //Do not extract subpaths for non-terminal Alias because they are useless. + is NonterminalType if nodeType.startState.nonterminal.name == "Alias" -> { + val range = node.inputRange ?: throw RuntimeException("Null inputRange for Alias Nonterminal node of SPPF") + return listOf(listOf(OutEdge(range.from, "Alias", range.to))) + } + + //Do not extract subpaths for non-terminal PointsTo because they are useless. + is NonterminalType if nodeType.startState.nonterminal.name == "PointsTo" -> { + val range = node.inputRange ?: throw RuntimeException("Null inputRange for PointsTo Nonterminal node of SPPF") + return listOf(listOf(OutEdge(range.from, "PointsTo", range.to))) } is EpsilonNonterminalType -> { - return emptyList() + return listOf(emptyList()) } is EmptyType -> { diff --git a/cfpq-app/src/main/resources/graph_1.dot b/cfpq-app/src/main/resources/graph_1.dot index 1dfb32c0f..47cc9326e 100644 --- a/cfpq-app/src/main/resources/graph_1.dot +++ b/cfpq-app/src/main/resources/graph_1.dot @@ -1,19 +1,19 @@ digraph { start -> 1; - 1 -> 0 [label = "pt"]; - 0 -> 1 [label = "pt_r"]; + 1 -> 0 [label = "alloc"]; + 0 -> 1 [label = "alloc_r"]; 2 -> 1 [label = "assign"]; 1 -> 2 [label = "assign_r"]; 2 -> 3 [label = "store_0"]; 3 -> 2 [label = "store_0_r"]; - 3 -> 4 [label = "pt"]; - 4 -> 3 [label = "pt_r"]; + 3 -> 4 [label = "alloc"]; + 4 -> 3 [label = "alloc_r"]; 5 -> 3 [label = "assign"]; 3 -> 5 [label = "assign_r"]; 5 -> 6 [label = "store_1"]; 6 -> 5 [label = "store_1_r"]; - 6 -> 7 [label = "pt"]; - 7 -> 6 [label = "pt_r"]; + 6 -> 7 [label = "alloc"]; + 7 -> 6 [label = "alloc_r"]; 0[label = "new X()"] 1[label = "n"] diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-app/src/main/resources/graph_2.dot index 56dee54b1..c0eb6626f 100644 --- a/cfpq-app/src/main/resources/graph_2.dot +++ b/cfpq-app/src/main/resources/graph_2.dot @@ -1,24 +1,18 @@ digraph { start -> 0; - 0 -> 1 [label = "pt"]; - 1 -> 0 [label = "pt_r"]; + 0 -> 1 [label = "alloc"]; + 1 -> 0 [label = "alloc_r"]; 2 -> 0 [label = "assign"]; 0 -> 2 [label = "assign_r"]; - 2 -> 1 [label = "pt"]; - 1 -> 2 [label = "pt_r"]; 2 -> 3 [label = "store_0"]; 3 -> 2 [label = "store_0_r"]; - 3 -> 4 [label = "pt"]; - 4 -> 3 [label = "pt_r"]; + 3 -> 4 [label = "alloc"]; + 4 -> 3 [label = "alloc_r"]; 2 -> 5 [label = "assign"]; 5 -> 2 [label = "assign_r"]; 5 -> 2 [label = "load_0"]; 2 -> 5 [label = "load_0_r"]; - 2 -> 4 [label = "pt"]; - 4 -> 2 [label = "pt_r"]; - 5 -> 4 [label = "pt"]; - 4 -> 5 [label = "pt_r"]; - + 0[label = "n"] 1[label = "new X() // line 1"] 2[label = "l"] diff --git a/cfpq-app/src/main/resources/graph_3.dot b/cfpq-app/src/main/resources/graph_3.dot index ee7945d40..f3451bb6a 100644 --- a/cfpq-app/src/main/resources/graph_3.dot +++ b/cfpq-app/src/main/resources/graph_3.dot @@ -6,10 +6,10 @@ digraph { 2 -> 1 [label = "store_0_r"]; 1 -> 2 [label = "assign"]; 2 -> 1 [label = "assign_r"]; - 2 -> 3 [label = "pt"]; - 3 -> 2 [label = "pt_r"]; - 0 -> 4 [label = "pt"]; - 4 -> 0 [label = "pt_r"]; + 2 -> 3 [label = "alloc"]; + 3 -> 2 [label = "alloc_r"]; + 0 -> 4 [label = "alloc"]; + 4 -> 0 [label = "alloc_r"]; 0[label = "n"] diff --git a/cfpq-app/src/main/resources/graph_4.dot b/cfpq-app/src/main/resources/graph_4.dot index a7bdd0be2..8ff719da2 100644 --- a/cfpq-app/src/main/resources/graph_4.dot +++ b/cfpq-app/src/main/resources/graph_4.dot @@ -1,16 +1,16 @@ digraph { start -> 1; start -> 8; - 1 -> 0 [label = "pt"]; - 0 -> 1 [label = "pt_r"]; - 4 -> 2 [label = "pt"]; - 2 -> 4 [label = "pt_r"]; - 5 -> 3 [label = "pt"]; - 3 -> 5 [label = "pt_r"]; - 10 -> 12 [label = "pt"]; - 12 -> 10 [label = "pt_r"]; - 11 -> 13 [label = "pt"]; - 13 -> 11 [label = "pt_r"]; + 1 -> 0 [label = "alloc"]; + 0 -> 1 [label = "alloc_r"]; + 4 -> 2 [label = "alloc"]; + 2 -> 4 [label = "alloc_r"]; + 5 -> 3 [label = "alloc"]; + 3 -> 5 [label = "alloc_r"]; + 10 -> 12 [label = "alloc"]; + 12 -> 10 [label = "alloc_r"]; + 11 -> 13 [label = "alloc"]; + 13 -> 11 [label = "alloc_r"]; 8 -> 6 [label = "assign"]; 6 -> 8 [label = "assign_r"]; 9 -> 7 [label = "assign"]; @@ -27,12 +27,19 @@ digraph { 4 -> 6 [label = "load_0_r"]; 7 -> 5 [label = "load_1"]; 5 -> 7 [label = "load_1_r"]; - 6 -> 0 [label = "pt"]; - 0 -> 6 [label = "pt_r"]; - 8 -> 0 [label = "pt"]; - 0 -> 8 [label = "pt_r"]; - 7 -> 0 [label = "pt"]; - 0 -> 7 [label = "pt_r"]; - 9 -> 0 [label = "pt"]; - 0 -> 9 [label = "pt_r"]; + + 0[label="new X()"]; + 1[label="n"]; + 2[label="new Z()"]; + 3[label="new U()"]; + 4[label="z"]; + 5[label="u"]; + 6[label="tmp1 // line 6"]; + 7[label="tmp2 // line 8"]; + 8[label="v"]; + 9[label="r"]; + 10[label="tmp3 // line 7"]; + 11[label="tmp4 // line 9"]; + 12[label="new Y()"]; + 13[label="new P()"]; } From 9d28557c8a142a1d2e4af3673c45fd2388a098e1 Mon Sep 17 00:00:00 2001 From: gsv Date: Fri, 20 Feb 2026 14:05:21 +0300 Subject: [PATCH 19/71] Draft of updated readme. --- cfpq-app/README.md | 96 +- .../src/main/resources/figures/graph_1.dot | 27 + .../main/resources/figures/graph_1.dot.svg | 171 + .../main/resources/figures/graph_1_sppf.dot | 176 + .../resources/figures/graph_1_sppf.dot.svg | 967 +++++ .../src/main/resources/figures/graph_2.dot | 23 + .../main/resources/figures/graph_2.dot.svg | 145 + .../main/resources/figures/graph_2_sppf.dot | 177 + .../resources/figures/graph_2_sppf.dot.svg | 1002 +++++ .../src/main/resources/figures/graph_3.dot | 20 + .../main/resources/figures/graph_3.dot.svg | 125 + .../main/resources/figures/graph_3_sppf.dot | 95 + .../resources/figures/graph_3_sppf.dot.svg | 520 +++ .../src/main/resources/figures/graph_4.dot | 45 + .../main/resources/figures/graph_4.dot.svg | 297 ++ .../main/resources/figures/graph_4_sppf.dot | 573 +++ .../resources/figures/graph_4_sppf.dot.svg | 3255 +++++++++++++++++ 17 files changed, 7705 insertions(+), 9 deletions(-) create mode 100644 cfpq-app/src/main/resources/figures/graph_1.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_1.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/graph_1_sppf.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_1_sppf.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/graph_2.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_2.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/graph_2_sppf.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/graph_3.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_3.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/graph_3_sppf.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/graph_4.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_4.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/graph_4_sppf.dot create mode 100644 cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg diff --git a/cfpq-app/README.md b/cfpq-app/README.md index 564750d1f..798c7a297 100644 --- a/cfpq-app/README.md +++ b/cfpq-app/README.md @@ -10,10 +10,12 @@ To run (from project root): ./gradlew :cfpq-app:run ``` -Input graphs: src/main/resources/ -We assume that points-to analysis is performed as a first step, so points-to edges (```pt``` and ```pt_r```) are explicitly represented in the input graphs. +Input graphs: ```src/main/resources/``` + +Grammar and code for paths extraction: ```src/main/kotlin/me/vkutuev/Main.kt``` + +SPPF traversal -Grammar and SPPF traversal: src/main/kotlin/me/vkutuev/Main.kt SPPF is a derivation-tree-like structure that represents **all** possible paths satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. >[!NOTE] @@ -21,9 +23,11 @@ SPPF is a derivation-tree-like structure that represents **all** possible paths ## Examples -Code snippet for related graphs. -Graph 1: + + +### Example 1 +Code snippet: ```java val n = new X() val y = new Y() @@ -34,8 +38,26 @@ l.u = y t.v = z ``` +Respective graph: + +![Graph for example 1](./src/main/resources/figures/graph_1.dot.svg) + +![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) + +Paths: +[(1-PointsTo->0)] + +[(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] + +[(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + +Trivial. Will be omitted in further examples -Graph 2: + +### Example 2 + +Code snippet: ```java val n = new X() val l = n @@ -45,7 +67,28 @@ while (...){ } ``` -Graph 3: +![Graph for example 2](./src/main/resources/figures/graph_2.dot.svg) +![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) + +Paths: + +[(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] + +[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + +[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + +[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + +[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + +[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + + +### Example 3 + +Code snippet: ```java val n = new X() val l = n @@ -56,7 +99,28 @@ while (...){ } ``` -Graph 4: +![Graph for example 3](./src/main/resources/figures/graph_3.dot.svg) +![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) + +Paths: + +[(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] + +[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + +[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + +[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + +[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + +[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + +### Example 4 + +Code snippet: + ```java val n = new X() val z = new Z() @@ -67,4 +131,18 @@ val v = z.x v.p = new Y() val r = u.y r.q = new P() -``` \ No newline at end of file +``` + +![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) + +Paths: + +[(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] + +[(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] + +[(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] + +[(8-store_2->10), (10-PointsTo->12)] + +[(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] diff --git a/cfpq-app/src/main/resources/figures/graph_1.dot b/cfpq-app/src/main/resources/figures/graph_1.dot new file mode 100644 index 000000000..db6f85581 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_1.dot @@ -0,0 +1,27 @@ +digraph { + start -> 1; + 1 -> 0 [label = "alloc"]; + 0 -> 1 [label = "alloc_r"]; + 2 -> 1 [label = "assign"]; + 1 -> 2 [label = "assign_r"]; + 2 -> 3 [label = "store_0"]; + 3 -> 2 [label = "store_0_r"]; + 3 -> 4 [label = "alloc"]; + 4 -> 3 [label = "alloc_r"]; + 5 -> 3 [label = "assign"]; + 3 -> 5 [label = "assign_r"]; + 5 -> 6 [label = "store_1"]; + 6 -> 5 [label = "store_1_r"]; + 6 -> 7 [label = "alloc"]; + 7 -> 6 [label = "alloc_r"]; + + 0[label = "0 | new X()"] + 1[label = "1 | n"] + 2[label = "2 | l"] + 3[label = "3 | y"] + 4[label = "4 | new Y()"] + 5[label = "5 | t"] + 6[label = "6 | z"] + 7[label = "7 | new Z()"] + +} diff --git a/cfpq-app/src/main/resources/figures/graph_1.dot.svg b/cfpq-app/src/main/resources/figures/graph_1.dot.svg new file mode 100644 index 000000000..9c58204f4 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_1.dot.svg @@ -0,0 +1,171 @@ + + + + + + +%3 + + + +start + +start + + + +1 + +1 | n + + + +start->1 + + + + + +0 + +0 | new X() + + + +1->0 + + +alloc + + + +2 + +2 | l + + + +1->2 + + +assign_r + + + +0->1 + + +alloc_r + + + +2->1 + + +assign + + + +3 + +3 | y + + + +2->3 + + +store_0 + + + +3->2 + + +store_0_r + + + +4 + +4 | new Y() + + + +3->4 + + +alloc + + + +5 + +5 | t + + + +3->5 + + +assign_r + + + +4->3 + + +alloc_r + + + +5->3 + + +assign + + + +6 + +6 | z + + + +5->6 + + +store_1 + + + +6->5 + + +store_1_r + + + +7 + +7 | new Z() + + + +6->7 + + +alloc + + + +7->6 + + +alloc_r + + + diff --git a/cfpq-app/src/main/resources/figures/graph_1_sppf.dot b/cfpq-app/src/main/resources/figures/graph_1_sppf.dot new file mode 100644 index 000000000..25b11c79e --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_1_sppf.dot @@ -0,0 +1,176 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [1, 0]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [1, 0], rsm: [S_0, S_2]", shape = ellipse] +_0_2 [label = "2 Nonterminal PointsTo, input: [1, 0]", shape = invtrapezium] +_0_3 [label = "3 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_0_4 [label = "4 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_2 +_0_2->_0_3 +_0_3->_0_4 +} + +subgraph cluster_1{ +labelloc="t" +_1_0 [label = "0 Nonterminal S, input: [1, 4]", shape = invtrapezium] +_1_1 [label = "1 Range , input: [1, 4], rsm: [S_0, S_2]", shape = ellipse] +_1_2 [label = "10 Nonterminal Alias, input: [1, 2]", shape = invtrapezium] +_1_3 [label = "11 Terminal 'store_0', input: [2, 3]", shape = rectangle] +_1_4 [label = "12 Terminal 'alloc', input: [3, 4]", shape = rectangle] +_1_5 [label = "13 Range , input: [1, 2], rsm: [Alias_0, Alias_2]", shape = ellipse] +_1_6 [label = "14 Intermediate input: 0, rsm: Alias_1, input: [1, 2]", shape = plain] +_1_7 [label = "15 Range , input: [1, 0], rsm: [Alias_0, Alias_1]", shape = ellipse] +_1_8 [label = "16 Range , input: [0, 2], rsm: [Alias_1, Alias_2]", shape = ellipse] +_1_9 [label = "17 Nonterminal PointsTo, input: [1, 0]", shape = invtrapezium] +_1_10 [label = "18 Nonterminal FlowsTo, input: [0, 2]", shape = invtrapezium] +_1_11 [label = "19 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_12 [label = "2 Intermediate input: 3, rsm: S_0, input: [1, 4]", shape = plain] +_1_13 [label = "20 Range , input: [0, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_14 [label = "21 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_1_15 [label = "22 Intermediate input: 1, rsm: FlowsTo_1, input: [0, 2]", shape = plain] +_1_16 [label = "23 Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_17 [label = "24 Range , input: [1, 2], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_1_18 [label = "25 Terminal 'alloc_r', input: [0, 1]", shape = rectangle] +_1_19 [label = "26 Terminal 'assign_r', input: [1, 2]", shape = rectangle] +_1_20 [label = "3 Range , input: [1, 3], rsm: [S_0, S_0]", shape = ellipse] +_1_21 [label = "4 Range , input: [3, 4], rsm: [S_0, S_2]", shape = ellipse] +_1_22 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_23 [label = "6 Nonterminal PointsTo, input: [3, 4]", shape = invtrapezium] +_1_24 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_1_25 [label = "8 Range , input: [2, 3], rsm: [S_1, S_0]", shape = ellipse] +_1_26 [label = "9 Range , input: [3, 4], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_0->_1_1 +_1_1->_1_12 +_1_2->_1_5 +_1_5->_1_6 +_1_6->_1_7 +_1_6->_1_8 +_1_7->_1_9 +_1_8->_1_10 +_1_9->_1_11 +_1_10->_1_13 +_1_11->_1_14 +_1_12->_1_20 +_1_12->_1_21 +_1_13->_1_15 +_1_15->_1_16 +_1_15->_1_17 +_1_16->_1_18 +_1_17->_1_19 +_1_20->_1_22 +_1_21->_1_23 +_1_22->_1_24 +_1_22->_1_25 +_1_23->_1_26 +_1_24->_1_2 +_1_25->_1_3 +_1_26->_1_4 +} + +subgraph cluster_2{ +labelloc="t" +_2_0 [label = "0 Nonterminal S, input: [1, 7]", shape = invtrapezium] +_2_1 [label = "1 Range , input: [1, 7], rsm: [S_0, S_2]", shape = ellipse] +_2_2 [label = "10 Intermediate input: 3, rsm: S_0, input: [1, 5]", shape = plain] +_2_3 [label = "11 Terminal 'store_1', input: [5, 6]", shape = rectangle] +_2_4 [label = "12 Terminal 'alloc', input: [6, 7]", shape = rectangle] +_2_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_0]", shape = ellipse] +_2_6 [label = "14 Range , input: [3, 5], rsm: [S_0, S_1]", shape = ellipse] +_2_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_8 [label = "16 Nonterminal Alias, input: [3, 5]", shape = invtrapezium] +_2_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_2_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_0]", shape = ellipse] +_2_11 [label = "19 Range , input: [3, 5], rsm: [Alias_0, Alias_2]", shape = ellipse] +_2_12 [label = "2 Intermediate input: 6, rsm: S_0, input: [1, 7]", shape = plain] +_2_13 [label = "20 Nonterminal Alias, input: [1, 2]", shape = invtrapezium] +_2_14 [label = "21 Terminal 'store_0', input: [2, 3]", shape = rectangle] +_2_15 [label = "22 Intermediate input: 4, rsm: Alias_1, input: [3, 5]", shape = plain] +_2_16 [label = "23 Range , input: [1, 2], rsm: [Alias_0, Alias_2]", shape = ellipse] +_2_17 [label = "24 Range , input: [3, 4], rsm: [Alias_0, Alias_1]", shape = ellipse] +_2_18 [label = "25 Range , input: [4, 5], rsm: [Alias_1, Alias_2]", shape = ellipse] +_2_19 [label = "26 Intermediate input: 0, rsm: Alias_1, input: [1, 2]", shape = plain] +_2_20 [label = "27 Nonterminal PointsTo, input: [3, 4]", shape = invtrapezium] +_2_21 [label = "28 Nonterminal FlowsTo, input: [4, 5]", shape = invtrapezium] +_2_22 [label = "29 Range , input: [1, 0], rsm: [Alias_0, Alias_1]", shape = ellipse] +_2_23 [label = "3 Range , input: [1, 6], rsm: [S_0, S_0]", shape = ellipse] +_2_24 [label = "30 Range , input: [0, 2], rsm: [Alias_1, Alias_2]", shape = ellipse] +_2_25 [label = "31 Range , input: [3, 4], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_2_26 [label = "32 Range , input: [4, 5], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_27 [label = "33 Nonterminal PointsTo, input: [1, 0]", shape = invtrapezium] +_2_28 [label = "34 Nonterminal FlowsTo, input: [0, 2]", shape = invtrapezium] +_2_29 [label = "35 Terminal 'alloc', input: [3, 4]", shape = rectangle] +_2_30 [label = "36 Intermediate input: 3, rsm: FlowsTo_1, input: [4, 5]", shape = plain] +_2_31 [label = "37 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_2_32 [label = "38 Range , input: [0, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_33 [label = "39 Range , input: [4, 3], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_34 [label = "4 Range , input: [6, 7], rsm: [S_0, S_2]", shape = ellipse] +_2_35 [label = "40 Range , input: [3, 5], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_2_36 [label = "41 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_2_37 [label = "42 Intermediate input: 1, rsm: FlowsTo_1, input: [0, 2]", shape = plain] +_2_38 [label = "43 Terminal 'alloc_r', input: [4, 3]", shape = rectangle] +_2_39 [label = "44 Terminal 'assign_r', input: [3, 5]", shape = rectangle] +_2_40 [label = "45 Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_41 [label = "46 Range , input: [1, 2], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_2_42 [label = "47 Terminal 'alloc_r', input: [0, 1]", shape = rectangle] +_2_43 [label = "48 Terminal 'assign_r', input: [1, 2]", shape = rectangle] +_2_44 [label = "5 Intermediate input: 5, rsm: S_1, input: [1, 6]", shape = plain] +_2_45 [label = "6 Nonterminal PointsTo, input: [6, 7]", shape = invtrapezium] +_2_46 [label = "7 Range , input: [1, 5], rsm: [S_0, S_1]", shape = ellipse] +_2_47 [label = "8 Range , input: [5, 6], rsm: [S_1, S_0]", shape = ellipse] +_2_48 [label = "9 Range , input: [6, 7], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_2_0->_2_1 +_2_1->_2_12 +_2_2->_2_5 +_2_2->_2_6 +_2_5->_2_7 +_2_6->_2_8 +_2_7->_2_9 +_2_7->_2_10 +_2_8->_2_11 +_2_9->_2_13 +_2_10->_2_14 +_2_11->_2_15 +_2_12->_2_23 +_2_12->_2_34 +_2_13->_2_16 +_2_15->_2_17 +_2_15->_2_18 +_2_16->_2_19 +_2_17->_2_20 +_2_18->_2_21 +_2_19->_2_22 +_2_19->_2_24 +_2_20->_2_25 +_2_21->_2_26 +_2_22->_2_27 +_2_23->_2_44 +_2_24->_2_28 +_2_25->_2_29 +_2_26->_2_30 +_2_27->_2_31 +_2_28->_2_32 +_2_30->_2_33 +_2_30->_2_35 +_2_31->_2_36 +_2_32->_2_37 +_2_33->_2_38 +_2_34->_2_45 +_2_35->_2_39 +_2_37->_2_40 +_2_37->_2_41 +_2_40->_2_42 +_2_41->_2_43 +_2_44->_2_46 +_2_44->_2_47 +_2_45->_2_48 +_2_46->_2_2 +_2_47->_2_3 +_2_48->_2_4 +} + +} + diff --git a/cfpq-app/src/main/resources/figures/graph_1_sppf.dot.svg b/cfpq-app/src/main/resources/figures/graph_1_sppf.dot.svg new file mode 100644 index 000000000..76a662962 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_1_sppf.dot.svg @@ -0,0 +1,967 @@ + + + + + + +g + + +cluster_0 + + + +cluster_1 + + + +cluster_2 + + + + +_0_0 + +0     Nonterminal S, input: [1, 0] + + + +_0_1 + +1     Range , input: [1, 0], rsm: [S_0, S_2] + + + +_0_0->_0_1 + + + + + +_0_2 + +2     Nonterminal PointsTo, input: [1, 0] + + + +_0_1->_0_2 + + + + + +_0_3 + +3     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_0_2->_0_3 + + + + + +_0_4 + +4     Terminal 'alloc', input: [1, 0] + + + +_0_3->_0_4 + + + + + +_1_0 + +0     Nonterminal S, input: [1, 4] + + + +_1_1 + +1     Range , input: [1, 4], rsm: [S_0, S_2] + + + +_1_0->_1_1 + + + + + +_1_12 +2     Intermediate input: 3, rsm: S_0, input: [1, 4] + + + +_1_1->_1_12 + + + + + +_1_2 + +10     Nonterminal Alias, input: [1, 2] + + + +_1_5 + +13     Range , input: [1, 2], rsm: [Alias_0, Alias_2] + + + +_1_2->_1_5 + + + + + +_1_3 + +11     Terminal 'store_0', input: [2, 3] + + + +_1_4 + +12     Terminal 'alloc', input: [3, 4] + + + +_1_6 +14     Intermediate input: 0, rsm: Alias_1, input: [1, 2] + + + +_1_5->_1_6 + + + + + +_1_7 + +15     Range , input: [1, 0], rsm: [Alias_0, Alias_1] + + + +_1_6->_1_7 + + + + + +_1_8 + +16     Range , input: [0, 2], rsm: [Alias_1, Alias_2] + + + +_1_6->_1_8 + + + + + +_1_9 + +17     Nonterminal PointsTo, input: [1, 0] + + + +_1_7->_1_9 + + + + + +_1_10 + +18     Nonterminal FlowsTo, input: [0, 2] + + + +_1_8->_1_10 + + + + + +_1_11 + +19     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_1_9->_1_11 + + + + + +_1_13 + +20     Range , input: [0, 2], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_10->_1_13 + + + + + +_1_14 + +21     Terminal 'alloc', input: [1, 0] + + + +_1_11->_1_14 + + + + + +_1_20 + +3     Range , input: [1, 3], rsm: [S_0, S_0] + + + +_1_12->_1_20 + + + + + +_1_21 + +4     Range , input: [3, 4], rsm: [S_0, S_2] + + + +_1_12->_1_21 + + + + + +_1_15 +22     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 2] + + + +_1_13->_1_15 + + + + + +_1_16 + +23     Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_15->_1_16 + + + + + +_1_17 + +24     Range , input: [1, 2], rsm: [FlowsTo_1, FlowsTo_1] + + + +_1_15->_1_17 + + + + + +_1_18 + +25     Terminal 'alloc_r', input: [0, 1] + + + +_1_16->_1_18 + + + + + +_1_19 + +26     Terminal 'assign_r', input: [1, 2] + + + +_1_17->_1_19 + + + + + +_1_22 +5     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_1_20->_1_22 + + + + + +_1_23 + +6     Nonterminal PointsTo, input: [3, 4] + + + +_1_21->_1_23 + + + + + +_1_24 + +7     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_1_22->_1_24 + + + + + +_1_25 + +8     Range , input: [2, 3], rsm: [S_1, S_0] + + + +_1_22->_1_25 + + + + + +_1_26 + +9     Range , input: [3, 4], rsm: [PointsTo_0, PointsTo_5] + + + +_1_23->_1_26 + + + + + +_1_24->_1_2 + + + + + +_1_25->_1_3 + + + + + +_1_26->_1_4 + + + + + +_2_0 + +0     Nonterminal S, input: [1, 7] + + + +_2_1 + +1     Range , input: [1, 7], rsm: [S_0, S_2] + + + +_2_0->_2_1 + + + + + +_2_12 +2     Intermediate input: 6, rsm: S_0, input: [1, 7] + + + +_2_1->_2_12 + + + + + +_2_2 +10     Intermediate input: 3, rsm: S_0, input: [1, 5] + + + +_2_5 + +13     Range , input: [1, 3], rsm: [S_0, S_0] + + + +_2_2->_2_5 + + + + + +_2_6 + +14     Range , input: [3, 5], rsm: [S_0, S_1] + + + +_2_2->_2_6 + + + + + +_2_3 + +11     Terminal 'store_1', input: [5, 6] + + + +_2_4 + +12     Terminal 'alloc', input: [6, 7] + + + +_2_7 +15     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_2_5->_2_7 + + + + + +_2_8 + +16     Nonterminal Alias, input: [3, 5] + + + +_2_6->_2_8 + + + + + +_2_9 + +17     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_2_7->_2_9 + + + + + +_2_10 + +18     Range , input: [2, 3], rsm: [S_1, S_0] + + + +_2_7->_2_10 + + + + + +_2_11 + +19     Range , input: [3, 5], rsm: [Alias_0, Alias_2] + + + +_2_8->_2_11 + + + + + +_2_13 + +20     Nonterminal Alias, input: [1, 2] + + + +_2_9->_2_13 + + + + + +_2_14 + +21     Terminal 'store_0', input: [2, 3] + + + +_2_10->_2_14 + + + + + +_2_15 +22     Intermediate input: 4, rsm: Alias_1, input: [3, 5] + + + +_2_11->_2_15 + + + + + +_2_23 + +3     Range , input: [1, 6], rsm: [S_0, S_0] + + + +_2_12->_2_23 + + + + + +_2_34 + +4     Range , input: [6, 7], rsm: [S_0, S_2] + + + +_2_12->_2_34 + + + + + +_2_16 + +23     Range , input: [1, 2], rsm: [Alias_0, Alias_2] + + + +_2_13->_2_16 + + + + + +_2_17 + +24     Range , input: [3, 4], rsm: [Alias_0, Alias_1] + + + +_2_15->_2_17 + + + + + +_2_18 + +25     Range , input: [4, 5], rsm: [Alias_1, Alias_2] + + + +_2_15->_2_18 + + + + + +_2_19 +26     Intermediate input: 0, rsm: Alias_1, input: [1, 2] + + + +_2_16->_2_19 + + + + + +_2_20 + +27     Nonterminal PointsTo, input: [3, 4] + + + +_2_17->_2_20 + + + + + +_2_21 + +28     Nonterminal FlowsTo, input: [4, 5] + + + +_2_18->_2_21 + + + + + +_2_22 + +29     Range , input: [1, 0], rsm: [Alias_0, Alias_1] + + + +_2_19->_2_22 + + + + + +_2_24 + +30     Range , input: [0, 2], rsm: [Alias_1, Alias_2] + + + +_2_19->_2_24 + + + + + +_2_25 + +31     Range , input: [3, 4], rsm: [PointsTo_0, PointsTo_5] + + + +_2_20->_2_25 + + + + + +_2_26 + +32     Range , input: [4, 5], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_21->_2_26 + + + + + +_2_27 + +33     Nonterminal PointsTo, input: [1, 0] + + + +_2_22->_2_27 + + + + + +_2_44 +5     Intermediate input: 5, rsm: S_1, input: [1, 6] + + + +_2_23->_2_44 + + + + + +_2_28 + +34     Nonterminal FlowsTo, input: [0, 2] + + + +_2_24->_2_28 + + + + + +_2_29 + +35     Terminal 'alloc', input: [3, 4] + + + +_2_25->_2_29 + + + + + +_2_30 +36     Intermediate input: 3, rsm: FlowsTo_1, input: [4, 5] + + + +_2_26->_2_30 + + + + + +_2_31 + +37     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_2_27->_2_31 + + + + + +_2_32 + +38     Range , input: [0, 2], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_28->_2_32 + + + + + +_2_33 + +39     Range , input: [4, 3], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_30->_2_33 + + + + + +_2_35 + +40     Range , input: [3, 5], rsm: [FlowsTo_1, FlowsTo_1] + + + +_2_30->_2_35 + + + + + +_2_36 + +41     Terminal 'alloc', input: [1, 0] + + + +_2_31->_2_36 + + + + + +_2_37 +42     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 2] + + + +_2_32->_2_37 + + + + + +_2_38 + +43     Terminal 'alloc_r', input: [4, 3] + + + +_2_33->_2_38 + + + + + +_2_45 + +6     Nonterminal PointsTo, input: [6, 7] + + + +_2_34->_2_45 + + + + + +_2_39 + +44     Terminal 'assign_r', input: [3, 5] + + + +_2_35->_2_39 + + + + + +_2_40 + +45     Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_37->_2_40 + + + + + +_2_41 + +46     Range , input: [1, 2], rsm: [FlowsTo_1, FlowsTo_1] + + + +_2_37->_2_41 + + + + + +_2_42 + +47     Terminal 'alloc_r', input: [0, 1] + + + +_2_40->_2_42 + + + + + +_2_43 + +48     Terminal 'assign_r', input: [1, 2] + + + +_2_41->_2_43 + + + + + +_2_46 + +7     Range , input: [1, 5], rsm: [S_0, S_1] + + + +_2_44->_2_46 + + + + + +_2_47 + +8     Range , input: [5, 6], rsm: [S_1, S_0] + + + +_2_44->_2_47 + + + + + +_2_48 + +9     Range , input: [6, 7], rsm: [PointsTo_0, PointsTo_5] + + + +_2_45->_2_48 + + + + + +_2_46->_2_2 + + + + + +_2_47->_2_3 + + + + + +_2_48->_2_4 + + + + + diff --git a/cfpq-app/src/main/resources/figures/graph_2.dot b/cfpq-app/src/main/resources/figures/graph_2.dot new file mode 100644 index 000000000..6fb4ab2f6 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_2.dot @@ -0,0 +1,23 @@ +digraph { + start -> 0; + 0 -> 1 [label = "alloc"]; + 1 -> 0 [label = "alloc_r"]; + 2 -> 0 [label = "assign"]; + 0 -> 2 [label = "assign_r"]; + 2 -> 3 [label = "store_0"]; + 3 -> 2 [label = "store_0_r"]; + 3 -> 4 [label = "alloc"]; + 4 -> 3 [label = "alloc_r"]; + 2 -> 5 [label = "assign"]; + 5 -> 2 [label = "assign_r"]; + 5 -> 2 [label = "load_0"]; + 2 -> 5 [label = "load_0_r"]; + + 0[label = "0: n"] + 1[label = "1: new X() // line 1"] + 2[label = "2: l"] + 3[label = "3: tmp1 // line 4"] + 4[label = "4: new X() // line 4"] + 5[label = "5: tmp2 // line 5"] + +} diff --git a/cfpq-app/src/main/resources/figures/graph_2.dot.svg b/cfpq-app/src/main/resources/figures/graph_2.dot.svg new file mode 100644 index 000000000..83e62d0a1 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_2.dot.svg @@ -0,0 +1,145 @@ + + + + + + +%191 + + + +start + +start + + + +0 + +0: n + + + +start->0 + + + + + +1 + +1: new X() // line 1 + + + +0->1 + + +alloc + + + +2 + +2: l + + + +0->2 + + +assign_r + + + +1->0 + + +alloc_r + + + +2->0 + + +assign + + + +3 + +3: tmp1 // line 4 + + + +2->3 + + +store_0 + + + +5 + +5: tmp2 // line 5 + + + +2->5 + + +assign + + + +2->5 + + +load_0_r + + + +3->2 + + +store_0_r + + + +4 + +4: new X() // line 4 + + + +3->4 + + +alloc + + + +4->3 + + +alloc_r + + + +5->2 + + +assign_r + + + +5->2 + + +load_0 + + + diff --git a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot new file mode 100644 index 000000000..698d1aa4d --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot @@ -0,0 +1,177 @@ +digraph g { +labelloc="t" +label="" + +subgraph cluster_1{ +labelloc="t" +_1_0 [label = "0 Nonterminal S, input: [0, 4]", shape = invtrapezium] +_1_1 [label = "1 Range , input: [0, 4], rsm: [S_0, S_2]", shape = ellipse] +_1_2 [label = "10 Nonterminal Alias, input: [0, 2]", shape = invtrapezium] +_1_3 [label = "11 Intermediate input: 3, rsm: S_0, input: [0, 2]", shape = plain] +_1_4 [label = "12 Terminal 'store_0', input: [2, 3]", shape = rectangle] +_1_5 [label = "13 Terminal 'alloc', input: [3, 4]", shape = rectangle] +_1_6 [label = "14 Range , input: [0, 2], rsm: [Alias_0, Alias_2]", shape = ellipse] +_1_7 [label = "15 Range , input: [3, 2], rsm: [S_0, S_1]", shape = ellipse] +_1_8 [label = "16 Intermediate input: 1, rsm: Alias_1, input: [0, 2]", shape = plain] +_1_9 [label = "17 Nonterminal Alias, input: [3, 2]", shape = invtrapezium] +_1_10 [label = "18 Range , input: [0, 1], rsm: [Alias_0, Alias_1]", shape = ellipse] +_1_11 [label = "19 Range , input: [1, 2], rsm: [Alias_1, Alias_2]", shape = ellipse] +_1_12 [label = "2 Intermediate input: 3, rsm: S_0, input: [0, 4]", shape = plain] +_1_13 [label = "20 Range , input: [3, 2], rsm: [Alias_0, Alias_2]", shape = ellipse] +_1_14 [label = "21 Nonterminal PointsTo, input: [0, 1]", shape = invtrapezium] +_1_15 [label = "22 Nonterminal FlowsTo, input: [1, 2]", shape = invtrapezium] +_1_16 [label = "23 Intermediate input: 4, rsm: Alias_1, input: [3, 2]", shape = plain] +_1_17 [label = "24 Range , input: [0, 1], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_18 [label = "25 Range , input: [1, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_19 [label = "26 Range , input: [3, 4], rsm: [Alias_0, Alias_1]", shape = ellipse] +_1_20 [label = "27 Range , input: [4, 2], rsm: [Alias_1, Alias_2]", shape = ellipse] +_1_21 [label = "28 Terminal 'alloc', input: [0, 1]", shape = rectangle] +_1_22 [label = "29 Intermediate input: 0, rsm: FlowsTo_1, input: [1, 2]", shape = plain] +_1_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_0]", shape = ellipse] +_1_24 [label = "30 Nonterminal PointsTo, input: [3, 4]", shape = invtrapezium] +_1_25 [label = "31 Nonterminal FlowsTo, input: [4, 2]", shape = invtrapezium] +_1_26 [label = "32 Range , input: [1, 0], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_27 [label = "33 Range , input: [0, 2], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_1_28 [label = "34 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_29 [label = "35 Terminal 'alloc_r', input: [1, 0]", shape = rectangle] +_1_30 [label = "36 Terminal 'assign_r', input: [0, 2]", shape = rectangle] +_1_31 [label = "37 Intermediate input: 5, rsm: FlowsTo_1, input: [4, 2]", shape = plain] +_1_32 [label = "38 Range , input: [4, 5], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_33 [label = "39 Range , input: [5, 2], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_1_34 [label = "4 Range , input: [3, 4], rsm: [S_0, S_2]", shape = ellipse] +_1_35 [label = "40 Intermediate input: 2, rsm: FlowsTo_9, input: [4, 5]", shape = plain] +_1_36 [label = "41 Terminal 'assign_r', input: [5, 2]", shape = rectangle] +_1_37 [label = "42 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_9]", shape = ellipse] +_1_38 [label = "43 Range , input: [2, 5], rsm: [FlowsTo_9, FlowsTo_1]", shape = ellipse] +_1_39 [label = "44 Intermediate input: 2, rsm: FlowsTo_2, input: [4, 2]", shape = plain] +_1_40 [label = "45 Terminal 'load_0_r', input: [2, 5]", shape = rectangle] +_1_41 [label = "46 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_2]", shape = ellipse] +_1_42 [label = "47 Range , input: [2, 2], rsm: [FlowsTo_2, FlowsTo_9]", shape = ellipse] +_1_43 [label = "48 Intermediate input: 3, rsm: FlowsTo_1, input: [4, 2]", shape = plain] +_1_44 [label = "49 Nonterminal Alias, input: [2, 2]", shape = invtrapezium] +_1_45 [label = "5 Intermediate input: 2, rsm: S_1, input: [0, 3]", shape = plain] +_1_46 [label = "50 Range , input: [4, 3], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_47 [label = "51 Range , input: [3, 2], rsm: [FlowsTo_1, FlowsTo_2]", shape = ellipse] +_1_48 [label = "52 Range , input: [2, 2], rsm: [Alias_0, Alias_2]", shape = ellipse] +_1_49 [label = "53 Terminal 'alloc_r', input: [4, 3]", shape = rectangle] +_1_50 [label = "54 Terminal 'store_0_r', input: [3, 2]", shape = rectangle] +_1_51 [label = "55 Intermediate input: 1, rsm: Alias_1, input: [2, 2]", shape = plain] +_1_52 [label = "56 Intermediate input: 4, rsm: Alias_1, input: [2, 2]", shape = plain] +_1_53 [label = "57 Range , input: [2, 1], rsm: [Alias_0, Alias_1]", shape = ellipse] +_1_54 [label = "58 Range , input: [2, 4], rsm: [Alias_0, Alias_1]", shape = ellipse] +_1_55 [label = "59 Nonterminal PointsTo, input: [2, 1]", shape = invtrapezium] +_1_56 [label = "6 Nonterminal PointsTo, input: [3, 4]", shape = invtrapezium] +_1_57 [label = "60 Nonterminal PointsTo, input: [2, 4]", shape = invtrapezium] +_1_58 [label = "61 Range , input: [2, 1], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_59 [label = "62 Range , input: [2, 4], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_60 [label = "63 Intermediate input: 0, rsm: PointsTo_0, input: [2, 1]", shape = plain] +_1_61 [label = "64 Intermediate input: 3, rsm: PointsTo_0, input: [2, 4]", shape = plain] +_1_62 [label = "65 Range , input: [2, 0], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_1_63 [label = "66 Range , input: [2, 3], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_1_64 [label = "67 Terminal 'assign', input: [2, 0]", shape = rectangle] +_1_65 [label = "68 Intermediate input: 2, rsm: PointsTo_9, input: [2, 3]", shape = plain] +_1_66 [label = "69 Range , input: [2, 2], rsm: [PointsTo_0, PointsTo_9]", shape = ellipse] +_1_67 [label = "7 Range , input: [0, 2], rsm: [S_0, S_1]", shape = ellipse] +_1_68 [label = "70 Range , input: [2, 3], rsm: [PointsTo_9, PointsTo_0]", shape = ellipse] +_1_69 [label = "71 Intermediate input: 2, rsm: PointsTo_1, input: [2, 2]", shape = plain] +_1_70 [label = "72 Range , input: [2, 2], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_1_71 [label = "73 Range , input: [2, 2], rsm: [PointsTo_1, PointsTo_9]", shape = ellipse] +_1_72 [label = "74 Intermediate input: 5, rsm: PointsTo_0, input: [2, 2]", shape = plain] +_1_73 [label = "75 Nonterminal Alias, input: [2, 2]", shape = invtrapezium] +_1_74 [label = "76 Range , input: [2, 5], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_1_75 [label = "77 Range , input: [5, 2], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_1_76 [label = "78 Terminal 'assign', input: [2, 5]", shape = rectangle] +_1_77 [label = "79 Terminal 'load_0', input: [5, 2]", shape = rectangle] +_1_78 [label = "8 Range , input: [2, 3], rsm: [S_1, S_0]", shape = ellipse] +_1_79 [label = "9 Range , input: [3, 4], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_0->_1_1 +_1_1->_1_12 +_1_2->_1_6 +_1_3->_1_23 +_1_3->_1_7 +_1_6->_1_8 +_1_7->_1_9 +_1_8->_1_10 +_1_8->_1_11 +_1_9->_1_13 +_1_10->_1_14 +_1_11->_1_15 +_1_12->_1_23 +_1_12->_1_34 +_1_13->_1_16 +_1_14->_1_17 +_1_15->_1_18 +_1_16->_1_19 +_1_16->_1_20 +_1_17->_1_21 +_1_18->_1_22 +_1_19->_1_24 +_1_20->_1_25 +_1_22->_1_26 +_1_22->_1_27 +_1_23->_1_45 +_1_24->_1_79 +_1_25->_1_28 +_1_26->_1_29 +_1_27->_1_30 +_1_28->_1_31 +_1_31->_1_32 +_1_31->_1_33 +_1_32->_1_35 +_1_33->_1_36 +_1_34->_1_56 +_1_35->_1_37 +_1_35->_1_38 +_1_37->_1_39 +_1_38->_1_40 +_1_39->_1_41 +_1_39->_1_42 +_1_41->_1_43 +_1_42->_1_44 +_1_43->_1_46 +_1_43->_1_47 +_1_44->_1_48 +_1_45->_1_67 +_1_45->_1_78 +_1_46->_1_49 +_1_47->_1_50 +_1_48->_1_51 +_1_48->_1_52 +_1_51->_1_53 +_1_51->_1_11 +_1_52->_1_54 +_1_52->_1_20 +_1_53->_1_55 +_1_54->_1_57 +_1_55->_1_58 +_1_56->_1_79 +_1_57->_1_59 +_1_58->_1_60 +_1_59->_1_61 +_1_60->_1_62 +_1_60->_1_17 +_1_61->_1_63 +_1_61->_1_79 +_1_62->_1_64 +_1_63->_1_65 +_1_65->_1_66 +_1_65->_1_68 +_1_66->_1_69 +_1_67->_1_2 +_1_67->_1_3 +_1_68->_1_4 +_1_69->_1_70 +_1_69->_1_71 +_1_70->_1_72 +_1_71->_1_73 +_1_72->_1_74 +_1_72->_1_75 +_1_73->_1_48 +_1_74->_1_76 +_1_75->_1_77 +_1_78->_1_4 +_1_79->_1_5 +} + +} + diff --git a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg new file mode 100644 index 000000000..e08b8b8d7 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg @@ -0,0 +1,1002 @@ + + + + + + +g + + +cluster_1 + + + + +_1_0 + +0     Nonterminal S, input: [0, 4] + + + +_1_1 + +1     Range , input: [0, 4], rsm: [S_0, S_2] + + + +_1_0->_1_1 + + + + + +_1_12 +2     Intermediate input: 3, rsm: S_0, input: [0, 4] + + + +_1_1->_1_12 + + + + + +_1_2 + +10     Nonterminal Alias, input: [0, 2] + + + +_1_6 + +14     Range , input: [0, 2], rsm: [Alias_0, Alias_2] + + + +_1_2->_1_6 + + + + + +_1_3 +11     Intermediate input: 3, rsm: S_0, input: [0, 2] + + + +_1_7 + +15     Range , input: [3, 2], rsm: [S_0, S_1] + + + +_1_3->_1_7 + + + + + +_1_23 + +3     Range , input: [0, 3], rsm: [S_0, S_0] + + + +_1_3->_1_23 + + + + + +_1_4 + +12     Terminal 'store_0', input: [2, 3] + + + +_1_5 + +13     Terminal 'alloc', input: [3, 4] + + + +_1_8 +16     Intermediate input: 1, rsm: Alias_1, input: [0, 2] + + + +_1_6->_1_8 + + + + + +_1_9 + +17     Nonterminal Alias, input: [3, 2] + + + +_1_7->_1_9 + + + + + +_1_10 + +18     Range , input: [0, 1], rsm: [Alias_0, Alias_1] + + + +_1_8->_1_10 + + + + + +_1_11 + +19     Range , input: [1, 2], rsm: [Alias_1, Alias_2] + + + +_1_8->_1_11 + + + + + +_1_13 + +20     Range , input: [3, 2], rsm: [Alias_0, Alias_2] + + + +_1_9->_1_13 + + + + + +_1_14 + +21     Nonterminal PointsTo, input: [0, 1] + + + +_1_10->_1_14 + + + + + +_1_15 + +22     Nonterminal FlowsTo, input: [1, 2] + + + +_1_11->_1_15 + + + + + +_1_12->_1_23 + + + + + +_1_34 + +4     Range , input: [3, 4], rsm: [S_0, S_2] + + + +_1_12->_1_34 + + + + + +_1_16 +23     Intermediate input: 4, rsm: Alias_1, input: [3, 2] + + + +_1_13->_1_16 + + + + + +_1_17 + +24     Range , input: [0, 1], rsm: [PointsTo_0, PointsTo_5] + + + +_1_14->_1_17 + + + + + +_1_18 + +25     Range , input: [1, 2], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_15->_1_18 + + + + + +_1_19 + +26     Range , input: [3, 4], rsm: [Alias_0, Alias_1] + + + +_1_16->_1_19 + + + + + +_1_20 + +27     Range , input: [4, 2], rsm: [Alias_1, Alias_2] + + + +_1_16->_1_20 + + + + + +_1_21 + +28     Terminal 'alloc', input: [0, 1] + + + +_1_17->_1_21 + + + + + +_1_22 +29     Intermediate input: 0, rsm: FlowsTo_1, input: [1, 2] + + + +_1_18->_1_22 + + + + + +_1_24 + +30     Nonterminal PointsTo, input: [3, 4] + + + +_1_19->_1_24 + + + + + +_1_25 + +31     Nonterminal FlowsTo, input: [4, 2] + + + +_1_20->_1_25 + + + + + +_1_26 + +32     Range , input: [1, 0], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_22->_1_26 + + + + + +_1_27 + +33     Range , input: [0, 2], rsm: [FlowsTo_1, FlowsTo_1] + + + +_1_22->_1_27 + + + + + +_1_45 +5     Intermediate input: 2, rsm: S_1, input: [0, 3] + + + +_1_23->_1_45 + + + + + +_1_79 + +9     Range , input: [3, 4], rsm: [PointsTo_0, PointsTo_5] + + + +_1_24->_1_79 + + + + + +_1_28 + +34     Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_25->_1_28 + + + + + +_1_29 + +35     Terminal 'alloc_r', input: [1, 0] + + + +_1_26->_1_29 + + + + + +_1_30 + +36     Terminal 'assign_r', input: [0, 2] + + + +_1_27->_1_30 + + + + + +_1_31 +37     Intermediate input: 5, rsm: FlowsTo_1, input: [4, 2] + + + +_1_28->_1_31 + + + + + +_1_32 + +38     Range , input: [4, 5], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_31->_1_32 + + + + + +_1_33 + +39     Range , input: [5, 2], rsm: [FlowsTo_1, FlowsTo_1] + + + +_1_31->_1_33 + + + + + +_1_35 +40     Intermediate input: 2, rsm: FlowsTo_9, input: [4, 5] + + + +_1_32->_1_35 + + + + + +_1_36 + +41     Terminal 'assign_r', input: [5, 2] + + + +_1_33->_1_36 + + + + + +_1_56 + +6     Nonterminal PointsTo, input: [3, 4] + + + +_1_34->_1_56 + + + + + +_1_37 + +42     Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_9] + + + +_1_35->_1_37 + + + + + +_1_38 + +43     Range , input: [2, 5], rsm: [FlowsTo_9, FlowsTo_1] + + + +_1_35->_1_38 + + + + + +_1_39 +44     Intermediate input: 2, rsm: FlowsTo_2, input: [4, 2] + + + +_1_37->_1_39 + + + + + +_1_40 + +45     Terminal 'load_0_r', input: [2, 5] + + + +_1_38->_1_40 + + + + + +_1_41 + +46     Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_2] + + + +_1_39->_1_41 + + + + + +_1_42 + +47     Range , input: [2, 2], rsm: [FlowsTo_2, FlowsTo_9] + + + +_1_39->_1_42 + + + + + +_1_43 +48     Intermediate input: 3, rsm: FlowsTo_1, input: [4, 2] + + + +_1_41->_1_43 + + + + + +_1_44 + +49     Nonterminal Alias, input: [2, 2] + + + +_1_42->_1_44 + + + + + +_1_46 + +50     Range , input: [4, 3], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_43->_1_46 + + + + + +_1_47 + +51     Range , input: [3, 2], rsm: [FlowsTo_1, FlowsTo_2] + + + +_1_43->_1_47 + + + + + +_1_48 + +52     Range , input: [2, 2], rsm: [Alias_0, Alias_2] + + + +_1_44->_1_48 + + + + + +_1_67 + +7     Range , input: [0, 2], rsm: [S_0, S_1] + + + +_1_45->_1_67 + + + + + +_1_78 + +8     Range , input: [2, 3], rsm: [S_1, S_0] + + + +_1_45->_1_78 + + + + + +_1_49 + +53     Terminal 'alloc_r', input: [4, 3] + + + +_1_46->_1_49 + + + + + +_1_50 + +54     Terminal 'store_0_r', input: [3, 2] + + + +_1_47->_1_50 + + + + + +_1_51 +55     Intermediate input: 1, rsm: Alias_1, input: [2, 2] + + + +_1_48->_1_51 + + + + + +_1_52 +56     Intermediate input: 4, rsm: Alias_1, input: [2, 2] + + + +_1_48->_1_52 + + + + + +_1_51->_1_11 + + + + + +_1_53 + +57     Range , input: [2, 1], rsm: [Alias_0, Alias_1] + + + +_1_51->_1_53 + + + + + +_1_52->_1_20 + + + + + +_1_54 + +58     Range , input: [2, 4], rsm: [Alias_0, Alias_1] + + + +_1_52->_1_54 + + + + + +_1_55 + +59     Nonterminal PointsTo, input: [2, 1] + + + +_1_53->_1_55 + + + + + +_1_57 + +60     Nonterminal PointsTo, input: [2, 4] + + + +_1_54->_1_57 + + + + + +_1_58 + +61     Range , input: [2, 1], rsm: [PointsTo_0, PointsTo_5] + + + +_1_55->_1_58 + + + + + +_1_56->_1_79 + + + + + +_1_59 + +62     Range , input: [2, 4], rsm: [PointsTo_0, PointsTo_5] + + + +_1_57->_1_59 + + + + + +_1_60 +63     Intermediate input: 0, rsm: PointsTo_0, input: [2, 1] + + + +_1_58->_1_60 + + + + + +_1_61 +64     Intermediate input: 3, rsm: PointsTo_0, input: [2, 4] + + + +_1_59->_1_61 + + + + + +_1_60->_1_17 + + + + + +_1_62 + +65     Range , input: [2, 0], rsm: [PointsTo_0, PointsTo_0] + + + +_1_60->_1_62 + + + + + +_1_63 + +66     Range , input: [2, 3], rsm: [PointsTo_0, PointsTo_0] + + + +_1_61->_1_63 + + + + + +_1_61->_1_79 + + + + + +_1_64 + +67     Terminal 'assign', input: [2, 0] + + + +_1_62->_1_64 + + + + + +_1_65 +68     Intermediate input: 2, rsm: PointsTo_9, input: [2, 3] + + + +_1_63->_1_65 + + + + + +_1_66 + +69     Range , input: [2, 2], rsm: [PointsTo_0, PointsTo_9] + + + +_1_65->_1_66 + + + + + +_1_68 + +70     Range , input: [2, 3], rsm: [PointsTo_9, PointsTo_0] + + + +_1_65->_1_68 + + + + + +_1_69 +71     Intermediate input: 2, rsm: PointsTo_1, input: [2, 2] + + + +_1_66->_1_69 + + + + + +_1_67->_1_2 + + + + + +_1_67->_1_3 + + + + + +_1_68->_1_4 + + + + + +_1_70 + +72     Range , input: [2, 2], rsm: [PointsTo_0, PointsTo_1] + + + +_1_69->_1_70 + + + + + +_1_71 + +73     Range , input: [2, 2], rsm: [PointsTo_1, PointsTo_9] + + + +_1_69->_1_71 + + + + + +_1_72 +74     Intermediate input: 5, rsm: PointsTo_0, input: [2, 2] + + + +_1_70->_1_72 + + + + + +_1_73 + +75     Nonterminal Alias, input: [2, 2] + + + +_1_71->_1_73 + + + + + +_1_74 + +76     Range , input: [2, 5], rsm: [PointsTo_0, PointsTo_0] + + + +_1_72->_1_74 + + + + + +_1_75 + +77     Range , input: [5, 2], rsm: [PointsTo_0, PointsTo_1] + + + +_1_72->_1_75 + + + + + +_1_73->_1_48 + + + + + +_1_76 + +78     Terminal 'assign', input: [2, 5] + + + +_1_74->_1_76 + + + + + +_1_77 + +79     Terminal 'load_0', input: [5, 2] + + + +_1_75->_1_77 + + + + + +_1_78->_1_4 + + + + + +_1_79->_1_5 + + + + + diff --git a/cfpq-app/src/main/resources/figures/graph_3.dot b/cfpq-app/src/main/resources/figures/graph_3.dot new file mode 100644 index 000000000..f3451bb6a --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_3.dot @@ -0,0 +1,20 @@ +digraph { + start -> 0; + 1 -> 0 [label = "assign"]; + 0 -> 1 [label = "assign_r"]; + 1 -> 2 [label = "store_0"]; + 2 -> 1 [label = "store_0_r"]; + 1 -> 2 [label = "assign"]; + 2 -> 1 [label = "assign_r"]; + 2 -> 3 [label = "alloc"]; + 3 -> 2 [label = "alloc_r"]; + 0 -> 4 [label = "alloc"]; + 4 -> 0 [label = "alloc_r"]; + + + 0[label = "n"] + 1[label = "l"] + 2[label = "t" ] + 3[label = "new X() // line 4"] + 4[label = "new X() // line 1"] +} diff --git a/cfpq-app/src/main/resources/figures/graph_3.dot.svg b/cfpq-app/src/main/resources/figures/graph_3.dot.svg new file mode 100644 index 000000000..60c083f66 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_3.dot.svg @@ -0,0 +1,125 @@ + + + + + + +%393 + + + +start + +start + + + +0 + +n + + + +start->0 + + + + + +1 + +l + + + +0->1 + + +assign_r + + + +4 + +new X() // line 1 + + + +0->4 + + +alloc + + + +1->0 + + +assign + + + +2 + +t + + + +1->2 + + +store_0 + + + +1->2 + + +assign + + + +2->1 + + +store_0_r + + + +2->1 + + +assign_r + + + +3 + +new X() // line 4 + + + +2->3 + + +alloc + + + +3->2 + + +alloc_r + + + +4->0 + + +alloc_r + + + diff --git a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot new file mode 100644 index 000000000..8e5c79e34 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot @@ -0,0 +1,95 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_2 [label = "10 Nonterminal Alias, input: [0, 1]", shape = invtrapezium] +_0_3 [label = "11 Intermediate input: 2, rsm: S_0, input: [0, 1]", shape = plain] +_0_4 [label = "12 Terminal 'store_0', input: [1, 2]", shape = rectangle] +_0_5 [label = "13 Terminal 'alloc', input: [2, 3]", shape = rectangle] +_0_6 [label = "14 Range , input: [0, 1], rsm: [Alias_0, Alias_2]", shape = ellipse] +_0_7 [label = "15 Range , input: [2, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_8 [label = "16 Intermediate input: 4, rsm: Alias_1, input: [0, 1]", shape = plain] +_0_9 [label = "17 Nonterminal Alias, input: [2, 1]", shape = invtrapezium] +_0_10 [label = "18 Range , input: [0, 4], rsm: [Alias_0, Alias_1]", shape = ellipse] +_0_11 [label = "19 Range , input: [4, 1], rsm: [Alias_1, Alias_2]", shape = ellipse] +_0_12 [label = "2 Intermediate input: 2, rsm: S_0, input: [0, 3]", shape = plain] +_0_13 [label = "20 Range , input: [2, 1], rsm: [Alias_0, Alias_2]", shape = ellipse] +_0_14 [label = "21 Nonterminal PointsTo, input: [0, 4]", shape = invtrapezium] +_0_15 [label = "22 Nonterminal FlowsTo, input: [4, 1]", shape = invtrapezium] +_0_16 [label = "23 Intermediate input: 3, rsm: Alias_1, input: [2, 1]", shape = plain] +_0_17 [label = "24 Range , input: [0, 4], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_0_18 [label = "25 Range , input: [4, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_0_19 [label = "26 Range , input: [2, 3], rsm: [Alias_0, Alias_1]", shape = ellipse] +_0_20 [label = "27 Range , input: [3, 1], rsm: [Alias_1, Alias_2]", shape = ellipse] +_0_21 [label = "28 Terminal 'alloc', input: [0, 4]", shape = rectangle] +_0_22 [label = "29 Intermediate input: 0, rsm: FlowsTo_1, input: [4, 1]", shape = plain] +_0_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_0]", shape = ellipse] +_0_24 [label = "30 Nonterminal PointsTo, input: [2, 3]", shape = invtrapezium] +_0_25 [label = "31 Nonterminal FlowsTo, input: [3, 1]", shape = invtrapezium] +_0_26 [label = "32 Range , input: [4, 0], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_0_27 [label = "33 Range , input: [0, 1], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_0_28 [label = "34 Range , input: [3, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_0_29 [label = "35 Terminal 'alloc_r', input: [4, 0]", shape = rectangle] +_0_30 [label = "36 Terminal 'assign_r', input: [0, 1]", shape = rectangle] +_0_31 [label = "37 Intermediate input: 2, rsm: FlowsTo_1, input: [3, 1]", shape = plain] +_0_32 [label = "38 Range , input: [3, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_0_33 [label = "39 Range , input: [2, 1], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_0_34 [label = "4 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_35 [label = "40 Terminal 'alloc_r', input: [3, 2]", shape = rectangle] +_0_36 [label = "41 Terminal 'assign_r', input: [2, 1]", shape = rectangle] +_0_37 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_38 [label = "6 Nonterminal PointsTo, input: [2, 3]", shape = invtrapezium] +_0_39 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_40 [label = "8 Range , input: [1, 2], rsm: [S_1, S_0]", shape = ellipse] +_0_41 [label = "9 Range , input: [2, 3], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_0_0->_0_1 +_0_1->_0_12 +_0_2->_0_6 +_0_3->_0_23 +_0_3->_0_7 +_0_6->_0_8 +_0_7->_0_9 +_0_8->_0_10 +_0_8->_0_11 +_0_9->_0_13 +_0_10->_0_14 +_0_11->_0_15 +_0_12->_0_23 +_0_12->_0_34 +_0_13->_0_16 +_0_14->_0_17 +_0_15->_0_18 +_0_16->_0_19 +_0_16->_0_20 +_0_17->_0_21 +_0_18->_0_22 +_0_19->_0_24 +_0_20->_0_25 +_0_22->_0_26 +_0_22->_0_27 +_0_23->_0_37 +_0_24->_0_41 +_0_25->_0_28 +_0_26->_0_29 +_0_27->_0_30 +_0_28->_0_31 +_0_31->_0_32 +_0_31->_0_33 +_0_32->_0_35 +_0_33->_0_36 +_0_34->_0_38 +_0_37->_0_39 +_0_37->_0_40 +_0_38->_0_41 +_0_39->_0_2 +_0_39->_0_3 +_0_40->_0_4 +_0_41->_0_5 +} + + +} + diff --git a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg new file mode 100644 index 000000000..1c917358d --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg @@ -0,0 +1,520 @@ + + + + + + +g + + +cluster_0 + + + + +_0_0 + +0     Nonterminal S, input: [0, 3] + + + +_0_1 + +1     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_0_0->_0_1 + + + + + +_0_12 +2     Intermediate input: 2, rsm: S_0, input: [0, 3] + + + +_0_1->_0_12 + + + + + +_0_2 + +10     Nonterminal Alias, input: [0, 1] + + + +_0_6 + +14     Range , input: [0, 1], rsm: [Alias_0, Alias_2] + + + +_0_2->_0_6 + + + + + +_0_3 +11     Intermediate input: 2, rsm: S_0, input: [0, 1] + + + +_0_7 + +15     Range , input: [2, 1], rsm: [S_0, S_1] + + + +_0_3->_0_7 + + + + + +_0_23 + +3     Range , input: [0, 2], rsm: [S_0, S_0] + + + +_0_3->_0_23 + + + + + +_0_4 + +12     Terminal 'store_0', input: [1, 2] + + + +_0_5 + +13     Terminal 'alloc', input: [2, 3] + + + +_0_8 +16     Intermediate input: 4, rsm: Alias_1, input: [0, 1] + + + +_0_6->_0_8 + + + + + +_0_9 + +17     Nonterminal Alias, input: [2, 1] + + + +_0_7->_0_9 + + + + + +_0_10 + +18     Range , input: [0, 4], rsm: [Alias_0, Alias_1] + + + +_0_8->_0_10 + + + + + +_0_11 + +19     Range , input: [4, 1], rsm: [Alias_1, Alias_2] + + + +_0_8->_0_11 + + + + + +_0_13 + +20     Range , input: [2, 1], rsm: [Alias_0, Alias_2] + + + +_0_9->_0_13 + + + + + +_0_14 + +21     Nonterminal PointsTo, input: [0, 4] + + + +_0_10->_0_14 + + + + + +_0_15 + +22     Nonterminal FlowsTo, input: [4, 1] + + + +_0_11->_0_15 + + + + + +_0_12->_0_23 + + + + + +_0_34 + +4     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_0_12->_0_34 + + + + + +_0_16 +23     Intermediate input: 3, rsm: Alias_1, input: [2, 1] + + + +_0_13->_0_16 + + + + + +_0_17 + +24     Range , input: [0, 4], rsm: [PointsTo_0, PointsTo_5] + + + +_0_14->_0_17 + + + + + +_0_18 + +25     Range , input: [4, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_0_15->_0_18 + + + + + +_0_19 + +26     Range , input: [2, 3], rsm: [Alias_0, Alias_1] + + + +_0_16->_0_19 + + + + + +_0_20 + +27     Range , input: [3, 1], rsm: [Alias_1, Alias_2] + + + +_0_16->_0_20 + + + + + +_0_21 + +28     Terminal 'alloc', input: [0, 4] + + + +_0_17->_0_21 + + + + + +_0_22 +29     Intermediate input: 0, rsm: FlowsTo_1, input: [4, 1] + + + +_0_18->_0_22 + + + + + +_0_24 + +30     Nonterminal PointsTo, input: [2, 3] + + + +_0_19->_0_24 + + + + + +_0_25 + +31     Nonterminal FlowsTo, input: [3, 1] + + + +_0_20->_0_25 + + + + + +_0_26 + +32     Range , input: [4, 0], rsm: [FlowsTo_0, FlowsTo_1] + + + +_0_22->_0_26 + + + + + +_0_27 + +33     Range , input: [0, 1], rsm: [FlowsTo_1, FlowsTo_1] + + + +_0_22->_0_27 + + + + + +_0_37 +5     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_0_23->_0_37 + + + + + +_0_41 + +9     Range , input: [2, 3], rsm: [PointsTo_0, PointsTo_5] + + + +_0_24->_0_41 + + + + + +_0_28 + +34     Range , input: [3, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_0_25->_0_28 + + + + + +_0_29 + +35     Terminal 'alloc_r', input: [4, 0] + + + +_0_26->_0_29 + + + + + +_0_30 + +36     Terminal 'assign_r', input: [0, 1] + + + +_0_27->_0_30 + + + + + +_0_31 +37     Intermediate input: 2, rsm: FlowsTo_1, input: [3, 1] + + + +_0_28->_0_31 + + + + + +_0_32 + +38     Range , input: [3, 2], rsm: [FlowsTo_0, FlowsTo_1] + + + +_0_31->_0_32 + + + + + +_0_33 + +39     Range , input: [2, 1], rsm: [FlowsTo_1, FlowsTo_1] + + + +_0_31->_0_33 + + + + + +_0_35 + +40     Terminal 'alloc_r', input: [3, 2] + + + +_0_32->_0_35 + + + + + +_0_36 + +41     Terminal 'assign_r', input: [2, 1] + + + +_0_33->_0_36 + + + + + +_0_38 + +6     Nonterminal PointsTo, input: [2, 3] + + + +_0_34->_0_38 + + + + + +_0_39 + +7     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_37->_0_39 + + + + + +_0_40 + +8     Range , input: [1, 2], rsm: [S_1, S_0] + + + +_0_37->_0_40 + + + + + +_0_38->_0_41 + + + + + +_0_39->_0_2 + + + + + +_0_39->_0_3 + + + + + +_0_40->_0_4 + + + + + +_0_41->_0_5 + + + + + diff --git a/cfpq-app/src/main/resources/figures/graph_4.dot b/cfpq-app/src/main/resources/figures/graph_4.dot new file mode 100644 index 000000000..8ff719da2 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_4.dot @@ -0,0 +1,45 @@ +digraph { + start -> 1; + start -> 8; + 1 -> 0 [label = "alloc"]; + 0 -> 1 [label = "alloc_r"]; + 4 -> 2 [label = "alloc"]; + 2 -> 4 [label = "alloc_r"]; + 5 -> 3 [label = "alloc"]; + 3 -> 5 [label = "alloc_r"]; + 10 -> 12 [label = "alloc"]; + 12 -> 10 [label = "alloc_r"]; + 11 -> 13 [label = "alloc"]; + 13 -> 11 [label = "alloc_r"]; + 8 -> 6 [label = "assign"]; + 6 -> 8 [label = "assign_r"]; + 9 -> 7 [label = "assign"]; + 7 -> 9 [label = "assign_r"]; + 4 -> 1 [label = "store_0"]; + 1 -> 4 [label = "store_0_r"]; + 5 -> 1 [label = "store_1"]; + 1 -> 5 [label = "store_1_r"]; + 8 -> 10 [label = "store_2"]; + 10 -> 8 [label = "store_2_r"]; + 9 -> 11 [label = "store_3"]; + 11 -> 9 [label = "store_3_r"]; + 6 -> 4 [label = "load_0"]; + 4 -> 6 [label = "load_0_r"]; + 7 -> 5 [label = "load_1"]; + 5 -> 7 [label = "load_1_r"]; + + 0[label="new X()"]; + 1[label="n"]; + 2[label="new Z()"]; + 3[label="new U()"]; + 4[label="z"]; + 5[label="u"]; + 6[label="tmp1 // line 6"]; + 7[label="tmp2 // line 8"]; + 8[label="v"]; + 9[label="r"]; + 10[label="tmp3 // line 7"]; + 11[label="tmp4 // line 9"]; + 12[label="new Y()"]; + 13[label="new P()"]; +} diff --git a/cfpq-app/src/main/resources/figures/graph_4.dot.svg b/cfpq-app/src/main/resources/figures/graph_4.dot.svg new file mode 100644 index 000000000..9c065edf8 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_4.dot.svg @@ -0,0 +1,297 @@ + + + + + + +%503 + + + +start + +start + + + +1 + +n + + + +start->1 + + + + + +8 + +v + + + +start->8 + + + + + +0 + +new X() + + + +1->0 + + +alloc + + + +4 + +z + + + +1->4 + + +store_0_r + + + +5 + +u + + + +1->5 + + +store_1_r + + + +10 + +tmp3 // line 7 + + + +8->10 + + +store_2 + + + +6 + +tmp1 // line 6 + + + +8->6 + + +assign + + + +0->1 + + +alloc_r + + + +4->1 + + +store_0 + + + +2 + +new Z() + + + +4->2 + + +alloc + + + +4->6 + + +load_0_r + + + +2->4 + + +alloc_r + + + +5->1 + + +store_1 + + + +3 + +new U() + + + +5->3 + + +alloc + + + +7 + +tmp2 // line 8 + + + +5->7 + + +load_1_r + + + +3->5 + + +alloc_r + + + +10->8 + + +store_2_r + + + +12 + +new Y() + + + +10->12 + + +alloc + + + +12->10 + + +alloc_r + + + +11 + +tmp4 // line 9 + + + +13 + +new P() + + + +11->13 + + +alloc + + + +9 + +r + + + +11->9 + + +store_3_r + + + +13->11 + + +alloc_r + + + +6->8 + + +assign_r + + + +6->4 + + +load_0 + + + +9->11 + + +store_3 + + + +9->7 + + +assign + + + +7->5 + + +load_1 + + + +7->9 + + +assign_r + + + diff --git a/cfpq-app/src/main/resources/figures/graph_4_sppf.dot b/cfpq-app/src/main/resources/figures/graph_4_sppf.dot new file mode 100644 index 000000000..d7983d9c2 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_4_sppf.dot @@ -0,0 +1,573 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [1, 0]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [1, 0], rsm: [S_0, S_2]", shape = ellipse] +_0_2 [label = "2 Nonterminal PointsTo, input: [1, 0]", shape = invtrapezium] +_0_3 [label = "3 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_0_4 [label = "4 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_2 +_0_2->_0_3 +_0_3->_0_4 +} + +subgraph cluster_1{ +labelloc="t" +_1_0 [label = "0 Nonterminal S, input: [1, 12]", shape = invtrapezium] +_1_1 [label = "1 Range , input: [1, 12], rsm: [S_0, S_2]", shape = ellipse] +_1_2 [label = "10 Nonterminal Alias, input: [1, 8]", shape = invtrapezium] +_1_3 [label = "11 Terminal 'store_2', input: [8, 10]", shape = rectangle] +_1_4 [label = "12 Terminal 'alloc', input: [10, 12]", shape = rectangle] +_1_5 [label = "13 Range , input: [1, 8], rsm: [Alias_0, Alias_2]", shape = ellipse] +_1_6 [label = "14 Intermediate input: 0, rsm: Alias_1, input: [1, 8]", shape = plain] +_1_7 [label = "15 Range , input: [1, 0], rsm: [Alias_0, Alias_1]", shape = ellipse] +_1_8 [label = "16 Range , input: [0, 8], rsm: [Alias_1, Alias_2]", shape = ellipse] +_1_9 [label = "17 Nonterminal PointsTo, input: [1, 0]", shape = invtrapezium] +_1_10 [label = "18 Nonterminal FlowsTo, input: [0, 8]", shape = invtrapezium] +_1_11 [label = "19 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_12 [label = "2 Intermediate input: 10, rsm: S_0, input: [1, 12]", shape = plain] +_1_13 [label = "20 Range , input: [0, 8], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_14 [label = "21 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_1_15 [label = "22 Intermediate input: 6, rsm: FlowsTo_1, input: [0, 8]", shape = plain] +_1_16 [label = "23 Range , input: [0, 6], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_17 [label = "24 Range , input: [6, 8], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_1_18 [label = "25 Intermediate input: 4, rsm: FlowsTo_9, input: [0, 6]", shape = plain] +_1_19 [label = "26 Terminal 'assign_r', input: [6, 8]", shape = rectangle] +_1_20 [label = "27 Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_9]", shape = ellipse] +_1_21 [label = "28 Range , input: [4, 6], rsm: [FlowsTo_9, FlowsTo_1]", shape = ellipse] +_1_22 [label = "29 Intermediate input: 4, rsm: FlowsTo_2, input: [0, 4]", shape = plain] +_1_23 [label = "3 Range , input: [1, 10], rsm: [S_0, S_0]", shape = ellipse] +_1_24 [label = "30 Terminal 'load_0_r', input: [4, 6]", shape = rectangle] +_1_25 [label = "31 Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_2]", shape = ellipse] +_1_26 [label = "32 Range , input: [4, 4], rsm: [FlowsTo_2, FlowsTo_9]", shape = ellipse] +_1_27 [label = "33 Intermediate input: 1, rsm: FlowsTo_1, input: [0, 4]", shape = plain] +_1_28 [label = "34 Nonterminal Alias, input: [4, 4]", shape = invtrapezium] +_1_29 [label = "35 Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_30 [label = "36 Range , input: [1, 4], rsm: [FlowsTo_1, FlowsTo_2]", shape = ellipse] +_1_31 [label = "37 Range , input: [4, 4], rsm: [Alias_0, Alias_2]", shape = ellipse] +_1_32 [label = "38 Terminal 'alloc_r', input: [0, 1]", shape = rectangle] +_1_33 [label = "39 Terminal 'store_0_r', input: [1, 4]", shape = rectangle] +_1_34 [label = "4 Range , input: [10, 12], rsm: [S_0, S_2]", shape = ellipse] +_1_35 [label = "40 Intermediate input: 2, rsm: Alias_1, input: [4, 4]", shape = plain] +_1_36 [label = "41 Range , input: [4, 2], rsm: [Alias_0, Alias_1]", shape = ellipse] +_1_37 [label = "42 Range , input: [2, 4], rsm: [Alias_1, Alias_2]", shape = ellipse] +_1_38 [label = "43 Nonterminal PointsTo, input: [4, 2]", shape = invtrapezium] +_1_39 [label = "44 Nonterminal FlowsTo, input: [2, 4]", shape = invtrapezium] +_1_40 [label = "45 Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_41 [label = "46 Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_42 [label = "47 Terminal 'alloc', input: [4, 2]", shape = rectangle] +_1_43 [label = "48 Terminal 'alloc_r', input: [2, 4]", shape = rectangle] +_1_44 [label = "5 Intermediate input: 8, rsm: S_1, input: [1, 10]", shape = plain] +_1_45 [label = "6 Nonterminal PointsTo, input: [10, 12]", shape = invtrapezium] +_1_46 [label = "7 Range , input: [1, 8], rsm: [S_0, S_1]", shape = ellipse] +_1_47 [label = "8 Range , input: [8, 10], rsm: [S_1, S_0]", shape = ellipse] +_1_48 [label = "9 Range , input: [10, 12], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_1_0->_1_1 +_1_1->_1_12 +_1_2->_1_5 +_1_5->_1_6 +_1_6->_1_7 +_1_6->_1_8 +_1_7->_1_9 +_1_8->_1_10 +_1_9->_1_11 +_1_10->_1_13 +_1_11->_1_14 +_1_12->_1_23 +_1_12->_1_34 +_1_13->_1_15 +_1_15->_1_16 +_1_15->_1_17 +_1_16->_1_18 +_1_17->_1_19 +_1_18->_1_20 +_1_18->_1_21 +_1_20->_1_22 +_1_21->_1_24 +_1_22->_1_25 +_1_22->_1_26 +_1_23->_1_44 +_1_25->_1_27 +_1_26->_1_28 +_1_27->_1_29 +_1_27->_1_30 +_1_28->_1_31 +_1_29->_1_32 +_1_30->_1_33 +_1_31->_1_35 +_1_34->_1_45 +_1_35->_1_36 +_1_35->_1_37 +_1_36->_1_38 +_1_37->_1_39 +_1_38->_1_40 +_1_39->_1_41 +_1_40->_1_42 +_1_41->_1_43 +_1_44->_1_46 +_1_44->_1_47 +_1_45->_1_48 +_1_46->_1_2 +_1_47->_1_3 +_1_48->_1_4 +} + +subgraph cluster_2{ +labelloc="t" +_2_0 [label = "0 Nonterminal S, input: [1, 13]", shape = invtrapezium] +_2_1 [label = "1 Range , input: [1, 13], rsm: [S_0, S_2]", shape = ellipse] +_2_2 [label = "10 Nonterminal Alias, input: [1, 9]", shape = invtrapezium] +_2_3 [label = "11 Terminal 'store_3', input: [9, 11]", shape = rectangle] +_2_4 [label = "12 Terminal 'alloc', input: [11, 13]", shape = rectangle] +_2_5 [label = "13 Range , input: [1, 9], rsm: [Alias_0, Alias_2]", shape = ellipse] +_2_6 [label = "14 Intermediate input: 0, rsm: Alias_1, input: [1, 9]", shape = plain] +_2_7 [label = "15 Range , input: [1, 0], rsm: [Alias_0, Alias_1]", shape = ellipse] +_2_8 [label = "16 Range , input: [0, 9], rsm: [Alias_1, Alias_2]", shape = ellipse] +_2_9 [label = "17 Nonterminal PointsTo, input: [1, 0]", shape = invtrapezium] +_2_10 [label = "18 Nonterminal FlowsTo, input: [0, 9]", shape = invtrapezium] +_2_11 [label = "19 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_2_12 [label = "2 Intermediate input: 11, rsm: S_0, input: [1, 13]", shape = plain] +_2_13 [label = "20 Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_14 [label = "21 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_2_15 [label = "22 Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9]", shape = plain] +_2_16 [label = "23 Range , input: [0, 7], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_17 [label = "24 Range , input: [7, 9], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_2_18 [label = "25 Intermediate input: 5, rsm: FlowsTo_8, input: [0, 7]", shape = plain] +_2_19 [label = "26 Terminal 'assign_r', input: [7, 9]", shape = rectangle] +_2_20 [label = "27 Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_8]", shape = ellipse] +_2_21 [label = "28 Range , input: [5, 7], rsm: [FlowsTo_8, FlowsTo_1]", shape = ellipse] +_2_22 [label = "29 Intermediate input: 5, rsm: FlowsTo_3, input: [0, 5]", shape = plain] +_2_23 [label = "3 Range , input: [1, 11], rsm: [S_0, S_0]", shape = ellipse] +_2_24 [label = "30 Terminal 'load_1_r', input: [5, 7]", shape = rectangle] +_2_25 [label = "31 Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_3]", shape = ellipse] +_2_26 [label = "32 Range , input: [5, 5], rsm: [FlowsTo_3, FlowsTo_8]", shape = ellipse] +_2_27 [label = "33 Intermediate input: 1, rsm: FlowsTo_1, input: [0, 5]", shape = plain] +_2_28 [label = "34 Nonterminal Alias, input: [5, 5]", shape = invtrapezium] +_2_29 [label = "35 Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_30 [label = "36 Range , input: [1, 5], rsm: [FlowsTo_1, FlowsTo_3]", shape = ellipse] +_2_31 [label = "37 Range , input: [5, 5], rsm: [Alias_0, Alias_2]", shape = ellipse] +_2_32 [label = "38 Terminal 'alloc_r', input: [0, 1]", shape = rectangle] +_2_33 [label = "39 Terminal 'store_1_r', input: [1, 5]", shape = rectangle] +_2_34 [label = "4 Range , input: [11, 13], rsm: [S_0, S_2]", shape = ellipse] +_2_35 [label = "40 Intermediate input: 3, rsm: Alias_1, input: [5, 5]", shape = plain] +_2_36 [label = "41 Range , input: [5, 3], rsm: [Alias_0, Alias_1]", shape = ellipse] +_2_37 [label = "42 Range , input: [3, 5], rsm: [Alias_1, Alias_2]", shape = ellipse] +_2_38 [label = "43 Nonterminal PointsTo, input: [5, 3]", shape = invtrapezium] +_2_39 [label = "44 Nonterminal FlowsTo, input: [3, 5]", shape = invtrapezium] +_2_40 [label = "45 Range , input: [5, 3], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_2_41 [label = "46 Range , input: [3, 5], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_2_42 [label = "47 Terminal 'alloc', input: [5, 3]", shape = rectangle] +_2_43 [label = "48 Terminal 'alloc_r', input: [3, 5]", shape = rectangle] +_2_44 [label = "5 Intermediate input: 9, rsm: S_1, input: [1, 11]", shape = plain] +_2_45 [label = "6 Nonterminal PointsTo, input: [11, 13]", shape = invtrapezium] +_2_46 [label = "7 Range , input: [1, 9], rsm: [S_0, S_1]", shape = ellipse] +_2_47 [label = "8 Range , input: [9, 11], rsm: [S_1, S_0]", shape = ellipse] +_2_48 [label = "9 Range , input: [11, 13], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_2_0->_2_1 +_2_1->_2_12 +_2_2->_2_5 +_2_5->_2_6 +_2_6->_2_7 +_2_6->_2_8 +_2_7->_2_9 +_2_8->_2_10 +_2_9->_2_11 +_2_10->_2_13 +_2_11->_2_14 +_2_12->_2_23 +_2_12->_2_34 +_2_13->_2_15 +_2_15->_2_16 +_2_15->_2_17 +_2_16->_2_18 +_2_17->_2_19 +_2_18->_2_20 +_2_18->_2_21 +_2_20->_2_22 +_2_21->_2_24 +_2_22->_2_25 +_2_22->_2_26 +_2_23->_2_44 +_2_25->_2_27 +_2_26->_2_28 +_2_27->_2_29 +_2_27->_2_30 +_2_28->_2_31 +_2_29->_2_32 +_2_30->_2_33 +_2_31->_2_35 +_2_34->_2_45 +_2_35->_2_36 +_2_35->_2_37 +_2_36->_2_38 +_2_37->_2_39 +_2_38->_2_40 +_2_39->_2_41 +_2_40->_2_42 +_2_41->_2_43 +_2_44->_2_46 +_2_44->_2_47 +_2_45->_2_48 +_2_46->_2_2 +_2_47->_2_3 +_2_48->_2_4 +} + +subgraph cluster_3{ +labelloc="t" +_3_0 [label = "0 Nonterminal S, input: [8, 0]", shape = invtrapezium] +_3_1 [label = "1 Range , input: [8, 0], rsm: [S_0, S_2]", shape = ellipse] +_3_2 [label = "10 Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0]", shape = ellipse] +_3_3 [label = "11 Intermediate input: 4, rsm: PointsTo_1, input: [8, 4]", shape = plain] +_3_4 [label = "12 Terminal 'store_0', input: [4, 1]", shape = rectangle] +_3_5 [label = "13 Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_3_6 [label = "14 Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9]", shape = ellipse] +_3_7 [label = "15 Intermediate input: 6, rsm: PointsTo_0, input: [8, 4]", shape = plain] +_3_8 [label = "16 Nonterminal Alias, input: [4, 4]", shape = invtrapezium] +_3_9 [label = "17 Range , input: [8, 6], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_3_10 [label = "18 Range , input: [6, 4], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_3_11 [label = "19 Range , input: [4, 4], rsm: [Alias_0, Alias_2]", shape = ellipse] +_3_12 [label = "2 Nonterminal PointsTo, input: [8, 0]", shape = invtrapezium] +_3_13 [label = "20 Terminal 'assign', input: [8, 6]", shape = rectangle] +_3_14 [label = "21 Terminal 'load_0', input: [6, 4]", shape = rectangle] +_3_15 [label = "22 Intermediate input: 2, rsm: Alias_1, input: [4, 4]", shape = plain] +_3_16 [label = "23 Range , input: [4, 2], rsm: [Alias_0, Alias_1]", shape = ellipse] +_3_17 [label = "24 Range , input: [2, 4], rsm: [Alias_1, Alias_2]", shape = ellipse] +_3_18 [label = "25 Nonterminal PointsTo, input: [4, 2]", shape = invtrapezium] +_3_19 [label = "26 Nonterminal FlowsTo, input: [2, 4]", shape = invtrapezium] +_3_20 [label = "27 Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_3_21 [label = "28 Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_3_22 [label = "29 Terminal 'alloc', input: [4, 2]", shape = rectangle] +_3_23 [label = "3 Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_3_24 [label = "30 Terminal 'alloc_r', input: [2, 4]", shape = rectangle] +_3_25 [label = "4 Intermediate input: 1, rsm: PointsTo_0, input: [8, 0]", shape = plain] +_3_26 [label = "5 Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_3_27 [label = "6 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_3_28 [label = "7 Intermediate input: 4, rsm: PointsTo_9, input: [8, 1]", shape = plain] +_3_29 [label = "8 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_3_30 [label = "9 Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9]", shape = ellipse] +_3_0->_3_1 +_3_1->_3_12 +_3_2->_3_4 +_3_3->_3_5 +_3_3->_3_6 +_3_5->_3_7 +_3_6->_3_8 +_3_7->_3_9 +_3_7->_3_10 +_3_8->_3_11 +_3_9->_3_13 +_3_10->_3_14 +_3_11->_3_15 +_3_12->_3_23 +_3_15->_3_16 +_3_15->_3_17 +_3_16->_3_18 +_3_17->_3_19 +_3_18->_3_20 +_3_19->_3_21 +_3_20->_3_22 +_3_21->_3_24 +_3_23->_3_25 +_3_25->_3_26 +_3_25->_3_27 +_3_26->_3_28 +_3_27->_3_29 +_3_28->_3_30 +_3_28->_3_2 +_3_30->_3_3 +} + +subgraph cluster_4{ +labelloc="t" +_4_0 [label = "0 Nonterminal S, input: [8, 12]", shape = invtrapezium] +_4_1 [label = "1 Range , input: [8, 12], rsm: [S_0, S_2]", shape = ellipse] +_4_2 [label = "10 Range , input: [10, 12], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_4_3 [label = "11 Nonterminal Alias, input: [8, 8]", shape = invtrapezium] +_4_4 [label = "12 Terminal 'alloc', input: [10, 12]", shape = rectangle] +_4_5 [label = "13 Range , input: [8, 8], rsm: [Alias_0, Alias_2]", shape = ellipse] +_4_6 [label = "14 Intermediate input: 0, rsm: Alias_1, input: [8, 8]", shape = plain] +_4_7 [label = "15 Range , input: [8, 0], rsm: [Alias_0, Alias_1]", shape = ellipse] +_4_8 [label = "16 Range , input: [0, 8], rsm: [Alias_1, Alias_2]", shape = ellipse] +_4_9 [label = "17 Nonterminal PointsTo, input: [8, 0]", shape = invtrapezium] +_4_10 [label = "18 Nonterminal FlowsTo, input: [0, 8]", shape = invtrapezium] +_4_11 [label = "19 Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_4_12 [label = "2 Intermediate input: 10, rsm: S_0, input: [8, 12]", shape = plain] +_4_13 [label = "20 Range , input: [0, 8], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_4_14 [label = "21 Intermediate input: 1, rsm: PointsTo_0, input: [8, 0]", shape = plain] +_4_15 [label = "22 Intermediate input: 6, rsm: FlowsTo_1, input: [0, 8]", shape = plain] +_4_16 [label = "23 Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_4_17 [label = "24 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_4_18 [label = "25 Range , input: [0, 6], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_4_19 [label = "26 Range , input: [6, 8], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_4_20 [label = "27 Intermediate input: 4, rsm: PointsTo_9, input: [8, 1]", shape = plain] +_4_21 [label = "28 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_4_22 [label = "29 Intermediate input: 4, rsm: FlowsTo_9, input: [0, 6]", shape = plain] +_4_23 [label = "3 Range , input: [8, 10], rsm: [S_0, S_0]", shape = ellipse] +_4_24 [label = "30 Terminal 'assign_r', input: [6, 8]", shape = rectangle] +_4_25 [label = "31 Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9]", shape = ellipse] +_4_26 [label = "32 Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0]", shape = ellipse] +_4_27 [label = "33 Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_9]", shape = ellipse] +_4_28 [label = "34 Range , input: [4, 6], rsm: [FlowsTo_9, FlowsTo_1]", shape = ellipse] +_4_29 [label = "35 Intermediate input: 4, rsm: PointsTo_1, input: [8, 4]", shape = plain] +_4_30 [label = "36 Terminal 'store_0', input: [4, 1]", shape = rectangle] +_4_31 [label = "37 Intermediate input: 4, rsm: FlowsTo_2, input: [0, 4]", shape = plain] +_4_32 [label = "38 Terminal 'load_0_r', input: [4, 6]", shape = rectangle] +_4_33 [label = "39 Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_4_34 [label = "4 Range , input: [10, 12], rsm: [S_0, S_2]", shape = ellipse] +_4_35 [label = "40 Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9]", shape = ellipse] +_4_36 [label = "41 Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_2]", shape = ellipse] +_4_37 [label = "42 Range , input: [4, 4], rsm: [FlowsTo_2, FlowsTo_9]", shape = ellipse] +_4_38 [label = "43 Intermediate input: 6, rsm: PointsTo_0, input: [8, 4]", shape = plain] +_4_39 [label = "44 Nonterminal Alias, input: [4, 4]", shape = invtrapezium] +_4_40 [label = "45 Intermediate input: 1, rsm: FlowsTo_1, input: [0, 4]", shape = plain] +_4_41 [label = "46 Nonterminal Alias, input: [4, 4]", shape = invtrapezium] +_4_42 [label = "47 Range , input: [8, 6], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_4_43 [label = "48 Range , input: [6, 4], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_4_44 [label = "49 Range , input: [4, 4], rsm: [Alias_0, Alias_2]", shape = ellipse] +_4_45 [label = "5 Terminal 'store_2', input: [8, 10]", shape = rectangle] +_4_46 [label = "50 Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_4_47 [label = "51 Range , input: [1, 4], rsm: [FlowsTo_1, FlowsTo_2]", shape = ellipse] +_4_48 [label = "52 Terminal 'assign', input: [8, 6]", shape = rectangle] +_4_49 [label = "53 Terminal 'load_0', input: [6, 4]", shape = rectangle] +_4_50 [label = "54 Intermediate input: 2, rsm: Alias_1, input: [4, 4]", shape = plain] +_4_51 [label = "55 Terminal 'alloc_r', input: [0, 1]", shape = rectangle] +_4_52 [label = "56 Terminal 'store_0_r', input: [1, 4]", shape = rectangle] +_4_53 [label = "57 Range , input: [4, 2], rsm: [Alias_0, Alias_1]", shape = ellipse] +_4_54 [label = "58 Range , input: [2, 4], rsm: [Alias_1, Alias_2]", shape = ellipse] +_4_55 [label = "59 Nonterminal PointsTo, input: [4, 2]", shape = invtrapezium] +_4_56 [label = "6 Intermediate input: 8, rsm: S_1, input: [8, 10]", shape = plain] +_4_57 [label = "60 Nonterminal FlowsTo, input: [2, 4]", shape = invtrapezium] +_4_58 [label = "61 Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_4_59 [label = "62 Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_4_60 [label = "63 Terminal 'alloc', input: [4, 2]", shape = rectangle] +_4_61 [label = "64 Terminal 'alloc_r', input: [2, 4]", shape = rectangle] +_4_62 [label = "7 Nonterminal PointsTo, input: [10, 12]", shape = invtrapezium] +_4_63 [label = "8 Range , input: [8, 8], rsm: [S_0, S_1]", shape = ellipse] +_4_64 [label = "9 Range , input: [8, 10], rsm: [S_1, S_0]", shape = ellipse] +_4_0->_4_1 +_4_1->_4_12 +_4_2->_4_4 +_4_3->_4_5 +_4_5->_4_6 +_4_6->_4_7 +_4_6->_4_8 +_4_7->_4_9 +_4_8->_4_10 +_4_9->_4_11 +_4_10->_4_13 +_4_11->_4_14 +_4_12->_4_23 +_4_12->_4_34 +_4_13->_4_15 +_4_14->_4_16 +_4_14->_4_17 +_4_15->_4_18 +_4_15->_4_19 +_4_16->_4_20 +_4_17->_4_21 +_4_18->_4_22 +_4_19->_4_24 +_4_20->_4_25 +_4_20->_4_26 +_4_22->_4_27 +_4_22->_4_28 +_4_23->_4_45 +_4_23->_4_56 +_4_25->_4_29 +_4_26->_4_30 +_4_27->_4_31 +_4_28->_4_32 +_4_29->_4_33 +_4_29->_4_35 +_4_31->_4_36 +_4_31->_4_37 +_4_33->_4_38 +_4_34->_4_62 +_4_35->_4_39 +_4_36->_4_40 +_4_37->_4_41 +_4_38->_4_42 +_4_38->_4_43 +_4_39->_4_44 +_4_40->_4_46 +_4_40->_4_47 +_4_41->_4_44 +_4_42->_4_48 +_4_43->_4_49 +_4_44->_4_50 +_4_46->_4_51 +_4_47->_4_52 +_4_50->_4_53 +_4_50->_4_54 +_4_53->_4_55 +_4_54->_4_57 +_4_55->_4_58 +_4_56->_4_63 +_4_56->_4_64 +_4_57->_4_59 +_4_58->_4_60 +_4_59->_4_61 +_4_62->_4_2 +_4_63->_4_3 +_4_64->_4_45 +} + +subgraph cluster_5{ +labelloc="t" +_5_0 [label = "0 Nonterminal S, input: [8, 13]", shape = invtrapezium] +_5_1 [label = "1 Range , input: [8, 13], rsm: [S_0, S_2]", shape = ellipse] +_5_2 [label = "10 Nonterminal Alias, input: [8, 9]", shape = invtrapezium] +_5_3 [label = "11 Terminal 'store_3', input: [9, 11]", shape = rectangle] +_5_4 [label = "12 Terminal 'alloc', input: [11, 13]", shape = rectangle] +_5_5 [label = "13 Range , input: [8, 9], rsm: [Alias_0, Alias_2]", shape = ellipse] +_5_6 [label = "14 Intermediate input: 0, rsm: Alias_1, input: [8, 9]", shape = plain] +_5_7 [label = "15 Range , input: [8, 0], rsm: [Alias_0, Alias_1]", shape = ellipse] +_5_8 [label = "16 Range , input: [0, 9], rsm: [Alias_1, Alias_2]", shape = ellipse] +_5_9 [label = "17 Nonterminal PointsTo, input: [8, 0]", shape = invtrapezium] +_5_10 [label = "18 Nonterminal FlowsTo, input: [0, 9]", shape = invtrapezium] +_5_11 [label = "19 Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_5_12 [label = "2 Intermediate input: 11, rsm: S_0, input: [8, 13]", shape = plain] +_5_13 [label = "20 Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_5_14 [label = "21 Intermediate input: 1, rsm: PointsTo_0, input: [8, 0]", shape = plain] +_5_15 [label = "22 Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9]", shape = plain] +_5_16 [label = "23 Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_5_17 [label = "24 Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_5_18 [label = "25 Range , input: [0, 7], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_5_19 [label = "26 Range , input: [7, 9], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] +_5_20 [label = "27 Intermediate input: 4, rsm: PointsTo_9, input: [8, 1]", shape = plain] +_5_21 [label = "28 Terminal 'alloc', input: [1, 0]", shape = rectangle] +_5_22 [label = "29 Intermediate input: 5, rsm: FlowsTo_8, input: [0, 7]", shape = plain] +_5_23 [label = "3 Range , input: [8, 11], rsm: [S_0, S_0]", shape = ellipse] +_5_24 [label = "30 Terminal 'assign_r', input: [7, 9]", shape = rectangle] +_5_25 [label = "31 Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9]", shape = ellipse] +_5_26 [label = "32 Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0]", shape = ellipse] +_5_27 [label = "33 Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_8]", shape = ellipse] +_5_28 [label = "34 Range , input: [5, 7], rsm: [FlowsTo_8, FlowsTo_1]", shape = ellipse] +_5_29 [label = "35 Intermediate input: 4, rsm: PointsTo_1, input: [8, 4]", shape = plain] +_5_30 [label = "36 Terminal 'store_0', input: [4, 1]", shape = rectangle] +_5_31 [label = "37 Intermediate input: 5, rsm: FlowsTo_3, input: [0, 5]", shape = plain] +_5_32 [label = "38 Terminal 'load_1_r', input: [5, 7]", shape = rectangle] +_5_33 [label = "39 Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_5_34 [label = "4 Range , input: [11, 13], rsm: [S_0, S_2]", shape = ellipse] +_5_35 [label = "40 Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9]", shape = ellipse] +_5_36 [label = "41 Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_3]", shape = ellipse] +_5_37 [label = "42 Range , input: [5, 5], rsm: [FlowsTo_3, FlowsTo_8]", shape = ellipse] +_5_38 [label = "43 Intermediate input: 6, rsm: PointsTo_0, input: [8, 4]", shape = plain] +_5_39 [label = "44 Nonterminal Alias, input: [4, 4]", shape = invtrapezium] +_5_40 [label = "45 Intermediate input: 1, rsm: FlowsTo_1, input: [0, 5]", shape = plain] +_5_41 [label = "46 Nonterminal Alias, input: [5, 5]", shape = invtrapezium] +_5_42 [label = "47 Range , input: [8, 6], rsm: [PointsTo_0, PointsTo_0]", shape = ellipse] +_5_43 [label = "48 Range , input: [6, 4], rsm: [PointsTo_0, PointsTo_1]", shape = ellipse] +_5_44 [label = "49 Range , input: [4, 4], rsm: [Alias_0, Alias_2]", shape = ellipse] +_5_45 [label = "5 Intermediate input: 9, rsm: S_1, input: [8, 11]", shape = plain] +_5_46 [label = "50 Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_5_47 [label = "51 Range , input: [1, 5], rsm: [FlowsTo_1, FlowsTo_3]", shape = ellipse] +_5_48 [label = "52 Range , input: [5, 5], rsm: [Alias_0, Alias_2]", shape = ellipse] +_5_49 [label = "53 Terminal 'assign', input: [8, 6]", shape = rectangle] +_5_50 [label = "54 Terminal 'load_0', input: [6, 4]", shape = rectangle] +_5_51 [label = "55 Intermediate input: 2, rsm: Alias_1, input: [4, 4]", shape = plain] +_5_52 [label = "56 Terminal 'alloc_r', input: [0, 1]", shape = rectangle] +_5_53 [label = "57 Terminal 'store_1_r', input: [1, 5]", shape = rectangle] +_5_54 [label = "58 Intermediate input: 3, rsm: Alias_1, input: [5, 5]", shape = plain] +_5_55 [label = "59 Range , input: [4, 2], rsm: [Alias_0, Alias_1]", shape = ellipse] +_5_56 [label = "6 Nonterminal PointsTo, input: [11, 13]", shape = invtrapezium] +_5_57 [label = "60 Range , input: [2, 4], rsm: [Alias_1, Alias_2]", shape = ellipse] +_5_58 [label = "61 Range , input: [5, 3], rsm: [Alias_0, Alias_1]", shape = ellipse] +_5_59 [label = "62 Range , input: [3, 5], rsm: [Alias_1, Alias_2]", shape = ellipse] +_5_60 [label = "63 Nonterminal PointsTo, input: [4, 2]", shape = invtrapezium] +_5_61 [label = "64 Nonterminal FlowsTo, input: [2, 4]", shape = invtrapezium] +_5_62 [label = "65 Nonterminal PointsTo, input: [5, 3]", shape = invtrapezium] +_5_63 [label = "66 Nonterminal FlowsTo, input: [3, 5]", shape = invtrapezium] +_5_64 [label = "67 Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_5_65 [label = "68 Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_5_66 [label = "69 Range , input: [5, 3], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_5_67 [label = "7 Range , input: [8, 9], rsm: [S_0, S_1]", shape = ellipse] +_5_68 [label = "70 Range , input: [3, 5], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_5_69 [label = "71 Terminal 'alloc', input: [4, 2]", shape = rectangle] +_5_70 [label = "72 Terminal 'alloc_r', input: [2, 4]", shape = rectangle] +_5_71 [label = "73 Terminal 'alloc', input: [5, 3]", shape = rectangle] +_5_72 [label = "74 Terminal 'alloc_r', input: [3, 5]", shape = rectangle] +_5_73 [label = "8 Range , input: [9, 11], rsm: [S_1, S_0]", shape = ellipse] +_5_74 [label = "9 Range , input: [11, 13], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] +_5_0->_5_1 +_5_1->_5_12 +_5_2->_5_5 +_5_5->_5_6 +_5_6->_5_7 +_5_6->_5_8 +_5_7->_5_9 +_5_8->_5_10 +_5_9->_5_11 +_5_10->_5_13 +_5_11->_5_14 +_5_12->_5_23 +_5_12->_5_34 +_5_13->_5_15 +_5_14->_5_16 +_5_14->_5_17 +_5_15->_5_18 +_5_15->_5_19 +_5_16->_5_20 +_5_17->_5_21 +_5_18->_5_22 +_5_19->_5_24 +_5_20->_5_25 +_5_20->_5_26 +_5_22->_5_27 +_5_22->_5_28 +_5_23->_5_45 +_5_25->_5_29 +_5_26->_5_30 +_5_27->_5_31 +_5_28->_5_32 +_5_29->_5_33 +_5_29->_5_35 +_5_31->_5_36 +_5_31->_5_37 +_5_33->_5_38 +_5_34->_5_56 +_5_35->_5_39 +_5_36->_5_40 +_5_37->_5_41 +_5_38->_5_42 +_5_38->_5_43 +_5_39->_5_44 +_5_40->_5_46 +_5_40->_5_47 +_5_41->_5_48 +_5_42->_5_49 +_5_43->_5_50 +_5_44->_5_51 +_5_45->_5_67 +_5_45->_5_73 +_5_46->_5_52 +_5_47->_5_53 +_5_48->_5_54 +_5_51->_5_55 +_5_51->_5_57 +_5_54->_5_58 +_5_54->_5_59 +_5_55->_5_60 +_5_56->_5_74 +_5_57->_5_61 +_5_58->_5_62 +_5_59->_5_63 +_5_60->_5_64 +_5_61->_5_65 +_5_62->_5_66 +_5_63->_5_68 +_5_64->_5_69 +_5_65->_5_70 +_5_66->_5_71 +_5_67->_5_2 +_5_68->_5_72 +_5_73->_5_3 +_5_74->_5_4 +} + +} + diff --git a/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg b/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg new file mode 100644 index 000000000..31a6dd901 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg @@ -0,0 +1,3255 @@ + + + + + + +g + + +cluster_5 + + + +cluster_2 + + + +cluster_4 + + + +cluster_0 + + + +cluster_1 + + + +cluster_3 + + + + +_0_0 + +0     Nonterminal S, input: [1, 0] + + + +_0_1 + +1     Range , input: [1, 0], rsm: [S_0, S_2] + + + +_0_0->_0_1 + + + + + +_0_2 + +2     Nonterminal PointsTo, input: [1, 0] + + + +_0_1->_0_2 + + + + + +_0_3 + +3     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_0_2->_0_3 + + + + + +_0_4 + +4     Terminal 'alloc', input: [1, 0] + + + +_0_3->_0_4 + + + + + +_1_0 + +0     Nonterminal S, input: [1, 12] + + + +_1_1 + +1     Range , input: [1, 12], rsm: [S_0, S_2] + + + +_1_0->_1_1 + + + + + +_1_12 +2     Intermediate input: 10, rsm: S_0, input: [1, 12] + + + +_1_1->_1_12 + + + + + +_1_2 + +10     Nonterminal Alias, input: [1, 8] + + + +_1_5 + +13     Range , input: [1, 8], rsm: [Alias_0, Alias_2] + + + +_1_2->_1_5 + + + + + +_1_3 + +11     Terminal 'store_2', input: [8, 10] + + + +_1_4 + +12     Terminal 'alloc', input: [10, 12] + + + +_1_6 +14     Intermediate input: 0, rsm: Alias_1, input: [1, 8] + + + +_1_5->_1_6 + + + + + +_1_7 + +15     Range , input: [1, 0], rsm: [Alias_0, Alias_1] + + + +_1_6->_1_7 + + + + + +_1_8 + +16     Range , input: [0, 8], rsm: [Alias_1, Alias_2] + + + +_1_6->_1_8 + + + + + +_1_9 + +17     Nonterminal PointsTo, input: [1, 0] + + + +_1_7->_1_9 + + + + + +_1_10 + +18     Nonterminal FlowsTo, input: [0, 8] + + + +_1_8->_1_10 + + + + + +_1_11 + +19     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_1_9->_1_11 + + + + + +_1_13 + +20     Range , input: [0, 8], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_10->_1_13 + + + + + +_1_14 + +21     Terminal 'alloc', input: [1, 0] + + + +_1_11->_1_14 + + + + + +_1_23 + +3     Range , input: [1, 10], rsm: [S_0, S_0] + + + +_1_12->_1_23 + + + + + +_1_34 + +4     Range , input: [10, 12], rsm: [S_0, S_2] + + + +_1_12->_1_34 + + + + + +_1_15 +22     Intermediate input: 6, rsm: FlowsTo_1, input: [0, 8] + + + +_1_13->_1_15 + + + + + +_1_16 + +23     Range , input: [0, 6], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_15->_1_16 + + + + + +_1_17 + +24     Range , input: [6, 8], rsm: [FlowsTo_1, FlowsTo_1] + + + +_1_15->_1_17 + + + + + +_1_18 +25     Intermediate input: 4, rsm: FlowsTo_9, input: [0, 6] + + + +_1_16->_1_18 + + + + + +_1_19 + +26     Terminal 'assign_r', input: [6, 8] + + + +_1_17->_1_19 + + + + + +_1_20 + +27     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_9] + + + +_1_18->_1_20 + + + + + +_1_21 + +28     Range , input: [4, 6], rsm: [FlowsTo_9, FlowsTo_1] + + + +_1_18->_1_21 + + + + + +_1_22 +29     Intermediate input: 4, rsm: FlowsTo_2, input: [0, 4] + + + +_1_20->_1_22 + + + + + +_1_24 + +30     Terminal 'load_0_r', input: [4, 6] + + + +_1_21->_1_24 + + + + + +_1_25 + +31     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_2] + + + +_1_22->_1_25 + + + + + +_1_26 + +32     Range , input: [4, 4], rsm: [FlowsTo_2, FlowsTo_9] + + + +_1_22->_1_26 + + + + + +_1_44 +5     Intermediate input: 8, rsm: S_1, input: [1, 10] + + + +_1_23->_1_44 + + + + + +_1_27 +33     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 4] + + + +_1_25->_1_27 + + + + + +_1_28 + +34     Nonterminal Alias, input: [4, 4] + + + +_1_26->_1_28 + + + + + +_1_29 + +35     Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_27->_1_29 + + + + + +_1_30 + +36     Range , input: [1, 4], rsm: [FlowsTo_1, FlowsTo_2] + + + +_1_27->_1_30 + + + + + +_1_31 + +37     Range , input: [4, 4], rsm: [Alias_0, Alias_2] + + + +_1_28->_1_31 + + + + + +_1_32 + +38     Terminal 'alloc_r', input: [0, 1] + + + +_1_29->_1_32 + + + + + +_1_33 + +39     Terminal 'store_0_r', input: [1, 4] + + + +_1_30->_1_33 + + + + + +_1_35 +40     Intermediate input: 2, rsm: Alias_1, input: [4, 4] + + + +_1_31->_1_35 + + + + + +_1_45 + +6     Nonterminal PointsTo, input: [10, 12] + + + +_1_34->_1_45 + + + + + +_1_36 + +41     Range , input: [4, 2], rsm: [Alias_0, Alias_1] + + + +_1_35->_1_36 + + + + + +_1_37 + +42     Range , input: [2, 4], rsm: [Alias_1, Alias_2] + + + +_1_35->_1_37 + + + + + +_1_38 + +43     Nonterminal PointsTo, input: [4, 2] + + + +_1_36->_1_38 + + + + + +_1_39 + +44     Nonterminal FlowsTo, input: [2, 4] + + + +_1_37->_1_39 + + + + + +_1_40 + +45     Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5] + + + +_1_38->_1_40 + + + + + +_1_41 + +46     Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1] + + + +_1_39->_1_41 + + + + + +_1_42 + +47     Terminal 'alloc', input: [4, 2] + + + +_1_40->_1_42 + + + + + +_1_43 + +48     Terminal 'alloc_r', input: [2, 4] + + + +_1_41->_1_43 + + + + + +_1_46 + +7     Range , input: [1, 8], rsm: [S_0, S_1] + + + +_1_44->_1_46 + + + + + +_1_47 + +8     Range , input: [8, 10], rsm: [S_1, S_0] + + + +_1_44->_1_47 + + + + + +_1_48 + +9     Range , input: [10, 12], rsm: [PointsTo_0, PointsTo_5] + + + +_1_45->_1_48 + + + + + +_1_46->_1_2 + + + + + +_1_47->_1_3 + + + + + +_1_48->_1_4 + + + + + +_2_0 + +0     Nonterminal S, input: [1, 13] + + + +_2_1 + +1     Range , input: [1, 13], rsm: [S_0, S_2] + + + +_2_0->_2_1 + + + + + +_2_12 +2     Intermediate input: 11, rsm: S_0, input: [1, 13] + + + +_2_1->_2_12 + + + + + +_2_2 + +10     Nonterminal Alias, input: [1, 9] + + + +_2_5 + +13     Range , input: [1, 9], rsm: [Alias_0, Alias_2] + + + +_2_2->_2_5 + + + + + +_2_3 + +11     Terminal 'store_3', input: [9, 11] + + + +_2_4 + +12     Terminal 'alloc', input: [11, 13] + + + +_2_6 +14     Intermediate input: 0, rsm: Alias_1, input: [1, 9] + + + +_2_5->_2_6 + + + + + +_2_7 + +15     Range , input: [1, 0], rsm: [Alias_0, Alias_1] + + + +_2_6->_2_7 + + + + + +_2_8 + +16     Range , input: [0, 9], rsm: [Alias_1, Alias_2] + + + +_2_6->_2_8 + + + + + +_2_9 + +17     Nonterminal PointsTo, input: [1, 0] + + + +_2_7->_2_9 + + + + + +_2_10 + +18     Nonterminal FlowsTo, input: [0, 9] + + + +_2_8->_2_10 + + + + + +_2_11 + +19     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_2_9->_2_11 + + + + + +_2_13 + +20     Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_10->_2_13 + + + + + +_2_14 + +21     Terminal 'alloc', input: [1, 0] + + + +_2_11->_2_14 + + + + + +_2_23 + +3     Range , input: [1, 11], rsm: [S_0, S_0] + + + +_2_12->_2_23 + + + + + +_2_34 + +4     Range , input: [11, 13], rsm: [S_0, S_2] + + + +_2_12->_2_34 + + + + + +_2_15 +22     Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9] + + + +_2_13->_2_15 + + + + + +_2_16 + +23     Range , input: [0, 7], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_15->_2_16 + + + + + +_2_17 + +24     Range , input: [7, 9], rsm: [FlowsTo_1, FlowsTo_1] + + + +_2_15->_2_17 + + + + + +_2_18 +25     Intermediate input: 5, rsm: FlowsTo_8, input: [0, 7] + + + +_2_16->_2_18 + + + + + +_2_19 + +26     Terminal 'assign_r', input: [7, 9] + + + +_2_17->_2_19 + + + + + +_2_20 + +27     Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_8] + + + +_2_18->_2_20 + + + + + +_2_21 + +28     Range , input: [5, 7], rsm: [FlowsTo_8, FlowsTo_1] + + + +_2_18->_2_21 + + + + + +_2_22 +29     Intermediate input: 5, rsm: FlowsTo_3, input: [0, 5] + + + +_2_20->_2_22 + + + + + +_2_24 + +30     Terminal 'load_1_r', input: [5, 7] + + + +_2_21->_2_24 + + + + + +_2_25 + +31     Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_3] + + + +_2_22->_2_25 + + + + + +_2_26 + +32     Range , input: [5, 5], rsm: [FlowsTo_3, FlowsTo_8] + + + +_2_22->_2_26 + + + + + +_2_44 +5     Intermediate input: 9, rsm: S_1, input: [1, 11] + + + +_2_23->_2_44 + + + + + +_2_27 +33     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 5] + + + +_2_25->_2_27 + + + + + +_2_28 + +34     Nonterminal Alias, input: [5, 5] + + + +_2_26->_2_28 + + + + + +_2_29 + +35     Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_27->_2_29 + + + + + +_2_30 + +36     Range , input: [1, 5], rsm: [FlowsTo_1, FlowsTo_3] + + + +_2_27->_2_30 + + + + + +_2_31 + +37     Range , input: [5, 5], rsm: [Alias_0, Alias_2] + + + +_2_28->_2_31 + + + + + +_2_32 + +38     Terminal 'alloc_r', input: [0, 1] + + + +_2_29->_2_32 + + + + + +_2_33 + +39     Terminal 'store_1_r', input: [1, 5] + + + +_2_30->_2_33 + + + + + +_2_35 +40     Intermediate input: 3, rsm: Alias_1, input: [5, 5] + + + +_2_31->_2_35 + + + + + +_2_45 + +6     Nonterminal PointsTo, input: [11, 13] + + + +_2_34->_2_45 + + + + + +_2_36 + +41     Range , input: [5, 3], rsm: [Alias_0, Alias_1] + + + +_2_35->_2_36 + + + + + +_2_37 + +42     Range , input: [3, 5], rsm: [Alias_1, Alias_2] + + + +_2_35->_2_37 + + + + + +_2_38 + +43     Nonterminal PointsTo, input: [5, 3] + + + +_2_36->_2_38 + + + + + +_2_39 + +44     Nonterminal FlowsTo, input: [3, 5] + + + +_2_37->_2_39 + + + + + +_2_40 + +45     Range , input: [5, 3], rsm: [PointsTo_0, PointsTo_5] + + + +_2_38->_2_40 + + + + + +_2_41 + +46     Range , input: [3, 5], rsm: [FlowsTo_0, FlowsTo_1] + + + +_2_39->_2_41 + + + + + +_2_42 + +47     Terminal 'alloc', input: [5, 3] + + + +_2_40->_2_42 + + + + + +_2_43 + +48     Terminal 'alloc_r', input: [3, 5] + + + +_2_41->_2_43 + + + + + +_2_46 + +7     Range , input: [1, 9], rsm: [S_0, S_1] + + + +_2_44->_2_46 + + + + + +_2_47 + +8     Range , input: [9, 11], rsm: [S_1, S_0] + + + +_2_44->_2_47 + + + + + +_2_48 + +9     Range , input: [11, 13], rsm: [PointsTo_0, PointsTo_5] + + + +_2_45->_2_48 + + + + + +_2_46->_2_2 + + + + + +_2_47->_2_3 + + + + + +_2_48->_2_4 + + + + + +_3_0 + +0     Nonterminal S, input: [8, 0] + + + +_3_1 + +1     Range , input: [8, 0], rsm: [S_0, S_2] + + + +_3_0->_3_1 + + + + + +_3_12 + +2     Nonterminal PointsTo, input: [8, 0] + + + +_3_1->_3_12 + + + + + +_3_2 + +10     Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0] + + + +_3_4 + +12     Terminal 'store_0', input: [4, 1] + + + +_3_2->_3_4 + + + + + +_3_3 +11     Intermediate input: 4, rsm: PointsTo_1, input: [8, 4] + + + +_3_5 + +13     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1] + + + +_3_3->_3_5 + + + + + +_3_6 + +14     Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9] + + + +_3_3->_3_6 + + + + + +_3_7 +15     Intermediate input: 6, rsm: PointsTo_0, input: [8, 4] + + + +_3_5->_3_7 + + + + + +_3_8 + +16     Nonterminal Alias, input: [4, 4] + + + +_3_6->_3_8 + + + + + +_3_9 + +17     Range , input: [8, 6], rsm: [PointsTo_0, PointsTo_0] + + + +_3_7->_3_9 + + + + + +_3_10 + +18     Range , input: [6, 4], rsm: [PointsTo_0, PointsTo_1] + + + +_3_7->_3_10 + + + + + +_3_11 + +19     Range , input: [4, 4], rsm: [Alias_0, Alias_2] + + + +_3_8->_3_11 + + + + + +_3_13 + +20     Terminal 'assign', input: [8, 6] + + + +_3_9->_3_13 + + + + + +_3_14 + +21     Terminal 'load_0', input: [6, 4] + + + +_3_10->_3_14 + + + + + +_3_15 +22     Intermediate input: 2, rsm: Alias_1, input: [4, 4] + + + +_3_11->_3_15 + + + + + +_3_23 + +3     Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_3_12->_3_23 + + + + + +_3_16 + +23     Range , input: [4, 2], rsm: [Alias_0, Alias_1] + + + +_3_15->_3_16 + + + + + +_3_17 + +24     Range , input: [2, 4], rsm: [Alias_1, Alias_2] + + + +_3_15->_3_17 + + + + + +_3_18 + +25     Nonterminal PointsTo, input: [4, 2] + + + +_3_16->_3_18 + + + + + +_3_19 + +26     Nonterminal FlowsTo, input: [2, 4] + + + +_3_17->_3_19 + + + + + +_3_20 + +27     Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5] + + + +_3_18->_3_20 + + + + + +_3_21 + +28     Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1] + + + +_3_19->_3_21 + + + + + +_3_22 + +29     Terminal 'alloc', input: [4, 2] + + + +_3_20->_3_22 + + + + + +_3_24 + +30     Terminal 'alloc_r', input: [2, 4] + + + +_3_21->_3_24 + + + + + +_3_25 +4     Intermediate input: 1, rsm: PointsTo_0, input: [8, 0] + + + +_3_23->_3_25 + + + + + +_3_26 + +5     Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0] + + + +_3_25->_3_26 + + + + + +_3_27 + +6     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_3_25->_3_27 + + + + + +_3_28 +7     Intermediate input: 4, rsm: PointsTo_9, input: [8, 1] + + + +_3_26->_3_28 + + + + + +_3_29 + +8     Terminal 'alloc', input: [1, 0] + + + +_3_27->_3_29 + + + + + +_3_28->_3_2 + + + + + +_3_30 + +9     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9] + + + +_3_28->_3_30 + + + + + +_3_30->_3_3 + + + + + +_4_0 + +0     Nonterminal S, input: [8, 12] + + + +_4_1 + +1     Range , input: [8, 12], rsm: [S_0, S_2] + + + +_4_0->_4_1 + + + + + +_4_12 +2     Intermediate input: 10, rsm: S_0, input: [8, 12] + + + +_4_1->_4_12 + + + + + +_4_2 + +10     Range , input: [10, 12], rsm: [PointsTo_0, PointsTo_5] + + + +_4_4 + +12     Terminal 'alloc', input: [10, 12] + + + +_4_2->_4_4 + + + + + +_4_3 + +11     Nonterminal Alias, input: [8, 8] + + + +_4_5 + +13     Range , input: [8, 8], rsm: [Alias_0, Alias_2] + + + +_4_3->_4_5 + + + + + +_4_6 +14     Intermediate input: 0, rsm: Alias_1, input: [8, 8] + + + +_4_5->_4_6 + + + + + +_4_7 + +15     Range , input: [8, 0], rsm: [Alias_0, Alias_1] + + + +_4_6->_4_7 + + + + + +_4_8 + +16     Range , input: [0, 8], rsm: [Alias_1, Alias_2] + + + +_4_6->_4_8 + + + + + +_4_9 + +17     Nonterminal PointsTo, input: [8, 0] + + + +_4_7->_4_9 + + + + + +_4_10 + +18     Nonterminal FlowsTo, input: [0, 8] + + + +_4_8->_4_10 + + + + + +_4_11 + +19     Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_4_9->_4_11 + + + + + +_4_13 + +20     Range , input: [0, 8], rsm: [FlowsTo_0, FlowsTo_1] + + + +_4_10->_4_13 + + + + + +_4_14 +21     Intermediate input: 1, rsm: PointsTo_0, input: [8, 0] + + + +_4_11->_4_14 + + + + + +_4_23 + +3     Range , input: [8, 10], rsm: [S_0, S_0] + + + +_4_12->_4_23 + + + + + +_4_34 + +4     Range , input: [10, 12], rsm: [S_0, S_2] + + + +_4_12->_4_34 + + + + + +_4_15 +22     Intermediate input: 6, rsm: FlowsTo_1, input: [0, 8] + + + +_4_13->_4_15 + + + + + +_4_16 + +23     Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0] + + + +_4_14->_4_16 + + + + + +_4_17 + +24     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_4_14->_4_17 + + + + + +_4_18 + +25     Range , input: [0, 6], rsm: [FlowsTo_0, FlowsTo_1] + + + +_4_15->_4_18 + + + + + +_4_19 + +26     Range , input: [6, 8], rsm: [FlowsTo_1, FlowsTo_1] + + + +_4_15->_4_19 + + + + + +_4_20 +27     Intermediate input: 4, rsm: PointsTo_9, input: [8, 1] + + + +_4_16->_4_20 + + + + + +_4_21 + +28     Terminal 'alloc', input: [1, 0] + + + +_4_17->_4_21 + + + + + +_4_22 +29     Intermediate input: 4, rsm: FlowsTo_9, input: [0, 6] + + + +_4_18->_4_22 + + + + + +_4_24 + +30     Terminal 'assign_r', input: [6, 8] + + + +_4_19->_4_24 + + + + + +_4_25 + +31     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9] + + + +_4_20->_4_25 + + + + + +_4_26 + +32     Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0] + + + +_4_20->_4_26 + + + + + +_4_27 + +33     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_9] + + + +_4_22->_4_27 + + + + + +_4_28 + +34     Range , input: [4, 6], rsm: [FlowsTo_9, FlowsTo_1] + + + +_4_22->_4_28 + + + + + +_4_45 + +5     Terminal 'store_2', input: [8, 10] + + + +_4_23->_4_45 + + + + + +_4_56 +6     Intermediate input: 8, rsm: S_1, input: [8, 10] + + + +_4_23->_4_56 + + + + + +_4_29 +35     Intermediate input: 4, rsm: PointsTo_1, input: [8, 4] + + + +_4_25->_4_29 + + + + + +_4_30 + +36     Terminal 'store_0', input: [4, 1] + + + +_4_26->_4_30 + + + + + +_4_31 +37     Intermediate input: 4, rsm: FlowsTo_2, input: [0, 4] + + + +_4_27->_4_31 + + + + + +_4_32 + +38     Terminal 'load_0_r', input: [4, 6] + + + +_4_28->_4_32 + + + + + +_4_33 + +39     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1] + + + +_4_29->_4_33 + + + + + +_4_35 + +40     Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9] + + + +_4_29->_4_35 + + + + + +_4_36 + +41     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_2] + + + +_4_31->_4_36 + + + + + +_4_37 + +42     Range , input: [4, 4], rsm: [FlowsTo_2, FlowsTo_9] + + + +_4_31->_4_37 + + + + + +_4_38 +43     Intermediate input: 6, rsm: PointsTo_0, input: [8, 4] + + + +_4_33->_4_38 + + + + + +_4_62 + +7     Nonterminal PointsTo, input: [10, 12] + + + +_4_34->_4_62 + + + + + +_4_39 + +44     Nonterminal Alias, input: [4, 4] + + + +_4_35->_4_39 + + + + + +_4_40 +45     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 4] + + + +_4_36->_4_40 + + + + + +_4_41 + +46     Nonterminal Alias, input: [4, 4] + + + +_4_37->_4_41 + + + + + +_4_42 + +47     Range , input: [8, 6], rsm: [PointsTo_0, PointsTo_0] + + + +_4_38->_4_42 + + + + + +_4_43 + +48     Range , input: [6, 4], rsm: [PointsTo_0, PointsTo_1] + + + +_4_38->_4_43 + + + + + +_4_44 + +49     Range , input: [4, 4], rsm: [Alias_0, Alias_2] + + + +_4_39->_4_44 + + + + + +_4_46 + +50     Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_4_40->_4_46 + + + + + +_4_47 + +51     Range , input: [1, 4], rsm: [FlowsTo_1, FlowsTo_2] + + + +_4_40->_4_47 + + + + + +_4_41->_4_44 + + + + + +_4_48 + +52     Terminal 'assign', input: [8, 6] + + + +_4_42->_4_48 + + + + + +_4_49 + +53     Terminal 'load_0', input: [6, 4] + + + +_4_43->_4_49 + + + + + +_4_50 +54     Intermediate input: 2, rsm: Alias_1, input: [4, 4] + + + +_4_44->_4_50 + + + + + +_4_51 + +55     Terminal 'alloc_r', input: [0, 1] + + + +_4_46->_4_51 + + + + + +_4_52 + +56     Terminal 'store_0_r', input: [1, 4] + + + +_4_47->_4_52 + + + + + +_4_53 + +57     Range , input: [4, 2], rsm: [Alias_0, Alias_1] + + + +_4_50->_4_53 + + + + + +_4_54 + +58     Range , input: [2, 4], rsm: [Alias_1, Alias_2] + + + +_4_50->_4_54 + + + + + +_4_55 + +59     Nonterminal PointsTo, input: [4, 2] + + + +_4_53->_4_55 + + + + + +_4_57 + +60     Nonterminal FlowsTo, input: [2, 4] + + + +_4_54->_4_57 + + + + + +_4_58 + +61     Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5] + + + +_4_55->_4_58 + + + + + +_4_63 + +8     Range , input: [8, 8], rsm: [S_0, S_1] + + + +_4_56->_4_63 + + + + + +_4_64 + +9     Range , input: [8, 10], rsm: [S_1, S_0] + + + +_4_56->_4_64 + + + + + +_4_59 + +62     Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1] + + + +_4_57->_4_59 + + + + + +_4_60 + +63     Terminal 'alloc', input: [4, 2] + + + +_4_58->_4_60 + + + + + +_4_61 + +64     Terminal 'alloc_r', input: [2, 4] + + + +_4_59->_4_61 + + + + + +_4_62->_4_2 + + + + + +_4_63->_4_3 + + + + + +_4_64->_4_45 + + + + + +_5_0 + +0     Nonterminal S, input: [8, 13] + + + +_5_1 + +1     Range , input: [8, 13], rsm: [S_0, S_2] + + + +_5_0->_5_1 + + + + + +_5_12 +2     Intermediate input: 11, rsm: S_0, input: [8, 13] + + + +_5_1->_5_12 + + + + + +_5_2 + +10     Nonterminal Alias, input: [8, 9] + + + +_5_5 + +13     Range , input: [8, 9], rsm: [Alias_0, Alias_2] + + + +_5_2->_5_5 + + + + + +_5_3 + +11     Terminal 'store_3', input: [9, 11] + + + +_5_4 + +12     Terminal 'alloc', input: [11, 13] + + + +_5_6 +14     Intermediate input: 0, rsm: Alias_1, input: [8, 9] + + + +_5_5->_5_6 + + + + + +_5_7 + +15     Range , input: [8, 0], rsm: [Alias_0, Alias_1] + + + +_5_6->_5_7 + + + + + +_5_8 + +16     Range , input: [0, 9], rsm: [Alias_1, Alias_2] + + + +_5_6->_5_8 + + + + + +_5_9 + +17     Nonterminal PointsTo, input: [8, 0] + + + +_5_7->_5_9 + + + + + +_5_10 + +18     Nonterminal FlowsTo, input: [0, 9] + + + +_5_8->_5_10 + + + + + +_5_11 + +19     Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_5_9->_5_11 + + + + + +_5_13 + +20     Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1] + + + +_5_10->_5_13 + + + + + +_5_14 +21     Intermediate input: 1, rsm: PointsTo_0, input: [8, 0] + + + +_5_11->_5_14 + + + + + +_5_23 + +3     Range , input: [8, 11], rsm: [S_0, S_0] + + + +_5_12->_5_23 + + + + + +_5_34 + +4     Range , input: [11, 13], rsm: [S_0, S_2] + + + +_5_12->_5_34 + + + + + +_5_15 +22     Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9] + + + +_5_13->_5_15 + + + + + +_5_16 + +23     Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0] + + + +_5_14->_5_16 + + + + + +_5_17 + +24     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + + + +_5_14->_5_17 + + + + + +_5_18 + +25     Range , input: [0, 7], rsm: [FlowsTo_0, FlowsTo_1] + + + +_5_15->_5_18 + + + + + +_5_19 + +26     Range , input: [7, 9], rsm: [FlowsTo_1, FlowsTo_1] + + + +_5_15->_5_19 + + + + + +_5_20 +27     Intermediate input: 4, rsm: PointsTo_9, input: [8, 1] + + + +_5_16->_5_20 + + + + + +_5_21 + +28     Terminal 'alloc', input: [1, 0] + + + +_5_17->_5_21 + + + + + +_5_22 +29     Intermediate input: 5, rsm: FlowsTo_8, input: [0, 7] + + + +_5_18->_5_22 + + + + + +_5_24 + +30     Terminal 'assign_r', input: [7, 9] + + + +_5_19->_5_24 + + + + + +_5_25 + +31     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9] + + + +_5_20->_5_25 + + + + + +_5_26 + +32     Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0] + + + +_5_20->_5_26 + + + + + +_5_27 + +33     Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_8] + + + +_5_22->_5_27 + + + + + +_5_28 + +34     Range , input: [5, 7], rsm: [FlowsTo_8, FlowsTo_1] + + + +_5_22->_5_28 + + + + + +_5_45 +5     Intermediate input: 9, rsm: S_1, input: [8, 11] + + + +_5_23->_5_45 + + + + + +_5_29 +35     Intermediate input: 4, rsm: PointsTo_1, input: [8, 4] + + + +_5_25->_5_29 + + + + + +_5_30 + +36     Terminal 'store_0', input: [4, 1] + + + +_5_26->_5_30 + + + + + +_5_31 +37     Intermediate input: 5, rsm: FlowsTo_3, input: [0, 5] + + + +_5_27->_5_31 + + + + + +_5_32 + +38     Terminal 'load_1_r', input: [5, 7] + + + +_5_28->_5_32 + + + + + +_5_33 + +39     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1] + + + +_5_29->_5_33 + + + + + +_5_35 + +40     Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9] + + + +_5_29->_5_35 + + + + + +_5_36 + +41     Range , input: [0, 5], rsm: [FlowsTo_0, FlowsTo_3] + + + +_5_31->_5_36 + + + + + +_5_37 + +42     Range , input: [5, 5], rsm: [FlowsTo_3, FlowsTo_8] + + + +_5_31->_5_37 + + + + + +_5_38 +43     Intermediate input: 6, rsm: PointsTo_0, input: [8, 4] + + + +_5_33->_5_38 + + + + + +_5_56 + +6     Nonterminal PointsTo, input: [11, 13] + + + +_5_34->_5_56 + + + + + +_5_39 + +44     Nonterminal Alias, input: [4, 4] + + + +_5_35->_5_39 + + + + + +_5_40 +45     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 5] + + + +_5_36->_5_40 + + + + + +_5_41 + +46     Nonterminal Alias, input: [5, 5] + + + +_5_37->_5_41 + + + + + +_5_42 + +47     Range , input: [8, 6], rsm: [PointsTo_0, PointsTo_0] + + + +_5_38->_5_42 + + + + + +_5_43 + +48     Range , input: [6, 4], rsm: [PointsTo_0, PointsTo_1] + + + +_5_38->_5_43 + + + + + +_5_44 + +49     Range , input: [4, 4], rsm: [Alias_0, Alias_2] + + + +_5_39->_5_44 + + + + + +_5_46 + +50     Range , input: [0, 1], rsm: [FlowsTo_0, FlowsTo_1] + + + +_5_40->_5_46 + + + + + +_5_47 + +51     Range , input: [1, 5], rsm: [FlowsTo_1, FlowsTo_3] + + + +_5_40->_5_47 + + + + + +_5_48 + +52     Range , input: [5, 5], rsm: [Alias_0, Alias_2] + + + +_5_41->_5_48 + + + + + +_5_49 + +53     Terminal 'assign', input: [8, 6] + + + +_5_42->_5_49 + + + + + +_5_50 + +54     Terminal 'load_0', input: [6, 4] + + + +_5_43->_5_50 + + + + + +_5_51 +55     Intermediate input: 2, rsm: Alias_1, input: [4, 4] + + + +_5_44->_5_51 + + + + + +_5_67 + +7     Range , input: [8, 9], rsm: [S_0, S_1] + + + +_5_45->_5_67 + + + + + +_5_73 + +8     Range , input: [9, 11], rsm: [S_1, S_0] + + + +_5_45->_5_73 + + + + + +_5_52 + +56     Terminal 'alloc_r', input: [0, 1] + + + +_5_46->_5_52 + + + + + +_5_53 + +57     Terminal 'store_1_r', input: [1, 5] + + + +_5_47->_5_53 + + + + + +_5_54 +58     Intermediate input: 3, rsm: Alias_1, input: [5, 5] + + + +_5_48->_5_54 + + + + + +_5_55 + +59     Range , input: [4, 2], rsm: [Alias_0, Alias_1] + + + +_5_51->_5_55 + + + + + +_5_57 + +60     Range , input: [2, 4], rsm: [Alias_1, Alias_2] + + + +_5_51->_5_57 + + + + + +_5_58 + +61     Range , input: [5, 3], rsm: [Alias_0, Alias_1] + + + +_5_54->_5_58 + + + + + +_5_59 + +62     Range , input: [3, 5], rsm: [Alias_1, Alias_2] + + + +_5_54->_5_59 + + + + + +_5_60 + +63     Nonterminal PointsTo, input: [4, 2] + + + +_5_55->_5_60 + + + + + +_5_74 + +9     Range , input: [11, 13], rsm: [PointsTo_0, PointsTo_5] + + + +_5_56->_5_74 + + + + + +_5_61 + +64     Nonterminal FlowsTo, input: [2, 4] + + + +_5_57->_5_61 + + + + + +_5_62 + +65     Nonterminal PointsTo, input: [5, 3] + + + +_5_58->_5_62 + + + + + +_5_63 + +66     Nonterminal FlowsTo, input: [3, 5] + + + +_5_59->_5_63 + + + + + +_5_64 + +67     Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5] + + + +_5_60->_5_64 + + + + + +_5_65 + +68     Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1] + + + +_5_61->_5_65 + + + + + +_5_66 + +69     Range , input: [5, 3], rsm: [PointsTo_0, PointsTo_5] + + + +_5_62->_5_66 + + + + + +_5_68 + +70     Range , input: [3, 5], rsm: [FlowsTo_0, FlowsTo_1] + + + +_5_63->_5_68 + + + + + +_5_69 + +71     Terminal 'alloc', input: [4, 2] + + + +_5_64->_5_69 + + + + + +_5_70 + +72     Terminal 'alloc_r', input: [2, 4] + + + +_5_65->_5_70 + + + + + +_5_71 + +73     Terminal 'alloc', input: [5, 3] + + + +_5_66->_5_71 + + + + + +_5_67->_5_2 + + + + + +_5_72 + +74     Terminal 'alloc_r', input: [3, 5] + + + +_5_68->_5_72 + + + + + +_5_73->_5_3 + + + + + +_5_74->_5_4 + + + + + From cb70a3c7da5e9e3afb3597928eef21587877983e Mon Sep 17 00:00:00 2001 From: gsv Date: Fri, 20 Feb 2026 17:03:48 +0300 Subject: [PATCH 20/71] Impreved readme: detailed description of examples --- cfpq-app/README.md | 164 +++- .../src/main/resources/figures/graph_2.dot | 12 +- .../main/resources/figures/graph_2.dot.svg | 110 +-- .../main/resources/figures/graph_2_sppf.dot | 24 +- .../resources/figures/graph_2_sppf.dot.svg | 18 +- .../src/main/resources/figures/graph_3.dot | 10 +- .../main/resources/figures/graph_3.dot.svg | 94 +-- .../main/resources/figures/graph_3_sppf.dot | 8 +- .../resources/figures/graph_3_sppf.dot.svg | 6 +- .../src/main/resources/figures/graph_4.dot | 28 +- .../main/resources/figures/graph_4.dot.svg | 230 +++--- .../resources/figures/graph_4_sppf.dot.svg | 774 +++++++++--------- 12 files changed, 788 insertions(+), 690 deletions(-) diff --git a/cfpq-app/README.md b/cfpq-app/README.md index 798c7a297..adb2d55c0 100644 --- a/cfpq-app/README.md +++ b/cfpq-app/README.md @@ -2,29 +2,72 @@ >For demo purposes only! >Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). -Requirements: 11 java +This demo is based on UCFS, which, for a given grammar represented as an RSM, a graph, and start vertices, produces an SPPF. -To run (from project root): +**RSM** (Recursive State Machine) is an automaton-like representation of context-free languages. + +**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. +SPPF consists of nodes of the types listed below. Each node has a unique Id and detailed information specific to its type. + +* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the start and end of paths derived from that non-terminal. + + ![Graph for example 1](./src/main/resources/figures/Nonterm_example.dot.svg) + + This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal ```S``` + +* **Terminal** node is a leaf and corresponds to an edge. + + ![Graph for example 1](./src/main/resources/figures/Terminal_example.dot.svg) + + This node depicts edge ```3 -alloc-> 4```. + +* **Epsilon** node is a simplified way to represent that $\varepsilon$ is derived at a specific position. + + ![Graph for example 1](./src/main/resources/figures/Epsilon_example.dot.svg) + +* **Range** node is a supplementary node that helps reuse subtrees. + + ![Graph for example 1](./src/main/resources/figures/Range_example.dot.svg) + + This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. + +* **Intermediate** node is a supplementary node used to connect subpaths. + + ![Graph for example 1](./src/main/resources/figures/Intermediate_example.dot.svg) + + This node depicts that the path from 0 to 2 is composed of two parts: from 0 to 1 and from 1 to 2. + +**Requirements**: 11 java + +**To run (from project root)**: ```bash ./gradlew :cfpq-app:run ``` -Input graphs: ```src/main/resources/``` +**Input graphs:** ```src/main/resources/``` -Grammar and code for paths extraction: ```src/main/kotlin/me/vkutuev/Main.kt``` - -SPPF traversal - -SPPF is a derivation-tree-like structure that represents **all** possible paths satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. +**Grammar and code for paths extraction:** ```src/main/kotlin/me/vkutuev/Main.kt``` >[!NOTE] > We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. ## Examples +We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted paths. + +For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to analyze chains of fields. +``` +PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" +FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* +Alias -> PointsTo FlowsTo +S -> (Alias? "store_i")* PointsTo +``` +For all our examples, we use a common grammar with $i \in [0..3]$. +The corresponding RSM is presented below: +![Graph for example 1](./src/main/resources/figures/rsm.dot.svg) ### Example 1 Code snippet: @@ -42,18 +85,28 @@ Respective graph: ![Graph for example 1](./src/main/resources/figures/graph_1.dot.svg) +Resulting SPPF: + ![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) -Paths: -[(1-PointsTo->0)] +Three trees are extracted because there are three paths of interest from node 1. +We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful information for restoring fields. -[(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] -[(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] +Respective paths: +* [(1-PointsTo->0)] + + This path is trivial. Such paths will be omitted in further examples. -Trivial. Will be omitted in further examples +* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] + This path means that ```n.u = new Y()```. Vertex 2 is an alias for 1 (corresponding to ```n```), and 2 has a field ```u``` that points to ```new Y()``` (```store_0``` corresponds to ```l.u = y```). + +* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] + + This path means that ```n.u.v = new Z()```. + ### Example 2 @@ -67,24 +120,41 @@ while (...){ } ``` +Respective graph: + ![Graph for example 2](./src/main/resources/figures/graph_2.dot.svg) + +Part of resulting SPPF: + ![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) -Paths: +This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because there are infinitely many paths of interest. We extract some of them: + +* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] -[(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] + ```n.next.next = new X () // line 4``` -[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] -[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + ```n.next.next.next = new X () // line 4``` -[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] -[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + ```n.next.next.next.next = new X () // line 4``` -[(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + ```n.next.next.next.next.next = new X () // line 4``` +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next.next = new X () // line 4``` + +More paths can be extracted if needed. Traversal should be tuned accordingly. ### Example 3 @@ -99,22 +169,39 @@ while (...){ } ``` +Respective graph: + ![Graph for example 3](./src/main/resources/figures/graph_3.dot.svg) + +Part of resulting SPPF: + ![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) -Paths: +This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of them. -[(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] -[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + ```n.next = new X() // line 4``` -[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] -[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + ```n.next.next = new X() // line 4``` -[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] -[(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + ```n.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next.next = new X() // line 4``` ### Example 4 @@ -132,17 +219,28 @@ v.p = new Y() val r = u.y r.q = new P() ``` +Respective graph: ![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) -Paths: +For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in this example, we specify two vertices as start: 1 and 8. + +* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```n.q = new P()``` + +* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```n.p = new Y() ``` + +* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] -[(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] + ```v.q = new P() ``` -[(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] +* [(8-store_2->10), (10-PointsTo->12)] -[(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] + ```v.p = new Y() ``` -[(8-store_2->10), (10-PointsTo->12)] +* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] -[(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] + ```v.p = new Y() ``` diff --git a/cfpq-app/src/main/resources/figures/graph_2.dot b/cfpq-app/src/main/resources/figures/graph_2.dot index 6fb4ab2f6..89921de33 100644 --- a/cfpq-app/src/main/resources/figures/graph_2.dot +++ b/cfpq-app/src/main/resources/figures/graph_2.dot @@ -13,11 +13,11 @@ digraph { 5 -> 2 [label = "load_0"]; 2 -> 5 [label = "load_0_r"]; - 0[label = "0: n"] - 1[label = "1: new X() // line 1"] - 2[label = "2: l"] - 3[label = "3: tmp1 // line 4"] - 4[label = "4: new X() // line 4"] - 5[label = "5: tmp2 // line 5"] + 0[label = "0 | n"] + 1[label = "1 | new X() // line 1"] + 2[label = "2 | l"] + 3[label = "3 | tmp1 // line 4"] + 4[label = "4 | new X() // line 4"] + 5[label = "5 | tmp2 // line 5"] } diff --git a/cfpq-app/src/main/resources/figures/graph_2.dot.svg b/cfpq-app/src/main/resources/figures/graph_2.dot.svg index 83e62d0a1..823dd0988 100644 --- a/cfpq-app/src/main/resources/figures/graph_2.dot.svg +++ b/cfpq-app/src/main/resources/figures/graph_2.dot.svg @@ -4,142 +4,142 @@ - + %191 - + start - -start + +start 0 - -0: n + +0 | n start->0 - - + + 1 - -1: new X() // line 1 + +1 | new X() // line 1 0->1 - - -alloc + + +alloc 2 - -2: l + +2 | l 0->2 - - -assign_r + + +assign_r 1->0 - - -alloc_r + + +alloc_r 2->0 - - -assign + + +assign 3 - -3: tmp1 // line 4 + +3 | tmp1 // line 4 2->3 - - -store_0 + + +store_0 5 - -5: tmp2 // line 5 + +5 | tmp2 // line 5 2->5 - - -assign + + +assign 2->5 - - -load_0_r + + +load_0_r 3->2 - - -store_0_r + + +store_0_r 4 - -4: new X() // line 4 + +4 | new X() // line 4 3->4 - - -alloc + + +alloc 4->3 - - -alloc_r + + +alloc_r 5->2 - - -assign_r + + +assign_r 5->2 - - -load_0 + + +load_0 diff --git a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot index 698d1aa4d..7ac8ed0b9 100644 --- a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot +++ b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot @@ -24,39 +24,39 @@ _1_16 [label = "23 Intermediate input: 4, rsm: Alias_1, input: [3, 2]", shap _1_17 [label = "24 Range , input: [0, 1], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] _1_18 [label = "25 Range , input: [1, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] _1_19 [label = "26 Range , input: [3, 4], rsm: [Alias_0, Alias_1]", shape = ellipse] -_1_20 [label = "27 Range , input: [4, 2], rsm: [Alias_1, Alias_2]", shape = ellipse] +_1_20 [label = "27 Range , input: [4, 2], rsm: [Alias_1, Alias_2]", shape = ellipse, color="red"] _1_21 [label = "28 Terminal 'alloc', input: [0, 1]", shape = rectangle] _1_22 [label = "29 Intermediate input: 0, rsm: FlowsTo_1, input: [1, 2]", shape = plain] _1_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_0]", shape = ellipse] _1_24 [label = "30 Nonterminal PointsTo, input: [3, 4]", shape = invtrapezium] -_1_25 [label = "31 Nonterminal FlowsTo, input: [4, 2]", shape = invtrapezium] +_1_25 [label = "31 Nonterminal FlowsTo, input: [4, 2]", shape = invtrapezium, color="red"] _1_26 [label = "32 Range , input: [1, 0], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] _1_27 [label = "33 Range , input: [0, 2], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] -_1_28 [label = "34 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_28 [label = "34 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse, color="red"] _1_29 [label = "35 Terminal 'alloc_r', input: [1, 0]", shape = rectangle] _1_30 [label = "36 Terminal 'assign_r', input: [0, 2]", shape = rectangle] -_1_31 [label = "37 Intermediate input: 5, rsm: FlowsTo_1, input: [4, 2]", shape = plain] -_1_32 [label = "38 Range , input: [4, 5], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] +_1_31 [label = "37 Intermediate input: 5, rsm: FlowsTo_1, input: [4, 2]", shape = plain, color="red"] +_1_32 [label = "38 Range , input: [4, 5], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse, color="red"] _1_33 [label = "39 Range , input: [5, 2], rsm: [FlowsTo_1, FlowsTo_1]", shape = ellipse] _1_34 [label = "4 Range , input: [3, 4], rsm: [S_0, S_2]", shape = ellipse] -_1_35 [label = "40 Intermediate input: 2, rsm: FlowsTo_9, input: [4, 5]", shape = plain] +_1_35 [label = "40 Intermediate input: 2, rsm: FlowsTo_9, input: [4, 5]", shape = plain, color="red"] _1_36 [label = "41 Terminal 'assign_r', input: [5, 2]", shape = rectangle] -_1_37 [label = "42 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_9]", shape = ellipse] +_1_37 [label = "42 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_9]", shape = ellipse, color="red"] _1_38 [label = "43 Range , input: [2, 5], rsm: [FlowsTo_9, FlowsTo_1]", shape = ellipse] -_1_39 [label = "44 Intermediate input: 2, rsm: FlowsTo_2, input: [4, 2]", shape = plain] +_1_39 [label = "44 Intermediate input: 2, rsm: FlowsTo_2, input: [4, 2]", shape = plain, color="red"] _1_40 [label = "45 Terminal 'load_0_r', input: [2, 5]", shape = rectangle] _1_41 [label = "46 Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_2]", shape = ellipse] -_1_42 [label = "47 Range , input: [2, 2], rsm: [FlowsTo_2, FlowsTo_9]", shape = ellipse] +_1_42 [label = "47 Range , input: [2, 2], rsm: [FlowsTo_2, FlowsTo_9]", shape = ellipse, color="red"] _1_43 [label = "48 Intermediate input: 3, rsm: FlowsTo_1, input: [4, 2]", shape = plain] -_1_44 [label = "49 Nonterminal Alias, input: [2, 2]", shape = invtrapezium] +_1_44 [label = "49 Nonterminal Alias, input: [2, 2]", shape = invtrapezium, color="red"] _1_45 [label = "5 Intermediate input: 2, rsm: S_1, input: [0, 3]", shape = plain] _1_46 [label = "50 Range , input: [4, 3], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] _1_47 [label = "51 Range , input: [3, 2], rsm: [FlowsTo_1, FlowsTo_2]", shape = ellipse] -_1_48 [label = "52 Range , input: [2, 2], rsm: [Alias_0, Alias_2]", shape = ellipse] +_1_48 [label = "52 Range , input: [2, 2], rsm: [Alias_0, Alias_2]", shape = ellipse, color="red"] _1_49 [label = "53 Terminal 'alloc_r', input: [4, 3]", shape = rectangle] _1_50 [label = "54 Terminal 'store_0_r', input: [3, 2]", shape = rectangle] _1_51 [label = "55 Intermediate input: 1, rsm: Alias_1, input: [2, 2]", shape = plain] -_1_52 [label = "56 Intermediate input: 4, rsm: Alias_1, input: [2, 2]", shape = plain] +_1_52 [label = "56 Intermediate input: 4, rsm: Alias_1, input: [2, 2]", shape = plain, color="red"] _1_53 [label = "57 Range , input: [2, 1], rsm: [Alias_0, Alias_1]", shape = ellipse] _1_54 [label = "58 Range , input: [2, 4], rsm: [Alias_0, Alias_1]", shape = ellipse] _1_55 [label = "59 Nonterminal PointsTo, input: [2, 1]", shape = invtrapezium] diff --git a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg index e08b8b8d7..144bea2ab 100644 --- a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg +++ b/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg @@ -6,7 +6,7 @@ - + g @@ -252,7 +252,7 @@ _1_20 - + 27     Range , input: [4, 2], rsm: [Alias_1, Alias_2] @@ -299,7 +299,7 @@ _1_25 - + 31     Nonterminal FlowsTo, input: [4, 2] @@ -358,7 +358,7 @@ _1_28 - + 34     Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_1] @@ -405,7 +405,7 @@ _1_32 - + 38     Range , input: [4, 5], rsm: [FlowsTo_0, FlowsTo_1] @@ -464,7 +464,7 @@ _1_37 - + 42     Range , input: [4, 2], rsm: [FlowsTo_0, FlowsTo_9] @@ -523,7 +523,7 @@ _1_42 - + 47     Range , input: [2, 2], rsm: [FlowsTo_2, FlowsTo_9] @@ -546,7 +546,7 @@ _1_44 - + 49     Nonterminal Alias, input: [2, 2] @@ -582,7 +582,7 @@ _1_48 - + 52     Range , input: [2, 2], rsm: [Alias_0, Alias_2] diff --git a/cfpq-app/src/main/resources/figures/graph_3.dot b/cfpq-app/src/main/resources/figures/graph_3.dot index f3451bb6a..e2e5b2c09 100644 --- a/cfpq-app/src/main/resources/figures/graph_3.dot +++ b/cfpq-app/src/main/resources/figures/graph_3.dot @@ -12,9 +12,9 @@ digraph { 4 -> 0 [label = "alloc_r"]; - 0[label = "n"] - 1[label = "l"] - 2[label = "t" ] - 3[label = "new X() // line 4"] - 4[label = "new X() // line 1"] + 0[label = "0 | n"] + 1[label = "1 | l"] + 2[label = "2 | t" ] + 3[label = "3 | new X() // line 4"] + 4[label = "4 | new X() // line 1"] } diff --git a/cfpq-app/src/main/resources/figures/graph_3.dot.svg b/cfpq-app/src/main/resources/figures/graph_3.dot.svg index 60c083f66..3beaf3825 100644 --- a/cfpq-app/src/main/resources/figures/graph_3.dot.svg +++ b/cfpq-app/src/main/resources/figures/graph_3.dot.svg @@ -4,122 +4,122 @@ - + %393 - + start - -start + +start 0 - -n + +0 | n start->0 - - + + 1 - -l + +1 | l 0->1 - - -assign_r + + +assign_r 4 - -new X() // line 1 + +4 | new X() // line 1 0->4 - - -alloc + + +alloc 1->0 - - -assign + + +assign 2 - -t + +2 | t 1->2 - - -store_0 + + +store_0 1->2 - - -assign + + +assign 2->1 - - -store_0_r + + +store_0_r 2->1 - - -assign_r + + +assign_r 3 - -new X() // line 4 + +3 | new X() // line 4 2->3 - - -alloc + + +alloc 3->2 - - -alloc_r + + +alloc_r 4->0 - - -alloc_r + + +alloc_r diff --git a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot index 8e5c79e34..0a0877649 100644 --- a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot +++ b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot @@ -6,7 +6,7 @@ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] _0_2 [label = "10 Nonterminal Alias, input: [0, 1]", shape = invtrapezium] -_0_3 [label = "11 Intermediate input: 2, rsm: S_0, input: [0, 1]", shape = plain] +_0_3 [label = "11 Intermediate input: 2, rsm: S_0, input: [0, 1]", shape = plain, color="red"] _0_4 [label = "12 Terminal 'store_0', input: [1, 2]", shape = rectangle] _0_5 [label = "13 Terminal 'alloc', input: [2, 3]", shape = rectangle] _0_6 [label = "14 Range , input: [0, 1], rsm: [Alias_0, Alias_2]", shape = ellipse] @@ -26,7 +26,7 @@ _0_19 [label = "26 Range , input: [2, 3], rsm: [Alias_0, Alias_1]", shape = _0_20 [label = "27 Range , input: [3, 1], rsm: [Alias_1, Alias_2]", shape = ellipse] _0_21 [label = "28 Terminal 'alloc', input: [0, 4]", shape = rectangle] _0_22 [label = "29 Intermediate input: 0, rsm: FlowsTo_1, input: [4, 1]", shape = plain] -_0_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_0]", shape = ellipse] +_0_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_0]", shape = ellipse, color="red"] _0_24 [label = "30 Nonterminal PointsTo, input: [2, 3]", shape = invtrapezium] _0_25 [label = "31 Nonterminal FlowsTo, input: [3, 1]", shape = invtrapezium] _0_26 [label = "32 Range , input: [4, 0], rsm: [FlowsTo_0, FlowsTo_1]", shape = ellipse] @@ -40,9 +40,9 @@ _0_33 [label = "39 Range , input: [2, 1], rsm: [FlowsTo_1, FlowsTo_1]", shap _0_34 [label = "4 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] _0_35 [label = "40 Terminal 'alloc_r', input: [3, 2]", shape = rectangle] _0_36 [label = "41 Terminal 'assign_r', input: [2, 1]", shape = rectangle] -_0_37 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_37 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain, color="red"] _0_38 [label = "6 Nonterminal PointsTo, input: [2, 3]", shape = invtrapezium] -_0_39 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_39 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse, color="red"] _0_40 [label = "8 Range , input: [1, 2], rsm: [S_1, S_0]", shape = ellipse] _0_41 [label = "9 Range , input: [2, 3], rsm: [PointsTo_0, PointsTo_5]", shape = ellipse] _0_0->_0_1 diff --git a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg index 1c917358d..547d50c85 100644 --- a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg +++ b/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg @@ -6,7 +6,7 @@ - + g @@ -80,7 +80,7 @@ _0_23 - + 3     Range , input: [0, 2], rsm: [S_0, S_0] @@ -465,7 +465,7 @@ _0_39 - + 7     Range , input: [0, 1], rsm: [S_0, S_1] diff --git a/cfpq-app/src/main/resources/figures/graph_4.dot b/cfpq-app/src/main/resources/figures/graph_4.dot index 8ff719da2..a8936f86d 100644 --- a/cfpq-app/src/main/resources/figures/graph_4.dot +++ b/cfpq-app/src/main/resources/figures/graph_4.dot @@ -28,18 +28,18 @@ digraph { 7 -> 5 [label = "load_1"]; 5 -> 7 [label = "load_1_r"]; - 0[label="new X()"]; - 1[label="n"]; - 2[label="new Z()"]; - 3[label="new U()"]; - 4[label="z"]; - 5[label="u"]; - 6[label="tmp1 // line 6"]; - 7[label="tmp2 // line 8"]; - 8[label="v"]; - 9[label="r"]; - 10[label="tmp3 // line 7"]; - 11[label="tmp4 // line 9"]; - 12[label="new Y()"]; - 13[label="new P()"]; + 0[label="0 | new X()"]; + 1[label="1 | n"]; + 2[label="2 | new Z()"]; + 3[label="3 | new U()"]; + 4[label="4 | z"]; + 5[label="5 | u"]; + 6[label="6 | tmp1 // line 6"]; + 7[label="7 | tmp2 // line 8"]; + 8[label="8 | v"]; + 9[label="9 | r"]; + 10[label="10 | tmp3 // line 7"]; + 11[label="11 | tmp4 // line 9"]; + 12[label="12 | new Y()"]; + 13[label="13 | new P()"]; } diff --git a/cfpq-app/src/main/resources/figures/graph_4.dot.svg b/cfpq-app/src/main/resources/figures/graph_4.dot.svg index 9c065edf8..5a55bc680 100644 --- a/cfpq-app/src/main/resources/figures/graph_4.dot.svg +++ b/cfpq-app/src/main/resources/figures/graph_4.dot.svg @@ -4,294 +4,294 @@ - + %503 - + start - -start + +start 1 - -n + +1 | n start->1 - - + + 8 - -v + +8 | v start->8 - - + + 0 - -new X() + +0 | new X() 1->0 - - -alloc + + +alloc 4 - -z + +4 | z 1->4 - - -store_0_r + + +store_0_r 5 - -u + +5 | u 1->5 - - -store_1_r + + +store_1_r 10 - -tmp3 // line 7 + +10 | tmp3 // line 7 8->10 - - -store_2 + + +store_2 6 - -tmp1 // line 6 + +6 | tmp1 // line 6 8->6 - - -assign + + +assign 0->1 - - -alloc_r + + +alloc_r 4->1 - - -store_0 + + +store_0 2 - -new Z() + +2 | new Z() 4->2 - - -alloc + + +alloc 4->6 - - -load_0_r + + +load_0_r 2->4 - - -alloc_r + + +alloc_r 5->1 - - -store_1 + + +store_1 3 - -new U() + +3 | new U() 5->3 - - -alloc + + +alloc 7 - -tmp2 // line 8 + +7 | tmp2 // line 8 5->7 - - -load_1_r + + +load_1_r 3->5 - - -alloc_r + + +alloc_r 10->8 - - -store_2_r + + +store_2_r 12 - -new Y() + +12 | new Y() 10->12 - - -alloc + + +alloc 12->10 - - -alloc_r + + +alloc_r 11 - -tmp4 // line 9 + +11 | tmp4 // line 9 13 - -new P() + +13 | new P() 11->13 - - -alloc + + +alloc 9 - -r + +9 | r 11->9 - - -store_3_r + + +store_3_r 13->11 - - -alloc_r + + +alloc_r 6->8 - - -assign_r + + +assign_r 6->4 - - -load_0 + + +load_0 9->11 - - -store_3 + + +store_3 9->7 - - -assign + + +assign 7->5 - - -load_1 + + +load_1 7->9 - - -assign_r + + +assign_r diff --git a/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg b/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg index 31a6dd901..f7bf293fd 100644 --- a/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg +++ b/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg @@ -9,18 +9,10 @@ g - -cluster_5 - - cluster_2 - -cluster_4 - - cluster_0 @@ -33,6 +25,14 @@ cluster_3 + +cluster_5 + + + +cluster_4 + + _0_0 @@ -664,191 +664,191 @@ _2_0 - -0     Nonterminal S, input: [1, 13] + +0     Nonterminal S, input: [1, 13] _2_1 - -1     Range , input: [1, 13], rsm: [S_0, S_2] + +1     Range , input: [1, 13], rsm: [S_0, S_2] _2_0->_2_1 - - + + _2_12 -2     Intermediate input: 11, rsm: S_0, input: [1, 13] +2     Intermediate input: 11, rsm: S_0, input: [1, 13] _2_1->_2_12 - - + + _2_2 - -10     Nonterminal Alias, input: [1, 9] + +10     Nonterminal Alias, input: [1, 9] _2_5 - -13     Range , input: [1, 9], rsm: [Alias_0, Alias_2] + +13     Range , input: [1, 9], rsm: [Alias_0, Alias_2] _2_2->_2_5 - - + + _2_3 - -11     Terminal 'store_3', input: [9, 11] + +11     Terminal 'store_3', input: [9, 11] _2_4 - -12     Terminal 'alloc', input: [11, 13] + +12     Terminal 'alloc', input: [11, 13] _2_6 -14     Intermediate input: 0, rsm: Alias_1, input: [1, 9] +14     Intermediate input: 0, rsm: Alias_1, input: [1, 9] _2_5->_2_6 - - + + _2_7 - -15     Range , input: [1, 0], rsm: [Alias_0, Alias_1] + +15     Range , input: [1, 0], rsm: [Alias_0, Alias_1] _2_6->_2_7 - - + + _2_8 - -16     Range , input: [0, 9], rsm: [Alias_1, Alias_2] + +16     Range , input: [0, 9], rsm: [Alias_1, Alias_2] _2_6->_2_8 - - + + _2_9 - -17     Nonterminal PointsTo, input: [1, 0] + +17     Nonterminal PointsTo, input: [1, 0] _2_7->_2_9 - - + + _2_10 - -18     Nonterminal FlowsTo, input: [0, 9] + +18     Nonterminal FlowsTo, input: [0, 9] _2_8->_2_10 - - + + _2_11 - -19     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + +19     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] _2_9->_2_11 - - + + _2_13 - -20     Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1] + +20     Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1] _2_10->_2_13 - - + + _2_14 - -21     Terminal 'alloc', input: [1, 0] + +21     Terminal 'alloc', input: [1, 0] _2_11->_2_14 - - + + _2_23 - -3     Range , input: [1, 11], rsm: [S_0, S_0] + +3     Range , input: [1, 11], rsm: [S_0, S_0] _2_12->_2_23 - - + + _2_34 - -4     Range , input: [11, 13], rsm: [S_0, S_2] + +4     Range , input: [11, 13], rsm: [S_0, S_2] _2_12->_2_34 - - + + _2_15 -22     Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9] +22     Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9] _2_13->_2_15 - - + + @@ -859,8 +859,8 @@ _2_15->_2_16 - - + + @@ -871,8 +871,8 @@ _2_15->_2_17 - - + + @@ -971,13 +971,13 @@ _2_44 -5     Intermediate input: 9, rsm: S_1, input: [1, 11] +5     Intermediate input: 9, rsm: S_1, input: [1, 11] _2_23->_2_44 - - + + @@ -1076,14 +1076,14 @@ _2_45 - -6     Nonterminal PointsTo, input: [11, 13] + +6     Nonterminal PointsTo, input: [11, 13] _2_34->_2_45 - - + + @@ -1184,56 +1184,56 @@ _2_46 - -7     Range , input: [1, 9], rsm: [S_0, S_1] + +7     Range , input: [1, 9], rsm: [S_0, S_1] _2_44->_2_46 - - + + _2_47 - -8     Range , input: [9, 11], rsm: [S_1, S_0] + +8     Range , input: [9, 11], rsm: [S_1, S_0] _2_44->_2_47 - - + + _2_48 - -9     Range , input: [11, 13], rsm: [PointsTo_0, PointsTo_5] + +9     Range , input: [11, 13], rsm: [PointsTo_0, PointsTo_5] _2_45->_2_48 - - + + _2_46->_2_2 - - + + _2_47->_2_3 - - + + _2_48->_2_4 - - + + @@ -1599,513 +1599,513 @@ _4_0 - -0     Nonterminal S, input: [8, 12] + +0     Nonterminal S, input: [8, 12] _4_1 - -1     Range , input: [8, 12], rsm: [S_0, S_2] + +1     Range , input: [8, 12], rsm: [S_0, S_2] _4_0->_4_1 - - + + _4_12 -2     Intermediate input: 10, rsm: S_0, input: [8, 12] +2     Intermediate input: 10, rsm: S_0, input: [8, 12] _4_1->_4_12 - - + + _4_2 - -10     Range , input: [10, 12], rsm: [PointsTo_0, PointsTo_5] + +10     Range , input: [10, 12], rsm: [PointsTo_0, PointsTo_5] _4_4 - -12     Terminal 'alloc', input: [10, 12] + +12     Terminal 'alloc', input: [10, 12] _4_2->_4_4 - - + + _4_3 - -11     Nonterminal Alias, input: [8, 8] + +11     Nonterminal Alias, input: [8, 8] _4_5 - -13     Range , input: [8, 8], rsm: [Alias_0, Alias_2] + +13     Range , input: [8, 8], rsm: [Alias_0, Alias_2] _4_3->_4_5 - - + + _4_6 -14     Intermediate input: 0, rsm: Alias_1, input: [8, 8] +14     Intermediate input: 0, rsm: Alias_1, input: [8, 8] _4_5->_4_6 - - + + _4_7 - -15     Range , input: [8, 0], rsm: [Alias_0, Alias_1] + +15     Range , input: [8, 0], rsm: [Alias_0, Alias_1] _4_6->_4_7 - - + + _4_8 - -16     Range , input: [0, 8], rsm: [Alias_1, Alias_2] + +16     Range , input: [0, 8], rsm: [Alias_1, Alias_2] _4_6->_4_8 - - + + _4_9 - -17     Nonterminal PointsTo, input: [8, 0] + +17     Nonterminal PointsTo, input: [8, 0] _4_7->_4_9 - - + + _4_10 - -18     Nonterminal FlowsTo, input: [0, 8] + +18     Nonterminal FlowsTo, input: [0, 8] _4_8->_4_10 - - + + _4_11 - -19     Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5] + +19     Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5] _4_9->_4_11 - - + + _4_13 - -20     Range , input: [0, 8], rsm: [FlowsTo_0, FlowsTo_1] + +20     Range , input: [0, 8], rsm: [FlowsTo_0, FlowsTo_1] _4_10->_4_13 - - + + _4_14 -21     Intermediate input: 1, rsm: PointsTo_0, input: [8, 0] +21     Intermediate input: 1, rsm: PointsTo_0, input: [8, 0] _4_11->_4_14 - - + + _4_23 - -3     Range , input: [8, 10], rsm: [S_0, S_0] + +3     Range , input: [8, 10], rsm: [S_0, S_0] _4_12->_4_23 - - + + _4_34 - -4     Range , input: [10, 12], rsm: [S_0, S_2] + +4     Range , input: [10, 12], rsm: [S_0, S_2] _4_12->_4_34 - - + + _4_15 -22     Intermediate input: 6, rsm: FlowsTo_1, input: [0, 8] +22     Intermediate input: 6, rsm: FlowsTo_1, input: [0, 8] _4_13->_4_15 - - + + _4_16 - -23     Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0] + +23     Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0] _4_14->_4_16 - - + + _4_17 - -24     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + +24     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] _4_14->_4_17 - - + + _4_18 - -25     Range , input: [0, 6], rsm: [FlowsTo_0, FlowsTo_1] + +25     Range , input: [0, 6], rsm: [FlowsTo_0, FlowsTo_1] _4_15->_4_18 - - + + _4_19 - -26     Range , input: [6, 8], rsm: [FlowsTo_1, FlowsTo_1] + +26     Range , input: [6, 8], rsm: [FlowsTo_1, FlowsTo_1] _4_15->_4_19 - - + + _4_20 -27     Intermediate input: 4, rsm: PointsTo_9, input: [8, 1] +27     Intermediate input: 4, rsm: PointsTo_9, input: [8, 1] _4_16->_4_20 - - + + _4_21 - -28     Terminal 'alloc', input: [1, 0] + +28     Terminal 'alloc', input: [1, 0] _4_17->_4_21 - - + + _4_22 -29     Intermediate input: 4, rsm: FlowsTo_9, input: [0, 6] +29     Intermediate input: 4, rsm: FlowsTo_9, input: [0, 6] _4_18->_4_22 - - + + _4_24 - -30     Terminal 'assign_r', input: [6, 8] + +30     Terminal 'assign_r', input: [6, 8] _4_19->_4_24 - - + + _4_25 - -31     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9] + +31     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9] _4_20->_4_25 - - + + _4_26 - -32     Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0] + +32     Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0] _4_20->_4_26 - - + + _4_27 - -33     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_9] + +33     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_9] _4_22->_4_27 - - + + _4_28 - -34     Range , input: [4, 6], rsm: [FlowsTo_9, FlowsTo_1] + +34     Range , input: [4, 6], rsm: [FlowsTo_9, FlowsTo_1] _4_22->_4_28 - - + + _4_45 - -5     Terminal 'store_2', input: [8, 10] + +5     Terminal 'store_2', input: [8, 10] _4_23->_4_45 - - + + _4_56 -6     Intermediate input: 8, rsm: S_1, input: [8, 10] +6     Intermediate input: 8, rsm: S_1, input: [8, 10] _4_23->_4_56 - - + + _4_29 -35     Intermediate input: 4, rsm: PointsTo_1, input: [8, 4] +35     Intermediate input: 4, rsm: PointsTo_1, input: [8, 4] _4_25->_4_29 - - + + _4_30 - -36     Terminal 'store_0', input: [4, 1] + +36     Terminal 'store_0', input: [4, 1] _4_26->_4_30 - - + + _4_31 -37     Intermediate input: 4, rsm: FlowsTo_2, input: [0, 4] +37     Intermediate input: 4, rsm: FlowsTo_2, input: [0, 4] _4_27->_4_31 - - + + _4_32 - -38     Terminal 'load_0_r', input: [4, 6] + +38     Terminal 'load_0_r', input: [4, 6] _4_28->_4_32 - - + + _4_33 - -39     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1] + +39     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_1] _4_29->_4_33 - - + + _4_35 - -40     Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9] + +40     Range , input: [4, 4], rsm: [PointsTo_1, PointsTo_9] _4_29->_4_35 - - + + _4_36 - -41     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_2] + +41     Range , input: [0, 4], rsm: [FlowsTo_0, FlowsTo_2] _4_31->_4_36 - - + + _4_37 - -42     Range , input: [4, 4], rsm: [FlowsTo_2, FlowsTo_9] + +42     Range , input: [4, 4], rsm: [FlowsTo_2, FlowsTo_9] _4_31->_4_37 - - + + _4_38 -43     Intermediate input: 6, rsm: PointsTo_0, input: [8, 4] +43     Intermediate input: 6, rsm: PointsTo_0, input: [8, 4] _4_33->_4_38 - - + + _4_62 - -7     Nonterminal PointsTo, input: [10, 12] + +7     Nonterminal PointsTo, input: [10, 12] _4_34->_4_62 - - + + _4_39 - -44     Nonterminal Alias, input: [4, 4] + +44     Nonterminal Alias, input: [4, 4] _4_35->_4_39 - - + + _4_40 -45     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 4] +45     Intermediate input: 1, rsm: FlowsTo_1, input: [0, 4] _4_36->_4_40 - - + + _4_41 - -46     Nonterminal Alias, input: [4, 4] + +46     Nonterminal Alias, input: [4, 4] _4_37->_4_41 - - + + @@ -2116,8 +2116,8 @@ _4_38->_4_42 - - + + @@ -2128,8 +2128,8 @@ _4_38->_4_43 - - + + @@ -2140,8 +2140,8 @@ _4_39->_4_44 - - + + @@ -2152,8 +2152,8 @@ _4_40->_4_46 - - + + @@ -2164,14 +2164,14 @@ _4_40->_4_47 - - + + _4_41->_4_44 - - + + @@ -2295,26 +2295,26 @@ _4_63 - -8     Range , input: [8, 8], rsm: [S_0, S_1] + +8     Range , input: [8, 8], rsm: [S_0, S_1] _4_56->_4_63 - - + + _4_64 - -9     Range , input: [8, 10], rsm: [S_1, S_0] + +9     Range , input: [8, 10], rsm: [S_1, S_0] _4_56->_4_64 - - + + @@ -2355,20 +2355,20 @@ _4_62->_4_2 - - + + _4_63->_4_3 - - + + _4_64->_4_45 - - + + @@ -2443,85 +2443,85 @@ _5_7 - -15     Range , input: [8, 0], rsm: [Alias_0, Alias_1] + +15     Range , input: [8, 0], rsm: [Alias_0, Alias_1] _5_6->_5_7 - - + + _5_8 - -16     Range , input: [0, 9], rsm: [Alias_1, Alias_2] + +16     Range , input: [0, 9], rsm: [Alias_1, Alias_2] _5_6->_5_8 - - + + _5_9 - -17     Nonterminal PointsTo, input: [8, 0] + +17     Nonterminal PointsTo, input: [8, 0] _5_7->_5_9 - - + + _5_10 - -18     Nonterminal FlowsTo, input: [0, 9] + +18     Nonterminal FlowsTo, input: [0, 9] _5_8->_5_10 - - + + _5_11 - -19     Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5] + +19     Range , input: [8, 0], rsm: [PointsTo_0, PointsTo_5] _5_9->_5_11 - - + + _5_13 - -20     Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1] + +20     Range , input: [0, 9], rsm: [FlowsTo_0, FlowsTo_1] _5_10->_5_13 - - + + _5_14 -21     Intermediate input: 1, rsm: PointsTo_0, input: [8, 0] +21     Intermediate input: 1, rsm: PointsTo_0, input: [8, 0] _5_11->_5_14 - - + + @@ -2550,37 +2550,37 @@ _5_15 -22     Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9] +22     Intermediate input: 7, rsm: FlowsTo_1, input: [0, 9] _5_13->_5_15 - - + + _5_16 - -23     Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0] + +23     Range , input: [8, 1], rsm: [PointsTo_0, PointsTo_0] _5_14->_5_16 - - + + _5_17 - -24     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] + +24     Range , input: [1, 0], rsm: [PointsTo_0, PointsTo_5] _5_14->_5_17 - - + + @@ -2591,8 +2591,8 @@ _5_15->_5_18 - - + + @@ -2603,31 +2603,31 @@ _5_15->_5_19 - - + + _5_20 -27     Intermediate input: 4, rsm: PointsTo_9, input: [8, 1] +27     Intermediate input: 4, rsm: PointsTo_9, input: [8, 1] _5_16->_5_20 - - + + _5_21 - -28     Terminal 'alloc', input: [1, 0] + +28     Terminal 'alloc', input: [1, 0] _5_17->_5_21 - - + + @@ -2655,26 +2655,26 @@ _5_25 - -31     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9] + +31     Range , input: [8, 4], rsm: [PointsTo_0, PointsTo_9] _5_20->_5_25 - - + + _5_26 - -32     Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0] + +32     Range , input: [4, 1], rsm: [PointsTo_9, PointsTo_0] _5_20->_5_26 - - + + @@ -2714,25 +2714,25 @@ _5_29 -35     Intermediate input: 4, rsm: PointsTo_1, input: [8, 4] +35     Intermediate input: 4, rsm: PointsTo_1, input: [8, 4] _5_25->_5_29 - - + + _5_30 - -36     Terminal 'store_0', input: [4, 1] + +36     Terminal 'store_0', input: [4, 1] _5_26->_5_30 - - + + @@ -2766,8 +2766,8 @@ _5_29->_5_33 - - + + @@ -2778,8 +2778,8 @@ _5_29->_5_35 - - + + @@ -3032,26 +3032,26 @@ _5_55 - -59     Range , input: [4, 2], rsm: [Alias_0, Alias_1] + +59     Range , input: [4, 2], rsm: [Alias_0, Alias_1] _5_51->_5_55 - - + + _5_57 - -60     Range , input: [2, 4], rsm: [Alias_1, Alias_2] + +60     Range , input: [2, 4], rsm: [Alias_1, Alias_2] _5_51->_5_57 - - + + @@ -3080,14 +3080,14 @@ _5_60 - -63     Nonterminal PointsTo, input: [4, 2] + +63     Nonterminal PointsTo, input: [4, 2] _5_55->_5_60 - - + + @@ -3104,14 +3104,14 @@ _5_61 - -64     Nonterminal FlowsTo, input: [2, 4] + +64     Nonterminal FlowsTo, input: [2, 4] _5_57->_5_61 - - + + @@ -3140,26 +3140,26 @@ _5_64 - -67     Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5] + +67     Range , input: [4, 2], rsm: [PointsTo_0, PointsTo_5] _5_60->_5_64 - - + + _5_65 - -68     Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1] + +68     Range , input: [2, 4], rsm: [FlowsTo_0, FlowsTo_1] _5_61->_5_65 - - + + @@ -3188,26 +3188,26 @@ _5_69 - -71     Terminal 'alloc', input: [4, 2] + +71     Terminal 'alloc', input: [4, 2] _5_64->_5_69 - - + + _5_70 - -72     Terminal 'alloc_r', input: [2, 4] + +72     Terminal 'alloc_r', input: [2, 4] _5_65->_5_70 - - + + From cb8c88e375f17d4feb37c03d1cf418eb0c6c6ac7 Mon Sep 17 00:00:00 2001 From: gsv Date: Fri, 20 Feb 2026 17:06:31 +0300 Subject: [PATCH 21/71] Missed figures --- .../resources/figures/Epsilon_example.dot | 3 + .../resources/figures/Epsilon_example.dot.svg | 19 + .../figures/Intermediate_example.dot | 4 + .../figures/Intermediate_example.dot.svg | 18 + .../resources/figures/Nonterm_example.dot | 4 + .../resources/figures/Nonterm_example.dot.svg | 19 + .../main/resources/figures/Range_example.dot | 4 + .../resources/figures/Range_example.dot.svg | 19 + .../resources/figures/Terminal_example.dot | 4 + .../figures/Terminal_example.dot.svg | 19 + cfpq-app/src/main/resources/figures/rsm.dot | 106 ++++ .../src/main/resources/figures/rsm.dot.svg | 473 ++++++++++++++++++ 12 files changed, 692 insertions(+) create mode 100644 cfpq-app/src/main/resources/figures/Epsilon_example.dot create mode 100644 cfpq-app/src/main/resources/figures/Epsilon_example.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/Intermediate_example.dot create mode 100644 cfpq-app/src/main/resources/figures/Intermediate_example.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/Nonterm_example.dot create mode 100644 cfpq-app/src/main/resources/figures/Nonterm_example.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/Range_example.dot create mode 100644 cfpq-app/src/main/resources/figures/Range_example.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/Terminal_example.dot create mode 100644 cfpq-app/src/main/resources/figures/Terminal_example.dot.svg create mode 100644 cfpq-app/src/main/resources/figures/rsm.dot create mode 100644 cfpq-app/src/main/resources/figures/rsm.dot.svg diff --git a/cfpq-app/src/main/resources/figures/Epsilon_example.dot b/cfpq-app/src/main/resources/figures/Epsilon_example.dot new file mode 100644 index 000000000..fe56a9c3e --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Epsilon_example.dot @@ -0,0 +1,3 @@ +digraph g{ +_0_12 [label = "2 Epsilon RSM: S_0, input: [0, 0]", shape = invhouse] +} \ No newline at end of file diff --git a/cfpq-app/src/main/resources/figures/Epsilon_example.dot.svg b/cfpq-app/src/main/resources/figures/Epsilon_example.dot.svg new file mode 100644 index 000000000..e39d541be --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Epsilon_example.dot.svg @@ -0,0 +1,19 @@ + + + + + + +g + + + +_0_12 + +2     Epsilon RSM: S_0, input: [0, 0] + + + diff --git a/cfpq-app/src/main/resources/figures/Intermediate_example.dot b/cfpq-app/src/main/resources/figures/Intermediate_example.dot new file mode 100644 index 000000000..12323b224 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Intermediate_example.dot @@ -0,0 +1,4 @@ +digraph g{ +_1_8 [label = "16 Intermediate input: 1, rsm: Alias_1, input: [0, 2]", shape = plain] +} + diff --git a/cfpq-app/src/main/resources/figures/Intermediate_example.dot.svg b/cfpq-app/src/main/resources/figures/Intermediate_example.dot.svg new file mode 100644 index 000000000..8487bffd2 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Intermediate_example.dot.svg @@ -0,0 +1,18 @@ + + + + + + +g + + + +_1_8 +16     Intermediate input: 1, rsm: Alias_1, input: [0, 2] + + + diff --git a/cfpq-app/src/main/resources/figures/Nonterm_example.dot b/cfpq-app/src/main/resources/figures/Nonterm_example.dot new file mode 100644 index 000000000..b65f1ef17 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Nonterm_example.dot @@ -0,0 +1,4 @@ +digraph g{ +_1_0 [label = "0 Nonterminal S, input: [0, 4]", shape = invtrapezium] +} + diff --git a/cfpq-app/src/main/resources/figures/Nonterm_example.dot.svg b/cfpq-app/src/main/resources/figures/Nonterm_example.dot.svg new file mode 100644 index 000000000..b4e60e705 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Nonterm_example.dot.svg @@ -0,0 +1,19 @@ + + + + + + +g + + + +_1_0 + +0     Nonterminal S, input: [0, 4] + + + diff --git a/cfpq-app/src/main/resources/figures/Range_example.dot b/cfpq-app/src/main/resources/figures/Range_example.dot new file mode 100644 index 000000000..aa8f56187 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Range_example.dot @@ -0,0 +1,4 @@ +digraph g{ +_1_1 [label = "1 Range , input: [0, 4], rsm: [S_0, S_2]", shape = ellipse] +} + diff --git a/cfpq-app/src/main/resources/figures/Range_example.dot.svg b/cfpq-app/src/main/resources/figures/Range_example.dot.svg new file mode 100644 index 000000000..e1b36d3f1 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Range_example.dot.svg @@ -0,0 +1,19 @@ + + + + + + +g + + + +_1_1 + +1     Range , input: [0, 4], rsm: [S_0, S_2] + + + diff --git a/cfpq-app/src/main/resources/figures/Terminal_example.dot b/cfpq-app/src/main/resources/figures/Terminal_example.dot new file mode 100644 index 000000000..b64dea439 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Terminal_example.dot @@ -0,0 +1,4 @@ +digraph g{ +_1_5 [label = "13 Terminal 'alloc', input: [3, 4]", shape = rectangle] +} + diff --git a/cfpq-app/src/main/resources/figures/Terminal_example.dot.svg b/cfpq-app/src/main/resources/figures/Terminal_example.dot.svg new file mode 100644 index 000000000..9947cddfd --- /dev/null +++ b/cfpq-app/src/main/resources/figures/Terminal_example.dot.svg @@ -0,0 +1,19 @@ + + + + + + +g + + + +_1_5 + +13     Terminal 'alloc', input: [3, 4] + + + diff --git a/cfpq-app/src/main/resources/figures/rsm.dot b/cfpq-app/src/main/resources/figures/rsm.dot new file mode 100644 index 000000000..f1ae35e3b --- /dev/null +++ b/cfpq-app/src/main/resources/figures/rsm.dot @@ -0,0 +1,106 @@ +digraph g { +S_2 [label = "S_2", shape = doublecircle, color = red] +PointsTo_4 [label = "PointsTo_4", shape = circle, color = black] +PointsTo_3 [label = "PointsTo_3", shape = circle, color = black] +PointsTo_2 [label = "PointsTo_2", shape = circle, color = black] +PointsTo_1 [label = "PointsTo_1", shape = circle, color = black] +FlowsTo_9 [label = "FlowsTo_9", shape = circle, color = black] +FlowsTo_8 [label = "FlowsTo_8", shape = circle, color = black] +S_1 [label = "S_1", shape = circle, color = black] +FlowsTo_5 [label = "FlowsTo_5", shape = circle, color = black] +FlowsTo_4 [label = "FlowsTo_4", shape = circle, color = black] +PointsTo_5 [label = "PointsTo_5", shape = doublecircle, color = red] +FlowsTo_1 [label = "FlowsTo_1", shape = doublecircle, color = red] +FlowsTo_7 [label = "FlowsTo_7", shape = circle, color = black] +FlowsTo_6 [label = "FlowsTo_6", shape = circle, color = black] +PointsTo_9 [label = "PointsTo_9", shape = circle, color = black] +PointsTo_8 [label = "PointsTo_8", shape = circle, color = black] +PointsTo_7 [label = "PointsTo_7", shape = circle, color = black] +FlowsTo_3 [label = "FlowsTo_3", shape = circle, color = black] +S_0 [label = "S_0", shape = circle, color = green] +PointsTo_6 [label = "PointsTo_6", shape = circle, color = black] +FlowsTo_2 [label = "FlowsTo_2", shape = circle, color = black] +Alias_2 [label = "Alias_2", shape = doublecircle, color = red] +FlowsTo_0 [label = "FlowsTo_0", shape = circle, color = green] +Alias_1 [label = "Alias_1", shape = circle, color = black] +PointsTo_0 [label = "PointsTo_0", shape = circle, color = green] +Alias_0 [label = "Alias_0", shape = circle, color = green] +PointsTo_4 -> PointsTo_6 [label = "Alias"] +PointsTo_3 -> PointsTo_7 [label = "Alias"] +PointsTo_2 -> PointsTo_8 [label = "Alias"] +PointsTo_1 -> PointsTo_9 [label = "Alias"] +FlowsTo_9 -> FlowsTo_1 [label = "load_0_r"] +FlowsTo_8 -> FlowsTo_1 [label = "load_1_r"] +S_1 -> S_0 [label = "store_0"] +S_1 -> S_0 [label = "store_1"] +S_1 -> S_0 [label = "store_2"] +S_1 -> S_0 [label = "store_3"] +FlowsTo_5 -> FlowsTo_6 [label = "Alias"] +FlowsTo_4 -> FlowsTo_7 [label = "Alias"] +FlowsTo_1 -> FlowsTo_1 [label = "assign_r"] +FlowsTo_1 -> FlowsTo_2 [label = "store_0_r"] +FlowsTo_1 -> FlowsTo_3 [label = "store_1_r"] +FlowsTo_1 -> FlowsTo_4 [label = "store_2_r"] +FlowsTo_1 -> FlowsTo_5 [label = "store_3_r"] +FlowsTo_7 -> FlowsTo_1 [label = "load_2_r"] +FlowsTo_6 -> FlowsTo_1 [label = "load_3_r"] +PointsTo_9 -> PointsTo_0 [label = "store_0"] +PointsTo_8 -> PointsTo_0 [label = "store_1"] +PointsTo_7 -> PointsTo_0 [label = "store_2"] +FlowsTo_3 -> FlowsTo_8 [label = "Alias"] +S_0 -> S_0 [label = "store_0"] +S_0 -> S_0 [label = "store_1"] +S_0 -> S_0 [label = "store_2"] +S_0 -> S_0 [label = "store_3"] +S_0 -> S_1 [label = "Alias"] +S_0 -> S_2 [label = "PointsTo"] +PointsTo_6 -> PointsTo_0 [label = "store_3"] +FlowsTo_2 -> FlowsTo_9 [label = "Alias"] +FlowsTo_0 -> FlowsTo_1 [label = "alloc_r"] +Alias_1 -> Alias_2 [label = "FlowsTo"] +PointsTo_0 -> PointsTo_0 [label = "assign"] +PointsTo_0 -> PointsTo_1 [label = "load_0"] +PointsTo_0 -> PointsTo_2 [label = "load_1"] +PointsTo_0 -> PointsTo_3 [label = "load_2"] +PointsTo_0 -> PointsTo_4 [label = "load_3"] +PointsTo_0 -> PointsTo_5 [label = "alloc"] +Alias_0 -> Alias_1 [label = "PointsTo"] +subgraph cluster_S { +S_1 +S_2 +S_0 +label = "S" +} +subgraph cluster_FlowsTo { +FlowsTo_9 +FlowsTo_8 +FlowsTo_0 +FlowsTo_5 +FlowsTo_4 +FlowsTo_1 +FlowsTo_7 +FlowsTo_6 +FlowsTo_3 +FlowsTo_2 +label = "FlowsTo" +} +subgraph cluster_Alias { +Alias_2 +Alias_0 +Alias_1 +label = "Alias" +} +subgraph cluster_PointsTo { +PointsTo_4 +PointsTo_3 +PointsTo_2 +PointsTo_1 +PointsTo_5 +PointsTo_0 +PointsTo_9 +PointsTo_8 +PointsTo_7 +PointsTo_6 +label = "PointsTo" +} +} diff --git a/cfpq-app/src/main/resources/figures/rsm.dot.svg b/cfpq-app/src/main/resources/figures/rsm.dot.svg new file mode 100644 index 000000000..096eee3a8 --- /dev/null +++ b/cfpq-app/src/main/resources/figures/rsm.dot.svg @@ -0,0 +1,473 @@ + + + + + + +g + + +cluster_S + +S + + +cluster_FlowsTo + +FlowsTo + + +cluster_Alias + +Alias + + +cluster_PointsTo + +PointsTo + + + +S_2 + + +S_2 + + + +PointsTo_4 + +PointsTo_4 + + + +PointsTo_6 + +PointsTo_6 + + + +PointsTo_4->PointsTo_6 + + +Alias + + + +PointsTo_3 + +PointsTo_3 + + + +PointsTo_7 + +PointsTo_7 + + + +PointsTo_3->PointsTo_7 + + +Alias + + + +PointsTo_2 + +PointsTo_2 + + + +PointsTo_8 + +PointsTo_8 + + + +PointsTo_2->PointsTo_8 + + +Alias + + + +PointsTo_1 + +PointsTo_1 + + + +PointsTo_9 + +PointsTo_9 + + + +PointsTo_1->PointsTo_9 + + +Alias + + + +FlowsTo_9 + +FlowsTo_9 + + + +FlowsTo_1 + + +FlowsTo_1 + + + +FlowsTo_9->FlowsTo_1 + + +load_0_r + + + +FlowsTo_8 + +FlowsTo_8 + + + +FlowsTo_8->FlowsTo_1 + + +load_1_r + + + +S_1 + +S_1 + + + +S_0 + +S_0 + + + +S_1->S_0 + + +store_0 + + + +S_1->S_0 + + +store_1 + + + +S_1->S_0 + + +store_2 + + + +S_1->S_0 + + +store_3 + + + +FlowsTo_5 + +FlowsTo_5 + + + +FlowsTo_6 + +FlowsTo_6 + + + +FlowsTo_5->FlowsTo_6 + + +Alias + + + +FlowsTo_4 + +FlowsTo_4 + + + +FlowsTo_7 + +FlowsTo_7 + + + +FlowsTo_4->FlowsTo_7 + + +Alias + + + +PointsTo_5 + + +PointsTo_5 + + + +FlowsTo_1->FlowsTo_5 + + +store_3_r + + + +FlowsTo_1->FlowsTo_4 + + +store_2_r + + + +FlowsTo_1->FlowsTo_1 + + +assign_r + + + +FlowsTo_3 + +FlowsTo_3 + + + +FlowsTo_1->FlowsTo_3 + + +store_1_r + + + +FlowsTo_2 + +FlowsTo_2 + + + +FlowsTo_1->FlowsTo_2 + + +store_0_r + + + +FlowsTo_7->FlowsTo_1 + + +load_2_r + + + +FlowsTo_6->FlowsTo_1 + + +load_3_r + + + +PointsTo_0 + +PointsTo_0 + + + +PointsTo_9->PointsTo_0 + + +store_0 + + + +PointsTo_8->PointsTo_0 + + +store_1 + + + +PointsTo_7->PointsTo_0 + + +store_2 + + + +FlowsTo_3->FlowsTo_8 + + +Alias + + + +S_0->S_2 + + +PointsTo + + + +S_0->S_1 + + +Alias + + + +S_0->S_0 + + +store_0 + + + +S_0->S_0 + + +store_1 + + + +S_0->S_0 + + +store_2 + + + +S_0->S_0 + + +store_3 + + + +PointsTo_6->PointsTo_0 + + +store_3 + + + +FlowsTo_2->FlowsTo_9 + + +Alias + + + +Alias_2 + + +Alias_2 + + + +FlowsTo_0 + +FlowsTo_0 + + + +FlowsTo_0->FlowsTo_1 + + +alloc_r + + + +Alias_1 + +Alias_1 + + + +Alias_1->Alias_2 + + +FlowsTo + + + +PointsTo_0->PointsTo_4 + + +load_3 + + + +PointsTo_0->PointsTo_3 + + +load_2 + + + +PointsTo_0->PointsTo_2 + + +load_1 + + + +PointsTo_0->PointsTo_1 + + +load_0 + + + +PointsTo_0->PointsTo_5 + + +alloc + + + +PointsTo_0->PointsTo_0 + + +assign + + + +Alias_0 + +Alias_0 + + + +Alias_0->Alias_1 + + +PointsTo + + + From 7ddd261f6be475538c56fed2cb11f0ce02d44911 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Sun, 8 Mar 2026 23:07:51 +0300 Subject: [PATCH 22/71] Fix module and packages names --- {cfpq-app => cfpq-paths-app}/README.md | 0 {cfpq-app => cfpq-paths-app}/build.gradle.kts | 2 +- .../src/main/kotlin/org/ucfs/paths}/Main.kt | 3 +-- .../src/main/resources/figures/Epsilon_example.dot | 0 .../src/main/resources/figures/Epsilon_example.dot.svg | 0 .../src/main/resources/figures/Intermediate_example.dot | 0 .../src/main/resources/figures/Intermediate_example.dot.svg | 0 .../src/main/resources/figures/Nonterm_example.dot | 0 .../src/main/resources/figures/Nonterm_example.dot.svg | 0 .../src/main/resources/figures/Range_example.dot | 0 .../src/main/resources/figures/Range_example.dot.svg | 0 .../src/main/resources/figures/Terminal_example.dot | 0 .../src/main/resources/figures/Terminal_example.dot.svg | 0 .../src/main/resources/figures/graph_1.dot | 0 .../src/main/resources/figures/graph_1.dot.svg | 0 .../src/main/resources/figures/graph_1_sppf.dot | 0 .../src/main/resources/figures/graph_1_sppf.dot.svg | 0 .../src/main/resources/figures/graph_2.dot | 0 .../src/main/resources/figures/graph_2.dot.svg | 0 .../src/main/resources/figures/graph_2_sppf.dot | 0 .../src/main/resources/figures/graph_2_sppf.dot.svg | 0 .../src/main/resources/figures/graph_3.dot | 0 .../src/main/resources/figures/graph_3.dot.svg | 0 .../src/main/resources/figures/graph_3_sppf.dot | 0 .../src/main/resources/figures/graph_3_sppf.dot.svg | 0 .../src/main/resources/figures/graph_4.dot | 0 .../src/main/resources/figures/graph_4.dot.svg | 0 .../src/main/resources/figures/graph_4_sppf.dot | 0 .../src/main/resources/figures/graph_4_sppf.dot.svg | 0 .../src/main/resources/figures/rsm.dot | 0 .../src/main/resources/figures/rsm.dot.svg | 0 {cfpq-app => cfpq-paths-app}/src/main/resources/graph_1.dot | 0 {cfpq-app => cfpq-paths-app}/src/main/resources/graph_2.dot | 0 {cfpq-app => cfpq-paths-app}/src/main/resources/graph_3.dot | 0 {cfpq-app => cfpq-paths-app}/src/main/resources/graph_4.dot | 0 settings.gradle.kts | 2 +- 36 files changed, 3 insertions(+), 4 deletions(-) rename {cfpq-app => cfpq-paths-app}/README.md (100%) rename {cfpq-app => cfpq-paths-app}/build.gradle.kts (85%) rename {cfpq-app/src/main/kotlin/me/vkutuev => cfpq-paths-app/src/main/kotlin/org/ucfs/paths}/Main.kt (98%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Epsilon_example.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Epsilon_example.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Intermediate_example.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Intermediate_example.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Nonterm_example.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Nonterm_example.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Range_example.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Range_example.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Terminal_example.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/Terminal_example.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_1.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_1.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_1_sppf.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_1_sppf.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_2.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_2.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_2_sppf.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_2_sppf.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_3.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_3.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_3_sppf.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_3_sppf.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_4.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_4.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_4_sppf.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/graph_4_sppf.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/rsm.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/figures/rsm.dot.svg (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/graph_1.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/graph_2.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/graph_3.dot (100%) rename {cfpq-app => cfpq-paths-app}/src/main/resources/graph_4.dot (100%) diff --git a/cfpq-app/README.md b/cfpq-paths-app/README.md similarity index 100% rename from cfpq-app/README.md rename to cfpq-paths-app/README.md diff --git a/cfpq-app/build.gradle.kts b/cfpq-paths-app/build.gradle.kts similarity index 85% rename from cfpq-app/build.gradle.kts rename to cfpq-paths-app/build.gradle.kts index d7c338601..4ff9a58b9 100644 --- a/cfpq-app/build.gradle.kts +++ b/cfpq-paths-app/build.gradle.kts @@ -17,5 +17,5 @@ kotlin { } application { - mainClass = "me.vkutuev.MainKt" + mainClass = "org.ucfs.paths.MainKt" } diff --git a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/Main.kt similarity index 98% rename from cfpq-app/src/main/kotlin/me/vkutuev/Main.kt rename to cfpq-paths-app/src/main/kotlin/org/ucfs/paths/Main.kt index a13f0e0a6..9c36d45f6 100644 --- a/cfpq-app/src/main/kotlin/me/vkutuev/Main.kt +++ b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/Main.kt @@ -1,7 +1,6 @@ -package me.vkutuev +package org.ucfs.paths import org.ucfs.grammar.combinator.Grammar -import org.ucfs.grammar.combinator.extension.StringExtension.many import org.ucfs.grammar.combinator.extension.StringExtension.or import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt diff --git a/cfpq-app/src/main/resources/figures/Epsilon_example.dot b/cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/Epsilon_example.dot rename to cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot diff --git a/cfpq-app/src/main/resources/figures/Epsilon_example.dot.svg b/cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/Epsilon_example.dot.svg rename to cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot.svg diff --git a/cfpq-app/src/main/resources/figures/Intermediate_example.dot b/cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/Intermediate_example.dot rename to cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot diff --git a/cfpq-app/src/main/resources/figures/Intermediate_example.dot.svg b/cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/Intermediate_example.dot.svg rename to cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot.svg diff --git a/cfpq-app/src/main/resources/figures/Nonterm_example.dot b/cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/Nonterm_example.dot rename to cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot diff --git a/cfpq-app/src/main/resources/figures/Nonterm_example.dot.svg b/cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/Nonterm_example.dot.svg rename to cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot.svg diff --git a/cfpq-app/src/main/resources/figures/Range_example.dot b/cfpq-paths-app/src/main/resources/figures/Range_example.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/Range_example.dot rename to cfpq-paths-app/src/main/resources/figures/Range_example.dot diff --git a/cfpq-app/src/main/resources/figures/Range_example.dot.svg b/cfpq-paths-app/src/main/resources/figures/Range_example.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/Range_example.dot.svg rename to cfpq-paths-app/src/main/resources/figures/Range_example.dot.svg diff --git a/cfpq-app/src/main/resources/figures/Terminal_example.dot b/cfpq-paths-app/src/main/resources/figures/Terminal_example.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/Terminal_example.dot rename to cfpq-paths-app/src/main/resources/figures/Terminal_example.dot diff --git a/cfpq-app/src/main/resources/figures/Terminal_example.dot.svg b/cfpq-paths-app/src/main/resources/figures/Terminal_example.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/Terminal_example.dot.svg rename to cfpq-paths-app/src/main/resources/figures/Terminal_example.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_1.dot b/cfpq-paths-app/src/main/resources/figures/graph_1.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_1.dot rename to cfpq-paths-app/src/main/resources/figures/graph_1.dot diff --git a/cfpq-app/src/main/resources/figures/graph_1.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_1.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_1.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_1.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_1_sppf.dot b/cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_1_sppf.dot rename to cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot diff --git a/cfpq-app/src/main/resources/figures/graph_1_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_1_sppf.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_2.dot b/cfpq-paths-app/src/main/resources/figures/graph_2.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_2.dot rename to cfpq-paths-app/src/main/resources/figures/graph_2.dot diff --git a/cfpq-app/src/main/resources/figures/graph_2.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_2.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_2.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_2.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot b/cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_2_sppf.dot rename to cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot diff --git a/cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_2_sppf.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_3.dot b/cfpq-paths-app/src/main/resources/figures/graph_3.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_3.dot rename to cfpq-paths-app/src/main/resources/figures/graph_3.dot diff --git a/cfpq-app/src/main/resources/figures/graph_3.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_3.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_3.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_3.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot b/cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_3_sppf.dot rename to cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot diff --git a/cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_3_sppf.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_4.dot b/cfpq-paths-app/src/main/resources/figures/graph_4.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_4.dot rename to cfpq-paths-app/src/main/resources/figures/graph_4.dot diff --git a/cfpq-app/src/main/resources/figures/graph_4.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_4.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_4.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_4.dot.svg diff --git a/cfpq-app/src/main/resources/figures/graph_4_sppf.dot b/cfpq-paths-app/src/main/resources/figures/graph_4_sppf.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_4_sppf.dot rename to cfpq-paths-app/src/main/resources/figures/graph_4_sppf.dot diff --git a/cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/graph_4_sppf.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/graph_4_sppf.dot.svg rename to cfpq-paths-app/src/main/resources/figures/graph_4_sppf.dot.svg diff --git a/cfpq-app/src/main/resources/figures/rsm.dot b/cfpq-paths-app/src/main/resources/figures/rsm.dot similarity index 100% rename from cfpq-app/src/main/resources/figures/rsm.dot rename to cfpq-paths-app/src/main/resources/figures/rsm.dot diff --git a/cfpq-app/src/main/resources/figures/rsm.dot.svg b/cfpq-paths-app/src/main/resources/figures/rsm.dot.svg similarity index 100% rename from cfpq-app/src/main/resources/figures/rsm.dot.svg rename to cfpq-paths-app/src/main/resources/figures/rsm.dot.svg diff --git a/cfpq-app/src/main/resources/graph_1.dot b/cfpq-paths-app/src/main/resources/graph_1.dot similarity index 100% rename from cfpq-app/src/main/resources/graph_1.dot rename to cfpq-paths-app/src/main/resources/graph_1.dot diff --git a/cfpq-app/src/main/resources/graph_2.dot b/cfpq-paths-app/src/main/resources/graph_2.dot similarity index 100% rename from cfpq-app/src/main/resources/graph_2.dot rename to cfpq-paths-app/src/main/resources/graph_2.dot diff --git a/cfpq-app/src/main/resources/graph_3.dot b/cfpq-paths-app/src/main/resources/graph_3.dot similarity index 100% rename from cfpq-app/src/main/resources/graph_3.dot rename to cfpq-paths-app/src/main/resources/graph_3.dot diff --git a/cfpq-app/src/main/resources/graph_4.dot b/cfpq-paths-app/src/main/resources/graph_4.dot similarity index 100% rename from cfpq-app/src/main/resources/graph_4.dot rename to cfpq-paths-app/src/main/resources/graph_4.dot diff --git a/settings.gradle.kts b/settings.gradle.kts index 3e92e4f30..0055379ac 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,4 +5,4 @@ rootProject.name = "ucfs" include("solver") include("generator") include("test-shared") -include("cfpq-app") +include("cfpq-paths-app") From 1363fef960e07129993ec7e2b14a864a84e13dad Mon Sep 17 00:00:00 2001 From: danisaev Date: Sat, 21 Mar 2026 21:27:18 +0300 Subject: [PATCH 23/71] feat(simple-examples): add example_1 graph pathfinding with grammar - Add simple_examples package with example_1.kt for pathfinding algorithm - Add figures directory with graph visualization outputs (*.dot.svg) - Add gen directory with algorithm-generated SPPF dot file - Add example_1_graph.dot resource file for algorithm input - Add runSimpleExamples task to build.gradle.kts for convenient execution The example demonstrates pathfinding using specified grammar rules. Visualization files help understand the graph structure and SPPF output. Usage: ./gradlew :cfpq-paths-app:runSimpleExamples --- cfpq-paths-app/build.gradle.kts | 6 + .../main/kotlin/simple_examples/example_1.kt | 100 + .../figures/example_1_graph.dot | 11 + .../figures/example_1_graph.dot.svg | 96 + .../figures/example_1_graph_sppf.dot | 671 +++ .../figures/example_1_graph_sppf.dot.svg | 3811 +++++++++++++++++ .../gen/example_1_graph_sppf.dot | 671 +++ .../src/main/resources/example_1_graph.dot | 11 + 8 files changed, 5377 insertions(+) create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot create mode 100644 cfpq-paths-app/src/main/resources/example_1_graph.dot diff --git a/cfpq-paths-app/build.gradle.kts b/cfpq-paths-app/build.gradle.kts index 4ff9a58b9..3f637dbc4 100644 --- a/cfpq-paths-app/build.gradle.kts +++ b/cfpq-paths-app/build.gradle.kts @@ -19,3 +19,9 @@ kotlin { application { mainClass = "org.ucfs.paths.MainKt" } + +tasks.register("runSimpleExamples") { + dependsOn("classes") + mainClass.set("simple_examples.Example_1Kt") + classpath = sourceSets["main"].runtimeClasspath +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt b/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt new file mode 100644 index 000000000..daa429e9e --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt @@ -0,0 +1,100 @@ +package simple_examples + +import org.ucfs.grammar.combinator.Grammar +import org.ucfs.grammar.combinator.extension.StringExtension.times +import org.ucfs.grammar.combinator.regexp.Nt +import org.ucfs.grammar.combinator.regexp.Option +import org.ucfs.input.DotParser +import org.ucfs.input.InputGraph +import org.ucfs.input.TerminalInputLabel +import org.ucfs.parser.Gll +import org.ucfs.sppf.getSppfDot +import org.ucfs.sppf.node.* +import java.nio.file.Files +import java.nio.file.Path + +class PointsToAnBnGrammar : Grammar() { + val S by Nt().asStart() + + init { + S /= "a" * Option(S) * "b" + } +} + +fun readGraph(name: String): InputGraph { + val dotGraph = object {}.javaClass.getResource("/$name")?.readText() + ?: throw RuntimeException("File $name is not found in resources") + val dotParser = DotParser() + return dotParser.parseDot(dotGraph) +} + +data class OutEdge(val start: Int, val symbol: String, val end: Int) { + override fun toString(): String = "(" + start.toString() + "-" + symbol + "->" + end.toString() + ")" +} + +fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { + if (maxDepth == 0) { + return null + } + when (val nodeType = node.type) { + is TerminalType<*> -> { + val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") + return listOf(listOf(OutEdge(range.from, nodeType.terminal.toString(), range.to))) + } + + is EpsilonNonterminalType -> { + return listOf(emptyList()) + } + + is EmptyType -> { + throw RuntimeException("SPPF cannot contain EmptyRange") + } + + is IntermediateType<*>, is NonterminalType -> { + val subPaths = node.children.map { getPathFromSppf(it, maxDepth - 1) } + if (subPaths.any { it == null }) { + return null + } + val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> + acc.flatMap { list -> lst.map { element -> list + element } } + } + return paths + } + + is Range -> { + val paths = node.children.map { + getPathFromSppf(it, maxDepth - 1)?.filterNotNull() + }.filterNotNull().flatten() + if (paths.isEmpty()) { + return null + } + return paths + } + + else -> { + println("Type of node is ${node.type.javaClass}") + throw RuntimeException("Unknown RangeType in SPPF") + } + } +} + +fun saveSppf(name: String, sppf: Set>) { + val graphName = name.removeSuffix(".dot") + val genPath = Path.of("src", "main", "kotlin", "simple_examples", "gen") + Files.createDirectories(genPath) + val file = genPath.resolve("${graphName}_sppf.dot").toFile() + + file.printWriter().use { out -> + out.println(getSppfDot(sppf)) + } +} + +fun main() { + listOf("example_1_graph.dot").forEach { graphName -> + val graph = readGraph(graphName) + val grammar = PointsToAnBnGrammar() + val gll = Gll.gll(grammar.rsm, graph) + val sppf = gll.parse() + saveSppf(graphName, sppf) + } +} diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot new file mode 100644 index 000000000..2e845e0ea --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot @@ -0,0 +1,11 @@ +digraph { + start -> 0; + start -> 1; + start -> 2; + 0 -> 1 [label = "a"]; + 1 -> 2 [label = "a"]; + 2 -> 3 [label = "b"]; + 3 -> 2 [label = "b"]; + 2 -> 0 [label = "a"]; + +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg new file mode 100644 index 000000000..511a10387 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg @@ -0,0 +1,96 @@ + + + + + + +%3 + + + +start + +start + + + +0 + +0 + + + +start->0 + + + + + +1 + +1 + + + +start->1 + + + + + +2 + +2 + + + +start->2 + + + + + +0->1 + + +a + + + +1->2 + + +a + + + +2->0 + + +a + + + +3 + +3 + + + +2->3 + + +b + + + +3->2 + + +b + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot new file mode 100644 index 000000000..b83bc8506 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot @@ -0,0 +1,671 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_0_3 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_4 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_5 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_0_6 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_7 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_0_8 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_9 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle] +_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle] +_0_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_0_13 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_0_14 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_0_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_17 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_0_18 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_19 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_0_20 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_21 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle] +_0_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_0_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_26 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_0_27 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_28 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_29 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_0_31 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_0_33 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_36 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_0_38 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_0_40 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_0_42 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_0_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_47 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_12 +_0_2->_0_3 +_0_3->_0_4 +_0_3->_0_5 +_0_4->_0_6 +_0_4->_0_7 +_0_5->_0_8 +_0_5->_0_9 +_0_6->_0_10 +_0_7->_0_11 +_0_8->_0_13 +_0_9->_0_11 +_0_12->_0_23 +_0_12->_0_34 +_0_13->_0_6 +_0_13->_0_14 +_0_14->_0_15 +_0_15->_0_16 +_0_16->_0_17 +_0_17->_0_18 +_0_17->_0_34 +_0_18->_0_19 +_0_19->_0_20 +_0_19->_0_21 +_0_20->_0_22 +_0_21->_0_24 +_0_23->_0_44 +_0_24->_0_25 +_0_25->_0_26 +_0_26->_0_27 +_0_26->_0_9 +_0_27->_0_28 +_0_28->_0_46 +_0_28->_0_29 +_0_29->_0_30 +_0_30->_0_31 +_0_31->_0_32 +_0_32->_0_33 +_0_32->_0_34 +_0_33->_0_35 +_0_34->_0_45 +_0_35->_0_6 +_0_35->_0_36 +_0_36->_0_37 +_0_37->_0_38 +_0_38->_0_39 +_0_39->_0_40 +_0_39->_0_9 +_0_40->_0_41 +_0_41->_0_20 +_0_41->_0_42 +_0_42->_0_43 +_0_43->_0_1 +_0_44->_0_46 +_0_44->_0_47 +_0_46->_0_48 +_0_47->_0_2 +} + +subgraph cluster_1{ +labelloc="t" +_1_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_1_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_1_3 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_1_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_1_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_1_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_1_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle] +_1_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_1_14 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_15 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_1_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_17 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_1_18 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_1_19 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle] +_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_1_22 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_24 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_1_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_26 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_1_27 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_1_29 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_30 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_31 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_1_32 [label = "38 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_1_33 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_1_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_1_36 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_1_38 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_1_40 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_1_42 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_1_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_1_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_1_47 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_1_0->_1_1 +_1_1->_1_12 +_1_2->_1_3 +_1_3->_1_4 +_1_4->_1_5 +_1_4->_1_6 +_1_5->_1_7 +_1_6->_1_8 +_1_7->_1_9 +_1_7->_1_10 +_1_9->_1_11 +_1_10->_1_13 +_1_12->_1_23 +_1_12->_1_34 +_1_13->_1_14 +_1_14->_1_15 +_1_15->_1_16 +_1_15->_1_34 +_1_16->_1_17 +_1_17->_1_18 +_1_17->_1_19 +_1_18->_1_20 +_1_19->_1_21 +_1_21->_1_22 +_1_22->_1_24 +_1_23->_1_44 +_1_24->_1_25 +_1_24->_1_6 +_1_25->_1_26 +_1_26->_1_46 +_1_26->_1_27 +_1_27->_1_28 +_1_28->_1_29 +_1_29->_1_30 +_1_29->_1_31 +_1_30->_1_9 +_1_30->_1_32 +_1_31->_1_33 +_1_31->_1_34 +_1_32->_1_45 +_1_33->_1_35 +_1_34->_1_45 +_1_35->_1_9 +_1_35->_1_36 +_1_36->_1_37 +_1_37->_1_38 +_1_38->_1_39 +_1_39->_1_40 +_1_39->_1_6 +_1_40->_1_41 +_1_41->_1_18 +_1_41->_1_42 +_1_42->_1_43 +_1_43->_1_1 +_1_44->_1_46 +_1_44->_1_47 +_1_46->_1_48 +_1_47->_1_2 +} + +subgraph cluster_2{ +labelloc="t" +_2_0 [label = "0 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_2_1 [label = "1 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_2_3 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_2_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_2_7 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_2_9 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_2_10 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle] +_2_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_2_14 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_2_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_17 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_2_18 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_2_19 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle] +_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_2_22 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_23 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_24 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_25 [label = "31 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_2_26 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_2_27 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_2_29 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_2_31 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_2_33 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_2_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_2_36 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_2_38 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_2_40 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_2_42 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_2_44 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_2_46 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_2_47 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle] +_2_0->_2_1 +_2_1->_2_12 +_2_2->_2_3 +_2_3->_2_4 +_2_4->_2_5 +_2_4->_2_6 +_2_5->_2_7 +_2_6->_2_8 +_2_7->_2_9 +_2_7->_2_10 +_2_9->_2_11 +_2_10->_2_13 +_2_12->_2_23 +_2_12->_2_34 +_2_13->_2_14 +_2_14->_2_15 +_2_15->_2_16 +_2_15->_2_34 +_2_16->_2_17 +_2_17->_2_18 +_2_17->_2_19 +_2_18->_2_20 +_2_19->_2_21 +_2_21->_2_22 +_2_22->_2_24 +_2_22->_2_25 +_2_23->_2_44 +_2_24->_2_46 +_2_24->_2_26 +_2_25->_2_27 +_2_25->_2_6 +_2_26->_2_8 +_2_27->_2_28 +_2_28->_2_46 +_2_28->_2_29 +_2_29->_2_30 +_2_30->_2_31 +_2_31->_2_32 +_2_32->_2_33 +_2_32->_2_34 +_2_33->_2_35 +_2_34->_2_45 +_2_35->_2_9 +_2_35->_2_36 +_2_36->_2_37 +_2_37->_2_38 +_2_38->_2_39 +_2_39->_2_40 +_2_39->_2_6 +_2_40->_2_41 +_2_41->_2_18 +_2_41->_2_42 +_2_42->_2_43 +_2_43->_2_1 +_2_44->_2_46 +_2_44->_2_47 +_2_46->_2_48 +_2_47->_2_2 +} + +subgraph cluster_3{ +labelloc="t" +_3_0 [label = "0 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_3_1 [label = "1 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_2 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_3_3 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_3_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_6 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_3_7 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_8 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_3_9 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle] +_3_11 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_3_12 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_13 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle] +_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_3_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_17 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_3_18 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_19 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_3_20 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_3_21 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle] +_3_23 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_3_25 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_3_27 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_29 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_3_31 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_3_33 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_34 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_3_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_3_36 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_3_38 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_3_40 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_3_42 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_3_44 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_3_45 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_46 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle] +_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle] +_3_0->_3_1 +_3_1->_3_12 +_3_1->_3_23 +_3_2->_3_34 +_3_2->_3_3 +_3_3->_3_4 +_3_4->_3_5 +_3_5->_3_6 +_3_6->_3_7 +_3_6->_3_8 +_3_7->_3_9 +_3_8->_3_10 +_3_9->_3_11 +_3_9->_3_13 +_3_11->_3_14 +_3_12->_3_34 +_3_12->_3_44 +_3_13->_3_15 +_3_15->_3_16 +_3_16->_3_17 +_3_17->_3_18 +_3_17->_3_46 +_3_18->_3_19 +_3_19->_3_20 +_3_19->_3_21 +_3_20->_3_22 +_3_21->_3_24 +_3_23->_3_45 +_3_23->_3_46 +_3_24->_3_25 +_3_25->_3_26 +_3_26->_3_27 +_3_26->_3_8 +_3_27->_3_28 +_3_28->_3_34 +_3_28->_3_29 +_3_29->_3_30 +_3_30->_3_31 +_3_31->_3_32 +_3_32->_3_33 +_3_32->_3_46 +_3_33->_3_35 +_3_34->_3_47 +_3_35->_3_11 +_3_35->_3_36 +_3_36->_3_37 +_3_37->_3_38 +_3_38->_3_39 +_3_39->_3_40 +_3_39->_3_8 +_3_40->_3_41 +_3_41->_3_20 +_3_41->_3_42 +_3_42->_3_43 +_3_43->_3_1 +_3_44->_3_48 +_3_45->_3_2 +_3_46->_3_48 +} + +subgraph cluster_4{ +labelloc="t" +_4_0 [label = "0 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_4_1 [label = "1 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_4_3 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_4_5 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_4_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_4_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_4_10 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_4_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_4_14 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_4_16 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_17 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_18 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_4_19 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] +_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_4_22 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_23 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_24 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_4_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_26 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_4_27 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_4_29 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_30 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_4_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_32 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_4_33 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_4_36 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_37 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_38 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_4_39 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_4_40 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_4_42 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_4_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_4_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_4_47 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_4_0->_4_1 +_4_1->_4_12 +_4_2->_4_3 +_4_3->_4_4 +_4_4->_4_5 +_4_4->_4_6 +_4_5->_4_7 +_4_6->_4_8 +_4_7->_4_9 +_4_7->_4_10 +_4_9->_4_11 +_4_10->_4_13 +_4_12->_4_23 +_4_12->_4_34 +_4_13->_4_14 +_4_14->_4_15 +_4_15->_4_16 +_4_15->_4_34 +_4_16->_4_17 +_4_17->_4_18 +_4_17->_4_19 +_4_18->_4_20 +_4_19->_4_21 +_4_21->_4_22 +_4_22->_4_24 +_4_23->_4_44 +_4_24->_4_25 +_4_24->_4_6 +_4_25->_4_26 +_4_26->_4_46 +_4_26->_4_27 +_4_27->_4_28 +_4_28->_4_29 +_4_29->_4_30 +_4_30->_4_31 +_4_30->_4_34 +_4_31->_4_32 +_4_32->_4_9 +_4_32->_4_33 +_4_33->_4_35 +_4_34->_4_45 +_4_35->_4_36 +_4_36->_4_37 +_4_36->_4_38 +_4_37->_4_18 +_4_37->_4_39 +_4_38->_4_40 +_4_38->_4_6 +_4_39->_4_8 +_4_40->_4_41 +_4_41->_4_18 +_4_41->_4_42 +_4_42->_4_43 +_4_43->_4_1 +_4_44->_4_46 +_4_44->_4_47 +_4_46->_4_48 +_4_47->_4_2 +} + +subgraph cluster_5{ +labelloc="t" +_5_0 [label = "0 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_5_1 [label = "1 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_5_3 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_5_5 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_5_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_5_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_5_10 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_5_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_5_14 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_15 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_16 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_5_17 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_5_18 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_5_19 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] +_5_21 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_5_22 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_23 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_5_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_5_27 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_28 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_5_29 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_5_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_5_33 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_5_35 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_5_36 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_5_38 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_5_40 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_42 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_5_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_5_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_5_47 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_5_0->_5_1 +_5_1->_5_12 +_5_2->_5_3 +_5_3->_5_4 +_5_4->_5_5 +_5_4->_5_6 +_5_5->_5_7 +_5_6->_5_8 +_5_7->_5_9 +_5_7->_5_10 +_5_9->_5_11 +_5_10->_5_13 +_5_12->_5_23 +_5_12->_5_34 +_5_13->_5_14 +_5_14->_5_15 +_5_14->_5_16 +_5_15->_5_17 +_5_15->_5_18 +_5_16->_5_19 +_5_16->_5_34 +_5_17->_5_20 +_5_18->_5_45 +_5_19->_5_21 +_5_21->_5_17 +_5_21->_5_22 +_5_22->_5_24 +_5_23->_5_44 +_5_24->_5_25 +_5_25->_5_26 +_5_26->_5_27 +_5_26->_5_6 +_5_27->_5_28 +_5_28->_5_46 +_5_28->_5_29 +_5_29->_5_30 +_5_30->_5_31 +_5_31->_5_32 +_5_32->_5_33 +_5_32->_5_34 +_5_33->_5_35 +_5_34->_5_45 +_5_35->_5_9 +_5_35->_5_36 +_5_36->_5_37 +_5_37->_5_38 +_5_38->_5_39 +_5_39->_5_40 +_5_39->_5_6 +_5_40->_5_41 +_5_41->_5_17 +_5_41->_5_42 +_5_42->_5_43 +_5_43->_5_1 +_5_44->_5_46 +_5_44->_5_47 +_5_46->_5_48 +_5_47->_5_2 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg new file mode 100644 index 000000000..27dec8ae1 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg @@ -0,0 +1,3811 @@ + + + + + + +g + + +cluster_0 + + + +cluster_1 + + + +cluster_2 + + + +cluster_3 + + + +cluster_4 + + + +cluster_5 + + + + +_0_0 + +0     Nonterminal S, input: [0, 2] + + + +_0_1 + +1     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_12 +2     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_0_1->_0_12 + + + + + +_0_2 + +10     Nonterminal S, input: [1, 3] + + + +_0_3 + +11     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_0_2->_0_3 + + + + + +_0_4 +12     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_0_3->_0_4 + + + + + +_0_5 +13     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_0_3->_0_5 + + + + + +_0_6 + +14     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_0_4->_0_6 + + + + + +_0_7 + +15     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_0_4->_0_7 + + + + + +_0_8 + +16     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_0_5->_0_8 + + + + + +_0_9 + +17     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_0_5->_0_9 + + + + + +_0_10 + +18     Terminal 'a', input: [1, 2] + + + +_0_6->_0_10 + + + + + +_0_11 + +19     Terminal 'b', input: [2, 3] + + + +_0_7->_0_11 + + + + + +_0_13 +20     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_0_8->_0_13 + + + + + +_0_9->_0_11 + + + + + +_0_23 + +3     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_0_12->_0_23 + + + + + +_0_34 + +4     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_0_12->_0_34 + + + + + +_0_13->_0_6 + + + + + +_0_14 + +21     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_0_13->_0_14 + + + + + +_0_15 + +22     Nonterminal S, input: [2, 2] + + + +_0_14->_0_15 + + + + + +_0_16 + +23     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_0_15->_0_16 + + + + + +_0_17 +24     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_0_16->_0_17 + + + + + +_0_18 + +25     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_0_17->_0_18 + + + + + +_0_17->_0_34 + + + + + +_0_19 +26     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_0_18->_0_19 + + + + + +_0_20 + +27     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_0_19->_0_20 + + + + + +_0_21 + +28     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_0_19->_0_21 + + + + + +_0_22 + +29     Terminal 'a', input: [2, 0] + + + +_0_20->_0_22 + + + + + +_0_24 + +30     Nonterminal S, input: [0, 3] + + + +_0_21->_0_24 + + + + + +_0_44 +5     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_0_23->_0_44 + + + + + +_0_25 + +31     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_0_24->_0_25 + + + + + +_0_26 +32     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_0_25->_0_26 + + + + + +_0_26->_0_9 + + + + + +_0_27 + +33     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_0_26->_0_27 + + + + + +_0_28 +34     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_0_27->_0_28 + + + + + +_0_29 + +35     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_0_28->_0_29 + + + + + +_0_46 + +7     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_28->_0_46 + + + + + +_0_30 + +36     Nonterminal S, input: [1, 2] + + + +_0_29->_0_30 + + + + + +_0_31 + +37     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_0_30->_0_31 + + + + + +_0_32 +38     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_0_31->_0_32 + + + + + +_0_33 + +39     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_0_32->_0_33 + + + + + +_0_32->_0_34 + + + + + +_0_35 +40     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_0_33->_0_35 + + + + + +_0_45 + +6     Terminal 'b', input: [3, 2] + + + +_0_34->_0_45 + + + + + +_0_35->_0_6 + + + + + +_0_36 + +41     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_0_35->_0_36 + + + + + +_0_37 + +42     Nonterminal S, input: [2, 3] + + + +_0_36->_0_37 + + + + + +_0_38 + +43     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_0_37->_0_38 + + + + + +_0_39 +44     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_0_38->_0_39 + + + + + +_0_39->_0_9 + + + + + +_0_40 + +45     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_0_39->_0_40 + + + + + +_0_41 +46     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_0_40->_0_41 + + + + + +_0_41->_0_20 + + + + + +_0_42 + +47     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_0_41->_0_42 + + + + + +_0_43 + +48     Nonterminal S, input: [0, 2] + + + +_0_42->_0_43 + + + + + +_0_43->_0_1 + + + + + +_0_44->_0_46 + + + + + +_0_47 + +8     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_0_44->_0_47 + + + + + +_0_48 + +9     Terminal 'a', input: [0, 1] + + + +_0_46->_0_48 + + + + + +_0_47->_0_2 + + + + + +_1_0 + +0     Nonterminal S, input: [0, 3] + + + +_1_1 + +1     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_1_0->_1_1 + + + + + +_1_12 +2     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_1_1->_1_12 + + + + + +_1_2 + +10     Nonterminal S, input: [1, 2] + + + +_1_3 + +11     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_1_2->_1_3 + + + + + +_1_4 +12     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_1_3->_1_4 + + + + + +_1_5 + +13     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_1_4->_1_5 + + + + + +_1_6 + +14     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_1_4->_1_6 + + + + + +_1_7 +15     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_1_5->_1_7 + + + + + +_1_8 + +16     Terminal 'b', input: [3, 2] + + + +_1_6->_1_8 + + + + + +_1_9 + +17     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_1_7->_1_9 + + + + + +_1_10 + +18     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_1_7->_1_10 + + + + + +_1_11 + +19     Terminal 'a', input: [1, 2] + + + +_1_9->_1_11 + + + + + +_1_13 + +20     Nonterminal S, input: [2, 3] + + + +_1_10->_1_13 + + + + + +_1_23 + +3     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_1_12->_1_23 + + + + + +_1_34 + +4     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_1_12->_1_34 + + + + + +_1_14 + +21     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_1_13->_1_14 + + + + + +_1_15 +22     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_1_14->_1_15 + + + + + +_1_16 + +23     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_1_15->_1_16 + + + + + +_1_15->_1_34 + + + + + +_1_17 +24     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_1_16->_1_17 + + + + + +_1_18 + +25     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_1_17->_1_18 + + + + + +_1_19 + +26     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_1_17->_1_19 + + + + + +_1_20 + +27     Terminal 'a', input: [2, 0] + + + +_1_18->_1_20 + + + + + +_1_21 + +28     Nonterminal S, input: [0, 2] + + + +_1_19->_1_21 + + + + + +_1_22 + +29     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_1_21->_1_22 + + + + + +_1_24 +30     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_1_22->_1_24 + + + + + +_1_44 +5     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_1_23->_1_44 + + + + + +_1_24->_1_6 + + + + + +_1_25 + +31     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_1_24->_1_25 + + + + + +_1_26 +32     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_1_25->_1_26 + + + + + +_1_27 + +33     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_1_26->_1_27 + + + + + +_1_46 + +7     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_1_26->_1_46 + + + + + +_1_28 + +34     Nonterminal S, input: [1, 3] + + + +_1_27->_1_28 + + + + + +_1_29 + +35     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_1_28->_1_29 + + + + + +_1_30 +36     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_1_29->_1_30 + + + + + +_1_31 +37     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_1_29->_1_31 + + + + + +_1_30->_1_9 + + + + + +_1_32 + +38     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_1_30->_1_32 + + + + + +_1_33 + +39     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_1_31->_1_33 + + + + + +_1_31->_1_34 + + + + + +_1_45 + +6     Terminal 'b', input: [2, 3] + + + +_1_32->_1_45 + + + + + +_1_35 +40     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_1_33->_1_35 + + + + + +_1_34->_1_45 + + + + + +_1_35->_1_9 + + + + + +_1_36 + +41     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_1_35->_1_36 + + + + + +_1_37 + +42     Nonterminal S, input: [2, 2] + + + +_1_36->_1_37 + + + + + +_1_38 + +43     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_1_37->_1_38 + + + + + +_1_39 +44     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_1_38->_1_39 + + + + + +_1_39->_1_6 + + + + + +_1_40 + +45     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_1_39->_1_40 + + + + + +_1_41 +46     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_1_40->_1_41 + + + + + +_1_41->_1_18 + + + + + +_1_42 + +47     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_1_41->_1_42 + + + + + +_1_43 + +48     Nonterminal S, input: [0, 3] + + + +_1_42->_1_43 + + + + + +_1_43->_1_1 + + + + + +_1_44->_1_46 + + + + + +_1_47 + +8     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_1_44->_1_47 + + + + + +_1_48 + +9     Terminal 'a', input: [0, 1] + + + +_1_46->_1_48 + + + + + +_1_47->_1_2 + + + + + +_2_0 + +0     Nonterminal S, input: [1, 2] + + + +_2_1 + +1     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_2_0->_2_1 + + + + + +_2_12 +2     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_2_1->_2_12 + + + + + +_2_2 + +10     Nonterminal S, input: [2, 3] + + + +_2_3 + +11     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_2_2->_2_3 + + + + + +_2_4 +12     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_2_3->_2_4 + + + + + +_2_5 + +13     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_2_4->_2_5 + + + + + +_2_6 + +14     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_2_4->_2_6 + + + + + +_2_7 +15     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_2_5->_2_7 + + + + + +_2_8 + +16     Terminal 'b', input: [2, 3] + + + +_2_6->_2_8 + + + + + +_2_9 + +17     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_2_7->_2_9 + + + + + +_2_10 + +18     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_2_7->_2_10 + + + + + +_2_11 + +19     Terminal 'a', input: [2, 0] + + + +_2_9->_2_11 + + + + + +_2_13 + +20     Nonterminal S, input: [0, 2] + + + +_2_10->_2_13 + + + + + +_2_23 + +3     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_2_12->_2_23 + + + + + +_2_34 + +4     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_2_12->_2_34 + + + + + +_2_14 + +21     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_2_13->_2_14 + + + + + +_2_15 +22     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_2_14->_2_15 + + + + + +_2_16 + +23     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_2_15->_2_16 + + + + + +_2_15->_2_34 + + + + + +_2_17 +24     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_2_16->_2_17 + + + + + +_2_18 + +25     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_2_17->_2_18 + + + + + +_2_19 + +26     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_2_17->_2_19 + + + + + +_2_20 + +27     Terminal 'a', input: [0, 1] + + + +_2_18->_2_20 + + + + + +_2_21 + +28     Nonterminal S, input: [1, 3] + + + +_2_19->_2_21 + + + + + +_2_22 + +29     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_2_21->_2_22 + + + + + +_2_24 +30     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_2_22->_2_24 + + + + + +_2_25 +31     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_2_22->_2_25 + + + + + +_2_44 +5     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_2_23->_2_44 + + + + + +_2_26 + +32     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_2_24->_2_26 + + + + + +_2_46 + +7     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_2_24->_2_46 + + + + + +_2_25->_2_6 + + + + + +_2_27 + +33     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_2_25->_2_27 + + + + + +_2_26->_2_8 + + + + + +_2_28 +34     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_2_27->_2_28 + + + + + +_2_29 + +35     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_2_28->_2_29 + + + + + +_2_28->_2_46 + + + + + +_2_30 + +36     Nonterminal S, input: [2, 2] + + + +_2_29->_2_30 + + + + + +_2_31 + +37     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_2_30->_2_31 + + + + + +_2_32 +38     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_2_31->_2_32 + + + + + +_2_33 + +39     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_2_32->_2_33 + + + + + +_2_32->_2_34 + + + + + +_2_35 +40     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_2_33->_2_35 + + + + + +_2_45 + +6     Terminal 'b', input: [3, 2] + + + +_2_34->_2_45 + + + + + +_2_35->_2_9 + + + + + +_2_36 + +41     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_2_35->_2_36 + + + + + +_2_37 + +42     Nonterminal S, input: [0, 3] + + + +_2_36->_2_37 + + + + + +_2_38 + +43     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_2_37->_2_38 + + + + + +_2_39 +44     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_2_38->_2_39 + + + + + +_2_39->_2_6 + + + + + +_2_40 + +45     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_2_39->_2_40 + + + + + +_2_41 +46     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_2_40->_2_41 + + + + + +_2_41->_2_18 + + + + + +_2_42 + +47     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_2_41->_2_42 + + + + + +_2_43 + +48     Nonterminal S, input: [1, 2] + + + +_2_42->_2_43 + + + + + +_2_43->_2_1 + + + + + +_2_44->_2_46 + + + + + +_2_47 + +8     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_2_44->_2_47 + + + + + +_2_48 + +9     Terminal 'a', input: [1, 2] + + + +_2_46->_2_48 + + + + + +_2_47->_2_2 + + + + + +_3_0 + +0     Nonterminal S, input: [1, 3] + + + +_3_1 + +1     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_3_0->_3_1 + + + + + +_3_12 +2     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_3_1->_3_12 + + + + + +_3_23 +3     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_3_1->_3_23 + + + + + +_3_2 +10     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_3_3 + +11     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_3_2->_3_3 + + + + + +_3_34 + +4     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_3_2->_3_34 + + + + + +_3_4 + +12     Nonterminal S, input: [2, 2] + + + +_3_3->_3_4 + + + + + +_3_5 + +13     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_3_4->_3_5 + + + + + +_3_6 +14     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_3_5->_3_6 + + + + + +_3_7 + +15     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_3_6->_3_7 + + + + + +_3_8 + +16     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_3_6->_3_8 + + + + + +_3_9 +17     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_3_7->_3_9 + + + + + +_3_10 + +18     Terminal 'b', input: [3, 2] + + + +_3_8->_3_10 + + + + + +_3_11 + +19     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_3_9->_3_11 + + + + + +_3_13 + +20     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_3_9->_3_13 + + + + + +_3_14 + +21     Terminal 'a', input: [2, 0] + + + +_3_11->_3_14 + + + + + +_3_12->_3_34 + + + + + +_3_44 + +5     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_3_12->_3_44 + + + + + +_3_15 + +22     Nonterminal S, input: [0, 3] + + + +_3_13->_3_15 + + + + + +_3_16 + +23     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_3_15->_3_16 + + + + + +_3_17 +24     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_3_16->_3_17 + + + + + +_3_18 + +25     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_3_17->_3_18 + + + + + +_3_46 + +7     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_3_17->_3_46 + + + + + +_3_19 +26     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_3_18->_3_19 + + + + + +_3_20 + +27     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_3_19->_3_20 + + + + + +_3_21 + +28     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_3_19->_3_21 + + + + + +_3_22 + +29     Terminal 'a', input: [0, 1] + + + +_3_20->_3_22 + + + + + +_3_24 + +30     Nonterminal S, input: [1, 2] + + + +_3_21->_3_24 + + + + + +_3_45 + +6     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_3_23->_3_45 + + + + + +_3_23->_3_46 + + + + + +_3_25 + +31     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_3_24->_3_25 + + + + + +_3_26 +32     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_3_25->_3_26 + + + + + +_3_26->_3_8 + + + + + +_3_27 + +33     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_3_26->_3_27 + + + + + +_3_28 +34     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_3_27->_3_28 + + + + + +_3_29 + +35     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_3_28->_3_29 + + + + + +_3_28->_3_34 + + + + + +_3_30 + +36     Nonterminal S, input: [2, 3] + + + +_3_29->_3_30 + + + + + +_3_31 + +37     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_3_30->_3_31 + + + + + +_3_32 +38     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_3_31->_3_32 + + + + + +_3_33 + +39     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_3_32->_3_33 + + + + + +_3_32->_3_46 + + + + + +_3_35 +40     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_3_33->_3_35 + + + + + +_3_47 + +8     Terminal 'a', input: [1, 2] + + + +_3_34->_3_47 + + + + + +_3_35->_3_11 + + + + + +_3_36 + +41     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_3_35->_3_36 + + + + + +_3_37 + +42     Nonterminal S, input: [0, 2] + + + +_3_36->_3_37 + + + + + +_3_38 + +43     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_3_37->_3_38 + + + + + +_3_39 +44     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_3_38->_3_39 + + + + + +_3_39->_3_8 + + + + + +_3_40 + +45     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_3_39->_3_40 + + + + + +_3_41 +46     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_3_40->_3_41 + + + + + +_3_41->_3_20 + + + + + +_3_42 + +47     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_3_41->_3_42 + + + + + +_3_43 + +48     Nonterminal S, input: [1, 3] + + + +_3_42->_3_43 + + + + + +_3_43->_3_1 + + + + + +_3_48 + +9     Terminal 'b', input: [2, 3] + + + +_3_44->_3_48 + + + + + +_3_45->_3_2 + + + + + +_3_46->_3_48 + + + + + +_4_0 + +0     Nonterminal S, input: [2, 2] + + + +_4_1 + +1     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_4_0->_4_1 + + + + + +_4_12 +2     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_4_1->_4_12 + + + + + +_4_2 + +10     Nonterminal S, input: [0, 3] + + + +_4_3 + +11     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_4_2->_4_3 + + + + + +_4_4 +12     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_4_3->_4_4 + + + + + +_4_5 + +13     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_4_4->_4_5 + + + + + +_4_6 + +14     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_4_4->_4_6 + + + + + +_4_7 +15     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_4_5->_4_7 + + + + + +_4_8 + +16     Terminal 'b', input: [2, 3] + + + +_4_6->_4_8 + + + + + +_4_9 + +17     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_4_7->_4_9 + + + + + +_4_10 + +18     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_4_7->_4_10 + + + + + +_4_11 + +19     Terminal 'a', input: [0, 1] + + + +_4_9->_4_11 + + + + + +_4_13 + +20     Nonterminal S, input: [1, 2] + + + +_4_10->_4_13 + + + + + +_4_23 + +3     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_4_12->_4_23 + + + + + +_4_34 + +4     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_4_12->_4_34 + + + + + +_4_14 + +21     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_4_13->_4_14 + + + + + +_4_15 +22     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_4_14->_4_15 + + + + + +_4_16 + +23     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_4_15->_4_16 + + + + + +_4_15->_4_34 + + + + + +_4_17 +24     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_4_16->_4_17 + + + + + +_4_18 + +25     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_4_17->_4_18 + + + + + +_4_19 + +26     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_4_17->_4_19 + + + + + +_4_20 + +27     Terminal 'a', input: [1, 2] + + + +_4_18->_4_20 + + + + + +_4_21 + +28     Nonterminal S, input: [2, 3] + + + +_4_19->_4_21 + + + + + +_4_22 + +29     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_4_21->_4_22 + + + + + +_4_24 +30     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_4_22->_4_24 + + + + + +_4_44 +5     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_4_23->_4_44 + + + + + +_4_24->_4_6 + + + + + +_4_25 + +31     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_4_24->_4_25 + + + + + +_4_26 +32     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_4_25->_4_26 + + + + + +_4_27 + +33     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_4_26->_4_27 + + + + + +_4_46 + +7     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_4_26->_4_46 + + + + + +_4_28 + +34     Nonterminal S, input: [0, 2] + + + +_4_27->_4_28 + + + + + +_4_29 + +35     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_4_28->_4_29 + + + + + +_4_30 +36     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_4_29->_4_30 + + + + + +_4_31 + +37     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_4_30->_4_31 + + + + + +_4_30->_4_34 + + + + + +_4_32 +38     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_4_31->_4_32 + + + + + +_4_32->_4_9 + + + + + +_4_33 + +39     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_4_32->_4_33 + + + + + +_4_35 + +40     Nonterminal S, input: [1, 3] + + + +_4_33->_4_35 + + + + + +_4_45 + +6     Terminal 'b', input: [3, 2] + + + +_4_34->_4_45 + + + + + +_4_36 + +41     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_4_35->_4_36 + + + + + +_4_37 +42     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_4_36->_4_37 + + + + + +_4_38 +43     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_4_36->_4_38 + + + + + +_4_37->_4_18 + + + + + +_4_39 + +44     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_4_37->_4_39 + + + + + +_4_38->_4_6 + + + + + +_4_40 + +45     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_4_38->_4_40 + + + + + +_4_39->_4_8 + + + + + +_4_41 +46     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_4_40->_4_41 + + + + + +_4_41->_4_18 + + + + + +_4_42 + +47     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_4_41->_4_42 + + + + + +_4_43 + +48     Nonterminal S, input: [2, 2] + + + +_4_42->_4_43 + + + + + +_4_43->_4_1 + + + + + +_4_44->_4_46 + + + + + +_4_47 + +8     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_4_44->_4_47 + + + + + +_4_48 + +9     Terminal 'a', input: [2, 0] + + + +_4_46->_4_48 + + + + + +_4_47->_4_2 + + + + + +_5_0 + +0     Nonterminal S, input: [2, 3] + + + +_5_1 + +1     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_5_0->_5_1 + + + + + +_5_12 +2     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_5_1->_5_12 + + + + + +_5_2 + +10     Nonterminal S, input: [0, 2] + + + +_5_3 + +11     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_5_2->_5_3 + + + + + +_5_4 +12     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_5_3->_5_4 + + + + + +_5_5 + +13     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_5_4->_5_5 + + + + + +_5_6 + +14     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_5_4->_5_6 + + + + + +_5_7 +15     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_5_5->_5_7 + + + + + +_5_8 + +16     Terminal 'b', input: [3, 2] + + + +_5_6->_5_8 + + + + + +_5_9 + +17     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_5_7->_5_9 + + + + + +_5_10 + +18     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_5_7->_5_10 + + + + + +_5_11 + +19     Terminal 'a', input: [0, 1] + + + +_5_9->_5_11 + + + + + +_5_13 + +20     Nonterminal S, input: [1, 3] + + + +_5_10->_5_13 + + + + + +_5_23 + +3     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_5_12->_5_23 + + + + + +_5_34 + +4     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_5_12->_5_34 + + + + + +_5_14 + +21     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_5_13->_5_14 + + + + + +_5_15 +22     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_5_14->_5_15 + + + + + +_5_16 +23     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_5_14->_5_16 + + + + + +_5_17 + +24     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_5_15->_5_17 + + + + + +_5_18 + +25     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_5_15->_5_18 + + + + + +_5_19 + +26     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_5_16->_5_19 + + + + + +_5_16->_5_34 + + + + + +_5_20 + +27     Terminal 'a', input: [1, 2] + + + +_5_17->_5_20 + + + + + +_5_45 + +6     Terminal 'b', input: [2, 3] + + + +_5_18->_5_45 + + + + + +_5_21 +28     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_5_19->_5_21 + + + + + +_5_21->_5_17 + + + + + +_5_22 + +29     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_5_21->_5_22 + + + + + +_5_24 + +30     Nonterminal S, input: [2, 2] + + + +_5_22->_5_24 + + + + + +_5_44 +5     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_5_23->_5_44 + + + + + +_5_25 + +31     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_5_24->_5_25 + + + + + +_5_26 +32     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_5_25->_5_26 + + + + + +_5_26->_5_6 + + + + + +_5_27 + +33     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_5_26->_5_27 + + + + + +_5_28 +34     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_5_27->_5_28 + + + + + +_5_29 + +35     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_5_28->_5_29 + + + + + +_5_46 + +7     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_5_28->_5_46 + + + + + +_5_30 + +36     Nonterminal S, input: [0, 3] + + + +_5_29->_5_30 + + + + + +_5_31 + +37     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_5_30->_5_31 + + + + + +_5_32 +38     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_5_31->_5_32 + + + + + +_5_33 + +39     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_5_32->_5_33 + + + + + +_5_32->_5_34 + + + + + +_5_35 +40     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_5_33->_5_35 + + + + + +_5_34->_5_45 + + + + + +_5_35->_5_9 + + + + + +_5_36 + +41     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_5_35->_5_36 + + + + + +_5_37 + +42     Nonterminal S, input: [1, 2] + + + +_5_36->_5_37 + + + + + +_5_38 + +43     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_5_37->_5_38 + + + + + +_5_39 +44     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_5_38->_5_39 + + + + + +_5_39->_5_6 + + + + + +_5_40 + +45     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_5_39->_5_40 + + + + + +_5_41 +46     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_5_40->_5_41 + + + + + +_5_41->_5_17 + + + + + +_5_42 + +47     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_5_41->_5_42 + + + + + +_5_43 + +48     Nonterminal S, input: [2, 3] + + + +_5_42->_5_43 + + + + + +_5_43->_5_1 + + + + + +_5_44->_5_46 + + + + + +_5_47 + +8     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_5_44->_5_47 + + + + + +_5_48 + +9     Terminal 'a', input: [2, 0] + + + +_5_46->_5_48 + + + + + +_5_47->_5_2 + + + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot new file mode 100644 index 000000000..b83bc8506 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot @@ -0,0 +1,671 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_0_3 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_4 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_5 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_0_6 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_7 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_0_8 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_9 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle] +_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle] +_0_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_0_13 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_0_14 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_0_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_17 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_0_18 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_19 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_0_20 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_21 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle] +_0_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_0_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_26 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_0_27 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_28 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_29 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_0_31 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_0_33 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_36 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_0_38 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_0_40 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_0_42 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_0_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_47 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_12 +_0_2->_0_3 +_0_3->_0_4 +_0_3->_0_5 +_0_4->_0_6 +_0_4->_0_7 +_0_5->_0_8 +_0_5->_0_9 +_0_6->_0_10 +_0_7->_0_11 +_0_8->_0_13 +_0_9->_0_11 +_0_12->_0_23 +_0_12->_0_34 +_0_13->_0_6 +_0_13->_0_14 +_0_14->_0_15 +_0_15->_0_16 +_0_16->_0_17 +_0_17->_0_18 +_0_17->_0_34 +_0_18->_0_19 +_0_19->_0_20 +_0_19->_0_21 +_0_20->_0_22 +_0_21->_0_24 +_0_23->_0_44 +_0_24->_0_25 +_0_25->_0_26 +_0_26->_0_27 +_0_26->_0_9 +_0_27->_0_28 +_0_28->_0_46 +_0_28->_0_29 +_0_29->_0_30 +_0_30->_0_31 +_0_31->_0_32 +_0_32->_0_33 +_0_32->_0_34 +_0_33->_0_35 +_0_34->_0_45 +_0_35->_0_6 +_0_35->_0_36 +_0_36->_0_37 +_0_37->_0_38 +_0_38->_0_39 +_0_39->_0_40 +_0_39->_0_9 +_0_40->_0_41 +_0_41->_0_20 +_0_41->_0_42 +_0_42->_0_43 +_0_43->_0_1 +_0_44->_0_46 +_0_44->_0_47 +_0_46->_0_48 +_0_47->_0_2 +} + +subgraph cluster_1{ +labelloc="t" +_1_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_1_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_1_3 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_1_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_1_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_1_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_1_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle] +_1_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_1_14 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_15 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_1_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_17 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_1_18 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_1_19 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle] +_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_1_22 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_24 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_1_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_26 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_1_27 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_1_29 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_30 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_31 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_1_32 [label = "38 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_1_33 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_1_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_1_36 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_1_38 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_1_40 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_1_42 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_1_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_1_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_1_47 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_1_0->_1_1 +_1_1->_1_12 +_1_2->_1_3 +_1_3->_1_4 +_1_4->_1_5 +_1_4->_1_6 +_1_5->_1_7 +_1_6->_1_8 +_1_7->_1_9 +_1_7->_1_10 +_1_9->_1_11 +_1_10->_1_13 +_1_12->_1_23 +_1_12->_1_34 +_1_13->_1_14 +_1_14->_1_15 +_1_15->_1_16 +_1_15->_1_34 +_1_16->_1_17 +_1_17->_1_18 +_1_17->_1_19 +_1_18->_1_20 +_1_19->_1_21 +_1_21->_1_22 +_1_22->_1_24 +_1_23->_1_44 +_1_24->_1_25 +_1_24->_1_6 +_1_25->_1_26 +_1_26->_1_46 +_1_26->_1_27 +_1_27->_1_28 +_1_28->_1_29 +_1_29->_1_30 +_1_29->_1_31 +_1_30->_1_9 +_1_30->_1_32 +_1_31->_1_33 +_1_31->_1_34 +_1_32->_1_45 +_1_33->_1_35 +_1_34->_1_45 +_1_35->_1_9 +_1_35->_1_36 +_1_36->_1_37 +_1_37->_1_38 +_1_38->_1_39 +_1_39->_1_40 +_1_39->_1_6 +_1_40->_1_41 +_1_41->_1_18 +_1_41->_1_42 +_1_42->_1_43 +_1_43->_1_1 +_1_44->_1_46 +_1_44->_1_47 +_1_46->_1_48 +_1_47->_1_2 +} + +subgraph cluster_2{ +labelloc="t" +_2_0 [label = "0 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_2_1 [label = "1 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_2_3 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_2_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_2_7 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_2_9 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_2_10 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle] +_2_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_2_14 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_2_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_17 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_2_18 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_2_19 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle] +_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_2_22 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_23 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_24 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_25 [label = "31 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_2_26 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_2_27 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_2_29 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_2_31 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_2_33 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_2_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_2_36 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_2_38 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_2_40 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_2_42 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_2_44 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_2_46 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_2_47 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle] +_2_0->_2_1 +_2_1->_2_12 +_2_2->_2_3 +_2_3->_2_4 +_2_4->_2_5 +_2_4->_2_6 +_2_5->_2_7 +_2_6->_2_8 +_2_7->_2_9 +_2_7->_2_10 +_2_9->_2_11 +_2_10->_2_13 +_2_12->_2_23 +_2_12->_2_34 +_2_13->_2_14 +_2_14->_2_15 +_2_15->_2_16 +_2_15->_2_34 +_2_16->_2_17 +_2_17->_2_18 +_2_17->_2_19 +_2_18->_2_20 +_2_19->_2_21 +_2_21->_2_22 +_2_22->_2_24 +_2_22->_2_25 +_2_23->_2_44 +_2_24->_2_46 +_2_24->_2_26 +_2_25->_2_27 +_2_25->_2_6 +_2_26->_2_8 +_2_27->_2_28 +_2_28->_2_46 +_2_28->_2_29 +_2_29->_2_30 +_2_30->_2_31 +_2_31->_2_32 +_2_32->_2_33 +_2_32->_2_34 +_2_33->_2_35 +_2_34->_2_45 +_2_35->_2_9 +_2_35->_2_36 +_2_36->_2_37 +_2_37->_2_38 +_2_38->_2_39 +_2_39->_2_40 +_2_39->_2_6 +_2_40->_2_41 +_2_41->_2_18 +_2_41->_2_42 +_2_42->_2_43 +_2_43->_2_1 +_2_44->_2_46 +_2_44->_2_47 +_2_46->_2_48 +_2_47->_2_2 +} + +subgraph cluster_3{ +labelloc="t" +_3_0 [label = "0 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_3_1 [label = "1 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_2 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_3_3 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_3_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_6 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_3_7 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_8 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_3_9 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle] +_3_11 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_3_12 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_13 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle] +_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_3_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_17 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_3_18 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_19 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_3_20 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_3_21 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle] +_3_23 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_3_25 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_3_27 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_29 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_3_31 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_3_33 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_34 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_3_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_3_36 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_3_38 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_3_40 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_3_42 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_3_44 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_3_45 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_46 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle] +_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle] +_3_0->_3_1 +_3_1->_3_12 +_3_1->_3_23 +_3_2->_3_34 +_3_2->_3_3 +_3_3->_3_4 +_3_4->_3_5 +_3_5->_3_6 +_3_6->_3_7 +_3_6->_3_8 +_3_7->_3_9 +_3_8->_3_10 +_3_9->_3_11 +_3_9->_3_13 +_3_11->_3_14 +_3_12->_3_34 +_3_12->_3_44 +_3_13->_3_15 +_3_15->_3_16 +_3_16->_3_17 +_3_17->_3_18 +_3_17->_3_46 +_3_18->_3_19 +_3_19->_3_20 +_3_19->_3_21 +_3_20->_3_22 +_3_21->_3_24 +_3_23->_3_45 +_3_23->_3_46 +_3_24->_3_25 +_3_25->_3_26 +_3_26->_3_27 +_3_26->_3_8 +_3_27->_3_28 +_3_28->_3_34 +_3_28->_3_29 +_3_29->_3_30 +_3_30->_3_31 +_3_31->_3_32 +_3_32->_3_33 +_3_32->_3_46 +_3_33->_3_35 +_3_34->_3_47 +_3_35->_3_11 +_3_35->_3_36 +_3_36->_3_37 +_3_37->_3_38 +_3_38->_3_39 +_3_39->_3_40 +_3_39->_3_8 +_3_40->_3_41 +_3_41->_3_20 +_3_41->_3_42 +_3_42->_3_43 +_3_43->_3_1 +_3_44->_3_48 +_3_45->_3_2 +_3_46->_3_48 +} + +subgraph cluster_4{ +labelloc="t" +_4_0 [label = "0 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_4_1 [label = "1 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_4_3 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_4_5 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_4_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_4_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_4_10 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_4_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_4_14 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_4_16 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_17 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_18 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_4_19 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] +_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_4_22 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_23 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_24 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_4_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_26 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_4_27 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_4_29 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_30 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_4_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_32 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_4_33 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_4_36 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_37 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_38 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_4_39 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_4_40 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_4_42 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_4_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_4_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_4_47 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_4_0->_4_1 +_4_1->_4_12 +_4_2->_4_3 +_4_3->_4_4 +_4_4->_4_5 +_4_4->_4_6 +_4_5->_4_7 +_4_6->_4_8 +_4_7->_4_9 +_4_7->_4_10 +_4_9->_4_11 +_4_10->_4_13 +_4_12->_4_23 +_4_12->_4_34 +_4_13->_4_14 +_4_14->_4_15 +_4_15->_4_16 +_4_15->_4_34 +_4_16->_4_17 +_4_17->_4_18 +_4_17->_4_19 +_4_18->_4_20 +_4_19->_4_21 +_4_21->_4_22 +_4_22->_4_24 +_4_23->_4_44 +_4_24->_4_25 +_4_24->_4_6 +_4_25->_4_26 +_4_26->_4_46 +_4_26->_4_27 +_4_27->_4_28 +_4_28->_4_29 +_4_29->_4_30 +_4_30->_4_31 +_4_30->_4_34 +_4_31->_4_32 +_4_32->_4_9 +_4_32->_4_33 +_4_33->_4_35 +_4_34->_4_45 +_4_35->_4_36 +_4_36->_4_37 +_4_36->_4_38 +_4_37->_4_18 +_4_37->_4_39 +_4_38->_4_40 +_4_38->_4_6 +_4_39->_4_8 +_4_40->_4_41 +_4_41->_4_18 +_4_41->_4_42 +_4_42->_4_43 +_4_43->_4_1 +_4_44->_4_46 +_4_44->_4_47 +_4_46->_4_48 +_4_47->_4_2 +} + +subgraph cluster_5{ +labelloc="t" +_5_0 [label = "0 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_5_1 [label = "1 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_5_3 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_5_5 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_5_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_5_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_5_10 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_5_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_5_14 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_15 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_16 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_5_17 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_5_18 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_5_19 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] +_5_21 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_5_22 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_23 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_5_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_5_27 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_28 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_5_29 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_5_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_5_33 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_5_35 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_5_36 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_5_38 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_5_40 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_42 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_5_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_5_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_5_47 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_5_0->_5_1 +_5_1->_5_12 +_5_2->_5_3 +_5_3->_5_4 +_5_4->_5_5 +_5_4->_5_6 +_5_5->_5_7 +_5_6->_5_8 +_5_7->_5_9 +_5_7->_5_10 +_5_9->_5_11 +_5_10->_5_13 +_5_12->_5_23 +_5_12->_5_34 +_5_13->_5_14 +_5_14->_5_15 +_5_14->_5_16 +_5_15->_5_17 +_5_15->_5_18 +_5_16->_5_19 +_5_16->_5_34 +_5_17->_5_20 +_5_18->_5_45 +_5_19->_5_21 +_5_21->_5_17 +_5_21->_5_22 +_5_22->_5_24 +_5_23->_5_44 +_5_24->_5_25 +_5_25->_5_26 +_5_26->_5_27 +_5_26->_5_6 +_5_27->_5_28 +_5_28->_5_46 +_5_28->_5_29 +_5_29->_5_30 +_5_30->_5_31 +_5_31->_5_32 +_5_32->_5_33 +_5_32->_5_34 +_5_33->_5_35 +_5_34->_5_45 +_5_35->_5_9 +_5_35->_5_36 +_5_36->_5_37 +_5_37->_5_38 +_5_38->_5_39 +_5_39->_5_40 +_5_39->_5_6 +_5_40->_5_41 +_5_41->_5_17 +_5_41->_5_42 +_5_42->_5_43 +_5_43->_5_1 +_5_44->_5_46 +_5_44->_5_47 +_5_46->_5_48 +_5_47->_5_2 +} + +} + diff --git a/cfpq-paths-app/src/main/resources/example_1_graph.dot b/cfpq-paths-app/src/main/resources/example_1_graph.dot new file mode 100644 index 000000000..2e845e0ea --- /dev/null +++ b/cfpq-paths-app/src/main/resources/example_1_graph.dot @@ -0,0 +1,11 @@ +digraph { + start -> 0; + start -> 1; + start -> 2; + 0 -> 1 [label = "a"]; + 1 -> 2 [label = "a"]; + 2 -> 3 [label = "b"]; + 3 -> 2 [label = "b"]; + 2 -> 0 [label = "a"]; + +} \ No newline at end of file From b31810b253e42f9edc24d96d9cedaa75109fe660 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 1 Apr 2026 22:50:52 +0300 Subject: [PATCH 24/71] docs(README.md): Added README.md file to simple_examples - Created two more simple examples, added their images - Wrote a readme with explanations for simple examples for UCFS using --- .../src/main/kotlin/simple_examples/README.md | 114 + .../main/kotlin/simple_examples/example_1.kt | 2 +- .../figures/example_1_graph.dot | 7 +- .../figures/example_1_graph.dot.svg | 93 +- .../figures/example_1_graph_sppf.dot | 689 +-- .../figures/example_1_graph_sppf.dot.svg | 3840 +---------------- .../figures/example_2_graph.dot | 7 + .../figures/example_2_graph.dot.svg | 58 + .../figures/example_2_graph_sppf.dot | 54 + .../figures/example_2_graph_sppf.dot.svg | 282 ++ .../figures/example_3_graph.dot | 11 + .../figures/example_3_graph.dot.svg | 96 + .../example_3_graph_sppf.dot} | 0 .../figures/example_3_graph_sppf.dot.svg | 3811 ++++++++++++++++ .../src/main/resources/example_1_graph.dot | 7 +- .../src/main/resources/example_2_graph.dot | 7 + .../src/main/resources/example_3_graph.dot | 11 + 17 files changed, 4661 insertions(+), 4428 deletions(-) create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/README.md create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg rename cfpq-paths-app/src/main/kotlin/simple_examples/{gen/example_1_graph_sppf.dot => figures/example_3_graph_sppf.dot} (100%) create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg create mode 100644 cfpq-paths-app/src/main/resources/example_2_graph.dot create mode 100644 cfpq-paths-app/src/main/resources/example_3_graph.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md new file mode 100644 index 000000000..488182dc4 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -0,0 +1,114 @@ +> [!IMPORTANT] +> This file is a tutorial and demonstration of how to use the UCFS tool. + +**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and +labeled directed graphs. It is based on the **GLL** algorithm. + +**Generalized LL parsing (GLL)** is a parsing technique that extends traditional LL parsing to handle any context-free +grammar. +The name *LL* itself stands for + +* Left-to-right scanning of the input +* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) + +**Requirements for use UCFS:** 11+ java version + +**To run (from project root):** + +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` + +**Code for path extraction:** ```src/main/kotlin/simple_examples/example_1.kt``` + + +> [!TIP] +> You can read about how to define a context-free grammar using DSL, including what a terminal and a non-terminal are, +> as well as about operations, by following +> the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/). + +## $a^nb^n$ Language + +**Grammar assignment** + +Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end +with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) +> [!TIP] +> Please note that we can do this in several ways. +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * Option(S) * "b" +> } +>} +>``` +>or +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * (Epsilon or S) * "b" +> } +>} +>``` + +**Example 1: Simple graph with a finite set of paths** + +**Input graph:** + +![Simple AnBn Graph / Finite Set Of Path](src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg) + +Let's find *all* words that satisfy the language's grammar: + +* $ab$ (0 -$a$-> 1 -$b$-> 2) +* $aabb$ (0 -$a$-> 1 -$a$-> 2 -$b$-> 1 -$b$-> 2) + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg) + +**Example 2: Simple graph with an infinite number of paths #1** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1](src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (0 -$a$-> 1 -$b$-> 1) +* $aaabbb$ (0 -$a$-> 1 -$a$-> 0 -$a$-> 1 -$b$-> 1 -$b$-> 1 -$b$-> 1) +* ... + +> [!NOTE] +> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg) + +> [!TIP] +> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. + +**Example 3: Simple graph with an infinite set of paths #2** + +**Input graph:** + +![Simple AnBn Graph / Iinite Set Of Path #2](src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (1 -$a$-> 2 -$b$-> 3) +* $aabb$ (0 -$a$-> 1 -$a$-> 2 -$b$-> 3 -$b$-> 2) +* $aaabbb$ (2 -$a$-> 0 -$a$-> 1 -$a$-> 2 -$b$-> 3 -$b$-> 2 -$b$-> 3) +* ... + +> [!NOTE] +> We get an infinite number of words. Words cover the entire language thanks to several starting points. + +**Resulting SPPF graph** is too big, you can find it in +```src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg``` + +*Default location of all generated SPPFs:* ```src/main/kotlin/simple_examples/gen``` diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt b/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt index daa429e9e..2adec6ef0 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt @@ -90,7 +90,7 @@ fun saveSppf(name: String, sppf: Set>) { } fun main() { - listOf("example_1_graph.dot").forEach { graphName -> + listOf("example_1_graph.dot", "example_2_graph.dot", "example_3_graph.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToAnBnGrammar() val gll = Gll.gll(grammar.rsm, graph) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot index 2e845e0ea..4b60207ce 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot @@ -1,11 +1,8 @@ digraph { start -> 0; - start -> 1; - start -> 2; 0 -> 1 [label = "a"]; 1 -> 2 [label = "a"]; - 2 -> 3 [label = "b"]; - 3 -> 2 [label = "b"]; - 2 -> 0 [label = "a"]; + 1 -> 2 [label = "b"]; + 2 -> 1 [label = "b"]; } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg index 511a10387..11a089d78 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg @@ -4,93 +4,68 @@ - - + + %3 - + start - -start + +start 0 - -0 + +0 start->0 - - + + 1 - -1 + +1 - + -start->1 - - +0->1 + + +a 2 - -2 + +2 - + -start->2 - - - - - -0->1 - - -a +1->2 + + +a - + 1->2 - - -a - - - -2->0 - - -a + + +b - - -3 - -3 - - - -2->3 - - -b - - - -3->2 - - -b + + +2->1 + + +b diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot index b83bc8506..a85d0c66b 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot @@ -5,666 +5,43 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_0_3 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_4 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_0_5 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_0_6 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_0_7 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_0_8 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_9 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle] -_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle] -_0_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_0_13 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_0_14 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_0_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_17 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_0_18 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_19 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_0_20 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_21 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle] -_0_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_0_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_26 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_0_27 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_28 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_0_29 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_0_31 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_0_33 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_0_36 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_0_38 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_0_40 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_0_42 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_0_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] -_0_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_47 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle] +_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle] +_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] +_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] +_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] _0_0->_0_1 +_0_1->_0_11 _0_1->_0_12 +_0_2->_0_13 _0_2->_0_3 _0_3->_0_4 -_0_3->_0_5 -_0_4->_0_6 -_0_4->_0_7 -_0_5->_0_8 -_0_5->_0_9 -_0_6->_0_10 -_0_7->_0_11 -_0_8->_0_13 -_0_9->_0_11 -_0_12->_0_23 -_0_12->_0_34 -_0_13->_0_6 -_0_13->_0_14 -_0_14->_0_15 -_0_15->_0_16 -_0_16->_0_17 -_0_17->_0_18 -_0_17->_0_34 -_0_18->_0_19 -_0_19->_0_20 -_0_19->_0_21 -_0_20->_0_22 -_0_21->_0_24 -_0_23->_0_44 -_0_24->_0_25 -_0_25->_0_26 -_0_26->_0_27 -_0_26->_0_9 -_0_27->_0_28 -_0_28->_0_46 -_0_28->_0_29 -_0_29->_0_30 -_0_30->_0_31 -_0_31->_0_32 -_0_32->_0_33 -_0_32->_0_34 -_0_33->_0_35 -_0_34->_0_45 -_0_35->_0_6 -_0_35->_0_36 -_0_36->_0_37 -_0_37->_0_38 -_0_38->_0_39 -_0_39->_0_40 -_0_39->_0_9 -_0_40->_0_41 -_0_41->_0_20 -_0_41->_0_42 -_0_42->_0_43 -_0_43->_0_1 -_0_44->_0_46 -_0_44->_0_47 -_0_46->_0_48 -_0_47->_0_2 -} - -subgraph cluster_1{ -labelloc="t" -_1_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_1_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_1_3 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_1_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_1_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] -_1_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_1_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle] -_1_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_1_14 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_15 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_1_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_17 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_1_18 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_1_19 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle] -_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_1_22 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_24 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_1_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_26 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_1_27 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_1_29 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_30 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_1_31 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_1_32 [label = "38 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_1_33 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_1_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_1_36 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_1_38 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_1_40 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_1_42 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_1_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] -_1_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_1_47 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] -_1_0->_1_1 -_1_1->_1_12 -_1_2->_1_3 -_1_3->_1_4 -_1_4->_1_5 -_1_4->_1_6 -_1_5->_1_7 -_1_6->_1_8 -_1_7->_1_9 -_1_7->_1_10 -_1_9->_1_11 -_1_10->_1_13 -_1_12->_1_23 -_1_12->_1_34 -_1_13->_1_14 -_1_14->_1_15 -_1_15->_1_16 -_1_15->_1_34 -_1_16->_1_17 -_1_17->_1_18 -_1_17->_1_19 -_1_18->_1_20 -_1_19->_1_21 -_1_21->_1_22 -_1_22->_1_24 -_1_23->_1_44 -_1_24->_1_25 -_1_24->_1_6 -_1_25->_1_26 -_1_26->_1_46 -_1_26->_1_27 -_1_27->_1_28 -_1_28->_1_29 -_1_29->_1_30 -_1_29->_1_31 -_1_30->_1_9 -_1_30->_1_32 -_1_31->_1_33 -_1_31->_1_34 -_1_32->_1_45 -_1_33->_1_35 -_1_34->_1_45 -_1_35->_1_9 -_1_35->_1_36 -_1_36->_1_37 -_1_37->_1_38 -_1_38->_1_39 -_1_39->_1_40 -_1_39->_1_6 -_1_40->_1_41 -_1_41->_1_18 -_1_41->_1_42 -_1_42->_1_43 -_1_43->_1_1 -_1_44->_1_46 -_1_44->_1_47 -_1_46->_1_48 -_1_47->_1_2 -} - -subgraph cluster_2{ -labelloc="t" -_2_0 [label = "0 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_2_1 [label = "1 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_2_3 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_2_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_2_7 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] -_2_9 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_2_10 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle] -_2_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_2_14 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_2_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_17 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_2_18 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_2_19 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle] -_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_2_22 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_23 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_24 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_2_25 [label = "31 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_2_26 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_2_27 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_2_29 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_2_31 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_2_33 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_2_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_2_36 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_2_38 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_2_40 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_2_42 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_2_44 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] -_2_46 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_2_47 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle] -_2_0->_2_1 -_2_1->_2_12 -_2_2->_2_3 -_2_3->_2_4 -_2_4->_2_5 -_2_4->_2_6 -_2_5->_2_7 -_2_6->_2_8 -_2_7->_2_9 -_2_7->_2_10 -_2_9->_2_11 -_2_10->_2_13 -_2_12->_2_23 -_2_12->_2_34 -_2_13->_2_14 -_2_14->_2_15 -_2_15->_2_16 -_2_15->_2_34 -_2_16->_2_17 -_2_17->_2_18 -_2_17->_2_19 -_2_18->_2_20 -_2_19->_2_21 -_2_21->_2_22 -_2_22->_2_24 -_2_22->_2_25 -_2_23->_2_44 -_2_24->_2_46 -_2_24->_2_26 -_2_25->_2_27 -_2_25->_2_6 -_2_26->_2_8 -_2_27->_2_28 -_2_28->_2_46 -_2_28->_2_29 -_2_29->_2_30 -_2_30->_2_31 -_2_31->_2_32 -_2_32->_2_33 -_2_32->_2_34 -_2_33->_2_35 -_2_34->_2_45 -_2_35->_2_9 -_2_35->_2_36 -_2_36->_2_37 -_2_37->_2_38 -_2_38->_2_39 -_2_39->_2_40 -_2_39->_2_6 -_2_40->_2_41 -_2_41->_2_18 -_2_41->_2_42 -_2_42->_2_43 -_2_43->_2_1 -_2_44->_2_46 -_2_44->_2_47 -_2_46->_2_48 -_2_47->_2_2 -} - -subgraph cluster_3{ -labelloc="t" -_3_0 [label = "0 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_3_1 [label = "1 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_2 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_3_3 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_3_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_6 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_3_7 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_8 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_3_9 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle] -_3_11 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_3_12 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_3_13 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle] -_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_3_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_17 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_3_18 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_19 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_3_20 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_3_21 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle] -_3_23 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_3_25 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_3_27 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_3_29 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_3_31 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_3_33 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_34 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_3_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_3_36 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_3_38 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_3_40 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_3_42 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_3_44 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_3_45 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_46 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle] -_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle] -_3_0->_3_1 -_3_1->_3_12 -_3_1->_3_23 -_3_2->_3_34 -_3_2->_3_3 -_3_3->_3_4 -_3_4->_3_5 -_3_5->_3_6 -_3_6->_3_7 -_3_6->_3_8 -_3_7->_3_9 -_3_8->_3_10 -_3_9->_3_11 -_3_9->_3_13 -_3_11->_3_14 -_3_12->_3_34 -_3_12->_3_44 -_3_13->_3_15 -_3_15->_3_16 -_3_16->_3_17 -_3_17->_3_18 -_3_17->_3_46 -_3_18->_3_19 -_3_19->_3_20 -_3_19->_3_21 -_3_20->_3_22 -_3_21->_3_24 -_3_23->_3_45 -_3_23->_3_46 -_3_24->_3_25 -_3_25->_3_26 -_3_26->_3_27 -_3_26->_3_8 -_3_27->_3_28 -_3_28->_3_34 -_3_28->_3_29 -_3_29->_3_30 -_3_30->_3_31 -_3_31->_3_32 -_3_32->_3_33 -_3_32->_3_46 -_3_33->_3_35 -_3_34->_3_47 -_3_35->_3_11 -_3_35->_3_36 -_3_36->_3_37 -_3_37->_3_38 -_3_38->_3_39 -_3_39->_3_40 -_3_39->_3_8 -_3_40->_3_41 -_3_41->_3_20 -_3_41->_3_42 -_3_42->_3_43 -_3_43->_3_1 -_3_44->_3_48 -_3_45->_3_2 -_3_46->_3_48 -} - -subgraph cluster_4{ -labelloc="t" -_4_0 [label = "0 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_4_1 [label = "1 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_4_3 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_4_5 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_4_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] -_4_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_4_10 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] -_4_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_4_14 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_4_16 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_17 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_4_18 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_4_19 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] -_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_4_22 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_23 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_24 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_4_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_26 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_4_27 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_4_29 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_30 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_4_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_32 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_4_33 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_4_36 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_37 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_4_38 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_4_39 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_4_40 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_4_42 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_4_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] -_4_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_4_47 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] -_4_0->_4_1 -_4_1->_4_12 -_4_2->_4_3 -_4_3->_4_4 -_4_4->_4_5 -_4_4->_4_6 -_4_5->_4_7 -_4_6->_4_8 -_4_7->_4_9 -_4_7->_4_10 -_4_9->_4_11 -_4_10->_4_13 -_4_12->_4_23 -_4_12->_4_34 -_4_13->_4_14 -_4_14->_4_15 -_4_15->_4_16 -_4_15->_4_34 -_4_16->_4_17 -_4_17->_4_18 -_4_17->_4_19 -_4_18->_4_20 -_4_19->_4_21 -_4_21->_4_22 -_4_22->_4_24 -_4_23->_4_44 -_4_24->_4_25 -_4_24->_4_6 -_4_25->_4_26 -_4_26->_4_46 -_4_26->_4_27 -_4_27->_4_28 -_4_28->_4_29 -_4_29->_4_30 -_4_30->_4_31 -_4_30->_4_34 -_4_31->_4_32 -_4_32->_4_9 -_4_32->_4_33 -_4_33->_4_35 -_4_34->_4_45 -_4_35->_4_36 -_4_36->_4_37 -_4_36->_4_38 -_4_37->_4_18 -_4_37->_4_39 -_4_38->_4_40 -_4_38->_4_6 -_4_39->_4_8 -_4_40->_4_41 -_4_41->_4_18 -_4_41->_4_42 -_4_42->_4_43 -_4_43->_4_1 -_4_44->_4_46 -_4_44->_4_47 -_4_46->_4_48 -_4_47->_4_2 -} - -subgraph cluster_5{ -labelloc="t" -_5_0 [label = "0 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_5_1 [label = "1 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_5_3 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_5_5 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_5_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] -_5_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_5_10 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] -_5_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_5_14 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_15 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_5_16 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_5_17 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_5_18 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_5_19 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] -_5_21 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_5_22 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_23 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_5_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_5_27 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_28 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_5_29 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_5_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_5_33 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_5_35 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_5_36 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_5_38 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_5_40 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_5_42 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_5_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] -_5_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_5_47 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] -_5_0->_5_1 -_5_1->_5_12 -_5_2->_5_3 -_5_3->_5_4 -_5_4->_5_5 -_5_4->_5_6 -_5_5->_5_7 -_5_6->_5_8 -_5_7->_5_9 -_5_7->_5_10 -_5_9->_5_11 -_5_10->_5_13 -_5_12->_5_23 -_5_12->_5_34 -_5_13->_5_14 -_5_14->_5_15 -_5_14->_5_16 -_5_15->_5_17 -_5_15->_5_18 -_5_16->_5_19 -_5_16->_5_34 -_5_17->_5_20 -_5_18->_5_45 -_5_19->_5_21 -_5_21->_5_17 -_5_21->_5_22 -_5_22->_5_24 -_5_23->_5_44 -_5_24->_5_25 -_5_25->_5_26 -_5_26->_5_27 -_5_26->_5_6 -_5_27->_5_28 -_5_28->_5_46 -_5_28->_5_29 -_5_29->_5_30 -_5_30->_5_31 -_5_31->_5_32 -_5_32->_5_33 -_5_32->_5_34 -_5_33->_5_35 -_5_34->_5_45 -_5_35->_5_9 -_5_35->_5_36 -_5_36->_5_37 -_5_37->_5_38 -_5_38->_5_39 -_5_39->_5_40 -_5_39->_5_6 -_5_40->_5_41 -_5_41->_5_17 -_5_41->_5_42 -_5_42->_5_43 -_5_43->_5_1 -_5_44->_5_46 -_5_44->_5_47 -_5_46->_5_48 -_5_47->_5_2 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_8 +_0_7->_0_9 +_0_8->_0_10 +_0_11->_0_13 +_0_11->_0_14 +_0_12->_0_15 +_0_12->_0_16 +_0_13->_0_17 +_0_14->_0_18 +_0_15->_0_2 +_0_16->_0_18 } } diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg index 27dec8ae1..995f987b9 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg @@ -4,3808 +4,244 @@ - - + + g - + cluster_0 - - - -cluster_1 - - - -cluster_2 - - - -cluster_3 - - - -cluster_4 - - - -cluster_5 - + _0_0 - -0     Nonterminal S, input: [0, 2] + +0     Nonterminal S, input: [0, 2] _0_1 - -1     Range , input: [0, 2], rsm: [S_0, S_3] + +1     Range , input: [0, 2], rsm: [S_0, S_3] _0_0->_0_1 - - + + + + + +_0_11 +2     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_0_1->_0_11 + + _0_12 -2     Intermediate input: 3, rsm: S_2, input: [0, 2] +3     Intermediate input: 1, rsm: S_2, input: [0, 2] - + _0_1->_0_12 - - + + _0_2 - -10     Nonterminal S, input: [1, 3] +10     Intermediate input: 1, rsm: S_1, input: [0, 1] _0_3 - -11     Range , input: [1, 3], rsm: [S_0, S_3] + +11     Range , input: [1, 1], rsm: [S_1, S_2] - + _0_2->_0_3 - - + + + + + +_0_13 + +4     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_2->_0_13 + + _0_4 -12     Intermediate input: 2, rsm: S_1, input: [1, 3] + +12     Nonterminal S, input: [1, 1] - + _0_3->_0_4 - - + + _0_5 -13     Intermediate input: 2, rsm: S_2, input: [1, 3] + +13     Range , input: [1, 1], rsm: [S_0, S_3] - - -_0_3->_0_5 - - + + +_0_4->_0_5 + + _0_6 - -14     Range , input: [1, 2], rsm: [S_0, S_1] +14     Intermediate input: 2, rsm: S_1, input: [1, 1] - - -_0_4->_0_6 - - + + +_0_5->_0_6 + + _0_7 - -15     Range , input: [2, 3], rsm: [S_1, S_3] + +15     Range , input: [1, 2], rsm: [S_0, S_1] - - -_0_4->_0_7 - - + + +_0_6->_0_7 + + _0_8 - -16     Range , input: [1, 2], rsm: [S_0, S_2] + +16     Range , input: [2, 1], rsm: [S_1, S_3] - - -_0_5->_0_8 - - + + +_0_6->_0_8 + + _0_9 - -17     Range , input: [2, 3], rsm: [S_2, S_3] + +17     Terminal 'a', input: [1, 2] - - -_0_5->_0_9 - - + + +_0_7->_0_9 + + _0_10 - -18     Terminal 'a', input: [1, 2] - - - -_0_6->_0_10 - - - - - -_0_11 - -19     Terminal 'b', input: [2, 3] - - - -_0_7->_0_11 - - - - - -_0_13 -20     Intermediate input: 2, rsm: S_1, input: [1, 2] + +18     Terminal 'b', input: [2, 1] - + -_0_8->_0_13 - - +_0_8->_0_10 + + - + -_0_9->_0_11 - - - - - -_0_23 - -3     Range , input: [0, 3], rsm: [S_0, S_2] - - - -_0_12->_0_23 - - - - - -_0_34 - -4     Range , input: [3, 2], rsm: [S_2, S_3] - - - -_0_12->_0_34 - - - - - -_0_13->_0_6 - - +_0_11->_0_13 + + _0_14 - -21     Range , input: [2, 2], rsm: [S_1, S_2] + +5     Range , input: [1, 2], rsm: [S_1, S_3] - - -_0_13->_0_14 - - + + +_0_11->_0_14 + + _0_15 - -22     Nonterminal S, input: [2, 2] + +6     Range , input: [0, 1], rsm: [S_0, S_2] - - -_0_14->_0_15 - - + + +_0_12->_0_15 + + _0_16 - -23     Range , input: [2, 2], rsm: [S_0, S_3] + +7     Range , input: [1, 2], rsm: [S_2, S_3] - - -_0_15->_0_16 - - + + +_0_12->_0_16 + + _0_17 -24     Intermediate input: 3, rsm: S_2, input: [2, 2] + +8     Terminal 'a', input: [0, 1] - - -_0_16->_0_17 - - + + +_0_13->_0_17 + + _0_18 - -25     Range , input: [2, 3], rsm: [S_0, S_2] - - - -_0_17->_0_18 - - - - - -_0_17->_0_34 - - - - - -_0_19 -26     Intermediate input: 0, rsm: S_1, input: [2, 3] - - - -_0_18->_0_19 - - - - - -_0_20 - -27     Range , input: [2, 0], rsm: [S_0, S_1] - - - -_0_19->_0_20 - - - - - -_0_21 - -28     Range , input: [0, 3], rsm: [S_1, S_2] - - - -_0_19->_0_21 - - - - - -_0_22 - -29     Terminal 'a', input: [2, 0] - - - -_0_20->_0_22 - - - - - -_0_24 - -30     Nonterminal S, input: [0, 3] - - - -_0_21->_0_24 - - - - - -_0_44 -5     Intermediate input: 1, rsm: S_1, input: [0, 3] - - - -_0_23->_0_44 - - - - - -_0_25 - -31     Range , input: [0, 3], rsm: [S_0, S_3] - - - -_0_24->_0_25 - - - - - -_0_26 -32     Intermediate input: 2, rsm: S_2, input: [0, 3] - - - -_0_25->_0_26 - - - - - -_0_26->_0_9 - - - - - -_0_27 - -33     Range , input: [0, 2], rsm: [S_0, S_2] - - - -_0_26->_0_27 - - - - - -_0_28 -34     Intermediate input: 1, rsm: S_1, input: [0, 2] - - - -_0_27->_0_28 - - - - - -_0_29 - -35     Range , input: [1, 2], rsm: [S_1, S_2] - - - -_0_28->_0_29 - - - - - -_0_46 - -7     Range , input: [0, 1], rsm: [S_0, S_1] - - - -_0_28->_0_46 - - - - - -_0_30 - -36     Nonterminal S, input: [1, 2] - - - -_0_29->_0_30 - - - - - -_0_31 - -37     Range , input: [1, 2], rsm: [S_0, S_3] - - - -_0_30->_0_31 - - - - - -_0_32 -38     Intermediate input: 3, rsm: S_2, input: [1, 2] - - - -_0_31->_0_32 - - - - - -_0_33 - -39     Range , input: [1, 3], rsm: [S_0, S_2] - - - -_0_32->_0_33 - - - - - -_0_32->_0_34 - - - - - -_0_35 -40     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_0_33->_0_35 - - - - - -_0_45 - -6     Terminal 'b', input: [3, 2] - - - -_0_34->_0_45 - - - - - -_0_35->_0_6 - - - - - -_0_36 - -41     Range , input: [2, 3], rsm: [S_1, S_2] - - - -_0_35->_0_36 - - - - - -_0_37 - -42     Nonterminal S, input: [2, 3] - - - -_0_36->_0_37 - - - - - -_0_38 - -43     Range , input: [2, 3], rsm: [S_0, S_3] - - - -_0_37->_0_38 - - - - - -_0_39 -44     Intermediate input: 2, rsm: S_2, input: [2, 3] - - - -_0_38->_0_39 - - - - - -_0_39->_0_9 - - - - - -_0_40 - -45     Range , input: [2, 2], rsm: [S_0, S_2] - - - -_0_39->_0_40 - - - - - -_0_41 -46     Intermediate input: 0, rsm: S_1, input: [2, 2] - - - -_0_40->_0_41 - - - - - -_0_41->_0_20 - - - - - -_0_42 - -47     Range , input: [0, 2], rsm: [S_1, S_2] - - - -_0_41->_0_42 - - - - - -_0_43 - -48     Nonterminal S, input: [0, 2] - - - -_0_42->_0_43 - - - - - -_0_43->_0_1 - - - - - -_0_44->_0_46 - - - - - -_0_47 - -8     Range , input: [1, 3], rsm: [S_1, S_2] - - - -_0_44->_0_47 - - - - - -_0_48 - -9     Terminal 'a', input: [0, 1] - - - -_0_46->_0_48 - - - - - -_0_47->_0_2 - - - - - -_1_0 - -0     Nonterminal S, input: [0, 3] + +9     Terminal 'b', input: [1, 2] - - -_1_1 - -1     Range , input: [0, 3], rsm: [S_0, S_3] - - - -_1_0->_1_1 - - - - - -_1_12 -2     Intermediate input: 2, rsm: S_2, input: [0, 3] - - - -_1_1->_1_12 - - - - - -_1_2 - -10     Nonterminal S, input: [1, 2] - - - -_1_3 - -11     Range , input: [1, 2], rsm: [S_0, S_3] - - - -_1_2->_1_3 - - - - - -_1_4 -12     Intermediate input: 3, rsm: S_2, input: [1, 2] - - - -_1_3->_1_4 - - - - - -_1_5 - -13     Range , input: [1, 3], rsm: [S_0, S_2] - - - -_1_4->_1_5 - - - - - -_1_6 - -14     Range , input: [3, 2], rsm: [S_2, S_3] - - - -_1_4->_1_6 - - - - - -_1_7 -15     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_1_5->_1_7 - - - - - -_1_8 - -16     Terminal 'b', input: [3, 2] - - - -_1_6->_1_8 - - - - - -_1_9 - -17     Range , input: [1, 2], rsm: [S_0, S_1] - - - -_1_7->_1_9 - - - - - -_1_10 - -18     Range , input: [2, 3], rsm: [S_1, S_2] - - - -_1_7->_1_10 - - - - - -_1_11 - -19     Terminal 'a', input: [1, 2] - - - -_1_9->_1_11 - - - - - -_1_13 - -20     Nonterminal S, input: [2, 3] - - - -_1_10->_1_13 - - - - - -_1_23 - -3     Range , input: [0, 2], rsm: [S_0, S_2] - - - -_1_12->_1_23 - - - - - -_1_34 - -4     Range , input: [2, 3], rsm: [S_2, S_3] - - - -_1_12->_1_34 - - - - - -_1_14 - -21     Range , input: [2, 3], rsm: [S_0, S_3] - - - -_1_13->_1_14 - - - - - -_1_15 -22     Intermediate input: 2, rsm: S_2, input: [2, 3] - - - -_1_14->_1_15 - - - - - -_1_16 - -23     Range , input: [2, 2], rsm: [S_0, S_2] - - - -_1_15->_1_16 - - - - - -_1_15->_1_34 - - - - - -_1_17 -24     Intermediate input: 0, rsm: S_1, input: [2, 2] - - - -_1_16->_1_17 - - - - - -_1_18 - -25     Range , input: [2, 0], rsm: [S_0, S_1] - - - -_1_17->_1_18 - - - - - -_1_19 - -26     Range , input: [0, 2], rsm: [S_1, S_2] - - - -_1_17->_1_19 - - - - - -_1_20 - -27     Terminal 'a', input: [2, 0] - - - -_1_18->_1_20 - - - - - -_1_21 - -28     Nonterminal S, input: [0, 2] - - - -_1_19->_1_21 - - - - - -_1_22 - -29     Range , input: [0, 2], rsm: [S_0, S_3] - - - -_1_21->_1_22 - - - - - -_1_24 -30     Intermediate input: 3, rsm: S_2, input: [0, 2] - - - -_1_22->_1_24 - - - - - -_1_44 -5     Intermediate input: 1, rsm: S_1, input: [0, 2] - - - -_1_23->_1_44 - - - - - -_1_24->_1_6 - - - - - -_1_25 - -31     Range , input: [0, 3], rsm: [S_0, S_2] - - - -_1_24->_1_25 - - - - - -_1_26 -32     Intermediate input: 1, rsm: S_1, input: [0, 3] - - - -_1_25->_1_26 - - - - - -_1_27 - -33     Range , input: [1, 3], rsm: [S_1, S_2] - - - -_1_26->_1_27 - - - - - -_1_46 - -7     Range , input: [0, 1], rsm: [S_0, S_1] - - - -_1_26->_1_46 - - - - - -_1_28 - -34     Nonterminal S, input: [1, 3] - - - -_1_27->_1_28 - - - - - -_1_29 - -35     Range , input: [1, 3], rsm: [S_0, S_3] - - - -_1_28->_1_29 - - - - - -_1_30 -36     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_1_29->_1_30 - - - - - -_1_31 -37     Intermediate input: 2, rsm: S_2, input: [1, 3] - - - -_1_29->_1_31 - - - - - -_1_30->_1_9 - - - - - -_1_32 - -38     Range , input: [2, 3], rsm: [S_1, S_3] - - - -_1_30->_1_32 - - - - - -_1_33 - -39     Range , input: [1, 2], rsm: [S_0, S_2] - - - -_1_31->_1_33 - - - - - -_1_31->_1_34 - - - - - -_1_45 - -6     Terminal 'b', input: [2, 3] - - - -_1_32->_1_45 - - - - - -_1_35 -40     Intermediate input: 2, rsm: S_1, input: [1, 2] - - - -_1_33->_1_35 - - - - - -_1_34->_1_45 - - - - - -_1_35->_1_9 - - - - - -_1_36 - -41     Range , input: [2, 2], rsm: [S_1, S_2] - - - -_1_35->_1_36 - - - - - -_1_37 - -42     Nonterminal S, input: [2, 2] - - - -_1_36->_1_37 - - - - - -_1_38 - -43     Range , input: [2, 2], rsm: [S_0, S_3] - - - -_1_37->_1_38 - - - - - -_1_39 -44     Intermediate input: 3, rsm: S_2, input: [2, 2] - - - -_1_38->_1_39 - - - - - -_1_39->_1_6 - - - - - -_1_40 - -45     Range , input: [2, 3], rsm: [S_0, S_2] - - - -_1_39->_1_40 - - - - - -_1_41 -46     Intermediate input: 0, rsm: S_1, input: [2, 3] - - - -_1_40->_1_41 - - - - - -_1_41->_1_18 - - - - - -_1_42 - -47     Range , input: [0, 3], rsm: [S_1, S_2] - - - -_1_41->_1_42 - - - - - -_1_43 - -48     Nonterminal S, input: [0, 3] - - - -_1_42->_1_43 - - - - - -_1_43->_1_1 - - - - - -_1_44->_1_46 - - - - - -_1_47 - -8     Range , input: [1, 2], rsm: [S_1, S_2] - - - -_1_44->_1_47 - - - - - -_1_48 - -9     Terminal 'a', input: [0, 1] - - - -_1_46->_1_48 - - - - - -_1_47->_1_2 - - - - - -_2_0 - -0     Nonterminal S, input: [1, 2] - - - -_2_1 - -1     Range , input: [1, 2], rsm: [S_0, S_3] - - - -_2_0->_2_1 - - - - - -_2_12 -2     Intermediate input: 3, rsm: S_2, input: [1, 2] - - - -_2_1->_2_12 - - - - - -_2_2 - -10     Nonterminal S, input: [2, 3] - - - -_2_3 - -11     Range , input: [2, 3], rsm: [S_0, S_3] - - - -_2_2->_2_3 - - - - - -_2_4 -12     Intermediate input: 2, rsm: S_2, input: [2, 3] - - - -_2_3->_2_4 - - - - - -_2_5 - -13     Range , input: [2, 2], rsm: [S_0, S_2] - - - -_2_4->_2_5 - - - - - -_2_6 - -14     Range , input: [2, 3], rsm: [S_2, S_3] - - - -_2_4->_2_6 - - - - - -_2_7 -15     Intermediate input: 0, rsm: S_1, input: [2, 2] - - - -_2_5->_2_7 - - - - - -_2_8 - -16     Terminal 'b', input: [2, 3] - - - -_2_6->_2_8 - - - - - -_2_9 - -17     Range , input: [2, 0], rsm: [S_0, S_1] - - - -_2_7->_2_9 - - - - - -_2_10 - -18     Range , input: [0, 2], rsm: [S_1, S_2] + + +_0_14->_0_18 + + - - -_2_7->_2_10 - - + + +_0_15->_0_2 + + - - -_2_11 - -19     Terminal 'a', input: [2, 0] - - - -_2_9->_2_11 - - - - - -_2_13 - -20     Nonterminal S, input: [0, 2] - - - -_2_10->_2_13 - - - - - -_2_23 - -3     Range , input: [1, 3], rsm: [S_0, S_2] - - - -_2_12->_2_23 - - - - - -_2_34 - -4     Range , input: [3, 2], rsm: [S_2, S_3] - - - -_2_12->_2_34 - - - - - -_2_14 - -21     Range , input: [0, 2], rsm: [S_0, S_3] - - - -_2_13->_2_14 - - - - - -_2_15 -22     Intermediate input: 3, rsm: S_2, input: [0, 2] - - - -_2_14->_2_15 - - - - - -_2_16 - -23     Range , input: [0, 3], rsm: [S_0, S_2] - - - -_2_15->_2_16 - - - - - -_2_15->_2_34 - - - - - -_2_17 -24     Intermediate input: 1, rsm: S_1, input: [0, 3] - - - -_2_16->_2_17 - - - - - -_2_18 - -25     Range , input: [0, 1], rsm: [S_0, S_1] - - - -_2_17->_2_18 - - - - - -_2_19 - -26     Range , input: [1, 3], rsm: [S_1, S_2] - - - -_2_17->_2_19 - - - - - -_2_20 - -27     Terminal 'a', input: [0, 1] - - - -_2_18->_2_20 - - - - - -_2_21 - -28     Nonterminal S, input: [1, 3] - - - -_2_19->_2_21 - - - - - -_2_22 - -29     Range , input: [1, 3], rsm: [S_0, S_3] - - - -_2_21->_2_22 - - - - - -_2_24 -30     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_2_22->_2_24 - - - - - -_2_25 -31     Intermediate input: 2, rsm: S_2, input: [1, 3] - - - -_2_22->_2_25 - - - - - -_2_44 -5     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_2_23->_2_44 - - - - - -_2_26 - -32     Range , input: [2, 3], rsm: [S_1, S_3] - - - -_2_24->_2_26 - - - - - -_2_46 - -7     Range , input: [1, 2], rsm: [S_0, S_1] - - - -_2_24->_2_46 - - - - - -_2_25->_2_6 - - - - - -_2_27 - -33     Range , input: [1, 2], rsm: [S_0, S_2] - - - -_2_25->_2_27 - - - - - -_2_26->_2_8 - - - - - -_2_28 -34     Intermediate input: 2, rsm: S_1, input: [1, 2] - - - -_2_27->_2_28 - - - - - -_2_29 - -35     Range , input: [2, 2], rsm: [S_1, S_2] - - - -_2_28->_2_29 - - - - - -_2_28->_2_46 - - - - - -_2_30 - -36     Nonterminal S, input: [2, 2] - - - -_2_29->_2_30 - - - - - -_2_31 - -37     Range , input: [2, 2], rsm: [S_0, S_3] - - - -_2_30->_2_31 - - - - - -_2_32 -38     Intermediate input: 3, rsm: S_2, input: [2, 2] - - - -_2_31->_2_32 - - - - - -_2_33 - -39     Range , input: [2, 3], rsm: [S_0, S_2] - - - -_2_32->_2_33 - - - - - -_2_32->_2_34 - - - - - -_2_35 -40     Intermediate input: 0, rsm: S_1, input: [2, 3] - - - -_2_33->_2_35 - - - - - -_2_45 - -6     Terminal 'b', input: [3, 2] - - - -_2_34->_2_45 - - - - - -_2_35->_2_9 - - - - - -_2_36 - -41     Range , input: [0, 3], rsm: [S_1, S_2] - - - -_2_35->_2_36 - - - - - -_2_37 - -42     Nonterminal S, input: [0, 3] - - - -_2_36->_2_37 - - - - - -_2_38 - -43     Range , input: [0, 3], rsm: [S_0, S_3] - - - -_2_37->_2_38 - - - - - -_2_39 -44     Intermediate input: 2, rsm: S_2, input: [0, 3] - - - -_2_38->_2_39 - - - - - -_2_39->_2_6 - - - - - -_2_40 - -45     Range , input: [0, 2], rsm: [S_0, S_2] - - - -_2_39->_2_40 - - - - - -_2_41 -46     Intermediate input: 1, rsm: S_1, input: [0, 2] - - - -_2_40->_2_41 - - - - - -_2_41->_2_18 - - - - - -_2_42 - -47     Range , input: [1, 2], rsm: [S_1, S_2] - - - -_2_41->_2_42 - - - - - -_2_43 - -48     Nonterminal S, input: [1, 2] - - - -_2_42->_2_43 - - - - - -_2_43->_2_1 - - - - - -_2_44->_2_46 - - - - - -_2_47 - -8     Range , input: [2, 3], rsm: [S_1, S_2] - - - -_2_44->_2_47 - - - - - -_2_48 - -9     Terminal 'a', input: [1, 2] - - - -_2_46->_2_48 - - - - - -_2_47->_2_2 - - - - - -_3_0 - -0     Nonterminal S, input: [1, 3] - - - -_3_1 - -1     Range , input: [1, 3], rsm: [S_0, S_3] - - - -_3_0->_3_1 - - - - - -_3_12 -2     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_3_1->_3_12 - - - - - -_3_23 -3     Intermediate input: 2, rsm: S_2, input: [1, 3] - - - -_3_1->_3_23 - - - - - -_3_2 -10     Intermediate input: 2, rsm: S_1, input: [1, 2] - - - -_3_3 - -11     Range , input: [2, 2], rsm: [S_1, S_2] - - - -_3_2->_3_3 - - - - - -_3_34 - -4     Range , input: [1, 2], rsm: [S_0, S_1] - - - -_3_2->_3_34 - - - - - -_3_4 - -12     Nonterminal S, input: [2, 2] - - - -_3_3->_3_4 - - - - - -_3_5 - -13     Range , input: [2, 2], rsm: [S_0, S_3] - - - -_3_4->_3_5 - - - - - -_3_6 -14     Intermediate input: 3, rsm: S_2, input: [2, 2] - - - -_3_5->_3_6 - - - - - -_3_7 - -15     Range , input: [2, 3], rsm: [S_0, S_2] - - - -_3_6->_3_7 - - - - - -_3_8 - -16     Range , input: [3, 2], rsm: [S_2, S_3] - - - -_3_6->_3_8 - - - - - -_3_9 -17     Intermediate input: 0, rsm: S_1, input: [2, 3] - - - -_3_7->_3_9 - - - - - -_3_10 - -18     Terminal 'b', input: [3, 2] - - - -_3_8->_3_10 - - - - - -_3_11 - -19     Range , input: [2, 0], rsm: [S_0, S_1] - - - -_3_9->_3_11 - - - - - -_3_13 - -20     Range , input: [0, 3], rsm: [S_1, S_2] - - - -_3_9->_3_13 - - - - - -_3_14 - -21     Terminal 'a', input: [2, 0] - - - -_3_11->_3_14 - - - - - -_3_12->_3_34 - - - - - -_3_44 - -5     Range , input: [2, 3], rsm: [S_1, S_3] - - - -_3_12->_3_44 - - - - - -_3_15 - -22     Nonterminal S, input: [0, 3] - - - -_3_13->_3_15 - - - - - -_3_16 - -23     Range , input: [0, 3], rsm: [S_0, S_3] - - - -_3_15->_3_16 - - - - - -_3_17 -24     Intermediate input: 2, rsm: S_2, input: [0, 3] - - - -_3_16->_3_17 - - - - - -_3_18 - -25     Range , input: [0, 2], rsm: [S_0, S_2] - - - -_3_17->_3_18 - - - - - -_3_46 - -7     Range , input: [2, 3], rsm: [S_2, S_3] - - - -_3_17->_3_46 - - - - - -_3_19 -26     Intermediate input: 1, rsm: S_1, input: [0, 2] - - - -_3_18->_3_19 - - - - - -_3_20 - -27     Range , input: [0, 1], rsm: [S_0, S_1] - - - -_3_19->_3_20 - - - - - -_3_21 - -28     Range , input: [1, 2], rsm: [S_1, S_2] - - - -_3_19->_3_21 - - - - - -_3_22 - -29     Terminal 'a', input: [0, 1] - - - -_3_20->_3_22 - - - - - -_3_24 - -30     Nonterminal S, input: [1, 2] - - - -_3_21->_3_24 - - - - - -_3_45 - -6     Range , input: [1, 2], rsm: [S_0, S_2] - - - -_3_23->_3_45 - - - - - -_3_23->_3_46 - - - - - -_3_25 - -31     Range , input: [1, 2], rsm: [S_0, S_3] - - - -_3_24->_3_25 - - - - - -_3_26 -32     Intermediate input: 3, rsm: S_2, input: [1, 2] - - - -_3_25->_3_26 - - - - - -_3_26->_3_8 - - - - - -_3_27 - -33     Range , input: [1, 3], rsm: [S_0, S_2] - - - -_3_26->_3_27 - - - - - -_3_28 -34     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_3_27->_3_28 - - - - - -_3_29 - -35     Range , input: [2, 3], rsm: [S_1, S_2] - - - -_3_28->_3_29 - - - - - -_3_28->_3_34 - - - - - -_3_30 - -36     Nonterminal S, input: [2, 3] - - - -_3_29->_3_30 - - - - - -_3_31 - -37     Range , input: [2, 3], rsm: [S_0, S_3] - - - -_3_30->_3_31 - - - - - -_3_32 -38     Intermediate input: 2, rsm: S_2, input: [2, 3] - - - -_3_31->_3_32 - - - - - -_3_33 - -39     Range , input: [2, 2], rsm: [S_0, S_2] - - - -_3_32->_3_33 - - - - - -_3_32->_3_46 - - - - - -_3_35 -40     Intermediate input: 0, rsm: S_1, input: [2, 2] - - - -_3_33->_3_35 - - - - - -_3_47 - -8     Terminal 'a', input: [1, 2] - - - -_3_34->_3_47 - - - - - -_3_35->_3_11 - - - - - -_3_36 - -41     Range , input: [0, 2], rsm: [S_1, S_2] - - - -_3_35->_3_36 - - - - - -_3_37 - -42     Nonterminal S, input: [0, 2] - - - -_3_36->_3_37 - - - - - -_3_38 - -43     Range , input: [0, 2], rsm: [S_0, S_3] - - - -_3_37->_3_38 - - - - - -_3_39 -44     Intermediate input: 3, rsm: S_2, input: [0, 2] - - - -_3_38->_3_39 - - - - - -_3_39->_3_8 - - - - - -_3_40 - -45     Range , input: [0, 3], rsm: [S_0, S_2] - - - -_3_39->_3_40 - - - - - -_3_41 -46     Intermediate input: 1, rsm: S_1, input: [0, 3] - - - -_3_40->_3_41 - - - - - -_3_41->_3_20 - - - - - -_3_42 - -47     Range , input: [1, 3], rsm: [S_1, S_2] - - - -_3_41->_3_42 - - - - - -_3_43 - -48     Nonterminal S, input: [1, 3] - - - -_3_42->_3_43 - - - - - -_3_43->_3_1 - - - - - -_3_48 - -9     Terminal 'b', input: [2, 3] - - - -_3_44->_3_48 - - - - - -_3_45->_3_2 - - - - - -_3_46->_3_48 - - - - - -_4_0 - -0     Nonterminal S, input: [2, 2] - - - -_4_1 - -1     Range , input: [2, 2], rsm: [S_0, S_3] - - - -_4_0->_4_1 - - - - - -_4_12 -2     Intermediate input: 3, rsm: S_2, input: [2, 2] - - - -_4_1->_4_12 - - - - - -_4_2 - -10     Nonterminal S, input: [0, 3] - - - -_4_3 - -11     Range , input: [0, 3], rsm: [S_0, S_3] - - - -_4_2->_4_3 - - - - - -_4_4 -12     Intermediate input: 2, rsm: S_2, input: [0, 3] - - - -_4_3->_4_4 - - - - - -_4_5 - -13     Range , input: [0, 2], rsm: [S_0, S_2] - - - -_4_4->_4_5 - - - - - -_4_6 - -14     Range , input: [2, 3], rsm: [S_2, S_3] - - - -_4_4->_4_6 - - - - - -_4_7 -15     Intermediate input: 1, rsm: S_1, input: [0, 2] - - - -_4_5->_4_7 - - - - - -_4_8 - -16     Terminal 'b', input: [2, 3] - - - -_4_6->_4_8 - - - - - -_4_9 - -17     Range , input: [0, 1], rsm: [S_0, S_1] - - - -_4_7->_4_9 - - - - - -_4_10 - -18     Range , input: [1, 2], rsm: [S_1, S_2] - - - -_4_7->_4_10 - - - - - -_4_11 - -19     Terminal 'a', input: [0, 1] - - - -_4_9->_4_11 - - - - - -_4_13 - -20     Nonterminal S, input: [1, 2] - - - -_4_10->_4_13 - - - - - -_4_23 - -3     Range , input: [2, 3], rsm: [S_0, S_2] - - - -_4_12->_4_23 - - - - - -_4_34 - -4     Range , input: [3, 2], rsm: [S_2, S_3] - - - -_4_12->_4_34 - - - - - -_4_14 - -21     Range , input: [1, 2], rsm: [S_0, S_3] - - - -_4_13->_4_14 - - - - - -_4_15 -22     Intermediate input: 3, rsm: S_2, input: [1, 2] - - - -_4_14->_4_15 - - - - - -_4_16 - -23     Range , input: [1, 3], rsm: [S_0, S_2] - - - -_4_15->_4_16 - - - - - -_4_15->_4_34 - - - - - -_4_17 -24     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_4_16->_4_17 - - - - - -_4_18 - -25     Range , input: [1, 2], rsm: [S_0, S_1] - - - -_4_17->_4_18 - - - - - -_4_19 - -26     Range , input: [2, 3], rsm: [S_1, S_2] - - - -_4_17->_4_19 - - - - - -_4_20 - -27     Terminal 'a', input: [1, 2] - - - -_4_18->_4_20 - - - - - -_4_21 - -28     Nonterminal S, input: [2, 3] - - - -_4_19->_4_21 - - - - - -_4_22 - -29     Range , input: [2, 3], rsm: [S_0, S_3] - - - -_4_21->_4_22 - - - - - -_4_24 -30     Intermediate input: 2, rsm: S_2, input: [2, 3] - - - -_4_22->_4_24 - - - - - -_4_44 -5     Intermediate input: 0, rsm: S_1, input: [2, 3] - - - -_4_23->_4_44 - - - - - -_4_24->_4_6 - - - - - -_4_25 - -31     Range , input: [2, 2], rsm: [S_0, S_2] - - - -_4_24->_4_25 - - - - - -_4_26 -32     Intermediate input: 0, rsm: S_1, input: [2, 2] - - - -_4_25->_4_26 - - - - - -_4_27 - -33     Range , input: [0, 2], rsm: [S_1, S_2] - - - -_4_26->_4_27 - - - - - -_4_46 - -7     Range , input: [2, 0], rsm: [S_0, S_1] - - - -_4_26->_4_46 - - - - - -_4_28 - -34     Nonterminal S, input: [0, 2] - - - -_4_27->_4_28 - - - - - -_4_29 - -35     Range , input: [0, 2], rsm: [S_0, S_3] - - - -_4_28->_4_29 - - - - - -_4_30 -36     Intermediate input: 3, rsm: S_2, input: [0, 2] - - - -_4_29->_4_30 - - - - - -_4_31 - -37     Range , input: [0, 3], rsm: [S_0, S_2] - - - -_4_30->_4_31 - - - - - -_4_30->_4_34 - - - - - -_4_32 -38     Intermediate input: 1, rsm: S_1, input: [0, 3] - - - -_4_31->_4_32 - - - - - -_4_32->_4_9 - - - - - -_4_33 - -39     Range , input: [1, 3], rsm: [S_1, S_2] - - - -_4_32->_4_33 - - - - - -_4_35 - -40     Nonterminal S, input: [1, 3] - - - -_4_33->_4_35 - - - - - -_4_45 - -6     Terminal 'b', input: [3, 2] - - - -_4_34->_4_45 - - - - - -_4_36 - -41     Range , input: [1, 3], rsm: [S_0, S_3] - - - -_4_35->_4_36 - - - - - -_4_37 -42     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_4_36->_4_37 - - - - - -_4_38 -43     Intermediate input: 2, rsm: S_2, input: [1, 3] - - - -_4_36->_4_38 - - - - - -_4_37->_4_18 - - - - - -_4_39 - -44     Range , input: [2, 3], rsm: [S_1, S_3] - - - -_4_37->_4_39 - - - - - -_4_38->_4_6 - - - - - -_4_40 - -45     Range , input: [1, 2], rsm: [S_0, S_2] - - - -_4_38->_4_40 - - - - - -_4_39->_4_8 - - - - - -_4_41 -46     Intermediate input: 2, rsm: S_1, input: [1, 2] - - - -_4_40->_4_41 - - - - - -_4_41->_4_18 - - - - - -_4_42 - -47     Range , input: [2, 2], rsm: [S_1, S_2] - - - -_4_41->_4_42 - - - - - -_4_43 - -48     Nonterminal S, input: [2, 2] - - - -_4_42->_4_43 - - - - - -_4_43->_4_1 - - - - - -_4_44->_4_46 - - - - - -_4_47 - -8     Range , input: [0, 3], rsm: [S_1, S_2] - - - -_4_44->_4_47 - - - - - -_4_48 - -9     Terminal 'a', input: [2, 0] - - - -_4_46->_4_48 - - - - - -_4_47->_4_2 - - - - - -_5_0 - -0     Nonterminal S, input: [2, 3] - - - -_5_1 - -1     Range , input: [2, 3], rsm: [S_0, S_3] - - - -_5_0->_5_1 - - - - - -_5_12 -2     Intermediate input: 2, rsm: S_2, input: [2, 3] - - - -_5_1->_5_12 - - - - - -_5_2 - -10     Nonterminal S, input: [0, 2] - - - -_5_3 - -11     Range , input: [0, 2], rsm: [S_0, S_3] - - - -_5_2->_5_3 - - - - - -_5_4 -12     Intermediate input: 3, rsm: S_2, input: [0, 2] - - - -_5_3->_5_4 - - - - - -_5_5 - -13     Range , input: [0, 3], rsm: [S_0, S_2] - - - -_5_4->_5_5 - - - - - -_5_6 - -14     Range , input: [3, 2], rsm: [S_2, S_3] - - - -_5_4->_5_6 - - - - - -_5_7 -15     Intermediate input: 1, rsm: S_1, input: [0, 3] - - - -_5_5->_5_7 - - - - - -_5_8 - -16     Terminal 'b', input: [3, 2] - - - -_5_6->_5_8 - - - - - -_5_9 - -17     Range , input: [0, 1], rsm: [S_0, S_1] - - - -_5_7->_5_9 - - - - - -_5_10 - -18     Range , input: [1, 3], rsm: [S_1, S_2] - - - -_5_7->_5_10 - - - - - -_5_11 - -19     Terminal 'a', input: [0, 1] - - - -_5_9->_5_11 - - - - - -_5_13 - -20     Nonterminal S, input: [1, 3] - - - -_5_10->_5_13 - - - - - -_5_23 - -3     Range , input: [2, 2], rsm: [S_0, S_2] - - - -_5_12->_5_23 - - - - - -_5_34 - -4     Range , input: [2, 3], rsm: [S_2, S_3] - - - -_5_12->_5_34 - - - - - -_5_14 - -21     Range , input: [1, 3], rsm: [S_0, S_3] - - - -_5_13->_5_14 - - - - - -_5_15 -22     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_5_14->_5_15 - - - - - -_5_16 -23     Intermediate input: 2, rsm: S_2, input: [1, 3] - - - -_5_14->_5_16 - - - - - -_5_17 - -24     Range , input: [1, 2], rsm: [S_0, S_1] - - - -_5_15->_5_17 - - - - - -_5_18 - -25     Range , input: [2, 3], rsm: [S_1, S_3] - - - -_5_15->_5_18 - - - - - -_5_19 - -26     Range , input: [1, 2], rsm: [S_0, S_2] - - - -_5_16->_5_19 - - - - - -_5_16->_5_34 - - - - - -_5_20 - -27     Terminal 'a', input: [1, 2] - - - -_5_17->_5_20 - - - - - -_5_45 - -6     Terminal 'b', input: [2, 3] - - - -_5_18->_5_45 - - - - - -_5_21 -28     Intermediate input: 2, rsm: S_1, input: [1, 2] - - - -_5_19->_5_21 - - - - - -_5_21->_5_17 - - - - - -_5_22 - -29     Range , input: [2, 2], rsm: [S_1, S_2] - - - -_5_21->_5_22 - - - - - -_5_24 - -30     Nonterminal S, input: [2, 2] - - - -_5_22->_5_24 - - - - - -_5_44 -5     Intermediate input: 0, rsm: S_1, input: [2, 2] - - - -_5_23->_5_44 - - - - - -_5_25 - -31     Range , input: [2, 2], rsm: [S_0, S_3] - - - -_5_24->_5_25 - - - - - -_5_26 -32     Intermediate input: 3, rsm: S_2, input: [2, 2] - - - -_5_25->_5_26 - - - - - -_5_26->_5_6 - - - - - -_5_27 - -33     Range , input: [2, 3], rsm: [S_0, S_2] - - - -_5_26->_5_27 - - - - - -_5_28 -34     Intermediate input: 0, rsm: S_1, input: [2, 3] - - - -_5_27->_5_28 - - - - - -_5_29 - -35     Range , input: [0, 3], rsm: [S_1, S_2] - - - -_5_28->_5_29 - - - - - -_5_46 - -7     Range , input: [2, 0], rsm: [S_0, S_1] - - - -_5_28->_5_46 - - - - - -_5_30 - -36     Nonterminal S, input: [0, 3] - - - -_5_29->_5_30 - - - - - -_5_31 - -37     Range , input: [0, 3], rsm: [S_0, S_3] - - - -_5_30->_5_31 - - - - - -_5_32 -38     Intermediate input: 2, rsm: S_2, input: [0, 3] - - - -_5_31->_5_32 - - - - - -_5_33 - -39     Range , input: [0, 2], rsm: [S_0, S_2] - - - -_5_32->_5_33 - - - - - -_5_32->_5_34 - - - - - -_5_35 -40     Intermediate input: 1, rsm: S_1, input: [0, 2] - - - -_5_33->_5_35 - - - - - -_5_34->_5_45 - - - - - -_5_35->_5_9 - - - - - -_5_36 - -41     Range , input: [1, 2], rsm: [S_1, S_2] - - - -_5_35->_5_36 - - - - - -_5_37 - -42     Nonterminal S, input: [1, 2] - - - -_5_36->_5_37 - - - - - -_5_38 - -43     Range , input: [1, 2], rsm: [S_0, S_3] - - - -_5_37->_5_38 - - - - - -_5_39 -44     Intermediate input: 3, rsm: S_2, input: [1, 2] - - - -_5_38->_5_39 - - - - - -_5_39->_5_6 - - - - - -_5_40 - -45     Range , input: [1, 3], rsm: [S_0, S_2] - - - -_5_39->_5_40 - - - - - -_5_41 -46     Intermediate input: 2, rsm: S_1, input: [1, 3] - - - -_5_40->_5_41 - - - - - -_5_41->_5_17 - - - - - -_5_42 - -47     Range , input: [2, 3], rsm: [S_1, S_2] - - - -_5_41->_5_42 - - - - - -_5_43 - -48     Nonterminal S, input: [2, 3] - - - -_5_42->_5_43 - - - - - -_5_43->_5_1 - - - - - -_5_44->_5_46 - - - - - -_5_47 - -8     Range , input: [0, 2], rsm: [S_1, S_2] - - - -_5_44->_5_47 - - - - - -_5_48 - -9     Terminal 'a', input: [2, 0] - - - -_5_46->_5_48 - - - - - -_5_47->_5_2 - - + + +_0_16->_0_18 + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot new file mode 100644 index 000000000..a276cb960 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot @@ -0,0 +1,7 @@ +digraph { + start -> 0; + 0 -> 1 [label = "a"]; + 1 -> 0 [label = "a"]; + 1 -> 1 [label = "b"]; + +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg new file mode 100644 index 000000000..a68fd2896 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg @@ -0,0 +1,58 @@ + + + + + + +%3 + + + +start + +start + + + +0 + +0 + + + +start->0 + + + + + +1 + +1 + + + +0->1 + + +a + + + +1->0 + + +a + + + +1->1 + + +b + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot new file mode 100644 index 000000000..957352329 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot @@ -0,0 +1,54 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] +_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_12 +_0_1->_0_14 +_0_2->_0_15 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_18 +_0_7->_0_8 +_0_8->_0_9 +_0_8->_0_10 +_0_9->_0_11 +_0_10->_0_13 +_0_12->_0_15 +_0_12->_0_16 +_0_13->_0_1 +_0_14->_0_17 +_0_14->_0_18 +_0_15->_0_19 +_0_16->_0_20 +_0_17->_0_2 +_0_18->_0_20 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg new file mode 100644 index 000000000..9849576ec --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg @@ -0,0 +1,282 @@ + + + + + + +g + + +cluster_0 + + + + +_0_0 + +0     Nonterminal S, input: [0, 1] + + + +_0_1 + +1     Range , input: [0, 1], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_12 +2     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + +_0_1->_0_12 + + + + + +_0_14 +3     Intermediate input: 1, rsm: S_2, input: [0, 1] + + + +_0_1->_0_14 + + + + + +_0_2 +10     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + +_0_3 + +11     Range , input: [1, 1], rsm: [S_1, S_2] + + + +_0_2->_0_3 + + + + + +_0_15 + +4     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_2->_0_15 + + + + + +_0_4 + +12     Nonterminal S, input: [1, 1] + + + +_0_3->_0_4 + + + + + +_0_5 + +13     Range , input: [1, 1], rsm: [S_0, S_3] + + + +_0_4->_0_5 + + + + + +_0_6 +14     Intermediate input: 1, rsm: S_2, input: [1, 1] + + + +_0_5->_0_6 + + + + + +_0_7 + +15     Range , input: [1, 1], rsm: [S_0, S_2] + + + +_0_6->_0_7 + + + + + +_0_18 + +7     Range , input: [1, 1], rsm: [S_2, S_3] + + + +_0_6->_0_18 + + + + + +_0_8 +16     Intermediate input: 0, rsm: S_1, input: [1, 1] + + + +_0_7->_0_8 + + + + + +_0_9 + +17     Range , input: [1, 0], rsm: [S_0, S_1] + + + +_0_8->_0_9 + + + + + +_0_10 + +18     Range , input: [0, 1], rsm: [S_1, S_2] + + + +_0_8->_0_10 + + + + + +_0_11 + +19     Terminal 'a', input: [1, 0] + + + +_0_9->_0_11 + + + + + +_0_13 + +20     Nonterminal S, input: [0, 1] + + + +_0_10->_0_13 + + + + + +_0_12->_0_15 + + + + + +_0_16 + +5     Range , input: [1, 1], rsm: [S_1, S_3] + + + +_0_12->_0_16 + + + + + +_0_13->_0_1 + + + + + +_0_17 + +6     Range , input: [0, 1], rsm: [S_0, S_2] + + + +_0_14->_0_17 + + + + + +_0_14->_0_18 + + + + + +_0_19 + +8     Terminal 'a', input: [0, 1] + + + +_0_15->_0_19 + + + + + +_0_20 + +9     Terminal 'b', input: [1, 1] + + + +_0_16->_0_20 + + + + + +_0_17->_0_2 + + + + + +_0_18->_0_20 + + + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot new file mode 100644 index 000000000..2e845e0ea --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot @@ -0,0 +1,11 @@ +digraph { + start -> 0; + start -> 1; + start -> 2; + 0 -> 1 [label = "a"]; + 1 -> 2 [label = "a"]; + 2 -> 3 [label = "b"]; + 3 -> 2 [label = "b"]; + 2 -> 0 [label = "a"]; + +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg new file mode 100644 index 000000000..511a10387 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg @@ -0,0 +1,96 @@ + + + + + + +%3 + + + +start + +start + + + +0 + +0 + + + +start->0 + + + + + +1 + +1 + + + +start->1 + + + + + +2 + +2 + + + +start->2 + + + + + +0->1 + + +a + + + +1->2 + + +a + + + +2->0 + + +a + + + +3 + +3 + + + +2->3 + + +b + + + +3->2 + + +b + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot rename to cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg new file mode 100644 index 000000000..27dec8ae1 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg @@ -0,0 +1,3811 @@ + + + + + + +g + + +cluster_0 + + + +cluster_1 + + + +cluster_2 + + + +cluster_3 + + + +cluster_4 + + + +cluster_5 + + + + +_0_0 + +0     Nonterminal S, input: [0, 2] + + + +_0_1 + +1     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_12 +2     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_0_1->_0_12 + + + + + +_0_2 + +10     Nonterminal S, input: [1, 3] + + + +_0_3 + +11     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_0_2->_0_3 + + + + + +_0_4 +12     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_0_3->_0_4 + + + + + +_0_5 +13     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_0_3->_0_5 + + + + + +_0_6 + +14     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_0_4->_0_6 + + + + + +_0_7 + +15     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_0_4->_0_7 + + + + + +_0_8 + +16     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_0_5->_0_8 + + + + + +_0_9 + +17     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_0_5->_0_9 + + + + + +_0_10 + +18     Terminal 'a', input: [1, 2] + + + +_0_6->_0_10 + + + + + +_0_11 + +19     Terminal 'b', input: [2, 3] + + + +_0_7->_0_11 + + + + + +_0_13 +20     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_0_8->_0_13 + + + + + +_0_9->_0_11 + + + + + +_0_23 + +3     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_0_12->_0_23 + + + + + +_0_34 + +4     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_0_12->_0_34 + + + + + +_0_13->_0_6 + + + + + +_0_14 + +21     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_0_13->_0_14 + + + + + +_0_15 + +22     Nonterminal S, input: [2, 2] + + + +_0_14->_0_15 + + + + + +_0_16 + +23     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_0_15->_0_16 + + + + + +_0_17 +24     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_0_16->_0_17 + + + + + +_0_18 + +25     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_0_17->_0_18 + + + + + +_0_17->_0_34 + + + + + +_0_19 +26     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_0_18->_0_19 + + + + + +_0_20 + +27     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_0_19->_0_20 + + + + + +_0_21 + +28     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_0_19->_0_21 + + + + + +_0_22 + +29     Terminal 'a', input: [2, 0] + + + +_0_20->_0_22 + + + + + +_0_24 + +30     Nonterminal S, input: [0, 3] + + + +_0_21->_0_24 + + + + + +_0_44 +5     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_0_23->_0_44 + + + + + +_0_25 + +31     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_0_24->_0_25 + + + + + +_0_26 +32     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_0_25->_0_26 + + + + + +_0_26->_0_9 + + + + + +_0_27 + +33     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_0_26->_0_27 + + + + + +_0_28 +34     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_0_27->_0_28 + + + + + +_0_29 + +35     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_0_28->_0_29 + + + + + +_0_46 + +7     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_28->_0_46 + + + + + +_0_30 + +36     Nonterminal S, input: [1, 2] + + + +_0_29->_0_30 + + + + + +_0_31 + +37     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_0_30->_0_31 + + + + + +_0_32 +38     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_0_31->_0_32 + + + + + +_0_33 + +39     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_0_32->_0_33 + + + + + +_0_32->_0_34 + + + + + +_0_35 +40     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_0_33->_0_35 + + + + + +_0_45 + +6     Terminal 'b', input: [3, 2] + + + +_0_34->_0_45 + + + + + +_0_35->_0_6 + + + + + +_0_36 + +41     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_0_35->_0_36 + + + + + +_0_37 + +42     Nonterminal S, input: [2, 3] + + + +_0_36->_0_37 + + + + + +_0_38 + +43     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_0_37->_0_38 + + + + + +_0_39 +44     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_0_38->_0_39 + + + + + +_0_39->_0_9 + + + + + +_0_40 + +45     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_0_39->_0_40 + + + + + +_0_41 +46     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_0_40->_0_41 + + + + + +_0_41->_0_20 + + + + + +_0_42 + +47     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_0_41->_0_42 + + + + + +_0_43 + +48     Nonterminal S, input: [0, 2] + + + +_0_42->_0_43 + + + + + +_0_43->_0_1 + + + + + +_0_44->_0_46 + + + + + +_0_47 + +8     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_0_44->_0_47 + + + + + +_0_48 + +9     Terminal 'a', input: [0, 1] + + + +_0_46->_0_48 + + + + + +_0_47->_0_2 + + + + + +_1_0 + +0     Nonterminal S, input: [0, 3] + + + +_1_1 + +1     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_1_0->_1_1 + + + + + +_1_12 +2     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_1_1->_1_12 + + + + + +_1_2 + +10     Nonterminal S, input: [1, 2] + + + +_1_3 + +11     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_1_2->_1_3 + + + + + +_1_4 +12     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_1_3->_1_4 + + + + + +_1_5 + +13     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_1_4->_1_5 + + + + + +_1_6 + +14     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_1_4->_1_6 + + + + + +_1_7 +15     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_1_5->_1_7 + + + + + +_1_8 + +16     Terminal 'b', input: [3, 2] + + + +_1_6->_1_8 + + + + + +_1_9 + +17     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_1_7->_1_9 + + + + + +_1_10 + +18     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_1_7->_1_10 + + + + + +_1_11 + +19     Terminal 'a', input: [1, 2] + + + +_1_9->_1_11 + + + + + +_1_13 + +20     Nonterminal S, input: [2, 3] + + + +_1_10->_1_13 + + + + + +_1_23 + +3     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_1_12->_1_23 + + + + + +_1_34 + +4     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_1_12->_1_34 + + + + + +_1_14 + +21     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_1_13->_1_14 + + + + + +_1_15 +22     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_1_14->_1_15 + + + + + +_1_16 + +23     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_1_15->_1_16 + + + + + +_1_15->_1_34 + + + + + +_1_17 +24     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_1_16->_1_17 + + + + + +_1_18 + +25     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_1_17->_1_18 + + + + + +_1_19 + +26     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_1_17->_1_19 + + + + + +_1_20 + +27     Terminal 'a', input: [2, 0] + + + +_1_18->_1_20 + + + + + +_1_21 + +28     Nonterminal S, input: [0, 2] + + + +_1_19->_1_21 + + + + + +_1_22 + +29     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_1_21->_1_22 + + + + + +_1_24 +30     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_1_22->_1_24 + + + + + +_1_44 +5     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_1_23->_1_44 + + + + + +_1_24->_1_6 + + + + + +_1_25 + +31     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_1_24->_1_25 + + + + + +_1_26 +32     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_1_25->_1_26 + + + + + +_1_27 + +33     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_1_26->_1_27 + + + + + +_1_46 + +7     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_1_26->_1_46 + + + + + +_1_28 + +34     Nonterminal S, input: [1, 3] + + + +_1_27->_1_28 + + + + + +_1_29 + +35     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_1_28->_1_29 + + + + + +_1_30 +36     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_1_29->_1_30 + + + + + +_1_31 +37     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_1_29->_1_31 + + + + + +_1_30->_1_9 + + + + + +_1_32 + +38     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_1_30->_1_32 + + + + + +_1_33 + +39     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_1_31->_1_33 + + + + + +_1_31->_1_34 + + + + + +_1_45 + +6     Terminal 'b', input: [2, 3] + + + +_1_32->_1_45 + + + + + +_1_35 +40     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_1_33->_1_35 + + + + + +_1_34->_1_45 + + + + + +_1_35->_1_9 + + + + + +_1_36 + +41     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_1_35->_1_36 + + + + + +_1_37 + +42     Nonterminal S, input: [2, 2] + + + +_1_36->_1_37 + + + + + +_1_38 + +43     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_1_37->_1_38 + + + + + +_1_39 +44     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_1_38->_1_39 + + + + + +_1_39->_1_6 + + + + + +_1_40 + +45     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_1_39->_1_40 + + + + + +_1_41 +46     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_1_40->_1_41 + + + + + +_1_41->_1_18 + + + + + +_1_42 + +47     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_1_41->_1_42 + + + + + +_1_43 + +48     Nonterminal S, input: [0, 3] + + + +_1_42->_1_43 + + + + + +_1_43->_1_1 + + + + + +_1_44->_1_46 + + + + + +_1_47 + +8     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_1_44->_1_47 + + + + + +_1_48 + +9     Terminal 'a', input: [0, 1] + + + +_1_46->_1_48 + + + + + +_1_47->_1_2 + + + + + +_2_0 + +0     Nonterminal S, input: [1, 2] + + + +_2_1 + +1     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_2_0->_2_1 + + + + + +_2_12 +2     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_2_1->_2_12 + + + + + +_2_2 + +10     Nonterminal S, input: [2, 3] + + + +_2_3 + +11     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_2_2->_2_3 + + + + + +_2_4 +12     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_2_3->_2_4 + + + + + +_2_5 + +13     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_2_4->_2_5 + + + + + +_2_6 + +14     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_2_4->_2_6 + + + + + +_2_7 +15     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_2_5->_2_7 + + + + + +_2_8 + +16     Terminal 'b', input: [2, 3] + + + +_2_6->_2_8 + + + + + +_2_9 + +17     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_2_7->_2_9 + + + + + +_2_10 + +18     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_2_7->_2_10 + + + + + +_2_11 + +19     Terminal 'a', input: [2, 0] + + + +_2_9->_2_11 + + + + + +_2_13 + +20     Nonterminal S, input: [0, 2] + + + +_2_10->_2_13 + + + + + +_2_23 + +3     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_2_12->_2_23 + + + + + +_2_34 + +4     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_2_12->_2_34 + + + + + +_2_14 + +21     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_2_13->_2_14 + + + + + +_2_15 +22     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_2_14->_2_15 + + + + + +_2_16 + +23     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_2_15->_2_16 + + + + + +_2_15->_2_34 + + + + + +_2_17 +24     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_2_16->_2_17 + + + + + +_2_18 + +25     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_2_17->_2_18 + + + + + +_2_19 + +26     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_2_17->_2_19 + + + + + +_2_20 + +27     Terminal 'a', input: [0, 1] + + + +_2_18->_2_20 + + + + + +_2_21 + +28     Nonterminal S, input: [1, 3] + + + +_2_19->_2_21 + + + + + +_2_22 + +29     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_2_21->_2_22 + + + + + +_2_24 +30     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_2_22->_2_24 + + + + + +_2_25 +31     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_2_22->_2_25 + + + + + +_2_44 +5     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_2_23->_2_44 + + + + + +_2_26 + +32     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_2_24->_2_26 + + + + + +_2_46 + +7     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_2_24->_2_46 + + + + + +_2_25->_2_6 + + + + + +_2_27 + +33     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_2_25->_2_27 + + + + + +_2_26->_2_8 + + + + + +_2_28 +34     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_2_27->_2_28 + + + + + +_2_29 + +35     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_2_28->_2_29 + + + + + +_2_28->_2_46 + + + + + +_2_30 + +36     Nonterminal S, input: [2, 2] + + + +_2_29->_2_30 + + + + + +_2_31 + +37     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_2_30->_2_31 + + + + + +_2_32 +38     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_2_31->_2_32 + + + + + +_2_33 + +39     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_2_32->_2_33 + + + + + +_2_32->_2_34 + + + + + +_2_35 +40     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_2_33->_2_35 + + + + + +_2_45 + +6     Terminal 'b', input: [3, 2] + + + +_2_34->_2_45 + + + + + +_2_35->_2_9 + + + + + +_2_36 + +41     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_2_35->_2_36 + + + + + +_2_37 + +42     Nonterminal S, input: [0, 3] + + + +_2_36->_2_37 + + + + + +_2_38 + +43     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_2_37->_2_38 + + + + + +_2_39 +44     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_2_38->_2_39 + + + + + +_2_39->_2_6 + + + + + +_2_40 + +45     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_2_39->_2_40 + + + + + +_2_41 +46     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_2_40->_2_41 + + + + + +_2_41->_2_18 + + + + + +_2_42 + +47     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_2_41->_2_42 + + + + + +_2_43 + +48     Nonterminal S, input: [1, 2] + + + +_2_42->_2_43 + + + + + +_2_43->_2_1 + + + + + +_2_44->_2_46 + + + + + +_2_47 + +8     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_2_44->_2_47 + + + + + +_2_48 + +9     Terminal 'a', input: [1, 2] + + + +_2_46->_2_48 + + + + + +_2_47->_2_2 + + + + + +_3_0 + +0     Nonterminal S, input: [1, 3] + + + +_3_1 + +1     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_3_0->_3_1 + + + + + +_3_12 +2     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_3_1->_3_12 + + + + + +_3_23 +3     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_3_1->_3_23 + + + + + +_3_2 +10     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_3_3 + +11     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_3_2->_3_3 + + + + + +_3_34 + +4     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_3_2->_3_34 + + + + + +_3_4 + +12     Nonterminal S, input: [2, 2] + + + +_3_3->_3_4 + + + + + +_3_5 + +13     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_3_4->_3_5 + + + + + +_3_6 +14     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_3_5->_3_6 + + + + + +_3_7 + +15     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_3_6->_3_7 + + + + + +_3_8 + +16     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_3_6->_3_8 + + + + + +_3_9 +17     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_3_7->_3_9 + + + + + +_3_10 + +18     Terminal 'b', input: [3, 2] + + + +_3_8->_3_10 + + + + + +_3_11 + +19     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_3_9->_3_11 + + + + + +_3_13 + +20     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_3_9->_3_13 + + + + + +_3_14 + +21     Terminal 'a', input: [2, 0] + + + +_3_11->_3_14 + + + + + +_3_12->_3_34 + + + + + +_3_44 + +5     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_3_12->_3_44 + + + + + +_3_15 + +22     Nonterminal S, input: [0, 3] + + + +_3_13->_3_15 + + + + + +_3_16 + +23     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_3_15->_3_16 + + + + + +_3_17 +24     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_3_16->_3_17 + + + + + +_3_18 + +25     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_3_17->_3_18 + + + + + +_3_46 + +7     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_3_17->_3_46 + + + + + +_3_19 +26     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_3_18->_3_19 + + + + + +_3_20 + +27     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_3_19->_3_20 + + + + + +_3_21 + +28     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_3_19->_3_21 + + + + + +_3_22 + +29     Terminal 'a', input: [0, 1] + + + +_3_20->_3_22 + + + + + +_3_24 + +30     Nonterminal S, input: [1, 2] + + + +_3_21->_3_24 + + + + + +_3_45 + +6     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_3_23->_3_45 + + + + + +_3_23->_3_46 + + + + + +_3_25 + +31     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_3_24->_3_25 + + + + + +_3_26 +32     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_3_25->_3_26 + + + + + +_3_26->_3_8 + + + + + +_3_27 + +33     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_3_26->_3_27 + + + + + +_3_28 +34     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_3_27->_3_28 + + + + + +_3_29 + +35     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_3_28->_3_29 + + + + + +_3_28->_3_34 + + + + + +_3_30 + +36     Nonterminal S, input: [2, 3] + + + +_3_29->_3_30 + + + + + +_3_31 + +37     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_3_30->_3_31 + + + + + +_3_32 +38     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_3_31->_3_32 + + + + + +_3_33 + +39     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_3_32->_3_33 + + + + + +_3_32->_3_46 + + + + + +_3_35 +40     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_3_33->_3_35 + + + + + +_3_47 + +8     Terminal 'a', input: [1, 2] + + + +_3_34->_3_47 + + + + + +_3_35->_3_11 + + + + + +_3_36 + +41     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_3_35->_3_36 + + + + + +_3_37 + +42     Nonterminal S, input: [0, 2] + + + +_3_36->_3_37 + + + + + +_3_38 + +43     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_3_37->_3_38 + + + + + +_3_39 +44     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_3_38->_3_39 + + + + + +_3_39->_3_8 + + + + + +_3_40 + +45     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_3_39->_3_40 + + + + + +_3_41 +46     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_3_40->_3_41 + + + + + +_3_41->_3_20 + + + + + +_3_42 + +47     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_3_41->_3_42 + + + + + +_3_43 + +48     Nonterminal S, input: [1, 3] + + + +_3_42->_3_43 + + + + + +_3_43->_3_1 + + + + + +_3_48 + +9     Terminal 'b', input: [2, 3] + + + +_3_44->_3_48 + + + + + +_3_45->_3_2 + + + + + +_3_46->_3_48 + + + + + +_4_0 + +0     Nonterminal S, input: [2, 2] + + + +_4_1 + +1     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_4_0->_4_1 + + + + + +_4_12 +2     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_4_1->_4_12 + + + + + +_4_2 + +10     Nonterminal S, input: [0, 3] + + + +_4_3 + +11     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_4_2->_4_3 + + + + + +_4_4 +12     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_4_3->_4_4 + + + + + +_4_5 + +13     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_4_4->_4_5 + + + + + +_4_6 + +14     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_4_4->_4_6 + + + + + +_4_7 +15     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_4_5->_4_7 + + + + + +_4_8 + +16     Terminal 'b', input: [2, 3] + + + +_4_6->_4_8 + + + + + +_4_9 + +17     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_4_7->_4_9 + + + + + +_4_10 + +18     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_4_7->_4_10 + + + + + +_4_11 + +19     Terminal 'a', input: [0, 1] + + + +_4_9->_4_11 + + + + + +_4_13 + +20     Nonterminal S, input: [1, 2] + + + +_4_10->_4_13 + + + + + +_4_23 + +3     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_4_12->_4_23 + + + + + +_4_34 + +4     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_4_12->_4_34 + + + + + +_4_14 + +21     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_4_13->_4_14 + + + + + +_4_15 +22     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_4_14->_4_15 + + + + + +_4_16 + +23     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_4_15->_4_16 + + + + + +_4_15->_4_34 + + + + + +_4_17 +24     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_4_16->_4_17 + + + + + +_4_18 + +25     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_4_17->_4_18 + + + + + +_4_19 + +26     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_4_17->_4_19 + + + + + +_4_20 + +27     Terminal 'a', input: [1, 2] + + + +_4_18->_4_20 + + + + + +_4_21 + +28     Nonterminal S, input: [2, 3] + + + +_4_19->_4_21 + + + + + +_4_22 + +29     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_4_21->_4_22 + + + + + +_4_24 +30     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_4_22->_4_24 + + + + + +_4_44 +5     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_4_23->_4_44 + + + + + +_4_24->_4_6 + + + + + +_4_25 + +31     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_4_24->_4_25 + + + + + +_4_26 +32     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_4_25->_4_26 + + + + + +_4_27 + +33     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_4_26->_4_27 + + + + + +_4_46 + +7     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_4_26->_4_46 + + + + + +_4_28 + +34     Nonterminal S, input: [0, 2] + + + +_4_27->_4_28 + + + + + +_4_29 + +35     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_4_28->_4_29 + + + + + +_4_30 +36     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_4_29->_4_30 + + + + + +_4_31 + +37     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_4_30->_4_31 + + + + + +_4_30->_4_34 + + + + + +_4_32 +38     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_4_31->_4_32 + + + + + +_4_32->_4_9 + + + + + +_4_33 + +39     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_4_32->_4_33 + + + + + +_4_35 + +40     Nonterminal S, input: [1, 3] + + + +_4_33->_4_35 + + + + + +_4_45 + +6     Terminal 'b', input: [3, 2] + + + +_4_34->_4_45 + + + + + +_4_36 + +41     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_4_35->_4_36 + + + + + +_4_37 +42     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_4_36->_4_37 + + + + + +_4_38 +43     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_4_36->_4_38 + + + + + +_4_37->_4_18 + + + + + +_4_39 + +44     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_4_37->_4_39 + + + + + +_4_38->_4_6 + + + + + +_4_40 + +45     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_4_38->_4_40 + + + + + +_4_39->_4_8 + + + + + +_4_41 +46     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_4_40->_4_41 + + + + + +_4_41->_4_18 + + + + + +_4_42 + +47     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_4_41->_4_42 + + + + + +_4_43 + +48     Nonterminal S, input: [2, 2] + + + +_4_42->_4_43 + + + + + +_4_43->_4_1 + + + + + +_4_44->_4_46 + + + + + +_4_47 + +8     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_4_44->_4_47 + + + + + +_4_48 + +9     Terminal 'a', input: [2, 0] + + + +_4_46->_4_48 + + + + + +_4_47->_4_2 + + + + + +_5_0 + +0     Nonterminal S, input: [2, 3] + + + +_5_1 + +1     Range , input: [2, 3], rsm: [S_0, S_3] + + + +_5_0->_5_1 + + + + + +_5_12 +2     Intermediate input: 2, rsm: S_2, input: [2, 3] + + + +_5_1->_5_12 + + + + + +_5_2 + +10     Nonterminal S, input: [0, 2] + + + +_5_3 + +11     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_5_2->_5_3 + + + + + +_5_4 +12     Intermediate input: 3, rsm: S_2, input: [0, 2] + + + +_5_3->_5_4 + + + + + +_5_5 + +13     Range , input: [0, 3], rsm: [S_0, S_2] + + + +_5_4->_5_5 + + + + + +_5_6 + +14     Range , input: [3, 2], rsm: [S_2, S_3] + + + +_5_4->_5_6 + + + + + +_5_7 +15     Intermediate input: 1, rsm: S_1, input: [0, 3] + + + +_5_5->_5_7 + + + + + +_5_8 + +16     Terminal 'b', input: [3, 2] + + + +_5_6->_5_8 + + + + + +_5_9 + +17     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_5_7->_5_9 + + + + + +_5_10 + +18     Range , input: [1, 3], rsm: [S_1, S_2] + + + +_5_7->_5_10 + + + + + +_5_11 + +19     Terminal 'a', input: [0, 1] + + + +_5_9->_5_11 + + + + + +_5_13 + +20     Nonterminal S, input: [1, 3] + + + +_5_10->_5_13 + + + + + +_5_23 + +3     Range , input: [2, 2], rsm: [S_0, S_2] + + + +_5_12->_5_23 + + + + + +_5_34 + +4     Range , input: [2, 3], rsm: [S_2, S_3] + + + +_5_12->_5_34 + + + + + +_5_14 + +21     Range , input: [1, 3], rsm: [S_0, S_3] + + + +_5_13->_5_14 + + + + + +_5_15 +22     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_5_14->_5_15 + + + + + +_5_16 +23     Intermediate input: 2, rsm: S_2, input: [1, 3] + + + +_5_14->_5_16 + + + + + +_5_17 + +24     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_5_15->_5_17 + + + + + +_5_18 + +25     Range , input: [2, 3], rsm: [S_1, S_3] + + + +_5_15->_5_18 + + + + + +_5_19 + +26     Range , input: [1, 2], rsm: [S_0, S_2] + + + +_5_16->_5_19 + + + + + +_5_16->_5_34 + + + + + +_5_20 + +27     Terminal 'a', input: [1, 2] + + + +_5_17->_5_20 + + + + + +_5_45 + +6     Terminal 'b', input: [2, 3] + + + +_5_18->_5_45 + + + + + +_5_21 +28     Intermediate input: 2, rsm: S_1, input: [1, 2] + + + +_5_19->_5_21 + + + + + +_5_21->_5_17 + + + + + +_5_22 + +29     Range , input: [2, 2], rsm: [S_1, S_2] + + + +_5_21->_5_22 + + + + + +_5_24 + +30     Nonterminal S, input: [2, 2] + + + +_5_22->_5_24 + + + + + +_5_44 +5     Intermediate input: 0, rsm: S_1, input: [2, 2] + + + +_5_23->_5_44 + + + + + +_5_25 + +31     Range , input: [2, 2], rsm: [S_0, S_3] + + + +_5_24->_5_25 + + + + + +_5_26 +32     Intermediate input: 3, rsm: S_2, input: [2, 2] + + + +_5_25->_5_26 + + + + + +_5_26->_5_6 + + + + + +_5_27 + +33     Range , input: [2, 3], rsm: [S_0, S_2] + + + +_5_26->_5_27 + + + + + +_5_28 +34     Intermediate input: 0, rsm: S_1, input: [2, 3] + + + +_5_27->_5_28 + + + + + +_5_29 + +35     Range , input: [0, 3], rsm: [S_1, S_2] + + + +_5_28->_5_29 + + + + + +_5_46 + +7     Range , input: [2, 0], rsm: [S_0, S_1] + + + +_5_28->_5_46 + + + + + +_5_30 + +36     Nonterminal S, input: [0, 3] + + + +_5_29->_5_30 + + + + + +_5_31 + +37     Range , input: [0, 3], rsm: [S_0, S_3] + + + +_5_30->_5_31 + + + + + +_5_32 +38     Intermediate input: 2, rsm: S_2, input: [0, 3] + + + +_5_31->_5_32 + + + + + +_5_33 + +39     Range , input: [0, 2], rsm: [S_0, S_2] + + + +_5_32->_5_33 + + + + + +_5_32->_5_34 + + + + + +_5_35 +40     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_5_33->_5_35 + + + + + +_5_34->_5_45 + + + + + +_5_35->_5_9 + + + + + +_5_36 + +41     Range , input: [1, 2], rsm: [S_1, S_2] + + + +_5_35->_5_36 + + + + + +_5_37 + +42     Nonterminal S, input: [1, 2] + + + +_5_36->_5_37 + + + + + +_5_38 + +43     Range , input: [1, 2], rsm: [S_0, S_3] + + + +_5_37->_5_38 + + + + + +_5_39 +44     Intermediate input: 3, rsm: S_2, input: [1, 2] + + + +_5_38->_5_39 + + + + + +_5_39->_5_6 + + + + + +_5_40 + +45     Range , input: [1, 3], rsm: [S_0, S_2] + + + +_5_39->_5_40 + + + + + +_5_41 +46     Intermediate input: 2, rsm: S_1, input: [1, 3] + + + +_5_40->_5_41 + + + + + +_5_41->_5_17 + + + + + +_5_42 + +47     Range , input: [2, 3], rsm: [S_1, S_2] + + + +_5_41->_5_42 + + + + + +_5_43 + +48     Nonterminal S, input: [2, 3] + + + +_5_42->_5_43 + + + + + +_5_43->_5_1 + + + + + +_5_44->_5_46 + + + + + +_5_47 + +8     Range , input: [0, 2], rsm: [S_1, S_2] + + + +_5_44->_5_47 + + + + + +_5_48 + +9     Terminal 'a', input: [2, 0] + + + +_5_46->_5_48 + + + + + +_5_47->_5_2 + + + + + diff --git a/cfpq-paths-app/src/main/resources/example_1_graph.dot b/cfpq-paths-app/src/main/resources/example_1_graph.dot index 2e845e0ea..4b60207ce 100644 --- a/cfpq-paths-app/src/main/resources/example_1_graph.dot +++ b/cfpq-paths-app/src/main/resources/example_1_graph.dot @@ -1,11 +1,8 @@ digraph { start -> 0; - start -> 1; - start -> 2; 0 -> 1 [label = "a"]; 1 -> 2 [label = "a"]; - 2 -> 3 [label = "b"]; - 3 -> 2 [label = "b"]; - 2 -> 0 [label = "a"]; + 1 -> 2 [label = "b"]; + 2 -> 1 [label = "b"]; } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/example_2_graph.dot b/cfpq-paths-app/src/main/resources/example_2_graph.dot new file mode 100644 index 000000000..a276cb960 --- /dev/null +++ b/cfpq-paths-app/src/main/resources/example_2_graph.dot @@ -0,0 +1,7 @@ +digraph { + start -> 0; + 0 -> 1 [label = "a"]; + 1 -> 0 [label = "a"]; + 1 -> 1 [label = "b"]; + +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/example_3_graph.dot b/cfpq-paths-app/src/main/resources/example_3_graph.dot new file mode 100644 index 000000000..2e845e0ea --- /dev/null +++ b/cfpq-paths-app/src/main/resources/example_3_graph.dot @@ -0,0 +1,11 @@ +digraph { + start -> 0; + start -> 1; + start -> 2; + 0 -> 1 [label = "a"]; + 1 -> 2 [label = "a"]; + 2 -> 3 [label = "b"]; + 3 -> 2 [label = "b"]; + 2 -> 0 [label = "a"]; + +} \ No newline at end of file From ae0da1202faa2a61bd216c75a2c747dbdfc4eea5 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 1 Apr 2026 23:01:45 +0300 Subject: [PATCH 25/71] fix(README.md): Fixed image display issue --- .../src/main/kotlin/simple_examples/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 488182dc4..93ee9d197 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -59,7 +59,7 @@ with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) **Input graph:** -![Simple AnBn Graph / Finite Set Of Path](src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg) +![Simple AnBn Graph / Finite Set Of Path](figures/example_1_graph.dot.svg) Let's find *all* words that satisfy the language's grammar: @@ -68,13 +68,13 @@ Let's find *all* words that satisfy the language's grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg) +![Simple AnBn Graph / Finite Set Of Path / SPPF](figures/example_1_graph_sppf.dot.svg) **Example 2: Simple graph with an infinite number of paths #1** **Input graph:** -![Simple AnBn Graph / Infinite Set Of Path #1](src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg) +![Simple AnBn Graph / Infinite Set Of Path #1](figures/example_2_graph.dot.svg) Let's find *some* words that satisfy the language's grammar: @@ -87,7 +87,7 @@ Let's find *some* words that satisfy the language's grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg) +![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](figures/example_2_graph_sppf.dot.svg) > [!TIP] > This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. @@ -96,7 +96,7 @@ Let's find *some* words that satisfy the language's grammar: **Input graph:** -![Simple AnBn Graph / Iinite Set Of Path #2](src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg) +![Simple AnBn Graph / Iinite Set Of Path #2](figures/example_3_graph.dot.svg) Let's find *some* words that satisfy the language's grammar: From e20352db4276ec5d1d597e0b65d15962f3e6ef84 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 1 Apr 2026 23:09:08 +0300 Subject: [PATCH 26/71] fix(README.md): Fixed bug with text display --- .../src/main/kotlin/simple_examples/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 93ee9d197..7d71fbbc0 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -63,8 +63,8 @@ with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) Let's find *all* words that satisfy the language's grammar: -* $ab$ (0 -$a$-> 1 -$b$-> 2) -* $aabb$ (0 -$a$-> 1 -$a$-> 2 -$b$-> 1 -$b$-> 2) +* $ab$ (0 -a-> 1 -b-> 2) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) **Resulting SPPF graph:** @@ -78,8 +78,8 @@ Let's find *all* words that satisfy the language's grammar: Let's find *some* words that satisfy the language's grammar: -* $ab$ (0 -$a$-> 1 -$b$-> 1) -* $aaabbb$ (0 -$a$-> 1 -$a$-> 0 -$a$-> 1 -$b$-> 1 -$b$-> 1 -$b$-> 1) +* $ab$ (0 -a-> 1 -b-> 1) +* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) * ... > [!NOTE] @@ -100,9 +100,9 @@ Let's find *some* words that satisfy the language's grammar: Let's find *some* words that satisfy the language's grammar: -* $ab$ (1 -$a$-> 2 -$b$-> 3) -* $aabb$ (0 -$a$-> 1 -$a$-> 2 -$b$-> 3 -$b$-> 2) -* $aaabbb$ (2 -$a$-> 0 -$a$-> 1 -$a$-> 2 -$b$-> 3 -$b$-> 2 -$b$-> 3) +* $ab$ (1 -a-> 2 -b-> 3) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) +* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) * ... > [!NOTE] From 7627887fbb29a60e2fee7d5b51210b869264eca9 Mon Sep 17 00:00:00 2001 From: danisaev Date: Sat, 4 Apr 2026 01:18:20 +0300 Subject: [PATCH 27/71] docs(README.md): Added RSM of AnBn grammar -Changed some admonitions in README.kt -Added new files to figures -Added commented method of writing RSM to example_1.kt --- .../src/main/kotlin/simple_examples/README.md | 15 +- .../main/kotlin/simple_examples/example_1.kt | 2 + .../figures/PointsToAnBnGrammarRsm.dot | 17 + .../figures/PointsToAnBnGrammarRsm.dot.svg | 71 ++ .../gen/example_1_graph_sppf.dot | 48 ++ .../gen/example_2_graph_sppf.dot | 54 ++ .../gen/example_3_graph_sppf.dot | 671 ++++++++++++++++++ 7 files changed, 876 insertions(+), 2 deletions(-) create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 7d71fbbc0..761693870 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -33,7 +33,7 @@ The name *LL* itself stands for Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) -> [!TIP] +> [!NOTE] > Please note that we can do this in several ways. >```kotlin >class PointsToAnBnGrammar : Grammar() { @@ -55,6 +55,17 @@ with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) >} >``` +Let's construct an RSM for the $a^n b^n$ grammar: + +![RSM for AnBn Grammar](figures/PointsToAnBnGrammarRsm.dot.svg) + +We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a +non-terminal and terminals $aSb$ + +> [!NOTE] +> To see this, look at the labels on the edges along the path from the starting non-terminal (green circle) to the final +> terminal (red circle) + **Example 1: Simple graph with a finite set of paths** **Input graph:** @@ -89,7 +100,7 @@ Let's find *some* words that satisfy the language's grammar: ![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](figures/example_2_graph_sppf.dot.svg) -> [!TIP] +> [!NOTE] > This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. **Example 3: Simple graph with an infinite set of paths #2** diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt b/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt index 2adec6ef0..5880a23b9 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt @@ -12,6 +12,7 @@ import org.ucfs.sppf.getSppfDot import org.ucfs.sppf.node.* import java.nio.file.Files import java.nio.file.Path +import org.ucfs.rsm.writeRsmToDot class PointsToAnBnGrammar : Grammar() { val S by Nt().asStart() @@ -93,6 +94,7 @@ fun main() { listOf("example_1_graph.dot", "example_2_graph.dot", "example_3_graph.dot").forEach { graphName -> val graph = readGraph(graphName) val grammar = PointsToAnBnGrammar() +// writeRsmToDot(grammar.rsm, "${grammar.name}Rsm") val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() saveSppf(graphName, sppf) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot new file mode 100644 index 000000000..10aed5484 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot @@ -0,0 +1,17 @@ +digraph g { +S_1 [label = "S,S_1", shape = circle, color = black] +S_2 [label = "S,S_2", shape = circle, color = black] +S_3 [label = "S,S_3", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +S_1 -> S_3 [label = "b"] +S_1 -> S_2 [label = "S"] +S_2 -> S_3 [label = "b"] +S_0 -> S_1 [label = "a"] +subgraph cluster_S { +S_1 +S_2 +S_3 +S_0 +label = "S" +} +} diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg new file mode 100644 index 000000000..661ca971b --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg @@ -0,0 +1,71 @@ + + + + + + +g + + +cluster_S + +S + + + +S_1 + +S,S_1 + + + +S_2 + +S,S_2 + + + +S_1->S_2 + + +S + + + +S_3 + + +S,S_3 + + + +S_1->S_3 + + +b + + + +S_2->S_3 + + +b + + + +S_0 + +S,S_0 + + + +S_0->S_1 + + +a + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot new file mode 100644 index 000000000..a85d0c66b --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot @@ -0,0 +1,48 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle] +_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle] +_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] +_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] +_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_11 +_0_1->_0_12 +_0_2->_0_13 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_8 +_0_7->_0_9 +_0_8->_0_10 +_0_11->_0_13 +_0_11->_0_14 +_0_12->_0_15 +_0_12->_0_16 +_0_13->_0_17 +_0_14->_0_18 +_0_15->_0_2 +_0_16->_0_18 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot new file mode 100644 index 000000000..957352329 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot @@ -0,0 +1,54 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] +_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_12 +_0_1->_0_14 +_0_2->_0_15 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_18 +_0_7->_0_8 +_0_8->_0_9 +_0_8->_0_10 +_0_9->_0_11 +_0_10->_0_13 +_0_12->_0_15 +_0_12->_0_16 +_0_13->_0_1 +_0_14->_0_17 +_0_14->_0_18 +_0_15->_0_19 +_0_16->_0_20 +_0_17->_0_2 +_0_18->_0_20 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot new file mode 100644 index 000000000..b83bc8506 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot @@ -0,0 +1,671 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_0_3 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_4 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_5 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_0_6 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_7 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_0_8 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_9 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle] +_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle] +_0_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_0_13 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_0_14 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_0_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_17 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_0_18 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_19 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_0_20 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_21 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle] +_0_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_0_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_26 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_0_27 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_28 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_29 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_0_31 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_0_33 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_36 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_0_38 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_0_40 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_0_42 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_0_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_47 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_12 +_0_2->_0_3 +_0_3->_0_4 +_0_3->_0_5 +_0_4->_0_6 +_0_4->_0_7 +_0_5->_0_8 +_0_5->_0_9 +_0_6->_0_10 +_0_7->_0_11 +_0_8->_0_13 +_0_9->_0_11 +_0_12->_0_23 +_0_12->_0_34 +_0_13->_0_6 +_0_13->_0_14 +_0_14->_0_15 +_0_15->_0_16 +_0_16->_0_17 +_0_17->_0_18 +_0_17->_0_34 +_0_18->_0_19 +_0_19->_0_20 +_0_19->_0_21 +_0_20->_0_22 +_0_21->_0_24 +_0_23->_0_44 +_0_24->_0_25 +_0_25->_0_26 +_0_26->_0_27 +_0_26->_0_9 +_0_27->_0_28 +_0_28->_0_46 +_0_28->_0_29 +_0_29->_0_30 +_0_30->_0_31 +_0_31->_0_32 +_0_32->_0_33 +_0_32->_0_34 +_0_33->_0_35 +_0_34->_0_45 +_0_35->_0_6 +_0_35->_0_36 +_0_36->_0_37 +_0_37->_0_38 +_0_38->_0_39 +_0_39->_0_40 +_0_39->_0_9 +_0_40->_0_41 +_0_41->_0_20 +_0_41->_0_42 +_0_42->_0_43 +_0_43->_0_1 +_0_44->_0_46 +_0_44->_0_47 +_0_46->_0_48 +_0_47->_0_2 +} + +subgraph cluster_1{ +labelloc="t" +_1_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_1_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_1_3 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_1_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_1_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_1_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_1_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle] +_1_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_1_14 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_15 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_1_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_17 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_1_18 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_1_19 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle] +_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_1_22 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_24 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_1_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_26 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_1_27 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_1_29 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_30 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_31 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_1_32 [label = "38 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_1_33 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_1_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_1_36 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_1_38 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_1_40 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_1_42 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_1_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_1_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_1_47 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_1_0->_1_1 +_1_1->_1_12 +_1_2->_1_3 +_1_3->_1_4 +_1_4->_1_5 +_1_4->_1_6 +_1_5->_1_7 +_1_6->_1_8 +_1_7->_1_9 +_1_7->_1_10 +_1_9->_1_11 +_1_10->_1_13 +_1_12->_1_23 +_1_12->_1_34 +_1_13->_1_14 +_1_14->_1_15 +_1_15->_1_16 +_1_15->_1_34 +_1_16->_1_17 +_1_17->_1_18 +_1_17->_1_19 +_1_18->_1_20 +_1_19->_1_21 +_1_21->_1_22 +_1_22->_1_24 +_1_23->_1_44 +_1_24->_1_25 +_1_24->_1_6 +_1_25->_1_26 +_1_26->_1_46 +_1_26->_1_27 +_1_27->_1_28 +_1_28->_1_29 +_1_29->_1_30 +_1_29->_1_31 +_1_30->_1_9 +_1_30->_1_32 +_1_31->_1_33 +_1_31->_1_34 +_1_32->_1_45 +_1_33->_1_35 +_1_34->_1_45 +_1_35->_1_9 +_1_35->_1_36 +_1_36->_1_37 +_1_37->_1_38 +_1_38->_1_39 +_1_39->_1_40 +_1_39->_1_6 +_1_40->_1_41 +_1_41->_1_18 +_1_41->_1_42 +_1_42->_1_43 +_1_43->_1_1 +_1_44->_1_46 +_1_44->_1_47 +_1_46->_1_48 +_1_47->_1_2 +} + +subgraph cluster_2{ +labelloc="t" +_2_0 [label = "0 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_2_1 [label = "1 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_2_3 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_2_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_2_7 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_2_9 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_2_10 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle] +_2_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_2_14 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_2_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_17 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_2_18 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_2_19 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle] +_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_2_22 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_23 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_24 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_25 [label = "31 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_2_26 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_2_27 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_2_29 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_2_31 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_2_33 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_2_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_2_36 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_2_38 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_2_40 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_2_42 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_2_44 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_2_46 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_2_47 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle] +_2_0->_2_1 +_2_1->_2_12 +_2_2->_2_3 +_2_3->_2_4 +_2_4->_2_5 +_2_4->_2_6 +_2_5->_2_7 +_2_6->_2_8 +_2_7->_2_9 +_2_7->_2_10 +_2_9->_2_11 +_2_10->_2_13 +_2_12->_2_23 +_2_12->_2_34 +_2_13->_2_14 +_2_14->_2_15 +_2_15->_2_16 +_2_15->_2_34 +_2_16->_2_17 +_2_17->_2_18 +_2_17->_2_19 +_2_18->_2_20 +_2_19->_2_21 +_2_21->_2_22 +_2_22->_2_24 +_2_22->_2_25 +_2_23->_2_44 +_2_24->_2_46 +_2_24->_2_26 +_2_25->_2_27 +_2_25->_2_6 +_2_26->_2_8 +_2_27->_2_28 +_2_28->_2_46 +_2_28->_2_29 +_2_29->_2_30 +_2_30->_2_31 +_2_31->_2_32 +_2_32->_2_33 +_2_32->_2_34 +_2_33->_2_35 +_2_34->_2_45 +_2_35->_2_9 +_2_35->_2_36 +_2_36->_2_37 +_2_37->_2_38 +_2_38->_2_39 +_2_39->_2_40 +_2_39->_2_6 +_2_40->_2_41 +_2_41->_2_18 +_2_41->_2_42 +_2_42->_2_43 +_2_43->_2_1 +_2_44->_2_46 +_2_44->_2_47 +_2_46->_2_48 +_2_47->_2_2 +} + +subgraph cluster_3{ +labelloc="t" +_3_0 [label = "0 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_3_1 [label = "1 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_2 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_3_3 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_3_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_6 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_3_7 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_8 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_3_9 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle] +_3_11 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_3_12 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_13 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle] +_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_3_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_17 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_3_18 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_19 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_3_20 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_3_21 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle] +_3_23 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_3_25 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_3_27 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_29 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_3_31 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_3_33 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_34 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_3_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_3_36 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_3_38 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_3_40 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_3_42 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_3_44 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_3_45 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_46 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle] +_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle] +_3_0->_3_1 +_3_1->_3_12 +_3_1->_3_23 +_3_2->_3_34 +_3_2->_3_3 +_3_3->_3_4 +_3_4->_3_5 +_3_5->_3_6 +_3_6->_3_7 +_3_6->_3_8 +_3_7->_3_9 +_3_8->_3_10 +_3_9->_3_11 +_3_9->_3_13 +_3_11->_3_14 +_3_12->_3_34 +_3_12->_3_44 +_3_13->_3_15 +_3_15->_3_16 +_3_16->_3_17 +_3_17->_3_18 +_3_17->_3_46 +_3_18->_3_19 +_3_19->_3_20 +_3_19->_3_21 +_3_20->_3_22 +_3_21->_3_24 +_3_23->_3_45 +_3_23->_3_46 +_3_24->_3_25 +_3_25->_3_26 +_3_26->_3_27 +_3_26->_3_8 +_3_27->_3_28 +_3_28->_3_34 +_3_28->_3_29 +_3_29->_3_30 +_3_30->_3_31 +_3_31->_3_32 +_3_32->_3_33 +_3_32->_3_46 +_3_33->_3_35 +_3_34->_3_47 +_3_35->_3_11 +_3_35->_3_36 +_3_36->_3_37 +_3_37->_3_38 +_3_38->_3_39 +_3_39->_3_40 +_3_39->_3_8 +_3_40->_3_41 +_3_41->_3_20 +_3_41->_3_42 +_3_42->_3_43 +_3_43->_3_1 +_3_44->_3_48 +_3_45->_3_2 +_3_46->_3_48 +} + +subgraph cluster_4{ +labelloc="t" +_4_0 [label = "0 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_4_1 [label = "1 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_4_3 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_4_5 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_4_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_4_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_4_10 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_4_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_4_14 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_4_16 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_17 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_18 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_4_19 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] +_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_4_22 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_23 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_24 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_4_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_26 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_4_27 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_4_29 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_30 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_4_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_32 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_4_33 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_4_36 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_37 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_38 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_4_39 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_4_40 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_4_42 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_4_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_4_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_4_47 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_4_0->_4_1 +_4_1->_4_12 +_4_2->_4_3 +_4_3->_4_4 +_4_4->_4_5 +_4_4->_4_6 +_4_5->_4_7 +_4_6->_4_8 +_4_7->_4_9 +_4_7->_4_10 +_4_9->_4_11 +_4_10->_4_13 +_4_12->_4_23 +_4_12->_4_34 +_4_13->_4_14 +_4_14->_4_15 +_4_15->_4_16 +_4_15->_4_34 +_4_16->_4_17 +_4_17->_4_18 +_4_17->_4_19 +_4_18->_4_20 +_4_19->_4_21 +_4_21->_4_22 +_4_22->_4_24 +_4_23->_4_44 +_4_24->_4_25 +_4_24->_4_6 +_4_25->_4_26 +_4_26->_4_46 +_4_26->_4_27 +_4_27->_4_28 +_4_28->_4_29 +_4_29->_4_30 +_4_30->_4_31 +_4_30->_4_34 +_4_31->_4_32 +_4_32->_4_9 +_4_32->_4_33 +_4_33->_4_35 +_4_34->_4_45 +_4_35->_4_36 +_4_36->_4_37 +_4_36->_4_38 +_4_37->_4_18 +_4_37->_4_39 +_4_38->_4_40 +_4_38->_4_6 +_4_39->_4_8 +_4_40->_4_41 +_4_41->_4_18 +_4_41->_4_42 +_4_42->_4_43 +_4_43->_4_1 +_4_44->_4_46 +_4_44->_4_47 +_4_46->_4_48 +_4_47->_4_2 +} + +subgraph cluster_5{ +labelloc="t" +_5_0 [label = "0 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_5_1 [label = "1 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_5_3 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_5_5 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_5_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_5_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_5_10 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_5_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_5_14 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_15 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_16 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_5_17 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_5_18 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_5_19 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] +_5_21 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_5_22 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_23 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_5_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_5_27 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_28 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_5_29 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_5_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_5_33 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_5_35 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_5_36 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_5_38 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_5_40 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_42 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_5_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_5_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_5_47 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_5_0->_5_1 +_5_1->_5_12 +_5_2->_5_3 +_5_3->_5_4 +_5_4->_5_5 +_5_4->_5_6 +_5_5->_5_7 +_5_6->_5_8 +_5_7->_5_9 +_5_7->_5_10 +_5_9->_5_11 +_5_10->_5_13 +_5_12->_5_23 +_5_12->_5_34 +_5_13->_5_14 +_5_14->_5_15 +_5_14->_5_16 +_5_15->_5_17 +_5_15->_5_18 +_5_16->_5_19 +_5_16->_5_34 +_5_17->_5_20 +_5_18->_5_45 +_5_19->_5_21 +_5_21->_5_17 +_5_21->_5_22 +_5_22->_5_24 +_5_23->_5_44 +_5_24->_5_25 +_5_25->_5_26 +_5_26->_5_27 +_5_26->_5_6 +_5_27->_5_28 +_5_28->_5_46 +_5_28->_5_29 +_5_29->_5_30 +_5_30->_5_31 +_5_31->_5_32 +_5_32->_5_33 +_5_32->_5_34 +_5_33->_5_35 +_5_34->_5_45 +_5_35->_5_9 +_5_35->_5_36 +_5_36->_5_37 +_5_37->_5_38 +_5_38->_5_39 +_5_39->_5_40 +_5_39->_5_6 +_5_40->_5_41 +_5_41->_5_17 +_5_41->_5_42 +_5_42->_5_43 +_5_43->_5_1 +_5_44->_5_46 +_5_44->_5_47 +_5_46->_5_48 +_5_47->_5_2 +} + +} + From 6a94359c6d8b759e3ddc3cf937d0d9eb4f53a197 Mon Sep 17 00:00:00 2001 From: danisaev Date: Sat, 4 Apr 2026 01:28:24 +0300 Subject: [PATCH 28/71] docs(README.md): Correction of the wording --- cfpq-paths-app/src/main/kotlin/simple_examples/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 761693870..43cdec928 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -63,8 +63,8 @@ We can see how the starting non-terminal $S$ turns into either a concatenation o non-terminal and terminals $aSb$ > [!NOTE] -> To see this, look at the labels on the edges along the path from the starting non-terminal (green circle) to the final -> terminal (red circle) +> To confirm this, look at the labels along the edges of the path from the tree root (green circle) to the final leaf +> (red circle). **Example 1: Simple graph with a finite set of paths** From 794f40091c690124fc94c9bb6299f159135bbc65 Mon Sep 17 00:00:00 2001 From: danisaev Date: Sat, 4 Apr 2026 01:45:58 +0300 Subject: [PATCH 29/71] docs(README.md): Correction of wording --- cfpq-paths-app/src/main/kotlin/simple_examples/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 43cdec928..253ea0e68 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -63,7 +63,7 @@ We can see how the starting non-terminal $S$ turns into either a concatenation o non-terminal and terminals $aSb$ > [!NOTE] -> To confirm this, look at the labels along the edges of the path from the tree root (green circle) to the final leaf +> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node > (red circle). **Example 1: Simple graph with a finite set of paths** From 33f68d9c1e00cb272d5ffc5511558223135f7ee0 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 8 Apr 2026 23:01:21 +0300 Subject: [PATCH 30/71] docs(README.md): Added explanations to the first simple example --- .../src/main/kotlin/simple_examples/README.md | 10 ++++++++++ .../figures/example_1_graph_sppf.dot.svg | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 253ea0e68..d2f7518a3 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -81,6 +81,16 @@ Let's find *all* words that satisfy the language's grammar: ![Simple AnBn Graph / Finite Set Of Path / SPPF](figures/example_1_graph_sppf.dot.svg) +Let's check our theoretical assumption. We use DFS to search for terminals. Start from number 0 and follow the next +fork. Fork with number 1 gives us two different words. Follow the path 1-2-4-8 and reach the $a$ terminal. Return to +fork number 2 and follow another path 2-5-9 to reach the $b$ terminal. **This way, we get the first word $ab$ as +expected.** + +We do the same for other paths: 1-3-6-10-4-8 to reach the $a$ terminal, then return to fork with number 10 and follow +the path 10-11-12-13-14-15-17 to reach the $a$ terminal, then return to fork number 14 and follow the path 14-16-18 to +reach the $b$ terminal, finally return to fork number 3 and follow the path 3-7-9 to reach the $b$ terminal. **This way, +we get the second word $aabb$ as expected.** + **Example 2: Simple graph with an infinite number of paths #1** **Input graph:** diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg index 995f987b9..9b693fe16 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg @@ -144,7 +144,7 @@ _0_9 - + 17     Terminal 'a', input: [1, 2] @@ -156,7 +156,7 @@ _0_10 - + 18     Terminal 'b', input: [2, 1] @@ -210,7 +210,7 @@ _0_17 - + 8     Terminal 'a', input: [0, 1] @@ -222,7 +222,7 @@ _0_18 - + 9     Terminal 'b', input: [1, 2] From 89df2e71cf7851bb2107fa8fb8ed0f79c5290bbf Mon Sep 17 00:00:00 2001 From: danisaev Date: Thu, 9 Apr 2026 02:01:32 +0300 Subject: [PATCH 31/71] docs(README.md): Added explanations of the second simple example --- .../src/main/kotlin/simple_examples/README.md | 17 +++++++++++++++++ .../figures/example_2_graph_sppf.dot.svg | 8 ++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index d2f7518a3..9caf97526 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -113,6 +113,23 @@ Let's find *some* words that satisfy the language's grammar: > [!NOTE] > This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. +Let's check our theoretical assumption. We use DFS to search for terminals. Start from number 0 and follow the next +fork. Fork with number 1 gives us two different words. Follow the path 1-2-4-8 and reach the $a$ terminal. Return to +fork number 2 and follow another path 2-5-9 to reach the $b$ terminal. **This way, we get the first word $ab$ as +expected.** + +We do the same for other paths: 1-3-6-10-4-8 to reach the $a$ terminal, then return to fork with number 10 and follow +the path 10-11-12-13-14-15-16-17-19 to reach the $a$ terminal, then return to fork number 16 and follow the path +16-18-20 to +reach the $S$ non-terminal, then return to fork number 14 and follow the path 14-7-9 to +reach the $b$ terminal, finally return to fork number 3 and follow the path 3-7-9 to reach the $b$ terminal. **This way, +we get the word $aaSbb$ as second word.** + +> [!NOTE] +> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we +> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. as we +> expected. + **Example 3: Simple graph with an infinite set of paths #2** **Input graph:** diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg index 9849576ec..c7ea1f112 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg @@ -179,7 +179,7 @@ _0_11 - + 19     Terminal 'a', input: [1, 0] @@ -191,7 +191,7 @@ _0_13 - + 20     Nonterminal S, input: [0, 1] @@ -245,7 +245,7 @@ _0_19 - + 8     Terminal 'a', input: [0, 1] @@ -257,7 +257,7 @@ _0_20 - + 9     Terminal 'b', input: [1, 1] From 39c79a3a028d569d7b7b7df1a2698ef541b31f37 Mon Sep 17 00:00:00 2001 From: danisaev Date: Tue, 14 Apr 2026 12:47:41 +0300 Subject: [PATCH 32/71] docs(README.md): fixed some comments - Removed requirements - Added a link to GLL - Fixed tags on the RSM --- .../src/main/kotlin/simple_examples/README.md | 4 +- .../figures/PointsToAnBnGrammarRsm.dot | 8 +-- .../figures/PointsToAnBnGrammarRsm.dot.svg | 54 +++++++++---------- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 9caf97526..3361ce76e 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -11,7 +11,9 @@ The name *LL* itself stands for * Left-to-right scanning of the input * Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) -**Requirements for use UCFS:** 11+ java version +> [!TIP] +> You can read more about GLL by following +> the [link](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5). **To run (from project root):** diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot index 10aed5484..a7852e289 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot @@ -1,8 +1,8 @@ digraph g { -S_1 [label = "S,S_1", shape = circle, color = black] -S_2 [label = "S,S_2", shape = circle, color = black] -S_3 [label = "S,S_3", shape = doublecircle, color = red] -S_0 [label = "S,S_0", shape = circle, color = green] +S_1 [label = "S_1", shape = circle, color = black] +S_2 [label = "S_2", shape = circle, color = black] +S_3 [label = "S_3", shape = doublecircle, color = red] +S_0 [label = "S_0", shape = circle, color = green] S_1 -> S_3 [label = "b"] S_1 -> S_2 [label = "S"] S_2 -> S_3 [label = "b"] diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg index 661ca971b..a1822ad18 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg @@ -4,68 +4,68 @@ - - + + g - + cluster_S - -S + +S S_1 - -S,S_1 + +S_1 S_2 - -S,S_2 + +S_2 S_1->S_2 - - -S + + +S S_3 - - -S,S_3 + + +S_3 S_1->S_3 - - -b + + +b S_2->S_3 - - -b + + +b S_0 - -S,S_0 + +S_0 S_0->S_1 - - -a + + +a From 49c2c5f62c7b8857e19731a6963d8deee675c208 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 22 Apr 2026 13:55:12 +0300 Subject: [PATCH 33/71] docs(README.md): changing the wording --- cfpq-paths-app/src/main/kotlin/simple_examples/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 3361ce76e..0d699893a 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -83,7 +83,7 @@ Let's find *all* words that satisfy the language's grammar: ![Simple AnBn Graph / Finite Set Of Path / SPPF](figures/example_1_graph_sppf.dot.svg) -Let's check our theoretical assumption. We use DFS to search for terminals. Start from number 0 and follow the next +Let's check our hypothesis. We use DFS to search for terminals. Start from number 0 and follow the next fork. Fork with number 1 gives us two different words. Follow the path 1-2-4-8 and reach the $a$ terminal. Return to fork number 2 and follow another path 2-5-9 to reach the $b$ terminal. **This way, we get the first word $ab$ as expected.** @@ -115,7 +115,7 @@ Let's find *some* words that satisfy the language's grammar: > [!NOTE] > This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. -Let's check our theoretical assumption. We use DFS to search for terminals. Start from number 0 and follow the next +Let's check our hypothesis. We use DFS to search for terminals. Start from number 0 and follow the next fork. Fork with number 1 gives us two different words. Follow the path 1-2-4-8 and reach the $a$ terminal. Return to fork number 2 and follow another path 2-5-9 to reach the $b$ terminal. **This way, we get the first word $ab$ as expected.** From f8e3684fa003eefea050bf28b65479f24056663d Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 22 Apr 2026 22:51:16 +0300 Subject: [PATCH 34/71] docs(README.md): Added trees extracted from SPPF for the first example - The corresponding graphs and their images have been added --- .../src/main/kotlin/simple_examples/README.md | 24 +- .../figures/example_1_graph_sppf_1tree.dot | 22 ++ .../example_1_graph_sppf_1tree.dot.svg | 94 ++++++++ .../figures/example_1_graph_sppf_2tree.dot | 42 ++++ .../example_1_graph_sppf_2tree.dot.svg | 212 ++++++++++++++++++ 5 files changed, 386 insertions(+), 8 deletions(-) create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 0d699893a..19080e691 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -83,15 +83,23 @@ Let's find *all* words that satisfy the language's grammar: ![Simple AnBn Graph / Finite Set Of Path / SPPF](figures/example_1_graph_sppf.dot.svg) -Let's check our hypothesis. We use DFS to search for terminals. Start from number 0 and follow the next -fork. Fork with number 1 gives us two different words. Follow the path 1-2-4-8 and reach the $a$ terminal. Return to -fork number 2 and follow another path 2-5-9 to reach the $b$ terminal. **This way, we get the first word $ab$ as -expected.** +**Let's see what the use of the algorithm gives us:** -We do the same for other paths: 1-3-6-10-4-8 to reach the $a$ terminal, then return to fork with number 10 and follow -the path 10-11-12-13-14-15-17 to reach the $a$ terminal, then return to fork number 14 and follow the path 14-16-18 to -reach the $b$ terminal, finally return to fork number 3 and follow the path 3-7-9 to reach the $b$ terminal. **This way, -we get the second word $aabb$ as expected.** +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](figures/example_1_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](figures/example_1_graph_sppf_2tree.dot.svg) + +When we parse this tree, we can see that this tree gives us the word $aabb$ + +Thus, the algorithm produced exactly what was expected. **Example 2: Simple graph with an infinite number of paths #1** diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot new file mode 100644 index 000000000..e057c1278 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot @@ -0,0 +1,22 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] +_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_11 +_0_11->_0_13 +_0_11->_0_14 +_0_13->_0_17 +_0_14->_0_18 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg new file mode 100644 index 000000000..7e1049d04 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg @@ -0,0 +1,94 @@ + + + + + + +g + + +cluster_0 + + + + +_0_0 + +0     Nonterminal S, input: [0, 2] + + + +_0_1 + +1     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_11 +2     Intermediate input: 1, rsm: S_1, input: [0, 2] + + + +_0_1->_0_11 + + + + + +_0_13 + +4     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_11->_0_13 + + + + + +_0_14 + +5     Range , input: [1, 2], rsm: [S_1, S_3] + + + +_0_11->_0_14 + + + + + +_0_17 + +8     Terminal 'a', input: [0, 1] + + + +_0_13->_0_17 + + + + + +_0_18 + +9     Terminal 'b', input: [1, 2] + + + +_0_14->_0_18 + + + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot new file mode 100644 index 000000000..96ac7ec6f --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot @@ -0,0 +1,42 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle] +_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle] +_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] +_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_12 +_0_2->_0_13 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_8 +_0_7->_0_9 +_0_8->_0_10 +_0_12->_0_15 +_0_12->_0_16 +_0_13->_0_17 +_0_15->_0_2 +_0_16->_0_18 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg new file mode 100644 index 000000000..fba0abfe8 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg @@ -0,0 +1,212 @@ + + + + + + +g + + +cluster_0 + + + + +_0_0 + +0     Nonterminal S, input: [0, 2] + + + +_0_1 + +1     Range , input: [0, 2], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_12 +3     Intermediate input: 1, rsm: S_2, input: [0, 2] + + + +_0_1->_0_12 + + + + + +_0_2 +10     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + +_0_3 + +11     Range , input: [1, 1], rsm: [S_1, S_2] + + + +_0_2->_0_3 + + + + + +_0_13 + +4     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_2->_0_13 + + + + + +_0_4 + +12     Nonterminal S, input: [1, 1] + + + +_0_3->_0_4 + + + + + +_0_5 + +13     Range , input: [1, 1], rsm: [S_0, S_3] + + + +_0_4->_0_5 + + + + + +_0_6 +14     Intermediate input: 2, rsm: S_1, input: [1, 1] + + + +_0_5->_0_6 + + + + + +_0_7 + +15     Range , input: [1, 2], rsm: [S_0, S_1] + + + +_0_6->_0_7 + + + + + +_0_8 + +16     Range , input: [2, 1], rsm: [S_1, S_3] + + + +_0_6->_0_8 + + + + + +_0_9 + +17     Terminal 'a', input: [1, 2] + + + +_0_7->_0_9 + + + + + +_0_10 + +18     Terminal 'b', input: [2, 1] + + + +_0_8->_0_10 + + + + + +_0_15 + +6     Range , input: [0, 1], rsm: [S_0, S_2] + + + +_0_12->_0_15 + + + + + +_0_16 + +7     Range , input: [1, 2], rsm: [S_2, S_3] + + + +_0_12->_0_16 + + + + + +_0_17 + +8     Terminal 'a', input: [0, 1] + + + +_0_13->_0_17 + + + + + +_0_15->_0_2 + + + + + +_0_18 + +9     Terminal 'b', input: [1, 2] + + + +_0_16->_0_18 + + + + + From 103d5a6062e47a6879ab9d55021b5046ca445949 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 22 Apr 2026 23:24:15 +0300 Subject: [PATCH 35/71] docs(README.md): added sppf split into two trees in the second example - Corresponding graphs and images have been added --- .../src/main/kotlin/simple_examples/README.md | 31 ++- .../figures/example_2_graph_sppf_1tree.dot | 22 ++ .../example_2_graph_sppf_1tree.dot.svg | 94 +++++++ .../figures/example_2_graph_sppf_2tree.dot | 48 ++++ .../example_2_graph_sppf_2tree.dot.svg | 247 ++++++++++++++++++ 5 files changed, 429 insertions(+), 13 deletions(-) create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot create mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 19080e691..1c91b73d3 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -123,22 +123,27 @@ Let's find *some* words that satisfy the language's grammar: > [!NOTE] > This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. -Let's check our hypothesis. We use DFS to search for terminals. Start from number 0 and follow the next -fork. Fork with number 1 gives us two different words. Follow the path 1-2-4-8 and reach the $a$ terminal. Return to -fork number 2 and follow another path 2-5-9 to reach the $b$ terminal. **This way, we get the first word $ab$ as -expected.** - -We do the same for other paths: 1-3-6-10-4-8 to reach the $a$ terminal, then return to fork with number 10 and follow -the path 10-11-12-13-14-15-16-17-19 to reach the $a$ terminal, then return to fork number 16 and follow the path -16-18-20 to -reach the $S$ non-terminal, then return to fork number 14 and follow the path 14-7-9 to -reach the $b$ terminal, finally return to fork number 3 and follow the path 3-7-9 to reach the $b$ terminal. **This way, -we get the word $aaSbb$ as second word.** +**Let's see what the use of the algorithm gives us:** + +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](figures/example_2_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](figures/example_2_graph_sppf_2tree.dot.svg) + +When we analyze this tree, we see that this tree gives us the word $aaSbb$ > [!NOTE] > We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we -> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. as we -> expected. +> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. + +Thus, the algorithm produced exactly what was expected. **Example 3: Simple graph with an infinite set of paths #2** diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot new file mode 100644 index 000000000..cd9a4887b --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot @@ -0,0 +1,22 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_12 +_0_12->_0_15 +_0_12->_0_16 +_0_15->_0_19 +_0_16->_0_20 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg new file mode 100644 index 000000000..697bdc5bc --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg @@ -0,0 +1,94 @@ + + + + + + +g + + +cluster_0 + + + + +_0_0 + +0     Nonterminal S, input: [0, 1] + + + +_0_1 + +1     Range , input: [0, 1], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_12 +2     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + +_0_1->_0_12 + + + + + +_0_15 + +4     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_12->_0_15 + + + + + +_0_16 + +5     Range , input: [1, 1], rsm: [S_1, S_3] + + + +_0_12->_0_16 + + + + + +_0_19 + +8     Terminal 'a', input: [0, 1] + + + +_0_15->_0_19 + + + + + +_0_20 + +9     Terminal 'b', input: [1, 1] + + + +_0_16->_0_20 + + + + + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot new file mode 100644 index 000000000..5c6f450c8 --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot @@ -0,0 +1,48 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] +_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_14 +_0_2->_0_15 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_18 +_0_7->_0_8 +_0_8->_0_9 +_0_8->_0_10 +_0_9->_0_11 +_0_10->_0_13 +_0_13->_0_1 +_0_14->_0_17 +_0_14->_0_18 +_0_15->_0_19 +_0_17->_0_2 +_0_18->_0_20 +} + +} + diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg new file mode 100644 index 000000000..4e6b3673d --- /dev/null +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg @@ -0,0 +1,247 @@ + + + + + + +g + + +cluster_0 + + + + +_0_0 + +0     Nonterminal S, input: [0, 1] + + + +_0_1 + +1     Range , input: [0, 1], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_14 +3     Intermediate input: 1, rsm: S_2, input: [0, 1] + + + +_0_1->_0_14 + + + + + +_0_2 +10     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + +_0_3 + +11     Range , input: [1, 1], rsm: [S_1, S_2] + + + +_0_2->_0_3 + + + + + +_0_15 + +4     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_2->_0_15 + + + + + +_0_4 + +12     Nonterminal S, input: [1, 1] + + + +_0_3->_0_4 + + + + + +_0_5 + +13     Range , input: [1, 1], rsm: [S_0, S_3] + + + +_0_4->_0_5 + + + + + +_0_6 +14     Intermediate input: 1, rsm: S_2, input: [1, 1] + + + +_0_5->_0_6 + + + + + +_0_7 + +15     Range , input: [1, 1], rsm: [S_0, S_2] + + + +_0_6->_0_7 + + + + + +_0_18 + +7     Range , input: [1, 1], rsm: [S_2, S_3] + + + +_0_6->_0_18 + + + + + +_0_8 +16     Intermediate input: 0, rsm: S_1, input: [1, 1] + + + +_0_7->_0_8 + + + + + +_0_9 + +17     Range , input: [1, 0], rsm: [S_0, S_1] + + + +_0_8->_0_9 + + + + + +_0_10 + +18     Range , input: [0, 1], rsm: [S_1, S_2] + + + +_0_8->_0_10 + + + + + +_0_11 + +19     Terminal 'a', input: [1, 0] + + + +_0_9->_0_11 + + + + + +_0_13 + +20     Nonterminal S, input: [0, 1] + + + +_0_10->_0_13 + + + + + +_0_13->_0_1 + + + + + +_0_17 + +6     Range , input: [0, 1], rsm: [S_0, S_2] + + + +_0_14->_0_17 + + + + + +_0_14->_0_18 + + + + + +_0_19 + +8     Terminal 'a', input: [0, 1] + + + +_0_15->_0_19 + + + + + +_0_17->_0_2 + + + + + +_0_20 + +9     Terminal 'b', input: [1, 1] + + + +_0_18->_0_20 + + + + + From 9616782c007005e9b438eba63b9e78e5b5bd5d6c Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 22 Apr 2026 23:57:23 +0300 Subject: [PATCH 36/71] docs(cfpq-paths-app/README.md): Integrating simple_examples/README.md into the main README.md - The file is divided into two sections: simple usage examples & complex usage examples - Added implementation of the simple usage examples section according to simple_examples/README.md - The complex usage examples section has been updated to correct the file paths and launch command --- cfpq-paths-app/README.md | 235 ++++++++++++++++++++++++++++++++++----- 1 file changed, 209 insertions(+), 26 deletions(-) diff --git a/cfpq-paths-app/README.md b/cfpq-paths-app/README.md index adb2d55c0..e37f38f7c 100644 --- a/cfpq-paths-app/README.md +++ b/cfpq-paths-app/README.md @@ -1,19 +1,38 @@ ->[!CAUTION] ->For demo purposes only! ->Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). +> [!CAUTION] +> For demo purposes only! +> Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). -This demo is based on UCFS, which, for a given grammar represented as an RSM, a graph, and start vertices, produces an SPPF. +This demo is based on UCFS, which, for a given grammar represented as an RSM, a graph, and start vertices, produces an +SPPF. + +**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and +labeled directed graphs. It is based on the **GLL** algorithm. + +**Generalized LL parsing (GLL)** is a parsing technique that extends traditional LL parsing to handle any context-free +grammar. +The name *LL* itself stands for + +* Left-to-right scanning of the input +* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) + +> [!TIP] +> You can read more about GLL by following +> the [link](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5). **RSM** (Recursive State Machine) is an automaton-like representation of context-free languages. -**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. -SPPF consists of nodes of the types listed below. Each node has a unique Id and detailed information specific to its type. +**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths +satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. +SPPF consists of nodes of the types listed below. Each node has a unique Id and detailed information specific to its +type. + +* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the + start and end of paths derived from that non-terminal. -* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the start and end of paths derived from that non-terminal. - ![Graph for example 1](./src/main/resources/figures/Nonterm_example.dot.svg) - This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal ```S``` + This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal + ```S``` * **Terminal** node is a leaf and corresponds to an edge. @@ -26,7 +45,7 @@ SPPF consists of nodes of the types listed below. Each node has a unique Id and ![Graph for example 1](./src/main/resources/figures/Epsilon_example.dot.svg) * **Range** node is a supplementary node that helps reuse subtrees. - + ![Graph for example 1](./src/main/resources/figures/Range_example.dot.svg) This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. @@ -39,24 +58,182 @@ SPPF consists of nodes of the types listed below. Each node has a unique Id and **Requirements**: 11 java +## Section 1: Simple usage examples + +**To run (from project root):** + +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` + +**Code for path extraction:** ```src/main/kotlin/simple_examples/example_1.kt``` + + +> [!TIP] +> You can read about how to define a context-free grammar using DSL, including what a terminal and a non-terminal are, +> as well as about operations, by following +> the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/). + +## $a^nb^n$ Language + +**Grammar assignment** + +Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end +with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) +> [!NOTE] +> Please note that we can do this in several ways. +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * Option(S) * "b" +> } +>} +>``` +>or +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * (Epsilon or S) * "b" +> } +>} +>``` + +Let's construct an RSM for the $a^n b^n$ grammar: + +![RSM for AnBn Grammar](src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg) + +We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a +non-terminal and terminals $aSb$ + +> [!NOTE] +> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node +> (red circle). + +**Example 1: Simple graph with a finite set of paths** + +**Input graph:** + +![Simple AnBn Graph / Finite Set Of Path](src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg) + +Let's find *all* words that satisfy the language's grammar: + +* $ab$ (0 -a-> 1 -b-> 2) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg) + +**Let's see what the use of the algorithm gives us:** + +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg) + +When we parse this tree, we can see that this tree gives us the word $aabb$ + +Thus, the algorithm produced exactly what was expected. + +**Example 2: Simple graph with an infinite number of paths #1** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1](src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (0 -a-> 1 -b-> 1) +* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) +* ... + +> [!NOTE] +> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg) + +> [!NOTE] +> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. + +**Let's see what the use of the algorithm gives us:** + +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg) + +When we analyze this tree, we see that this tree gives us the word $aaSbb$ + +> [!NOTE] +> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we +> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. + +Thus, the algorithm produced exactly what was expected. + +**Example 3: Simple graph with an infinite set of paths #2** + +**Input graph:** + +![Simple AnBn Graph / Iinite Set Of Path #2](src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (1 -a-> 2 -b-> 3) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) +* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) +* ... + +> [!NOTE] +> We get an infinite number of words. Words cover the entire language thanks to several starting points. + +**Resulting SPPF graph** is too big, you can find it in +```src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg``` + +*Default location of all generated SPPFs:* ```src/main/kotlin/simple_examples/gen``` + +## Section 2: Complex usage examples + **To run (from project root)**: ```bash -./gradlew :cfpq-app:run +./gradlew :cfpq-paths-app:run ``` **Input graphs:** ```src/main/resources/``` -**Grammar and code for paths extraction:** ```src/main/kotlin/me/vkutuev/Main.kt``` +**Grammar and code for paths extraction:** ```src/main/kotlin/org.ucfs.paths/Main.kt``` ->[!NOTE] +> [!NOTE] > We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. ## Examples -We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted paths. +We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted +paths. + +For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to +analyze chains of fields. -For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to analyze chains of fields. ``` PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* @@ -70,7 +247,9 @@ The corresponding RSM is presented below: ![Graph for example 1](./src/main/resources/figures/rsm.dot.svg) ### Example 1 -Code snippet: + +Code snippet: + ```java val n = new X() val y = new Y() @@ -90,13 +269,13 @@ Resulting SPPF: ![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) Three trees are extracted because there are three paths of interest from node 1. -We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful information for restoring fields. - +We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful +information for restoring fields. Respective paths: * [(1-PointsTo->0)] - + This path is trivial. Such paths will be omitted in further examples. * [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] @@ -105,12 +284,12 @@ Respective paths: * [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] - This path means that ```n.u.v = new Z()```. - + This path means that ```n.u.v = new Z()```. ### Example 2 -Code snippet: +Code snippet: + ```java val n = new X() val l = n @@ -128,7 +307,8 @@ Part of resulting SPPF: ![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) -This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because there are infinitely many paths of interest. We extract some of them: +This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because +there are infinitely many paths of interest. We extract some of them: * [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] @@ -159,6 +339,7 @@ More paths can be extracted if needed. Traversal should be tuned accordingly. ### Example 3 Code snippet: + ```java val n = new X() val l = n @@ -177,7 +358,8 @@ Part of resulting SPPF: ![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) -This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of them. +This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of +them. * [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] @@ -203,7 +385,6 @@ This SPPF also contains a cycle (3–5–7–11), so there are infinitely many p ```n.next.next.next.next.next.next = new X() // line 4``` - ### Example 4 Code snippet: @@ -219,11 +400,13 @@ v.p = new Y() val r = u.y r.q = new P() ``` + Respective graph: ![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) -For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in this example, we specify two vertices as start: 1 and 8. +For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in +this example, we specify two vertices as start: 1 and 8. * [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] From 6b5365bde895a0f06db03864b9a57b5a1d078e73 Mon Sep 17 00:00:00 2001 From: danisaev Date: Thu, 23 Apr 2026 00:20:13 +0300 Subject: [PATCH 37/71] docs(cfpq-paths-app/README.md): Small changes - Added an explanation of G in GLL - The note about familiarizing yourself with dsl is placed at the beginning of the document --- cfpq-paths-app/README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cfpq-paths-app/README.md b/cfpq-paths-app/README.md index e37f38f7c..e96f34905 100644 --- a/cfpq-paths-app/README.md +++ b/cfpq-paths-app/README.md @@ -2,6 +2,11 @@ > For demo purposes only! > Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). +> [!TIP] +> Before using the tool, we recommend familiarizing yourself with how to define a context-free grammar using DSL — +> including the concepts of terminals, non-terminals, and operations — +> via the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/). + This demo is based on UCFS, which, for a given grammar represented as an RSM, a graph, and start vertices, produces an SPPF. @@ -10,6 +15,9 @@ labeled directed graphs. It is based on the **GLL** algorithm. **Generalized LL parsing (GLL)** is a parsing technique that extends traditional LL parsing to handle any context-free grammar. + +* Generalized means the parser can handle any context-free grammar, including left-recursive and ambiguous ones + The name *LL* itself stands for * Left-to-right scanning of the input @@ -68,12 +76,6 @@ type. **Code for path extraction:** ```src/main/kotlin/simple_examples/example_1.kt``` - -> [!TIP] -> You can read about how to define a context-free grammar using DSL, including what a terminal and a non-terminal are, -> as well as about operations, by following -> the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/). - ## $a^nb^n$ Language **Grammar assignment** From cbd7706663305eff603f3ea34f630899f719997a Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 13 May 2026 14:05:16 +0300 Subject: [PATCH 38/71] chore: moving all the images to original folder --- .../src/main/kotlin/simple_examples/README.md | 20 +++++++++---------- .../figures/PointsToAnBnGrammarRsm.dot | 0 .../figures/PointsToAnBnGrammarRsm.dot.svg | 0 .../figures/example_1_graph.dot | 0 .../figures/example_1_graph.dot.svg | 0 .../figures/example_1_graph_sppf.dot | 0 .../figures/example_1_graph_sppf.dot.svg | 0 .../figures/example_1_graph_sppf_1tree.dot | 0 .../example_1_graph_sppf_1tree.dot.svg | 0 .../figures/example_1_graph_sppf_2tree.dot | 0 .../example_1_graph_sppf_2tree.dot.svg | 0 .../figures/example_2_graph.dot | 0 .../figures/example_2_graph.dot.svg | 0 .../figures/example_2_graph_sppf.dot | 0 .../figures/example_2_graph_sppf.dot.svg | 0 .../figures/example_2_graph_sppf_1tree.dot | 0 .../example_2_graph_sppf_1tree.dot.svg | 0 .../figures/example_2_graph_sppf_2tree.dot | 0 .../example_2_graph_sppf_2tree.dot.svg | 0 .../figures/example_3_graph.dot | 0 .../figures/example_3_graph.dot.svg | 0 .../figures/example_3_graph_sppf.dot | 0 .../figures/example_3_graph_sppf.dot.svg | 0 23 files changed, 10 insertions(+), 10 deletions(-) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/PointsToAnBnGrammarRsm.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/PointsToAnBnGrammarRsm.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph_sppf.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph_sppf.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph_sppf_1tree.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph_sppf_1tree.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph_sppf_2tree.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_1_graph_sppf_2tree.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph_sppf.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph_sppf.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph_sppf_1tree.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph_sppf_1tree.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph_sppf_2tree.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_2_graph_sppf_2tree.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_3_graph.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_3_graph.dot.svg (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_3_graph_sppf.dot (100%) rename cfpq-paths-app/src/main/{kotlin/simple_examples => resources}/figures/example_3_graph_sppf.dot.svg (100%) diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md index 1c91b73d3..772a1ce78 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md @@ -59,7 +59,7 @@ with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) Let's construct an RSM for the $a^n b^n$ grammar: -![RSM for AnBn Grammar](figures/PointsToAnBnGrammarRsm.dot.svg) +![RSM for AnBn Grammar](../../resources/figures/PointsToAnBnGrammarRsm.dot.svg) We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a non-terminal and terminals $aSb$ @@ -72,7 +72,7 @@ non-terminal and terminals $aSb$ **Input graph:** -![Simple AnBn Graph / Finite Set Of Path](figures/example_1_graph.dot.svg) +![Simple AnBn Graph / Finite Set Of Path](../../resources/figures/example_1_graph.dot.svg) Let's find *all* words that satisfy the language's grammar: @@ -81,7 +81,7 @@ Let's find *all* words that satisfy the language's grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Finite Set Of Path / SPPF](figures/example_1_graph_sppf.dot.svg) +![Simple AnBn Graph / Finite Set Of Path / SPPF](../../resources/figures/example_1_graph_sppf.dot.svg) **Let's see what the use of the algorithm gives us:** @@ -89,13 +89,13 @@ Let's divide SPPF into two trees: **The *first* tree:** -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](figures/example_1_graph_sppf_1tree.dot.svg) +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../../resources/figures/example_1_graph_sppf_1tree.dot.svg) We can actually see that this tree gives us the word $ab$ **The *second* tree:** -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](figures/example_1_graph_sppf_2tree.dot.svg) +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../../resources/figures/example_1_graph_sppf_2tree.dot.svg) When we parse this tree, we can see that this tree gives us the word $aabb$ @@ -105,7 +105,7 @@ Thus, the algorithm produced exactly what was expected. **Input graph:** -![Simple AnBn Graph / Infinite Set Of Path #1](figures/example_2_graph.dot.svg) +![Simple AnBn Graph / Infinite Set Of Path #1](../../resources/figures/example_2_graph.dot.svg) Let's find *some* words that satisfy the language's grammar: @@ -118,7 +118,7 @@ Let's find *some* words that satisfy the language's grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](figures/example_2_graph_sppf.dot.svg) +![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](../../resources/figures/example_2_graph_sppf.dot.svg) > [!NOTE] > This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. @@ -129,13 +129,13 @@ Let's divide SPPF into two trees: **The *first* tree:** -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](figures/example_2_graph_sppf_1tree.dot.svg) +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](../../resources/figures/example_2_graph_sppf_1tree.dot.svg) We can actually see that this tree gives us the word $ab$ **The *second* tree:** -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](figures/example_2_graph_sppf_2tree.dot.svg) +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](../../resources/figures/example_2_graph_sppf_2tree.dot.svg) When we analyze this tree, we see that this tree gives us the word $aaSbb$ @@ -149,7 +149,7 @@ Thus, the algorithm produced exactly what was expected. **Input graph:** -![Simple AnBn Graph / Iinite Set Of Path #2](figures/example_3_graph.dot.svg) +![Simple AnBn Graph / Iinite Set Of Path #2](../../resources/figures/example_3_graph.dot.svg) Let's find *some* words that satisfy the language's grammar: diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot b/cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot rename to cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg b/cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg rename to cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot rename to cfpq-paths-app/src/main/resources/figures/example_1_graph.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot rename to cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot rename to cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot rename to cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot rename to cfpq-paths-app/src/main/resources/figures/example_2_graph.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_2_graph.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot rename to cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot rename to cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot rename to cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot rename to cfpq-paths-app/src/main/resources/figures/example_3_graph.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_3_graph.dot.svg diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot rename to cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg rename to cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg From 30f91ba257f1a7ba37a817a5b78121e07334d8e6 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 13 May 2026 14:21:17 +0300 Subject: [PATCH 39/71] =?UTF-8?q?docs:=20=D0=A1hanging=20paths=20for=20ima?= =?UTF-8?q?ges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cfpq-paths-app/README.md | 20 +- .../gen/example_1_graph_sppf.dot | 48 -- .../gen/example_2_graph_sppf.dot | 54 -- .../gen/example_3_graph_sppf.dot | 671 ------------------ 4 files changed, 10 insertions(+), 783 deletions(-) delete mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot delete mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot delete mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot diff --git a/cfpq-paths-app/README.md b/cfpq-paths-app/README.md index e96f34905..6e3f1040e 100644 --- a/cfpq-paths-app/README.md +++ b/cfpq-paths-app/README.md @@ -106,7 +106,7 @@ with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) Let's construct an RSM for the $a^n b^n$ grammar: -![RSM for AnBn Grammar](src/main/kotlin/simple_examples/figures/PointsToAnBnGrammarRsm.dot.svg) +![RSM for AnBn Grammar](src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a non-terminal and terminals $aSb$ @@ -119,7 +119,7 @@ non-terminal and terminals $aSb$ **Input graph:** -![Simple AnBn Graph / Finite Set Of Path](src/main/kotlin/simple_examples/figures/example_1_graph.dot.svg) +![Simple AnBn Graph / Finite Set Of Path](src/main/resources/figures/example_1_graph.dot.svg) Let's find *all* words that satisfy the language's grammar: @@ -128,7 +128,7 @@ Let's find *all* words that satisfy the language's grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/kotlin/simple_examples/figures/example_1_graph_sppf.dot.svg) +![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/resources/figures/example_1_graph_sppf.dot.svg) **Let's see what the use of the algorithm gives us:** @@ -136,13 +136,13 @@ Let's divide SPPF into two trees: **The *first* tree:** -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/kotlin/simple_examples/figures/example_1_graph_sppf_1tree.dot.svg) +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) We can actually see that this tree gives us the word $ab$ **The *second* tree:** -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/kotlin/simple_examples/figures/example_1_graph_sppf_2tree.dot.svg) +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) When we parse this tree, we can see that this tree gives us the word $aabb$ @@ -152,7 +152,7 @@ Thus, the algorithm produced exactly what was expected. **Input graph:** -![Simple AnBn Graph / Infinite Set Of Path #1](src/main/kotlin/simple_examples/figures/example_2_graph.dot.svg) +![Simple AnBn Graph / Infinite Set Of Path #1](src/main/resources/figures/example_2_graph.dot.svg) Let's find *some* words that satisfy the language's grammar: @@ -165,7 +165,7 @@ Let's find *some* words that satisfy the language's grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/kotlin/simple_examples/figures/example_2_graph_sppf.dot.svg) +![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/resources/figures/example_2_graph_sppf.dot.svg) > [!NOTE] > This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. @@ -176,13 +176,13 @@ Let's divide SPPF into two trees: **The *first* tree:** -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/kotlin/simple_examples/figures/example_2_graph_sppf_1tree.dot.svg) +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) We can actually see that this tree gives us the word $ab$ **The *second* tree:** -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/kotlin/simple_examples/figures/example_2_graph_sppf_2tree.dot.svg) +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) When we analyze this tree, we see that this tree gives us the word $aaSbb$ @@ -196,7 +196,7 @@ Thus, the algorithm produced exactly what was expected. **Input graph:** -![Simple AnBn Graph / Iinite Set Of Path #2](src/main/kotlin/simple_examples/figures/example_3_graph.dot.svg) +![Simple AnBn Graph / Iinite Set Of Path #2](src/main/resources/figures/example_3_graph.dot.svg) Let's find *some* words that satisfy the language's grammar: diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot deleted file mode 100644 index a85d0c66b..000000000 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_1_graph_sppf.dot +++ /dev/null @@ -1,48 +0,0 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle] -_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle] -_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] -_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] -_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] -_0_0->_0_1 -_0_1->_0_11 -_0_1->_0_12 -_0_2->_0_13 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_8 -_0_7->_0_9 -_0_8->_0_10 -_0_11->_0_13 -_0_11->_0_14 -_0_12->_0_15 -_0_12->_0_16 -_0_13->_0_17 -_0_14->_0_18 -_0_15->_0_2 -_0_16->_0_18 -} - -} - diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot deleted file mode 100644 index 957352329..000000000 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_2_graph_sppf.dot +++ /dev/null @@ -1,54 +0,0 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] -_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] -_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] -_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] -_0_0->_0_1 -_0_1->_0_12 -_0_1->_0_14 -_0_2->_0_15 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_18 -_0_7->_0_8 -_0_8->_0_9 -_0_8->_0_10 -_0_9->_0_11 -_0_10->_0_13 -_0_12->_0_15 -_0_12->_0_16 -_0_13->_0_1 -_0_14->_0_17 -_0_14->_0_18 -_0_15->_0_19 -_0_16->_0_20 -_0_17->_0_2 -_0_18->_0_20 -} - -} - diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot b/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot deleted file mode 100644 index b83bc8506..000000000 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/gen/example_3_graph_sppf.dot +++ /dev/null @@ -1,671 +0,0 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_0_3 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_4 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_0_5 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_0_6 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_0_7 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_0_8 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_9 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle] -_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle] -_0_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_0_13 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_0_14 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_0_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_17 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_0_18 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_19 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_0_20 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_21 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle] -_0_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_0_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_26 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_0_27 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_28 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_0_29 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_0_31 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_0_33 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_0_36 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_0_38 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_0_40 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_0_42 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_0_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] -_0_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_47 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_0->_0_1 -_0_1->_0_12 -_0_2->_0_3 -_0_3->_0_4 -_0_3->_0_5 -_0_4->_0_6 -_0_4->_0_7 -_0_5->_0_8 -_0_5->_0_9 -_0_6->_0_10 -_0_7->_0_11 -_0_8->_0_13 -_0_9->_0_11 -_0_12->_0_23 -_0_12->_0_34 -_0_13->_0_6 -_0_13->_0_14 -_0_14->_0_15 -_0_15->_0_16 -_0_16->_0_17 -_0_17->_0_18 -_0_17->_0_34 -_0_18->_0_19 -_0_19->_0_20 -_0_19->_0_21 -_0_20->_0_22 -_0_21->_0_24 -_0_23->_0_44 -_0_24->_0_25 -_0_25->_0_26 -_0_26->_0_27 -_0_26->_0_9 -_0_27->_0_28 -_0_28->_0_46 -_0_28->_0_29 -_0_29->_0_30 -_0_30->_0_31 -_0_31->_0_32 -_0_32->_0_33 -_0_32->_0_34 -_0_33->_0_35 -_0_34->_0_45 -_0_35->_0_6 -_0_35->_0_36 -_0_36->_0_37 -_0_37->_0_38 -_0_38->_0_39 -_0_39->_0_40 -_0_39->_0_9 -_0_40->_0_41 -_0_41->_0_20 -_0_41->_0_42 -_0_42->_0_43 -_0_43->_0_1 -_0_44->_0_46 -_0_44->_0_47 -_0_46->_0_48 -_0_47->_0_2 -} - -subgraph cluster_1{ -labelloc="t" -_1_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_1_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_1_3 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_1_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_1_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] -_1_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_1_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle] -_1_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_1_14 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_15 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_1_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_17 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_1_18 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_1_19 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle] -_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_1_22 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_24 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_1_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_26 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_1_27 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_1_29 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_30 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_1_31 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_1_32 [label = "38 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_1_33 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_1_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_1_36 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_1_38 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_1_40 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_1_42 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_1_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] -_1_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_1_47 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] -_1_0->_1_1 -_1_1->_1_12 -_1_2->_1_3 -_1_3->_1_4 -_1_4->_1_5 -_1_4->_1_6 -_1_5->_1_7 -_1_6->_1_8 -_1_7->_1_9 -_1_7->_1_10 -_1_9->_1_11 -_1_10->_1_13 -_1_12->_1_23 -_1_12->_1_34 -_1_13->_1_14 -_1_14->_1_15 -_1_15->_1_16 -_1_15->_1_34 -_1_16->_1_17 -_1_17->_1_18 -_1_17->_1_19 -_1_18->_1_20 -_1_19->_1_21 -_1_21->_1_22 -_1_22->_1_24 -_1_23->_1_44 -_1_24->_1_25 -_1_24->_1_6 -_1_25->_1_26 -_1_26->_1_46 -_1_26->_1_27 -_1_27->_1_28 -_1_28->_1_29 -_1_29->_1_30 -_1_29->_1_31 -_1_30->_1_9 -_1_30->_1_32 -_1_31->_1_33 -_1_31->_1_34 -_1_32->_1_45 -_1_33->_1_35 -_1_34->_1_45 -_1_35->_1_9 -_1_35->_1_36 -_1_36->_1_37 -_1_37->_1_38 -_1_38->_1_39 -_1_39->_1_40 -_1_39->_1_6 -_1_40->_1_41 -_1_41->_1_18 -_1_41->_1_42 -_1_42->_1_43 -_1_43->_1_1 -_1_44->_1_46 -_1_44->_1_47 -_1_46->_1_48 -_1_47->_1_2 -} - -subgraph cluster_2{ -labelloc="t" -_2_0 [label = "0 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_2_1 [label = "1 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_2_3 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_2_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_2_7 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] -_2_9 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_2_10 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle] -_2_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_2_14 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_2_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_17 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_2_18 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_2_19 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle] -_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_2_22 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_23 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_24 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_2_25 [label = "31 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_2_26 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_2_27 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_2_29 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_2_31 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_2_33 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_2_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_2_36 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_2_38 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_2_40 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_2_42 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_2_44 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] -_2_46 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_2_47 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle] -_2_0->_2_1 -_2_1->_2_12 -_2_2->_2_3 -_2_3->_2_4 -_2_4->_2_5 -_2_4->_2_6 -_2_5->_2_7 -_2_6->_2_8 -_2_7->_2_9 -_2_7->_2_10 -_2_9->_2_11 -_2_10->_2_13 -_2_12->_2_23 -_2_12->_2_34 -_2_13->_2_14 -_2_14->_2_15 -_2_15->_2_16 -_2_15->_2_34 -_2_16->_2_17 -_2_17->_2_18 -_2_17->_2_19 -_2_18->_2_20 -_2_19->_2_21 -_2_21->_2_22 -_2_22->_2_24 -_2_22->_2_25 -_2_23->_2_44 -_2_24->_2_46 -_2_24->_2_26 -_2_25->_2_27 -_2_25->_2_6 -_2_26->_2_8 -_2_27->_2_28 -_2_28->_2_46 -_2_28->_2_29 -_2_29->_2_30 -_2_30->_2_31 -_2_31->_2_32 -_2_32->_2_33 -_2_32->_2_34 -_2_33->_2_35 -_2_34->_2_45 -_2_35->_2_9 -_2_35->_2_36 -_2_36->_2_37 -_2_37->_2_38 -_2_38->_2_39 -_2_39->_2_40 -_2_39->_2_6 -_2_40->_2_41 -_2_41->_2_18 -_2_41->_2_42 -_2_42->_2_43 -_2_43->_2_1 -_2_44->_2_46 -_2_44->_2_47 -_2_46->_2_48 -_2_47->_2_2 -} - -subgraph cluster_3{ -labelloc="t" -_3_0 [label = "0 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_3_1 [label = "1 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_2 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_3_3 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_3_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_6 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_3_7 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_8 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_3_9 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle] -_3_11 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_3_12 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_3_13 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle] -_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_3_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_17 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_3_18 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_19 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_3_20 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_3_21 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle] -_3_23 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_3_25 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_3_27 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_3_29 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_3_31 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_3_33 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_34 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_3_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_3_36 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_3_38 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_3_40 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_3_42 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_3_44 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_3_45 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_46 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle] -_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle] -_3_0->_3_1 -_3_1->_3_12 -_3_1->_3_23 -_3_2->_3_34 -_3_2->_3_3 -_3_3->_3_4 -_3_4->_3_5 -_3_5->_3_6 -_3_6->_3_7 -_3_6->_3_8 -_3_7->_3_9 -_3_8->_3_10 -_3_9->_3_11 -_3_9->_3_13 -_3_11->_3_14 -_3_12->_3_34 -_3_12->_3_44 -_3_13->_3_15 -_3_15->_3_16 -_3_16->_3_17 -_3_17->_3_18 -_3_17->_3_46 -_3_18->_3_19 -_3_19->_3_20 -_3_19->_3_21 -_3_20->_3_22 -_3_21->_3_24 -_3_23->_3_45 -_3_23->_3_46 -_3_24->_3_25 -_3_25->_3_26 -_3_26->_3_27 -_3_26->_3_8 -_3_27->_3_28 -_3_28->_3_34 -_3_28->_3_29 -_3_29->_3_30 -_3_30->_3_31 -_3_31->_3_32 -_3_32->_3_33 -_3_32->_3_46 -_3_33->_3_35 -_3_34->_3_47 -_3_35->_3_11 -_3_35->_3_36 -_3_36->_3_37 -_3_37->_3_38 -_3_38->_3_39 -_3_39->_3_40 -_3_39->_3_8 -_3_40->_3_41 -_3_41->_3_20 -_3_41->_3_42 -_3_42->_3_43 -_3_43->_3_1 -_3_44->_3_48 -_3_45->_3_2 -_3_46->_3_48 -} - -subgraph cluster_4{ -labelloc="t" -_4_0 [label = "0 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_4_1 [label = "1 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_4_3 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_4_5 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_4_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] -_4_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_4_10 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] -_4_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_4_14 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_4_16 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_17 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_4_18 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_4_19 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] -_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_4_22 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_23 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_24 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_4_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_26 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_4_27 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_4_29 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_30 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_4_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_32 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_4_33 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_4_36 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_37 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_4_38 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_4_39 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_4_40 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_4_42 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_4_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] -_4_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_4_47 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] -_4_0->_4_1 -_4_1->_4_12 -_4_2->_4_3 -_4_3->_4_4 -_4_4->_4_5 -_4_4->_4_6 -_4_5->_4_7 -_4_6->_4_8 -_4_7->_4_9 -_4_7->_4_10 -_4_9->_4_11 -_4_10->_4_13 -_4_12->_4_23 -_4_12->_4_34 -_4_13->_4_14 -_4_14->_4_15 -_4_15->_4_16 -_4_15->_4_34 -_4_16->_4_17 -_4_17->_4_18 -_4_17->_4_19 -_4_18->_4_20 -_4_19->_4_21 -_4_21->_4_22 -_4_22->_4_24 -_4_23->_4_44 -_4_24->_4_25 -_4_24->_4_6 -_4_25->_4_26 -_4_26->_4_46 -_4_26->_4_27 -_4_27->_4_28 -_4_28->_4_29 -_4_29->_4_30 -_4_30->_4_31 -_4_30->_4_34 -_4_31->_4_32 -_4_32->_4_9 -_4_32->_4_33 -_4_33->_4_35 -_4_34->_4_45 -_4_35->_4_36 -_4_36->_4_37 -_4_36->_4_38 -_4_37->_4_18 -_4_37->_4_39 -_4_38->_4_40 -_4_38->_4_6 -_4_39->_4_8 -_4_40->_4_41 -_4_41->_4_18 -_4_41->_4_42 -_4_42->_4_43 -_4_43->_4_1 -_4_44->_4_46 -_4_44->_4_47 -_4_46->_4_48 -_4_47->_4_2 -} - -subgraph cluster_5{ -labelloc="t" -_5_0 [label = "0 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_5_1 [label = "1 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_5_3 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_5_5 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_5_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] -_5_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_5_10 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] -_5_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium] -_5_14 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_15 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_5_16 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_5_17 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_5_18 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_5_19 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] -_5_21 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_5_22 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_23 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium] -_5_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_5_27 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_28 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_5_29 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium] -_5_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_5_33 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_5_35 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_5_36 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium] -_5_38 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_5_40 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_5_42 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium] -_5_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] -_5_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_5_47 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] -_5_0->_5_1 -_5_1->_5_12 -_5_2->_5_3 -_5_3->_5_4 -_5_4->_5_5 -_5_4->_5_6 -_5_5->_5_7 -_5_6->_5_8 -_5_7->_5_9 -_5_7->_5_10 -_5_9->_5_11 -_5_10->_5_13 -_5_12->_5_23 -_5_12->_5_34 -_5_13->_5_14 -_5_14->_5_15 -_5_14->_5_16 -_5_15->_5_17 -_5_15->_5_18 -_5_16->_5_19 -_5_16->_5_34 -_5_17->_5_20 -_5_18->_5_45 -_5_19->_5_21 -_5_21->_5_17 -_5_21->_5_22 -_5_22->_5_24 -_5_23->_5_44 -_5_24->_5_25 -_5_25->_5_26 -_5_26->_5_27 -_5_26->_5_6 -_5_27->_5_28 -_5_28->_5_46 -_5_28->_5_29 -_5_29->_5_30 -_5_30->_5_31 -_5_31->_5_32 -_5_32->_5_33 -_5_32->_5_34 -_5_33->_5_35 -_5_34->_5_45 -_5_35->_5_9 -_5_35->_5_36 -_5_36->_5_37 -_5_37->_5_38 -_5_38->_5_39 -_5_39->_5_40 -_5_39->_5_6 -_5_40->_5_41 -_5_41->_5_17 -_5_41->_5_42 -_5_42->_5_43 -_5_43->_5_1 -_5_44->_5_46 -_5_44->_5_47 -_5_46->_5_48 -_5_47->_5_2 -} - -} - From 8ce79ffa9e7ebc631af5770e48f14cd230ff18d2 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 13 May 2026 14:48:51 +0300 Subject: [PATCH 40/71] chore: changing the project structure --- cfpq-paths-app/build.gradle.kts | 2 +- .../ucfs/paths/examples}/example_1.kt | 202 +++++++++--------- .../src/main/kotlin/simple_examples/README.md | 167 --------------- 3 files changed, 101 insertions(+), 270 deletions(-) rename cfpq-paths-app/src/main/kotlin/{simple_examples => org/ucfs/paths/examples}/example_1.kt (90%) delete mode 100644 cfpq-paths-app/src/main/kotlin/simple_examples/README.md diff --git a/cfpq-paths-app/build.gradle.kts b/cfpq-paths-app/build.gradle.kts index 3f637dbc4..c83691b5c 100644 --- a/cfpq-paths-app/build.gradle.kts +++ b/cfpq-paths-app/build.gradle.kts @@ -22,6 +22,6 @@ application { tasks.register("runSimpleExamples") { dependsOn("classes") - mainClass.set("simple_examples.Example_1Kt") + mainClass.set("org.ucfs.paths.examples.Example_1Kt") classpath = sourceSets["main"].runtimeClasspath } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt similarity index 90% rename from cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt rename to cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt index 5880a23b9..7d638b816 100644 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/example_1.kt +++ b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt @@ -1,102 +1,100 @@ -package simple_examples - -import org.ucfs.grammar.combinator.Grammar -import org.ucfs.grammar.combinator.extension.StringExtension.times -import org.ucfs.grammar.combinator.regexp.Nt -import org.ucfs.grammar.combinator.regexp.Option -import org.ucfs.input.DotParser -import org.ucfs.input.InputGraph -import org.ucfs.input.TerminalInputLabel -import org.ucfs.parser.Gll -import org.ucfs.sppf.getSppfDot -import org.ucfs.sppf.node.* -import java.nio.file.Files -import java.nio.file.Path -import org.ucfs.rsm.writeRsmToDot - -class PointsToAnBnGrammar : Grammar() { - val S by Nt().asStart() - - init { - S /= "a" * Option(S) * "b" - } -} - -fun readGraph(name: String): InputGraph { - val dotGraph = object {}.javaClass.getResource("/$name")?.readText() - ?: throw RuntimeException("File $name is not found in resources") - val dotParser = DotParser() - return dotParser.parseDot(dotGraph) -} - -data class OutEdge(val start: Int, val symbol: String, val end: Int) { - override fun toString(): String = "(" + start.toString() + "-" + symbol + "->" + end.toString() + ")" -} - -fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { - if (maxDepth == 0) { - return null - } - when (val nodeType = node.type) { - is TerminalType<*> -> { - val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") - return listOf(listOf(OutEdge(range.from, nodeType.terminal.toString(), range.to))) - } - - is EpsilonNonterminalType -> { - return listOf(emptyList()) - } - - is EmptyType -> { - throw RuntimeException("SPPF cannot contain EmptyRange") - } - - is IntermediateType<*>, is NonterminalType -> { - val subPaths = node.children.map { getPathFromSppf(it, maxDepth - 1) } - if (subPaths.any { it == null }) { - return null - } - val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> - acc.flatMap { list -> lst.map { element -> list + element } } - } - return paths - } - - is Range -> { - val paths = node.children.map { - getPathFromSppf(it, maxDepth - 1)?.filterNotNull() - }.filterNotNull().flatten() - if (paths.isEmpty()) { - return null - } - return paths - } - - else -> { - println("Type of node is ${node.type.javaClass}") - throw RuntimeException("Unknown RangeType in SPPF") - } - } -} - -fun saveSppf(name: String, sppf: Set>) { - val graphName = name.removeSuffix(".dot") - val genPath = Path.of("src", "main", "kotlin", "simple_examples", "gen") - Files.createDirectories(genPath) - val file = genPath.resolve("${graphName}_sppf.dot").toFile() - - file.printWriter().use { out -> - out.println(getSppfDot(sppf)) - } -} - -fun main() { - listOf("example_1_graph.dot", "example_2_graph.dot", "example_3_graph.dot").forEach { graphName -> - val graph = readGraph(graphName) - val grammar = PointsToAnBnGrammar() -// writeRsmToDot(grammar.rsm, "${grammar.name}Rsm") - val gll = Gll.gll(grammar.rsm, graph) - val sppf = gll.parse() - saveSppf(graphName, sppf) - } -} +package org.ucfs.paths.examples + +import org.ucfs.grammar.combinator.Grammar +import org.ucfs.grammar.combinator.extension.StringExtension.times +import org.ucfs.grammar.combinator.regexp.Nt +import org.ucfs.grammar.combinator.regexp.Option +import org.ucfs.input.DotParser +import org.ucfs.input.InputGraph +import org.ucfs.input.TerminalInputLabel +import org.ucfs.parser.Gll +import org.ucfs.sppf.getSppfDot +import org.ucfs.sppf.node.* +import java.nio.file.Files +import java.nio.file.Path + +class PointsToAnBnGrammar : Grammar() { + val S by Nt().asStart() + + init { + S /= "a" * Option(S) * "b" + } +} + +fun readGraph(name: String): InputGraph { + val dotGraph = object {}.javaClass.getResource("/$name")?.readText() + ?: throw RuntimeException("File $name is not found in resources") + val dotParser = DotParser() + return dotParser.parseDot(dotGraph) +} + +data class OutEdge(val start: Int, val symbol: String, val end: Int) { + override fun toString(): String = "(" + start.toString() + "-" + symbol + "->" + end.toString() + ")" +} + +fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { + if (maxDepth == 0) { + return null + } + when (val nodeType = node.type) { + is TerminalType<*> -> { + val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") + return listOf(listOf(OutEdge(range.from, nodeType.terminal.toString(), range.to))) + } + + is EpsilonNonterminalType -> { + return listOf(emptyList()) + } + + is EmptyType -> { + throw RuntimeException("SPPF cannot contain EmptyRange") + } + + is IntermediateType<*>, is NonterminalType -> { + val subPaths = node.children.map { getPathFromSppf(it, maxDepth - 1) } + if (subPaths.any { it == null }) { + return null + } + val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> + acc.flatMap { list -> lst.map { element -> list + element } } + } + return paths + } + + is Range -> { + val paths = node.children.map { + getPathFromSppf(it, maxDepth - 1)?.filterNotNull() + }.filterNotNull().flatten() + if (paths.isEmpty()) { + return null + } + return paths + } + + else -> { + println("Type of node is ${node.type.javaClass}") + throw RuntimeException("Unknown RangeType in SPPF") + } + } +} + +fun saveSppf(name: String, sppf: Set>) { + val graphName = name.removeSuffix(".dot") + val genPath = Path.of("gen", "sppf") + Files.createDirectories(genPath) + val file = genPath.resolve("${graphName}_sppf.dot").toFile() + + file.printWriter().use { out -> + out.println(getSppfDot(sppf)) + } +} + +fun main() { + listOf("example_1_graph.dot", "example_2_graph.dot", "example_3_graph.dot").forEach { graphName -> + val graph = readGraph(graphName) + val grammar = PointsToAnBnGrammar() + val gll = Gll.gll(grammar.rsm, graph) + val sppf = gll.parse() + saveSppf(graphName, sppf) + } +} diff --git a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md b/cfpq-paths-app/src/main/kotlin/simple_examples/README.md deleted file mode 100644 index 772a1ce78..000000000 --- a/cfpq-paths-app/src/main/kotlin/simple_examples/README.md +++ /dev/null @@ -1,167 +0,0 @@ -> [!IMPORTANT] -> This file is a tutorial and demonstration of how to use the UCFS tool. - -**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and -labeled directed graphs. It is based on the **GLL** algorithm. - -**Generalized LL parsing (GLL)** is a parsing technique that extends traditional LL parsing to handle any context-free -grammar. -The name *LL* itself stands for - -* Left-to-right scanning of the input -* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) - -> [!TIP] -> You can read more about GLL by following -> the [link](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5). - -**To run (from project root):** - -```bash -./gradlew :cfpq-paths-app:runSimpleExamples -``` - -**Code for path extraction:** ```src/main/kotlin/simple_examples/example_1.kt``` - - -> [!TIP] -> You can read about how to define a context-free grammar using DSL, including what a terminal and a non-terminal are, -> as well as about operations, by following -> the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/). - -## $a^nb^n$ Language - -**Grammar assignment** - -Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end -with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) -> [!NOTE] -> Please note that we can do this in several ways. ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * Option(S) * "b" -> } ->} ->``` ->or ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * (Epsilon or S) * "b" -> } ->} ->``` - -Let's construct an RSM for the $a^n b^n$ grammar: - -![RSM for AnBn Grammar](../../resources/figures/PointsToAnBnGrammarRsm.dot.svg) - -We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a -non-terminal and terminals $aSb$ - -> [!NOTE] -> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node -> (red circle). - -**Example 1: Simple graph with a finite set of paths** - -**Input graph:** - -![Simple AnBn Graph / Finite Set Of Path](../../resources/figures/example_1_graph.dot.svg) - -Let's find *all* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 2) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Finite Set Of Path / SPPF](../../resources/figures/example_1_graph_sppf.dot.svg) - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../../resources/figures/example_1_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../../resources/figures/example_1_graph_sppf_2tree.dot.svg) - -When we parse this tree, we can see that this tree gives us the word $aabb$ - -Thus, the algorithm produced exactly what was expected. - -**Example 2: Simple graph with an infinite number of paths #1** - -**Input graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1](../../resources/figures/example_2_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 1) -* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) -* ... - -> [!NOTE] -> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](../../resources/figures/example_2_graph_sppf.dot.svg) - -> [!NOTE] -> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](../../resources/figures/example_2_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](../../resources/figures/example_2_graph_sppf_2tree.dot.svg) - -When we analyze this tree, we see that this tree gives us the word $aaSbb$ - -> [!NOTE] -> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we -> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. - -Thus, the algorithm produced exactly what was expected. - -**Example 3: Simple graph with an infinite set of paths #2** - -**Input graph:** - -![Simple AnBn Graph / Iinite Set Of Path #2](../../resources/figures/example_3_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (1 -a-> 2 -b-> 3) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) -* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) -* ... - -> [!NOTE] -> We get an infinite number of words. Words cover the entire language thanks to several starting points. - -**Resulting SPPF graph** is too big, you can find it in -```src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg``` - -*Default location of all generated SPPFs:* ```src/main/kotlin/simple_examples/gen``` From 42de858d68b43fdaaa222614b64ad7a39f7d13e5 Mon Sep 17 00:00:00 2001 From: danisaev Date: Thu, 14 May 2026 20:43:34 +0300 Subject: [PATCH 41/71] docs(TUTORIAL.md): Added the tutorial for using UCFS --- cfpq-paths-app/TUTORIAL.md | 560 +++++++++++++++++++++++++++++++++++++ 1 file changed, 560 insertions(+) create mode 100644 cfpq-paths-app/TUTORIAL.md diff --git a/cfpq-paths-app/TUTORIAL.md b/cfpq-paths-app/TUTORIAL.md new file mode 100644 index 000000000..5c654c89e --- /dev/null +++ b/cfpq-paths-app/TUTORIAL.md @@ -0,0 +1,560 @@ +## Tutorial + +This guide will help you understand how to use UCFS. + +## Basic concepts and terms + +**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and +labeled directed graphs. It is based on the **GLL** algorithm. + +**Generalized LL parsing ([GLL](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5))** is a parsing technique +that extends traditional LL parsing to handle any context-free +grammar. + +* Generalized means the parser can handle any context-free grammar, including left-recursive and ambiguous ones + +The name *LL* itself stands for + +* Left-to-right scanning of the input +* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) + +**RSM** (Recursive State Machine) is an automaton-like representation of context-free languages. + +**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths +satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. +SPPF consists of nodes. Each node has a unique Id and detailed information specific to its +type. + +## Introduction to context-free languages + +A context-free language is a set of strings that can be generated by a set of replacement **rules**. + +Each rule looks like this: + +``` +A -> something +``` + +* Left side: one symbol (called a non-terminal) +* Right side: a sequence of terminals and non-terminals + +Terminal — a concrete symbol (like a, b, +, if). Cannot be replaced further + +Non-terminal — a placeholder that must be replaced using rules + +**Example:** + +Grammar for $a^nb^n$ (n $a$ followed by n $b$): + +``` +S -> a S b +S -> ε +``` + +Here $S$ is a non-terminal, $a$ and $b$ are terminals, $ε$ means empty. + +**Context-free** means, that you can replace a non-terminal anywhere, anytime, regardless of what surrounds it. The rule +does not look at neighbors. + +## Defining graphs + +UCFS accepts graphs in DOT format. + +**DOT** is a plain-text format for describing graphs. It uses a simple structure: + +* Vertices (nodes) +* Edges between vertices +* Optional labels on edges + +```dot +digraph G { + 0 -> 1 [label="a"] + 1 -> 2 [label="b"] +} +``` + +This describes: + +* Vertices: $0, 1, 2$ +* Edge from $0$ to $1$ labeled $a$ +* Edge from $1$ to $2$ labeled $b$ + +Vertices can be defined explicitly: + +```dot +digraph G { + 0 -> 1 [label="a"] + 1 -> 2 [label="b"] + + 0 [label="entry"] + 1 [label="middle"] + 2 [label="exit"] +} +``` + +UCFS needs to know where to start: + +```dot +digraph G { + start -> 0; + 0 -> 1 [label="a"]; + 1 -> 2 [label="b"]; + + 0 [label="entry"] + 1 [label="middle"] + 2 [label="exit"] +} +``` + +## Defining the grammar + +UCFS uses a DSL (Domain Specific Language) to +define context-free grammars. + +Basic structure: + +```kotlin +class MyGrammar : Grammar() { + val S by Nt().asStart() + + init { + S /= "a" * "b" + } +} +``` + +This defines the language $ab$ (single $a$ followed by single $b$) + +You can read more about DSL and find other operations for defining grammars by following +the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/) + +## Getting started with UCFS + +> [!CAUTION] +> For demo purposes only! +> Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). + +**Requirements**: 11 java + +Before running, understand the pipeline: + +``` +INPUT 1: Grammar (CFG) ─────┐ + ├──► UCFS ──► OUTPUT: SPPF +INPUT 2: Graph (DOT) ───────┘ +``` + +* Grammar describes a language (set of strings) +* Graph contains many paths (each path produces a string of edge labels) +* UCFS finds every path whose string belongs to the grammar's language + +Example: + +``` +Grammar: S → a b (language: just "ab") +Graph: 0 -a→ 1 -b→ 2 (one path: "ab") + 0 -a→ 3 -b→ 2 (another path: "ab") + +UCFS finds: BOTH paths (both produce "ab") +Result: SPPF with two packed alternatives +``` + +Default locations: + +* Input graphs ```cfpq-paths-app/src/main/resources``` +* Generated SPPF ```cfpq-paths-app/gen/sppf``` + +## Types of nodes in SPPF + +The resulting SPPF consists of several types of nodes. Each node has a unique ID and stores specific information. + +* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the + start and end of paths derived from that non-terminal. + + ![Graph for example 1](./src/main/resources/figures/Nonterm_example.dot.svg) + + This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal + ```S``` + +* **Terminal** node is a leaf and corresponds to an edge. + + ![Graph for example 1](./src/main/resources/figures/Terminal_example.dot.svg) + + This node depicts edge ```3 -alloc-> 4```. + +* **Epsilon** node is a simplified way to represent that $\varepsilon$ is derived at a specific position. + + ![Graph for example 1](./src/main/resources/figures/Epsilon_example.dot.svg) + +* **Range** node is a supplementary node that helps reuse subtrees. + + ![Graph for example 1](./src/main/resources/figures/Range_example.dot.svg) + + This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. + +* **Intermediate** node is a supplementary node used to connect subpaths. + + ![Graph for example 1](./src/main/resources/figures/Intermediate_example.dot.svg) + + This node depicts that the path from 0 to 2 is composed of two parts: from 0 to 1 and from 1 to 2. + +## Using UCFS with simple examples + +It is necessary to set the grammar in the code located +```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` + +**Grammar assignment** + +Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end +with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) +> [!NOTE] +> Please note that we can do this in several ways. +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * Option(S) * "b" +> } +>} +>``` +>or +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * (Epsilon or S) * "b" +> } +>} +>``` + +Let's construct an RSM for the $a^n b^n$ grammar: + +![RSM for AnBn Grammar](src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) + +We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a +non-terminal and terminals $aSb$ + +> [!NOTE] +> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node +> (red circle). + +**To run (from project root):** + +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` + +**Example 1: Simple graph with a finite set of paths** + +**Input graph:** + +![Simple AnBn Graph / Finite Set Of Path](src/main/resources/figures/example_1_graph.dot.svg) + +Let's find *all* words that satisfy the language's grammar: + +* $ab$ (0 -a-> 1 -b-> 2) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/resources/figures/example_1_graph_sppf.dot.svg) + +**Let's see what the use of the algorithm gives us:** + +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) + +When we parse this tree, we can see that this tree gives us the word $aabb$ + +Thus, the algorithm produced exactly what was expected. + +**Example 2: Simple graph with an infinite number of paths #1** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1](src/main/resources/figures/example_2_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (0 -a-> 1 -b-> 1) +* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) +* ... + +> [!NOTE] +> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/resources/figures/example_2_graph_sppf.dot.svg) + +> [!NOTE] +> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. + +**Let's see what the use of the algorithm gives us:** + +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) + +When we analyze this tree, we see that this tree gives us the word $aaSbb$ + +> [!NOTE] +> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we +> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. + +Thus, the algorithm produced exactly what was expected. + +**Example 3: Simple graph with an infinite set of paths #2** + +**Input graph:** + +![Simple AnBn Graph / Iinite Set Of Path #2](src/main/resources/figures/example_3_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (1 -a-> 2 -b-> 3) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) +* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) +* ... + +> [!NOTE] +> We get an infinite number of words. Words cover the entire language thanks to several starting points. + +**Resulting SPPF graph** is too big, you can find it in +```src/main/resources/figures/example_3_graph_sppf.dot.svg``` + +## Using UCFS to complex examples + +Let's move on to examples that demonstrate the tool's performance in real-life scenarios. + +**Grammar and code for paths extraction:** ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/Main.kt``` + +**To run (from project root)**: + +```bash +./gradlew :cfpq-paths-app:run +``` + +> [!NOTE] +> We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. + +We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted +paths. + +For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to +analyze chains of fields. + +``` +PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" +FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* +Alias -> PointsTo FlowsTo +S -> (Alias? "store_i")* PointsTo +``` + +For all our examples, we use a common grammar with $i \in [0..3]$. +The corresponding RSM is presented below: + +![Graph for example 1](./src/main/resources/figures/rsm.dot.svg) + +### Example 1 + +Code snippet: + +```java +val n = new X() +val y = new Y() +val z = new Z() +val l = n +val t = y +l.u = y +t.v = z +``` + +Respective graph: + +![Graph for example 1](./src/main/resources/figures/graph_1.dot.svg) + +Resulting SPPF: + +![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) + +Three trees are extracted because there are three paths of interest from node 1. +We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful +information for restoring fields. + +Respective paths: + +* [(1-PointsTo->0)] + + This path is trivial. Such paths will be omitted in further examples. + +* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + This path means that ```n.u = new Y()```. Vertex 2 is an alias for 1 (corresponding to ```n```), and 2 has a field ```u``` that points to ```new Y()``` (```store_0``` corresponds to ```l.u = y```). + +* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] + + This path means that ```n.u.v = new Z()```. + +### Example 2 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + l.next = new X() + l = l.next +} +``` + +Respective graph: + +![Graph for example 2](./src/main/resources/figures/graph_2.dot.svg) + +Part of resulting SPPF: + +![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) + +This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because +there are infinitely many paths of interest. We extract some of them: + +* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next.next = new X () // line 4``` + +More paths can be extracted if needed. Traversal should be tuned accordingly. + +### Example 3 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + val t = new X() + l.next = t + l = t +} +``` + +Respective graph: + +![Graph for example 3](./src/main/resources/figures/graph_3.dot.svg) + +Part of resulting SPPF: + +![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) + +This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of +them. + +* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next.next = new X() // line 4``` + +### Example 4 + +Code snippet: + +```java +val n = new X() +val z = new Z() +val u = new U() +z.x = n +u.y = n +val v = z.x +v.p = new Y() +val r = u.y +r.q = new P() +``` + +Respective graph: + +![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) + +For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in +this example, we specify two vertices as start: 1 and 8. + +* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```n.q = new P()``` + +* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```n.p = new Y() ``` + +* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```v.q = new P() ``` + +* [(8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + +* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + + From 4788d083608ad288e6954fe7362509e35b960fb0 Mon Sep 17 00:00:00 2001 From: danisaev Date: Fri, 15 May 2026 15:45:38 +0300 Subject: [PATCH 42/71] docs(README.md): Deleted TUTORIAL.md for README.md --- cfpq-paths-app/README.md | 991 +++++++++++++++++++++---------------- cfpq-paths-app/TUTORIAL.md | 560 --------------------- 2 files changed, 560 insertions(+), 991 deletions(-) delete mode 100644 cfpq-paths-app/TUTORIAL.md diff --git a/cfpq-paths-app/README.md b/cfpq-paths-app/README.md index 6e3f1040e..aec5db1a4 100644 --- a/cfpq-paths-app/README.md +++ b/cfpq-paths-app/README.md @@ -1,431 +1,560 @@ -> [!CAUTION] -> For demo purposes only! -> Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). - -> [!TIP] -> Before using the tool, we recommend familiarizing yourself with how to define a context-free grammar using DSL — -> including the concepts of terminals, non-terminals, and operations — -> via the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/). - -This demo is based on UCFS, which, for a given grammar represented as an RSM, a graph, and start vertices, produces an -SPPF. - -**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and -labeled directed graphs. It is based on the **GLL** algorithm. - -**Generalized LL parsing (GLL)** is a parsing technique that extends traditional LL parsing to handle any context-free -grammar. - -* Generalized means the parser can handle any context-free grammar, including left-recursive and ambiguous ones - -The name *LL* itself stands for - -* Left-to-right scanning of the input -* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) - -> [!TIP] -> You can read more about GLL by following -> the [link](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5). - -**RSM** (Recursive State Machine) is an automaton-like representation of context-free languages. - -**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths -satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. -SPPF consists of nodes of the types listed below. Each node has a unique Id and detailed information specific to its -type. - -* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the - start and end of paths derived from that non-terminal. - - ![Graph for example 1](./src/main/resources/figures/Nonterm_example.dot.svg) - - This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal - ```S``` - -* **Terminal** node is a leaf and corresponds to an edge. - - ![Graph for example 1](./src/main/resources/figures/Terminal_example.dot.svg) - - This node depicts edge ```3 -alloc-> 4```. - -* **Epsilon** node is a simplified way to represent that $\varepsilon$ is derived at a specific position. - - ![Graph for example 1](./src/main/resources/figures/Epsilon_example.dot.svg) - -* **Range** node is a supplementary node that helps reuse subtrees. - - ![Graph for example 1](./src/main/resources/figures/Range_example.dot.svg) - - This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. - -* **Intermediate** node is a supplementary node used to connect subpaths. - - ![Graph for example 1](./src/main/resources/figures/Intermediate_example.dot.svg) - - This node depicts that the path from 0 to 2 is composed of two parts: from 0 to 1 and from 1 to 2. - -**Requirements**: 11 java - -## Section 1: Simple usage examples - -**To run (from project root):** - -```bash -./gradlew :cfpq-paths-app:runSimpleExamples -``` - -**Code for path extraction:** ```src/main/kotlin/simple_examples/example_1.kt``` - -## $a^nb^n$ Language - -**Grammar assignment** - -Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end -with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) -> [!NOTE] -> Please note that we can do this in several ways. ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * Option(S) * "b" -> } ->} ->``` ->or ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * (Epsilon or S) * "b" -> } ->} ->``` - -Let's construct an RSM for the $a^n b^n$ grammar: - -![RSM for AnBn Grammar](src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) - -We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a -non-terminal and terminals $aSb$ - -> [!NOTE] -> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node -> (red circle). - -**Example 1: Simple graph with a finite set of paths** - -**Input graph:** - -![Simple AnBn Graph / Finite Set Of Path](src/main/resources/figures/example_1_graph.dot.svg) - -Let's find *all* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 2) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/resources/figures/example_1_graph_sppf.dot.svg) - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) - -When we parse this tree, we can see that this tree gives us the word $aabb$ - -Thus, the algorithm produced exactly what was expected. - -**Example 2: Simple graph with an infinite number of paths #1** - -**Input graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1](src/main/resources/figures/example_2_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 1) -* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) -* ... - -> [!NOTE] -> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/resources/figures/example_2_graph_sppf.dot.svg) - -> [!NOTE] -> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) - -When we analyze this tree, we see that this tree gives us the word $aaSbb$ - -> [!NOTE] -> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we -> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. - -Thus, the algorithm produced exactly what was expected. - -**Example 3: Simple graph with an infinite set of paths #2** - -**Input graph:** - -![Simple AnBn Graph / Iinite Set Of Path #2](src/main/resources/figures/example_3_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (1 -a-> 2 -b-> 3) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) -* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) -* ... - -> [!NOTE] -> We get an infinite number of words. Words cover the entire language thanks to several starting points. - -**Resulting SPPF graph** is too big, you can find it in -```src/main/kotlin/simple_examples/figures/example_3_graph_sppf.dot.svg``` - -*Default location of all generated SPPFs:* ```src/main/kotlin/simple_examples/gen``` - -## Section 2: Complex usage examples - -**To run (from project root)**: - -```bash -./gradlew :cfpq-paths-app:run -``` - -**Input graphs:** ```src/main/resources/``` - -**Grammar and code for paths extraction:** ```src/main/kotlin/org.ucfs.paths/Main.kt``` - -> [!NOTE] -> We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. - -## Examples - -We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted -paths. - -For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to -analyze chains of fields. - -``` -PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" -FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* -Alias -> PointsTo FlowsTo -S -> (Alias? "store_i")* PointsTo -``` - -For all our examples, we use a common grammar with $i \in [0..3]$. -The corresponding RSM is presented below: - -![Graph for example 1](./src/main/resources/figures/rsm.dot.svg) - -### Example 1 - -Code snippet: - -```java -val n = new X() -val y = new Y() -val z = new Z() -val l = n -val t = y -l.u = y -t.v = z -``` - -Respective graph: - -![Graph for example 1](./src/main/resources/figures/graph_1.dot.svg) - -Resulting SPPF: - -![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) - -Three trees are extracted because there are three paths of interest from node 1. -We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful -information for restoring fields. - -Respective paths: - -* [(1-PointsTo->0)] - - This path is trivial. Such paths will be omitted in further examples. - -* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - This path means that ```n.u = new Y()```. Vertex 2 is an alias for 1 (corresponding to ```n```), and 2 has a field ```u``` that points to ```new Y()``` (```store_0``` corresponds to ```l.u = y```). - -* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] - - This path means that ```n.u.v = new Z()```. - -### Example 2 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - l.next = new X() - l = l.next -} -``` - -Respective graph: - -![Graph for example 2](./src/main/resources/figures/graph_2.dot.svg) - -Part of resulting SPPF: - -![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) - -This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because -there are infinitely many paths of interest. We extract some of them: - -* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next.next = new X () // line 4``` - -More paths can be extracted if needed. Traversal should be tuned accordingly. - -### Example 3 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - val t = new X() - l.next = t - l = t -} -``` - -Respective graph: - -![Graph for example 3](./src/main/resources/figures/graph_3.dot.svg) - -Part of resulting SPPF: - -![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) - -This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of -them. - -* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next.next = new X() // line 4``` - -### Example 4 - -Code snippet: - -```java -val n = new X() -val z = new Z() -val u = new U() -z.x = n -u.y = n -val v = z.x -v.p = new Y() -val r = u.y -r.q = new P() -``` - -Respective graph: - -![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) - -For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in -this example, we specify two vertices as start: 1 and 8. - -* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```n.q = new P()``` - -* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```n.p = new Y() ``` - -* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```v.q = new P() ``` - -* [(8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` - -* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` +## Tutorial + +This guide will help you understand how to use UCFS. + +## Basic concepts and terms + +**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and +labeled directed graphs. It is based on the **GLL** algorithm. + +**Generalized LL parsing ([GLL](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5))** is a parsing technique +that extends traditional LL parsing to handle any context-free +grammar. + +* Generalized means the parser can handle any context-free grammar, including left-recursive and ambiguous ones + +The name *LL* itself stands for + +* Left-to-right scanning of the input +* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) + +**RSM** (Recursive State Machine) is an automaton-like representation of context-free languages. + +**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths +satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. +SPPF consists of nodes. Each node has a unique Id and detailed information specific to its +type. + +## Introduction to context-free languages + +A context-free language is a set of strings that can be generated by a set of replacement **rules**. + +Each rule looks like this: + +``` +A -> something +``` + +* Left side: one symbol (called a non-terminal) +* Right side: a sequence of terminals and non-terminals + +Terminal — a concrete symbol. Cannot be replaced further + +Non-terminal — a placeholder that must be replaced using rules + +**Example:** + +Grammar for $a^nb^n$ (n $a$ followed by n $b$): + +``` +S -> a S b +S -> ε +``` + +Here $S$ is a non-terminal, $a$ and $b$ are terminals, $ε$ means empty. + +**Context-free** means, that you can replace a non-terminal anywhere, anytime, regardless of what surrounds it. The rule +does not look at neighbors. + +## Defining graphs + +UCFS accepts graphs in DOT format. + +**DOT** is a plain-text format for describing graphs. It uses a simple structure: + +* Vertices (nodes) +* Edges between vertices +* Optional labels on edges + +```dot +digraph G { + 0 -> 1 [label="a"] + 1 -> 2 [label="b"] +} +``` + +This describes: + +* Vertices: $0, 1, 2$ +* Edge from $0$ to $1$ labeled $a$ +* Edge from $1$ to $2$ labeled $b$ + +Vertices can be defined explicitly: + +```dot +digraph G { + 0 -> 1 [label="a"] + 1 -> 2 [label="b"] + + 0 [label="entry"] + 1 [label="middle"] + 2 [label="exit"] +} +``` + +UCFS needs to know where to start: + +```dot +digraph G { + start -> 0; + 0 -> 1 [label="a"]; + 1 -> 2 [label="b"]; + + 0 [label="entry"] + 1 [label="middle"] + 2 [label="exit"] +} +``` + +## Defining the grammar + +UCFS uses a DSL (Domain Specific Language) to +define context-free grammars. + +Basic structure: + +```kotlin +class MyGrammar : Grammar() { + val S by Nt().asStart() + + init { + S /= "a" * "b" + } +} +``` + +This defines the language $ab$ (single $a$ followed by single $b$) + +You can read more about DSL and find other operations for defining grammars by following +the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/) + +## Getting started with UCFS + +> [!CAUTION] +> For demo purposes only! +> Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). + +**Requirements**: 11 java + +Before running, understand the pipeline: + +``` +INPUT 1: Grammar (CFG) ─────┐ + ├─> UCFS ──► OUTPUT: SPPF +INPUT 2: Graph (DOT) ───────┘ +``` + +* Grammar describes a language (set of strings) +* Graph contains many paths (each path produces a string of edge labels) +* UCFS finds every path whose string belongs to the grammar's language + +Example: + +``` +Grammar: S -> a b (language: just "ab") +Graph: 0 -a-> 1 -b-> 2 (one path: "ab") + 0 -a-> 3 -b-> 2 (another path: "ab") + +UCFS finds: BOTH paths (both produce "ab") +Result: SPPF with two packed alternatives +``` + +Default locations: + +* Input graphs ```cfpq-paths-app/src/main/resources``` +* Generated SPPF ```cfpq-paths-app/gen/sppf``` + +## Types of nodes in SPPF + +The resulting SPPF consists of several types of nodes. Each node has a unique ID and stores specific information. + +* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the + start and end of paths derived from that non-terminal. + + ![Graph for example 1](./src/main/resources/figures/Nonterm_example.dot.svg) + + This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal + ```S``` + +* **Terminal** node is a leaf and corresponds to an edge. + + ![Graph for example 1](./src/main/resources/figures/Terminal_example.dot.svg) + + This node depicts edge ```3 -alloc-> 4```. + +* **Epsilon** node is a simplified way to represent that $\varepsilon$ is derived at a specific position. + + ![Graph for example 1](./src/main/resources/figures/Epsilon_example.dot.svg) + +* **Range** node is a supplementary node that helps reuse subtrees. + + ![Graph for example 1](./src/main/resources/figures/Range_example.dot.svg) + + This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. + +* **Intermediate** node is a supplementary node used to connect subpaths. + + ![Graph for example 1](./src/main/resources/figures/Intermediate_example.dot.svg) + + This node depicts that the path from 0 to 2 is composed of two parts: from 0 to 1 and from 1 to 2. + +## Using UCFS with simple examples + +It is necessary to set the grammar in the code located +```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` + +**Grammar assignment** + +Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end +with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) +> [!NOTE] +> Please note that we can do this in several ways. +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * Option(S) * "b" +> } +>} +>``` +>or +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * (Epsilon or S) * "b" +> } +>} +>``` + +Let's construct an RSM for the $a^n b^n$ grammar: + +![RSM for AnBn Grammar](src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) + +We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a +non-terminal and terminals $aSb$ + +> [!NOTE] +> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node +> (red circle). + +**To run (from project root):** + +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` + +**Example 1: Simple graph with a finite set of paths** + +**Input graph:** + +![Simple AnBn Graph / Finite Set Of Path](src/main/resources/figures/example_1_graph.dot.svg) + +Let's find *all* words that satisfy the language's grammar: + +* $ab$ (0 -a-> 1 -b-> 2) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/resources/figures/example_1_graph_sppf.dot.svg) + +**Let's see what the use of the algorithm gives us:** + +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) + +When we parse this tree, we can see that this tree gives us the word $aabb$ + +Thus, the algorithm produced exactly what was expected. + +**Example 2: Simple graph with an infinite number of paths #1** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1](src/main/resources/figures/example_2_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (0 -a-> 1 -b-> 1) +* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) +* ... + +> [!NOTE] +> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/resources/figures/example_2_graph_sppf.dot.svg) + +> [!NOTE] +> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. + +**Let's see what the use of the algorithm gives us:** + +Let's divide SPPF into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) + +We can actually see that this tree gives us the word $ab$ + +**The *second* tree:** + +![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) + +When we analyze this tree, we see that this tree gives us the word $aaSbb$ + +> [!NOTE] +> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we +> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. + +Thus, the algorithm produced exactly what was expected. + +**Example 3: Simple graph with an infinite set of paths #2** + +**Input graph:** + +![Simple AnBn Graph / Iinite Set Of Path #2](src/main/resources/figures/example_3_graph.dot.svg) + +Let's find *some* words that satisfy the language's grammar: + +* $ab$ (1 -a-> 2 -b-> 3) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) +* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) +* ... + +> [!NOTE] +> We get an infinite number of words. Words cover the entire language thanks to several starting points. + +**Resulting SPPF graph** is too big, you can find it in +```src/main/resources/figures/example_3_graph_sppf.dot.svg``` + +## Using UCFS to complex examples + +Let's move on to examples that demonstrate the tool's performance in real-life scenarios. + +**Grammar and code for paths extraction:** ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/Main.kt``` + +**To run (from project root)**: + +```bash +./gradlew :cfpq-paths-app:run +``` + +> [!NOTE] +> We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. + +We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted +paths. + +For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to +analyze chains of fields. + +``` +PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" +FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* +Alias -> PointsTo FlowsTo +S -> (Alias? "store_i")* PointsTo +``` + +For all our examples, we use a common grammar with $i \in [0..3]$. +The corresponding RSM is presented below: + +![Graph for example 1](./src/main/resources/figures/rsm.dot.svg) + +### Example 1 + +Code snippet: + +```java +val n = new X() +val y = new Y() +val z = new Z() +val l = n +val t = y +l.u = y +t.v = z +``` + +Respective graph: + +![Graph for example 1](./src/main/resources/figures/graph_1.dot.svg) + +Resulting SPPF: + +![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) + +Three trees are extracted because there are three paths of interest from node 1. +We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful +information for restoring fields. + +Respective paths: + +* [(1-PointsTo->0)] + + This path is trivial. Such paths will be omitted in further examples. + +* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + This path means that ```n.u = new Y()```. Vertex 2 is an alias for 1 (corresponding to ```n```), and 2 has a field ```u``` that points to ```new Y()``` (```store_0``` corresponds to ```l.u = y```). + +* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] + + This path means that ```n.u.v = new Z()```. + +### Example 2 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + l.next = new X() + l = l.next +} +``` + +Respective graph: + +![Graph for example 2](./src/main/resources/figures/graph_2.dot.svg) + +Part of resulting SPPF: + +![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) + +This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because +there are infinitely many paths of interest. We extract some of them: + +* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next.next = new X () // line 4``` + +More paths can be extracted if needed. Traversal should be tuned accordingly. + +### Example 3 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + val t = new X() + l.next = t + l = t +} +``` + +Respective graph: + +![Graph for example 3](./src/main/resources/figures/graph_3.dot.svg) + +Part of resulting SPPF: + +![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) + +This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of +them. + +* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next.next = new X() // line 4``` + +### Example 4 + +Code snippet: + +```java +val n = new X() +val z = new Z() +val u = new U() +z.x = n +u.y = n +val v = z.x +v.p = new Y() +val r = u.y +r.q = new P() +``` + +Respective graph: + +![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) + +For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in +this example, we specify two vertices as start: 1 and 8. + +* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```n.q = new P()``` + +* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```n.p = new Y() ``` + +* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```v.q = new P() ``` + +* [(8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + +* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + + diff --git a/cfpq-paths-app/TUTORIAL.md b/cfpq-paths-app/TUTORIAL.md deleted file mode 100644 index 5c654c89e..000000000 --- a/cfpq-paths-app/TUTORIAL.md +++ /dev/null @@ -1,560 +0,0 @@ -## Tutorial - -This guide will help you understand how to use UCFS. - -## Basic concepts and terms - -**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and -labeled directed graphs. It is based on the **GLL** algorithm. - -**Generalized LL parsing ([GLL](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5))** is a parsing technique -that extends traditional LL parsing to handle any context-free -grammar. - -* Generalized means the parser can handle any context-free grammar, including left-recursive and ambiguous ones - -The name *LL* itself stands for - -* Left-to-right scanning of the input -* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) - -**RSM** (Recursive State Machine) is an automaton-like representation of context-free languages. - -**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths -satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. -SPPF consists of nodes. Each node has a unique Id and detailed information specific to its -type. - -## Introduction to context-free languages - -A context-free language is a set of strings that can be generated by a set of replacement **rules**. - -Each rule looks like this: - -``` -A -> something -``` - -* Left side: one symbol (called a non-terminal) -* Right side: a sequence of terminals and non-terminals - -Terminal — a concrete symbol (like a, b, +, if). Cannot be replaced further - -Non-terminal — a placeholder that must be replaced using rules - -**Example:** - -Grammar for $a^nb^n$ (n $a$ followed by n $b$): - -``` -S -> a S b -S -> ε -``` - -Here $S$ is a non-terminal, $a$ and $b$ are terminals, $ε$ means empty. - -**Context-free** means, that you can replace a non-terminal anywhere, anytime, regardless of what surrounds it. The rule -does not look at neighbors. - -## Defining graphs - -UCFS accepts graphs in DOT format. - -**DOT** is a plain-text format for describing graphs. It uses a simple structure: - -* Vertices (nodes) -* Edges between vertices -* Optional labels on edges - -```dot -digraph G { - 0 -> 1 [label="a"] - 1 -> 2 [label="b"] -} -``` - -This describes: - -* Vertices: $0, 1, 2$ -* Edge from $0$ to $1$ labeled $a$ -* Edge from $1$ to $2$ labeled $b$ - -Vertices can be defined explicitly: - -```dot -digraph G { - 0 -> 1 [label="a"] - 1 -> 2 [label="b"] - - 0 [label="entry"] - 1 [label="middle"] - 2 [label="exit"] -} -``` - -UCFS needs to know where to start: - -```dot -digraph G { - start -> 0; - 0 -> 1 [label="a"]; - 1 -> 2 [label="b"]; - - 0 [label="entry"] - 1 [label="middle"] - 2 [label="exit"] -} -``` - -## Defining the grammar - -UCFS uses a DSL (Domain Specific Language) to -define context-free grammars. - -Basic structure: - -```kotlin -class MyGrammar : Grammar() { - val S by Nt().asStart() - - init { - S /= "a" * "b" - } -} -``` - -This defines the language $ab$ (single $a$ followed by single $b$) - -You can read more about DSL and find other operations for defining grammars by following -the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/) - -## Getting started with UCFS - -> [!CAUTION] -> For demo purposes only! -> Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). - -**Requirements**: 11 java - -Before running, understand the pipeline: - -``` -INPUT 1: Grammar (CFG) ─────┐ - ├──► UCFS ──► OUTPUT: SPPF -INPUT 2: Graph (DOT) ───────┘ -``` - -* Grammar describes a language (set of strings) -* Graph contains many paths (each path produces a string of edge labels) -* UCFS finds every path whose string belongs to the grammar's language - -Example: - -``` -Grammar: S → a b (language: just "ab") -Graph: 0 -a→ 1 -b→ 2 (one path: "ab") - 0 -a→ 3 -b→ 2 (another path: "ab") - -UCFS finds: BOTH paths (both produce "ab") -Result: SPPF with two packed alternatives -``` - -Default locations: - -* Input graphs ```cfpq-paths-app/src/main/resources``` -* Generated SPPF ```cfpq-paths-app/gen/sppf``` - -## Types of nodes in SPPF - -The resulting SPPF consists of several types of nodes. Each node has a unique ID and stores specific information. - -* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the - start and end of paths derived from that non-terminal. - - ![Graph for example 1](./src/main/resources/figures/Nonterm_example.dot.svg) - - This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal - ```S``` - -* **Terminal** node is a leaf and corresponds to an edge. - - ![Graph for example 1](./src/main/resources/figures/Terminal_example.dot.svg) - - This node depicts edge ```3 -alloc-> 4```. - -* **Epsilon** node is a simplified way to represent that $\varepsilon$ is derived at a specific position. - - ![Graph for example 1](./src/main/resources/figures/Epsilon_example.dot.svg) - -* **Range** node is a supplementary node that helps reuse subtrees. - - ![Graph for example 1](./src/main/resources/figures/Range_example.dot.svg) - - This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. - -* **Intermediate** node is a supplementary node used to connect subpaths. - - ![Graph for example 1](./src/main/resources/figures/Intermediate_example.dot.svg) - - This node depicts that the path from 0 to 2 is composed of two parts: from 0 to 1 and from 1 to 2. - -## Using UCFS with simple examples - -It is necessary to set the grammar in the code located -```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` - -**Grammar assignment** - -Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end -with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) -> [!NOTE] -> Please note that we can do this in several ways. ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * Option(S) * "b" -> } ->} ->``` ->or ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * (Epsilon or S) * "b" -> } ->} ->``` - -Let's construct an RSM for the $a^n b^n$ grammar: - -![RSM for AnBn Grammar](src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) - -We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a -non-terminal and terminals $aSb$ - -> [!NOTE] -> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node -> (red circle). - -**To run (from project root):** - -```bash -./gradlew :cfpq-paths-app:runSimpleExamples -``` - -**Example 1: Simple graph with a finite set of paths** - -**Input graph:** - -![Simple AnBn Graph / Finite Set Of Path](src/main/resources/figures/example_1_graph.dot.svg) - -Let's find *all* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 2) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/resources/figures/example_1_graph_sppf.dot.svg) - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) - -When we parse this tree, we can see that this tree gives us the word $aabb$ - -Thus, the algorithm produced exactly what was expected. - -**Example 2: Simple graph with an infinite number of paths #1** - -**Input graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1](src/main/resources/figures/example_2_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 1) -* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) -* ... - -> [!NOTE] -> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/resources/figures/example_2_graph_sppf.dot.svg) - -> [!NOTE] -> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) - -When we analyze this tree, we see that this tree gives us the word $aaSbb$ - -> [!NOTE] -> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we -> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. - -Thus, the algorithm produced exactly what was expected. - -**Example 3: Simple graph with an infinite set of paths #2** - -**Input graph:** - -![Simple AnBn Graph / Iinite Set Of Path #2](src/main/resources/figures/example_3_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (1 -a-> 2 -b-> 3) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) -* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) -* ... - -> [!NOTE] -> We get an infinite number of words. Words cover the entire language thanks to several starting points. - -**Resulting SPPF graph** is too big, you can find it in -```src/main/resources/figures/example_3_graph_sppf.dot.svg``` - -## Using UCFS to complex examples - -Let's move on to examples that demonstrate the tool's performance in real-life scenarios. - -**Grammar and code for paths extraction:** ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/Main.kt``` - -**To run (from project root)**: - -```bash -./gradlew :cfpq-paths-app:run -``` - -> [!NOTE] -> We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. - -We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted -paths. - -For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to -analyze chains of fields. - -``` -PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" -FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* -Alias -> PointsTo FlowsTo -S -> (Alias? "store_i")* PointsTo -``` - -For all our examples, we use a common grammar with $i \in [0..3]$. -The corresponding RSM is presented below: - -![Graph for example 1](./src/main/resources/figures/rsm.dot.svg) - -### Example 1 - -Code snippet: - -```java -val n = new X() -val y = new Y() -val z = new Z() -val l = n -val t = y -l.u = y -t.v = z -``` - -Respective graph: - -![Graph for example 1](./src/main/resources/figures/graph_1.dot.svg) - -Resulting SPPF: - -![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) - -Three trees are extracted because there are three paths of interest from node 1. -We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful -information for restoring fields. - -Respective paths: - -* [(1-PointsTo->0)] - - This path is trivial. Such paths will be omitted in further examples. - -* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - This path means that ```n.u = new Y()```. Vertex 2 is an alias for 1 (corresponding to ```n```), and 2 has a field ```u``` that points to ```new Y()``` (```store_0``` corresponds to ```l.u = y```). - -* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] - - This path means that ```n.u.v = new Z()```. - -### Example 2 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - l.next = new X() - l = l.next -} -``` - -Respective graph: - -![Graph for example 2](./src/main/resources/figures/graph_2.dot.svg) - -Part of resulting SPPF: - -![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) - -This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because -there are infinitely many paths of interest. We extract some of them: - -* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next.next = new X () // line 4``` - -More paths can be extracted if needed. Traversal should be tuned accordingly. - -### Example 3 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - val t = new X() - l.next = t - l = t -} -``` - -Respective graph: - -![Graph for example 3](./src/main/resources/figures/graph_3.dot.svg) - -Part of resulting SPPF: - -![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) - -This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of -them. - -* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next.next = new X() // line 4``` - -### Example 4 - -Code snippet: - -```java -val n = new X() -val z = new Z() -val u = new U() -z.x = n -u.y = n -val v = z.x -v.p = new Y() -val r = u.y -r.q = new P() -``` - -Respective graph: - -![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) - -For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in -this example, we specify two vertices as start: 1 and 8. - -* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```n.q = new P()``` - -* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```n.p = new Y() ``` - -* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```v.q = new P() ``` - -* [(8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` - -* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` - - From a13aaecffd3ea071f0d0202b0545305f39818867 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 3 Jun 2026 11:38:15 +0300 Subject: [PATCH 43/71] docs: Divided the information into sections --- README.md | 51 +- cfpq-paths-app/README.md | 583 +------------------- cfpq-paths-app/tutorial/cfl.md | 32 ++ cfpq-paths-app/tutorial/complex-examples.md | 213 +++++++ cfpq-paths-app/tutorial/grammar.md | 17 + cfpq-paths-app/tutorial/graphs.md | 78 +++ cfpq-paths-app/tutorial/simple-examples.md | 141 +++++ cfpq-paths-app/tutorial/sppf.md | 36 ++ 8 files changed, 576 insertions(+), 575 deletions(-) create mode 100644 cfpq-paths-app/tutorial/cfl.md create mode 100644 cfpq-paths-app/tutorial/complex-examples.md create mode 100644 cfpq-paths-app/tutorial/grammar.md create mode 100644 cfpq-paths-app/tutorial/graphs.md create mode 100644 cfpq-paths-app/tutorial/simple-examples.md create mode 100644 cfpq-paths-app/tutorial/sppf.md diff --git a/README.md b/README.md index ca5985e7c..24718bde9 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,14 @@ Please, see [documentation](https://formallanguageconstrainedpathquerying.github ## What is UCFS? -UCFS is an **U**niversal **C**ontext-**F**ree **S**olver: a GLL‑based tool for problems at the intersection of context‑free languages +UCFS is an **U**niversal **C**ontext-**F**ree **S**olver: a GLL‑based tool for problems at the intersection of +context‑free languages over edge‑labeled directed graphs. Examples of such problems: - Parsing - Context-free path querying (CFPQ) - Context-free language reachability (CFL-R) -- static code analysis +- static code analysis **Highlights** @@ -20,27 +21,47 @@ over edge‑labeled directed graphs. Examples of such problems: * Input: arbitrary edge‑labeled directed graphs. * Output: SPPF -- finite structure for all‑paths queries. +### Typical workflow + +1) **Describe grammar** in Kotlin DSL. +2) **Load graph** (for now `dot` format is supported). +3) **Run query**. +4) **Inspect results**. + +Detailed information and tutorial is [here](./cfpq-paths-app/README.md) +## Core Algorithm + +UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive +State Machines (RSM) and input in form of arbitratry directed edge-labelled graph. Basic ideas +described [here](https://arxiv.org/pdf/2312.11925.pdf). ### Repository layout (high‑level) + ``` -docs/ # documentation pages -generator/ # Parser & AST node‑class generator -solver/ # Core UCFS logic (GLL + RSM) -test-shared/ # Testcases, grammars, inputs, ANTLR4 comparison - # grammar examples and experiments +docs/ # Documentation pages +generator/ # Parser & AST node‑class generator +solver/ # Core UCFS logic (GLL + RSM) +test-shared/ # Testcases, grammars, inputs, ANTLR4 comparison + # grammar examples and experiments +cfpq-paths-app/ # Runnable demos and tutorial ``` ### Requirements -- JDK 11+ (toolchain targets 11). + +- JDK 11+ (toolchain targets 11). - Gradle Wrapper included (`./gradlew`). -### Typical workflow -1) **Describe grammar** in Kotlin DSL. -2) **Load graph** (for now `dot` format is supported). -3) **Run query**. -4) **Inspect results**. +### Installation: +* To download the project by **https** enter -## Core Algorithm -UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive State Machines (RSM) and input in form of arbitratry directed edge-labelled graph. Basic ideas described [here](https://arxiv.org/pdf/2312.11925.pdf). +```bash +git clone https://github.com/FormalLanguageConstrainedPathQuerying/UCFS.git +``` + +* To download the project by **ssh** enter: + +```bash +git clone git@github.com:FormalLanguageConstrainedPathQuerying/UCFS.git +``` diff --git a/cfpq-paths-app/README.md b/cfpq-paths-app/README.md index aec5db1a4..13146cf59 100644 --- a/cfpq-paths-app/README.md +++ b/cfpq-paths-app/README.md @@ -1,560 +1,23 @@ -## Tutorial - -This guide will help you understand how to use UCFS. - -## Basic concepts and terms - -**UCFS** is a universal tool designed to solve problems that lie at the intersection of context-free languages and -labeled directed graphs. It is based on the **GLL** algorithm. - -**Generalized LL parsing ([GLL](https://link.springer.com/chapter/10.1007/978-3-662-46663-6_5))** is a parsing technique -that extends traditional LL parsing to handle any context-free -grammar. - -* Generalized means the parser can handle any context-free grammar, including left-recursive and ambiguous ones - -The name *LL* itself stands for - -* Left-to-right scanning of the input -* Leftmost derivation (the parse tree is constructed by expanding the leftmost nonterminal first) - -**RSM** (Recursive State Machine) is an automaton-like representation of context-free languages. - -**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths -satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. -SPPF consists of nodes. Each node has a unique Id and detailed information specific to its -type. - -## Introduction to context-free languages - -A context-free language is a set of strings that can be generated by a set of replacement **rules**. - -Each rule looks like this: - -``` -A -> something -``` - -* Left side: one symbol (called a non-terminal) -* Right side: a sequence of terminals and non-terminals - -Terminal — a concrete symbol. Cannot be replaced further - -Non-terminal — a placeholder that must be replaced using rules - -**Example:** - -Grammar for $a^nb^n$ (n $a$ followed by n $b$): - -``` -S -> a S b -S -> ε -``` - -Here $S$ is a non-terminal, $a$ and $b$ are terminals, $ε$ means empty. - -**Context-free** means, that you can replace a non-terminal anywhere, anytime, regardless of what surrounds it. The rule -does not look at neighbors. - -## Defining graphs - -UCFS accepts graphs in DOT format. - -**DOT** is a plain-text format for describing graphs. It uses a simple structure: - -* Vertices (nodes) -* Edges between vertices -* Optional labels on edges - -```dot -digraph G { - 0 -> 1 [label="a"] - 1 -> 2 [label="b"] -} -``` - -This describes: - -* Vertices: $0, 1, 2$ -* Edge from $0$ to $1$ labeled $a$ -* Edge from $1$ to $2$ labeled $b$ - -Vertices can be defined explicitly: - -```dot -digraph G { - 0 -> 1 [label="a"] - 1 -> 2 [label="b"] - - 0 [label="entry"] - 1 [label="middle"] - 2 [label="exit"] -} -``` - -UCFS needs to know where to start: - -```dot -digraph G { - start -> 0; - 0 -> 1 [label="a"]; - 1 -> 2 [label="b"]; - - 0 [label="entry"] - 1 [label="middle"] - 2 [label="exit"] -} -``` - -## Defining the grammar - -UCFS uses a DSL (Domain Specific Language) to -define context-free grammars. - -Basic structure: - -```kotlin -class MyGrammar : Grammar() { - val S by Nt().asStart() - - init { - S /= "a" * "b" - } -} -``` - -This defines the language $ab$ (single $a$ followed by single $b$) - -You can read more about DSL and find other operations for defining grammars by following -the [link](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/) - -## Getting started with UCFS - -> [!CAUTION] -> For demo purposes only! -> Do not expect big graphs to be processed successfully (in reasonable time or without out-of-memory errors). - -**Requirements**: 11 java - -Before running, understand the pipeline: - -``` -INPUT 1: Grammar (CFG) ─────┐ - ├─> UCFS ──► OUTPUT: SPPF -INPUT 2: Graph (DOT) ───────┘ -``` - -* Grammar describes a language (set of strings) -* Graph contains many paths (each path produces a string of edge labels) -* UCFS finds every path whose string belongs to the grammar's language - -Example: - -``` -Grammar: S -> a b (language: just "ab") -Graph: 0 -a-> 1 -b-> 2 (one path: "ab") - 0 -a-> 3 -b-> 2 (another path: "ab") - -UCFS finds: BOTH paths (both produce "ab") -Result: SPPF with two packed alternatives -``` - -Default locations: - -* Input graphs ```cfpq-paths-app/src/main/resources``` -* Generated SPPF ```cfpq-paths-app/gen/sppf``` - -## Types of nodes in SPPF - -The resulting SPPF consists of several types of nodes. Each node has a unique ID and stores specific information. - -* **Nonterminal** node contains the name of the non-terminal and pairs of vertices from the input graph that are the - start and end of paths derived from that non-terminal. - - ![Graph for example 1](./src/main/resources/figures/Nonterm_example.dot.svg) - - This node has number ```0``` and is the root of all derivations for all paths from 1 to 4 derivable from non-terminal - ```S``` - -* **Terminal** node is a leaf and corresponds to an edge. - - ![Graph for example 1](./src/main/resources/figures/Terminal_example.dot.svg) - - This node depicts edge ```3 -alloc-> 4```. - -* **Epsilon** node is a simplified way to represent that $\varepsilon$ is derived at a specific position. - - ![Graph for example 1](./src/main/resources/figures/Epsilon_example.dot.svg) - -* **Range** node is a supplementary node that helps reuse subtrees. - - ![Graph for example 1](./src/main/resources/figures/Range_example.dot.svg) - - This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. - -* **Intermediate** node is a supplementary node used to connect subpaths. - - ![Graph for example 1](./src/main/resources/figures/Intermediate_example.dot.svg) - - This node depicts that the path from 0 to 2 is composed of two parts: from 0 to 1 and from 1 to 2. - -## Using UCFS with simple examples - -It is necessary to set the grammar in the code located -```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` - -**Grammar assignment** - -Let's define the grammar of the language $a^n b^n$, which defines a set of words that start with $n$ letters $a$ and end -with $n$ letters $b$ (Examples: $ab$, $aabb$, $aaabbb$) -> [!NOTE] -> Please note that we can do this in several ways. ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * Option(S) * "b" -> } ->} ->``` ->or ->```kotlin ->class PointsToAnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * (Epsilon or S) * "b" -> } ->} ->``` - -Let's construct an RSM for the $a^n b^n$ grammar: - -![RSM for AnBn Grammar](src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) - -We can see how the starting non-terminal $S$ turns into either a concatenation of terminals $ab$ or a concatenation of a -non-terminal and terminals $aSb$ - -> [!NOTE] -> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node -> (red circle). - -**To run (from project root):** - -```bash -./gradlew :cfpq-paths-app:runSimpleExamples -``` - -**Example 1: Simple graph with a finite set of paths** - -**Input graph:** - -![Simple AnBn Graph / Finite Set Of Path](src/main/resources/figures/example_1_graph.dot.svg) - -Let's find *all* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 2) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Finite Set Of Path / SPPF](src/main/resources/figures/example_1_graph_sppf.dot.svg) - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) - -When we parse this tree, we can see that this tree gives us the word $aabb$ - -Thus, the algorithm produced exactly what was expected. - -**Example 2: Simple graph with an infinite number of paths #1** - -**Input graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1](src/main/resources/figures/example_2_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (0 -a-> 1 -b-> 1) -* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) -* ... - -> [!NOTE] -> We get an infinite number of words that obey the rule: $a^nb^n$ & $n$ is odd - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Infinite Set Of Path #1/ SPPF](src/main/resources/figures/example_2_graph_sppf.dot.svg) - -> [!NOTE] -> This example demonstrates that despite the infinite number of paths, the graph will be finite, as a limit is provided. - -**Let's see what the use of the algorithm gives us:** - -Let's divide SPPF into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 1Tree](src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) - -We can actually see that this tree gives us the word $ab$ - -**The *second* tree:** - -![Simple AnBn Graph / Ininite Set of Paths / SPPF / 2Tree](src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) - -When we analyze this tree, we see that this tree gives us the word $aaSbb$ - -> [!NOTE] -> We can see that there is a cycle in the graph. We can also see that the second word contains a non-terminal, which we -> can also replace with $ab$ or $aaSbb$, so we can get the words $aaabbb$, $aaaaSbbbb$ -> $aaaaabbbbb$ etc. - -Thus, the algorithm produced exactly what was expected. - -**Example 3: Simple graph with an infinite set of paths #2** - -**Input graph:** - -![Simple AnBn Graph / Iinite Set Of Path #2](src/main/resources/figures/example_3_graph.dot.svg) - -Let's find *some* words that satisfy the language's grammar: - -* $ab$ (1 -a-> 2 -b-> 3) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) -* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) -* ... - -> [!NOTE] -> We get an infinite number of words. Words cover the entire language thanks to several starting points. - -**Resulting SPPF graph** is too big, you can find it in -```src/main/resources/figures/example_3_graph_sppf.dot.svg``` - -## Using UCFS to complex examples - -Let's move on to examples that demonstrate the tool's performance in real-life scenarios. - -**Grammar and code for paths extraction:** ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/Main.kt``` - -**To run (from project root)**: - -```bash -./gradlew :cfpq-paths-app:run -``` - -> [!NOTE] -> We implemented a very naive path extraction algorithm solely to demonstrate SPPF traversal. - -We provide a few code snippets, the corresponding graphs to be analyzed, parts of the resulting SPPFs, and extracted -paths. - -For analysis, we use the following extended points-to grammar (start non-terminal is ```S```), which allows us to -analyze chains of fields. - -``` -PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" -FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* -Alias -> PointsTo FlowsTo -S -> (Alias? "store_i")* PointsTo -``` - -For all our examples, we use a common grammar with $i \in [0..3]$. -The corresponding RSM is presented below: - -![Graph for example 1](./src/main/resources/figures/rsm.dot.svg) - -### Example 1 - -Code snippet: - -```java -val n = new X() -val y = new Y() -val z = new Z() -val l = n -val t = y -l.u = y -t.v = z -``` - -Respective graph: - -![Graph for example 1](./src/main/resources/figures/graph_1.dot.svg) - -Resulting SPPF: - -![SPPF for example 1](./src/main/resources/figures/graph_1_sppf.dot.svg) - -Three trees are extracted because there are three paths of interest from node 1. -We do not extract subpaths derivable from non-terminals ```Alias``` and ```PointsTo```, as they contain no useful -information for restoring fields. - -Respective paths: - -* [(1-PointsTo->0)] - - This path is trivial. Such paths will be omitted in further examples. - -* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - This path means that ```n.u = new Y()```. Vertex 2 is an alias for 1 (corresponding to ```n```), and 2 has a field ```u``` that points to ```new Y()``` (```store_0``` corresponds to ```l.u = y```). - -* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] - - This path means that ```n.u.v = new Z()```. - -### Example 2 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - l.next = new X() - l = l.next -} -``` - -Respective graph: - -![Graph for example 2](./src/main/resources/figures/graph_2.dot.svg) - -Part of resulting SPPF: - -![SPPF for example 2](./src/main/resources/figures/graph_2_sppf.dot.svg) - -This part contains a cycle formed by vertices 27–31–34–37–38–40–42–44–47–49–52–56 (colored in red). This is because -there are infinitely many paths of interest. We extract some of them: - -* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next.next = new X () // line 4``` - -More paths can be extracted if needed. Traversal should be tuned accordingly. - -### Example 3 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - val t = new X() - l.next = t - l = t -} -``` - -Respective graph: - -![Graph for example 3](./src/main/resources/figures/graph_3.dot.svg) - -Part of resulting SPPF: - -![SPPF for example 3](./src/main/resources/figures/graph_3_sppf.dot.svg) - -This SPPF also contains a cycle (3–5–7–11), so there are infinitely many paths of interest, and we extract only a few of -them. - -* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next.next = new X() // line 4``` - -### Example 4 - -Code snippet: - -```java -val n = new X() -val z = new Z() -val u = new U() -z.x = n -u.y = n -val v = z.x -v.p = new Y() -val r = u.y -r.q = new P() -``` - -Respective graph: - -![Graph for example 4](./src/main/resources/figures/graph_4.dot.svg) - -For this example, we omit the figure of the SPPF due to its size. However, we present the respective paths. Note that in -this example, we specify two vertices as start: 1 and 8. - -* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```n.q = new P()``` - -* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```n.p = new Y() ``` - -* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```v.q = new P() ``` - -* [(8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` - -* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` - - +# CFPQ-Path-App + +This module contains Runnable demos for UCFS. +For project overview, see [../README.md](../README.md). + + +## Prerequisites + +- Input graphs: `cfpq-paths-app/src/main/resources/` +- Generated SPPF: `cfpq-paths-app/gen/sppf/` + +## Running the examples + +### Simple examples ($a^nb^n$ grammar) +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` +### Complex examples (PointsTo analysis) +```bash +./gradlew :cfpq-paths-app:run +``` diff --git a/cfpq-paths-app/tutorial/cfl.md b/cfpq-paths-app/tutorial/cfl.md new file mode 100644 index 000000000..2ada0a450 --- /dev/null +++ b/cfpq-paths-app/tutorial/cfl.md @@ -0,0 +1,32 @@ +# Introduction to context-free languages + +UCFS solves path queries on edge-labeled directed graphs: the result consists of paths whose concatenated edge labels +form a word in a language $L$ specified by a grammar. In UCFS, $L$ is given by a context-free grammar +(CFG), and the corresponding language is a context-free language (CFL). For more information about CFG/L, see +сhapter 5 of the [book](https://github.com/FormalLanguageConstrainedPathQuerying/FormalLanguageConstrainedReachability-LectureNotes) + +The graph defines the set of candidate paths and the grammar restricts it to paths whose label sequences belong to $L$. + +## Context-free grammar + +A context-free grammar is a finite set of productions of the form $A \to a$, where $A$ is a non-terminal and $a$ is a +string of terminals and non-terminals. + +Notation used below: + +``` +A -> a +``` + +* **Non-terminal** — a symbol on the left-hand side of a production, expanded by applying rules. +* **Terminal** — a symbol that does not expanded and corresponds to the edge labels in UCFS + +**Example.** Grammar for $L = \{a^n b^n \mid n \ge 0\}$: + +``` +S -> a S b +S -> ε +``` + +Here $S$ is a non-terminal, $a$ and $b$ are terminals, $\varepsilon$ denotes the empty string. A path matches this +grammar if its label sequence is $ab$, $aabb$, $aaabbb$, etc. The simple examples in this guide use this grammar. diff --git a/cfpq-paths-app/tutorial/complex-examples.md b/cfpq-paths-app/tutorial/complex-examples.md new file mode 100644 index 000000000..95fad0f18 --- /dev/null +++ b/cfpq-paths-app/tutorial/complex-examples.md @@ -0,0 +1,213 @@ +# Complex examples (PointsTo analysis) + +The following examples illustrate UCFS on analysis-style graphs. + +**Grammar and code for paths extraction:** ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/Main.kt``` + +**To run (from project root)**: + +```bash +./gradlew :cfpq-paths-app:run +``` + +> [!NOTE] +> Path extraction uses a naive traversal algorithm intended only to demonstrate SPPF traversal. + +Below are code snippets, input graphs, fragments of the resulting SPPFs, and extracted paths. + +The analysis uses the following extended points-to grammar (start non-terminal ```S```) to model field-access chains. + +``` +PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" +FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* +Alias -> PointsTo FlowsTo +S -> (Alias? "store_i")* PointsTo +``` + +In all examples below, the grammar uses indices $i \in [0..3]$. +The corresponding RSM: + +![Graph for example 1](../src/main/resources/figures/rsm.dot.svg) + +## Example 1 + +Code snippet: + +```java +val n = new X() +val y = new Y() +val z = new Z() +val l = n +val t = y +l.u = y +t.v = z +``` + +Corresponding graph: + +![Graph for example 1](../src/main/resources/figures/graph_1.dot.svg) + +The resulting SPPF: + +![SPPF for example 1](../src/main/resources/figures/graph_1_sppf.dot.svg) + +Three trees are extracted because there are three paths of interest from node 1. +Subpaths derivable from non-terminals ```Alias``` and ```PointsTo``` are omitted, because they do not contribute +to recovering field assignments. + +Extracted paths: + +* [(1-PointsTo->0)] + + This path is trivial. Such paths will be omitted in further examples. + +* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + This path corresponds to ```n.u = new Y()```. Vertex 2 is an alias of 1 (```n```); the ```store_0``` edge models ```l.u = y```. + +* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] + + This path corresponds to ```n.u.v = new Z()```. + +## Example 2 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + l.next = new X() + l = l.next +} +``` + +Corresponding graph: + +![Graph for example 2](../src/main/resources/figures/graph_2.dot.svg) + +Part of the resulting SPPF: + +![SPPF for example 2](../src/main/resources/figures/graph_2_sppf.dot.svg) + +This fragment contains a cycle on vertices 27–31–34–37–38–40–42–44–47–49–52–56 (shown in red), indicating infinitely +many paths of interest. A sample of extracted paths: + +* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next.next = new X () // line 4``` + +More paths can be extracted if needed. Traversal should be tuned accordingly. + +## Example 3 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + val t = new X() + l.next = t + l = t +} +``` + +Corresponding graph: + +![Graph for example 3](../src/main/resources/figures/graph_3.dot.svg) + +Part of the resulting SPPF: + +![SPPF for example 3](../src/main/resources/figures/graph_3_sppf.dot.svg) + +This SPPF also contains a cycle on vertices 3–5–7–11; therefore, infinitely many paths of interest exist. Only a sample +is listed below. + +* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next.next = new X() // line 4``` + +## Example 4 + +Code snippet: + +```java +val n = new X() +val z = new Z() +val u = new U() +z.x = n +u.y = n +val v = z.x +v.p = new Y() +val r = u.y +r.q = new P() +``` + +Corresponding graph: + +![Graph for example 4](../src/main/resources/figures/graph_4.dot.svg) + +For this example, the SPPF figure is omitted due to size; only the extracted paths are listed. The query uses two start +vertices: 1 and 8. + +* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```n.q = new P()``` + +* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```n.p = new Y() ``` + +* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```v.q = new P() ``` + +* [(8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + +* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + diff --git a/cfpq-paths-app/tutorial/grammar.md b/cfpq-paths-app/tutorial/grammar.md new file mode 100644 index 000000000..7757763c0 --- /dev/null +++ b/cfpq-paths-app/tutorial/grammar.md @@ -0,0 +1,17 @@ +# Defining the grammar + +UCFS uses a [DSL](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/) (domain-specific language) to define context-free grammars. + +Basic example structure: + +```kotlin +class MyGrammar : Grammar() { + val S by Nt().asStart() + + init { + S /= "a" * "b" + } +} +``` + +This defines the language $\{ab\}$ (a single $a$ followed by a single $b$). diff --git a/cfpq-paths-app/tutorial/graphs.md b/cfpq-paths-app/tutorial/graphs.md new file mode 100644 index 000000000..9d14a7de4 --- /dev/null +++ b/cfpq-paths-app/tutorial/graphs.md @@ -0,0 +1,78 @@ +# Defining graphs + +UCFS operates on edge-labeled directed graphs. Internally, a graph is represented as `InputGraph` (see `IInputGraph`): +vertices, labeled edges between them, and one or more start vertices where path exploration begins. + +You can provide a graph in several ways: + +* **Programmatically in Kotlin** — create an `InputGraph`, mark start vertices with `addStartVertex`, and add labeled +* edges with `addEdge`. +* **From a DOT file or string** — parse with `DotParser`: `parseDotFile(path)` or `parseDot(text)`. +* **From resources** — load a `.dot` file from the classpath (as in the tutorial examples below). + +For example, the same graph as in the DOT examples below can be built in code: + +```kotlin +val graph = InputGraph() +graph.addStartVertex(0) +graph.addEdge(0, TerminalInputLabel(Term("a")), 1) +graph.addEdge(1, TerminalInputLabel(Term("b")), 2) +``` + +The examples in this guide use DOT, so the following section walks through that format in detail. + +## Example: DOT format + +[DOT](https://graphviz.org/doc/info/lang.html) is a plain-text format for describing graphs. It uses a simple structure: + +* Vertices (nodes) +* Edges between vertices +* Optional labels on edges + +```dot +digraph G { + 0 -> 1 [label="a"] + 1 -> 2 [label="b"] +} +``` + +This describes: + +* Vertices: $0, 1, 2$ +* Edge from $0$ to $1$ labeled $a$ +* Edge from $1$ to $2$ labeled $b$ + +Vertices can be defined explicitly: + +```dot +digraph G { + 0 -> 1 [label="a"] + 1 -> 2 [label="b"] + + 0 [label="entry"] + 1 [label="middle"] + 2 [label="exit"] +} +``` + +UCFS needs to know where to start. In DOT, mark start vertices with edges from a dedicated `start` node: + +```dot +digraph G { + start -> 0; + 0 -> 1 [label="a"]; + 1 -> 2 [label="b"]; + + 0 [label="entry"] + 1 [label="middle"] + 2 [label="exit"] +} +``` + +To load such a graph in code: + +```kotlin +val graph = DotParser().parseDotFile("") +// or +val graph = DotParser().parseDot(dotString) +``` diff --git a/cfpq-paths-app/tutorial/simple-examples.md b/cfpq-paths-app/tutorial/simple-examples.md new file mode 100644 index 000000000..69fa46c57 --- /dev/null +++ b/cfpq-paths-app/tutorial/simple-examples.md @@ -0,0 +1,141 @@ +# Using UCFS with simple examples + +Set the grammar in +```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` + +**Grammar assignment** + +Define the grammar for the language $a^n b^n$: words consisting of $n$ occurrences of $a$ followed by $n$ +occurrences of $b$ (e.g., $ab$, $aabb$, $aaabbb$). +> [!NOTE] +> The grammar can be defined equivalently as follows. +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * Option(S) * "b" +> } +>} +>``` +>or +>```kotlin +>class PointsToAnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * (Epsilon or S) * "b" +> } +>} +>``` + +A **recursive state machine** ([RSM](https://www.researchgate.net/publication/226965977_Analysis_of_Recursive_State_Machines)) is an automaton-like representation of a context-free grammar. + +The RSM for the $a^n b^n$ grammar: + +![RSM for AnBn Grammar](../src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) + +The start non-terminal $S$ expands to either the terminal string $ab$ or the string $aSb$. + +> [!NOTE] +> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node +> (red circle). + +**To run (from project root):** + +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` + +**Example 1: Simple graph with a finite set of paths** + +**Input graph:** + +![Simple AnBn Graph / Finite Set Of Paths](../src/main/resources/figures/example_1_graph.dot.svg) + +The following words satisfy the grammar: + +* $ab$ (0 -a-> 1 -b-> 2) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Finite Set Of Paths / SPPF](../src/main/resources/figures/example_1_graph_sppf.dot.svg) + +The SPPF decomposes into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) + +The first tree corresponds to the word $ab$. + +**The *second* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 2Tree](../src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) + +The second tree corresponds to the word $aabb$. + +The result matches the expected language. + +**Example 2: Simple graph with an infinite number of paths #1** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Paths #1](../src/main/resources/figures/example_2_graph.dot.svg) + +Examples of words that satisfy the grammar: + +* $ab$ (0 -a-> 1 -b-> 1) +* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) +* ... + +> [!NOTE] +> The language contains infinitely many words of the form $a^nb^n$ where $n$ is odd. + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Infinite Set Of Paths #1 / SPPF](../src/main/resources/figures/example_2_graph_sppf.dot.svg) + +> [!NOTE] +> This example shows that although the number of paths is infinite, the SPPF remains finite when a depth limit +> is applied. + +The SPPF decomposes into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Infinite Set of Paths / SPPF / 1Tree](../src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) + +The first tree corresponds to the word $ab$. + +**The *second* tree:** + +![Simple AnBn Graph / Infinite Set of Paths / SPPF / 2Tree](../src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) + +The second tree corresponds to the word $aaSbb$. + +> [!NOTE] +> The SPPF contains a cycle. The label sequence $aaSbb$ includes the non-terminal $S$, which can be expanded further +> to obtain $aaabbb$, $aaaaabbbbb$, and so on. + +The result matches the expected language. + +**Example 3: Simple graph with an infinite set of paths #2** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Paths #2](../src/main/resources/figures/example_3_graph.dot.svg) + +Examples of words that satisfy the grammar: + +* $ab$ (1 -a-> 2 -b-> 3) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) +* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) +* ... + +> [!NOTE] +> The graph yields infinitely many words that cover the full language, because it has several start vertices. + +The resulting SPPF is too large to include here; see +```src/main/resources/figures/example_3_graph_sppf.dot.svg``` diff --git a/cfpq-paths-app/tutorial/sppf.md b/cfpq-paths-app/tutorial/sppf.md new file mode 100644 index 000000000..a7b2f0b7f --- /dev/null +++ b/cfpq-paths-app/tutorial/sppf.md @@ -0,0 +1,36 @@ +# Reading the SPPF + +**SPPF** (Shared Packed Parse Forest) is a derivation-tree-like structure that represents **all** possible paths +satisfying the specified grammar. If the number of such paths is infinite, the SPPF contains cycles. + +The SPPF consists of several node types. Each node has a unique ID and stores type-specific information. + +* A **non-terminal** node contains the name of a non-terminal and pairs of vertices from the input graph that mark the +* start and end of paths derived from that non-terminal. + + ![Graph for example 1](../src/main/resources/figures/Nonterm_example.dot.svg) + + This node has ID ```0``` and is the root of all derivations for paths from vertex 1 to vertex 4 derivable from +* non-terminal ```S```. + +* A **terminal** node is a leaf and corresponds to an edge. + + ![Graph for example 1](../src/main/resources/figures/Terminal_example.dot.svg) + + This node depicts edge ```3 -alloc-> 4```. + +* An **epsilon** node represents that $\varepsilon$ is derived at a specific position. + + ![Graph for example 1](../src/main/resources/figures/Epsilon_example.dot.svg) + +* A **range** node is a supplementary node that helps reuse subtrees. + + ![Graph for example 1](../src/main/resources/figures/Range_example.dot.svg) + + This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. + +* An **intermediate** node is a supplementary node used to connect subpaths. + + ![Graph for example 1](../src/main/resources/figures/Intermediate_example.dot.svg) + + This node indicates that the path from 0 to 2 consists of two parts: from 0 to 1 and from 1 to 2. From 9064c98fa0b7c14b5874ed6d9cc2e2386a451208 Mon Sep 17 00:00:00 2001 From: danisaev Date: Wed, 3 Jun 2026 11:41:52 +0300 Subject: [PATCH 44/71] docs: Explanatory comment --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 24718bde9..28ebb1864 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ over edge‑labeled directed graphs. Examples of such problems: 4) **Inspect results**. Detailed information and tutorial is [here](./cfpq-paths-app/README.md) - + ## Core Algorithm UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive From a8e10d2da3be32d7886154c0194007c17dc34dac Mon Sep 17 00:00:00 2001 From: danisaev Date: Thu, 9 Jul 2026 15:30:45 +0300 Subject: [PATCH 45/71] chore: Some fixes --- README.md | 2 +- cfpq-paths-app/README.md | 3 --- .../src/main/kotlin/org/ucfs/paths/examples/example_1.kt | 4 ++-- .../{PointsToAnBnGrammarRsm.dot => AnBnGrammarRsm.dot} | 0 ...ointsToAnBnGrammarRsm.dot.svg => AnBnGrammarRsm.dot.svg} | 0 cfpq-paths-app/tutorial/simple-examples.md | 6 +++--- 6 files changed, 6 insertions(+), 9 deletions(-) rename cfpq-paths-app/src/main/resources/figures/{PointsToAnBnGrammarRsm.dot => AnBnGrammarRsm.dot} (100%) rename cfpq-paths-app/src/main/resources/figures/{PointsToAnBnGrammarRsm.dot.svg => AnBnGrammarRsm.dot.svg} (100%) diff --git a/README.md b/README.md index 28ebb1864..24718bde9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ over edge‑labeled directed graphs. Examples of such problems: 4) **Inspect results**. Detailed information and tutorial is [here](./cfpq-paths-app/README.md) - + ## Core Algorithm UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive diff --git a/cfpq-paths-app/README.md b/cfpq-paths-app/README.md index 13146cf59..0555395c0 100644 --- a/cfpq-paths-app/README.md +++ b/cfpq-paths-app/README.md @@ -2,9 +2,6 @@ This module contains Runnable demos for UCFS. For project overview, see [../README.md](../README.md). - ## Prerequisites diff --git a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt index 7d638b816..f28740420 100644 --- a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt +++ b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt @@ -13,7 +13,7 @@ import org.ucfs.sppf.node.* import java.nio.file.Files import java.nio.file.Path -class PointsToAnBnGrammar : Grammar() { +class AnBnGrammar : Grammar() { val S by Nt().asStart() init { @@ -92,7 +92,7 @@ fun saveSppf(name: String, sppf: Set>) { fun main() { listOf("example_1_graph.dot", "example_2_graph.dot", "example_3_graph.dot").forEach { graphName -> val graph = readGraph(graphName) - val grammar = PointsToAnBnGrammar() + val grammar = AnBnGrammar() val gll = Gll.gll(grammar.rsm, graph) val sppf = gll.parse() saveSppf(graphName, sppf) diff --git a/cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot b/cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot rename to cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot diff --git a/cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg b/cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg rename to cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot.svg diff --git a/cfpq-paths-app/tutorial/simple-examples.md b/cfpq-paths-app/tutorial/simple-examples.md index 69fa46c57..b9f77f7e9 100644 --- a/cfpq-paths-app/tutorial/simple-examples.md +++ b/cfpq-paths-app/tutorial/simple-examples.md @@ -10,7 +10,7 @@ occurrences of $b$ (e.g., $ab$, $aabb$, $aaabbb$). > [!NOTE] > The grammar can be defined equivalently as follows. >```kotlin ->class PointsToAnBnGrammar : Grammar() { +>class AnBnGrammar : Grammar() { > val S by Nt().asStart() > > init { @@ -20,7 +20,7 @@ occurrences of $b$ (e.g., $ab$, $aabb$, $aaabbb$). >``` >or >```kotlin ->class PointsToAnBnGrammar : Grammar() { +>class AnBnGrammar : Grammar() { > val S by Nt().asStart() > > init { @@ -33,7 +33,7 @@ A **recursive state machine** ([RSM](https://www.researchgate.net/publication/22 The RSM for the $a^n b^n$ grammar: -![RSM for AnBn Grammar](../src/main/resources/figures/PointsToAnBnGrammarRsm.dot.svg) +![RSM for AnBn Grammar](../src/main/resources/figures/AnBnGrammarRsm.dot.svg) The start non-terminal $S$ expands to either the terminal string $ab$ or the string $aSb$. From 00af2a19dd7da3627295cbecfeba921bcdd2fbec Mon Sep 17 00:00:00 2001 From: danisaev Date: Thu, 9 Jul 2026 16:57:06 +0300 Subject: [PATCH 46/71] chore: Small changes --- cfpq-paths-app/tutorial/sppf.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cfpq-paths-app/tutorial/sppf.md b/cfpq-paths-app/tutorial/sppf.md index a7b2f0b7f..6da5e6d2c 100644 --- a/cfpq-paths-app/tutorial/sppf.md +++ b/cfpq-paths-app/tutorial/sppf.md @@ -5,13 +5,11 @@ satisfying the specified grammar. If the number of such paths is infinite, the S The SPPF consists of several node types. Each node has a unique ID and stores type-specific information. -* A **non-terminal** node contains the name of a non-terminal and pairs of vertices from the input graph that mark the -* start and end of paths derived from that non-terminal. +* A **non-terminal** node contains the name of a non-terminal and pairs of vertices from the input graph that mark the start and end of paths derived from that non-terminal. ![Graph for example 1](../src/main/resources/figures/Nonterm_example.dot.svg) - This node has ID ```0``` and is the root of all derivations for paths from vertex 1 to vertex 4 derivable from -* non-terminal ```S```. + This node has ID ```0``` and is the root of all derivations for paths from vertex 1 to vertex 4 derivable from non-terminal ```S```. * A **terminal** node is a leaf and corresponds to an edge. From 2ff7bf454ddfc4f5a60e63c771c80ef2a317b4a9 Mon Sep 17 00:00:00 2001 From: danisaev Date: Fri, 10 Jul 2026 13:31:19 +0300 Subject: [PATCH 47/71] docs: Added some files, modified simple_examples.md - Added files for 2pre-tree with images - Modified files for 2tree with images - Modified simple_examples.md with 2pre-tree and 2tree images --- .../figures/example_2_graph_sppf_2pretree.dot | 47 +++ .../example_2_graph_sppf_2pretree.dot.svg | 247 ++++++++++++++++ .../figures/example_2_graph_sppf_2tree.dot | 13 +- .../example_2_graph_sppf_2tree.dot.svg | 267 +++++++++++------- cfpq-paths-app/tutorial/simple-examples.md | 14 +- 5 files changed, 483 insertions(+), 105 deletions(-) create mode 100644 cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot create mode 100644 cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot new file mode 100644 index 000000000..ef7a48b45 --- /dev/null +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot @@ -0,0 +1,47 @@ +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] +_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_0->_0_1 +_0_1->_0_14 +_0_2->_0_15 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_18 +_0_7->_0_8 +_0_8->_0_9 +_0_8->_0_10 +_0_9->_0_11 +_0_10->_0_13 +_0_13->_0_1 +_0_14->_0_17 +_0_14->_0_18 +_0_15->_0_19 +_0_17->_0_2 +_0_18->_0_20 +} + +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg new file mode 100644 index 000000000..1c8ee3d8b --- /dev/null +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg @@ -0,0 +1,247 @@ + + + + + + + g + + + cluster_0 + + + + + _0_0 + + 0     Nonterminal S, input: [0, 1] + + + + _0_1 + + 1     Range , input: [0, 1], rsm: [S_0, S_3] + + + + _0_0->_0_1 + + + + + + _0_14 + 3     Intermediate input: 1, rsm: S_2, input: [0, 1] + + + + _0_1->_0_14 + + + + + + _0_2 + 10     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + + _0_3 + + 11     Range , input: [1, 1], rsm: [S_1, S_2] + + + + _0_2->_0_3 + + + + + + _0_15 + + 4     Range , input: [0, 1], rsm: [S_0, S_1] + + + + _0_2->_0_15 + + + + + + _0_4 + + 12     Nonterminal S, input: [1, 1] + + + + _0_3->_0_4 + + + + + + _0_5 + + 13     Range , input: [1, 1], rsm: [S_0, S_3] + + + + _0_4->_0_5 + + + + + + _0_6 + 14     Intermediate input: 1, rsm: S_2, input: [1, 1] + + + + _0_5->_0_6 + + + + + + _0_7 + + 15     Range , input: [1, 1], rsm: [S_0, S_2] + + + + _0_6->_0_7 + + + + + + _0_18 + + 7     Range , input: [1, 1], rsm: [S_2, S_3] + + + + _0_6->_0_18 + + + + + + _0_8 + 16     Intermediate input: 0, rsm: S_1, input: [1, 1] + + + + _0_7->_0_8 + + + + + + _0_9 + + 17     Range , input: [1, 0], rsm: [S_0, S_1] + + + + _0_8->_0_9 + + + + + + _0_10 + + 18     Range , input: [0, 1], rsm: [S_1, S_2] + + + + _0_8->_0_10 + + + + + + _0_11 + + 19     Terminal 'a', input: [1, 0] + + + + _0_9->_0_11 + + + + + + _0_13 + + 20     Nonterminal S, input: [0, 1] + + + + _0_10->_0_13 + + + + + + _0_13->_0_1 + + + + + + _0_17 + + 6     Range , input: [0, 1], rsm: [S_0, S_2] + + + + _0_14->_0_17 + + + + + + _0_14->_0_18 + + + + + + _0_19 + + 8     Terminal 'a', input: [0, 1] + + + + _0_15->_0_19 + + + + + + _0_17->_0_2 + + + + + + _0_20 + + 9     Terminal 'b', input: [1, 1] + + + + _0_18->_0_20 + + + + + diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot index 5c6f450c8..157aa3333 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot @@ -22,6 +22,18 @@ _0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] _0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] _0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] _0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_21 [label = "21 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_22 [label = "22 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_23 [label = "23 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_24 [label = "24 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_25 [label = "25 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_26 [label = "26 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_13->_0_21 +_0_21->_0_22 +_0_22->_0_23 +_0_22->_0_24 +_0_23->_0_25 +_0_24->_0_26 _0_0->_0_1 _0_1->_0_14 _0_2->_0_15 @@ -36,7 +48,6 @@ _0_8->_0_9 _0_8->_0_10 _0_9->_0_11 _0_10->_0_13 -_0_13->_0_1 _0_14->_0_17 _0_14->_0_18 _0_15->_0_19 diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg index 4e6b3673d..70d858962 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg @@ -4,244 +4,309 @@ - - + + g - + cluster_0 - + _0_0 - -0     Nonterminal S, input: [0, 1] + +0     Nonterminal S, input: [0, 1] _0_1 - -1     Range , input: [0, 1], rsm: [S_0, S_3] + +1     Range , input: [0, 1], rsm: [S_0, S_3] - + _0_0->_0_1 - - + + _0_14 -3     Intermediate input: 1, rsm: S_2, input: [0, 1] +3     Intermediate input: 1, rsm: S_2, input: [0, 1] - + _0_1->_0_14 - - + + _0_2 -10     Intermediate input: 1, rsm: S_1, input: [0, 1] +10     Intermediate input: 1, rsm: S_1, input: [0, 1] _0_3 - -11     Range , input: [1, 1], rsm: [S_1, S_2] + +11     Range , input: [1, 1], rsm: [S_1, S_2] - + _0_2->_0_3 - - + + _0_15 - -4     Range , input: [0, 1], rsm: [S_0, S_1] + +4     Range , input: [0, 1], rsm: [S_0, S_1] - + _0_2->_0_15 - - + + _0_4 - -12     Nonterminal S, input: [1, 1] + +12     Nonterminal S, input: [1, 1] - + _0_3->_0_4 - - + + _0_5 - -13     Range , input: [1, 1], rsm: [S_0, S_3] + +13     Range , input: [1, 1], rsm: [S_0, S_3] - + _0_4->_0_5 - - + + _0_6 -14     Intermediate input: 1, rsm: S_2, input: [1, 1] +14     Intermediate input: 1, rsm: S_2, input: [1, 1] - + _0_5->_0_6 - - + + _0_7 - -15     Range , input: [1, 1], rsm: [S_0, S_2] + +15     Range , input: [1, 1], rsm: [S_0, S_2] - + _0_6->_0_7 - - + + _0_18 - -7     Range , input: [1, 1], rsm: [S_2, S_3] + +7     Range , input: [1, 1], rsm: [S_2, S_3] - + _0_6->_0_18 - - + + _0_8 -16     Intermediate input: 0, rsm: S_1, input: [1, 1] +16     Intermediate input: 0, rsm: S_1, input: [1, 1] - + _0_7->_0_8 - - + + _0_9 - -17     Range , input: [1, 0], rsm: [S_0, S_1] + +17     Range , input: [1, 0], rsm: [S_0, S_1] - + _0_8->_0_9 - - + + _0_10 - -18     Range , input: [0, 1], rsm: [S_1, S_2] + +18     Range , input: [0, 1], rsm: [S_1, S_2] - + _0_8->_0_10 - - + + _0_11 - -19     Terminal 'a', input: [1, 0] + +19     Terminal 'a', input: [1, 0] - + _0_9->_0_11 - - + + _0_13 - -20     Nonterminal S, input: [0, 1] + +20     Nonterminal S, input: [0, 1] - + _0_10->_0_13 - - + + - - -_0_13->_0_1 - - + + +_0_21 + +21     Range , input: [0, 1], rsm: [S_0, S_3] + + + +_0_13->_0_21 + + _0_17 - -6     Range , input: [0, 1], rsm: [S_0, S_2] + +6     Range , input: [0, 1], rsm: [S_0, S_2] - + _0_14->_0_17 - - + + - + _0_14->_0_18 - - + + _0_19 - -8     Terminal 'a', input: [0, 1] + +8     Terminal 'a', input: [0, 1] - + _0_15->_0_19 - - + + - + _0_17->_0_2 - - + + _0_20 - -9     Terminal 'b', input: [1, 1] + +9     Terminal 'b', input: [1, 1] - + _0_18->_0_20 - - + + + + + +_0_22 +22     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + +_0_21->_0_22 + + + + + +_0_23 + +23     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_22->_0_23 + + + + + +_0_24 + +24     Range , input: [1, 1], rsm: [S_1, S_3] + + + +_0_22->_0_24 + + + + + +_0_25 + +25     Terminal 'a', input: [0, 1] + + + +_0_23->_0_25 + + + + + +_0_26 + +26     Terminal 'b', input: [1, 1] + + + +_0_24->_0_26 + + diff --git a/cfpq-paths-app/tutorial/simple-examples.md b/cfpq-paths-app/tutorial/simple-examples.md index b9f77f7e9..a16ecd47e 100644 --- a/cfpq-paths-app/tutorial/simple-examples.md +++ b/cfpq-paths-app/tutorial/simple-examples.md @@ -109,16 +109,24 @@ The SPPF decomposes into two trees: The first tree corresponds to the word $ab$. -**The *second* tree:** -![Simple AnBn Graph / Infinite Set of Paths / SPPF / 2Tree](../src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) -The second tree corresponds to the word $aaSbb$. +**The *second* pre-tree:** + +![Simple AnBn Graph / Infinite Set of Paths / SPPF / 2PreTree](../src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg) > [!NOTE] > The SPPF contains a cycle. The label sequence $aaSbb$ includes the non-terminal $S$, which can be expanded further > to obtain $aaabbb$, $aaaaabbbbb$, and so on. +Let's expand the nonterminal to construct the tree. + +**The *second* tree:** + +![Simple AnBn Graph / Infinite Set of Paths/ SPPF / 2Tree](../src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) + +This tree corresponds to the word $aaabbb$. + The result matches the expected language. **Example 3: Simple graph with an infinite set of paths #2** From b329f49b0f069e9c91b3904e4a82619094cf85c2 Mon Sep 17 00:00:00 2001 From: danisaev Date: Fri, 10 Jul 2026 14:12:23 +0300 Subject: [PATCH 48/71] docs: Changed colors in .dot files --- .../resources/figures/example_1_graph.dot | 14 +- .../figures/example_1_graph_sppf.dot | 10 +- .../figures/example_1_graph_sppf.dot.svg | 2 +- .../figures/example_1_graph_sppf_1tree.dot | 44 +- .../figures/example_1_graph_sppf_2tree.dot | 84 +-- .../example_1_graph_sppf_2tree.dot.svg | 2 +- .../resources/figures/example_2_graph.dot | 12 +- .../figures/example_2_graph_sppf.dot | 10 +- .../figures/example_2_graph_sppf.dot.svg | 2 +- .../figures/example_2_graph_sppf_1tree.dot | 44 +- .../figures/example_2_graph_sppf_2pretree.dot | 92 ++-- .../example_2_graph_sppf_2pretree.dot.svg | 480 +++++++++--------- .../figures/example_2_graph_sppf_2tree.dot | 121 ++--- .../example_2_graph_sppf_2tree.dot.svg | 212 ++++---- .../resources/figures/example_3_graph.dot | 20 +- .../figures/example_3_graph_sppf.dot | 132 ++--- .../figures/example_3_graph_sppf.dot.svg | 132 ++--- 17 files changed, 717 insertions(+), 696 deletions(-) diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot index 4b60207ce..cfd76d1cf 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot @@ -1,8 +1,8 @@ -digraph { - start -> 0; - 0 -> 1 [label = "a"]; - 1 -> 2 [label = "a"]; - 1 -> 2 [label = "b"]; - 2 -> 1 [label = "b"]; - +digraph { + start -> 0; + 0 -> 1 [label = "a"]; + 1 -> 2 [label = "a"]; + 1 -> 2 [label = "b"]; + 2 -> 1 [label = "b"]; + } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot index a85d0c66b..432c1e3fe 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot @@ -7,21 +7,21 @@ _0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] _0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] _0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] _0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] _0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] _0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] _0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle] -_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle] +_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle, color = "red"] _0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] _0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] _0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] _0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] _0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] +_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] _0_0->_0_1 _0_1->_0_11 _0_1->_0_12 diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg index 9b693fe16..c3c6dca71 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg @@ -85,7 +85,7 @@ _0_4 - + 12     Nonterminal S, input: [1, 1] diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot index e057c1278..937f858e6 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot @@ -1,22 +1,22 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] -_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] -_0_0->_0_1 -_0_1->_0_11 -_0_11->_0_13 -_0_11->_0_14 -_0_13->_0_17 -_0_14->_0_18 -} - -} - +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] +_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] +_0_0->_0_1 +_0_1->_0_11 +_0_11->_0_13 +_0_11->_0_14 +_0_13->_0_17 +_0_14->_0_18 +} + +} + diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot index 96ac7ec6f..c9fc66aa2 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot @@ -1,42 +1,42 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle] -_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle] -_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] -_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle] -_0_0->_0_1 -_0_1->_0_12 -_0_2->_0_13 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_8 -_0_7->_0_9 -_0_8->_0_10 -_0_12->_0_15 -_0_12->_0_16 -_0_13->_0_17 -_0_15->_0_2 -_0_16->_0_18 -} - -} - +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle, color = "red"] +_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] +_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] +_0_0->_0_1 +_0_1->_0_12 +_0_2->_0_13 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_8 +_0_7->_0_9 +_0_8->_0_10 +_0_12->_0_15 +_0_12->_0_16 +_0_13->_0_17 +_0_15->_0_2 +_0_16->_0_18 +} + +} + diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg index fba0abfe8..7f2f7daa5 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg @@ -74,7 +74,7 @@ _0_4 - + 12     Nonterminal S, input: [1, 1] diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot index a276cb960..355c5d683 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot @@ -1,7 +1,7 @@ -digraph { - start -> 0; - 0 -> 1 [label = "a"]; - 1 -> 0 [label = "a"]; - 1 -> 1 [label = "b"]; - +digraph { + start -> 0; + 0 -> 1 [label = "a"]; + 1 -> 0 [label = "a"]; + 1 -> 1 [label = "b"]; + } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot index 957352329..b46686bdd 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot @@ -7,23 +7,23 @@ _0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] _0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] _0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] _0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] _0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] _0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] _0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] _0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] _0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] +_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] _0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] _0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] _0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] _0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] _0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] _0_0->_0_1 _0_1->_0_12 _0_1->_0_14 diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg index c7ea1f112..3888cb736 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg @@ -85,7 +85,7 @@ _0_4 - + 12     Nonterminal S, input: [1, 1] diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot index cd9a4887b..d0c7b277e 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot @@ -1,22 +1,22 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] -_0_0->_0_1 -_0_1->_0_12 -_0_12->_0_15 -_0_12->_0_16 -_0_15->_0_19 -_0_16->_0_20 -} - -} - +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_0->_0_1 +_0_1->_0_12 +_0_12->_0_15 +_0_12->_0_16 +_0_15->_0_19 +_0_16->_0_20 +} + +} + diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot index ef7a48b45..f4f27d5ab 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot @@ -1,47 +1,47 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] -_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] -_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] -_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] -_0_0->_0_1 -_0_1->_0_14 -_0_2->_0_15 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_18 -_0_7->_0_8 -_0_8->_0_9 -_0_8->_0_10 -_0_9->_0_11 -_0_10->_0_13 -_0_13->_0_1 -_0_14->_0_17 -_0_14->_0_18 -_0_15->_0_19 -_0_17->_0_2 -_0_18->_0_20 -} - +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] +_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] +_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_0->_0_1 +_0_1->_0_14 +_0_2->_0_15 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_18 +_0_7->_0_8 +_0_8->_0_9 +_0_8->_0_10 +_0_9->_0_11 +_0_10->_0_13 +_0_13->_0_1 +_0_14->_0_17 +_0_14->_0_18 +_0_15->_0_19 +_0_17->_0_2 +_0_18->_0_20 +} + } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg index 1c8ee3d8b..026041830 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg @@ -1,247 +1,247 @@ + "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> - - g - - - cluster_0 - - - - - _0_0 - - 0     Nonterminal S, input: [0, 1] - - - - _0_1 - - 1     Range , input: [0, 1], rsm: [S_0, S_3] - - - - _0_0->_0_1 - - - - - - _0_14 - 3     Intermediate input: 1, rsm: S_2, input: [0, 1] - - - - _0_1->_0_14 - - - - - - _0_2 - 10     Intermediate input: 1, rsm: S_1, input: [0, 1] - - - - _0_3 - - 11     Range , input: [1, 1], rsm: [S_1, S_2] - - - - _0_2->_0_3 - - - - - - _0_15 - - 4     Range , input: [0, 1], rsm: [S_0, S_1] - - - - _0_2->_0_15 - - - - - - _0_4 - - 12     Nonterminal S, input: [1, 1] - - - - _0_3->_0_4 - - - - - - _0_5 - - 13     Range , input: [1, 1], rsm: [S_0, S_3] - - - - _0_4->_0_5 - - - - - - _0_6 - 14     Intermediate input: 1, rsm: S_2, input: [1, 1] - - - - _0_5->_0_6 - - - - - - _0_7 - - 15     Range , input: [1, 1], rsm: [S_0, S_2] - - - - _0_6->_0_7 - - - - - - _0_18 - - 7     Range , input: [1, 1], rsm: [S_2, S_3] - - - - _0_6->_0_18 - - - - - - _0_8 - 16     Intermediate input: 0, rsm: S_1, input: [1, 1] - - - - _0_7->_0_8 - - - - - - _0_9 - - 17     Range , input: [1, 0], rsm: [S_0, S_1] - - - - _0_8->_0_9 - - - - - - _0_10 - - 18     Range , input: [0, 1], rsm: [S_1, S_2] - - - - _0_8->_0_10 - - - - - - _0_11 - - 19     Terminal 'a', input: [1, 0] - - - - _0_9->_0_11 - - - - - - _0_13 - - 20     Nonterminal S, input: [0, 1] - - - - _0_10->_0_13 - - - - - - _0_13->_0_1 - - - - - - _0_17 - - 6     Range , input: [0, 1], rsm: [S_0, S_2] - - - - _0_14->_0_17 - - - - - - _0_14->_0_18 - - - - - - _0_19 - - 8     Terminal 'a', input: [0, 1] - - - - _0_15->_0_19 - - - - - - _0_17->_0_2 - - - - - - _0_20 - - 9     Terminal 'b', input: [1, 1] - - - - _0_18->_0_20 - - - - + viewBox="0.00 0.00 908.00 877.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + +g + + +cluster_0 + + + + +_0_0 + +0     Nonterminal S, input: [0, 1] + + + +_0_1 + +1     Range , input: [0, 1], rsm: [S_0, S_3] + + + +_0_0->_0_1 + + + + + +_0_14 +3     Intermediate input: 1, rsm: S_2, input: [0, 1] + + + +_0_1->_0_14 + + + + + +_0_2 +10     Intermediate input: 1, rsm: S_1, input: [0, 1] + + + +_0_3 + +11     Range , input: [1, 1], rsm: [S_1, S_2] + + + +_0_2->_0_3 + + + + + +_0_15 + +4     Range , input: [0, 1], rsm: [S_0, S_1] + + + +_0_2->_0_15 + + + + + +_0_4 + +12     Nonterminal S, input: [1, 1] + + + +_0_3->_0_4 + + + + + +_0_5 + +13     Range , input: [1, 1], rsm: [S_0, S_3] + + + +_0_4->_0_5 + + + + + +_0_6 +14     Intermediate input: 1, rsm: S_2, input: [1, 1] + + + +_0_5->_0_6 + + + + + +_0_7 + +15     Range , input: [1, 1], rsm: [S_0, S_2] + + + +_0_6->_0_7 + + + + + +_0_18 + +7     Range , input: [1, 1], rsm: [S_2, S_3] + + + +_0_6->_0_18 + + + + + +_0_8 +16     Intermediate input: 0, rsm: S_1, input: [1, 1] + + + +_0_7->_0_8 + + + + + +_0_9 + +17     Range , input: [1, 0], rsm: [S_0, S_1] + + + +_0_8->_0_9 + + + + + +_0_10 + +18     Range , input: [0, 1], rsm: [S_1, S_2] + + + +_0_8->_0_10 + + + + + +_0_11 + +19     Terminal 'a', input: [1, 0] + + + +_0_9->_0_11 + + + + + +_0_13 + +20     Nonterminal S, input: [0, 1] + + + +_0_10->_0_13 + + + + + +_0_13->_0_1 + + + + + +_0_17 + +6     Range , input: [0, 1], rsm: [S_0, S_2] + + + +_0_14->_0_17 + + + + + +_0_14->_0_18 + + + + + +_0_19 + +8     Terminal 'a', input: [0, 1] + + + +_0_15->_0_19 + + + + + +_0_17->_0_2 + + + + + +_0_20 + +9     Terminal 'b', input: [1, 1] + + + +_0_18->_0_20 + + + + diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot index 157aa3333..680551247 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot @@ -1,59 +1,62 @@ -digraph g { -labelloc="t" -label="" -subgraph cluster_0{ -labelloc="t" -_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] -_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] -_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle] -_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium] -_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle] -_0_21 [label = "21 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_22 [label = "22 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_23 [label = "23 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_24 [label = "24 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_25 [label = "25 Terminal 'a', input: [0, 1]", shape = rectangle] -_0_26 [label = "26 Terminal 'b', input: [1, 1]", shape = rectangle] -_0_13->_0_21 -_0_21->_0_22 -_0_22->_0_23 -_0_22->_0_24 -_0_23->_0_25 -_0_24->_0_26 -_0_0->_0_1 -_0_1->_0_14 -_0_2->_0_15 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_18 -_0_7->_0_8 -_0_8->_0_9 -_0_8->_0_10 -_0_9->_0_11 -_0_10->_0_13 -_0_14->_0_17 -_0_14->_0_18 -_0_15->_0_19 -_0_17->_0_2 -_0_18->_0_20 -} - -} - +digraph g { +labelloc="t" +label="" +subgraph cluster_0{ +labelloc="t" +_0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] +_0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] +_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] +_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_27 [label = "27 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_28 [label = "28 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_21 [label = "21 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_22 [label = "22 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_23 [label = "23 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_24 [label = "24 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_25 [label = "25 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_26 [label = "26 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_13->_0_21 +_0_21->_0_22 +_0_22->_0_23 +_0_22->_0_24 +_0_23->_0_25 +_0_24->_0_26 +_0_0->_0_1 +_0_1->_0_14 +_0_2->_0_15 +_0_2->_0_3 +_0_3->_0_4 +_0_4->_0_5 +_0_5->_0_6 +_0_6->_0_7 +_0_6->_0_18 +_0_7->_0_8 +_0_8->_0_9 +_0_8->_0_10 +_0_9->_0_11 +_0_10->_0_13 +_0_14->_0_17 +_0_14->_0_27 +_0_27->_0_28 +_0_15->_0_19 +_0_17->_0_2 +_0_18->_0_20 +} + +} + diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg index 70d858962..b4d19ed65 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg @@ -4,84 +4,84 @@ - - + + g - + cluster_0 - + _0_0 - -0     Nonterminal S, input: [0, 1] + +0     Nonterminal S, input: [0, 1] _0_1 - -1     Range , input: [0, 1], rsm: [S_0, S_3] + +1     Range , input: [0, 1], rsm: [S_0, S_3] _0_0->_0_1 - - + + _0_14 -3     Intermediate input: 1, rsm: S_2, input: [0, 1] +3     Intermediate input: 1, rsm: S_2, input: [0, 1] _0_1->_0_14 - - + + _0_2 -10     Intermediate input: 1, rsm: S_1, input: [0, 1] +10     Intermediate input: 1, rsm: S_1, input: [0, 1] _0_3 - -11     Range , input: [1, 1], rsm: [S_1, S_2] + +11     Range , input: [1, 1], rsm: [S_1, S_2] _0_2->_0_3 - - + + _0_15 - -4     Range , input: [0, 1], rsm: [S_0, S_1] + +4     Range , input: [0, 1], rsm: [S_0, S_1] _0_2->_0_15 - - + + _0_4 - + 12     Nonterminal S, input: [1, 1] _0_3->_0_4 - - + + @@ -109,37 +109,37 @@ _0_7 - -15     Range , input: [1, 1], rsm: [S_0, S_2] + +15     Range , input: [1, 1], rsm: [S_0, S_2] _0_6->_0_7 - - + + _0_18 - -7     Range , input: [1, 1], rsm: [S_2, S_3] + +7     Range , input: [1, 1], rsm: [S_2, S_3] _0_6->_0_18 - - + + _0_8 -16     Intermediate input: 0, rsm: S_1, input: [1, 1] +16     Intermediate input: 0, rsm: S_1, input: [1, 1] _0_7->_0_8 - - + + @@ -150,8 +150,8 @@ _0_8->_0_9 - - + + @@ -162,8 +162,8 @@ _0_8->_0_10 - - + + @@ -180,133 +180,151 @@ _0_13 - -20     Nonterminal S, input: [0, 1] + +20     Nonterminal S, input: [0, 1] _0_10->_0_13 - - + + - + _0_21 - -21     Range , input: [0, 1], rsm: [S_0, S_3] + +21     Range , input: [0, 1], rsm: [S_0, S_3] _0_13->_0_21 - - + + _0_17 - -6     Range , input: [0, 1], rsm: [S_0, S_2] + +6     Range , input: [0, 1], rsm: [S_0, S_2] _0_14->_0_17 - - + + + + + +_0_27 + +27     Range , input: [1, 1], rsm: [S_2, S_3] - + -_0_14->_0_18 - - +_0_14->_0_27 + + - + _0_19 - -8     Terminal 'a', input: [0, 1] + +8     Terminal 'a', input: [0, 1] - + _0_15->_0_19 - - + + - + _0_17->_0_2 - - + + - + _0_20 - -9     Terminal 'b', input: [1, 1] + +9     Terminal 'b', input: [1, 1] - + _0_18->_0_20 - - + + + + + +_0_28 + +28     Terminal 'b', input: [1, 1] + + + +_0_27->_0_28 + + - + _0_22 -22     Intermediate input: 1, rsm: S_1, input: [0, 1] +22     Intermediate input: 1, rsm: S_1, input: [0, 1] _0_21->_0_22 - - + + - + _0_23 - -23     Range , input: [0, 1], rsm: [S_0, S_1] + +23     Range , input: [0, 1], rsm: [S_0, S_1] _0_22->_0_23 - - + + - + _0_24 - -24     Range , input: [1, 1], rsm: [S_1, S_3] + +24     Range , input: [1, 1], rsm: [S_1, S_3] _0_22->_0_24 - - + + - + _0_25 - -25     Terminal 'a', input: [0, 1] + +25     Terminal 'a', input: [0, 1] _0_23->_0_25 - - + + - + _0_26 - -26     Terminal 'b', input: [1, 1] + +26     Terminal 'b', input: [1, 1] _0_24->_0_26 - - + + diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot index 2e845e0ea..6a612f706 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot @@ -1,11 +1,11 @@ -digraph { - start -> 0; - start -> 1; - start -> 2; - 0 -> 1 [label = "a"]; - 1 -> 2 [label = "a"]; - 2 -> 3 [label = "b"]; - 3 -> 2 [label = "b"]; - 2 -> 0 [label = "a"]; - +digraph { + start -> 0; + start -> 1; + start -> 2; + 0 -> 1 [label = "a"]; + 1 -> 2 [label = "a"]; + 2 -> 3 [label = "b"]; + 3 -> 2 [label = "b"]; + 2 -> 0 [label = "a"]; + } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot index b83bc8506..db8faf703 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot @@ -5,7 +5,7 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] _0_3 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] _0_4 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _0_5 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] @@ -13,45 +13,45 @@ _0_6 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] _0_7 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] _0_8 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] _0_9 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle] -_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle] +_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] _0_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] _0_13 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] _0_14 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] _0_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] _0_17 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] _0_18 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] _0_19 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] _0_20 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] _0_21 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle] +_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] _0_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] _0_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] _0_26 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] _0_27 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] _0_28 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] _0_29 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] _0_31 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] _0_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] _0_33 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] _0_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] _0_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _0_36 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] _0_38 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] _0_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] _0_40 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] _0_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] _0_42 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] _0_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] _0_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _0_47 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _0_0->_0_1 _0_1->_0_12 _0_2->_0_3 @@ -116,33 +116,33 @@ subgraph cluster_1{ labelloc="t" _1_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] _1_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] _1_3 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] _1_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] _1_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] _1_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] _1_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] _1_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] _1_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle] +_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] _1_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] _1_14 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] _1_15 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] _1_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] _1_17 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] _1_18 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] _1_19 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle] -_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] _1_22 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] _1_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] _1_24 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] _1_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] _1_26 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] _1_27 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] _1_29 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] _1_30 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _1_31 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] @@ -151,18 +151,18 @@ _1_33 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] _1_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] _1_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] _1_36 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] _1_38 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] _1_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] _1_40 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] _1_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] _1_42 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] _1_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] _1_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _1_47 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle] +_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _1_0->_1_1 _1_1->_1_12 _1_2->_1_3 @@ -227,26 +227,26 @@ subgraph cluster_2{ labelloc="t" _2_0 [label = "0 Nonterminal S, input: [1, 2]", shape = invtrapezium] _2_1 [label = "1 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] _2_3 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] _2_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] _2_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] _2_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] _2_7 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] _2_9 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] _2_10 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle] +_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] _2_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] _2_14 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] _2_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] _2_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] _2_17 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] _2_18 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _2_19 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle] -_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] _2_22 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] _2_23 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] _2_24 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] @@ -255,25 +255,25 @@ _2_26 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] _2_27 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] _2_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] _2_29 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] _2_31 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] _2_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] _2_33 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] _2_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] _2_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] _2_36 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] _2_38 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] _2_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] _2_40 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] _2_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] _2_42 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] _2_44 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] _2_46 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] _2_47 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle] +_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] _2_0->_2_1 _2_1->_2_12 _2_2->_2_3 @@ -340,51 +340,51 @@ _3_0 [label = "0 Nonterminal S, input: [1, 3]", shape = invtrapezium] _3_1 [label = "1 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] _3_2 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] _3_3 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] _3_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] _3_6 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] _3_7 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] _3_8 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] _3_9 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle] +_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] _3_11 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] _3_12 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _3_13 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle] -_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] _3_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] _3_17 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] _3_18 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] _3_19 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] _3_20 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _3_21 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle] +_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _3_23 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] _3_25 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] _3_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] _3_27 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] _3_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _3_29 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] _3_31 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] _3_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] _3_33 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] _3_34 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] _3_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] _3_36 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] _3_38 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] _3_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] _3_40 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] _3_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] _3_42 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] _3_44 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] _3_45 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] _3_46 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle] -_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle] +_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] _3_0->_3_1 _3_1->_3_12 _3_1->_3_23 @@ -449,40 +449,40 @@ subgraph cluster_4{ labelloc="t" _4_0 [label = "0 Nonterminal S, input: [2, 2]", shape = invtrapezium] _4_1 [label = "1 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] _4_3 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] _4_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] _4_5 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] _4_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] _4_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle] +_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] _4_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _4_10 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _4_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] _4_14 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] _4_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] _4_16 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] _4_17 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _4_18 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] _4_19 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] -_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] _4_22 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] _4_23 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] _4_24 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] _4_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] _4_26 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] _4_27 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] _4_29 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] _4_30 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] _4_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] _4_32 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] _4_33 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] _4_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] _4_36 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] _4_37 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _4_38 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] @@ -490,12 +490,12 @@ _4_39 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] _4_40 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] _4_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] _4_42 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] _4_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle] +_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] _4_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] _4_47 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] _4_0->_4_1 _4_1->_4_12 _4_2->_4_3 @@ -560,53 +560,53 @@ subgraph cluster_5{ labelloc="t" _5_0 [label = "0 Nonterminal S, input: [2, 3]", shape = invtrapezium] _5_1 [label = "1 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium] +_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] _5_3 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] _5_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] _5_5 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] _5_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] _5_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle] +_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] _5_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _5_10 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle] +_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _5_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium] +_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] _5_14 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] _5_15 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _5_16 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] _5_17 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] _5_18 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] _5_19 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle] +_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] _5_21 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] _5_22 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] _5_23 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium] +_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] _5_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] _5_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] _5_27 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] _5_28 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] _5_29 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium] +_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] _5_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] _5_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] _5_33 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] _5_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] _5_35 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] _5_36 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium] +_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] _5_38 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] _5_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] _5_40 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] _5_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] _5_42 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium] +_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] _5_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle] +_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] _5_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] _5_47 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle] +_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] _5_0->_5_1 _5_1->_5_12 _5_2->_5_3 diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg index 27dec8ae1..a12f46a1a 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg @@ -65,7 +65,7 @@ _0_2 - + 10     Nonterminal S, input: [1, 3] @@ -153,7 +153,7 @@ _0_10 - + 18     Terminal 'a', input: [1, 2] @@ -165,7 +165,7 @@ _0_11 - + 19     Terminal 'b', input: [2, 3] @@ -236,7 +236,7 @@ _0_15 - + 22     Nonterminal S, input: [2, 2] @@ -324,7 +324,7 @@ _0_22 - + 29     Terminal 'a', input: [2, 0] @@ -336,7 +336,7 @@ _0_24 - + 30     Nonterminal S, input: [0, 3] @@ -435,7 +435,7 @@ _0_30 - + 36     Nonterminal S, input: [1, 2] @@ -499,7 +499,7 @@ _0_45 - + 6     Terminal 'b', input: [3, 2] @@ -529,7 +529,7 @@ _0_37 - + 42     Nonterminal S, input: [2, 3] @@ -611,7 +611,7 @@ _0_43 - + 48     Nonterminal S, input: [0, 2] @@ -647,7 +647,7 @@ _0_48 - + 9     Terminal 'a', input: [0, 1] @@ -694,7 +694,7 @@ _1_2 - + 10     Nonterminal S, input: [1, 2] @@ -758,7 +758,7 @@ _1_8 - + 16     Terminal 'b', input: [3, 2] @@ -794,7 +794,7 @@ _1_11 - + 19     Terminal 'a', input: [1, 2] @@ -806,7 +806,7 @@ _1_13 - + 20     Nonterminal S, input: [2, 3] @@ -918,7 +918,7 @@ _1_20 - + 27     Terminal 'a', input: [2, 0] @@ -930,7 +930,7 @@ _1_21 - + 28     Nonterminal S, input: [0, 2] @@ -1029,7 +1029,7 @@ _1_28 - + 34     Nonterminal S, input: [1, 3] @@ -1111,7 +1111,7 @@ _1_45 - + 6     Terminal 'b', input: [2, 3] @@ -1158,7 +1158,7 @@ _1_37 - + 42     Nonterminal S, input: [2, 2] @@ -1240,7 +1240,7 @@ _1_43 - + 48     Nonterminal S, input: [0, 3] @@ -1276,7 +1276,7 @@ _1_48 - + 9     Terminal 'a', input: [0, 1] @@ -1323,7 +1323,7 @@ _2_2 - + 10     Nonterminal S, input: [2, 3] @@ -1387,7 +1387,7 @@ _2_8 - + 16     Terminal 'b', input: [2, 3] @@ -1423,7 +1423,7 @@ _2_11 - + 19     Terminal 'a', input: [2, 0] @@ -1435,7 +1435,7 @@ _2_13 - + 20     Nonterminal S, input: [0, 2] @@ -1547,7 +1547,7 @@ _2_20 - + 27     Terminal 'a', input: [0, 1] @@ -1559,7 +1559,7 @@ _2_21 - + 28     Nonterminal S, input: [1, 3] @@ -1693,7 +1693,7 @@ _2_30 - + 36     Nonterminal S, input: [2, 2] @@ -1757,7 +1757,7 @@ _2_45 - + 6     Terminal 'b', input: [3, 2] @@ -1787,7 +1787,7 @@ _2_37 - + 42     Nonterminal S, input: [0, 3] @@ -1869,7 +1869,7 @@ _2_43 - + 48     Nonterminal S, input: [1, 2] @@ -1905,7 +1905,7 @@ _2_48 - + 9     Terminal 'a', input: [1, 2] @@ -1992,7 +1992,7 @@ _3_4 - + 12     Nonterminal S, input: [2, 2] @@ -2062,7 +2062,7 @@ _3_10 - + 18     Terminal 'b', input: [3, 2] @@ -2098,7 +2098,7 @@ _3_14 - + 21     Terminal 'a', input: [2, 0] @@ -2128,7 +2128,7 @@ _3_15 - + 22     Nonterminal S, input: [0, 3] @@ -2222,7 +2222,7 @@ _3_22 - + 29     Terminal 'a', input: [0, 1] @@ -2234,7 +2234,7 @@ _3_24 - + 30     Nonterminal S, input: [1, 2] @@ -2334,7 +2334,7 @@ _3_30 - + 36     Nonterminal S, input: [2, 3] @@ -2398,7 +2398,7 @@ _3_47 - + 8     Terminal 'a', input: [1, 2] @@ -2428,7 +2428,7 @@ _3_37 - + 42     Nonterminal S, input: [0, 2] @@ -2510,7 +2510,7 @@ _3_43 - + 48     Nonterminal S, input: [1, 3] @@ -2528,7 +2528,7 @@ _3_48 - + 9     Terminal 'b', input: [2, 3] @@ -2581,7 +2581,7 @@ _4_2 - + 10     Nonterminal S, input: [0, 3] @@ -2645,7 +2645,7 @@ _4_8 - + 16     Terminal 'b', input: [2, 3] @@ -2681,7 +2681,7 @@ _4_11 - + 19     Terminal 'a', input: [0, 1] @@ -2693,7 +2693,7 @@ _4_13 - + 20     Nonterminal S, input: [1, 2] @@ -2805,7 +2805,7 @@ _4_20 - + 27     Terminal 'a', input: [1, 2] @@ -2817,7 +2817,7 @@ _4_21 - + 28     Nonterminal S, input: [2, 3] @@ -2916,7 +2916,7 @@ _4_28 - + 34     Nonterminal S, input: [0, 2] @@ -2998,7 +2998,7 @@ _4_35 - + 40     Nonterminal S, input: [1, 3] @@ -3010,7 +3010,7 @@ _4_45 - + 6     Terminal 'b', input: [3, 2] @@ -3127,7 +3127,7 @@ _4_43 - + 48     Nonterminal S, input: [2, 2] @@ -3163,7 +3163,7 @@ _4_48 - + 9     Terminal 'a', input: [2, 0] @@ -3210,7 +3210,7 @@ _5_2 - + 10     Nonterminal S, input: [0, 2] @@ -3274,7 +3274,7 @@ _5_8 - + 16     Terminal 'b', input: [3, 2] @@ -3310,7 +3310,7 @@ _5_11 - + 19     Terminal 'a', input: [0, 1] @@ -3322,7 +3322,7 @@ _5_13 - + 20     Nonterminal S, input: [1, 3] @@ -3434,7 +3434,7 @@ _5_20 - + 27     Terminal 'a', input: [1, 2] @@ -3446,7 +3446,7 @@ _5_45 - + 6     Terminal 'b', input: [2, 3] @@ -3487,7 +3487,7 @@ _5_24 - + 30     Nonterminal S, input: [2, 2] @@ -3586,7 +3586,7 @@ _5_30 - + 36     Nonterminal S, input: [0, 3] @@ -3674,7 +3674,7 @@ _5_37 - + 42     Nonterminal S, input: [1, 2] @@ -3756,7 +3756,7 @@ _5_43 - + 48     Nonterminal S, input: [2, 3] @@ -3792,7 +3792,7 @@ _5_48 - + 9     Terminal 'a', input: [2, 0] From b5c962768d22e043829cd2d718e7830295bfef2b Mon Sep 17 00:00:00 2001 From: danisaev Date: Fri, 10 Jul 2026 14:29:52 +0300 Subject: [PATCH 49/71] docs: Reorganizing dot files: vertices according to their names --- .../figures/example_1_graph_sppf.dot | 70 +- .../figures/example_1_graph_sppf.dot.svg | 144 +- .../figures/example_1_graph_sppf_1tree.dot | 20 +- .../example_1_graph_sppf_1tree.dot.svg | 40 +- .../figures/example_1_graph_sppf_2tree.dot | 58 +- .../example_1_graph_sppf_2tree.dot.svg | 120 +- .../figures/example_2_graph_sppf.dot | 82 +- .../figures/example_2_graph_sppf.dot.svg | 168 +- .../figures/example_2_graph_sppf_1tree.dot | 20 +- .../example_2_graph_sppf_1tree.dot.svg | 40 +- .../figures/example_2_graph_sppf_2pretree.dot | 70 +- .../example_2_graph_sppf_2pretree.dot.svg | 144 +- .../figures/example_2_graph_sppf_2tree.dot | 72 +- .../example_2_graph_sppf_2tree.dot.svg | 144 +- .../figures/example_3_graph_sppf.dot | 1072 +++---- .../figures/example_3_graph_sppf.dot.svg | 2496 ++++++++--------- 16 files changed, 2380 insertions(+), 2380 deletions(-) diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot index 432c1e3fe..c5eabb4ed 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot @@ -5,43 +5,43 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] -_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle, color = "red"] -_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] -_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] -_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] +_0_10 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_11 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_12 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_13 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_14 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] +_0_15 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_16 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_17 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_0_18 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle, color = "red"] +_0_2 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_3 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] +_0_4 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_5 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] +_0_6 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_7 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_8 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_9 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] _0_0->_0_1 -_0_1->_0_11 -_0_1->_0_12 -_0_2->_0_13 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_8 -_0_7->_0_9 -_0_8->_0_10 -_0_11->_0_13 -_0_11->_0_14 -_0_12->_0_15 -_0_12->_0_16 -_0_13->_0_17 -_0_14->_0_18 -_0_15->_0_2 +_0_1->_0_2 +_0_1->_0_3 +_0_10->_0_4 +_0_10->_0_11 +_0_11->_0_12 +_0_12->_0_13 +_0_13->_0_14 +_0_14->_0_15 +_0_14->_0_16 +_0_15->_0_17 _0_16->_0_18 +_0_2->_0_4 +_0_2->_0_5 +_0_3->_0_6 +_0_3->_0_7 +_0_4->_0_8 +_0_5->_0_9 +_0_6->_0_10 +_0_7->_0_9 } } diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg index c3c6dca71..53b9bdaed 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg @@ -31,215 +31,215 @@ - + -_0_11 +_0_2 2     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_0_1->_0_11 +_0_1->_0_2 - + -_0_12 +_0_3 3     Intermediate input: 1, rsm: S_2, input: [0, 2] - + -_0_1->_0_12 +_0_1->_0_3 - + -_0_2 +_0_10 10     Intermediate input: 1, rsm: S_1, input: [0, 1] - + -_0_3 +_0_11 11     Range , input: [1, 1], rsm: [S_1, S_2] - + -_0_2->_0_3 +_0_10->_0_11 - + -_0_13 +_0_4 4     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_2->_0_13 +_0_10->_0_4 - + -_0_4 +_0_12 12     Nonterminal S, input: [1, 1] - + -_0_3->_0_4 +_0_11->_0_12 - + -_0_5 +_0_13 13     Range , input: [1, 1], rsm: [S_0, S_3] - + -_0_4->_0_5 +_0_12->_0_13 - + -_0_6 +_0_14 14     Intermediate input: 2, rsm: S_1, input: [1, 1] - + -_0_5->_0_6 +_0_13->_0_14 - + -_0_7 +_0_15 15     Range , input: [1, 2], rsm: [S_0, S_1] - + -_0_6->_0_7 +_0_14->_0_15 - + -_0_8 +_0_16 16     Range , input: [2, 1], rsm: [S_1, S_3] - + -_0_6->_0_8 +_0_14->_0_16 - + -_0_9 +_0_17 17     Terminal 'a', input: [1, 2] - + -_0_7->_0_9 +_0_15->_0_17 - + -_0_10 +_0_18 18     Terminal 'b', input: [2, 1] - + -_0_8->_0_10 +_0_16->_0_18 - + -_0_11->_0_13 +_0_2->_0_4 - + -_0_14 +_0_5 5     Range , input: [1, 2], rsm: [S_1, S_3] - + -_0_11->_0_14 +_0_2->_0_5 - + -_0_15 +_0_6 6     Range , input: [0, 1], rsm: [S_0, S_2] - + -_0_12->_0_15 +_0_3->_0_6 - + -_0_16 +_0_7 7     Range , input: [1, 2], rsm: [S_2, S_3] - + -_0_12->_0_16 +_0_3->_0_7 - + -_0_17 +_0_8 8     Terminal 'a', input: [0, 1] - + -_0_13->_0_17 +_0_4->_0_8 - + -_0_18 +_0_9 9     Terminal 'b', input: [1, 2] - + -_0_14->_0_18 +_0_5->_0_9 - + -_0_15->_0_2 +_0_6->_0_10 - + -_0_16->_0_18 +_0_7->_0_9 diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot index 937f858e6..237cb6c07 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot @@ -5,17 +5,17 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_11 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_14 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] -_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] +_0_2 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_4 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_5 [label = "5 Range , input: [1, 2], rsm: [S_1, S_3]", shape = ellipse] +_0_8 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_9 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] _0_0->_0_1 -_0_1->_0_11 -_0_11->_0_13 -_0_11->_0_14 -_0_13->_0_17 -_0_14->_0_18 +_0_1->_0_2 +_0_2->_0_4 +_0_2->_0_5 +_0_4->_0_8 +_0_5->_0_9 } } diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg index 7e1049d04..c76899eba 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg @@ -31,62 +31,62 @@ - + -_0_11 +_0_2 2     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_0_1->_0_11 +_0_1->_0_2 - + -_0_13 +_0_4 4     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_11->_0_13 +_0_2->_0_4 - + -_0_14 +_0_5 5     Range , input: [1, 2], rsm: [S_1, S_3] - + -_0_11->_0_14 +_0_2->_0_5 - + -_0_17 +_0_8 8     Terminal 'a', input: [0, 1] - + -_0_13->_0_17 +_0_4->_0_8 - + -_0_18 +_0_9 9     Terminal 'b', input: [1, 2] - + -_0_14->_0_18 +_0_5->_0_9 diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot index c9fc66aa2..3f1fe0d12 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot @@ -5,37 +5,37 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_0_8 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_9 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] -_0_10 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle, color = "red"] -_0_12 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] -_0_13 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_15 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_16 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_17 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_0_18 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] +_0_10 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_11 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_12 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_13 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_14 [label = "14 Intermediate input: 2, rsm: S_1, input: [1, 1]", shape = plain] +_0_15 [label = "15 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_16 [label = "16 Range , input: [2, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_17 [label = "17 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_0_18 [label = "18 Terminal 'b', input: [2, 1]", shape = rectangle, color = "red"] +_0_3 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 2]", shape = plain] +_0_4 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_6 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_7 [label = "7 Range , input: [1, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_8 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_9 [label = "9 Terminal 'b', input: [1, 2]", shape = rectangle, color = "red"] _0_0->_0_1 -_0_1->_0_12 -_0_2->_0_13 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_8 -_0_7->_0_9 -_0_8->_0_10 -_0_12->_0_15 -_0_12->_0_16 -_0_13->_0_17 -_0_15->_0_2 +_0_1->_0_3 +_0_10->_0_4 +_0_10->_0_11 +_0_11->_0_12 +_0_12->_0_13 +_0_13->_0_14 +_0_14->_0_15 +_0_14->_0_16 +_0_15->_0_17 _0_16->_0_18 +_0_3->_0_6 +_0_3->_0_7 +_0_4->_0_8 +_0_6->_0_10 +_0_7->_0_9 } } diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg index 7f2f7daa5..3af57965c 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg @@ -31,180 +31,180 @@ - + -_0_12 +_0_3 3     Intermediate input: 1, rsm: S_2, input: [0, 2] - + -_0_1->_0_12 +_0_1->_0_3 - + -_0_2 +_0_10 10     Intermediate input: 1, rsm: S_1, input: [0, 1] - + -_0_3 +_0_11 11     Range , input: [1, 1], rsm: [S_1, S_2] - + -_0_2->_0_3 +_0_10->_0_11 - + -_0_13 +_0_4 4     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_2->_0_13 +_0_10->_0_4 - + -_0_4 +_0_12 12     Nonterminal S, input: [1, 1] - + -_0_3->_0_4 +_0_11->_0_12 - + -_0_5 +_0_13 13     Range , input: [1, 1], rsm: [S_0, S_3] - + -_0_4->_0_5 +_0_12->_0_13 - + -_0_6 +_0_14 14     Intermediate input: 2, rsm: S_1, input: [1, 1] - + -_0_5->_0_6 +_0_13->_0_14 - + -_0_7 +_0_15 15     Range , input: [1, 2], rsm: [S_0, S_1] - + -_0_6->_0_7 +_0_14->_0_15 - + -_0_8 +_0_16 16     Range , input: [2, 1], rsm: [S_1, S_3] - + -_0_6->_0_8 +_0_14->_0_16 - + -_0_9 +_0_17 17     Terminal 'a', input: [1, 2] - + -_0_7->_0_9 +_0_15->_0_17 - + -_0_10 +_0_18 18     Terminal 'b', input: [2, 1] - + -_0_8->_0_10 +_0_16->_0_18 - + -_0_15 +_0_6 6     Range , input: [0, 1], rsm: [S_0, S_2] - + -_0_12->_0_15 +_0_3->_0_6 - + -_0_16 +_0_7 7     Range , input: [1, 2], rsm: [S_2, S_3] - + -_0_12->_0_16 +_0_3->_0_7 - + -_0_17 +_0_8 8     Terminal 'a', input: [0, 1] - + -_0_13->_0_17 +_0_4->_0_8 - + -_0_15->_0_2 +_0_6->_0_10 - + -_0_18 +_0_9 9     Terminal 'b', input: [1, 2] - + -_0_16->_0_18 +_0_7->_0_9 diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot index b46686bdd..c6c61ee87 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot @@ -5,49 +5,49 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] -_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] -_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] -_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_10 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_11 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_12 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_13 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_14 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_15 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_16 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_17 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_18 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_19 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] +_0_2 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_20 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] +_0_3 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_4 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_5 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_6 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_7 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_8 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_9 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] _0_0->_0_1 -_0_1->_0_12 -_0_1->_0_14 -_0_2->_0_15 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_18 -_0_7->_0_8 -_0_8->_0_9 -_0_8->_0_10 -_0_9->_0_11 -_0_10->_0_13 -_0_12->_0_15 -_0_12->_0_16 -_0_13->_0_1 -_0_14->_0_17 -_0_14->_0_18 -_0_15->_0_19 -_0_16->_0_20 -_0_17->_0_2 +_0_1->_0_2 +_0_1->_0_3 +_0_10->_0_4 +_0_10->_0_11 +_0_11->_0_12 +_0_12->_0_13 +_0_13->_0_14 +_0_14->_0_15 +_0_14->_0_7 +_0_15->_0_16 +_0_16->_0_17 +_0_16->_0_18 +_0_17->_0_19 _0_18->_0_20 +_0_2->_0_4 +_0_2->_0_5 +_0_20->_0_1 +_0_3->_0_6 +_0_3->_0_7 +_0_4->_0_8 +_0_5->_0_9 +_0_6->_0_10 +_0_7->_0_9 } } diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg index 3888cb736..a33ff2d26 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg @@ -31,250 +31,250 @@ - + -_0_12 +_0_2 2     Intermediate input: 1, rsm: S_1, input: [0, 1] - + -_0_1->_0_12 +_0_1->_0_2 - + -_0_14 +_0_3 3     Intermediate input: 1, rsm: S_2, input: [0, 1] - + -_0_1->_0_14 +_0_1->_0_3 - + -_0_2 +_0_10 10     Intermediate input: 1, rsm: S_1, input: [0, 1] - + -_0_3 +_0_11 11     Range , input: [1, 1], rsm: [S_1, S_2] - + -_0_2->_0_3 +_0_10->_0_11 - + -_0_15 +_0_4 4     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_2->_0_15 +_0_10->_0_4 - + -_0_4 +_0_12 12     Nonterminal S, input: [1, 1] - + -_0_3->_0_4 +_0_11->_0_12 - + -_0_5 +_0_13 13     Range , input: [1, 1], rsm: [S_0, S_3] - + -_0_4->_0_5 +_0_12->_0_13 - + -_0_6 +_0_14 14     Intermediate input: 1, rsm: S_2, input: [1, 1] - + -_0_5->_0_6 +_0_13->_0_14 - + -_0_7 +_0_15 15     Range , input: [1, 1], rsm: [S_0, S_2] - + -_0_6->_0_7 +_0_14->_0_15 - + -_0_18 +_0_7 7     Range , input: [1, 1], rsm: [S_2, S_3] - + -_0_6->_0_18 +_0_14->_0_7 - + -_0_8 +_0_16 16     Intermediate input: 0, rsm: S_1, input: [1, 1] - + -_0_7->_0_8 +_0_15->_0_16 - + -_0_9 +_0_17 17     Range , input: [1, 0], rsm: [S_0, S_1] - + -_0_8->_0_9 +_0_16->_0_17 - + -_0_10 +_0_18 18     Range , input: [0, 1], rsm: [S_1, S_2] - + -_0_8->_0_10 +_0_16->_0_18 - + -_0_11 +_0_19 19     Terminal 'a', input: [1, 0] - + -_0_9->_0_11 +_0_17->_0_19 - + -_0_13 +_0_20 20     Nonterminal S, input: [0, 1] - + -_0_10->_0_13 +_0_18->_0_20 - + -_0_12->_0_15 +_0_2->_0_4 - + -_0_16 +_0_5 5     Range , input: [1, 1], rsm: [S_1, S_3] - + -_0_12->_0_16 +_0_2->_0_5 - + -_0_13->_0_1 +_0_20->_0_1 - + -_0_17 +_0_6 6     Range , input: [0, 1], rsm: [S_0, S_2] - + -_0_14->_0_17 +_0_3->_0_6 - + -_0_14->_0_18 +_0_3->_0_7 - + -_0_19 +_0_8 8     Terminal 'a', input: [0, 1] - + -_0_15->_0_19 +_0_4->_0_8 - + -_0_20 +_0_9 9     Terminal 'b', input: [1, 1] - + -_0_16->_0_20 +_0_5->_0_9 - + -_0_17->_0_2 +_0_6->_0_10 - + -_0_18->_0_20 +_0_7->_0_9 diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot index d0c7b277e..6ac22016f 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot @@ -5,17 +5,17 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_12 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_16 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_2 [label = "2 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_4 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_5 [label = "5 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] +_0_8 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_9 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] _0_0->_0_1 -_0_1->_0_12 -_0_12->_0_15 -_0_12->_0_16 -_0_15->_0_19 -_0_16->_0_20 +_0_1->_0_2 +_0_2->_0_4 +_0_2->_0_5 +_0_4->_0_8 +_0_5->_0_9 } } diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg index 697bdc5bc..60aee9aee 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg @@ -31,62 +31,62 @@ - + -_0_12 +_0_2 2     Intermediate input: 1, rsm: S_1, input: [0, 1] - + -_0_1->_0_12 +_0_1->_0_2 - + -_0_15 +_0_4 4     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_12->_0_15 +_0_2->_0_4 - + -_0_16 +_0_5 5     Range , input: [1, 1], rsm: [S_1, S_3] - + -_0_12->_0_16 +_0_2->_0_5 - + -_0_19 +_0_8 8     Terminal 'a', input: [0, 1] - + -_0_15->_0_19 +_0_4->_0_8 - + -_0_20 +_0_9 9     Terminal 'b', input: [1, 1] - + -_0_16->_0_20 +_0_5->_0_9 diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot index f4f27d5ab..2299b3d38 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot @@ -5,43 +5,43 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] -_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] -_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] -_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_10 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_11 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_12 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_13 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_14 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_15 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_16 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_17 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_18 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_19 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] +_0_20 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] +_0_3 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_4 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_6 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_7 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_8 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_9 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] _0_0->_0_1 -_0_1->_0_14 -_0_2->_0_15 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_18 -_0_7->_0_8 -_0_8->_0_9 -_0_8->_0_10 -_0_9->_0_11 -_0_10->_0_13 -_0_13->_0_1 -_0_14->_0_17 -_0_14->_0_18 -_0_15->_0_19 -_0_17->_0_2 +_0_1->_0_3 +_0_10->_0_4 +_0_10->_0_11 +_0_11->_0_12 +_0_12->_0_13 +_0_13->_0_14 +_0_14->_0_15 +_0_14->_0_7 +_0_15->_0_16 +_0_16->_0_17 +_0_16->_0_18 +_0_17->_0_19 _0_18->_0_20 +_0_20->_0_1 +_0_3->_0_6 +_0_3->_0_7 +_0_4->_0_8 +_0_6->_0_10 +_0_7->_0_9 } } \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg index 026041830..440fd4b45 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg @@ -31,215 +31,215 @@ - + -_0_14 +_0_3 3     Intermediate input: 1, rsm: S_2, input: [0, 1] - + -_0_1->_0_14 +_0_1->_0_3 - + -_0_2 +_0_10 10     Intermediate input: 1, rsm: S_1, input: [0, 1] - + -_0_3 +_0_11 11     Range , input: [1, 1], rsm: [S_1, S_2] - + -_0_2->_0_3 +_0_10->_0_11 - + -_0_15 +_0_4 4     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_2->_0_15 +_0_10->_0_4 - + -_0_4 +_0_12 12     Nonterminal S, input: [1, 1] - + -_0_3->_0_4 +_0_11->_0_12 - + -_0_5 +_0_13 13     Range , input: [1, 1], rsm: [S_0, S_3] - + -_0_4->_0_5 +_0_12->_0_13 - + -_0_6 +_0_14 14     Intermediate input: 1, rsm: S_2, input: [1, 1] - + -_0_5->_0_6 +_0_13->_0_14 - + -_0_7 +_0_15 15     Range , input: [1, 1], rsm: [S_0, S_2] - + -_0_6->_0_7 +_0_14->_0_15 - + -_0_18 +_0_7 7     Range , input: [1, 1], rsm: [S_2, S_3] - + -_0_6->_0_18 +_0_14->_0_7 - + -_0_8 +_0_16 16     Intermediate input: 0, rsm: S_1, input: [1, 1] - + -_0_7->_0_8 +_0_15->_0_16 - + -_0_9 +_0_17 17     Range , input: [1, 0], rsm: [S_0, S_1] - + -_0_8->_0_9 +_0_16->_0_17 - + -_0_10 +_0_18 18     Range , input: [0, 1], rsm: [S_1, S_2] - + -_0_8->_0_10 +_0_16->_0_18 - + -_0_11 +_0_19 19     Terminal 'a', input: [1, 0] - + -_0_9->_0_11 +_0_17->_0_19 - + -_0_13 +_0_20 20     Nonterminal S, input: [0, 1] - + -_0_10->_0_13 +_0_18->_0_20 - + -_0_13->_0_1 +_0_20->_0_1 - + -_0_17 +_0_6 6     Range , input: [0, 1], rsm: [S_0, S_2] - + -_0_14->_0_17 +_0_3->_0_6 - + -_0_14->_0_18 +_0_3->_0_7 - + -_0_19 +_0_8 8     Terminal 'a', input: [0, 1] - + -_0_15->_0_19 +_0_4->_0_8 - + -_0_17->_0_2 +_0_6->_0_10 - + -_0_20 +_0_9 9     Terminal 'b', input: [1, 1] - + -_0_18->_0_20 +_0_7->_0_9 diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot index 680551247..617b5c7a9 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot @@ -5,57 +5,57 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 1]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] -_0_3 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_4 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] -_0_5 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] -_0_6 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] -_0_7 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_8 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] -_0_9 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_10 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] -_0_11 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] -_0_13 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] -_0_14 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] -_0_15 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_17 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] -_0_18 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] +_0_10 [label = "10 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] +_0_11 [label = "11 Range , input: [1, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_12 [label = "12 Nonterminal S, input: [1, 1]", shape = invtrapezium, color = "green"] +_0_13 [label = "13 Range , input: [1, 1], rsm: [S_0, S_3]", shape = ellipse] +_0_14 [label = "14 Intermediate input: 1, rsm: S_2, input: [1, 1]", shape = plain] +_0_15 [label = "15 Range , input: [1, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_16 [label = "16 Intermediate input: 0, rsm: S_1, input: [1, 1]", shape = plain] +_0_17 [label = "17 Range , input: [1, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_18 [label = "18 Range , input: [0, 1], rsm: [S_1, S_2]", shape = ellipse] +_0_19 [label = "19 Terminal 'a', input: [1, 0]", shape = rectangle, color = "red"] +_0_20 [label = "20 Nonterminal S, input: [0, 1]", shape = invtrapezium, color = "green"] +_0_3 [label = "3 Intermediate input: 1, rsm: S_2, input: [0, 1]", shape = plain] +_0_4 [label = "4 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_6 [label = "6 Range , input: [0, 1], rsm: [S_0, S_2]", shape = ellipse] +_0_7 [label = "7 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] _0_27 [label = "27 Range , input: [1, 1], rsm: [S_2, S_3]", shape = ellipse] _0_28 [label = "28 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] -_0_19 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_0_20 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] +_0_8 [label = "8 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_9 [label = "9 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] _0_21 [label = "21 Range , input: [0, 1], rsm: [S_0, S_3]", shape = ellipse] _0_22 [label = "22 Intermediate input: 1, rsm: S_1, input: [0, 1]", shape = plain] _0_23 [label = "23 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] _0_24 [label = "24 Range , input: [1, 1], rsm: [S_1, S_3]", shape = ellipse] _0_25 [label = "25 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _0_26 [label = "26 Terminal 'b', input: [1, 1]", shape = rectangle, color = "red"] -_0_13->_0_21 +_0_20->_0_21 _0_21->_0_22 _0_22->_0_23 _0_22->_0_24 _0_23->_0_25 _0_24->_0_26 _0_0->_0_1 -_0_1->_0_14 -_0_2->_0_15 -_0_2->_0_3 -_0_3->_0_4 -_0_4->_0_5 -_0_5->_0_6 -_0_6->_0_7 -_0_6->_0_18 -_0_7->_0_8 -_0_8->_0_9 -_0_8->_0_10 -_0_9->_0_11 -_0_10->_0_13 -_0_14->_0_17 -_0_14->_0_27 -_0_27->_0_28 -_0_15->_0_19 -_0_17->_0_2 +_0_1->_0_3 +_0_10->_0_4 +_0_10->_0_11 +_0_11->_0_12 +_0_12->_0_13 +_0_13->_0_14 +_0_14->_0_15 +_0_14->_0_7 +_0_15->_0_16 +_0_16->_0_17 +_0_16->_0_18 +_0_17->_0_19 _0_18->_0_20 +_0_3->_0_6 +_0_3->_0_27 +_0_27->_0_28 +_0_4->_0_8 +_0_6->_0_10 +_0_7->_0_9 } } diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg index b4d19ed65..6a469f336 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg @@ -31,161 +31,161 @@ - + -_0_14 +_0_3 3     Intermediate input: 1, rsm: S_2, input: [0, 1] - + -_0_1->_0_14 +_0_1->_0_3 - + -_0_2 +_0_10 10     Intermediate input: 1, rsm: S_1, input: [0, 1] - + -_0_3 +_0_11 11     Range , input: [1, 1], rsm: [S_1, S_2] - + -_0_2->_0_3 +_0_10->_0_11 - + -_0_15 +_0_4 4     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_2->_0_15 +_0_10->_0_4 - + -_0_4 +_0_12 12     Nonterminal S, input: [1, 1] - + -_0_3->_0_4 +_0_11->_0_12 - + -_0_5 +_0_13 13     Range , input: [1, 1], rsm: [S_0, S_3] - + -_0_4->_0_5 +_0_12->_0_13 - + -_0_6 +_0_14 14     Intermediate input: 1, rsm: S_2, input: [1, 1] - + -_0_5->_0_6 +_0_13->_0_14 - + -_0_7 +_0_15 15     Range , input: [1, 1], rsm: [S_0, S_2] - + -_0_6->_0_7 +_0_14->_0_15 - + -_0_18 +_0_7 7     Range , input: [1, 1], rsm: [S_2, S_3] - + -_0_6->_0_18 +_0_14->_0_7 - + -_0_8 +_0_16 16     Intermediate input: 0, rsm: S_1, input: [1, 1] - + -_0_7->_0_8 +_0_15->_0_16 - + -_0_9 +_0_17 17     Range , input: [1, 0], rsm: [S_0, S_1] - + -_0_8->_0_9 +_0_16->_0_17 - + -_0_10 +_0_18 18     Range , input: [0, 1], rsm: [S_1, S_2] - + -_0_8->_0_10 +_0_16->_0_18 - + -_0_11 +_0_19 19     Terminal 'a', input: [1, 0] - + -_0_9->_0_11 +_0_17->_0_19 - + -_0_13 +_0_20 20     Nonterminal S, input: [0, 1] - + -_0_10->_0_13 +_0_18->_0_20 @@ -195,21 +195,21 @@ 21     Range , input: [0, 1], rsm: [S_0, S_3] - + -_0_13->_0_21 +_0_20->_0_21 - + -_0_17 +_0_6 6     Range , input: [0, 1], rsm: [S_0, S_2] - + -_0_14->_0_17 +_0_3->_0_6 @@ -219,39 +219,39 @@ 27     Range , input: [1, 1], rsm: [S_2, S_3] - + -_0_14->_0_27 +_0_3->_0_27 - + -_0_19 +_0_8 8     Terminal 'a', input: [0, 1] - + -_0_15->_0_19 +_0_4->_0_8 - + -_0_17->_0_2 +_0_6->_0_10 - + -_0_20 +_0_9 9     Terminal 'b', input: [1, 1] - + -_0_18->_0_20 +_0_7->_0_9 diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot index db8faf703..94481c962 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot @@ -5,666 +5,666 @@ subgraph cluster_0{ labelloc="t" _0_0 [label = "0 Nonterminal S, input: [0, 2]", shape = invtrapezium] _0_1 [label = "1 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_2 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] -_0_3 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_4 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_0_5 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_0_6 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_0_7 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_0_8 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_9 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_0_10 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] -_0_11 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] -_0_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_0_13 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_0_14 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_15 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] -_0_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_17 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_0_18 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_19 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_0_20 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_0_21 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_22 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] -_0_23 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_24 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] -_0_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_26 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_0_27 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_28 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_0_29 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_30 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] -_0_31 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_0_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_0_33 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_0_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_0_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_0_36 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_37 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] -_0_38 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_0_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_0_40 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_0_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_0_42 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_0_43 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] -_0_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_0_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] -_0_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_0_47 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_0_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_0_10 [label = "10 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] +_0_11 [label = "11 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_12 [label = "12 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_13 [label = "13 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_0_14 [label = "14 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_0_15 [label = "15 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_0_16 [label = "16 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_17 [label = "17 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_0_18 [label = "18 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_0_19 [label = "19 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] +_0_2 [label = "2 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_0_20 [label = "20 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_0_21 [label = "21 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_22 [label = "22 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] +_0_23 [label = "23 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_24 [label = "24 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_0_25 [label = "25 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_26 [label = "26 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_0_27 [label = "27 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_0_28 [label = "28 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_29 [label = "29 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_0_3 [label = "3 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_30 [label = "30 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] +_0_31 [label = "31 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_32 [label = "32 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_0_33 [label = "33 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_34 [label = "34 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_0_35 [label = "35 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_36 [label = "36 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] +_0_37 [label = "37 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_0_38 [label = "38 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_0_39 [label = "39 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_0_4 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_0_40 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_0_41 [label = "41 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_42 [label = "42 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] +_0_43 [label = "43 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_0_44 [label = "44 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_0_45 [label = "45 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_0_46 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_0_47 [label = "47 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_0_48 [label = "48 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] +_0_5 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_0_6 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] +_0_7 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_0_8 [label = "8 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_0_9 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _0_0->_0_1 -_0_1->_0_12 +_0_1->_0_2 +_0_10->_0_11 +_0_11->_0_12 +_0_11->_0_13 +_0_12->_0_14 +_0_12->_0_15 +_0_13->_0_16 +_0_13->_0_17 +_0_14->_0_18 +_0_15->_0_19 +_0_16->_0_20 +_0_17->_0_19 _0_2->_0_3 -_0_3->_0_4 -_0_3->_0_5 -_0_4->_0_6 -_0_4->_0_7 -_0_5->_0_8 -_0_5->_0_9 -_0_6->_0_10 -_0_7->_0_11 -_0_8->_0_13 -_0_9->_0_11 -_0_12->_0_23 -_0_12->_0_34 -_0_13->_0_6 -_0_13->_0_14 -_0_14->_0_15 -_0_15->_0_16 -_0_16->_0_17 -_0_17->_0_18 -_0_17->_0_34 -_0_18->_0_19 -_0_19->_0_20 -_0_19->_0_21 -_0_20->_0_22 -_0_21->_0_24 -_0_23->_0_44 +_0_2->_0_4 +_0_20->_0_14 +_0_20->_0_21 +_0_21->_0_22 +_0_22->_0_23 +_0_23->_0_24 _0_24->_0_25 +_0_24->_0_4 _0_25->_0_26 _0_26->_0_27 -_0_26->_0_9 -_0_27->_0_28 -_0_28->_0_46 -_0_28->_0_29 -_0_29->_0_30 +_0_26->_0_28 +_0_27->_0_29 +_0_28->_0_30 +_0_3->_0_5 _0_30->_0_31 _0_31->_0_32 _0_32->_0_33 -_0_32->_0_34 -_0_33->_0_35 -_0_34->_0_45 -_0_35->_0_6 +_0_32->_0_17 +_0_33->_0_34 +_0_34->_0_7 +_0_34->_0_35 _0_35->_0_36 _0_36->_0_37 _0_37->_0_38 _0_38->_0_39 +_0_38->_0_4 _0_39->_0_40 -_0_39->_0_9 +_0_4->_0_6 +_0_40->_0_14 _0_40->_0_41 -_0_41->_0_20 _0_41->_0_42 _0_42->_0_43 -_0_43->_0_1 -_0_44->_0_46 -_0_44->_0_47 -_0_46->_0_48 -_0_47->_0_2 +_0_43->_0_44 +_0_44->_0_45 +_0_44->_0_17 +_0_45->_0_46 +_0_46->_0_27 +_0_46->_0_47 +_0_47->_0_48 +_0_48->_0_1 +_0_5->_0_7 +_0_5->_0_8 +_0_7->_0_9 +_0_8->_0_10 } subgraph cluster_1{ labelloc="t" _1_0 [label = "0 Nonterminal S, input: [0, 3]", shape = invtrapezium] _1_1 [label = "1 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_2 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] -_1_3 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_1_5 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_1_7 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_1_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] -_1_9 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_1_10 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_11 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] -_1_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_1_13 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] -_1_14 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_15 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_1_16 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_17 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_1_18 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_1_19 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_20 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] -_1_21 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] -_1_22 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_23 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_24 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_1_25 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_26 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_1_27 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_28 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] -_1_29 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_1_30 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_1_31 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_1_32 [label = "38 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_1_33 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_1_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_1_35 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_1_36 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_37 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] -_1_38 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_1_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_1_40 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_1_41 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_1_42 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_1_43 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] -_1_44 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_1_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] -_1_46 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_1_47 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_1_48 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_1_10 [label = "10 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] +_1_11 [label = "11 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_12 [label = "12 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_1_13 [label = "13 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_14 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_1_15 [label = "15 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_16 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] +_1_17 [label = "17 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_1_18 [label = "18 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_19 [label = "19 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_1_2 [label = "2 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_1_20 [label = "20 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] +_1_21 [label = "21 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_22 [label = "22 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_1_23 [label = "23 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_24 [label = "24 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_1_25 [label = "25 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_1_26 [label = "26 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_27 [label = "27 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_1_28 [label = "28 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] +_1_29 [label = "29 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_3 [label = "3 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_30 [label = "30 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_1_31 [label = "31 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_32 [label = "32 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_1_33 [label = "33 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_34 [label = "34 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] +_1_35 [label = "35 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_1_36 [label = "36 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_1_37 [label = "37 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_1_38 [label = "38 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_1_39 [label = "39 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_1_4 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_1_40 [label = "40 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_1_41 [label = "41 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_42 [label = "42 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] +_1_43 [label = "43 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_1_44 [label = "44 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_1_45 [label = "45 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_1_46 [label = "46 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_1_47 [label = "47 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_1_48 [label = "48 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] +_1_5 [label = "5 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_1_6 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] +_1_7 [label = "7 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_1_8 [label = "8 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_1_9 [label = "9 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] _1_0->_1_1 -_1_1->_1_12 -_1_2->_1_3 -_1_3->_1_4 -_1_4->_1_5 -_1_4->_1_6 -_1_5->_1_7 -_1_6->_1_8 -_1_7->_1_9 -_1_7->_1_10 -_1_9->_1_11 -_1_10->_1_13 -_1_12->_1_23 -_1_12->_1_34 -_1_13->_1_14 -_1_14->_1_15 -_1_15->_1_16 -_1_15->_1_34 -_1_16->_1_17 -_1_17->_1_18 +_1_1->_1_2 +_1_10->_1_11 +_1_11->_1_12 +_1_12->_1_13 +_1_12->_1_14 +_1_13->_1_15 +_1_14->_1_16 +_1_15->_1_17 +_1_15->_1_18 _1_17->_1_19 _1_18->_1_20 -_1_19->_1_21 +_1_2->_1_3 +_1_2->_1_4 +_1_20->_1_21 _1_21->_1_22 -_1_22->_1_24 -_1_23->_1_44 +_1_22->_1_23 +_1_22->_1_4 +_1_23->_1_24 _1_24->_1_25 -_1_24->_1_6 -_1_25->_1_26 -_1_26->_1_46 -_1_26->_1_27 -_1_27->_1_28 +_1_24->_1_26 +_1_25->_1_27 +_1_26->_1_28 _1_28->_1_29 _1_29->_1_30 -_1_29->_1_31 -_1_30->_1_9 -_1_30->_1_32 -_1_31->_1_33 -_1_31->_1_34 -_1_32->_1_45 -_1_33->_1_35 -_1_34->_1_45 -_1_35->_1_9 +_1_3->_1_5 +_1_30->_1_31 +_1_30->_1_14 +_1_31->_1_32 +_1_32->_1_7 +_1_32->_1_33 +_1_33->_1_34 +_1_34->_1_35 _1_35->_1_36 -_1_36->_1_37 -_1_37->_1_38 -_1_38->_1_39 +_1_35->_1_37 +_1_36->_1_17 +_1_36->_1_38 +_1_37->_1_39 +_1_37->_1_4 +_1_38->_1_6 _1_39->_1_40 -_1_39->_1_6 +_1_4->_1_6 +_1_40->_1_17 _1_40->_1_41 -_1_41->_1_18 _1_41->_1_42 _1_42->_1_43 -_1_43->_1_1 -_1_44->_1_46 -_1_44->_1_47 -_1_46->_1_48 -_1_47->_1_2 +_1_43->_1_44 +_1_44->_1_45 +_1_44->_1_14 +_1_45->_1_46 +_1_46->_1_25 +_1_46->_1_47 +_1_47->_1_48 +_1_48->_1_1 +_1_5->_1_7 +_1_5->_1_8 +_1_7->_1_9 +_1_8->_1_10 } subgraph cluster_2{ labelloc="t" _2_0 [label = "0 Nonterminal S, input: [1, 2]", shape = invtrapezium] _2_1 [label = "1 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_2 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] -_2_3 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_2_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_2_7 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_2_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] -_2_9 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_2_10 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_11 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] -_2_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_2_13 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] -_2_14 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_2_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_17 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_2_18 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_2_19 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_20 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_2_21 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] -_2_22 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_23 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_24 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_2_25 [label = "31 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_2_26 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_2_27 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_2_29 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_30 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] -_2_31 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_2_32 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_2_33 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_2_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_2_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_2_36 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_37 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] -_2_38 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_2_39 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_2_40 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_2_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_2_42 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_2_43 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] -_2_44 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_2_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] -_2_46 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_2_47 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_2_48 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_2_10 [label = "10 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] +_2_11 [label = "11 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_12 [label = "12 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_2_13 [label = "13 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_14 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_2_15 [label = "15 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_2_16 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] +_2_17 [label = "17 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_2_18 [label = "18 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_19 [label = "19 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_2_2 [label = "2 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_2_20 [label = "20 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] +_2_21 [label = "21 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_22 [label = "22 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_2_23 [label = "23 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_24 [label = "24 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_2_25 [label = "25 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_2_26 [label = "26 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_27 [label = "27 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_2_28 [label = "28 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] +_2_29 [label = "29 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_3 [label = "3 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_30 [label = "30 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_31 [label = "31 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_2_32 [label = "32 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_2_33 [label = "33 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_34 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_2_35 [label = "35 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_36 [label = "36 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] +_2_37 [label = "37 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_2_38 [label = "38 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_2_39 [label = "39 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_2_4 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_2_40 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_2_41 [label = "41 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_42 [label = "42 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] +_2_43 [label = "43 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_2_44 [label = "44 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_2_45 [label = "45 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_2_46 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_2_47 [label = "47 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_2_48 [label = "48 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] +_2_5 [label = "5 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_2_6 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] +_2_7 [label = "7 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_2_8 [label = "8 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_2_9 [label = "9 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] _2_0->_2_1 -_2_1->_2_12 -_2_2->_2_3 -_2_3->_2_4 -_2_4->_2_5 -_2_4->_2_6 -_2_5->_2_7 -_2_6->_2_8 -_2_7->_2_9 -_2_7->_2_10 -_2_9->_2_11 -_2_10->_2_13 -_2_12->_2_23 -_2_12->_2_34 -_2_13->_2_14 -_2_14->_2_15 -_2_15->_2_16 -_2_15->_2_34 -_2_16->_2_17 -_2_17->_2_18 +_2_1->_2_2 +_2_10->_2_11 +_2_11->_2_12 +_2_12->_2_13 +_2_12->_2_14 +_2_13->_2_15 +_2_14->_2_16 +_2_15->_2_17 +_2_15->_2_18 _2_17->_2_19 _2_18->_2_20 -_2_19->_2_21 +_2_2->_2_3 +_2_2->_2_4 +_2_20->_2_21 _2_21->_2_22 -_2_22->_2_24 -_2_22->_2_25 -_2_23->_2_44 -_2_24->_2_46 +_2_22->_2_23 +_2_22->_2_4 +_2_23->_2_24 +_2_24->_2_25 _2_24->_2_26 _2_25->_2_27 -_2_25->_2_6 -_2_26->_2_8 -_2_27->_2_28 -_2_28->_2_46 +_2_26->_2_28 _2_28->_2_29 _2_29->_2_30 -_2_30->_2_31 -_2_31->_2_32 -_2_32->_2_33 -_2_32->_2_34 -_2_33->_2_35 -_2_34->_2_45 -_2_35->_2_9 +_2_29->_2_31 +_2_3->_2_5 +_2_30->_2_7 +_2_30->_2_32 +_2_31->_2_33 +_2_31->_2_14 +_2_32->_2_16 +_2_33->_2_34 +_2_34->_2_7 +_2_34->_2_35 _2_35->_2_36 _2_36->_2_37 _2_37->_2_38 _2_38->_2_39 +_2_38->_2_4 _2_39->_2_40 -_2_39->_2_6 +_2_4->_2_6 +_2_40->_2_17 _2_40->_2_41 -_2_41->_2_18 _2_41->_2_42 _2_42->_2_43 -_2_43->_2_1 -_2_44->_2_46 -_2_44->_2_47 -_2_46->_2_48 -_2_47->_2_2 +_2_43->_2_44 +_2_44->_2_45 +_2_44->_2_14 +_2_45->_2_46 +_2_46->_2_25 +_2_46->_2_47 +_2_47->_2_48 +_2_48->_2_1 +_2_5->_2_7 +_2_5->_2_8 +_2_7->_2_9 +_2_8->_2_10 } subgraph cluster_3{ labelloc="t" _3_0 [label = "0 Nonterminal S, input: [1, 3]", shape = invtrapezium] _3_1 [label = "1 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_2 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_3_3 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_4 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] -_3_5 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_6 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_3_7 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_8 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_3_9 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_3_10 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] -_3_11 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_3_12 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_3_13 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_14 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] -_3_15 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] -_3_16 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_17 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_3_18 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_19 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_3_20 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_3_21 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_22 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_3_23 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_3_24 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] -_3_25 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_3_27 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_28 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_3_29 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_30 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] -_3_31 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_3_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_3_33 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_34 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_3_35 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_3_36 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_3_37 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] -_3_38 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_3_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_3_40 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_3_41 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_3_42 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_3_43 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] -_3_44 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_3_45 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_3_46 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_3_47 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] -_3_48 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] +_3_10 [label = "10 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_3_11 [label = "11 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_12 [label = "12 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] +_3_13 [label = "13 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_14 [label = "14 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_3_15 [label = "15 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_16 [label = "16 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_3_17 [label = "17 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_3_18 [label = "18 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] +_3_19 [label = "19 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_3_2 [label = "2 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_20 [label = "20 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_21 [label = "21 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_3_22 [label = "22 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] +_3_23 [label = "23 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_24 [label = "24 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_3_25 [label = "25 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_26 [label = "26 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_3_27 [label = "27 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_3_28 [label = "28 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_29 [label = "29 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_3_3 [label = "3 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_3_30 [label = "30 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] +_3_31 [label = "31 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_32 [label = "32 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_3_33 [label = "33 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_34 [label = "34 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_3_35 [label = "35 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_36 [label = "36 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] +_3_37 [label = "37 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_3_38 [label = "38 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_3_39 [label = "39 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_4 [label = "4 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_3_40 [label = "40 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_3_41 [label = "41 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_3_42 [label = "42 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] +_3_43 [label = "43 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_3_44 [label = "44 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_3_45 [label = "45 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_3_46 [label = "46 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_3_47 [label = "47 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_3_48 [label = "48 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] +_3_5 [label = "5 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_3_6 [label = "6 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_3_7 [label = "7 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_3_8 [label = "8 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_3_9 [label = "9 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] _3_0->_3_1 -_3_1->_3_12 -_3_1->_3_23 -_3_2->_3_34 -_3_2->_3_3 -_3_3->_3_4 -_3_4->_3_5 -_3_5->_3_6 -_3_6->_3_7 -_3_6->_3_8 -_3_7->_3_9 -_3_8->_3_10 -_3_9->_3_11 -_3_9->_3_13 -_3_11->_3_14 -_3_12->_3_34 -_3_12->_3_44 -_3_13->_3_15 -_3_15->_3_16 -_3_16->_3_17 -_3_17->_3_18 -_3_17->_3_46 -_3_18->_3_19 -_3_19->_3_20 +_3_1->_3_2 +_3_1->_3_3 +_3_10->_3_4 +_3_10->_3_11 +_3_11->_3_12 +_3_12->_3_13 +_3_13->_3_14 +_3_14->_3_15 +_3_14->_3_16 +_3_15->_3_17 +_3_16->_3_18 +_3_17->_3_19 +_3_17->_3_20 _3_19->_3_21 +_3_2->_3_4 +_3_2->_3_5 _3_20->_3_22 -_3_21->_3_24 -_3_23->_3_45 -_3_23->_3_46 +_3_22->_3_23 +_3_23->_3_24 _3_24->_3_25 +_3_24->_3_7 _3_25->_3_26 _3_26->_3_27 -_3_26->_3_8 -_3_27->_3_28 -_3_28->_3_34 -_3_28->_3_29 -_3_29->_3_30 +_3_26->_3_28 +_3_27->_3_29 +_3_28->_3_30 +_3_3->_3_6 +_3_3->_3_7 _3_30->_3_31 _3_31->_3_32 _3_32->_3_33 -_3_32->_3_46 -_3_33->_3_35 -_3_34->_3_47 -_3_35->_3_11 +_3_32->_3_16 +_3_33->_3_34 +_3_34->_3_4 +_3_34->_3_35 _3_35->_3_36 _3_36->_3_37 _3_37->_3_38 _3_38->_3_39 +_3_38->_3_7 _3_39->_3_40 -_3_39->_3_8 +_3_4->_3_8 +_3_40->_3_19 _3_40->_3_41 -_3_41->_3_20 _3_41->_3_42 _3_42->_3_43 -_3_43->_3_1 -_3_44->_3_48 -_3_45->_3_2 -_3_46->_3_48 +_3_43->_3_44 +_3_44->_3_45 +_3_44->_3_16 +_3_45->_3_46 +_3_46->_3_27 +_3_46->_3_47 +_3_47->_3_48 +_3_48->_3_1 +_3_5->_3_9 +_3_6->_3_10 +_3_7->_3_9 } subgraph cluster_4{ labelloc="t" _4_0 [label = "0 Nonterminal S, input: [2, 2]", shape = invtrapezium] _4_1 [label = "1 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_2 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] -_4_3 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_4 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_4_5 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_6 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_4_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_4_8 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] -_4_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_4_10 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_4_12 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_4_13 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] -_4_14 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_15 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_4_16 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_17 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_4_18 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_4_19 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] -_4_21 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] -_4_22 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_23 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_24 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_4_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_26 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_4_27 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_28 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] -_4_29 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_4_30 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_4_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_4_32 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_4_33 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_34 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_4_35 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] -_4_36 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_4_37 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_4_38 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_4_39 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_4_40 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_4_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_4_42 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_4_43 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] -_4_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_4_45 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] -_4_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_4_47 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_4_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_4_10 [label = "10 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] +_4_11 [label = "11 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_12 [label = "12 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_4_13 [label = "13 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_14 [label = "14 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_4_15 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_4_16 [label = "16 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] +_4_17 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_4_18 [label = "18 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_19 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_4_2 [label = "2 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_4_20 [label = "20 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] +_4_21 [label = "21 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_22 [label = "22 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_4_23 [label = "23 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_24 [label = "24 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_25 [label = "25 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_4_26 [label = "26 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_27 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_4_28 [label = "28 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] +_4_29 [label = "29 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_3 [label = "3 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_30 [label = "30 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_4_31 [label = "31 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_32 [label = "32 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_4_33 [label = "33 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_34 [label = "34 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] +_4_35 [label = "35 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_4_36 [label = "36 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_4_37 [label = "37 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_4_38 [label = "38 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_4_39 [label = "39 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_4 [label = "4 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_4_40 [label = "40 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] +_4_41 [label = "41 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_4_42 [label = "42 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_4_43 [label = "43 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_4_44 [label = "44 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_4_45 [label = "45 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_4_46 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_4_47 [label = "47 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_4_48 [label = "48 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] +_4_5 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_4_6 [label = "6 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] +_4_7 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_4_8 [label = "8 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_4_9 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] _4_0->_4_1 -_4_1->_4_12 -_4_2->_4_3 -_4_3->_4_4 -_4_4->_4_5 -_4_4->_4_6 -_4_5->_4_7 -_4_6->_4_8 -_4_7->_4_9 -_4_7->_4_10 -_4_9->_4_11 -_4_10->_4_13 -_4_12->_4_23 -_4_12->_4_34 -_4_13->_4_14 -_4_14->_4_15 -_4_15->_4_16 -_4_15->_4_34 -_4_16->_4_17 -_4_17->_4_18 +_4_1->_4_2 +_4_10->_4_11 +_4_11->_4_12 +_4_12->_4_13 +_4_12->_4_14 +_4_13->_4_15 +_4_14->_4_16 +_4_15->_4_17 +_4_15->_4_18 _4_17->_4_19 _4_18->_4_20 -_4_19->_4_21 +_4_2->_4_3 +_4_2->_4_4 +_4_20->_4_21 _4_21->_4_22 -_4_22->_4_24 -_4_23->_4_44 +_4_22->_4_23 +_4_22->_4_4 +_4_23->_4_24 _4_24->_4_25 -_4_24->_4_6 -_4_25->_4_26 -_4_26->_4_46 -_4_26->_4_27 -_4_27->_4_28 +_4_24->_4_26 +_4_25->_4_27 +_4_26->_4_28 _4_28->_4_29 _4_29->_4_30 +_4_3->_4_5 _4_30->_4_31 -_4_30->_4_34 +_4_30->_4_14 _4_31->_4_32 -_4_32->_4_9 +_4_32->_4_7 _4_32->_4_33 -_4_33->_4_35 -_4_34->_4_45 +_4_33->_4_34 +_4_34->_4_35 _4_35->_4_36 _4_36->_4_37 -_4_36->_4_38 -_4_37->_4_18 -_4_37->_4_39 -_4_38->_4_40 -_4_38->_4_6 -_4_39->_4_8 +_4_36->_4_4 +_4_37->_4_38 +_4_38->_4_17 +_4_38->_4_39 +_4_39->_4_40 +_4_4->_4_6 _4_40->_4_41 -_4_41->_4_18 _4_41->_4_42 -_4_42->_4_43 -_4_43->_4_1 -_4_44->_4_46 -_4_44->_4_47 -_4_46->_4_48 -_4_47->_4_2 +_4_41->_4_43 +_4_42->_4_25 +_4_42->_4_44 +_4_43->_4_45 +_4_43->_4_14 +_4_44->_4_16 +_4_45->_4_46 +_4_46->_4_25 +_4_46->_4_47 +_4_47->_4_48 +_4_48->_4_1 +_4_5->_4_7 +_4_5->_4_8 +_4_7->_4_9 +_4_8->_4_10 } subgraph cluster_5{ labelloc="t" _5_0 [label = "0 Nonterminal S, input: [2, 3]", shape = invtrapezium] _5_1 [label = "1 Range , input: [2, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_2 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] -_5_3 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_4 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] -_5_5 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_6 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] -_5_7 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] -_5_8 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] -_5_9 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] -_5_10 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_11 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] -_5_12 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] -_5_13 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] -_5_14 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_15 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_5_16 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] -_5_17 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] -_5_18 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] -_5_19 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_20 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] -_5_21 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] -_5_22 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_23 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_24 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] -_5_25 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_26 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] -_5_27 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_28 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] -_5_29 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_30 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] -_5_31 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] -_5_32 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] -_5_33 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] -_5_34 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] -_5_35 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] -_5_36 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_37 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] -_5_38 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] -_5_39 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] -_5_40 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] -_5_41 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] -_5_42 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] -_5_43 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] -_5_44 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] -_5_45 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] -_5_46 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] -_5_47 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] -_5_48 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] +_5_10 [label = "10 Nonterminal S, input: [0, 2]", shape = invtrapezium, color = "green"] +_5_11 [label = "11 Range , input: [0, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_12 [label = "12 Intermediate input: 3, rsm: S_2, input: [0, 2]", shape = plain] +_5_13 [label = "13 Range , input: [0, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_14 [label = "14 Range , input: [3, 2], rsm: [S_2, S_3]", shape = ellipse] +_5_15 [label = "15 Intermediate input: 1, rsm: S_1, input: [0, 3]", shape = plain] +_5_16 [label = "16 Terminal 'b', input: [3, 2]", shape = rectangle, color = "red"] +_5_17 [label = "17 Range , input: [0, 1], rsm: [S_0, S_1]", shape = ellipse] +_5_18 [label = "18 Range , input: [1, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_19 [label = "19 Terminal 'a', input: [0, 1]", shape = rectangle, color = "red"] +_5_2 [label = "2 Intermediate input: 2, rsm: S_2, input: [2, 3]", shape = plain] +_5_20 [label = "20 Nonterminal S, input: [1, 3]", shape = invtrapezium, color = "green"] +_5_21 [label = "21 Range , input: [1, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_22 [label = "22 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_23 [label = "23 Intermediate input: 2, rsm: S_2, input: [1, 3]", shape = plain] +_5_24 [label = "24 Range , input: [1, 2], rsm: [S_0, S_1]", shape = ellipse] +_5_25 [label = "25 Range , input: [2, 3], rsm: [S_1, S_3]", shape = ellipse] +_5_26 [label = "26 Range , input: [1, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_27 [label = "27 Terminal 'a', input: [1, 2]", shape = rectangle, color = "red"] +_5_28 [label = "28 Intermediate input: 2, rsm: S_1, input: [1, 2]", shape = plain] +_5_29 [label = "29 Range , input: [2, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_3 [label = "3 Range , input: [2, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_30 [label = "30 Nonterminal S, input: [2, 2]", shape = invtrapezium, color = "green"] +_5_31 [label = "31 Range , input: [2, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_32 [label = "32 Intermediate input: 3, rsm: S_2, input: [2, 2]", shape = plain] +_5_33 [label = "33 Range , input: [2, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_34 [label = "34 Intermediate input: 0, rsm: S_1, input: [2, 3]", shape = plain] +_5_35 [label = "35 Range , input: [0, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_36 [label = "36 Nonterminal S, input: [0, 3]", shape = invtrapezium, color = "green"] +_5_37 [label = "37 Range , input: [0, 3], rsm: [S_0, S_3]", shape = ellipse] +_5_38 [label = "38 Intermediate input: 2, rsm: S_2, input: [0, 3]", shape = plain] +_5_39 [label = "39 Range , input: [0, 2], rsm: [S_0, S_2]", shape = ellipse] +_5_4 [label = "4 Range , input: [2, 3], rsm: [S_2, S_3]", shape = ellipse] +_5_40 [label = "40 Intermediate input: 1, rsm: S_1, input: [0, 2]", shape = plain] +_5_41 [label = "41 Range , input: [1, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_42 [label = "42 Nonterminal S, input: [1, 2]", shape = invtrapezium, color = "green"] +_5_43 [label = "43 Range , input: [1, 2], rsm: [S_0, S_3]", shape = ellipse] +_5_44 [label = "44 Intermediate input: 3, rsm: S_2, input: [1, 2]", shape = plain] +_5_45 [label = "45 Range , input: [1, 3], rsm: [S_0, S_2]", shape = ellipse] +_5_46 [label = "46 Intermediate input: 2, rsm: S_1, input: [1, 3]", shape = plain] +_5_47 [label = "47 Range , input: [2, 3], rsm: [S_1, S_2]", shape = ellipse] +_5_48 [label = "48 Nonterminal S, input: [2, 3]", shape = invtrapezium, color = "green"] +_5_5 [label = "5 Intermediate input: 0, rsm: S_1, input: [2, 2]", shape = plain] +_5_6 [label = "6 Terminal 'b', input: [2, 3]", shape = rectangle, color = "red"] +_5_7 [label = "7 Range , input: [2, 0], rsm: [S_0, S_1]", shape = ellipse] +_5_8 [label = "8 Range , input: [0, 2], rsm: [S_1, S_2]", shape = ellipse] +_5_9 [label = "9 Terminal 'a', input: [2, 0]", shape = rectangle, color = "red"] _5_0->_5_1 -_5_1->_5_12 -_5_2->_5_3 -_5_3->_5_4 -_5_4->_5_5 -_5_4->_5_6 -_5_5->_5_7 -_5_6->_5_8 -_5_7->_5_9 -_5_7->_5_10 -_5_9->_5_11 -_5_10->_5_13 -_5_12->_5_23 -_5_12->_5_34 -_5_13->_5_14 -_5_14->_5_15 +_5_1->_5_2 +_5_10->_5_11 +_5_11->_5_12 +_5_12->_5_13 +_5_12->_5_14 +_5_13->_5_15 _5_14->_5_16 _5_15->_5_17 _5_15->_5_18 -_5_16->_5_19 -_5_16->_5_34 -_5_17->_5_20 -_5_18->_5_45 -_5_19->_5_21 -_5_21->_5_17 +_5_17->_5_19 +_5_18->_5_20 +_5_2->_5_3 +_5_2->_5_4 +_5_20->_5_21 _5_21->_5_22 +_5_21->_5_23 _5_22->_5_24 -_5_23->_5_44 -_5_24->_5_25 -_5_25->_5_26 -_5_26->_5_27 -_5_26->_5_6 -_5_27->_5_28 -_5_28->_5_46 +_5_22->_5_25 +_5_23->_5_26 +_5_23->_5_4 +_5_24->_5_27 +_5_25->_5_6 +_5_26->_5_28 +_5_28->_5_24 _5_28->_5_29 _5_29->_5_30 +_5_3->_5_5 _5_30->_5_31 _5_31->_5_32 _5_32->_5_33 -_5_32->_5_34 -_5_33->_5_35 -_5_34->_5_45 -_5_35->_5_9 +_5_32->_5_14 +_5_33->_5_34 +_5_34->_5_7 +_5_34->_5_35 _5_35->_5_36 _5_36->_5_37 _5_37->_5_38 _5_38->_5_39 +_5_38->_5_4 _5_39->_5_40 -_5_39->_5_6 +_5_4->_5_6 +_5_40->_5_17 _5_40->_5_41 -_5_41->_5_17 _5_41->_5_42 _5_42->_5_43 -_5_43->_5_1 -_5_44->_5_46 -_5_44->_5_47 -_5_46->_5_48 -_5_47->_5_2 +_5_43->_5_44 +_5_44->_5_45 +_5_44->_5_14 +_5_45->_5_46 +_5_46->_5_24 +_5_46->_5_47 +_5_47->_5_48 +_5_48->_5_1 +_5_5->_5_7 +_5_5->_5_8 +_5_7->_5_9 +_5_8->_5_10 } } diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg index a12f46a1a..289081b6e 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg +++ b/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg @@ -51,614 +51,614 @@ - + -_0_12 +_0_2 2     Intermediate input: 3, rsm: S_2, input: [0, 2] - + -_0_1->_0_12 +_0_1->_0_2 - + -_0_2 +_0_10 10     Nonterminal S, input: [1, 3] - + -_0_3 +_0_11 11     Range , input: [1, 3], rsm: [S_0, S_3] - + -_0_2->_0_3 +_0_10->_0_11 - + -_0_4 +_0_12 12     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_0_3->_0_4 +_0_11->_0_12 - + -_0_5 +_0_13 13     Intermediate input: 2, rsm: S_2, input: [1, 3] - + -_0_3->_0_5 +_0_11->_0_13 - + -_0_6 +_0_14 14     Range , input: [1, 2], rsm: [S_0, S_1] - + -_0_4->_0_6 +_0_12->_0_14 - + -_0_7 +_0_15 15     Range , input: [2, 3], rsm: [S_1, S_3] - + -_0_4->_0_7 +_0_12->_0_15 - + -_0_8 +_0_16 16     Range , input: [1, 2], rsm: [S_0, S_2] - + -_0_5->_0_8 +_0_13->_0_16 - + -_0_9 +_0_17 17     Range , input: [2, 3], rsm: [S_2, S_3] - + -_0_5->_0_9 +_0_13->_0_17 - + -_0_10 +_0_18 18     Terminal 'a', input: [1, 2] - + -_0_6->_0_10 +_0_14->_0_18 - + -_0_11 +_0_19 19     Terminal 'b', input: [2, 3] - + -_0_7->_0_11 +_0_15->_0_19 - + -_0_13 +_0_20 20     Intermediate input: 2, rsm: S_1, input: [1, 2] - + -_0_8->_0_13 +_0_16->_0_20 - + -_0_9->_0_11 +_0_17->_0_19 - + -_0_23 +_0_3 3     Range , input: [0, 3], rsm: [S_0, S_2] - + -_0_12->_0_23 +_0_2->_0_3 - + -_0_34 +_0_4 4     Range , input: [3, 2], rsm: [S_2, S_3] - + -_0_12->_0_34 +_0_2->_0_4 - + -_0_13->_0_6 +_0_20->_0_14 - + -_0_14 +_0_21 21     Range , input: [2, 2], rsm: [S_1, S_2] - + -_0_13->_0_14 +_0_20->_0_21 - + -_0_15 +_0_22 22     Nonterminal S, input: [2, 2] - + -_0_14->_0_15 +_0_21->_0_22 - + -_0_16 +_0_23 23     Range , input: [2, 2], rsm: [S_0, S_3] - + -_0_15->_0_16 +_0_22->_0_23 - + -_0_17 +_0_24 24     Intermediate input: 3, rsm: S_2, input: [2, 2] - + -_0_16->_0_17 +_0_23->_0_24 - + -_0_18 +_0_25 25     Range , input: [2, 3], rsm: [S_0, S_2] - + -_0_17->_0_18 +_0_24->_0_25 - + -_0_17->_0_34 +_0_24->_0_4 - + -_0_19 +_0_26 26     Intermediate input: 0, rsm: S_1, input: [2, 3] - + -_0_18->_0_19 +_0_25->_0_26 - + -_0_20 +_0_27 27     Range , input: [2, 0], rsm: [S_0, S_1] - + -_0_19->_0_20 +_0_26->_0_27 - + -_0_21 +_0_28 28     Range , input: [0, 3], rsm: [S_1, S_2] - + -_0_19->_0_21 +_0_26->_0_28 - + -_0_22 +_0_29 29     Terminal 'a', input: [2, 0] - + -_0_20->_0_22 +_0_27->_0_29 - + -_0_24 +_0_30 30     Nonterminal S, input: [0, 3] - + -_0_21->_0_24 +_0_28->_0_30 - + -_0_44 +_0_5 5     Intermediate input: 1, rsm: S_1, input: [0, 3] - + -_0_23->_0_44 +_0_3->_0_5 - + -_0_25 +_0_31 31     Range , input: [0, 3], rsm: [S_0, S_3] - + -_0_24->_0_25 +_0_30->_0_31 - + -_0_26 +_0_32 32     Intermediate input: 2, rsm: S_2, input: [0, 3] - + -_0_25->_0_26 +_0_31->_0_32 - + -_0_26->_0_9 +_0_32->_0_17 - + -_0_27 +_0_33 33     Range , input: [0, 2], rsm: [S_0, S_2] - + -_0_26->_0_27 +_0_32->_0_33 - + -_0_28 +_0_34 34     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_0_27->_0_28 +_0_33->_0_34 - + -_0_29 +_0_35 35     Range , input: [1, 2], rsm: [S_1, S_2] - + -_0_28->_0_29 +_0_34->_0_35 - + -_0_46 +_0_7 7     Range , input: [0, 1], rsm: [S_0, S_1] - + -_0_28->_0_46 +_0_34->_0_7 - + -_0_30 +_0_36 36     Nonterminal S, input: [1, 2] - + -_0_29->_0_30 +_0_35->_0_36 - + -_0_31 +_0_37 37     Range , input: [1, 2], rsm: [S_0, S_3] - + -_0_30->_0_31 +_0_36->_0_37 - + -_0_32 +_0_38 38     Intermediate input: 3, rsm: S_2, input: [1, 2] - + -_0_31->_0_32 +_0_37->_0_38 - + -_0_33 +_0_39 39     Range , input: [1, 3], rsm: [S_0, S_2] - + -_0_32->_0_33 +_0_38->_0_39 - + -_0_32->_0_34 +_0_38->_0_4 - + -_0_35 +_0_40 40     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_0_33->_0_35 +_0_39->_0_40 - + -_0_45 +_0_6 6     Terminal 'b', input: [3, 2] - + -_0_34->_0_45 +_0_4->_0_6 - + -_0_35->_0_6 +_0_40->_0_14 - + -_0_36 +_0_41 41     Range , input: [2, 3], rsm: [S_1, S_2] - + -_0_35->_0_36 +_0_40->_0_41 - + -_0_37 +_0_42 42     Nonterminal S, input: [2, 3] - + -_0_36->_0_37 +_0_41->_0_42 - + -_0_38 +_0_43 43     Range , input: [2, 3], rsm: [S_0, S_3] - + -_0_37->_0_38 +_0_42->_0_43 - + -_0_39 +_0_44 44     Intermediate input: 2, rsm: S_2, input: [2, 3] - + -_0_38->_0_39 +_0_43->_0_44 - + -_0_39->_0_9 +_0_44->_0_17 - + -_0_40 +_0_45 45     Range , input: [2, 2], rsm: [S_0, S_2] - + -_0_39->_0_40 +_0_44->_0_45 - + -_0_41 +_0_46 46     Intermediate input: 0, rsm: S_1, input: [2, 2] - + -_0_40->_0_41 +_0_45->_0_46 - + -_0_41->_0_20 +_0_46->_0_27 - + -_0_42 +_0_47 47     Range , input: [0, 2], rsm: [S_1, S_2] - + -_0_41->_0_42 +_0_46->_0_47 - + -_0_43 +_0_48 48     Nonterminal S, input: [0, 2] - + -_0_42->_0_43 +_0_47->_0_48 - + -_0_43->_0_1 +_0_48->_0_1 - + -_0_44->_0_46 +_0_5->_0_7 - + -_0_47 +_0_8 8     Range , input: [1, 3], rsm: [S_1, S_2] - + -_0_44->_0_47 +_0_5->_0_8 - + -_0_48 +_0_9 9     Terminal 'a', input: [0, 1] - + -_0_46->_0_48 +_0_7->_0_9 - + -_0_47->_0_2 +_0_8->_0_10 @@ -680,614 +680,614 @@ - + -_1_12 +_1_2 2     Intermediate input: 2, rsm: S_2, input: [0, 3] - + -_1_1->_1_12 +_1_1->_1_2 - + -_1_2 +_1_10 10     Nonterminal S, input: [1, 2] - + -_1_3 +_1_11 11     Range , input: [1, 2], rsm: [S_0, S_3] - + -_1_2->_1_3 +_1_10->_1_11 - + -_1_4 +_1_12 12     Intermediate input: 3, rsm: S_2, input: [1, 2] - + -_1_3->_1_4 +_1_11->_1_12 - + -_1_5 +_1_13 13     Range , input: [1, 3], rsm: [S_0, S_2] - + -_1_4->_1_5 +_1_12->_1_13 - + -_1_6 +_1_14 14     Range , input: [3, 2], rsm: [S_2, S_3] - + -_1_4->_1_6 +_1_12->_1_14 - + -_1_7 +_1_15 15     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_1_5->_1_7 +_1_13->_1_15 - + -_1_8 +_1_16 16     Terminal 'b', input: [3, 2] - + -_1_6->_1_8 +_1_14->_1_16 - + -_1_9 +_1_17 17     Range , input: [1, 2], rsm: [S_0, S_1] - + -_1_7->_1_9 +_1_15->_1_17 - + -_1_10 +_1_18 18     Range , input: [2, 3], rsm: [S_1, S_2] - + -_1_7->_1_10 +_1_15->_1_18 - + -_1_11 +_1_19 19     Terminal 'a', input: [1, 2] - + -_1_9->_1_11 +_1_17->_1_19 - + -_1_13 +_1_20 20     Nonterminal S, input: [2, 3] - + -_1_10->_1_13 +_1_18->_1_20 - + -_1_23 +_1_3 3     Range , input: [0, 2], rsm: [S_0, S_2] - + -_1_12->_1_23 +_1_2->_1_3 - + -_1_34 +_1_4 4     Range , input: [2, 3], rsm: [S_2, S_3] - + -_1_12->_1_34 +_1_2->_1_4 - + -_1_14 +_1_21 21     Range , input: [2, 3], rsm: [S_0, S_3] - + -_1_13->_1_14 +_1_20->_1_21 - + -_1_15 +_1_22 22     Intermediate input: 2, rsm: S_2, input: [2, 3] - + -_1_14->_1_15 +_1_21->_1_22 - + -_1_16 +_1_23 23     Range , input: [2, 2], rsm: [S_0, S_2] - + -_1_15->_1_16 +_1_22->_1_23 - + -_1_15->_1_34 +_1_22->_1_4 - + -_1_17 +_1_24 24     Intermediate input: 0, rsm: S_1, input: [2, 2] - + -_1_16->_1_17 +_1_23->_1_24 - + -_1_18 +_1_25 25     Range , input: [2, 0], rsm: [S_0, S_1] - + -_1_17->_1_18 +_1_24->_1_25 - + -_1_19 +_1_26 26     Range , input: [0, 2], rsm: [S_1, S_2] - + -_1_17->_1_19 +_1_24->_1_26 - + -_1_20 +_1_27 27     Terminal 'a', input: [2, 0] - + -_1_18->_1_20 +_1_25->_1_27 - + -_1_21 +_1_28 28     Nonterminal S, input: [0, 2] - + -_1_19->_1_21 +_1_26->_1_28 - + -_1_22 +_1_29 29     Range , input: [0, 2], rsm: [S_0, S_3] - + -_1_21->_1_22 +_1_28->_1_29 - + -_1_24 +_1_30 30     Intermediate input: 3, rsm: S_2, input: [0, 2] - + -_1_22->_1_24 +_1_29->_1_30 - + -_1_44 +_1_5 5     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_1_23->_1_44 +_1_3->_1_5 - + -_1_24->_1_6 +_1_30->_1_14 - + -_1_25 +_1_31 31     Range , input: [0, 3], rsm: [S_0, S_2] - + -_1_24->_1_25 +_1_30->_1_31 - + -_1_26 +_1_32 32     Intermediate input: 1, rsm: S_1, input: [0, 3] - + -_1_25->_1_26 +_1_31->_1_32 - + -_1_27 +_1_33 33     Range , input: [1, 3], rsm: [S_1, S_2] - + -_1_26->_1_27 +_1_32->_1_33 - + -_1_46 +_1_7 7     Range , input: [0, 1], rsm: [S_0, S_1] - + -_1_26->_1_46 +_1_32->_1_7 - + -_1_28 +_1_34 34     Nonterminal S, input: [1, 3] - + -_1_27->_1_28 +_1_33->_1_34 - + -_1_29 +_1_35 35     Range , input: [1, 3], rsm: [S_0, S_3] - + -_1_28->_1_29 +_1_34->_1_35 - + -_1_30 +_1_36 36     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_1_29->_1_30 +_1_35->_1_36 - + -_1_31 +_1_37 37     Intermediate input: 2, rsm: S_2, input: [1, 3] - + -_1_29->_1_31 +_1_35->_1_37 - + -_1_30->_1_9 +_1_36->_1_17 - + -_1_32 +_1_38 38     Range , input: [2, 3], rsm: [S_1, S_3] - + -_1_30->_1_32 +_1_36->_1_38 - + -_1_33 +_1_39 39     Range , input: [1, 2], rsm: [S_0, S_2] - + -_1_31->_1_33 +_1_37->_1_39 - + -_1_31->_1_34 +_1_37->_1_4 - + -_1_45 +_1_6 6     Terminal 'b', input: [2, 3] - + -_1_32->_1_45 +_1_38->_1_6 - + -_1_35 +_1_40 40     Intermediate input: 2, rsm: S_1, input: [1, 2] - + -_1_33->_1_35 +_1_39->_1_40 - + -_1_34->_1_45 +_1_4->_1_6 - + -_1_35->_1_9 +_1_40->_1_17 - + -_1_36 +_1_41 41     Range , input: [2, 2], rsm: [S_1, S_2] - + -_1_35->_1_36 +_1_40->_1_41 - + -_1_37 +_1_42 42     Nonterminal S, input: [2, 2] - + -_1_36->_1_37 +_1_41->_1_42 - + -_1_38 +_1_43 43     Range , input: [2, 2], rsm: [S_0, S_3] - + -_1_37->_1_38 +_1_42->_1_43 - + -_1_39 +_1_44 44     Intermediate input: 3, rsm: S_2, input: [2, 2] - + -_1_38->_1_39 +_1_43->_1_44 - + -_1_39->_1_6 +_1_44->_1_14 - + -_1_40 +_1_45 45     Range , input: [2, 3], rsm: [S_0, S_2] - + -_1_39->_1_40 +_1_44->_1_45 - + -_1_41 +_1_46 46     Intermediate input: 0, rsm: S_1, input: [2, 3] - + -_1_40->_1_41 +_1_45->_1_46 - + -_1_41->_1_18 +_1_46->_1_25 - + -_1_42 +_1_47 47     Range , input: [0, 3], rsm: [S_1, S_2] - + -_1_41->_1_42 +_1_46->_1_47 - + -_1_43 +_1_48 48     Nonterminal S, input: [0, 3] - + -_1_42->_1_43 +_1_47->_1_48 - + -_1_43->_1_1 +_1_48->_1_1 - + -_1_44->_1_46 +_1_5->_1_7 - + -_1_47 +_1_8 8     Range , input: [1, 2], rsm: [S_1, S_2] - + -_1_44->_1_47 +_1_5->_1_8 - + -_1_48 +_1_9 9     Terminal 'a', input: [0, 1] - + -_1_46->_1_48 +_1_7->_1_9 - + -_1_47->_1_2 +_1_8->_1_10 @@ -1309,614 +1309,614 @@ - + -_2_12 +_2_2 2     Intermediate input: 3, rsm: S_2, input: [1, 2] - + -_2_1->_2_12 +_2_1->_2_2 - + -_2_2 +_2_10 10     Nonterminal S, input: [2, 3] - + -_2_3 +_2_11 11     Range , input: [2, 3], rsm: [S_0, S_3] - + -_2_2->_2_3 +_2_10->_2_11 - + -_2_4 +_2_12 12     Intermediate input: 2, rsm: S_2, input: [2, 3] - + -_2_3->_2_4 +_2_11->_2_12 - + -_2_5 +_2_13 13     Range , input: [2, 2], rsm: [S_0, S_2] - + -_2_4->_2_5 +_2_12->_2_13 - + -_2_6 +_2_14 14     Range , input: [2, 3], rsm: [S_2, S_3] - + -_2_4->_2_6 +_2_12->_2_14 - + -_2_7 +_2_15 15     Intermediate input: 0, rsm: S_1, input: [2, 2] - + -_2_5->_2_7 +_2_13->_2_15 - + -_2_8 +_2_16 16     Terminal 'b', input: [2, 3] - + -_2_6->_2_8 +_2_14->_2_16 - + -_2_9 +_2_17 17     Range , input: [2, 0], rsm: [S_0, S_1] - + -_2_7->_2_9 +_2_15->_2_17 - + -_2_10 +_2_18 18     Range , input: [0, 2], rsm: [S_1, S_2] - + -_2_7->_2_10 +_2_15->_2_18 - + -_2_11 +_2_19 19     Terminal 'a', input: [2, 0] - + -_2_9->_2_11 +_2_17->_2_19 - + -_2_13 +_2_20 20     Nonterminal S, input: [0, 2] - + -_2_10->_2_13 +_2_18->_2_20 - + -_2_23 +_2_3 3     Range , input: [1, 3], rsm: [S_0, S_2] - + -_2_12->_2_23 +_2_2->_2_3 - + -_2_34 +_2_4 4     Range , input: [3, 2], rsm: [S_2, S_3] - + -_2_12->_2_34 +_2_2->_2_4 - + -_2_14 +_2_21 21     Range , input: [0, 2], rsm: [S_0, S_3] - + -_2_13->_2_14 +_2_20->_2_21 - + -_2_15 +_2_22 22     Intermediate input: 3, rsm: S_2, input: [0, 2] - + -_2_14->_2_15 +_2_21->_2_22 - + -_2_16 +_2_23 23     Range , input: [0, 3], rsm: [S_0, S_2] - + -_2_15->_2_16 +_2_22->_2_23 - + -_2_15->_2_34 +_2_22->_2_4 - + -_2_17 +_2_24 24     Intermediate input: 1, rsm: S_1, input: [0, 3] - + -_2_16->_2_17 +_2_23->_2_24 - + -_2_18 +_2_25 25     Range , input: [0, 1], rsm: [S_0, S_1] - + -_2_17->_2_18 +_2_24->_2_25 - + -_2_19 +_2_26 26     Range , input: [1, 3], rsm: [S_1, S_2] - + -_2_17->_2_19 +_2_24->_2_26 - + -_2_20 +_2_27 27     Terminal 'a', input: [0, 1] - + -_2_18->_2_20 +_2_25->_2_27 - + -_2_21 +_2_28 28     Nonterminal S, input: [1, 3] - + -_2_19->_2_21 +_2_26->_2_28 - + -_2_22 +_2_29 29     Range , input: [1, 3], rsm: [S_0, S_3] - + -_2_21->_2_22 +_2_28->_2_29 - + -_2_24 +_2_30 30     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_2_22->_2_24 +_2_29->_2_30 - + -_2_25 +_2_31 31     Intermediate input: 2, rsm: S_2, input: [1, 3] - + -_2_22->_2_25 +_2_29->_2_31 - + -_2_44 +_2_5 5     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_2_23->_2_44 +_2_3->_2_5 - + -_2_26 +_2_32 32     Range , input: [2, 3], rsm: [S_1, S_3] - + -_2_24->_2_26 +_2_30->_2_32 - + -_2_46 +_2_7 7     Range , input: [1, 2], rsm: [S_0, S_1] - + -_2_24->_2_46 +_2_30->_2_7 - + -_2_25->_2_6 +_2_31->_2_14 - + -_2_27 +_2_33 33     Range , input: [1, 2], rsm: [S_0, S_2] - + -_2_25->_2_27 +_2_31->_2_33 - + -_2_26->_2_8 +_2_32->_2_16 - + -_2_28 +_2_34 34     Intermediate input: 2, rsm: S_1, input: [1, 2] - + -_2_27->_2_28 +_2_33->_2_34 - + -_2_29 +_2_35 35     Range , input: [2, 2], rsm: [S_1, S_2] - + -_2_28->_2_29 +_2_34->_2_35 - + -_2_28->_2_46 +_2_34->_2_7 - + -_2_30 +_2_36 36     Nonterminal S, input: [2, 2] - + -_2_29->_2_30 +_2_35->_2_36 - + -_2_31 +_2_37 37     Range , input: [2, 2], rsm: [S_0, S_3] - + -_2_30->_2_31 +_2_36->_2_37 - + -_2_32 +_2_38 38     Intermediate input: 3, rsm: S_2, input: [2, 2] - + -_2_31->_2_32 +_2_37->_2_38 - + -_2_33 +_2_39 39     Range , input: [2, 3], rsm: [S_0, S_2] - + -_2_32->_2_33 +_2_38->_2_39 - + -_2_32->_2_34 +_2_38->_2_4 - + -_2_35 +_2_40 40     Intermediate input: 0, rsm: S_1, input: [2, 3] - + -_2_33->_2_35 +_2_39->_2_40 - + -_2_45 +_2_6 6     Terminal 'b', input: [3, 2] - + -_2_34->_2_45 +_2_4->_2_6 - + -_2_35->_2_9 +_2_40->_2_17 - + -_2_36 +_2_41 41     Range , input: [0, 3], rsm: [S_1, S_2] - + -_2_35->_2_36 +_2_40->_2_41 - + -_2_37 +_2_42 42     Nonterminal S, input: [0, 3] - + -_2_36->_2_37 +_2_41->_2_42 - + -_2_38 +_2_43 43     Range , input: [0, 3], rsm: [S_0, S_3] - + -_2_37->_2_38 +_2_42->_2_43 - + -_2_39 +_2_44 44     Intermediate input: 2, rsm: S_2, input: [0, 3] - + -_2_38->_2_39 +_2_43->_2_44 - + -_2_39->_2_6 +_2_44->_2_14 - + -_2_40 +_2_45 45     Range , input: [0, 2], rsm: [S_0, S_2] - + -_2_39->_2_40 +_2_44->_2_45 - + -_2_41 +_2_46 46     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_2_40->_2_41 +_2_45->_2_46 - + -_2_41->_2_18 +_2_46->_2_25 - + -_2_42 +_2_47 47     Range , input: [1, 2], rsm: [S_1, S_2] - + -_2_41->_2_42 +_2_46->_2_47 - + -_2_43 +_2_48 48     Nonterminal S, input: [1, 2] - + -_2_42->_2_43 +_2_47->_2_48 - + -_2_43->_2_1 +_2_48->_2_1 - + -_2_44->_2_46 +_2_5->_2_7 - + -_2_47 +_2_8 8     Range , input: [2, 3], rsm: [S_1, S_2] - + -_2_44->_2_47 +_2_5->_2_8 - + -_2_48 +_2_9 9     Terminal 'a', input: [1, 2] - + -_2_46->_2_48 +_2_7->_2_9 - + -_2_47->_2_2 +_2_8->_2_10 @@ -1938,614 +1938,614 @@ - + -_3_12 +_3_2 2     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_3_1->_3_12 +_3_1->_3_2 - + -_3_23 +_3_3 3     Intermediate input: 2, rsm: S_2, input: [1, 3] - + -_3_1->_3_23 +_3_1->_3_3 - + -_3_2 +_3_10 10     Intermediate input: 2, rsm: S_1, input: [1, 2] - + -_3_3 +_3_11 11     Range , input: [2, 2], rsm: [S_1, S_2] - + -_3_2->_3_3 +_3_10->_3_11 - + -_3_34 +_3_4 4     Range , input: [1, 2], rsm: [S_0, S_1] - + -_3_2->_3_34 +_3_10->_3_4 - + -_3_4 +_3_12 12     Nonterminal S, input: [2, 2] - + -_3_3->_3_4 +_3_11->_3_12 - + -_3_5 +_3_13 13     Range , input: [2, 2], rsm: [S_0, S_3] - + -_3_4->_3_5 +_3_12->_3_13 - + -_3_6 +_3_14 14     Intermediate input: 3, rsm: S_2, input: [2, 2] - + -_3_5->_3_6 +_3_13->_3_14 - + -_3_7 +_3_15 15     Range , input: [2, 3], rsm: [S_0, S_2] - + -_3_6->_3_7 +_3_14->_3_15 - + -_3_8 +_3_16 16     Range , input: [3, 2], rsm: [S_2, S_3] - + -_3_6->_3_8 +_3_14->_3_16 - + -_3_9 +_3_17 17     Intermediate input: 0, rsm: S_1, input: [2, 3] - + -_3_7->_3_9 +_3_15->_3_17 - + -_3_10 +_3_18 18     Terminal 'b', input: [3, 2] - + -_3_8->_3_10 +_3_16->_3_18 - + -_3_11 +_3_19 19     Range , input: [2, 0], rsm: [S_0, S_1] - + -_3_9->_3_11 +_3_17->_3_19 - + -_3_13 +_3_20 20     Range , input: [0, 3], rsm: [S_1, S_2] - + -_3_9->_3_13 +_3_17->_3_20 - + -_3_14 +_3_21 21     Terminal 'a', input: [2, 0] - + -_3_11->_3_14 +_3_19->_3_21 - + -_3_12->_3_34 +_3_2->_3_4 - + -_3_44 +_3_5 5     Range , input: [2, 3], rsm: [S_1, S_3] - + -_3_12->_3_44 +_3_2->_3_5 - + -_3_15 +_3_22 22     Nonterminal S, input: [0, 3] - + -_3_13->_3_15 +_3_20->_3_22 - + -_3_16 +_3_23 23     Range , input: [0, 3], rsm: [S_0, S_3] - + -_3_15->_3_16 +_3_22->_3_23 - + -_3_17 +_3_24 24     Intermediate input: 2, rsm: S_2, input: [0, 3] - + -_3_16->_3_17 +_3_23->_3_24 - + -_3_18 +_3_25 25     Range , input: [0, 2], rsm: [S_0, S_2] - + -_3_17->_3_18 +_3_24->_3_25 - + -_3_46 +_3_7 7     Range , input: [2, 3], rsm: [S_2, S_3] - + -_3_17->_3_46 +_3_24->_3_7 - + -_3_19 +_3_26 26     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_3_18->_3_19 +_3_25->_3_26 - + -_3_20 +_3_27 27     Range , input: [0, 1], rsm: [S_0, S_1] - + -_3_19->_3_20 +_3_26->_3_27 - + -_3_21 +_3_28 28     Range , input: [1, 2], rsm: [S_1, S_2] - + -_3_19->_3_21 +_3_26->_3_28 - + -_3_22 +_3_29 29     Terminal 'a', input: [0, 1] - + -_3_20->_3_22 +_3_27->_3_29 - + -_3_24 +_3_30 30     Nonterminal S, input: [1, 2] - + -_3_21->_3_24 +_3_28->_3_30 - + -_3_45 +_3_6 6     Range , input: [1, 2], rsm: [S_0, S_2] - + -_3_23->_3_45 +_3_3->_3_6 - + -_3_23->_3_46 +_3_3->_3_7 - + -_3_25 +_3_31 31     Range , input: [1, 2], rsm: [S_0, S_3] - + -_3_24->_3_25 +_3_30->_3_31 - + -_3_26 +_3_32 32     Intermediate input: 3, rsm: S_2, input: [1, 2] - + -_3_25->_3_26 +_3_31->_3_32 - + -_3_26->_3_8 +_3_32->_3_16 - + -_3_27 +_3_33 33     Range , input: [1, 3], rsm: [S_0, S_2] - + -_3_26->_3_27 +_3_32->_3_33 - + -_3_28 +_3_34 34     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_3_27->_3_28 +_3_33->_3_34 - + -_3_29 +_3_35 35     Range , input: [2, 3], rsm: [S_1, S_2] - + -_3_28->_3_29 +_3_34->_3_35 - + -_3_28->_3_34 +_3_34->_3_4 - + -_3_30 +_3_36 36     Nonterminal S, input: [2, 3] - + -_3_29->_3_30 +_3_35->_3_36 - + -_3_31 +_3_37 37     Range , input: [2, 3], rsm: [S_0, S_3] - + -_3_30->_3_31 +_3_36->_3_37 - + -_3_32 +_3_38 38     Intermediate input: 2, rsm: S_2, input: [2, 3] - + -_3_31->_3_32 +_3_37->_3_38 - + -_3_33 +_3_39 39     Range , input: [2, 2], rsm: [S_0, S_2] - + -_3_32->_3_33 +_3_38->_3_39 - + -_3_32->_3_46 +_3_38->_3_7 - + -_3_35 +_3_40 40     Intermediate input: 0, rsm: S_1, input: [2, 2] - + -_3_33->_3_35 +_3_39->_3_40 - + -_3_47 +_3_8 8     Terminal 'a', input: [1, 2] - + -_3_34->_3_47 +_3_4->_3_8 - + -_3_35->_3_11 +_3_40->_3_19 - + -_3_36 +_3_41 41     Range , input: [0, 2], rsm: [S_1, S_2] - + -_3_35->_3_36 +_3_40->_3_41 - + -_3_37 +_3_42 42     Nonterminal S, input: [0, 2] - + -_3_36->_3_37 +_3_41->_3_42 - + -_3_38 +_3_43 43     Range , input: [0, 2], rsm: [S_0, S_3] - + -_3_37->_3_38 +_3_42->_3_43 - + -_3_39 +_3_44 44     Intermediate input: 3, rsm: S_2, input: [0, 2] - + -_3_38->_3_39 +_3_43->_3_44 - + -_3_39->_3_8 +_3_44->_3_16 - + -_3_40 +_3_45 45     Range , input: [0, 3], rsm: [S_0, S_2] - + -_3_39->_3_40 +_3_44->_3_45 - + -_3_41 +_3_46 46     Intermediate input: 1, rsm: S_1, input: [0, 3] - + -_3_40->_3_41 +_3_45->_3_46 - + -_3_41->_3_20 +_3_46->_3_27 - + -_3_42 +_3_47 47     Range , input: [1, 3], rsm: [S_1, S_2] - + -_3_41->_3_42 +_3_46->_3_47 - + -_3_43 +_3_48 48     Nonterminal S, input: [1, 3] - + -_3_42->_3_43 +_3_47->_3_48 - + -_3_43->_3_1 +_3_48->_3_1 - + -_3_48 +_3_9 9     Terminal 'b', input: [2, 3] - + -_3_44->_3_48 +_3_5->_3_9 - + -_3_45->_3_2 +_3_6->_3_10 - + -_3_46->_3_48 +_3_7->_3_9 @@ -2567,614 +2567,614 @@ - + -_4_12 +_4_2 2     Intermediate input: 3, rsm: S_2, input: [2, 2] - + -_4_1->_4_12 +_4_1->_4_2 - + -_4_2 +_4_10 10     Nonterminal S, input: [0, 3] - + -_4_3 +_4_11 11     Range , input: [0, 3], rsm: [S_0, S_3] - + -_4_2->_4_3 +_4_10->_4_11 - + -_4_4 +_4_12 12     Intermediate input: 2, rsm: S_2, input: [0, 3] - + -_4_3->_4_4 +_4_11->_4_12 - + -_4_5 +_4_13 13     Range , input: [0, 2], rsm: [S_0, S_2] - + -_4_4->_4_5 +_4_12->_4_13 - + -_4_6 +_4_14 14     Range , input: [2, 3], rsm: [S_2, S_3] - + -_4_4->_4_6 +_4_12->_4_14 - + -_4_7 +_4_15 15     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_4_5->_4_7 +_4_13->_4_15 - + -_4_8 +_4_16 16     Terminal 'b', input: [2, 3] - + -_4_6->_4_8 +_4_14->_4_16 - + -_4_9 +_4_17 17     Range , input: [0, 1], rsm: [S_0, S_1] - + -_4_7->_4_9 +_4_15->_4_17 - + -_4_10 +_4_18 18     Range , input: [1, 2], rsm: [S_1, S_2] - + -_4_7->_4_10 +_4_15->_4_18 - + -_4_11 +_4_19 19     Terminal 'a', input: [0, 1] - + -_4_9->_4_11 +_4_17->_4_19 - + -_4_13 +_4_20 20     Nonterminal S, input: [1, 2] - + -_4_10->_4_13 +_4_18->_4_20 - + -_4_23 +_4_3 3     Range , input: [2, 3], rsm: [S_0, S_2] - + -_4_12->_4_23 +_4_2->_4_3 - + -_4_34 +_4_4 4     Range , input: [3, 2], rsm: [S_2, S_3] - + -_4_12->_4_34 +_4_2->_4_4 - + -_4_14 +_4_21 21     Range , input: [1, 2], rsm: [S_0, S_3] - + -_4_13->_4_14 +_4_20->_4_21 - + -_4_15 +_4_22 22     Intermediate input: 3, rsm: S_2, input: [1, 2] - + -_4_14->_4_15 +_4_21->_4_22 - + -_4_16 +_4_23 23     Range , input: [1, 3], rsm: [S_0, S_2] - + -_4_15->_4_16 +_4_22->_4_23 - + -_4_15->_4_34 +_4_22->_4_4 - + -_4_17 +_4_24 24     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_4_16->_4_17 +_4_23->_4_24 - + -_4_18 +_4_25 25     Range , input: [1, 2], rsm: [S_0, S_1] - + -_4_17->_4_18 +_4_24->_4_25 - + -_4_19 +_4_26 26     Range , input: [2, 3], rsm: [S_1, S_2] - + -_4_17->_4_19 +_4_24->_4_26 - + -_4_20 +_4_27 27     Terminal 'a', input: [1, 2] - + -_4_18->_4_20 +_4_25->_4_27 - + -_4_21 +_4_28 28     Nonterminal S, input: [2, 3] - + -_4_19->_4_21 +_4_26->_4_28 - + -_4_22 +_4_29 29     Range , input: [2, 3], rsm: [S_0, S_3] - + -_4_21->_4_22 +_4_28->_4_29 - + -_4_24 +_4_30 30     Intermediate input: 2, rsm: S_2, input: [2, 3] - + -_4_22->_4_24 +_4_29->_4_30 - + -_4_44 +_4_5 5     Intermediate input: 0, rsm: S_1, input: [2, 3] - + -_4_23->_4_44 +_4_3->_4_5 - + -_4_24->_4_6 +_4_30->_4_14 - + -_4_25 +_4_31 31     Range , input: [2, 2], rsm: [S_0, S_2] - + -_4_24->_4_25 +_4_30->_4_31 - + -_4_26 +_4_32 32     Intermediate input: 0, rsm: S_1, input: [2, 2] - + -_4_25->_4_26 +_4_31->_4_32 - + -_4_27 +_4_33 33     Range , input: [0, 2], rsm: [S_1, S_2] - + -_4_26->_4_27 +_4_32->_4_33 - + -_4_46 +_4_7 7     Range , input: [2, 0], rsm: [S_0, S_1] - + -_4_26->_4_46 +_4_32->_4_7 - + -_4_28 +_4_34 34     Nonterminal S, input: [0, 2] - + -_4_27->_4_28 +_4_33->_4_34 - + -_4_29 +_4_35 35     Range , input: [0, 2], rsm: [S_0, S_3] - + -_4_28->_4_29 +_4_34->_4_35 - + -_4_30 +_4_36 36     Intermediate input: 3, rsm: S_2, input: [0, 2] - + -_4_29->_4_30 +_4_35->_4_36 - + -_4_31 +_4_37 37     Range , input: [0, 3], rsm: [S_0, S_2] - + -_4_30->_4_31 +_4_36->_4_37 - + -_4_30->_4_34 +_4_36->_4_4 - + -_4_32 +_4_38 38     Intermediate input: 1, rsm: S_1, input: [0, 3] - + -_4_31->_4_32 +_4_37->_4_38 - + -_4_32->_4_9 +_4_38->_4_17 - + -_4_33 +_4_39 39     Range , input: [1, 3], rsm: [S_1, S_2] - + -_4_32->_4_33 +_4_38->_4_39 - + -_4_35 +_4_40 40     Nonterminal S, input: [1, 3] - + -_4_33->_4_35 +_4_39->_4_40 - + -_4_45 +_4_6 6     Terminal 'b', input: [3, 2] - + -_4_34->_4_45 +_4_4->_4_6 - + -_4_36 +_4_41 41     Range , input: [1, 3], rsm: [S_0, S_3] - + -_4_35->_4_36 +_4_40->_4_41 - + -_4_37 +_4_42 42     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_4_36->_4_37 +_4_41->_4_42 - + -_4_38 +_4_43 43     Intermediate input: 2, rsm: S_2, input: [1, 3] - + -_4_36->_4_38 +_4_41->_4_43 - + -_4_37->_4_18 +_4_42->_4_25 - + -_4_39 +_4_44 44     Range , input: [2, 3], rsm: [S_1, S_3] - + -_4_37->_4_39 +_4_42->_4_44 - + -_4_38->_4_6 +_4_43->_4_14 - + -_4_40 +_4_45 45     Range , input: [1, 2], rsm: [S_0, S_2] - + -_4_38->_4_40 +_4_43->_4_45 - + -_4_39->_4_8 +_4_44->_4_16 - + -_4_41 +_4_46 46     Intermediate input: 2, rsm: S_1, input: [1, 2] - + -_4_40->_4_41 +_4_45->_4_46 - + -_4_41->_4_18 +_4_46->_4_25 - + -_4_42 +_4_47 47     Range , input: [2, 2], rsm: [S_1, S_2] - + -_4_41->_4_42 +_4_46->_4_47 - + -_4_43 +_4_48 48     Nonterminal S, input: [2, 2] - + -_4_42->_4_43 +_4_47->_4_48 - + -_4_43->_4_1 +_4_48->_4_1 - + -_4_44->_4_46 +_4_5->_4_7 - + -_4_47 +_4_8 8     Range , input: [0, 3], rsm: [S_1, S_2] - + -_4_44->_4_47 +_4_5->_4_8 - + -_4_48 +_4_9 9     Terminal 'a', input: [2, 0] - + -_4_46->_4_48 +_4_7->_4_9 - + -_4_47->_4_2 +_4_8->_4_10 @@ -3196,614 +3196,614 @@ - + -_5_12 +_5_2 2     Intermediate input: 2, rsm: S_2, input: [2, 3] - + -_5_1->_5_12 +_5_1->_5_2 - + -_5_2 +_5_10 10     Nonterminal S, input: [0, 2] - + -_5_3 +_5_11 11     Range , input: [0, 2], rsm: [S_0, S_3] - + -_5_2->_5_3 +_5_10->_5_11 - + -_5_4 +_5_12 12     Intermediate input: 3, rsm: S_2, input: [0, 2] - + -_5_3->_5_4 +_5_11->_5_12 - + -_5_5 +_5_13 13     Range , input: [0, 3], rsm: [S_0, S_2] - + -_5_4->_5_5 +_5_12->_5_13 - + -_5_6 +_5_14 14     Range , input: [3, 2], rsm: [S_2, S_3] - + -_5_4->_5_6 +_5_12->_5_14 - + -_5_7 +_5_15 15     Intermediate input: 1, rsm: S_1, input: [0, 3] - + -_5_5->_5_7 +_5_13->_5_15 - + -_5_8 +_5_16 16     Terminal 'b', input: [3, 2] - + -_5_6->_5_8 +_5_14->_5_16 - + -_5_9 +_5_17 17     Range , input: [0, 1], rsm: [S_0, S_1] - + -_5_7->_5_9 +_5_15->_5_17 - + -_5_10 +_5_18 18     Range , input: [1, 3], rsm: [S_1, S_2] - + -_5_7->_5_10 +_5_15->_5_18 - + -_5_11 +_5_19 19     Terminal 'a', input: [0, 1] - + -_5_9->_5_11 +_5_17->_5_19 - + -_5_13 +_5_20 20     Nonterminal S, input: [1, 3] - + -_5_10->_5_13 +_5_18->_5_20 - + -_5_23 +_5_3 3     Range , input: [2, 2], rsm: [S_0, S_2] - + -_5_12->_5_23 +_5_2->_5_3 - + -_5_34 +_5_4 4     Range , input: [2, 3], rsm: [S_2, S_3] - + -_5_12->_5_34 +_5_2->_5_4 - + -_5_14 +_5_21 21     Range , input: [1, 3], rsm: [S_0, S_3] - + -_5_13->_5_14 +_5_20->_5_21 - + -_5_15 +_5_22 22     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_5_14->_5_15 +_5_21->_5_22 - + -_5_16 +_5_23 23     Intermediate input: 2, rsm: S_2, input: [1, 3] - + -_5_14->_5_16 +_5_21->_5_23 - + -_5_17 +_5_24 24     Range , input: [1, 2], rsm: [S_0, S_1] - + -_5_15->_5_17 +_5_22->_5_24 - + -_5_18 +_5_25 25     Range , input: [2, 3], rsm: [S_1, S_3] - + -_5_15->_5_18 +_5_22->_5_25 - + -_5_19 +_5_26 26     Range , input: [1, 2], rsm: [S_0, S_2] - + -_5_16->_5_19 +_5_23->_5_26 - + -_5_16->_5_34 +_5_23->_5_4 - + -_5_20 +_5_27 27     Terminal 'a', input: [1, 2] - + -_5_17->_5_20 +_5_24->_5_27 - + -_5_45 +_5_6 6     Terminal 'b', input: [2, 3] - + -_5_18->_5_45 +_5_25->_5_6 - + -_5_21 +_5_28 28     Intermediate input: 2, rsm: S_1, input: [1, 2] - + -_5_19->_5_21 +_5_26->_5_28 - + -_5_21->_5_17 +_5_28->_5_24 - + -_5_22 +_5_29 29     Range , input: [2, 2], rsm: [S_1, S_2] - + -_5_21->_5_22 +_5_28->_5_29 - + -_5_24 +_5_30 30     Nonterminal S, input: [2, 2] - + -_5_22->_5_24 +_5_29->_5_30 - + -_5_44 +_5_5 5     Intermediate input: 0, rsm: S_1, input: [2, 2] - + -_5_23->_5_44 +_5_3->_5_5 - + -_5_25 +_5_31 31     Range , input: [2, 2], rsm: [S_0, S_3] - + -_5_24->_5_25 +_5_30->_5_31 - + -_5_26 +_5_32 32     Intermediate input: 3, rsm: S_2, input: [2, 2] - + -_5_25->_5_26 +_5_31->_5_32 - + -_5_26->_5_6 +_5_32->_5_14 - + -_5_27 +_5_33 33     Range , input: [2, 3], rsm: [S_0, S_2] - + -_5_26->_5_27 +_5_32->_5_33 - + -_5_28 +_5_34 34     Intermediate input: 0, rsm: S_1, input: [2, 3] - + -_5_27->_5_28 +_5_33->_5_34 - + -_5_29 +_5_35 35     Range , input: [0, 3], rsm: [S_1, S_2] - + -_5_28->_5_29 +_5_34->_5_35 - + -_5_46 +_5_7 7     Range , input: [2, 0], rsm: [S_0, S_1] - + -_5_28->_5_46 +_5_34->_5_7 - + -_5_30 +_5_36 36     Nonterminal S, input: [0, 3] - + -_5_29->_5_30 +_5_35->_5_36 - + -_5_31 +_5_37 37     Range , input: [0, 3], rsm: [S_0, S_3] - + -_5_30->_5_31 +_5_36->_5_37 - + -_5_32 +_5_38 38     Intermediate input: 2, rsm: S_2, input: [0, 3] - + -_5_31->_5_32 +_5_37->_5_38 - + -_5_33 +_5_39 39     Range , input: [0, 2], rsm: [S_0, S_2] - + -_5_32->_5_33 +_5_38->_5_39 - + -_5_32->_5_34 +_5_38->_5_4 - + -_5_35 +_5_40 40     Intermediate input: 1, rsm: S_1, input: [0, 2] - + -_5_33->_5_35 +_5_39->_5_40 - + -_5_34->_5_45 +_5_4->_5_6 - + -_5_35->_5_9 +_5_40->_5_17 - + -_5_36 +_5_41 41     Range , input: [1, 2], rsm: [S_1, S_2] - + -_5_35->_5_36 +_5_40->_5_41 - + -_5_37 +_5_42 42     Nonterminal S, input: [1, 2] - + -_5_36->_5_37 +_5_41->_5_42 - + -_5_38 +_5_43 43     Range , input: [1, 2], rsm: [S_0, S_3] - + -_5_37->_5_38 +_5_42->_5_43 - + -_5_39 +_5_44 44     Intermediate input: 3, rsm: S_2, input: [1, 2] - + -_5_38->_5_39 +_5_43->_5_44 - + -_5_39->_5_6 +_5_44->_5_14 - + -_5_40 +_5_45 45     Range , input: [1, 3], rsm: [S_0, S_2] - + -_5_39->_5_40 +_5_44->_5_45 - + -_5_41 +_5_46 46     Intermediate input: 2, rsm: S_1, input: [1, 3] - + -_5_40->_5_41 +_5_45->_5_46 - + -_5_41->_5_17 +_5_46->_5_24 - + -_5_42 +_5_47 47     Range , input: [2, 3], rsm: [S_1, S_2] - + -_5_41->_5_42 +_5_46->_5_47 - + -_5_43 +_5_48 48     Nonterminal S, input: [2, 3] - + -_5_42->_5_43 +_5_47->_5_48 - + -_5_43->_5_1 +_5_48->_5_1 - + -_5_44->_5_46 +_5_5->_5_7 - + -_5_47 +_5_8 8     Range , input: [0, 2], rsm: [S_1, S_2] - + -_5_44->_5_47 +_5_5->_5_8 - + -_5_48 +_5_9 9     Terminal 'a', input: [2, 0] - + -_5_46->_5_48 +_5_7->_5_9 - + -_5_47->_5_2 +_5_8->_5_10 From bfe5ad6236e43d553933f1da834e62e30e18c61a Mon Sep 17 00:00:00 2001 From: danisaev Date: Fri, 10 Jul 2026 17:01:02 +0300 Subject: [PATCH 50/71] docs: Modified README.md with Quick Start --- README.md | 36 +++++++++- .../org/ucfs/paths/examples/example_1.kt | 50 ------------- .../example_1_graph_sppf_1extraction.dot | 4 ++ .../example_1_graph_sppf_1extraction.dot.svg | 45 ++++++++++++ .../example_1_graph_sppf_2extraction.dot | 11 +++ .../example_1_graph_sppf_2extraction.dot.svg | 71 +++++++++++++++++++ 6 files changed, 166 insertions(+), 51 deletions(-) create mode 100644 cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot create mode 100644 cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg create mode 100644 cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot create mode 100644 cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg diff --git a/README.md b/README.md index 24718bde9..12ef06314 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,42 @@ over edge‑labeled directed graphs. Examples of such problems: 3) **Run query**. 4) **Inspect results**. -Detailed information and tutorial is [here](./cfpq-paths-app/README.md) +## Quick start +Find all paths in the graph that satisfy the grammar: +1) Describe grammar +```kotlin +class AnBnGrammar : Grammar() { + val S by Nt().asStart() + + init { + S /= "a" * Option(S) * "b" + } +} +``` +2) Load the graph + +![example_1_graph.dot](cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) +```kotlin +fun main() { + listOf("example_1_graph.dot").forEach { graphName -> + val graph = readGraph(graphName) + val grammar = AnBnGrammar() + val gll = Gll.gll(grammar.rsm, graph) + val sppf = gll.parse() + saveSppf(graphName, sppf) + } +} +``` +3) Inspect results from SPPF +![Results as SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) + SPPF contains a compressed representation of set of paths: + +![Path 1 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg) +![Path 2 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg) +> [!NOTE] +> At this stage of using UCFS, we get compressed representation of the entire set of extractable paths, and if you need to work with them further, you can add custom +> functions for your task. You can see an example of this [here](cfpq-paths-app/tutorial/complex-examples.md) ## Core Algorithm UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive diff --git a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt index f28740420..bea85a42f 100644 --- a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt +++ b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt @@ -28,56 +28,6 @@ fun readGraph(name: String): InputGraph { return dotParser.parseDot(dotGraph) } -data class OutEdge(val start: Int, val symbol: String, val end: Int) { - override fun toString(): String = "(" + start.toString() + "-" + symbol + "->" + end.toString() + ")" -} - -fun getPathFromSppf(node: RangeSppfNode, maxDepth: Int): List>? { - if (maxDepth == 0) { - return null - } - when (val nodeType = node.type) { - is TerminalType<*> -> { - val range = node.inputRange ?: throw RuntimeException("Null inputRange for TerminalType node of SPPF") - return listOf(listOf(OutEdge(range.from, nodeType.terminal.toString(), range.to))) - } - - is EpsilonNonterminalType -> { - return listOf(emptyList()) - } - - is EmptyType -> { - throw RuntimeException("SPPF cannot contain EmptyRange") - } - - is IntermediateType<*>, is NonterminalType -> { - val subPaths = node.children.map { getPathFromSppf(it, maxDepth - 1) } - if (subPaths.any { it == null }) { - return null - } - val paths = subPaths.filterNotNull().fold(listOf(listOf())) { acc, lst -> - acc.flatMap { list -> lst.map { element -> list + element } } - } - return paths - } - - is Range -> { - val paths = node.children.map { - getPathFromSppf(it, maxDepth - 1)?.filterNotNull() - }.filterNotNull().flatten() - if (paths.isEmpty()) { - return null - } - return paths - } - - else -> { - println("Type of node is ${node.type.javaClass}") - throw RuntimeException("Unknown RangeType in SPPF") - } - } -} - fun saveSppf(name: String, sppf: Set>) { val graphName = name.removeSuffix(".dot") val genPath = Path.of("gen", "sppf") diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot new file mode 100644 index 000000000..7f92679b1 --- /dev/null +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot @@ -0,0 +1,4 @@ +digraph { + 0 -> 1 [label = "a"] + 1 -> 2 [label = "b"] +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg new file mode 100644 index 000000000..b62635511 --- /dev/null +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg @@ -0,0 +1,45 @@ + + + + + + +%3 + + + +0 + +0 + + + +1 + +1 + + + +0->1 + + +a + + + +2 + +2 + + + +1->2 + + +b + + + diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot new file mode 100644 index 000000000..33e923983 --- /dev/null +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot @@ -0,0 +1,11 @@ +digraph { + 0 [label = "0"] + 1 [label = "1"] + 2 [label = "2"] + 3 [label = "1"] + 4 [label = "2"] + 0 -> 1 [label = "a"] + 1 -> 2 [label = "a"] + 2 -> 3 [label = "b"] + 3 -> 4 [label = "b"] +} \ No newline at end of file diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg new file mode 100644 index 000000000..6aa625b65 --- /dev/null +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg @@ -0,0 +1,71 @@ + + + + + + +%3 + + + +0 + +0 + + + +1 + +1 + + + +0->1 + + +a + + + +2 + +2 + + + +1->2 + + +a + + + +3 + +1 + + + +2->3 + + +b + + + +4 + +2 + + + +3->4 + + +b + + + From 04807b239fd0e598c0d916650ea162d318fd3deb Mon Sep 17 00:00:00 2001 From: danisaev Date: Sun, 12 Jul 2026 22:07:39 +0300 Subject: [PATCH 51/71] docs: Documentation restructuring --- README.md | 2 +- cfpq-paths-app/tutorial/cfl.md | 32 -- cfpq-paths-app/tutorial/complex-examples.md | 213 ---------- cfpq-paths-app/tutorial/grammar.md | 17 - cfpq-paths-app/tutorial/simple-examples.md | 149 ------- docs/docs/dsl.md | 53 +++ .../tutorial => docs/docs}/graphs.md | 0 docs/docs/index.md | 87 ++++- .../tutorial => docs/docs}/sppf.md | 10 +- docs/docs/usage-examples.md | 363 ++++++++++++++++++ 10 files changed, 494 insertions(+), 432 deletions(-) delete mode 100644 cfpq-paths-app/tutorial/cfl.md delete mode 100644 cfpq-paths-app/tutorial/complex-examples.md delete mode 100644 cfpq-paths-app/tutorial/grammar.md delete mode 100644 cfpq-paths-app/tutorial/simple-examples.md rename {cfpq-paths-app/tutorial => docs/docs}/graphs.md (100%) rename {cfpq-paths-app/tutorial => docs/docs}/sppf.md (69%) create mode 100644 docs/docs/usage-examples.md diff --git a/README.md b/README.md index 12ef06314..07a7c44c5 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ fun main() { > [!NOTE] > At this stage of using UCFS, we get compressed representation of the entire set of extractable paths, and if you need to work with them further, you can add custom -> functions for your task. You can see an example of this [here](cfpq-paths-app/tutorial/complex-examples.md) +> functions for your task. You can see an example of this [here](docs/docs/usage-examples.md) ## Core Algorithm UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive diff --git a/cfpq-paths-app/tutorial/cfl.md b/cfpq-paths-app/tutorial/cfl.md deleted file mode 100644 index 2ada0a450..000000000 --- a/cfpq-paths-app/tutorial/cfl.md +++ /dev/null @@ -1,32 +0,0 @@ -# Introduction to context-free languages - -UCFS solves path queries on edge-labeled directed graphs: the result consists of paths whose concatenated edge labels -form a word in a language $L$ specified by a grammar. In UCFS, $L$ is given by a context-free grammar -(CFG), and the corresponding language is a context-free language (CFL). For more information about CFG/L, see -сhapter 5 of the [book](https://github.com/FormalLanguageConstrainedPathQuerying/FormalLanguageConstrainedReachability-LectureNotes) - -The graph defines the set of candidate paths and the grammar restricts it to paths whose label sequences belong to $L$. - -## Context-free grammar - -A context-free grammar is a finite set of productions of the form $A \to a$, where $A$ is a non-terminal and $a$ is a -string of terminals and non-terminals. - -Notation used below: - -``` -A -> a -``` - -* **Non-terminal** — a symbol on the left-hand side of a production, expanded by applying rules. -* **Terminal** — a symbol that does not expanded and corresponds to the edge labels in UCFS - -**Example.** Grammar for $L = \{a^n b^n \mid n \ge 0\}$: - -``` -S -> a S b -S -> ε -``` - -Here $S$ is a non-terminal, $a$ and $b$ are terminals, $\varepsilon$ denotes the empty string. A path matches this -grammar if its label sequence is $ab$, $aabb$, $aaabbb$, etc. The simple examples in this guide use this grammar. diff --git a/cfpq-paths-app/tutorial/complex-examples.md b/cfpq-paths-app/tutorial/complex-examples.md deleted file mode 100644 index 95fad0f18..000000000 --- a/cfpq-paths-app/tutorial/complex-examples.md +++ /dev/null @@ -1,213 +0,0 @@ -# Complex examples (PointsTo analysis) - -The following examples illustrate UCFS on analysis-style graphs. - -**Grammar and code for paths extraction:** ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/Main.kt``` - -**To run (from project root)**: - -```bash -./gradlew :cfpq-paths-app:run -``` - -> [!NOTE] -> Path extraction uses a naive traversal algorithm intended only to demonstrate SPPF traversal. - -Below are code snippets, input graphs, fragments of the resulting SPPFs, and extracted paths. - -The analysis uses the following extended points-to grammar (start non-terminal ```S```) to model field-access chains. - -``` -PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" -FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* -Alias -> PointsTo FlowsTo -S -> (Alias? "store_i")* PointsTo -``` - -In all examples below, the grammar uses indices $i \in [0..3]$. -The corresponding RSM: - -![Graph for example 1](../src/main/resources/figures/rsm.dot.svg) - -## Example 1 - -Code snippet: - -```java -val n = new X() -val y = new Y() -val z = new Z() -val l = n -val t = y -l.u = y -t.v = z -``` - -Corresponding graph: - -![Graph for example 1](../src/main/resources/figures/graph_1.dot.svg) - -The resulting SPPF: - -![SPPF for example 1](../src/main/resources/figures/graph_1_sppf.dot.svg) - -Three trees are extracted because there are three paths of interest from node 1. -Subpaths derivable from non-terminals ```Alias``` and ```PointsTo``` are omitted, because they do not contribute -to recovering field assignments. - -Extracted paths: - -* [(1-PointsTo->0)] - - This path is trivial. Such paths will be omitted in further examples. - -* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - This path corresponds to ```n.u = new Y()```. Vertex 2 is an alias of 1 (```n```); the ```store_0``` edge models ```l.u = y```. - -* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] - - This path corresponds to ```n.u.v = new Z()```. - -## Example 2 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - l.next = new X() - l = l.next -} -``` - -Corresponding graph: - -![Graph for example 2](../src/main/resources/figures/graph_2.dot.svg) - -Part of the resulting SPPF: - -![SPPF for example 2](../src/main/resources/figures/graph_2_sppf.dot.svg) - -This fragment contains a cycle on vertices 27–31–34–37–38–40–42–44–47–49–52–56 (shown in red), indicating infinitely -many paths of interest. A sample of extracted paths: - -* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next = new X () // line 4``` - -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] - - ```n.next.next.next.next.next.next = new X () // line 4``` - -More paths can be extracted if needed. Traversal should be tuned accordingly. - -## Example 3 - -Code snippet: - -```java -val n = new X() -val l = n -while (...){ - val t = new X() - l.next = t - l = t -} -``` - -Corresponding graph: - -![Graph for example 3](../src/main/resources/figures/graph_3.dot.svg) - -Part of the resulting SPPF: - -![SPPF for example 3](../src/main/resources/figures/graph_3_sppf.dot.svg) - -This SPPF also contains a cycle on vertices 3–5–7–11; therefore, infinitely many paths of interest exist. Only a sample -is listed below. - -* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next = new X() // line 4``` - -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] - - ```n.next.next.next.next.next.next = new X() // line 4``` - -## Example 4 - -Code snippet: - -```java -val n = new X() -val z = new Z() -val u = new U() -z.x = n -u.y = n -val v = z.x -v.p = new Y() -val r = u.y -r.q = new P() -``` - -Corresponding graph: - -![Graph for example 4](../src/main/resources/figures/graph_4.dot.svg) - -For this example, the SPPF figure is omitted due to size; only the extracted paths are listed. The query uses two start -vertices: 1 and 8. - -* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```n.q = new P()``` - -* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```n.p = new Y() ``` - -* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] - - ```v.q = new P() ``` - -* [(8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` - -* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] - - ```v.p = new Y() ``` - diff --git a/cfpq-paths-app/tutorial/grammar.md b/cfpq-paths-app/tutorial/grammar.md deleted file mode 100644 index 7757763c0..000000000 --- a/cfpq-paths-app/tutorial/grammar.md +++ /dev/null @@ -1,17 +0,0 @@ -# Defining the grammar - -UCFS uses a [DSL](https://formallanguageconstrainedpathquerying.github.io/UCFS/dsl/) (domain-specific language) to define context-free grammars. - -Basic example structure: - -```kotlin -class MyGrammar : Grammar() { - val S by Nt().asStart() - - init { - S /= "a" * "b" - } -} -``` - -This defines the language $\{ab\}$ (a single $a$ followed by a single $b$). diff --git a/cfpq-paths-app/tutorial/simple-examples.md b/cfpq-paths-app/tutorial/simple-examples.md deleted file mode 100644 index a16ecd47e..000000000 --- a/cfpq-paths-app/tutorial/simple-examples.md +++ /dev/null @@ -1,149 +0,0 @@ -# Using UCFS with simple examples - -Set the grammar in -```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` - -**Grammar assignment** - -Define the grammar for the language $a^n b^n$: words consisting of $n$ occurrences of $a$ followed by $n$ -occurrences of $b$ (e.g., $ab$, $aabb$, $aaabbb$). -> [!NOTE] -> The grammar can be defined equivalently as follows. ->```kotlin ->class AnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * Option(S) * "b" -> } ->} ->``` ->or ->```kotlin ->class AnBnGrammar : Grammar() { -> val S by Nt().asStart() -> -> init { -> S /= "a" * (Epsilon or S) * "b" -> } ->} ->``` - -A **recursive state machine** ([RSM](https://www.researchgate.net/publication/226965977_Analysis_of_Recursive_State_Machines)) is an automaton-like representation of a context-free grammar. - -The RSM for the $a^n b^n$ grammar: - -![RSM for AnBn Grammar](../src/main/resources/figures/AnBnGrammarRsm.dot.svg) - -The start non-terminal $S$ expands to either the terminal string $ab$ or the string $aSb$. - -> [!NOTE] -> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node -> (red circle). - -**To run (from project root):** - -```bash -./gradlew :cfpq-paths-app:runSimpleExamples -``` - -**Example 1: Simple graph with a finite set of paths** - -**Input graph:** - -![Simple AnBn Graph / Finite Set Of Paths](../src/main/resources/figures/example_1_graph.dot.svg) - -The following words satisfy the grammar: - -* $ab$ (0 -a-> 1 -b-> 2) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Finite Set Of Paths / SPPF](../src/main/resources/figures/example_1_graph_sppf.dot.svg) - -The SPPF decomposes into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) - -The first tree corresponds to the word $ab$. - -**The *second* tree:** - -![Simple AnBn Graph / Finite Set of Paths / SPPF / 2Tree](../src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) - -The second tree corresponds to the word $aabb$. - -The result matches the expected language. - -**Example 2: Simple graph with an infinite number of paths #1** - -**Input graph:** - -![Simple AnBn Graph / Infinite Set Of Paths #1](../src/main/resources/figures/example_2_graph.dot.svg) - -Examples of words that satisfy the grammar: - -* $ab$ (0 -a-> 1 -b-> 1) -* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) -* ... - -> [!NOTE] -> The language contains infinitely many words of the form $a^nb^n$ where $n$ is odd. - -**Resulting SPPF graph:** - -![Simple AnBn Graph / Infinite Set Of Paths #1 / SPPF](../src/main/resources/figures/example_2_graph_sppf.dot.svg) - -> [!NOTE] -> This example shows that although the number of paths is infinite, the SPPF remains finite when a depth limit -> is applied. - -The SPPF decomposes into two trees: - -**The *first* tree:** - -![Simple AnBn Graph / Infinite Set of Paths / SPPF / 1Tree](../src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) - -The first tree corresponds to the word $ab$. - - - -**The *second* pre-tree:** - -![Simple AnBn Graph / Infinite Set of Paths / SPPF / 2PreTree](../src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg) - -> [!NOTE] -> The SPPF contains a cycle. The label sequence $aaSbb$ includes the non-terminal $S$, which can be expanded further -> to obtain $aaabbb$, $aaaaabbbbb$, and so on. - -Let's expand the nonterminal to construct the tree. - -**The *second* tree:** - -![Simple AnBn Graph / Infinite Set of Paths/ SPPF / 2Tree](../src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) - -This tree corresponds to the word $aaabbb$. - -The result matches the expected language. - -**Example 3: Simple graph with an infinite set of paths #2** - -**Input graph:** - -![Simple AnBn Graph / Infinite Set Of Paths #2](../src/main/resources/figures/example_3_graph.dot.svg) - -Examples of words that satisfy the grammar: - -* $ab$ (1 -a-> 2 -b-> 3) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) -* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) -* ... - -> [!NOTE] -> The graph yields infinitely many words that cover the full language, because it has several start vertices. - -The resulting SPPF is too large to include here; see -```src/main/resources/figures/example_3_graph_sppf.dot.svg``` diff --git a/docs/docs/dsl.md b/docs/docs/dsl.md index 5a2a84100..330c1f00a 100644 --- a/docs/docs/dsl.md +++ b/docs/docs/dsl.md @@ -5,6 +5,39 @@ It enables developers to describe grammars using natural Kotlin syntax while ben * development tools and syntax analysis from scratch; * simple (for now) compile-time checks for rules. +## Introduction to context-free languages + +UCFS solves path queries on edge-labeled directed graphs: the result consists of paths whose concatenated edge labels +form a word in a language $L$ specified by a grammar. In UCFS, $L$ is given by a context-free grammar +(CFG), and the corresponding language is a context-free language (CFL). For more information about CFG/L, see +сhapter 5 of the [book](https://github.com/FormalLanguageConstrainedPathQuerying/FormalLanguageConstrainedReachability-LectureNotes) + +The graph defines the set of candidate paths and the grammar restricts it to paths whose label sequences belong to $L$. + +## Context-free grammar + +A context-free grammar is a finite set of productions of the form $A \to a$, where $A$ is a non-terminal and $a$ is a +string of terminals and non-terminals. + +Notation used below: + +``` +A -> a +``` + +* **Non-terminal** — a symbol on the left-hand side of a production, expanded by applying rules. +* **Terminal** — a symbol that does not expanded and corresponds to the edge labels in UCFS + +**Example.** Grammar for $L = \{a^n b^n \mid n \ge 0\}$: + +``` +S -> a S b +S -> ε +``` + +Here $S$ is a non-terminal, $a$ and $b$ are terminals, $\varepsilon$ denotes the empty string. A path matches this +grammar if its label sequence is $ab$, $aabb$, $aaabbb$, etc. + ## Grammar @@ -63,6 +96,25 @@ Epsilon ($\varepsilon$) - constant terminal with behavior corresponding to the e ## Examples +### $AB$ language +This defines the language $\{ab\}$ (a single $a$ followed by a single $b$). +#### *EBNF* + +``` +S = "a" * "b" +``` + +#### *DSL* +```kotlin +class MyGrammar : Grammar() { + val S by Nt().asStart() + + init { + S /= "a" * "b" + } +} +``` + ### Dyck language These grammars define the Dyck language — all correctly nested parentheses, brackets, and braces. @@ -115,3 +167,4 @@ class AStar : Grammar() { } } ``` + diff --git a/cfpq-paths-app/tutorial/graphs.md b/docs/docs/graphs.md similarity index 100% rename from cfpq-paths-app/tutorial/graphs.md rename to docs/docs/graphs.md diff --git a/docs/docs/index.md b/docs/docs/index.md index 013b207c9..450667a06 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -2,15 +2,18 @@ > Note: project under heavy development! +Please, see [documentation](https://formallanguageconstrainedpathquerying.github.io/UCFS/) for details. + ## What is UCFS? -UCFS is an **U**niversal **C**ontext-**F**ree **S**olver: a GLL‑based tool for problems at the intersection of context‑free languages +UCFS is an **U**niversal **C**ontext-**F**ree **S**olver: a GLL‑based tool for problems at the intersection of +context‑free languages over edge‑labeled directed graphs. Examples of such problems: - Parsing - Context-free path querying (CFPQ) - Context-free language reachability (CFL-R) -- static code analysis +- static code analysis **Highlights** @@ -18,27 +21,81 @@ over edge‑labeled directed graphs. Examples of such problems: * Input: arbitrary edge‑labeled directed graphs. * Output: SPPF -- finite structure for all‑paths queries. +### Typical workflow + +1) **Describe grammar** in Kotlin DSL. +2) **Load graph** (for now `dot` format is supported). +3) **Run query**. +4) **Inspect results**. + +## Quick start +Find all paths in the graph that satisfy the grammar: +1) Describe grammar +```kotlin +class AnBnGrammar : Grammar() { + val S by Nt().asStart() + init { + S /= "a" * Option(S) * "b" + } +} +``` +2) Load the graph + +![example_1_graph.dot](cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) +```kotlin +fun main() { + listOf("example_1_graph.dot").forEach { graphName -> + val graph = readGraph(graphName) + val grammar = AnBnGrammar() + val gll = Gll.gll(grammar.rsm, graph) + val sppf = gll.parse() + saveSppf(graphName, sppf) + } +} +``` +3) Inspect results from SPPF + ![Results as SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) + SPPF contains a compressed representation of set of paths: + +![Path 1 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg) +![Path 2 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg) + +> [!NOTE] +> At this stage of using UCFS, we get compressed representation of the entire set of extractable paths, and if you need to work with them further, you can add custom +> functions for your task. You can see an example of this [here](./usage-examples.md) +## Core Algorithm + +UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive +State Machines (RSM) and input in form of arbitratry directed edge-labelled graph. Basic ideas +described [here](https://arxiv.org/pdf/2312.11925.pdf). ### Repository layout (high‑level) + ``` -docs/ # documentation pages -generator/ # Parser & AST node‑class generator -solver/ # Core UCFS logic (GLL + RSM) -test-shared/ # Testcases, grammars, inputs, ANTLR4 comparison - # grammar examples and experiments +docs/ # Documentation pages +generator/ # Parser & AST node‑class generator +solver/ # Core UCFS logic (GLL + RSM) +test-shared/ # Testcases, grammars, inputs, ANTLR4 comparison + # grammar examples and experiments +cfpq-paths-app/ # Runnable demos and tutorial ``` ### Requirements -- JDK 11+ (toolchain targets 11). + +- JDK 11+ (toolchain targets 11). - Gradle Wrapper included (`./gradlew`). -### Typical workflow -1) **Describe grammar** in Kotlin DSL. -2) **Load graph** (for now `dot` format is supported). -3) **Run query**. -4) **Inspect results**. +### Installation: +* To download the project by **https** enter -## Core Algorithm -UCFS is based on Generalized LL (GLL) parsing algorithm modified to handle language specification in form of Recursive State Machines (RSM-s) and input in form of arbitratry directed edge-labelled graph. Basic ideas described [here](https://arxiv.org/pdf/2312.11925.pdf). \ No newline at end of file +```bash +git clone https://github.com/FormalLanguageConstrainedPathQuerying/UCFS.git +``` + +* To download the project by **ssh** enter: + +```bash +git clone git@github.com:FormalLanguageConstrainedPathQuerying/UCFS.git +``` diff --git a/cfpq-paths-app/tutorial/sppf.md b/docs/docs/sppf.md similarity index 69% rename from cfpq-paths-app/tutorial/sppf.md rename to docs/docs/sppf.md index 6da5e6d2c..19c64a6cf 100644 --- a/cfpq-paths-app/tutorial/sppf.md +++ b/docs/docs/sppf.md @@ -7,28 +7,28 @@ The SPPF consists of several node types. Each node has a unique ID and stores ty * A **non-terminal** node contains the name of a non-terminal and pairs of vertices from the input graph that mark the start and end of paths derived from that non-terminal. - ![Graph for example 1](../src/main/resources/figures/Nonterm_example.dot.svg) + ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot.svg) This node has ID ```0``` and is the root of all derivations for paths from vertex 1 to vertex 4 derivable from non-terminal ```S```. * A **terminal** node is a leaf and corresponds to an edge. - ![Graph for example 1](../src/main/resources/figures/Terminal_example.dot.svg) + ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Terminal_example.dot.svg) This node depicts edge ```3 -alloc-> 4```. * An **epsilon** node represents that $\varepsilon$ is derived at a specific position. - ![Graph for example 1](../src/main/resources/figures/Epsilon_example.dot.svg) + ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot.svg) * A **range** node is a supplementary node that helps reuse subtrees. - ![Graph for example 1](../src/main/resources/figures/Range_example.dot.svg) + ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Range_example.dot.svg) This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. * An **intermediate** node is a supplementary node used to connect subpaths. - ![Graph for example 1](../src/main/resources/figures/Intermediate_example.dot.svg) + ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot.svg) This node indicates that the path from 0 to 2 consists of two parts: from 0 to 1 and from 1 to 2. diff --git a/docs/docs/usage-examples.md b/docs/docs/usage-examples.md new file mode 100644 index 000000000..b00bc370a --- /dev/null +++ b/docs/docs/usage-examples.md @@ -0,0 +1,363 @@ +# Using UCFS with simple examples + +Set the grammar in +```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` + +**Grammar assignment** + +Define the grammar for the language $a^n b^n$: words consisting of $n$ occurrences of $a$ followed by $n$ +occurrences of $b$ (e.g., $ab$, $aabb$, $aaabbb$). +> [!NOTE] +> The grammar can be defined equivalently as follows. +>```kotlin +>class AnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * Option(S) * "b" +> } +>} +>``` +>or +>```kotlin +>class AnBnGrammar : Grammar() { +> val S by Nt().asStart() +> +> init { +> S /= "a" * (Epsilon or S) * "b" +> } +>} +>``` + +A **recursive state machine** ([RSM](https://www.researchgate.net/publication/226965977_Analysis_of_Recursive_State_Machines)) is an automaton-like representation of a context-free grammar. + +The RSM for the $a^n b^n$ grammar: + +![RSM for AnBn Grammar](../../cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot.svg) + +The start non-terminal $S$ expands to either the terminal string $ab$ or the string $aSb$. + +> [!NOTE] +> To confirm this, look at the labels along the edges of the path from the source node (green circle) to the sink node +> (red circle). + +**To run (from project root):** + +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` + +**Example 1: Simple graph with a finite set of paths** + +**Input graph:** + +![Simple AnBn Graph / Finite Set Of Paths](../../cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) + +The following words satisfy the grammar: + +* $ab$ (0 -a-> 1 -b-> 2) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Finite Set Of Paths / SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) + +The SPPF decomposes into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) + +The first tree corresponds to the word $ab$. + +**The *second* tree:** + +![Simple AnBn Graph / Finite Set of Paths / SPPF / 2Tree](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) + +The second tree corresponds to the word $aabb$. + +The result matches the expected language. + +**Example 2: Simple graph with an infinite number of paths #1** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Paths #1](../../cfpq-paths-app/src/main/resources/figures/example_2_graph.dot.svg) + +Examples of words that satisfy the grammar: + +* $ab$ (0 -a-> 1 -b-> 1) +* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) +* ... + +> [!NOTE] +> The language contains infinitely many words of the form $a^nb^n$ where $n$ is odd. + +**Resulting SPPF graph:** + +![Simple AnBn Graph / Infinite Set Of Paths #1 / SPPF](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg) + +> [!NOTE] +> This example shows that although the number of paths is infinite, the SPPF remains finite when a depth limit +> is applied. + +The SPPF decomposes into two trees: + +**The *first* tree:** + +![Simple AnBn Graph / Infinite Set of Paths / SPPF / 1Tree](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) + +The first tree corresponds to the word $ab$. + + + +**The *second* pre-tree:** + +![Simple AnBn Graph / Infinite Set of Paths / SPPF / 2PreTree](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg) + +> [!NOTE] +> The SPPF contains a cycle. The label sequence $aaSbb$ includes the non-terminal $S$, which can be expanded further +> to obtain $aaabbb$, $aaaaabbbbb$, and so on. + +Let's expand the nonterminal to construct the tree. + +**The *second* tree:** + +![Simple AnBn Graph / Infinite Set of Paths/ SPPF / 2Tree](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) + +This tree corresponds to the word $aaabbb$. + +The result matches the expected language. + +**Example 3: Simple graph with an infinite set of paths #2** + +**Input graph:** + +![Simple AnBn Graph / Infinite Set Of Paths #2](../../cfpq-paths-app/src/main/resources/figures/example_3_graph.dot.svg) + +Examples of words that satisfy the grammar: + +* $ab$ (1 -a-> 2 -b-> 3) +* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) +* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) +* ... + +> [!NOTE] +> The graph yields infinitely many words that cover the full language, because it has several start vertices. + +The resulting SPPF is too large to include here; see +```src/main/resources/figures/example_3_graph_sppf.dot.svg``` + +# PointsTo analysis + +The following examples illustrate UCFS on analysis-style graphs. + +**Grammar and code for paths extraction:** ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/Main.kt``` + +**To run (from project root)**: + +```bash +./gradlew :cfpq-paths-app:run +``` + +> [!NOTE] +> Path extraction uses a naive traversal algorithm intended only to demonstrate SPPF traversal. + +Below are code snippets, input graphs, fragments of the resulting SPPFs, and extracted paths. + +The analysis uses the following extended points-to grammar (start non-terminal ```S```) to model field-access chains. + +``` +PointsTo -> ("assign" | ("load_i" Alias "store_i"))* "alloc" +FlowsTo -> "alloc_r" ("assign_r" | ("store_i_r" Alias "load_o_r"))* +Alias -> PointsTo FlowsTo +S -> (Alias? "store_i")* PointsTo +``` + +In all examples below, the grammar uses indices $i \in [0..3]$. +The corresponding RSM: + +![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/rsm.dot.svg) + +## Example 1 + +Code snippet: + +```java +val n = new X() +val y = new Y() +val z = new Z() +val l = n +val t = y +l.u = y +t.v = z +``` + +Corresponding graph: + +![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/graph_1.dot.svg) + +The resulting SPPF: + +![SPPF for example 1](../../cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot.svg) + +Three trees are extracted because there are three paths of interest from node 1. +Subpaths derivable from non-terminals ```Alias``` and ```PointsTo``` are omitted, because they do not contribute +to recovering field assignments. + +Extracted paths: + +* [(1-PointsTo->0)] + + This path is trivial. Such paths will be omitted in further examples. + +* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + This path corresponds to ```n.u = new Y()```. Vertex 2 is an alias of 1 (```n```); the ```store_0``` edge models ```l.u = y```. + +* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] + + This path corresponds to ```n.u.v = new Z()```. + +## Example 2 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + l.next = new X() + l = l.next +} +``` + +Corresponding graph: + +![Graph for example 2](../../cfpq-paths-app/src/main/resources/figures/graph_2.dot.svg) + +Part of the resulting SPPF: + +![SPPF for example 2](../../cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot.svg) + +This fragment contains a cycle on vertices 27–31–34–37–38–40–42–44–47–49–52–56 (shown in red), indicating infinitely +many paths of interest. A sample of extracted paths: + +* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next = new X () // line 4``` + +* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] + + ```n.next.next.next.next.next.next = new X () // line 4``` + +More paths can be extracted if needed. Traversal should be tuned accordingly. + +## Example 3 + +Code snippet: + +```java +val n = new X() +val l = n +while (...){ + val t = new X() + l.next = t + l = t +} +``` + +Corresponding graph: + +![Graph for example 3](../../cfpq-paths-app/src/main/resources/figures/graph_3.dot.svg) + +Part of the resulting SPPF: + +![SPPF for example 3](../../cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot.svg) + +This SPPF also contains a cycle on vertices 3–5–7–11; therefore, infinitely many paths of interest exist. Only a sample +is listed below. + +* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next = new X() // line 4``` + +* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] + + ```n.next.next.next.next.next.next = new X() // line 4``` + +## Example 4 + +Code snippet: + +```java +val n = new X() +val z = new Z() +val u = new U() +z.x = n +u.y = n +val v = z.x +v.p = new Y() +val r = u.y +r.q = new P() +``` + +Corresponding graph: + +![Graph for example 4](../../cfpq-paths-app/src/main/resources/figures/graph_4.dot.svg) + +For this example, the SPPF figure is omitted due to size; only the extracted paths are listed. The query uses two start +vertices: 1 and 8. + +* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```n.q = new P()``` + +* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```n.p = new Y() ``` + +* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] + + ```v.q = new P() ``` + +* [(8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + +* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] + + ```v.p = new Y() ``` + From 1770231165960ceb5741a12da56dc43dffdf9895 Mon Sep 17 00:00:00 2001 From: danisaev Date: Sun, 12 Jul 2026 22:24:22 +0300 Subject: [PATCH 52/71] docs: Some changes --- docs/docs/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/index.md b/docs/docs/index.md index 450667a06..35311d6da 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -42,7 +42,7 @@ class AnBnGrammar : Grammar() { ``` 2) Load the graph -![example_1_graph.dot](cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) +![example_1_graph.dot](../../cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) ```kotlin fun main() { listOf("example_1_graph.dot").forEach { graphName -> @@ -55,11 +55,11 @@ fun main() { } ``` 3) Inspect results from SPPF - ![Results as SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) + ![Results as SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) SPPF contains a compressed representation of set of paths: -![Path 1 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg) -![Path 2 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg) +![Path 1 Extracted From SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg) +![Path 2 Extracted From SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg) > [!NOTE] > At this stage of using UCFS, we get compressed representation of the entire set of extractable paths, and if you need to work with them further, you can add custom From 7f4ef38b52288186d0360db621cb7b4f4f1f9a36 Mon Sep 17 00:00:00 2001 From: danisaev Date: Mon, 13 Jul 2026 12:53:23 +0300 Subject: [PATCH 53/71] docs: Added newline at the end of files --- cfpq-paths-app/build.gradle.kts | 2 +- cfpq-paths-app/src/main/resources/example_1_graph.dot | 2 +- cfpq-paths-app/src/main/resources/example_2_graph.dot | 2 +- cfpq-paths-app/src/main/resources/example_3_graph.dot | 2 +- cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot | 2 +- cfpq-paths-app/src/main/resources/figures/example_1_graph.dot | 3 +-- .../resources/figures/example_1_graph_sppf_1extraction.dot | 2 +- .../resources/figures/example_1_graph_sppf_2extraction.dot | 2 +- cfpq-paths-app/src/main/resources/figures/example_2_graph.dot | 3 +-- .../main/resources/figures/example_2_graph_sppf_2pretree.dot | 2 +- cfpq-paths-app/src/main/resources/figures/example_3_graph.dot | 3 +-- 11 files changed, 11 insertions(+), 14 deletions(-) diff --git a/cfpq-paths-app/build.gradle.kts b/cfpq-paths-app/build.gradle.kts index c83691b5c..fe0b8b087 100644 --- a/cfpq-paths-app/build.gradle.kts +++ b/cfpq-paths-app/build.gradle.kts @@ -24,4 +24,4 @@ tasks.register("runSimpleExamples") { dependsOn("classes") mainClass.set("org.ucfs.paths.examples.Example_1Kt") classpath = sourceSets["main"].runtimeClasspath -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/example_1_graph.dot b/cfpq-paths-app/src/main/resources/example_1_graph.dot index 4b60207ce..39ee35f1c 100644 --- a/cfpq-paths-app/src/main/resources/example_1_graph.dot +++ b/cfpq-paths-app/src/main/resources/example_1_graph.dot @@ -5,4 +5,4 @@ digraph { 1 -> 2 [label = "b"]; 2 -> 1 [label = "b"]; -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/example_2_graph.dot b/cfpq-paths-app/src/main/resources/example_2_graph.dot index a276cb960..cf38e3e01 100644 --- a/cfpq-paths-app/src/main/resources/example_2_graph.dot +++ b/cfpq-paths-app/src/main/resources/example_2_graph.dot @@ -4,4 +4,4 @@ digraph { 1 -> 0 [label = "a"]; 1 -> 1 [label = "b"]; -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/example_3_graph.dot b/cfpq-paths-app/src/main/resources/example_3_graph.dot index 2e845e0ea..f86164df6 100644 --- a/cfpq-paths-app/src/main/resources/example_3_graph.dot +++ b/cfpq-paths-app/src/main/resources/example_3_graph.dot @@ -8,4 +8,4 @@ digraph { 3 -> 2 [label = "b"]; 2 -> 0 [label = "a"]; -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot b/cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot index fe56a9c3e..15e46fa04 100644 --- a/cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot +++ b/cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot @@ -1,3 +1,3 @@ digraph g{ _0_12 [label = "2 Epsilon RSM: S_0, input: [0, 0]", shape = invhouse] -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot index cfd76d1cf..b8dfb79f1 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot @@ -4,5 +4,4 @@ digraph { 1 -> 2 [label = "a"]; 1 -> 2 [label = "b"]; 2 -> 1 [label = "b"]; - -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot index 7f92679b1..021c75ee4 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot @@ -1,4 +1,4 @@ digraph { 0 -> 1 [label = "a"] 1 -> 2 [label = "b"] -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot index 33e923983..8d8359dcc 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot @@ -8,4 +8,4 @@ digraph { 1 -> 2 [label = "a"] 2 -> 3 [label = "b"] 3 -> 4 [label = "b"] -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot index 355c5d683..4b536fd61 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot @@ -3,5 +3,4 @@ digraph { 0 -> 1 [label = "a"]; 1 -> 0 [label = "a"]; 1 -> 1 [label = "b"]; - -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot index 2299b3d38..5c7ac64b7 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot @@ -44,4 +44,4 @@ _0_6->_0_10 _0_7->_0_9 } -} \ No newline at end of file +} diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot b/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot index 6a612f706..cbe93b0d8 100644 --- a/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot +++ b/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot @@ -7,5 +7,4 @@ digraph { 2 -> 3 [label = "b"]; 3 -> 2 [label = "b"]; 2 -> 0 [label = "a"]; - -} \ No newline at end of file +} From 6bca18af1258c433840bd60f3cd1bbe420f514aa Mon Sep 17 00:00:00 2001 From: danisaev Date: Mon, 13 Jul 2026 16:20:05 +0300 Subject: [PATCH 54/71] docs: New folder assets with images created - All .svg files moved to new folder - Changed links to images in docs files and in README.md --- README.md | 8 ++-- .../docs/assets}/AnBnGrammarRsm.dot.svg | 0 .../docs/assets}/Epsilon_example.dot.svg | 0 .../docs/assets}/Intermediate_example.dot.svg | 0 .../docs/assets}/Nonterm_example.dot.svg | 0 .../docs/assets}/Range_example.dot.svg | 0 .../docs/assets}/Terminal_example.dot.svg | 0 .../docs/assets}/example_1_graph.dot.svg | 0 .../docs/assets}/example_1_graph_sppf.dot.svg | 0 .../example_1_graph_sppf_1extraction.dot.svg | 0 .../example_1_graph_sppf_1tree.dot.svg | 0 .../example_1_graph_sppf_2extraction.dot.svg | 0 .../example_1_graph_sppf_2tree.dot.svg | 0 .../docs/assets}/example_2_graph.dot.svg | 0 .../docs/assets}/example_2_graph_sppf.dot.svg | 0 .../example_2_graph_sppf_1tree.dot.svg | 0 .../example_2_graph_sppf_2pretree.dot.svg | 0 .../example_2_graph_sppf_2tree.dot.svg | 0 .../docs/assets}/example_3_graph.dot.svg | 0 .../docs/assets}/example_3_graph_sppf.dot.svg | 0 .../docs/assets}/graph_1.dot.svg | 0 .../docs/assets}/graph_1_sppf.dot.svg | 0 .../docs/assets}/graph_2.dot.svg | 0 .../docs/assets}/graph_2_sppf.dot.svg | 0 .../docs/assets}/graph_3.dot.svg | 0 .../docs/assets}/graph_3_sppf.dot.svg | 0 .../docs/assets}/graph_4.dot.svg | 0 .../docs/assets}/graph_4_sppf.dot.svg | 0 .../figures => docs/docs/assets}/rsm.dot.svg | 0 docs/docs/index.md | 8 ++-- docs/docs/sppf.md | 10 ++--- docs/docs/usage-examples.md | 40 +++++++++---------- 32 files changed, 33 insertions(+), 33 deletions(-) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/AnBnGrammarRsm.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/Epsilon_example.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/Intermediate_example.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/Nonterm_example.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/Range_example.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/Terminal_example.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_1_graph.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_1_graph_sppf.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_1_graph_sppf_1extraction.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_1_graph_sppf_1tree.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_1_graph_sppf_2extraction.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_1_graph_sppf_2tree.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_2_graph.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_2_graph_sppf.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_2_graph_sppf_1tree.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_2_graph_sppf_2pretree.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_2_graph_sppf_2tree.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_3_graph.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/example_3_graph_sppf.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_1.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_1_sppf.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_2.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_2_sppf.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_3.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_3_sppf.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_4.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/graph_4_sppf.dot.svg (100%) rename {cfpq-paths-app/src/main/resources/figures => docs/docs/assets}/rsm.dot.svg (100%) diff --git a/README.md b/README.md index 07a7c44c5..f1df19965 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ class AnBnGrammar : Grammar() { ``` 2) Load the graph -![example_1_graph.dot](cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) +![example_1_graph.dot](docs/docs/assets/example_1_graph.dot.svg) ```kotlin fun main() { listOf("example_1_graph.dot").forEach { graphName -> @@ -55,11 +55,11 @@ fun main() { } ``` 3) Inspect results from SPPF -![Results as SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) +![Results as SPPF](docs/docs/assets/example_1_graph_sppf.dot.svg) SPPF contains a compressed representation of set of paths: -![Path 1 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg) -![Path 2 Extracted From SPPF](cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg) +![Path 1 Extracted From SPPF](docs/docs/assets/example_1_graph_sppf_1extraction.dot.svg) +![Path 2 Extracted From SPPF](docs/docs/assets/example_1_graph_sppf_2extraction.dot.svg) > [!NOTE] > At this stage of using UCFS, we get compressed representation of the entire set of extractable paths, and if you need to work with them further, you can add custom diff --git a/cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot.svg b/docs/docs/assets/AnBnGrammarRsm.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot.svg rename to docs/docs/assets/AnBnGrammarRsm.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot.svg b/docs/docs/assets/Epsilon_example.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot.svg rename to docs/docs/assets/Epsilon_example.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot.svg b/docs/docs/assets/Intermediate_example.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot.svg rename to docs/docs/assets/Intermediate_example.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot.svg b/docs/docs/assets/Nonterm_example.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot.svg rename to docs/docs/assets/Nonterm_example.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/Range_example.dot.svg b/docs/docs/assets/Range_example.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/Range_example.dot.svg rename to docs/docs/assets/Range_example.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/Terminal_example.dot.svg b/docs/docs/assets/Terminal_example.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/Terminal_example.dot.svg rename to docs/docs/assets/Terminal_example.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg b/docs/docs/assets/example_1_graph.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg rename to docs/docs/assets/example_1_graph.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg b/docs/docs/assets/example_1_graph_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg rename to docs/docs/assets/example_1_graph_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg b/docs/docs/assets/example_1_graph_sppf_1extraction.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg rename to docs/docs/assets/example_1_graph_sppf_1extraction.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg b/docs/docs/assets/example_1_graph_sppf_1tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg rename to docs/docs/assets/example_1_graph_sppf_1tree.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg b/docs/docs/assets/example_1_graph_sppf_2extraction.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg rename to docs/docs/assets/example_1_graph_sppf_2extraction.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg b/docs/docs/assets/example_1_graph_sppf_2tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg rename to docs/docs/assets/example_1_graph_sppf_2tree.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph.dot.svg b/docs/docs/assets/example_2_graph.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_2_graph.dot.svg rename to docs/docs/assets/example_2_graph.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg b/docs/docs/assets/example_2_graph_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg rename to docs/docs/assets/example_2_graph_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg b/docs/docs/assets/example_2_graph_sppf_1tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg rename to docs/docs/assets/example_2_graph_sppf_1tree.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg b/docs/docs/assets/example_2_graph_sppf_2pretree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg rename to docs/docs/assets/example_2_graph_sppf_2pretree.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg b/docs/docs/assets/example_2_graph_sppf_2tree.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg rename to docs/docs/assets/example_2_graph_sppf_2tree.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph.dot.svg b/docs/docs/assets/example_3_graph.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_3_graph.dot.svg rename to docs/docs/assets/example_3_graph.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg b/docs/docs/assets/example_3_graph_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/example_3_graph_sppf.dot.svg rename to docs/docs/assets/example_3_graph_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_1.dot.svg b/docs/docs/assets/graph_1.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_1.dot.svg rename to docs/docs/assets/graph_1.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot.svg b/docs/docs/assets/graph_1_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot.svg rename to docs/docs/assets/graph_1_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_2.dot.svg b/docs/docs/assets/graph_2.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_2.dot.svg rename to docs/docs/assets/graph_2.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot.svg b/docs/docs/assets/graph_2_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot.svg rename to docs/docs/assets/graph_2_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_3.dot.svg b/docs/docs/assets/graph_3.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_3.dot.svg rename to docs/docs/assets/graph_3.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot.svg b/docs/docs/assets/graph_3_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot.svg rename to docs/docs/assets/graph_3_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_4.dot.svg b/docs/docs/assets/graph_4.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_4.dot.svg rename to docs/docs/assets/graph_4.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/graph_4_sppf.dot.svg b/docs/docs/assets/graph_4_sppf.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/graph_4_sppf.dot.svg rename to docs/docs/assets/graph_4_sppf.dot.svg diff --git a/cfpq-paths-app/src/main/resources/figures/rsm.dot.svg b/docs/docs/assets/rsm.dot.svg similarity index 100% rename from cfpq-paths-app/src/main/resources/figures/rsm.dot.svg rename to docs/docs/assets/rsm.dot.svg diff --git a/docs/docs/index.md b/docs/docs/index.md index 35311d6da..e047e465f 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -42,7 +42,7 @@ class AnBnGrammar : Grammar() { ``` 2) Load the graph -![example_1_graph.dot](../../cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) +![example_1_graph.dot](assets/example_1_graph.dot.svg) ```kotlin fun main() { listOf("example_1_graph.dot").forEach { graphName -> @@ -55,11 +55,11 @@ fun main() { } ``` 3) Inspect results from SPPF - ![Results as SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) + ![Results as SPPF](assets/example_1_graph_sppf.dot.svg) SPPF contains a compressed representation of set of paths: -![Path 1 Extracted From SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1extraction.dot.svg) -![Path 2 Extracted From SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2extraction.dot.svg) +![Path 1 Extracted From SPPF](assets/example_1_graph_sppf_1extraction.dot.svg) +![Path 2 Extracted From SPPF](assets/example_1_graph_sppf_2extraction.dot.svg) > [!NOTE] > At this stage of using UCFS, we get compressed representation of the entire set of extractable paths, and if you need to work with them further, you can add custom diff --git a/docs/docs/sppf.md b/docs/docs/sppf.md index 19c64a6cf..d96e772fe 100644 --- a/docs/docs/sppf.md +++ b/docs/docs/sppf.md @@ -7,28 +7,28 @@ The SPPF consists of several node types. Each node has a unique ID and stores ty * A **non-terminal** node contains the name of a non-terminal and pairs of vertices from the input graph that mark the start and end of paths derived from that non-terminal. - ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Nonterm_example.dot.svg) + ![Graph for example 1](assets/Nonterm_example.dot.svg) This node has ID ```0``` and is the root of all derivations for paths from vertex 1 to vertex 4 derivable from non-terminal ```S```. * A **terminal** node is a leaf and corresponds to an edge. - ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Terminal_example.dot.svg) + ![Graph for example 1](assets/Terminal_example.dot.svg) This node depicts edge ```3 -alloc-> 4```. * An **epsilon** node represents that $\varepsilon$ is derived at a specific position. - ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Epsilon_example.dot.svg) + ![Graph for example 1](assets/Epsilon_example.dot.svg) * A **range** node is a supplementary node that helps reuse subtrees. - ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Range_example.dot.svg) + ![Graph for example 1](assets/Range_example.dot.svg) This node represents all subpaths from 0 to 4 that are accepted while the RSM transitions from ```S_0``` to ```S_2```. * An **intermediate** node is a supplementary node used to connect subpaths. - ![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/Intermediate_example.dot.svg) + ![Graph for example 1](assets/Intermediate_example.dot.svg) This node indicates that the path from 0 to 2 consists of two parts: from 0 to 1 and from 1 to 2. diff --git a/docs/docs/usage-examples.md b/docs/docs/usage-examples.md index b00bc370a..e2dae892a 100644 --- a/docs/docs/usage-examples.md +++ b/docs/docs/usage-examples.md @@ -33,7 +33,7 @@ A **recursive state machine** ([RSM](https://www.researchgate.net/publication/22 The RSM for the $a^n b^n$ grammar: -![RSM for AnBn Grammar](../../cfpq-paths-app/src/main/resources/figures/AnBnGrammarRsm.dot.svg) +![RSM for AnBn Grammar](assets/AnBnGrammarRsm.dot.svg) The start non-terminal $S$ expands to either the terminal string $ab$ or the string $aSb$. @@ -51,7 +51,7 @@ The start non-terminal $S$ expands to either the terminal string $ab$ or the str **Input graph:** -![Simple AnBn Graph / Finite Set Of Paths](../../cfpq-paths-app/src/main/resources/figures/example_1_graph.dot.svg) +![Simple AnBn Graph / Finite Set Of Paths](assets/example_1_graph.dot.svg) The following words satisfy the grammar: @@ -60,19 +60,19 @@ The following words satisfy the grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Finite Set Of Paths / SPPF](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf.dot.svg) +![Simple AnBn Graph / Finite Set Of Paths / SPPF](assets/example_1_graph_sppf.dot.svg) The SPPF decomposes into two trees: **The *first* tree:** -![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_1tree.dot.svg) +![Simple AnBn Graph / Finite Set of Paths / SPPF / 1Tree](assets/example_1_graph_sppf_1tree.dot.svg) The first tree corresponds to the word $ab$. **The *second* tree:** -![Simple AnBn Graph / Finite Set of Paths / SPPF / 2Tree](../../cfpq-paths-app/src/main/resources/figures/example_1_graph_sppf_2tree.dot.svg) +![Simple AnBn Graph / Finite Set of Paths / SPPF / 2Tree](assets/example_1_graph_sppf_2tree.dot.svg) The second tree corresponds to the word $aabb$. @@ -82,7 +82,7 @@ The result matches the expected language. **Input graph:** -![Simple AnBn Graph / Infinite Set Of Paths #1](../../cfpq-paths-app/src/main/resources/figures/example_2_graph.dot.svg) +![Simple AnBn Graph / Infinite Set Of Paths #1](assets/example_2_graph.dot.svg) Examples of words that satisfy the grammar: @@ -95,7 +95,7 @@ Examples of words that satisfy the grammar: **Resulting SPPF graph:** -![Simple AnBn Graph / Infinite Set Of Paths #1 / SPPF](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf.dot.svg) +![Simple AnBn Graph / Infinite Set Of Paths #1 / SPPF](assets/example_2_graph_sppf.dot.svg) > [!NOTE] > This example shows that although the number of paths is infinite, the SPPF remains finite when a depth limit @@ -105,7 +105,7 @@ The SPPF decomposes into two trees: **The *first* tree:** -![Simple AnBn Graph / Infinite Set of Paths / SPPF / 1Tree](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_1tree.dot.svg) +![Simple AnBn Graph / Infinite Set of Paths / SPPF / 1Tree](assets/example_2_graph_sppf_1tree.dot.svg) The first tree corresponds to the word $ab$. @@ -113,7 +113,7 @@ The first tree corresponds to the word $ab$. **The *second* pre-tree:** -![Simple AnBn Graph / Infinite Set of Paths / SPPF / 2PreTree](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2pretree.dot.svg) +![Simple AnBn Graph / Infinite Set of Paths / SPPF / 2PreTree](assets/example_2_graph_sppf_2pretree.dot.svg) > [!NOTE] > The SPPF contains a cycle. The label sequence $aaSbb$ includes the non-terminal $S$, which can be expanded further @@ -123,7 +123,7 @@ Let's expand the nonterminal to construct the tree. **The *second* tree:** -![Simple AnBn Graph / Infinite Set of Paths/ SPPF / 2Tree](../../cfpq-paths-app/src/main/resources/figures/example_2_graph_sppf_2tree.dot.svg) +![Simple AnBn Graph / Infinite Set of Paths/ SPPF / 2Tree](assets/example_2_graph_sppf_2tree.dot.svg) This tree corresponds to the word $aaabbb$. @@ -133,7 +133,7 @@ The result matches the expected language. **Input graph:** -![Simple AnBn Graph / Infinite Set Of Paths #2](../../cfpq-paths-app/src/main/resources/figures/example_3_graph.dot.svg) +![Simple AnBn Graph / Infinite Set Of Paths #2](assets/example_3_graph.dot.svg) Examples of words that satisfy the grammar: @@ -146,7 +146,7 @@ Examples of words that satisfy the grammar: > The graph yields infinitely many words that cover the full language, because it has several start vertices. The resulting SPPF is too large to include here; see -```src/main/resources/figures/example_3_graph_sppf.dot.svg``` +```docs/docs/assets/example_3_graph_sppf.dot.svg``` # PointsTo analysis @@ -177,7 +177,7 @@ S -> (Alias? "store_i")* PointsTo In all examples below, the grammar uses indices $i \in [0..3]$. The corresponding RSM: -![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/rsm.dot.svg) +![Graph for example 1](assets/rsm.dot.svg) ## Example 1 @@ -195,11 +195,11 @@ t.v = z Corresponding graph: -![Graph for example 1](../../cfpq-paths-app/src/main/resources/figures/graph_1.dot.svg) +![Graph for example 1](assets/graph_1.dot.svg) The resulting SPPF: -![SPPF for example 1](../../cfpq-paths-app/src/main/resources/figures/graph_1_sppf.dot.svg) +![SPPF for example 1](assets/graph_1_sppf.dot.svg) Three trees are extracted because there are three paths of interest from node 1. Subpaths derivable from non-terminals ```Alias``` and ```PointsTo``` are omitted, because they do not contribute @@ -234,11 +234,11 @@ while (...){ Corresponding graph: -![Graph for example 2](../../cfpq-paths-app/src/main/resources/figures/graph_2.dot.svg) +![Graph for example 2](assets/graph_2.dot.svg) Part of the resulting SPPF: -![SPPF for example 2](../../cfpq-paths-app/src/main/resources/figures/graph_2_sppf.dot.svg) +![SPPF for example 2](assets/graph_2_sppf.dot.svg) This fragment contains a cycle on vertices 27–31–34–37–38–40–42–44–47–49–52–56 (shown in red), indicating infinitely many paths of interest. A sample of extracted paths: @@ -285,11 +285,11 @@ while (...){ Corresponding graph: -![Graph for example 3](../../cfpq-paths-app/src/main/resources/figures/graph_3.dot.svg) +![Graph for example 3](assets/graph_3.dot.svg) Part of the resulting SPPF: -![SPPF for example 3](../../cfpq-paths-app/src/main/resources/figures/graph_3_sppf.dot.svg) +![SPPF for example 3](assets/graph_3_sppf.dot.svg) This SPPF also contains a cycle on vertices 3–5–7–11; therefore, infinitely many paths of interest exist. Only a sample is listed below. @@ -336,7 +336,7 @@ r.q = new P() Corresponding graph: -![Graph for example 4](../../cfpq-paths-app/src/main/resources/figures/graph_4.dot.svg) +![Graph for example 4](assets/graph_4.dot.svg) For this example, the SPPF figure is omitted due to size; only the extracted paths are listed. The query uses two start vertices: 1 and 8. From 8c30bc4d26cea477bfe63b0c23119b1d42ca3841 Mon Sep 17 00:00:00 2001 From: ShelokaevGrigoriy Date: Sun, 22 Mar 2026 22:11:10 +0300 Subject: [PATCH 55/71] ci: add test workflow, rename ci.yml to ci-docs.yml --- .github/workflows/{ci.yaml => ci-docs.yaml} | 0 .github/workflows/ci-tests.yaml | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+) rename .github/workflows/{ci.yaml => ci-docs.yaml} (100%) create mode 100644 .github/workflows/ci-tests.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci-docs.yaml similarity index 100% rename from .github/workflows/ci.yaml rename to .github/workflows/ci-docs.yaml diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml new file mode 100644 index 000000000..bebd015a1 --- /dev/null +++ b/.github/workflows/ci-tests.yaml @@ -0,0 +1,19 @@ +name: Run tests +on: + push: + pull_request: +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '11' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + - name: Run tests + run: ./gradlew test \ No newline at end of file From 1a94a126e73ec25168ebeec9310dbdc95c716cde Mon Sep 17 00:00:00 2001 From: ShelokaevGrigoriy Date: Fri, 3 Apr 2026 17:40:33 +0300 Subject: [PATCH 56/71] ci build: restructure test infrastructure, add coverage reporting and GitHub Packages publishing Test coverage: - Add JaCoCo plugin to solver and generator modules with html/xml/csv reports - Set coverage thresholds per module (instructions 95%, lines 80%, branches 80%) - Fix executionData/classDirectories for jacocoTestCoverageVerification - Rename JaCoCo XML reports for code-coverage-summary-action compatibility - Remove coverage report generation from test-shared module CI: - Update GitHub Actions versions across workflows - Rename ci-tests to ci-test-infrastructure - Configure code-coverage-summary-action, remove unnecessary parameters Publishing: - Add maven-publish plugin to solver and generator for GitHub Packages - Replace per-module publishing with single fat jar via publisher module - Switch to thin jar with auto-generated POM - Add axion-release-plugin for versioning Chore: - Mark DotParser test as @Disabled for CI stability Extract test coverage reporting functionality to root build.gradle.kts --- .github/workflows/ci-test-infrastructure.yaml | 29 ++++++++ .github/workflows/ci-tests.yaml | 19 ----- build.gradle.kts | 69 +++++++++++++++++++ generator/build.gradle.kts | 5 +- solver/build.gradle.kts | 8 ++- solver/src/test/kotlin/TestDotParser.kt | 6 +- test-shared/build.gradle.kts | 8 ++- 7 files changed, 116 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/ci-test-infrastructure.yaml delete mode 100644 .github/workflows/ci-tests.yaml create mode 100644 build.gradle.kts diff --git a/.github/workflows/ci-test-infrastructure.yaml b/.github/workflows/ci-test-infrastructure.yaml new file mode 100644 index 000000000..b00755746 --- /dev/null +++ b/.github/workflows/ci-test-infrastructure.yaml @@ -0,0 +1,29 @@ +name: Run tests and test coverage +on: + push: + pull_request: + workflow_dispatch: +permissions: + contents: read +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Set up JDK 11 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '11' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + - name: Run tests + run: ./gradlew --no-daemon solver:jacocoTestCoverageVerification generator:jacocoTestCoverageVerification + + - name: Prepare JaCoCo files for summary action + run: | + cp solver/build/reports/jacoco/test/jacocoTestReport.xml solver/build/reports/jacoco/testCodeCoverageReport.xml + cp generator/build/reports/jacoco/test/jacocoTestReport.xml generator/build/reports/jacoco/testCodeCoverageReport.xml + - name: Summarize tests results + uses: jeantessier/code-coverage-summary-action@v1 diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml deleted file mode 100644 index bebd015a1..000000000 --- a/.github/workflows/ci-tests.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Run tests -on: - push: - pull_request: -permissions: - contents: read -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '11' - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Run tests - run: ./gradlew test \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 000000000..0a8ff43ff --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,69 @@ +plugins { + id("java") + id("jacoco") + id("jacoco-report-aggregation") + kotlin("jvm") version "1.9.20" apply false + kotlin("plugin.allopen") version "1.9.20" apply false +} + +jacoco { + toolVersion = "0.8.14" +} + +repositories { + mavenCentral() +} + +dependencies { + jacocoAggregation(project(":solver")) + jacocoAggregation(project(":generator")) + jacocoAggregation(project(":test-shared")) +} + +tasks.testCodeCoverageReport { + reports { + xml.required.set(true) + html.required.set(true) + csv.required.set(true) + } + classDirectories.setFrom(classDirectories.filter { !it.path.contains("test-shared") }) +} + +tasks.jacocoTestCoverageVerification { + dependsOn(tasks.testCodeCoverageReport) + + executionData.setFrom(tasks.testCodeCoverageReport.map { it.executionData }) + sourceDirectories.setFrom(tasks.testCodeCoverageReport.map { it.sourceDirectories }) + classDirectories.setFrom(tasks.testCodeCoverageReport.map { it.classDirectories }) + + violationRules { + rule { + isEnabled = true + limit { + counter = "INSTRUCTION" + value = "COVEREDRATIO" + minimum = "0.95".toBigDecimal() + } + limit { + counter = "BRANCH" + value = "COVEREDRATIO" + minimum = "0.80".toBigDecimal() + } + limit { + counter = "LINE" + value = "COVEREDRATIO" + minimum = "0.80".toBigDecimal() + } + limit { + counter = "METHOD"; + value = "COVEREDRATIO" + minimum = "0.85".toBigDecimal() + } + limit { + counter = "CLASS" + value = "COVEREDRATIO" + minimum = "0.90".toBigDecimal() + } + } + } +} diff --git a/generator/build.gradle.kts b/generator/build.gradle.kts index 133781def..4dc989d59 100644 --- a/generator/build.gradle.kts +++ b/generator/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "1.9.20" + kotlin("jvm") } repositories { @@ -15,6 +15,7 @@ dependencies { tasks.test { useJUnitPlatform() } + kotlin { jvmToolchain(11) -} \ No newline at end of file +} diff --git a/solver/build.gradle.kts b/solver/build.gradle.kts index c234a8ef2..2c2472919 100644 --- a/solver/build.gradle.kts +++ b/solver/build.gradle.kts @@ -1,7 +1,7 @@ plugins { java - kotlin("jvm") version "1.9.20" - kotlin("plugin.allopen") version "1.9.20" + kotlin("jvm") + kotlin("plugin.allopen") } repositories { @@ -25,4 +25,6 @@ dependencies { kotlin { jvmToolchain(11) } -tasks.test { useJUnitPlatform() } \ No newline at end of file +tasks.test { + useJUnitPlatform() +} diff --git a/solver/src/test/kotlin/TestDotParser.kt b/solver/src/test/kotlin/TestDotParser.kt index d8b74ffe0..0716ea641 100644 --- a/solver/src/test/kotlin/TestDotParser.kt +++ b/solver/src/test/kotlin/TestDotParser.kt @@ -1,3 +1,4 @@ +import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Test import org.ucfs.input.DotParser import org.ucfs.input.InputGraph @@ -8,6 +9,7 @@ import java.nio.file.Path import kotlin.test.assertEquals class TestDotParser { + @Disabled("DotWriter drops quotes around label values during serialization") @Test fun testParser(){ val testCasesFolder = File(Path.of("src", "test", "resources", "dotParserTest").toUri()) @@ -20,6 +22,4 @@ class TestDotParser { assertEquals(originalDot, DotWriter().getDotView(graph)) } } - - -} \ No newline at end of file +} diff --git a/test-shared/build.gradle.kts b/test-shared/build.gradle.kts index 5c9a2c88b..cd3bdd8b6 100644 --- a/test-shared/build.gradle.kts +++ b/test-shared/build.gradle.kts @@ -1,5 +1,10 @@ plugins { - kotlin("jvm") version "1.9.20" + kotlin("jvm") + jacoco +} + +jacoco{ + toolVersion = "0.8.14" } group = "org.pl" @@ -38,6 +43,7 @@ tasks.test { "-Dwrite_case_time=$write_case_time" ) } + kotlin { jvmToolchain(11) } \ No newline at end of file From ddc68eddcf5dcd5734ca84b28d610fc7790ceb53 Mon Sep 17 00:00:00 2001 From: ShelokaevGrigoriy Date: Thu, 9 Jul 2026 21:59:34 +0300 Subject: [PATCH 57/71] ci: restructure test workflow and configure GitHub Packages publishing CI: - Replace action with more suitable one in 'Run tests and test coverage' workflow - Reorder workflow steps for better execution flow - Add test step and --stacktrace to publishing workflow Publishing: - Configure automatic jar publishing to GitHub Packages on new version release - Replace per-module publishing with single fat jar via publisher module - Switch publisher to thin jar with auto-generated POM Chore: - Fork publishing config: URL, version 0.1.0, PUBLISH_TOKEN - Lowercase artifactId, bump to version 0.2.0 - Restore clean state: original URL, unspecified version, uncomment test --- .../workflows/ci-publishing-jar-files.yaml | 26 +++++++++++++ .github/workflows/ci-test-infrastructure.yaml | 22 +++++++---- .gitignore | 2 + build.gradle.kts | 38 ++++++++++++++++++- 4 files changed, 78 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/ci-publishing-jar-files.yaml diff --git a/.github/workflows/ci-publishing-jar-files.yaml b/.github/workflows/ci-publishing-jar-files.yaml new file mode 100644 index 000000000..be91868d7 --- /dev/null +++ b/.github/workflows/ci-publishing-jar-files.yaml @@ -0,0 +1,26 @@ +name: Publish package to GitHub Packages +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout repository + uses: actions/checkout@v6 + - name: Setup JDK 11 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: '11' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v6 + - name: Run tests + run: ./gradlew test + - name: Publish package + run: ./gradlew publish --stacktrace + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci-test-infrastructure.yaml b/.github/workflows/ci-test-infrastructure.yaml index b00755746..069db75df 100644 --- a/.github/workflows/ci-test-infrastructure.yaml +++ b/.github/workflows/ci-test-infrastructure.yaml @@ -4,6 +4,7 @@ on: pull_request: workflow_dispatch: permissions: + pull-requests: write contents: read jobs: test: @@ -18,12 +19,17 @@ jobs: java-version: '11' - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - - name: Run tests - run: ./gradlew --no-daemon solver:jacocoTestCoverageVerification generator:jacocoTestCoverageVerification + - name: Run tests and verify coverage + run: ./gradlew --no-daemon testCodeCoverageReport + + - name: Add coverage to PR + id: jacoco + uses: madrapps/jacoco-report@v1.8.0 + with: + paths: ${{ github.workspace }}/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml + token: ${{ secrets.GITHUB_TOKEN }} + min-coverage-overall: 95 + min-coverage-changed-lines: 0 - - name: Prepare JaCoCo files for summary action - run: | - cp solver/build/reports/jacoco/test/jacocoTestReport.xml solver/build/reports/jacoco/testCodeCoverageReport.xml - cp generator/build/reports/jacoco/test/jacocoTestReport.xml generator/build/reports/jacoco/testCodeCoverageReport.xml - - name: Summarize tests results - uses: jeantessier/code-coverage-summary-action@v1 + - name: Verify coverage + run: ./gradlew jacocoTestCoverageVerification diff --git a/.gitignore b/.gitignore index 4be53026b..e170044a1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ *.log *.logs +bin/ + .gradle !gradle/wrapper/gradle-wrapper.jar **/build/ diff --git a/build.gradle.kts b/build.gradle.kts index 0a8ff43ff..3dd8011f2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,10 +2,13 @@ plugins { id("java") id("jacoco") id("jacoco-report-aggregation") - kotlin("jvm") version "1.9.20" apply false - kotlin("plugin.allopen") version "1.9.20" apply false + kotlin("jvm") version "2.4.0" apply false + kotlin("plugin.allopen") version "2.4.0" apply false + id("maven-publish") + id("pl.allegro.tech.build.axion-release") version "1.21.2" } +// Part of test code coverage report jacoco { toolVersion = "0.8.14" } @@ -67,3 +70,34 @@ tasks.jacocoTestCoverageVerification { } } } + +// Part of publishing + +group = "org.ucfs" + +version = scmVersion.version + +evaluationDependsOnChildren() + +publishing { + publications { + create("solver") { + artifactId = "solver" + from(project(":solver").components.getByName("java")) + } + create("generator") { + artifactId = "generator" + from(project(":generator").components.getByName("java")) + } + } + repositories { + maven { + name = "GitHubPackages" + url = uri("https://maven.pkg.github.com/FormalLanguageConstrainedPathQuerying/UCFS") + credentials { + username = System.getenv("GITHUB_ACTOR") + password = System.getenv("GITHUB_TOKEN") + } + } + } +} From fc11cc5915f8c7827db003c833b98645c9cdc7eb Mon Sep 17 00:00:00 2001 From: ShelokaevGrigoriy Date: Thu, 9 Jul 2026 22:04:21 +0300 Subject: [PATCH 58/71] chore: upgrade Gradle to version 9.6.1 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72b8..a351597e6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME From 500e92542f66c68d019f94553f63e1d87425bed9 Mon Sep 17 00:00:00 2001 From: ShelokaevGrigoriy Date: Fri, 10 Jul 2026 01:49:54 +0300 Subject: [PATCH 59/71] chore: upgrade Java to 21 version --- .github/workflows/ci-publishing-jar-files.yaml | 2 +- .github/workflows/ci-test-infrastructure.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-publishing-jar-files.yaml b/.github/workflows/ci-publishing-jar-files.yaml index be91868d7..b75c6516a 100644 --- a/.github/workflows/ci-publishing-jar-files.yaml +++ b/.github/workflows/ci-publishing-jar-files.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/setup-java@v5 with: distribution: 'temurin' - java-version: '11' + java-version: '21' - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - name: Run tests diff --git a/.github/workflows/ci-test-infrastructure.yaml b/.github/workflows/ci-test-infrastructure.yaml index 069db75df..8f14dab5a 100644 --- a/.github/workflows/ci-test-infrastructure.yaml +++ b/.github/workflows/ci-test-infrastructure.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/setup-java@v5 with: distribution: 'temurin' - java-version: '11' + java-version: '21' - name: Setup Gradle uses: gradle/actions/setup-gradle@v6 - name: Run tests and verify coverage From e5ae71766fc2da7c278e8a355bbbc20eb5094b6c Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 18:14:24 +0300 Subject: [PATCH 60/71] chore: fix kotlin plugin in cfpq-paths-app module --- cfpq-paths-app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfpq-paths-app/build.gradle.kts b/cfpq-paths-app/build.gradle.kts index fe0b8b087..520b97317 100644 --- a/cfpq-paths-app/build.gradle.kts +++ b/cfpq-paths-app/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "2.3.0" + kotlin("jvm") application } From 2e7e2fb82d1f1554c45e217d4b68740fc53c98b9 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 18:19:39 +0300 Subject: [PATCH 61/71] docs: remove bad link to mathjax in config --- docs/mkdocs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 4cbe86a6e..114e9ea36 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -16,5 +16,4 @@ markdown_extensions: extra_javascript: - - javascripts/mathjax.js - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js From 57e4360ea1d0883b19c8ee27b85c08476bd07980 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 19:26:15 +0300 Subject: [PATCH 62/71] docs: add agent-ready documentation for developers and AI agents - Add AGENTS.md with project overview, module structure, build commands, and conventions - Add dev/ARCHITECTURE.md with module dependencies, data flow, and design decisions - Add dev/DEVELOPMENT.md with local setup, build/test commands, and MkDocs guide - Add CONTRIBUTING.md with contribution workflow and coding standards - Add CHANGELOG.md in Keep a Changelog format - Add CODE_OF_CONDUCT.md (Contributor Covenant 2.1) - Enhance README.md with badges, table of contents, and documentation links - Replace ASCII diagrams with Mermaid for GitHub rendering --- .gitignore | 5 +- AGENTS.md | 119 ++++++++++++++++++++++++++++++++++ CHANGELOG.md | 21 ++++++ CODE_OF_CONDUCT.md | 62 ++++++++++++++++++ CONTRIBUTING.md | 89 ++++++++++++++++++++++++++ README.md | 38 +++++++++-- dev/ARCHITECTURE.md | 97 ++++++++++++++++++++++++++++ dev/DEVELOPMENT.md | 152 ++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 577 insertions(+), 6 deletions(-) create mode 100644 AGENTS.md create mode 100644 CHANGELOG.md create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 dev/ARCHITECTURE.md create mode 100644 dev/DEVELOPMENT.md diff --git a/.gitignore b/.gitignore index e170044a1..16f945467 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Tests output +./test-shared/gen/ + # Log file *.log *.logs @@ -30,4 +33,4 @@ bin/ !/benchmarks/src/main/java/org/ucfs/scanner/*.flex ### Large datasets ### -/benchmarks/src/test/resources/java/correct/* \ No newline at end of file +/benchmarks/src/test/resources/java/correct/* diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..6e590ba33 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,119 @@ +# AGENTS.md + +This file helps AI agents understand and work with the UCFS codebase. + +## Project Overview + +**UCFS** (Universal Context-Free Solver) is a Kotlin library that performs context-free path querying on edge-labeled directed graphs using a modified GLL (Generalized LL) parsing algorithm with Recursive State Machines (RSM). + +**Key capabilities:** +- Parse arbitrary directed graphs against context-free grammars +- Produce SPPF (Shared Packed Parse Forest) — compact representation of all matching paths +- Support for grammar definition via Kotlin DSL +- DOT graph format support + +## Module Structure + +| Module | Description | +|--------|-------------| +| `solver/` | Core library — GLL parser, RSM, grammar DSL, SPPF, input graph | +| `generator/` | Code generator built on solver — AST extraction, parser generation | +| `test-shared/` | Shared test infrastructure, dynamic tests, ANTLR4 comparison | +| `cfpq-paths-app/` | Runnable demo application with examples | + +### Module Dependencies + +```mermaid +graph TD + Solver[solver] + Generator[generator] --> Solver + TestShared[test-shared] --> Solver + TestShared --> Generator + App[cfpq-paths-app] --> Solver +``` + +## Build System + +- **Tool:** Gradle with Kotlin DSL (`build.gradle.kts`) +- **Wrapper:** `./gradlew` included, no local Gradle install needed +- **JDK:** 11+ (toolchain configured in each module) +- **Kotlin:** 2.4.0 + +### Essential Commands + +```bash +./gradlew build # Build all modules +./gradlew test # Run all tests +./gradlew testCodeCoverageReport # Generate coverage report (HTML + XML) +./gradlew jacocoTestCoverageVerification # Verify coverage thresholds +./gradlew :cfpq-paths-app:runSimpleExamples # Run demo examples +``` + +### Coverage Thresholds + +| Counter | Minimum | +|---------|---------| +| Instruction | 95% | +| Branch | 80% | +| Line | 80% | +| Method | 85% | +| Class | 90% | + +## Code Conventions + +- **Style:** `kotlin.code.style=official` (set in `gradle.properties`) +- **Package root:** `org.ucfs` for all modules +- **Naming:** PascalCase for classes, camelCase for functions/properties +- **Testing:** JUnit 5 with `useJUnitPlatform()` + +## Documentation Conventions + +- **Structured over ASCII:** Use Mermaid diagrams (`graph TD`, `flowchart LR`) and tables instead of ASCII art or text-based schemas — they render natively on GitHub +- **Unified style:** All documentation follows a consistent structure: purpose → prerequisites → content → cross-references +- **Developer docs:** Place in `dev/` directory; user-facing docs go to `docs/docs/` + +## Key Source Files + +| File | Purpose | +|------|---------| +| `solver/.../parser/Gll.kt` | Main GLL parser implementation | +| `solver/.../grammar/combinator/Grammar.kt` | Grammar DSL base class | +| `solver/.../rsm/RsmState.kt` | RSM state representation | +| `solver/.../gss/GraphStructuredStack.kt` | GSS data structure for GLL | +| `solver/.../sppf/SppfStorage.kt` | SPPF node management | +| `solver/.../input/InputGraph.kt` | Input graph representation | +| `generator/.../ast/AstExtractor.kt` | AST extraction from SPPF | + +## Key Abstractions + +- **`Grammar`** — DSL base class; users extend it to define CFGs +- **`RsmState`** — Recursive State Machine state; grammar compiles to RSM +- **`Gll`** — Parser that runs RSM against input graph +- **`IInputGraph`** — Generic graph interface with vertices and labeled edges +- **`RangeSppfNode`** — SPPF node representing a range of matched input +- **`Descriptor`** — Processing unit in GLL: (position, GSS node, RSM state, SPPF node) + +## Data Flow + +```mermaid +flowchart LR + Grammar[User Grammar DSL] --> RSM[RSM] + RSM --> GLL[Gll.parse] + GLL --> SPPF[SPPF] + SPPF --> Results[Path extraction / AST] + Graph[Input Graph DOT/code] --> GLL +``` + +## CI/CD + +Three GitHub Actions workflows: +- `ci-test-infrastructure.yaml` — Tests + JaCoCo coverage on push/PR +- `ci-docs.yaml` — MkDocs site deployment +- `ci-publishing-jar-files.yaml` — Maven package publishing to GitHub Packages + +## Documentation + +- **User docs:** `docs/docs/` (MkDocs, deployed to GitHub Pages) +- **Developer docs:** `dev/` directory + - `dev/ARCHITECTURE.md` — Detailed architecture overview + - `dev/DEVELOPMENT.md` — Local development setup guide diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..1f6bd0cd9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +- Developer documentation in `dev/` directory +- `AGENTS.md` for AI-assisted development +- `ARCHITECTURE.md` with module and data flow overview +- `DEVELOPMENT.md` with local setup guide +- `CONTRIBUTING.md` with contribution guidelines +- `CODE_OF_CONDUCT.md` + +### Changed + +- Enhanced `README.md` with badges and improved structure diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..ca69a9190 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,62 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity +and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the + overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at the project +maintainers. All complaints will be reviewed and investigated promptly and +fairly. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), +version 2.1, available at +https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..a570da7ce --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,89 @@ +# Contributing to UCFS + +Thank you for your interest in contributing! This document provides guidelines for contributing to the project. + +## Getting Started + +1. Fork the repository +2. Clone your fork locally +3. Set up the development environment (see `dev/DEVELOPMENT.md`) +4. Create a feature branch from `main` + +## Development Workflow + +### Before You Start + +- Check existing issues and pull requests to avoid duplicate work +- For significant changes, open an issue to discuss the approach first + +### Making Changes + +1. Create a descriptive branch name: `feature/description`, `fix/description`, `docs/description` +2. Make focused, logical commits +3. Follow the coding conventions (see below) +4. Ensure all tests pass and coverage thresholds are met +5. Update documentation if your change affects public API or user-facing behavior + +### Commit Messages + +Use conventional commit format: + +``` +type(scope): short description + +Optional body with more details. +``` + +**Types:** `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` + +**Examples:** +- `feat(solver): add support for epsilon transitions` +- `fix(gss): handle cycle detection in GSS pop` +- `docs: update grammar DSL examples` + +### Pull Requests + +1. Update `CHANGELOG.md` with your change under the "Unreleased" section +2. Ensure CI passes (tests + coverage verification) +3. Provide a clear description of what and why +4. Reference related issues if applicable + +## Coding Conventions + +- **Kotlin style:** Official style (`kotlin.code.style=official`) +- **Package naming:** `org.ucfs.` for all modules +- **Class naming:** PascalCase +- **Function/property naming:** camelCase +- **Test naming:** Backtick strings with descriptive names: `` `should do something` `` + +## Code Quality Requirements + +All changes must meet these coverage thresholds: + +| Counter | Minimum | +|---------|---------| +| Instruction | 95% | +| Branch | 80% | +| Line | 80% | +| Method | 85% | +| Class | 90% | + +Run locally before pushing: +```bash +./gradlew testCodeCoverageReport jacocoTestCoverageVerification +``` + +## Project Structure + +- `solver/` — Core parsing library +- `generator/` — Code generation utilities +- `test-shared/` — Shared test infrastructure +- `cfpq-paths-app/` — Demo application +- `docs/` — User documentation (MkDocs) +- `dev/` — Developer documentation + +See `dev/ARCHITECTURE.md` for detailed architecture overview. + +## Questions? + +If you have questions, open an issue with the "question" label. diff --git a/README.md b/README.md index f1df19965..5bbc00fc0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # UCFS +[![CI](https://github.com/FormalLanguageConstrainedPathQuerying/UCFS/actions/workflows/ci-test-infrastructure.yaml/badge.svg)](https://github.com/FormalLanguageConstrainedPathQuerying/UCFS/actions/workflows/ci-test-infrastructure.yaml) +[![License](https://img.shields.io/github/license/FormalLanguageConstrainedPathQuerying/UCFS)](LICENSE) +[![Kotlin](https://img.shields.io/badge/kotlin-2.4.0-blue.svg?logo=kotlin)](https://kotlinlang.org) +[![JDK](https://img.shields.io/badge/JDK-11%2B-orange.svg?logo=openjdk)](https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html) + > Note: project under heavy development! Please, see [documentation](https://formallanguageconstrainedpathquerying.github.io/UCFS/) for details. @@ -7,19 +12,28 @@ Please, see [documentation](https://formallanguageconstrainedpathquerying.github ## What is UCFS? UCFS is an **U**niversal **C**ontext-**F**ree **S**olver: a GLL‑based tool for problems at the intersection of -context‑free languages -over edge‑labeled directed graphs. Examples of such problems: +context‑free languages over edge‑labeled directed graphs. Examples of such problems: - Parsing - Context-free path querying (CFPQ) - Context-free language reachability (CFL-R) -- static code analysis +- Static code analysis **Highlights** * Kotlin implementation with a concise Grammar DSL (EBNF‑friendly). * Input: arbitrary edge‑labeled directed graphs. -* Output: SPPF -- finite structure for all‑paths queries. +* Output: SPPF — finite structure for all‑paths queries. + +## Table of Contents + +- [Quick Start](#quick-start) +- [Core Algorithm](#core-algorithm) +- [Repository Layout](#repository-layout-high-level) +- [Requirements](#requirements) +- [Installation](#installation) +- [Documentation](#documentation) +- [Contributing](#contributing) ### Typical workflow @@ -86,7 +100,7 @@ cfpq-paths-app/ # Runnable demos and tutorial - JDK 11+ (toolchain targets 11). - Gradle Wrapper included (`./gradlew`). -### Installation: +## Installation * To download the project by **https** enter @@ -99,3 +113,17 @@ git clone https://github.com/FormalLanguageConstrainedPathQuerying/UCFS.git ```bash git clone git@github.com:FormalLanguageConstrainedPathQuerying/UCFS.git ``` + +## Documentation + +- [User Guide](https://formallanguageconstrainedpathquerying.github.io/UCFS/) — Grammar DSL, SPPF, graph formats, usage examples +- [Architecture](dev/ARCHITECTURE.md) — Module structure, data flow, key abstractions +- [Development Guide](dev/DEVELOPMENT.md) — Local setup, build commands, running examples + +## Contributing + +We welcome contributions! Please see: + +- [Contributing Guidelines](CONTRIBUTING.md) +- [Code of Conduct](CODE_OF_CONDUCT.md) +- [Changelog](CHANGELOG.md) diff --git a/dev/ARCHITECTURE.md b/dev/ARCHITECTURE.md new file mode 100644 index 000000000..0450e170a --- /dev/null +++ b/dev/ARCHITECTURE.md @@ -0,0 +1,97 @@ +# Architecture + +## Overview + +UCFS implements a modified GLL (Generalized LL) parsing algorithm that operates on arbitrary edge-labeled directed graphs instead of linear text input. The grammar is specified as a context-free grammar and compiled into a Recursive State Machine (RSM), which drives the parser. + +## Module Architecture + +### solver/ + +The core library containing all parsing infrastructure. + +**Packages:** + +| Package | Responsibility | +|---------|---------------| +| `grammar.combinator` | Grammar DSL — `Grammar`, `Nt`, `Term`, operators (`*`, `or`, `many`, `opt`) | +| `rsm` | Recursive State Machine — `RsmState`, `Symbol`, `Nonterminal`, `Term` | +| `parser` | GLL engine — `Gll`, `IGll`, `Context`, `ParsingException` | +| `gss` | Graph Structured Stack — `GraphStructuredStack`, `GssNode`, `GssEdge` | +| `sppf` | Shared Packed Parse Forest — `SppfStorage`, `RangeSppfNode`, serialization | +| `input` | Input graph model — `InputGraph`, `Edge`, `ILabel`, DOT parsing | +| `descriptors` | Processing descriptors — `Descriptor`, `DescriptorsStorage` | +| `intersection` | RSM-graph intersection engine — `IntersectionEngine`, `IIntersectionEngine` | + +### generator/ + +Code generation layer built on top of solver. Generates Kotlin AST node classes and parser code from grammar definitions. + +**Packages:** + +| Package | Responsibility | +|---------|---------------| +| `ast` | AST extraction, node class generation, DOT writing for AST | +| `parser` | Parser generators — `ParserGenerator`, `ScanerlessParserGenerator`, `RecoveryParserGenerator` | +| `examples` | Grammar examples (Dyck language, simple Go) | + +### test-shared/ + +Shared test infrastructure with dynamic test generation and ANTLR4 comparison tests. + +### cfpq-paths-app/ + +Runnable demonstration application showing UCFS usage patterns. + +## Data Flow + +```mermaid +flowchart LR + Grammar[User Grammar DSL] --> RSM[RSM] + RSM --> GLL[Gll.parse] + GLL --> SPPF[SPPF] + SPPF --> Results[Path extraction / AST] + Graph[Input Graph DOT/code] --> GLL +``` + +### Step-by-step + +1. **Grammar definition** — User extends `Grammar` class, declares non-terminals with `Nt()`, defines rules using DSL operators +2. **RSM compilation** — `Grammar.rsm` property triggers lazy RSM construction: each non-terminal builds its RSM box, a fictitious start state wraps the user's start +3. **Graph loading** — Input graph is loaded from DOT file or built programmatically +4. **GLL parsing** — `Gll.gll(startState, graph)` creates parser; `parse()` runs the algorithm: + - Descriptors are processed through the intersection engine + - GSS manages active parsing contexts + - SPPF accumulates match results +5. **Result extraction** — SPPF contains compact representation of all matching paths; can be serialized to DOT or traversed for AST extraction + +## Key Design Decisions + +### Generic Input Graph + +The `IInputGraph` interface is fully generic, allowing: +- Any vertex type (Int, String, custom objects) +- Any label type implementing `ILabel` +- Multiple start vertices for multi-source path queries + +### Lazy RSM Construction + +RSM is built lazily on first access to `Grammar.rsm`. This allows grammar definition and compilation to be separated, and enables inspection of grammar structure before compilation. + +### SPPF over Parse Trees + +SPPF provides a compact, shared representation of all possible parses. For ambiguous grammars or graphs with cycles, this avoids exponential blowup that would occur with individual parse trees. + +### Intersection Engine + +The `IntersectionEngine` handles the product construction between RSM states and graph edges, enabling efficient exploration of the combined state space. + +## External Dependencies + +| Dependency | Module | Purpose | +|-----------|--------|---------| +| kotlinx-cli | solver | CLI utilities | +| kotlin-logging-jvm | solver | Structured logging | +| ANTLR4 | solver | DOT grammar parsing | +| slf4j + logback | solver | Logging implementation | +| KotlinPoet | generator | Kotlin code generation | diff --git a/dev/DEVELOPMENT.md b/dev/DEVELOPMENT.md new file mode 100644 index 000000000..37ab9db11 --- /dev/null +++ b/dev/DEVELOPMENT.md @@ -0,0 +1,152 @@ +# Development Guide + +## Prerequisites + +- **JDK 11+** (Gradle toolchain will manage version) +- **Git** +- No local Gradle installation required — use the included wrapper + +## Initial Setup + +```bash +git clone https://github.com/FormalLanguageConstrainedPathQuerying/UCFS.git +cd UCFS +``` + +## Build Commands + +### Build + +```bash +./gradlew build +``` + +Compiles all modules and runs tests. + +### Test + +```bash +./gradlew test +``` + +Runs all unit tests across all modules. + +### Coverage + +```bash +./gradlew testCodeCoverageReport +``` + +Generates JaCoCo coverage report. Output: +- HTML: `build/reports/jacoco/testCodeCoverageReport/index.html` +- XML: `build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml` + +### Verify Coverage Thresholds + +```bash +./gradlew jacocoTestCoverageVerification +``` + +Checks that coverage meets minimum thresholds (95% instruction, 80% branch/line, 85% method, 90% class). + +## Running Examples + +The `cfpq-paths-app` module contains runnable examples: + +```bash +./gradlew :cfpq-paths-app:runSimpleExamples +``` + +Or run the main application: + +```bash +./gradlew :cfpq-paths-app:run +``` + +## Module-Specific Commands + +```bash +./gradlew :solver:test # Tests for solver module only +./gradlew :generator:test # Tests for generator module only +./gradlew :test-shared:test # Tests for test-shared module only +``` + +## IDE Setup + +### IntelliJ IDEA + +1. Open the project root directory +2. IntelliJ will detect Gradle project automatically +3. Ensure JDK 11+ is selected in Project Structure → SDKs + +## Writing Tests + +Tests use JUnit 5. Place tests in `src/test/kotlin/` following the same package structure as main source. + +Example test structure: +```kotlin +import org.junit.jupiter.api.Test +import kotlin.test.assertEquals + +class MyTest { + @Test + fun `test description`() { + // test body + } +} +``` + +## Publishing + +Jars are published to GitHub Packages via CI workflow. Local publishing: + +```bash +./gradlew publishToMavenLocal +``` + +Requires `GITHUB_ACTOR` and `GitHub_TOKEN` environment variables for remote publishing. + +## Documentation + +User documentation is built with MkDocs. + +### Setup + +1. Navigate to the `docs/` directory: + ```bash + cd docs + ``` + +2. Create a virtual environment: + ```bash + python3 -m venv venv + ``` + +3. Activate the virtual environment: + ```bash + source venv/bin/activate + ``` + +4. Install MkDocs and required dependencies: + ```bash + pip install mkdocs mkdocs-material pymdown-extensions + ``` + +### Serve Locally + +```bash +./run.sh +``` + +Or manually: +```bash +mkdocs serve --livereload +``` + +### Build Site + +```bash +mkdocs build +``` + +Output is placed in `docs/site/`. From 1730a727bc467b78b17684c55d18b8f90464520f Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 19:34:18 +0300 Subject: [PATCH 63/71] docs: add guide for writing user documentation --- dev/USER-DOCS.md | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 dev/USER-DOCS.md diff --git a/dev/USER-DOCS.md b/dev/USER-DOCS.md new file mode 100644 index 000000000..5cd69c210 --- /dev/null +++ b/dev/USER-DOCS.md @@ -0,0 +1,113 @@ +# Writing User Documentation + +This guide describes conventions for writing user-facing documentation in `docs/docs/`. + +## Purpose + +User documentation helps external users understand and use UCFS without reading source code. It covers: +- What UCFS is and what problems it solves +- How to define grammars, graphs, and run queries +- How to interpret results (SPPF) +- Worked examples with real input/output + +## Prerequisites + +- Read existing docs in `docs/docs/` to understand current style. +- Familiarity with MkDocs and Material theme. + +## Structure + +``` +docs/ +├── mkdocs.yml # Site configuration and navigation +├── run.sh # Local dev server: `bash docs/run.sh` +└── docs/ + ├── index.md # Landing page — overview, quick start, installation + ├── dsl.md # Grammar DSL reference + ├── graphs.md # Graph input formats + ├── sppf.md # SPPF node types and reading results + ├── usage-examples.md # Worked examples with diagrams + └── assets/ # SVG diagrams and images +``` + +## Conventions + +### Markdown + +- **Headings:** ATX style (`#`, `##`, `###`), one space after `#`. +- **Lists:** Use `*` for unordered lists, consistent 2-space indentation. +- **Code blocks:** Always specify language (`kotlin`, `bash`, `dot`). +- **Inline code:** Backtick-wrapped for identifiers, flags, file paths. +- **Math:** Use `$...$` for inline math and `$$...$$` for display math (MathJax via arithmatex). +- **Admonitions:** GitHub/Flavored syntax: + ```markdown + > [!NOTE] + > Important information. + ``` + +### Cross-references + +- Internal links use relative paths: `[link text](./other-file.md)` +- External links use full URLs with descriptive text, not bare URLs. + +### Diagrams + +- **Format:** SVG only, placed in `docs/docs/assets/`. +- **Naming:** Descriptive, snake_case, with context (e.g., `example_1_graph_sppf.dot.svg`). +- **Embedding:** Reference from markdown with `![Alt text](assets/filename.svg)`. +- **Alt text:** Brief description of what the diagram shows. + +### Code Examples + +- Show complete, runnable snippets when possible. +- Include the file path where the example lives in the codebase: + ```markdown + Set the grammar in + ```cfpq-paths-app/src/main/kotlin/org.ucfs.paths/examples/example_1.kt``` + ``` +- For terminal commands, always specify the working directory: + ```markdown + **To run (from project root):** + ```bash + ./gradlew :cfpq-paths-app:runSimpleExamples + ``` + ``` + +### Tone and Style + +- **Direct:** Address the reader with imperative instructions ("Define the grammar", "Run the query"). +- **Concise:** One idea per paragraph. Avoid filler sentences. +- **Mathematical notation:** Use LaTeX for formal definitions ($L$, $\varepsilon$, $A \to a$). +- **Structured over ASCII:** Prefer tables, lists, and Mermaid diagrams over text-based schemas. + +### Navigation + +Update `mkdocs.yml` when adding new pages: + +```yaml +nav: + - Home: index.md + - DSL: dsl.md + - Graphs: graphs.md + - SPPF: sppf.md + - Examples: usage-examples.md + - New Page: new-page.md +``` + +## Workflow + +1. Write content in `docs/docs/.md`. +2. Place assets in `docs/docs/assets/`. +3. Update `mkdocs.yml` navigation if adding a new page. +4. Preview locally: + ```bash + bash docs/run.sh + ``` +5. Verify all links resolve and images render. + +## Anti-patterns + +- **Don't** duplicate content between pages — use cross-references instead. +- **Don't** embed large ASCII diagrams — use SVG or Mermaid. +- **Don't** reference internal API without explaining what it does for the user. +- **Don't** omit the working directory for shell commands. From 705589ef77caeda7dd5095181191e4196d207ba6 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 19:45:54 +0300 Subject: [PATCH 64/71] docs(dev): add path representation rule to user docs guide --- dev/USER-DOCS.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dev/USER-DOCS.md b/dev/USER-DOCS.md index 5cd69c210..11259b7e9 100644 --- a/dev/USER-DOCS.md +++ b/dev/USER-DOCS.md @@ -57,6 +57,27 @@ docs/ - **Embedding:** Reference from markdown with `![Alt text](assets/filename.svg)`. - **Alt text:** Brief description of what the diagram shows. +### Paths + +Represent paths using TeX `\xrightarrow{}` notation, **not** ASCII edge lists. + +**Correct:** +```markdown +$0 \xrightarrow{a} 1 \xrightarrow{b} 2$ +$1 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ +``` + +**Incorrect:** +```markdown +(0 -a-> 1 -b-> 2) +[(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] +``` + +Rules: +- Simple labels: `\xrightarrow{a}` +- Multi-word labels: `\xrightarrow{\text{PointsTo}}` +- Labels with subscripts: `\xrightarrow{\text{store}_0}` + ### Code Examples - Show complete, runnable snippets when possible. @@ -110,4 +131,5 @@ nav: - **Don't** duplicate content between pages — use cross-references instead. - **Don't** embed large ASCII diagrams — use SVG or Mermaid. - **Don't** reference internal API without explaining what it does for the user. +- **Don't** use ASCII edge lists like `[(v-label->u)]` — always use TeX `$\xrightarrow{}$`. - **Don't** omit the working directory for shell commands. From 651b94383b1d0a48d8e3ade26af15cda06e347aa Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 19:45:56 +0300 Subject: [PATCH 65/71] docs: replace ASCII edge lists with TeX \xrightarrow{} notation --- docs/docs/usage-examples.md | 94 ++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/docs/docs/usage-examples.md b/docs/docs/usage-examples.md index e2dae892a..cc1fb6d93 100644 --- a/docs/docs/usage-examples.md +++ b/docs/docs/usage-examples.md @@ -55,8 +55,8 @@ The start non-terminal $S$ expands to either the terminal string $ab$ or the str The following words satisfy the grammar: -* $ab$ (0 -a-> 1 -b-> 2) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 1 -b-> 2) +* $ab$ — $0 \xrightarrow{a} 1 \xrightarrow{b} 2$ +* $aabb$ — $0 \xrightarrow{a} 1 \xrightarrow{a} 2 \xrightarrow{b} 1 \xrightarrow{b} 2$ **Resulting SPPF graph:** @@ -86,8 +86,8 @@ The result matches the expected language. Examples of words that satisfy the grammar: -* $ab$ (0 -a-> 1 -b-> 1) -* $aaabbb$ (0 -a-> 1 -a-> 0 -a-> 1 -b-> 1 -b-> 1 -b-> 1) +* $ab$ — $0 \xrightarrow{a} 1 \xrightarrow{b} 1$ +* $aaabbb$ — $0 \xrightarrow{a} 1 \xrightarrow{a} 0 \xrightarrow{a} 1 \xrightarrow{b} 1 \xrightarrow{b} 1 \xrightarrow{b} 1$ * ... > [!NOTE] @@ -137,9 +137,9 @@ The result matches the expected language. Examples of words that satisfy the grammar: -* $ab$ (1 -a-> 2 -b-> 3) -* $aabb$ (0 -a-> 1 -a-> 2 -b-> 3 -b-> 2) -* $aaabbb$ (2 -a-> 0 -a-> 1 -a-> 2 -b-> 3 -b-> 2 -b-> 3) +* $ab$ — $1 \xrightarrow{a} 2 \xrightarrow{b} 3$ +* $aabb$ — $0 \xrightarrow{a} 1 \xrightarrow{a} 2 \xrightarrow{b} 3 \xrightarrow{b} 2$ +* $aaabbb$ — $2 \xrightarrow{a} 0 \xrightarrow{a} 1 \xrightarrow{a} 2 \xrightarrow{b} 3 \xrightarrow{b} 2 \xrightarrow{b} 3$ * ... > [!NOTE] @@ -207,17 +207,17 @@ to recovering field assignments. Extracted paths: -* [(1-PointsTo->0)] +* $1 \xrightarrow{\text{PointsTo}} 0$ - This path is trivial. Such paths will be omitted in further examples. + This path is trivial. Such paths will be omitted in further examples. -* [(1-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* $1 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ - This path corresponds to ```n.u = new Y()```. Vertex 2 is an alias of 1 (```n```); the ```store_0``` edge models ```l.u = y```. + This path corresponds to ```n.u = new Y()```. Vertex 2 is an alias of 1 (```n```); the ```store_0``` edge models ```l.u = y```. -* [(1-Alias->2), (2-store_0->3), (3-Alias->5), (5-store_1->6), (6-PointsTo->7)] +* $1 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 5 \xrightarrow{\text{store}_1} 6 \xrightarrow{\text{PointsTo}} 7$ - This path corresponds to ```n.u.v = new Z()```. + This path corresponds to ```n.u.v = new Z()```. ## Example 2 @@ -243,29 +243,29 @@ Part of the resulting SPPF: This fragment contains a cycle on vertices 27–31–34–37–38–40–42–44–47–49–52–56 (shown in red), indicating infinitely many paths of interest. A sample of extracted paths: -* [(0-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* $0 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ - ```n.next = new X () // line 4``` + ```n.next = new X () // line 4``` -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* $0 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ - ```n.next.next = new X () // line 4``` + ```n.next.next = new X () // line 4``` -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* $0 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ - ```n.next.next.next = new X () // line 4``` + ```n.next.next.next = new X () // line 4``` -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* $0 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ - ```n.next.next.next.next = new X () // line 4``` + ```n.next.next.next.next = new X () // line 4``` -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* $0 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ - ```n.next.next.next.next.next = new X () // line 4``` + ```n.next.next.next.next.next = new X () // line 4``` -* [(0-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-Alias->2), (2-store_0->3), (3-PointsTo->4)] +* $0 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{Alias}} 2 \xrightarrow{\text{store}_0} 3 \xrightarrow{\text{PointsTo}} 4$ - ```n.next.next.next.next.next.next = new X () // line 4``` + ```n.next.next.next.next.next.next = new X () // line 4``` More paths can be extracted if needed. Traversal should be tuned accordingly. @@ -294,29 +294,29 @@ Part of the resulting SPPF: This SPPF also contains a cycle on vertices 3–5–7–11; therefore, infinitely many paths of interest exist. Only a sample is listed below. -* [(0-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* $0 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{PointsTo}} 3$ - ```n.next = new X() // line 4``` + ```n.next = new X() // line 4``` -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* $0 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{PointsTo}} 3$ - ```n.next.next = new X() // line 4``` + ```n.next.next = new X() // line 4``` -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* $0 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{PointsTo}} 3$ - ```n.next.next.next = new X() // line 4``` + ```n.next.next.next = new X() // line 4``` -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* $0 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{PointsTo}} 3$ - ```n.next.next.next.next = new X() // line 4``` + ```n.next.next.next.next = new X() // line 4``` -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* $0 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{PointsTo}} 3$ - ```n.next.next.next.next.next = new X() // line 4``` + ```n.next.next.next.next.next = new X() // line 4``` -* [(0-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-Alias->1), (1-store_0->2), (2-PointsTo->3)] +* $0 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{Alias}} 1 \xrightarrow{\text{store}_0} 2 \xrightarrow{\text{PointsTo}} 3$ - ```n.next.next.next.next.next.next = new X() // line 4``` + ```n.next.next.next.next.next.next = new X() // line 4``` ## Example 4 @@ -341,23 +341,23 @@ Corresponding graph: For this example, the SPPF figure is omitted due to size; only the extracted paths are listed. The query uses two start vertices: 1 and 8. -* [(1-Alias->9), (9-store_3->11), (11-PointsTo->13)] +* $1 \xrightarrow{\text{Alias}} 9 \xrightarrow{\text{store}_3} 11 \xrightarrow{\text{PointsTo}} 13$ - ```n.q = new P()``` + ```n.q = new P()``` -* [(1-Alias->8), (8-store_2->10), (10-PointsTo->12)] +* $1 \xrightarrow{\text{Alias}} 8 \xrightarrow{\text{store}_2} 10 \xrightarrow{\text{PointsTo}} 12$ - ```n.p = new Y() ``` + ```n.p = new Y() ``` -* [(8-Alias->9), (9-store_3->11), (11-PointsTo->13)] +* $8 \xrightarrow{\text{Alias}} 9 \xrightarrow{\text{store}_3} 11 \xrightarrow{\text{PointsTo}} 13$ - ```v.q = new P() ``` + ```v.q = new P() ``` -* [(8-store_2->10), (10-PointsTo->12)] +* $8 \xrightarrow{\text{store}_2} 10 \xrightarrow{\text{PointsTo}} 12$ - ```v.p = new Y() ``` + ```v.p = new Y() ``` -* [(8-Alias->8), (8-store_2->10), (10-PointsTo->12)] +* $8 \xrightarrow{\text{Alias}} 8 \xrightarrow{\text{store}_2} 10 \xrightarrow{\text{PointsTo}} 12$ - ```v.p = new Y() ``` + ```v.p = new Y() ``` From 0c0b7316d5cc572f511f00fc76b2e8cc60d029b3 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 19:53:33 +0300 Subject: [PATCH 66/71] docs: add documentation-first policy rule for agents --- AGENTS.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 6e590ba33..728e3881c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -72,6 +72,15 @@ graph TD - **Unified style:** All documentation follows a consistent structure: purpose → prerequisites → content → cross-references - **Developer docs:** Place in `dev/` directory; user-facing docs go to `docs/docs/` +## Agent Workflow Rules + +> **Documentation-first policy:** Any structural or behavioral change must be reflected in the agent documentation *before* implementation. + +1. Update relevant files in `dev/` (and `AGENTS.md`) to reflect the intended change +2. **Ask the user to approve the documentation changes** +3. Only after approval, commit the documentation changes +4. Then implement the actual code changes + ## Key Source Files | File | Purpose | From ce5a4b7081b0a5c778647928195530baf19f4075 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Tue, 14 Jul 2026 23:04:41 +0300 Subject: [PATCH 67/71] fix: correct Temr typo and add explicit nav to mkdocs.yml --- docs/docs/dsl.md | 2 +- docs/mkdocs.yml | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/docs/dsl.md b/docs/docs/dsl.md index 330c1f00a..03468222a 100644 --- a/docs/docs/dsl.md +++ b/docs/docs/dsl.md @@ -74,7 +74,7 @@ val B = Term(42) ``` * Terminals are compared based on their content value. * Initialization: - * * as fields of grammar class, can be reused `val a = Temr("A")`; + * * as fields of grammar class, can be reused `val a = Term("A")`; * * directly in production `BA \= Term("B") * Term("A")`. * Strings can be handled without wrapping. For instance, `digit \= "1" or "0"`. diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 114e9ea36..bbb722d1e 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -1,5 +1,11 @@ site_name: Universal Context-Free Solver site_url: https://formallanguageconstrainedpathquerying.github.io/UCFS/ +nav: + - Home: index.md + - DSL: dsl.md + - Graphs: graphs.md + - SPPF: sppf.md + - Examples: usage-examples.md theme: name: material From d51741d3749219405489693d3751c14824a65d28 Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 15 Jul 2026 00:34:27 +0300 Subject: [PATCH 68/71] refactor: unify DSL repetition operators to lowercase functions - Remove unused Regexp.many extension property - Make Many constructor internal (factory functions only) - Rename Option() -> option() for consistent naming - Fix undefined Some() -> some() in Java8 grammar - Update all call sites and documentation --- README.md | 2 +- .../src/main/kotlin/org/ucfs/paths/Main.kt | 4 +- .../org/ucfs/paths/examples/example_1.kt | 4 +- docs/docs/dsl.md | 4 +- docs/docs/index.md | 2 +- docs/docs/usage-examples.md | 2 +- .../org/ucfs/examples/golang/SimpleGolang.kt | 4 +- .../combinator/extension/StringExtension.kt | 2 +- .../grammar/combinator/regexp/Alternative.kt | 2 +- .../ucfs/grammar/combinator/regexp/Many.kt | 10 +- test-shared/gen/ABGrammarRsm | 35 +++ test-shared/gen/AmbiguousAStar1GrammarRsm | 11 + test-shared/gen/AmbiguousAStar2GrammarRsm | 14 ++ test-shared/gen/AmbiguousAStar3GrammarRsm | 17 ++ test-shared/gen/BipartitleGrammarRsm | 32 +++ test-shared/gen/CAliasGrammarRsm | 66 ++++++ test-shared/gen/EpsilonGrammarRsm | 7 + test-shared/gen/LoopDyckGrammarRsm | 14 ++ test-shared/gen/SALangGrammarRsm | 28 +++ test-shared/gen/SimplifiedDyckGrammarRsm | 16 ++ test-shared/gen/StrangeDyckGrammarRsm | 17 ++ test-shared/gen/dyckAlphaGrammarKParityRsm | 64 ++++++ test-shared/gen/dyckBetaGrammarKParityRsm | 64 ++++++ .../grammars_example/GrammarsExample.kt | 4 +- .../LoopDyckGrammarTest/LoopDyckGrammar.kt | 2 +- .../LoopDyckGrammarTest/LoopDyckGrammar.kt | 2 +- .../SimplifiedDyckGrammar.kt | 2 +- .../grammars/g1/ScanerlessGrammarDsl.kt | 6 +- .../grammars/geo/ScanerlessGrammarDsl.kt | 4 +- .../resources/grammars/java8/GrammarDsll.kt | 208 +++++++++--------- .../simple_golang/ScanerlessGrammarDsl.kt | 4 +- 31 files changed, 517 insertions(+), 136 deletions(-) create mode 100644 test-shared/gen/ABGrammarRsm create mode 100644 test-shared/gen/AmbiguousAStar1GrammarRsm create mode 100644 test-shared/gen/AmbiguousAStar2GrammarRsm create mode 100644 test-shared/gen/AmbiguousAStar3GrammarRsm create mode 100644 test-shared/gen/BipartitleGrammarRsm create mode 100644 test-shared/gen/CAliasGrammarRsm create mode 100644 test-shared/gen/EpsilonGrammarRsm create mode 100644 test-shared/gen/LoopDyckGrammarRsm create mode 100644 test-shared/gen/SALangGrammarRsm create mode 100644 test-shared/gen/SimplifiedDyckGrammarRsm create mode 100644 test-shared/gen/StrangeDyckGrammarRsm create mode 100644 test-shared/gen/dyckAlphaGrammarKParityRsm create mode 100644 test-shared/gen/dyckBetaGrammarKParityRsm diff --git a/README.md b/README.md index 5bbc00fc0..cea90c66e 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ class AnBnGrammar : Grammar() { val S by Nt().asStart() init { - S /= "a" * Option(S) * "b" + S /= "a" * option(S) * "b" } } ``` diff --git a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/Main.kt b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/Main.kt index 9c36d45f6..3c3fa4c8e 100644 --- a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/Main.kt +++ b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/Main.kt @@ -4,7 +4,7 @@ import org.ucfs.grammar.combinator.Grammar import org.ucfs.grammar.combinator.extension.StringExtension.or import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt -import org.ucfs.grammar.combinator.regexp.Option +import org.ucfs.grammar.combinator.regexp.option import org.ucfs.grammar.combinator.regexp.many import org.ucfs.grammar.combinator.regexp.or import org.ucfs.input.DotParser @@ -31,7 +31,7 @@ class PointsToGrammar : Grammar() { init { Alias /= PointsTo * FlowsTo - S /= many( Option(Alias) * ("store_0" or "store_1" or "store_2" or "store_3")) * PointsTo + S /= many( option(Alias) * ("store_0" or "store_1" or "store_2" or "store_3")) * PointsTo } } diff --git a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt index bea85a42f..b5bd2a63d 100644 --- a/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt +++ b/cfpq-paths-app/src/main/kotlin/org/ucfs/paths/examples/example_1.kt @@ -3,7 +3,7 @@ package org.ucfs.paths.examples import org.ucfs.grammar.combinator.Grammar import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt -import org.ucfs.grammar.combinator.regexp.Option +import org.ucfs.grammar.combinator.regexp.option import org.ucfs.input.DotParser import org.ucfs.input.InputGraph import org.ucfs.input.TerminalInputLabel @@ -17,7 +17,7 @@ class AnBnGrammar : Grammar() { val S by Nt().asStart() init { - S /= "a" * Option(S) * "b" + S /= "a" * option(S) * "b" } } diff --git a/docs/docs/dsl.md b/docs/docs/dsl.md index 03468222a..104b83f1d 100644 --- a/docs/docs/dsl.md +++ b/docs/docs/dsl.md @@ -88,7 +88,7 @@ val B = Term(42) | Alternatve | A \| B | A or B | | Kleene Star | $A^*$ | many(A) | | Kleene Star+ | $A^+$ | some(A) | -| Optional | A \| $\varepsilon$
A? | opt(A) | +| Optional | A \| $\varepsilon$
A? | option(A) | Epsilon ($\varepsilon$) - constant terminal with behavior corresponding to the empty string. @@ -155,7 +155,7 @@ Grammar for this language can be described in various ways. ```kotlin class AStar : Grammar() { var A = Term("a") - val S by Nt().asStart(many(A)) + val S by Nt(many(A)).asStart() } ``` or diff --git a/docs/docs/index.md b/docs/docs/index.md index e047e465f..949a365a5 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -36,7 +36,7 @@ class AnBnGrammar : Grammar() { val S by Nt().asStart() init { - S /= "a" * Option(S) * "b" + S /= "a" * option(S) * "b" } } ``` diff --git a/docs/docs/usage-examples.md b/docs/docs/usage-examples.md index cc1fb6d93..6b9e8d534 100644 --- a/docs/docs/usage-examples.md +++ b/docs/docs/usage-examples.md @@ -14,7 +14,7 @@ occurrences of $b$ (e.g., $ab$, $aabb$, $aaabbb$). > val S by Nt().asStart() > > init { -> S /= "a" * Option(S) * "b" +> S /= "a" * option(S) * "b" > } >} >``` diff --git a/generator/src/main/kotlin/org/ucfs/examples/golang/SimpleGolang.kt b/generator/src/main/kotlin/org/ucfs/examples/golang/SimpleGolang.kt index 59bb2217f..d542ddfd2 100644 --- a/generator/src/main/kotlin/org/ucfs/examples/golang/SimpleGolang.kt +++ b/generator/src/main/kotlin/org/ucfs/examples/golang/SimpleGolang.kt @@ -3,13 +3,13 @@ package org.ucfs.examples.golang import org.ucfs.grammar.combinator.Grammar import org.ucfs.grammar.combinator.extension.StringExtension.or import org.ucfs.grammar.combinator.extension.StringExtension.times -import org.ucfs.grammar.combinator.regexp.Many +import org.ucfs.grammar.combinator.regexp.many import org.ucfs.grammar.combinator.regexp.Nt import org.ucfs.grammar.combinator.regexp.or class SimpleGolang : Grammar() { val IntExpr by Nt("1" or "1" * "+" * "1") val Statement by Nt(IntExpr * ";" or "r" * IntExpr * ";") - val Block by Nt(Many(Statement)) + val Block by Nt(many(Statement)) val Program by Nt(Block).asStart() } diff --git a/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt b/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt index 8b4154f9e..98146e22b 100644 --- a/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt +++ b/solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt @@ -24,6 +24,6 @@ object StringExtension { fun many(some: String): Regexp { return many(Term(some)) } - fun Option(exp: String) = Alternative.makeAlternative(Epsilon, Term(exp)) + fun option(exp: String) = Alternative.makeAlternative(Epsilon, Term(exp)) } \ No newline at end of file diff --git a/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Alternative.kt b/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Alternative.kt index 4ad84b6e7..868ae3cfc 100644 --- a/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Alternative.kt +++ b/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Alternative.kt @@ -30,4 +30,4 @@ data class Alternative( infix fun Regexp.or(other: Regexp): Regexp = Alternative.makeAlternative(left = this, other) -fun Option(exp: Regexp) = Alternative.makeAlternative(Epsilon, exp) \ No newline at end of file +fun option(exp: Regexp) = Alternative.makeAlternative(Epsilon, exp) \ No newline at end of file diff --git a/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Many.kt b/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Many.kt index 949bce2ac..635041f07 100644 --- a/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Many.kt +++ b/solver/src/main/kotlin/org/ucfs/grammar/combinator/regexp/Many.kt @@ -1,6 +1,6 @@ package org.ucfs.grammar.combinator.regexp -data class Many( +data class Many internal constructor( val exp: Regexp, ) : Regexp { override fun derive(symbol: DerivedSymbol): Regexp { @@ -14,10 +14,6 @@ data class Many( } } -fun many(some: Regexp): Many { - return Many(some) -} -val Regexp.many: Many - get() = Many(this) +fun many(some: Regexp): Regexp = Many(some) -fun some(exp: Regexp) = exp * Many(exp) \ No newline at end of file +fun some(exp: Regexp) = exp * many(exp) \ No newline at end of file diff --git a/test-shared/gen/ABGrammarRsm b/test-shared/gen/ABGrammarRsm new file mode 100644 index 000000000..9b6be003a --- /dev/null +++ b/test-shared/gen/ABGrammarRsm @@ -0,0 +1,35 @@ +digraph g { +B_1 [label = "B,B_1", shape = doublecircle, color = red] +C_1 [label = "C,C_1", shape = doublecircle, color = red] +A_1 [label = "A,A_1", shape = doublecircle, color = red] +C_0 [label = "C,C_0", shape = circle, color = green] +B_0 [label = "B,B_0", shape = circle, color = green] +A_0 [label = "A,A_0", shape = circle, color = green] +S_1 [label = "S,S_1", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +C_0 -> C_1 [label = "a"] +B_0 -> B_1 [label = "C"] +A_0 -> A_1 [label = "a"] +S_0 -> S_1 [label = "A"] +S_0 -> S_1 [label = "B"] +subgraph cluster_A { +A_1 +A_0 +label = "A" +} +subgraph cluster_B { +B_1 +B_0 +label = "B" +} +subgraph cluster_C { +C_1 +C_0 +label = "C" +} +subgraph cluster_S { +S_1 +S_0 +label = "S" +} +} diff --git a/test-shared/gen/AmbiguousAStar1GrammarRsm b/test-shared/gen/AmbiguousAStar1GrammarRsm new file mode 100644 index 000000000..a7db60af3 --- /dev/null +++ b/test-shared/gen/AmbiguousAStar1GrammarRsm @@ -0,0 +1,11 @@ +digraph g { +S_1 [label = "S,S_1", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +S_0 -> S_1 [label = "a"] +S_0 -> S_1 [label = "S"] +subgraph cluster_S { +S_1 +S_0 +label = "S" +} +} diff --git a/test-shared/gen/AmbiguousAStar2GrammarRsm b/test-shared/gen/AmbiguousAStar2GrammarRsm new file mode 100644 index 000000000..6371dae44 --- /dev/null +++ b/test-shared/gen/AmbiguousAStar2GrammarRsm @@ -0,0 +1,14 @@ +digraph g { +S_2 [label = "S,S_2", shape = circle, color = black] +S_1 [label = "S,S_1", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +S_2 -> S_1 [label = "S"] +S_0 -> S_1 [label = "a"] +S_0 -> S_2 [label = "S"] +subgraph cluster_S { +S_2 +S_1 +S_0 +label = "S" +} +} diff --git a/test-shared/gen/AmbiguousAStar3GrammarRsm b/test-shared/gen/AmbiguousAStar3GrammarRsm new file mode 100644 index 000000000..4a8dc663e --- /dev/null +++ b/test-shared/gen/AmbiguousAStar3GrammarRsm @@ -0,0 +1,17 @@ +digraph g { +S_1 [label = "S,S_1", shape = circle, color = black] +S_3 [label = "S,S_3", shape = circle, color = black] +S_2 [label = "S,S_2", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +S_1 -> S_3 [label = "S"] +S_3 -> S_2 [label = ")"] +S_0 -> S_1 [label = "("] +S_0 -> S_2 [label = "a"] +subgraph cluster_S { +S_1 +S_3 +S_2 +S_0 +label = "S" +} +} diff --git a/test-shared/gen/BipartitleGrammarRsm b/test-shared/gen/BipartitleGrammarRsm new file mode 100644 index 000000000..efa023323 --- /dev/null +++ b/test-shared/gen/BipartitleGrammarRsm @@ -0,0 +1,32 @@ +digraph g { +B_1 [label = "B,B_1", shape = doublecircle, color = red] +A_1 [label = "A,A_1", shape = doublecircle, color = red] +B_2 [label = "B,B_2", shape = doublecircle, color = red] +A_2 [label = "A,A_2", shape = doublecircle, color = red] +B_0 [label = "B,B_0", shape = circle, color = green] +A_0 [label = "A,A_0", shape = circle, color = green] +S_1 [label = "S,S_1", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +B_1 -> B_2 [label = "A"] +A_1 -> A_2 [label = "B"] +B_0 -> B_1 [label = "b"] +A_0 -> A_1 [label = "a"] +S_0 -> S_1 [label = "A"] +subgraph cluster_A { +A_1 +A_2 +A_0 +label = "A" +} +subgraph cluster_B { +B_1 +B_2 +B_0 +label = "B" +} +subgraph cluster_S { +S_1 +S_0 +label = "S" +} +} diff --git a/test-shared/gen/CAliasGrammarRsm b/test-shared/gen/CAliasGrammarRsm new file mode 100644 index 000000000..754b22db1 --- /dev/null +++ b/test-shared/gen/CAliasGrammarRsm @@ -0,0 +1,66 @@ +digraph g { +V_1_3 [label = "V_1,V_1_3", shape = doublecircle, color = red] +V_3 [label = "V,V_3", shape = doublecircle, color = red] +S_3 [label = "S,S_3", shape = doublecircle, color = red] +V_1 [label = "V,V_1", shape = circle, color = black] +V_3_1 [label = "V_3,V_3_1", shape = circle, color = black] +V_2_0 [label = "V_2,V_2_0", shape = doublecircle, color = green] +V_3_0 [label = "V_3,V_3_0", shape = doublecircle, color = green] +V_2 [label = "V,V_2", shape = circle, color = black] +S_1 [label = "S,S_1", shape = circle, color = black] +S_2 [label = "S,S_2", shape = circle, color = black] +V_2_1 [label = "V_2,V_2_1", shape = doublecircle, color = red] +V_3_3 [label = "V_3,V_3_3", shape = doublecircle, color = red] +V_1_0 [label = "V_1,V_1_0", shape = doublecircle, color = green] +V_0 [label = "V,V_0", shape = circle, color = green] +V_1_1 [label = "V_1,V_1_1", shape = circle, color = black] +V_3_2 [label = "V_3,V_3_2", shape = circle, color = black] +V_1_2 [label = "V_1,V_1_2", shape = circle, color = black] +S_0 [label = "S,S_0", shape = circle, color = green] +V_1 -> V_2 [label = "V_2"] +V_3_1 -> V_3_2 [label = "V_2"] +V_2_0 -> V_2_1 [label = "S"] +V_3_0 -> V_3_1 [label = "a"] +V_2 -> V_3 [label = "V_3"] +S_1 -> S_2 [label = "V"] +S_2 -> S_3 [label = "d"] +V_1_0 -> V_1_1 [label = "V_2"] +V_0 -> V_1 [label = "V_1"] +V_1_1 -> V_1_2 [label = "a_r"] +V_3_2 -> V_3_3 [label = "V_3"] +V_1_2 -> V_1_3 [label = "V_1"] +S_0 -> S_1 [label = "d_r"] +subgraph cluster_S { +S_1 +S_2 +S_3 +S_0 +label = "S" +} +subgraph cluster_V { +V_1 +V_2 +V_3 +V_0 +label = "V" +} +subgraph cluster_V_2 { +V_2_0 +V_2_1 +label = "V_2" +} +subgraph cluster_V_1 { +V_1_3 +V_1_0 +V_1_1 +V_1_2 +label = "V_1" +} +subgraph cluster_V_3 { +V_3_1 +V_3_0 +V_3_3 +V_3_2 +label = "V_3" +} +} diff --git a/test-shared/gen/EpsilonGrammarRsm b/test-shared/gen/EpsilonGrammarRsm new file mode 100644 index 000000000..f412a141a --- /dev/null +++ b/test-shared/gen/EpsilonGrammarRsm @@ -0,0 +1,7 @@ +digraph g { +S_0 [label = "S,S_0", shape = doublecircle, color = green] +subgraph cluster_S { +S_0 +label = "S" +} +} diff --git a/test-shared/gen/LoopDyckGrammarRsm b/test-shared/gen/LoopDyckGrammarRsm new file mode 100644 index 000000000..ef9e4ef6d --- /dev/null +++ b/test-shared/gen/LoopDyckGrammarRsm @@ -0,0 +1,14 @@ +digraph g { +S_0 [label = "S,S_0", shape = doublecircle, color = green] +S_1 [label = "S,S_1", shape = circle, color = black] +S_2 [label = "S,S_2", shape = circle, color = black] +S_0 -> S_1 [label = "("] +S_1 -> S_2 [label = "S"] +S_2 -> S_0 [label = ")"] +subgraph cluster_S { +S_0 +S_1 +S_2 +label = "S" +} +} diff --git a/test-shared/gen/SALangGrammarRsm b/test-shared/gen/SALangGrammarRsm new file mode 100644 index 000000000..6dd948a43 --- /dev/null +++ b/test-shared/gen/SALangGrammarRsm @@ -0,0 +1,28 @@ +digraph g { +A_1 [label = "A,A_1", shape = circle, color = black] +S_1 [label = "S,S_1", shape = circle, color = black] +S_2 [label = "S,S_2", shape = circle, color = black] +A_2 [label = "A,A_2", shape = doublecircle, color = red] +A_0 [label = "A,A_0", shape = circle, color = green] +S_3 [label = "S,S_3", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +A_1 -> A_2 [label = "b"] +S_1 -> S_3 [label = "c"] +S_2 -> S_1 [label = "b"] +A_0 -> A_1 [label = "a"] +S_0 -> S_2 [label = "a"] +S_0 -> S_1 [label = "A"] +subgraph cluster_A { +A_1 +A_2 +A_0 +label = "A" +} +subgraph cluster_S { +S_1 +S_2 +S_3 +S_0 +label = "S" +} +} diff --git a/test-shared/gen/SimplifiedDyckGrammarRsm b/test-shared/gen/SimplifiedDyckGrammarRsm new file mode 100644 index 000000000..59ebc6fc9 --- /dev/null +++ b/test-shared/gen/SimplifiedDyckGrammarRsm @@ -0,0 +1,16 @@ +digraph g { +S_0 [label = "S,S_0", shape = doublecircle, color = green] +S_1 [label = "S,S_1", shape = circle, color = black] +S_2 [label = "S,S_2", shape = circle, color = black] +S_3 [label = "S,S_3", shape = doublecircle, color = red] +S_0 -> S_1 [label = "("] +S_1 -> S_2 [label = "S"] +S_2 -> S_3 [label = ")"] +subgraph cluster_S { +S_0 +S_1 +S_2 +S_3 +label = "S" +} +} diff --git a/test-shared/gen/StrangeDyckGrammarRsm b/test-shared/gen/StrangeDyckGrammarRsm new file mode 100644 index 000000000..4a8dc663e --- /dev/null +++ b/test-shared/gen/StrangeDyckGrammarRsm @@ -0,0 +1,17 @@ +digraph g { +S_1 [label = "S,S_1", shape = circle, color = black] +S_3 [label = "S,S_3", shape = circle, color = black] +S_2 [label = "S,S_2", shape = doublecircle, color = red] +S_0 [label = "S,S_0", shape = circle, color = green] +S_1 -> S_3 [label = "S"] +S_3 -> S_2 [label = ")"] +S_0 -> S_1 [label = "("] +S_0 -> S_2 [label = "a"] +subgraph cluster_S { +S_1 +S_3 +S_2 +S_0 +label = "S" +} +} diff --git a/test-shared/gen/dyckAlphaGrammarKParityRsm b/test-shared/gen/dyckAlphaGrammarKParityRsm new file mode 100644 index 000000000..66fe2e3c8 --- /dev/null +++ b/test-shared/gen/dyckAlphaGrammarKParityRsm @@ -0,0 +1,64 @@ +digraph g { +Si_4 [label = "Si,Si_4", shape = doublecircle, color = red] +Si_6 [label = "Si,Si_6", shape = circle, color = black] +S_1 [label = "S,S_1", shape = doublecircle, color = red] +Sp_3 [label = "Sp,Sp_3", shape = circle, color = black] +Sp_2 [label = "Sp,Sp_2", shape = circle, color = black] +Sp_1 [label = "Sp,Sp_1", shape = circle, color = black] +Sp_0 [label = "Sp,Sp_0", shape = doublecircle, color = green] +Si_0 [label = "Si,Si_0", shape = circle, color = green] +Si_2 [label = "Si,Si_2", shape = circle, color = black] +Si_3 [label = "Si,Si_3", shape = circle, color = black] +Sp_4 [label = "Sp,Sp_4", shape = doublecircle, color = red] +Si_5 [label = "Si,Si_5", shape = circle, color = black] +Sp_6 [label = "Sp,Sp_6", shape = circle, color = black] +S_0 [label = "S,S_0", shape = circle, color = green] +Sp_5 [label = "Sp,Sp_5", shape = circle, color = black] +Si_1 [label = "Si,Si_1", shape = circle, color = black] +Si_6 -> Si_1 [label = "cp--1"] +Sp_3 -> Sp_4 [label = "Sp"] +Sp_2 -> Sp_5 [label = "Si"] +Sp_2 -> Sp_6 [label = "Sp"] +Sp_1 -> Sp_4 [label = "Si"] +Sp_0 -> Sp_1 [label = "ob--1"] +Sp_0 -> Sp_1 [label = "cb--1"] +Sp_0 -> Sp_2 [label = "op--1"] +Sp_0 -> Sp_3 [label = "normal"] +Si_0 -> Si_1 [label = "ob--1"] +Si_0 -> Si_1 [label = "cb--1"] +Si_0 -> Si_2 [label = "op--1"] +Si_0 -> Si_3 [label = "normal"] +Si_2 -> Si_5 [label = "Sp"] +Si_2 -> Si_6 [label = "Si"] +Si_3 -> Si_4 [label = "Si"] +Si_5 -> Si_3 [label = "cp--1"] +Sp_6 -> Sp_3 [label = "cp--1"] +S_0 -> S_1 [label = "Sp"] +Sp_5 -> Sp_1 [label = "cp--1"] +Si_1 -> Si_4 [label = "Sp"] +subgraph cluster_S { +S_1 +S_0 +label = "S" +} +subgraph cluster_Si { +Si_4 +Si_6 +Si_0 +Si_2 +Si_3 +Si_5 +Si_1 +label = "Si" +} +subgraph cluster_Sp { +Sp_3 +Sp_2 +Sp_1 +Sp_0 +Sp_4 +Sp_6 +Sp_5 +label = "Sp" +} +} diff --git a/test-shared/gen/dyckBetaGrammarKParityRsm b/test-shared/gen/dyckBetaGrammarKParityRsm new file mode 100644 index 000000000..4bafc861a --- /dev/null +++ b/test-shared/gen/dyckBetaGrammarKParityRsm @@ -0,0 +1,64 @@ +digraph g { +Si_4 [label = "Si,Si_4", shape = doublecircle, color = red] +Si_6 [label = "Si,Si_6", shape = circle, color = black] +S_1 [label = "S,S_1", shape = doublecircle, color = red] +Sp_3 [label = "Sp,Sp_3", shape = circle, color = black] +Sp_2 [label = "Sp,Sp_2", shape = circle, color = black] +Sp_1 [label = "Sp,Sp_1", shape = circle, color = black] +Sp_0 [label = "Sp,Sp_0", shape = doublecircle, color = green] +Si_0 [label = "Si,Si_0", shape = circle, color = green] +Si_2 [label = "Si,Si_2", shape = circle, color = black] +Si_3 [label = "Si,Si_3", shape = circle, color = black] +Sp_4 [label = "Sp,Sp_4", shape = doublecircle, color = red] +Si_5 [label = "Si,Si_5", shape = circle, color = black] +Sp_6 [label = "Sp,Sp_6", shape = circle, color = black] +S_0 [label = "S,S_0", shape = circle, color = green] +Sp_5 [label = "Sp,Sp_5", shape = circle, color = black] +Si_1 [label = "Si,Si_1", shape = circle, color = black] +Si_6 -> Si_1 [label = "cb--1"] +Sp_3 -> Sp_4 [label = "Sp"] +Sp_2 -> Sp_5 [label = "Si"] +Sp_2 -> Sp_6 [label = "Sp"] +Sp_1 -> Sp_4 [label = "Si"] +Sp_0 -> Sp_1 [label = "op--1"] +Sp_0 -> Sp_1 [label = "cp--1"] +Sp_0 -> Sp_2 [label = "ob--1"] +Sp_0 -> Sp_3 [label = "normal"] +Si_0 -> Si_1 [label = "op--1"] +Si_0 -> Si_1 [label = "cp--1"] +Si_0 -> Si_2 [label = "ob--1"] +Si_0 -> Si_3 [label = "normal"] +Si_2 -> Si_5 [label = "Sp"] +Si_2 -> Si_6 [label = "Si"] +Si_3 -> Si_4 [label = "Si"] +Si_5 -> Si_3 [label = "cb--1"] +Sp_6 -> Sp_3 [label = "cb--1"] +S_0 -> S_1 [label = "Sp"] +Sp_5 -> Sp_1 [label = "cb--1"] +Si_1 -> Si_4 [label = "Sp"] +subgraph cluster_S { +S_1 +S_0 +label = "S" +} +subgraph cluster_Si { +Si_4 +Si_6 +Si_0 +Si_2 +Si_3 +Si_5 +Si_1 +label = "Si" +} +subgraph cluster_Sp { +Sp_3 +Sp_2 +Sp_1 +Sp_0 +Sp_4 +Sp_6 +Sp_5 +label = "Sp" +} +} diff --git a/test-shared/src/test/kotlin/grammars_example/GrammarsExample.kt b/test-shared/src/test/kotlin/grammars_example/GrammarsExample.kt index e4cb4d141..ba9f17efd 100644 --- a/test-shared/src/test/kotlin/grammars_example/GrammarsExample.kt +++ b/test-shared/src/test/kotlin/grammars_example/GrammarsExample.kt @@ -11,7 +11,7 @@ class SimplifiedDyck : Grammar() { val S by Nt().asStart() init { - S /= Option("(" * S * ")") + S /= option("(" * S * ")") // S = ( S ) ? } } @@ -29,7 +29,7 @@ class LoopDyck : Grammar() { val S by Nt().asStart() init { - S /= Many("(" * S * ")") + S /= many("(" * S * ")") // S = [ ( S ) ]* } } diff --git a/test-shared/src/test/kotlin/solver/benchmarks/LoopDyckGrammarTest/LoopDyckGrammar.kt b/test-shared/src/test/kotlin/solver/benchmarks/LoopDyckGrammarTest/LoopDyckGrammar.kt index ffd2b360e..354d77e43 100644 --- a/test-shared/src/test/kotlin/solver/benchmarks/LoopDyckGrammarTest/LoopDyckGrammar.kt +++ b/test-shared/src/test/kotlin/solver/benchmarks/LoopDyckGrammarTest/LoopDyckGrammar.kt @@ -9,7 +9,7 @@ class LoopDyckGrammar : Grammar() { val S by Nt().asStart() init { - S /= Many("(" * S * ")") + S /= many("(" * S * ")") // S = [ ( S ) ]* } } diff --git a/test-shared/src/test/kotlin/solver/correctnessTests/LoopDyckGrammarTest/LoopDyckGrammar.kt b/test-shared/src/test/kotlin/solver/correctnessTests/LoopDyckGrammarTest/LoopDyckGrammar.kt index 9018ff36b..047ca2954 100644 --- a/test-shared/src/test/kotlin/solver/correctnessTests/LoopDyckGrammarTest/LoopDyckGrammar.kt +++ b/test-shared/src/test/kotlin/solver/correctnessTests/LoopDyckGrammarTest/LoopDyckGrammar.kt @@ -9,7 +9,7 @@ class LoopDyckGrammar : Grammar() { val S by Nt().asStart() init { - S /= Many("(" * S * ")") + S /= many("(" * S * ")") // S = [ ( S ) ]* } } diff --git a/test-shared/src/test/kotlin/solver/correctnessTests/SimplifiedDyckGrammarTest/SimplifiedDyckGrammar.kt b/test-shared/src/test/kotlin/solver/correctnessTests/SimplifiedDyckGrammarTest/SimplifiedDyckGrammar.kt index fed242693..3001b96c2 100644 --- a/test-shared/src/test/kotlin/solver/correctnessTests/SimplifiedDyckGrammarTest/SimplifiedDyckGrammar.kt +++ b/test-shared/src/test/kotlin/solver/correctnessTests/SimplifiedDyckGrammarTest/SimplifiedDyckGrammar.kt @@ -9,7 +9,7 @@ class SimplifiedDyckGrammar : Grammar() { val S by Nt().asStart() init { - S /= Option("(" * S * ")") + S /= option("(" * S * ")") // S = ( S ) ? } } \ No newline at end of file diff --git a/test-shared/src/test/resources/grammars/g1/ScanerlessGrammarDsl.kt b/test-shared/src/test/resources/grammars/g1/ScanerlessGrammarDsl.kt index 81c88b793..00ee9606d 100644 --- a/test-shared/src/test/resources/grammars/g1/ScanerlessGrammarDsl.kt +++ b/test-shared/src/test/resources/grammars/g1/ScanerlessGrammarDsl.kt @@ -3,14 +3,14 @@ package grammars.g1 import org.ucfs.grammar.combinator.Grammar import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt -import org.ucfs.grammar.combinator.regexp.Option +import org.ucfs.grammar.combinator.regexp.option import org.ucfs.grammar.combinator.regexp.or class ScanerlessGrammarDsl : Grammar() { val S by Nt().asStart() init { - S /= "subClassOf_r" * Option(S) * "subClassOf" or - "type_r" * Option(S) * "type" + S /= "subClassOf_r" * option(S) * "subClassOf" or + "type_r" * option(S) * "type" } } \ No newline at end of file diff --git a/test-shared/src/test/resources/grammars/geo/ScanerlessGrammarDsl.kt b/test-shared/src/test/resources/grammars/geo/ScanerlessGrammarDsl.kt index 081d96493..72f3dd59b 100644 --- a/test-shared/src/test/resources/grammars/geo/ScanerlessGrammarDsl.kt +++ b/test-shared/src/test/resources/grammars/geo/ScanerlessGrammarDsl.kt @@ -3,12 +3,12 @@ package grammars.geo import org.ucfs.grammar.combinator.Grammar import org.ucfs.grammar.combinator.extension.StringExtension.times import org.ucfs.grammar.combinator.regexp.Nt -import org.ucfs.grammar.combinator.regexp.Option +import org.ucfs.grammar.combinator.regexp.option class ScanerlessGrammarDsl : Grammar() { val S by Nt().asStart() init { - S /= "broaderTransitive" * Option(S) * "broaderTransitive_r" + S /= "broaderTransitive" * option(S) * "broaderTransitive_r" } } \ No newline at end of file diff --git a/test-shared/src/test/resources/grammars/java8/GrammarDsll.kt b/test-shared/src/test/resources/grammars/java8/GrammarDsll.kt index 8218fcd95..964de4c80 100644 --- a/test-shared/src/test/resources/grammars/java8/GrammarDsll.kt +++ b/test-shared/src/test/resources/grammars/java8/GrammarDsll.kt @@ -227,26 +227,26 @@ class GrammarDsl : Grammar() { * Productions from §4 (Types, Values, and Variables) */ Type = PrimitiveType or ReferenceType - PrimitiveType = Many(Annotation) * NumericType or Many(Annotation) * Token.BOOLEAN + PrimitiveType = many(Annotation) * NumericType or many(Annotation) * Token.BOOLEAN NumericType = IntegralType or FloatingPointType IntegralType = Token.BYTE or Token.SHORT or Token.INT or Token.LONG or Token.CHAR FloatingPointType = Token.FLOAT or Token.DOUBLE ReferenceType = ClassOrInterfaceType or TypeVariable or ArrayType ClassOrInterfaceType = ClassType or InterfaceType - ClassType = Many(Annotation) * Identifier * Option(TypeArguments) or - ClassOrInterfaceType * Token.DOT * Many(Annotation) * Identifier * Option(TypeArguments) + ClassType = many(Annotation) * Identifier * option(TypeArguments) or + ClassOrInterfaceType * Token.DOT * many(Annotation) * Identifier * option(TypeArguments) InterfaceType = ClassType - TypeVariable = Many(Annotation) * Identifier + TypeVariable = many(Annotation) * Identifier ArrayType = PrimitiveType * Dims or ClassOrInterfaceType * Dims or TypeVariable * Dims - Dims = Some(Many(Annotation) * Token.BRACKETLEFT * Token.BRACKETRIGHT) - TypeParameter = Many(TypeParameterModifier) * Identifier * Option(TypeBound) + Dims = some(many(Annotation) * Token.BRACKETLEFT * Token.BRACKETRIGHT) + TypeParameter = many(TypeParameterModifier) * Identifier * option(TypeBound) TypeParameterModifier = Annotation - TypeBound = Token.EXTENDS * TypeVariable or Token.EXTENDS * ClassOrInterfaceType * Many(AdditionalBound) + TypeBound = Token.EXTENDS * TypeVariable or Token.EXTENDS * ClassOrInterfaceType * many(AdditionalBound) AdditionalBound = Token.ANDBIT * InterfaceType TypeArguments = Token.LT * TypeArgumentList * Token.GT - TypeArgumentList = TypeArgument * Many(Token.COMMA * TypeArgument) + TypeArgumentList = TypeArgument * many(Token.COMMA * TypeArgument) TypeArgument = ReferenceType or Wildcard - Wildcard = Many(Annotation) * Token.QUESTIONMARK * Option(WildcardBounds) + Wildcard = many(Annotation) * Token.QUESTIONMARK * option(WildcardBounds) WildcardBounds = Token.EXTENDS * ReferenceType or Token.SUPER * ReferenceType /** @@ -264,8 +264,8 @@ class GrammarDsl : Grammar() { * Productions from §7 (Packages) */ - CompilationUnit = Option(PackageDeclaration) * Many(ImportDeclaration) * Many(TypeDeclaration) - PackageDeclaration = Many(PackageModifier) * Token.PACKAGE * Identifier * Many(Token.DOT * Identifier) * Token.SEMICOLON + CompilationUnit = option(PackageDeclaration) * many(ImportDeclaration) * many(TypeDeclaration) + PackageDeclaration = many(PackageModifier) * Token.PACKAGE * Identifier * many(Token.DOT * Identifier) * Token.SEMICOLON PackageModifier = Annotation ImportDeclaration = SingleTypeImportDeclaration or TypeImportOnDemandDeclaration or SingleStaticImportDeclaration or StaticImportOnDemandDeclaration @@ -280,70 +280,70 @@ class GrammarDsl : Grammar() { */ ClassDeclaration = NormalClassDeclaration or EnumDeclaration - NormalClassDeclaration = Many(ClassModifier) * Token.CLASS * Identifier * - Option(TypeParameters) * Option(Superclass) * Option(Superinterfaces) * ClassBody + NormalClassDeclaration = many(ClassModifier) * Token.CLASS * Identifier * + option(TypeParameters) * option(Superclass) * option(Superinterfaces) * ClassBody ClassModifier = Annotation or Token.PUBLIC or Token.PROTECTED or Token.PRIVATE or Token.ABSTRACT or Token.STATIC or Token.FINAL or Token.STRICTFP TypeParameters = Token.LT * TypeParameterList * Token.GT - TypeParameterList = TypeParameter * Many(Token.COMMA * TypeParameter) + TypeParameterList = TypeParameter * many(Token.COMMA * TypeParameter) Superclass = Token.EXTENDS * ClassType Superinterfaces = Token.IMPLEMENTS * InterfaceTypeList - InterfaceTypeList = InterfaceType * Many(Token.COMMA * InterfaceType) - ClassBody = Token.CURLYLEFT * Many(ClassBodyDeclaration) * Token.CURLYRIGHT + InterfaceTypeList = InterfaceType * many(Token.COMMA * InterfaceType) + ClassBody = Token.CURLYLEFT * many(ClassBodyDeclaration) * Token.CURLYRIGHT ClassBodyDeclaration = ClassMemberDeclaration or InstanceInitializer or StaticInitializer or ConstructorDeclaration ClassMemberDeclaration = FieldDeclaration or MethodDeclaration or ClassDeclaration or InterfaceDeclaration or Token.SEMICOLON - FieldDeclaration = Many(FieldModifier) * UnannType * VariableDeclaratorList * Token.SEMICOLON + FieldDeclaration = many(FieldModifier) * UnannType * VariableDeclaratorList * Token.SEMICOLON FieldModifier = Annotation or Token.PUBLIC or Token.PROTECTED or Token.PRIVATE or Token.STATIC or Token.FINAL or Token.TRANSIENT or Token.VOLATILE - VariableDeclaratorList = VariableDeclarator * Many(Token.COMMA * VariableDeclarator) - VariableDeclarator = VariableDeclaratorId * Option(Token.ASSIGN * VariableInitializer) - VariableDeclaratorId = Identifier * Option(Dims) + VariableDeclaratorList = VariableDeclarator * many(Token.COMMA * VariableDeclarator) + VariableDeclarator = VariableDeclaratorId * option(Token.ASSIGN * VariableInitializer) + VariableDeclaratorId = Identifier * option(Dims) VariableInitializer = Expression or ArrayInitializer UnannType = UnannPrimitiveType or UnannReferenceType UnannPrimitiveType = NumericType or Token.BOOLEAN UnannReferenceType = UnannClassOrInterfaceType or UnannTypeVariable or UnannArrayType UnannClassOrInterfaceType = UnannClassType or UnannInterfaceType - UnannClassType = Identifier * Option(TypeArguments) or - UnannClassOrInterfaceType * Token.DOT * Many(Annotation) * Identifier * Option(TypeArguments) + UnannClassType = Identifier * option(TypeArguments) or + UnannClassOrInterfaceType * Token.DOT * many(Annotation) * Identifier * option(TypeArguments) UnannInterfaceType = UnannClassType UnannTypeVariable = Identifier UnannArrayType = UnannPrimitiveType * Dims or UnannClassOrInterfaceType * Dims or UnannTypeVariable * Dims - MethodDeclaration = Many(MethodModifier) * MethodHeader * MethodBody + MethodDeclaration = many(MethodModifier) * MethodHeader * MethodBody MethodModifier = Annotation or Token.PUBLIC or Token.PROTECTED or Token.PRIVATE or Token.ABSTRACT or Token.STATIC or Token.FINAL or Token.SYNCHRONIZED or Token.NATIVE or Token.STRICTFP - MethodHeader = Result * MethodDeclarator * Option(Throws) or - TypeParameters * Many(Annotation) * Result * MethodDeclarator * Option(Throws) + MethodHeader = Result * MethodDeclarator * option(Throws) or + TypeParameters * many(Annotation) * Result * MethodDeclarator * option(Throws) Result = UnannType or Token.VOID - MethodDeclarator = Identifier * Token.PARENTHLEFT * Option(FormalParameterList) * Token.PARENTHRIGHT * Option(Dims) + MethodDeclarator = Identifier * Token.PARENTHLEFT * option(FormalParameterList) * Token.PARENTHRIGHT * option(Dims) FormalParameterList = ReceiverParameter or FormalParameters * Token.COMMA * LastFormalParameter or LastFormalParameter - FormalParameters = FormalParameter * Many(Token.COMMA * FormalParameter) or - ReceiverParameter * Many(Token.COMMA * FormalParameter) - FormalParameter = Many(VariableModifier) * UnannType * VariableDeclaratorId + FormalParameters = FormalParameter * many(Token.COMMA * FormalParameter) or + ReceiverParameter * many(Token.COMMA * FormalParameter) + FormalParameter = many(VariableModifier) * UnannType * VariableDeclaratorId VariableModifier = Annotation or Token.FINAL - LastFormalParameter = Many(VariableModifier) * UnannType * Many(Annotation) * Token.ELLIPSIS * VariableDeclaratorId or FormalParameter - ReceiverParameter = Many(Annotation) * UnannType * Option(Identifier * Token.DOT) * Token.THIS + LastFormalParameter = many(VariableModifier) * UnannType * many(Annotation) * Token.ELLIPSIS * VariableDeclaratorId or FormalParameter + ReceiverParameter = many(Annotation) * UnannType * option(Identifier * Token.DOT) * Token.THIS Throws = Token.THROWS * ExceptionTypeList - ExceptionTypeList = ExceptionType * Many(Token.COMMA * ExceptionType) + ExceptionTypeList = ExceptionType * many(Token.COMMA * ExceptionType) ExceptionType = ClassType or TypeVariable MethodBody = Block or Token.SEMICOLON InstanceInitializer = Block StaticInitializer = Token.STATIC * Block - ConstructorDeclaration = Many(ConstructorModifier) * ConstructorDeclarator * Option(Throws) * ConstructorBody + ConstructorDeclaration = many(ConstructorModifier) * ConstructorDeclarator * option(Throws) * ConstructorBody ConstructorModifier = Annotation or Token.PUBLIC or Token.PROTECTED or Token.PRIVATE - ConstructorDeclarator = Option(TypeParameters) * SimpleTypeName * Token.PARENTHLEFT * Option(FormalParameterList) * Token.PARENTHRIGHT + ConstructorDeclarator = option(TypeParameters) * SimpleTypeName * Token.PARENTHLEFT * option(FormalParameterList) * Token.PARENTHRIGHT SimpleTypeName = Identifier - ConstructorBody = Token.CURLYLEFT * Option(ExplicitConstructorInvocation) * Option(BlockStatements) * Token.CURLYRIGHT - ExplicitConstructorInvocation = Option(TypeArguments) * Token.THIS * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON or - Option(TypeArguments) * Token.SUPER * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON or - ExpressionName * Token.DOT * Option(TypeArguments) * Token.SUPER * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON or - Primary * Token.DOT * Option(TypeArguments) * Token.SUPER * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON - EnumDeclaration = Many(ClassModifier) * Token.ENUM * Identifier * Option(Superinterfaces) * EnumBody - EnumBody = Token.CURLYLEFT * Option(EnumConstantList) * Option(Token.COMMA) * Option(EnumBodyDeclarations) * Token.CURLYRIGHT - EnumConstantList = EnumConstant * Many(Token.COMMA * EnumConstant) - EnumConstant = Many(EnumConstantModifier) * Identifier * Option(Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT * Option(ClassBody)) + ConstructorBody = Token.CURLYLEFT * option(ExplicitConstructorInvocation) * option(BlockStatements) * Token.CURLYRIGHT + ExplicitConstructorInvocation = option(TypeArguments) * Token.THIS * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON or + option(TypeArguments) * Token.SUPER * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON or + ExpressionName * Token.DOT * option(TypeArguments) * Token.SUPER * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON or + Primary * Token.DOT * option(TypeArguments) * Token.SUPER * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT * Token.SEMICOLON + EnumDeclaration = many(ClassModifier) * Token.ENUM * Identifier * option(Superinterfaces) * EnumBody + EnumBody = Token.CURLYLEFT * option(EnumConstantList) * option(Token.COMMA) * option(EnumBodyDeclarations) * Token.CURLYRIGHT + EnumConstantList = EnumConstant * many(Token.COMMA * EnumConstant) + EnumConstant = many(EnumConstantModifier) * Identifier * option(Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT * option(ClassBody)) EnumConstantModifier = Annotation - EnumBodyDeclarations = Token.SEMICOLON * Many(ClassBodyDeclaration) + EnumBodyDeclarations = Token.SEMICOLON * many(ClassBodyDeclaration) /** * Productions from §9 (Interfaces) @@ -351,30 +351,30 @@ class GrammarDsl : Grammar() { InterfaceDeclaration = NormalInterfaceDeclaration or AnnotationTypeDeclaration NormalInterfaceDeclaration = - Many(InterfaceModifier) * Token.INTERFACE * Identifier * Option(TypeParameters) * Option(ExtendsInterfaces) * InterfaceBody + many(InterfaceModifier) * Token.INTERFACE * Identifier * option(TypeParameters) * option(ExtendsInterfaces) * InterfaceBody InterfaceModifier = Annotation or Token.PUBLIC or Token.PROTECTED or Token.PRIVATE or Token.ABSTRACT or Token.STATIC or Token.STRICTFP ExtendsInterfaces = Token.EXTENDS * InterfaceTypeList - InterfaceBody = Token.CURLYLEFT * Many(InterfaceMemberDeclaration) * Token.CURLYRIGHT + InterfaceBody = Token.CURLYLEFT * many(InterfaceMemberDeclaration) * Token.CURLYRIGHT InterfaceMemberDeclaration = ConstantDeclaration or InterfaceMethodDeclaration or ClassDeclaration or InterfaceDeclaration or Token.SEMICOLON - ConstantDeclaration = Many(ConstantModifier) * UnannType * VariableDeclaratorList * Token.SEMICOLON + ConstantDeclaration = many(ConstantModifier) * UnannType * VariableDeclaratorList * Token.SEMICOLON ConstantModifier = Annotation or Token.PUBLIC or Token.STATIC or Token.FINAL - InterfaceMethodDeclaration = Many(InterfaceMethodModifier) * MethodHeader * MethodBody + InterfaceMethodDeclaration = many(InterfaceMethodModifier) * MethodHeader * MethodBody InterfaceMethodModifier = Annotation or Token.PUBLIC or Token.ABSTRACT or Token.DEFAULT or Token.STATIC or Token.STRICTFP - AnnotationTypeDeclaration = Many(InterfaceModifier) * Token.AT * Token.INTERFACE * Identifier * AnnotationTypeBody - AnnotationTypeBody = Token.CURLYLEFT * Many(AnnotationTypeMemberDeclaration) * Token.CURLYRIGHT + AnnotationTypeDeclaration = many(InterfaceModifier) * Token.AT * Token.INTERFACE * Identifier * AnnotationTypeBody + AnnotationTypeBody = Token.CURLYLEFT * many(AnnotationTypeMemberDeclaration) * Token.CURLYRIGHT AnnotationTypeMemberDeclaration = AnnotationTypeElementDeclaration or ConstantDeclaration or ClassDeclaration or InterfaceDeclaration or Token.SEMICOLON AnnotationTypeElementDeclaration = - Many(AnnotationTypeElementModifier) * UnannType * Identifier * Token.PARENTHLEFT * Token.PARENTHRIGHT * Option(Dims) * Option(DefaultValue) * Token.SEMICOLON + many(AnnotationTypeElementModifier) * UnannType * Identifier * Token.PARENTHLEFT * Token.PARENTHRIGHT * option(Dims) * option(DefaultValue) * Token.SEMICOLON AnnotationTypeElementModifier = Annotation or Token.PUBLIC or Token.ABSTRACT DefaultValue = Token.DEFAULT * ElementValue Annotation = NormalAnnotation or MarkerAnnotation or SingleElementAnnotation - NormalAnnotation = Token.AT * TypeName * Token.PARENTHLEFT * Option(ElementValuePairList) * Token.PARENTHRIGHT - ElementValuePairList = ElementValuePair * Many(Token.COMMA * ElementValuePair) + NormalAnnotation = Token.AT * TypeName * Token.PARENTHLEFT * option(ElementValuePairList) * Token.PARENTHRIGHT + ElementValuePairList = ElementValuePair * many(Token.COMMA * ElementValuePair) ElementValuePair = Identifier * Token.ASSIGN * ElementValue ElementValue = ConditionalExpression or ElementValueArrayInitializer or Annotation - ElementValueArrayInitializer = Token.CURLYLEFT * Option(ElementValueList) * Option(Token.COMMA) * Token.CURLYRIGHT - ElementValueList = ElementValue * Many(Token.COMMA * ElementValue) + ElementValueArrayInitializer = Token.CURLYLEFT * option(ElementValueList) * option(Token.COMMA) * Token.CURLYRIGHT + ElementValueList = ElementValue * many(Token.COMMA * ElementValue) MarkerAnnotation = Token.AT * TypeName SingleElementAnnotation = Token.AT * TypeName * Token.PARENTHLEFT * ElementValue * Token.PARENTHRIGHT @@ -382,18 +382,18 @@ class GrammarDsl : Grammar() { * Productions from §10 (Arrays) */ - ArrayInitializer = Token.CURLYLEFT * Option(VariableInitializerList) * Option(Token.COMMA) * Token.CURLYRIGHT - VariableInitializerList = VariableInitializer * Many(Token.COMMA * VariableInitializer) + ArrayInitializer = Token.CURLYLEFT * option(VariableInitializerList) * option(Token.COMMA) * Token.CURLYRIGHT + VariableInitializerList = VariableInitializer * many(Token.COMMA * VariableInitializer) /** * Productions from §14 (Blocks and Statements) */ - Block = Token.CURLYLEFT * Option(BlockStatements) * Token.CURLYRIGHT - BlockStatements = BlockStatement * Many(BlockStatement) + Block = Token.CURLYLEFT * option(BlockStatements) * Token.CURLYRIGHT + BlockStatements = BlockStatement * many(BlockStatement) BlockStatement = LocalVariableDeclarationStatement or ClassDeclaration or Statement LocalVariableDeclarationStatement = LocalVariableDeclaration * Token.SEMICOLON - LocalVariableDeclaration = Many(VariableModifier) * UnannType * VariableDeclaratorList + LocalVariableDeclaration = many(VariableModifier) * UnannType * VariableDeclaratorList Statement = StatementWithoutTrailingSubstatement or LabeledStatement or IfThenStatement or IfThenElseStatement or WhileStatement or ForStatement StatementNoShortIf = StatementWithoutTrailingSubstatement or LabeledStatementNoShortIf or IfThenElseStatementNoShortIf or @@ -414,9 +414,9 @@ class GrammarDsl : Grammar() { AssertStatement = Token.ASSERT * Expression * Token.SEMICOLON or Token.ASSERT * Expression * Token.COLON * Expression * Token.SEMICOLON SwitchStatement = Token.SWITCH * Token.PARENTHLEFT * Expression * Token.PARENTHRIGHT * SwitchBlock - SwitchBlock = Token.CURLYLEFT * Many(SwitchBlockStatementGroup) * Many(SwitchLabel) * Token.CURLYRIGHT + SwitchBlock = Token.CURLYLEFT * many(SwitchBlockStatementGroup) * many(SwitchLabel) * Token.CURLYRIGHT SwitchBlockStatementGroup = SwitchLabels * BlockStatements - SwitchLabels = Some(SwitchLabel) + SwitchLabels = some(SwitchLabel) SwitchLabel = Token.CASE * ConstantExpression * Token.COLON or Token.CASE * EnumConstantName * Token.COLON or Token.DEFAULT * Token.COLON EnumConstantName = Identifier @@ -425,28 +425,28 @@ class GrammarDsl : Grammar() { DoStatement = Token.DO * Statement * Token.WHILE * Token.PARENTHLEFT * Expression * Token.PARENTHRIGHT * Token.SEMICOLON ForStatement = BasicForStatement or EnhancedForStatement ForStatementNoShortIf = BasicForStatementNoShortIf or EnhancedForStatementNoShortIf - BasicForStatement = Token.FOR * Token.PARENTHLEFT * Option(ForInit) * Token.SEMICOLON * Option(Expression) * Token.SEMICOLON * Option(ForUpdate) * Token.PARENTHRIGHT * Statement - BasicForStatementNoShortIf = Token.FOR * Token.PARENTHLEFT * Option(ForInit) * Token.SEMICOLON * Option(Expression) * Token.SEMICOLON * Option(ForUpdate) * Token.PARENTHRIGHT * StatementNoShortIf + BasicForStatement = Token.FOR * Token.PARENTHLEFT * option(ForInit) * Token.SEMICOLON * option(Expression) * Token.SEMICOLON * option(ForUpdate) * Token.PARENTHRIGHT * Statement + BasicForStatementNoShortIf = Token.FOR * Token.PARENTHLEFT * option(ForInit) * Token.SEMICOLON * option(Expression) * Token.SEMICOLON * option(ForUpdate) * Token.PARENTHRIGHT * StatementNoShortIf ForInit = StatementExpressionList or LocalVariableDeclaration ForUpdate = StatementExpressionList - StatementExpressionList = StatementExpression * Many(Token.COMMA * StatementExpression) - EnhancedForStatement = Token.FOR * Token.PARENTHLEFT * Many(VariableModifier) * UnannType * VariableDeclaratorId * Token.COLON * Expression * Token.PARENTHRIGHT * Statement - EnhancedForStatementNoShortIf = Token.FOR * Token.PARENTHLEFT * Many(VariableModifier) * UnannType * VariableDeclaratorId * Token.COLON * Expression * Token.PARENTHRIGHT * StatementNoShortIf - BreakStatement = Token.BREAK * Option(Identifier) * Token.SEMICOLON - ContinueStatement = Token.CONTINUE * Option(Identifier) * Token.SEMICOLON - ReturnStatement = Token.RETURN * Option(Expression) * Token.SEMICOLON + StatementExpressionList = StatementExpression * many(Token.COMMA * StatementExpression) + EnhancedForStatement = Token.FOR * Token.PARENTHLEFT * many(VariableModifier) * UnannType * VariableDeclaratorId * Token.COLON * Expression * Token.PARENTHRIGHT * Statement + EnhancedForStatementNoShortIf = Token.FOR * Token.PARENTHLEFT * many(VariableModifier) * UnannType * VariableDeclaratorId * Token.COLON * Expression * Token.PARENTHRIGHT * StatementNoShortIf + BreakStatement = Token.BREAK * option(Identifier) * Token.SEMICOLON + ContinueStatement = Token.CONTINUE * option(Identifier) * Token.SEMICOLON + ReturnStatement = Token.RETURN * option(Expression) * Token.SEMICOLON ThrowStatement = Token.THROW * Expression * Token.SEMICOLON SynchronizedStatement = Token.SYNCHRONIZED * Token.PARENTHLEFT * Expression * Token.PARENTHRIGHT * Block - TryStatement = Token.TRY * Block * Catches or Token.TRY * Block * Option(Catches) * Finally or TryWithResourcesStatement - Catches = Some(CatchClause) + TryStatement = Token.TRY * Block * Catches or Token.TRY * Block * option(Catches) * Finally or TryWithResourcesStatement + Catches = some(CatchClause) CatchClause = Token.CATCH * Token.PARENTHLEFT * CatchFormalParameter * Token.PARENTHRIGHT * Block - CatchFormalParameter = Many(VariableModifier) * CatchType * VariableDeclaratorId - CatchType = UnannClassType * Many(Token.ORBIT * ClassType) + CatchFormalParameter = many(VariableModifier) * CatchType * VariableDeclaratorId + CatchType = UnannClassType * many(Token.ORBIT * ClassType) Finally = Token.FINALLY * Block - TryWithResourcesStatement = Token.TRY * ResourceSpecification * Block * Option(Catches) * Option(Finally) - ResourceSpecification = Token.PARENTHLEFT * ResourceList * Option(Token.SEMICOLON) * Token.PARENTHRIGHT - ResourceList = Resource * Many(Token.COMMA * Resource) - Resource = Many(VariableModifier) * UnannType * VariableDeclaratorId * Token.ASSIGN * Expression + TryWithResourcesStatement = Token.TRY * ResourceSpecification * Block * option(Catches) * option(Finally) + ResourceSpecification = Token.PARENTHLEFT * ResourceList * option(Token.SEMICOLON) * Token.PARENTHRIGHT + ResourceList = Resource * many(Token.COMMA * Resource) + Resource = many(VariableModifier) * UnannType * VariableDeclaratorId * Token.ASSIGN * Expression /** * Productions from §15 (Expressions) @@ -456,46 +456,46 @@ class GrammarDsl : Grammar() { PrimaryNoNewArray = Literal or ClassLiteral or Token.THIS or TypeName * Token.DOT * Token.THIS or Token.PARENTHLEFT * Expression * Token.PARENTHRIGHT or ClassInstanceCreationExpression or FieldAccess or ArrayAccess or MethodInvocation or MethodReference - ClassLiteral = TypeName * Many(Token.BRACKETLEFT * Token.BRACKETRIGHT) * Token.DOT * Token.CLASS or - NumericType * Many(Token.BRACKETLEFT * Token.BRACKETRIGHT) * Token.DOT * Token.CLASS or - Token.BOOLEAN * Many(Token.BRACKETLEFT * Token.BRACKETRIGHT) * Token.DOT * Token.CLASS or + ClassLiteral = TypeName * many(Token.BRACKETLEFT * Token.BRACKETRIGHT) * Token.DOT * Token.CLASS or + NumericType * many(Token.BRACKETLEFT * Token.BRACKETRIGHT) * Token.DOT * Token.CLASS or + Token.BOOLEAN * many(Token.BRACKETLEFT * Token.BRACKETRIGHT) * Token.DOT * Token.CLASS or Token.VOID * Token.DOT * Token.CLASS ClassInstanceCreationExpression = UnqualifiedClassInstanceCreationExpression or ExpressionName * Token.DOT * UnqualifiedClassInstanceCreationExpression or Primary * Token.DOT * UnqualifiedClassInstanceCreationExpression UnqualifiedClassInstanceCreationExpression = - Token.NEW * Option(TypeArguments) * classOrInterfaceTypeToInstantiate * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT * Option(ClassBody) - classOrInterfaceTypeToInstantiate = Many(Annotation) * Identifier * Many(Token.DOT * Many(Annotation) * Identifier) * Option(TypeArgumentsOrDiamond) + Token.NEW * option(TypeArguments) * classOrInterfaceTypeToInstantiate * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT * option(ClassBody) + classOrInterfaceTypeToInstantiate = many(Annotation) * Identifier * many(Token.DOT * many(Annotation) * Identifier) * option(TypeArgumentsOrDiamond) TypeArgumentsOrDiamond = TypeArguments or Token.LT * Token.GT FieldAccess = Primary * Token.DOT * Identifier or Token.SUPER * Token.DOT * Identifier or TypeName * Token.DOT * Token.SUPER * Token.DOT * Identifier ArrayAccess = ExpressionName * Token.BRACKETLEFT * Expression * Token.BRACKETRIGHT or PrimaryNoNewArray * Token.BRACKETLEFT * Expression * Token.BRACKETRIGHT - MethodInvocation = MethodName * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT or - TypeName * Token.DOT * Option(TypeArguments) * Identifier * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT or - ExpressionName * Token.DOT * Option(TypeArguments) * Identifier * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT or - Primary * Token.DOT * Option(TypeArguments) * Identifier * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT or - Token.SUPER * Token.DOT * Option(TypeArguments) * Identifier * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT or - TypeName * Token.DOT * Token.SUPER * Token.DOT * Option(TypeArguments) * Identifier * Token.PARENTHLEFT * Option(ArgumentList) * Token.PARENTHRIGHT - ArgumentList = Expression * Many(Token.COMMA * Expression) - MethodReference = ExpressionName * Token.DOUBLECOLON * Option(TypeArguments) * Identifier or - ReferenceType * Token.DOUBLECOLON * Option(TypeArguments) * Identifier or - Primary * Token.DOUBLECOLON * Option(TypeArguments) * Identifier or - Token.SUPER * Token.DOUBLECOLON * Option(TypeArguments) * Identifier or - TypeName * Token.DOT * Token.SUPER * Token.DOUBLECOLON * Option(TypeArguments) * Identifier or - ClassType * Token.DOUBLECOLON * Option(TypeArguments) * Token.NEW or + MethodInvocation = MethodName * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT or + TypeName * Token.DOT * option(TypeArguments) * Identifier * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT or + ExpressionName * Token.DOT * option(TypeArguments) * Identifier * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT or + Primary * Token.DOT * option(TypeArguments) * Identifier * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT or + Token.SUPER * Token.DOT * option(TypeArguments) * Identifier * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT or + TypeName * Token.DOT * Token.SUPER * Token.DOT * option(TypeArguments) * Identifier * Token.PARENTHLEFT * option(ArgumentList) * Token.PARENTHRIGHT + ArgumentList = Expression * many(Token.COMMA * Expression) + MethodReference = ExpressionName * Token.DOUBLECOLON * option(TypeArguments) * Identifier or + ReferenceType * Token.DOUBLECOLON * option(TypeArguments) * Identifier or + Primary * Token.DOUBLECOLON * option(TypeArguments) * Identifier or + Token.SUPER * Token.DOUBLECOLON * option(TypeArguments) * Identifier or + TypeName * Token.DOT * Token.SUPER * Token.DOUBLECOLON * option(TypeArguments) * Identifier or + ClassType * Token.DOUBLECOLON * option(TypeArguments) * Token.NEW or ArrayType * Token.DOUBLECOLON * Token.NEW - ArrayCreationExpression = Token.NEW * PrimitiveType * DimExprs * Option(Dims) or - Token.NEW * ClassOrInterfaceType * DimExprs * Option(Dims) or + ArrayCreationExpression = Token.NEW * PrimitiveType * DimExprs * option(Dims) or + Token.NEW * ClassOrInterfaceType * DimExprs * option(Dims) or Token.NEW * PrimitiveType * Dims * ArrayInitializer or Token.NEW * ClassOrInterfaceType * Dims * ArrayInitializer - DimExprs = Some(DimExpr) - DimExpr = Many(Annotation) * Token.BRACKETLEFT * Expression * Token.BRACKETRIGHT + DimExprs = some(DimExpr) + DimExpr = many(Annotation) * Token.BRACKETLEFT * Expression * Token.BRACKETRIGHT Expression = LambdaExpression or AssignmentExpression LambdaExpression = LambdaParameters * Token.ARROW * LambdaBody - LambdaParameters = Identifier or Token.PARENTHLEFT * Option(FormalParameterList) * Token.PARENTHRIGHT or + LambdaParameters = Identifier or Token.PARENTHLEFT * option(FormalParameterList) * Token.PARENTHRIGHT or Token.PARENTHLEFT * InferredFormalParameterList * Token.PARENTHRIGHT - InferredFormalParameterList = Identifier * Many(Token.COMMA * Identifier) + InferredFormalParameterList = Identifier * many(Token.COMMA * Identifier) LambdaBody = Expression or Block AssignmentExpression = ConditionalExpression or Assignment Assignment = LeftHandSide * AssignmentOperator * Expression @@ -536,8 +536,8 @@ class GrammarDsl : Grammar() { PostIncrementExpression = PostfixExpression * Token.PLUSPLUS PostDecrementExpression = PostfixExpression * Token.MINUSMINUS CastExpression = Token.PARENTHLEFT * PrimitiveType * Token.PARENTHRIGHT * UnaryExpression or - Token.PARENTHLEFT * ReferenceType * Many(AdditionalBound) * Token.PARENTHRIGHT * UnaryExpressionNotPlusMinus or - Token.PARENTHLEFT * ReferenceType * Many(AdditionalBound) * Token.PARENTHRIGHT * LambdaExpression + Token.PARENTHLEFT * ReferenceType * many(AdditionalBound) * Token.PARENTHRIGHT * UnaryExpressionNotPlusMinus or + Token.PARENTHLEFT * ReferenceType * many(AdditionalBound) * Token.PARENTHRIGHT * LambdaExpression ConstantExpression = Expression setStart(CompilationUnit) diff --git a/test-shared/src/test/resources/grammars/simple_golang/ScanerlessGrammarDsl.kt b/test-shared/src/test/resources/grammars/simple_golang/ScanerlessGrammarDsl.kt index 2d12dfd8a..a07405486 100644 --- a/test-shared/src/test/resources/grammars/simple_golang/ScanerlessGrammarDsl.kt +++ b/test-shared/src/test/resources/grammars/simple_golang/ScanerlessGrammarDsl.kt @@ -3,13 +3,13 @@ package grammars.simple_golang import org.ucfs.grammar.combinator.Grammar import org.ucfs.grammar.combinator.extension.StringExtension.or import org.ucfs.grammar.combinator.extension.StringExtension.times -import org.ucfs.grammar.combinator.regexp.Many +import org.ucfs.grammar.combinator.regexp.many import org.ucfs.grammar.combinator.regexp.Nt import org.ucfs.grammar.combinator.regexp.or class ScanerlessGrammarDsl : Grammar() { val IntExpr by Nt("1" or "1" * "+" * "1") val Statement by Nt(IntExpr * ";" or "r" * IntExpr * ";") - val Block by Nt(Many(Statement)) + val Block by Nt(many(Statement)) val Program by Nt(Block).asStart() } \ No newline at end of file From 13437a6c73c3abdace8e1d2325cc91de33ebe95d Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 15 Jul 2026 16:10:02 +0300 Subject: [PATCH 69/71] docs(agents): add documentation update rules for API refactoring --- AGENTS.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 728e3881c..a1e600f6d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -81,6 +81,14 @@ graph TD 3. Only after approval, commit the documentation changes 4. Then implement the actual code changes +### Documentation update rules + +When refactoring public API (e.g., renaming DSL functions), update **all** documentation: + +1. **Search scope:** Always search the **entire repository**, not just `docs/docs/`. Include `README.md`, `dev/*.md`, and `docs/docs/*.md` in every grep. +2. **Verify against source:** After updating docs, cross-check each code snippet against the actual API signature in source code (e.g., confirm `asStart()` takes no arguments by reading `Grammar.kt`). +3. **Build verification:** Run `./gradlew build` after any change that touches documented API to catch stale examples that no longer compile. + ## Key Source Files | File | Purpose | From a4bad74648acac81b966a2e6252b1d70ab79cbcf Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 15 Jul 2026 03:04:06 +0300 Subject: [PATCH 70/71] chore(build): update JDK toolchain from 11 to 21 --- .github/workflows/ci-publishing-jar-files.yaml | 2 +- .github/workflows/ci-test-infrastructure.yaml | 2 +- AGENTS.md | 2 +- README.md | 4 ++-- cfpq-paths-app/build.gradle.kts | 2 +- dev/DEVELOPMENT.md | 4 ++-- docs/docs/index.md | 2 +- generator/build.gradle.kts | 2 +- solver/build.gradle.kts | 2 +- test-shared/build.gradle.kts | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-publishing-jar-files.yaml b/.github/workflows/ci-publishing-jar-files.yaml index b75c6516a..77504dc78 100644 --- a/.github/workflows/ci-publishing-jar-files.yaml +++ b/.github/workflows/ci-publishing-jar-files.yaml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - - name: Setup JDK 11 + - name: Setup JDK 21 uses: actions/setup-java@v5 with: distribution: 'temurin' diff --git a/.github/workflows/ci-test-infrastructure.yaml b/.github/workflows/ci-test-infrastructure.yaml index 8f14dab5a..f044538fb 100644 --- a/.github/workflows/ci-test-infrastructure.yaml +++ b/.github/workflows/ci-test-infrastructure.yaml @@ -12,7 +12,7 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v6 - - name: Set up JDK 11 + - name: Set up JDK 21 uses: actions/setup-java@v5 with: distribution: 'temurin' diff --git a/AGENTS.md b/AGENTS.md index a1e600f6d..1474bb96c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -36,7 +36,7 @@ graph TD - **Tool:** Gradle with Kotlin DSL (`build.gradle.kts`) - **Wrapper:** `./gradlew` included, no local Gradle install needed -- **JDK:** 11+ (toolchain configured in each module) +- **JDK:** 21+ (toolchain configured in each module) - **Kotlin:** 2.4.0 ### Essential Commands diff --git a/README.md b/README.md index cea90c66e..87be98b26 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![CI](https://github.com/FormalLanguageConstrainedPathQuerying/UCFS/actions/workflows/ci-test-infrastructure.yaml/badge.svg)](https://github.com/FormalLanguageConstrainedPathQuerying/UCFS/actions/workflows/ci-test-infrastructure.yaml) [![License](https://img.shields.io/github/license/FormalLanguageConstrainedPathQuerying/UCFS)](LICENSE) [![Kotlin](https://img.shields.io/badge/kotlin-2.4.0-blue.svg?logo=kotlin)](https://kotlinlang.org) -[![JDK](https://img.shields.io/badge/JDK-11%2B-orange.svg?logo=openjdk)](https://www.oracle.com/java/technologies/javase/jdk11-archive-downloads.html) +[![JDK](https://img.shields.io/badge/JDK-21%2B-orange.svg?logo=openjdk)](https://www.oracle.com/java/technologies/downloads/#java21) > Note: project under heavy development! @@ -97,7 +97,7 @@ cfpq-paths-app/ # Runnable demos and tutorial ### Requirements -- JDK 11+ (toolchain targets 11). +- JDK 21+ (toolchain targets 21). - Gradle Wrapper included (`./gradlew`). ## Installation diff --git a/cfpq-paths-app/build.gradle.kts b/cfpq-paths-app/build.gradle.kts index 520b97317..8e84f40e3 100644 --- a/cfpq-paths-app/build.gradle.kts +++ b/cfpq-paths-app/build.gradle.kts @@ -13,7 +13,7 @@ dependencies { } kotlin { - jvmToolchain(11) + jvmToolchain(21) } application { diff --git a/dev/DEVELOPMENT.md b/dev/DEVELOPMENT.md index 37ab9db11..04899502e 100644 --- a/dev/DEVELOPMENT.md +++ b/dev/DEVELOPMENT.md @@ -2,7 +2,7 @@ ## Prerequisites -- **JDK 11+** (Gradle toolchain will manage version) +- **JDK 21+** (Gradle toolchain will manage version) - **Git** - No local Gradle installation required — use the included wrapper @@ -77,7 +77,7 @@ Or run the main application: 1. Open the project root directory 2. IntelliJ will detect Gradle project automatically -3. Ensure JDK 11+ is selected in Project Structure → SDKs +3. Ensure JDK 21+ is selected in Project Structure → SDKs ## Writing Tests diff --git a/docs/docs/index.md b/docs/docs/index.md index 949a365a5..5f488321b 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -83,7 +83,7 @@ cfpq-paths-app/ # Runnable demos and tutorial ### Requirements -- JDK 11+ (toolchain targets 11). +- JDK 21+ (toolchain targets 21). - Gradle Wrapper included (`./gradlew`). ### Installation: diff --git a/generator/build.gradle.kts b/generator/build.gradle.kts index 4dc989d59..fd018e346 100644 --- a/generator/build.gradle.kts +++ b/generator/build.gradle.kts @@ -17,5 +17,5 @@ tasks.test { } kotlin { - jvmToolchain(11) + jvmToolchain(21) } diff --git a/solver/build.gradle.kts b/solver/build.gradle.kts index 2c2472919..70c9c2d86 100644 --- a/solver/build.gradle.kts +++ b/solver/build.gradle.kts @@ -23,7 +23,7 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter:5.8.1") } -kotlin { jvmToolchain(11) } +kotlin { jvmToolchain(21) } tasks.test { useJUnitPlatform() diff --git a/test-shared/build.gradle.kts b/test-shared/build.gradle.kts index cd3bdd8b6..1384cae56 100644 --- a/test-shared/build.gradle.kts +++ b/test-shared/build.gradle.kts @@ -45,5 +45,5 @@ tasks.test { } kotlin { - jvmToolchain(11) + jvmToolchain(21) } \ No newline at end of file From 0c2718ba48d495ffe3da82fecb24fdc0311124fb Mon Sep 17 00:00:00 2001 From: Vladimir Kutuev Date: Wed, 15 Jul 2026 03:37:10 +0300 Subject: [PATCH 71/71] docs: add agent workflow rules and conventional commit guidance --- AGENTS.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 1474bb96c..1c1beba19 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -74,7 +74,19 @@ graph TD ## Agent Workflow Rules -> **Documentation-first policy:** Any structural or behavioral change must be reflected in the agent documentation *before* implementation. +### General Workflow + +1. **Plan-first policy:** Before making any changes, present a plan of what will be changed and why. Wait for user approval before executing. +2. **No commits without explicit request:** Never `git commit` or `git push` unless the user explicitly asks. Present diffs for review first. +3. **Verify before presenting:** Build and tests must pass before showing changes as ready for review. +4. **Conventional commits:** All commit messages must follow the format from [CONTRIBUTING.md](CONTRIBUTING.md): + - Format: `type(scope): short description` + - Types: `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` + - Example: `chore(build): update JDK toolchain from 11 to 21` + +### Documentation-First Policy + +> Any structural or behavioral change must be reflected in the agent documentation *before* implementation. 1. Update relevant files in `dev/` (and `AGENTS.md`) to reflect the intended change 2. **Ask the user to approve the documentation changes**