From 5c234abf6ed93988fcedb9661802897738f65311 Mon Sep 17 00:00:00 2001 From: Mikka Rainer Date: Tue, 2 Jan 2024 17:04:13 +0100 Subject: [PATCH] Fix the bug causing issue #171 --- docs/beta/code/GeneratorGrammarFuzzer.py | 2 +- docs/beta/notebooks/GeneratorGrammarFuzzer.ipynb | 4 ++-- docs/code/GeneratorGrammarFuzzer.py | 2 +- docs/notebooks/GeneratorGrammarFuzzer.ipynb | 4 ++-- notebooks/GeneratorGrammarFuzzer.ipynb | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/beta/code/GeneratorGrammarFuzzer.py b/docs/beta/code/GeneratorGrammarFuzzer.py index 5136d1266..b7d260c86 100755 --- a/docs/beta/code/GeneratorGrammarFuzzer.py +++ b/docs/beta/code/GeneratorGrammarFuzzer.py @@ -875,7 +875,7 @@ def choose_tree_expansion(self, tree: DerivationTree, print("Expandable child #%d %s has order %d" % (k, expandable_child[0], given_order[j])) - if min_given_order is None or given_order[j] < min_given_order: + if min_given_order is None or given_order[j] < given_order[min_given_order]: min_given_order = k assert min_given_order is not None diff --git a/docs/beta/notebooks/GeneratorGrammarFuzzer.ipynb b/docs/beta/notebooks/GeneratorGrammarFuzzer.ipynb index 600d9cb82..9e37b1bdd 100644 --- a/docs/beta/notebooks/GeneratorGrammarFuzzer.ipynb +++ b/docs/beta/notebooks/GeneratorGrammarFuzzer.ipynb @@ -3506,7 +3506,7 @@ " print(\"Expandable child #%d %s has order %d\" %\n", " (k, expandable_child[0], given_order[j]))\n", "\n", - " if min_given_order is None or given_order[j] < min_given_order:\n", + " if min_given_order is None or given_order[j] < given_order[min_given_order]:\n", " min_given_order = k\n", "\n", " assert min_given_order is not None\n", @@ -5031,4 +5031,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/docs/code/GeneratorGrammarFuzzer.py b/docs/code/GeneratorGrammarFuzzer.py index 5136d1266..b7d260c86 100755 --- a/docs/code/GeneratorGrammarFuzzer.py +++ b/docs/code/GeneratorGrammarFuzzer.py @@ -875,7 +875,7 @@ def choose_tree_expansion(self, tree: DerivationTree, print("Expandable child #%d %s has order %d" % (k, expandable_child[0], given_order[j])) - if min_given_order is None or given_order[j] < min_given_order: + if min_given_order is None or given_order[j] < given_order[min_given_order]: min_given_order = k assert min_given_order is not None diff --git a/docs/notebooks/GeneratorGrammarFuzzer.ipynb b/docs/notebooks/GeneratorGrammarFuzzer.ipynb index 600d9cb82..9e37b1bdd 100644 --- a/docs/notebooks/GeneratorGrammarFuzzer.ipynb +++ b/docs/notebooks/GeneratorGrammarFuzzer.ipynb @@ -3506,7 +3506,7 @@ " print(\"Expandable child #%d %s has order %d\" %\n", " (k, expandable_child[0], given_order[j]))\n", "\n", - " if min_given_order is None or given_order[j] < min_given_order:\n", + " if min_given_order is None or given_order[j] < given_order[min_given_order]:\n", " min_given_order = k\n", "\n", " assert min_given_order is not None\n", @@ -5031,4 +5031,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -} \ No newline at end of file +} diff --git a/notebooks/GeneratorGrammarFuzzer.ipynb b/notebooks/GeneratorGrammarFuzzer.ipynb index 0e3e50745..36f7f8e92 100644 --- a/notebooks/GeneratorGrammarFuzzer.ipynb +++ b/notebooks/GeneratorGrammarFuzzer.ipynb @@ -1977,7 +1977,7 @@ " print(\"Expandable child #%d %s has order %d\" %\n", " (k, expandable_child[0], given_order[j]))\n", "\n", - " if min_given_order is None or given_order[j] < min_given_order:\n", + " if min_given_order is None or given_order[j] < given_order[min_given_order]:\n", " min_given_order = k\n", "\n", " assert min_given_order is not None\n",