From d336be4941967bf3f757d4565d24f32e1c4722b4 Mon Sep 17 00:00:00 2001 From: Taksh Date: Mon, 10 Aug 2026 23:00:05 +0530 Subject: [PATCH 1/2] Fix NameError crash in beta_bound_examples2 exp_pairs and bounds were referenced before assignment, so this example (invoked at module load) always crashed with NameError. Capture the exponent pairs from beta_bounds_to_exponent_pairs and recompute bounds before the final display call, mirroring the working pattern in the sibling beta_bound_examples(). --- blueprint/src/python/examples.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/blueprint/src/python/examples.py b/blueprint/src/python/examples.py index 8ed07ee..ebe29bb 100644 --- a/blueprint/src/python/examples.py +++ b/blueprint/src/python/examples.py @@ -212,7 +212,8 @@ def beta_bound_examples2(): hs.add_hypotheses(compute_exp_pairs(hs, search_depth=1, prune=True)) hs.add_hypotheses(exponent_pairs_to_beta_bounds(hs)) hs.add_hypotheses(compute_best_beta_bounds(hs)) - hs.add_hypotheses(beta_bounds_to_exponent_pairs(hs)) + exp_pairs = beta_bounds_to_exponent_pairs(hs) + hs.add_hypotheses(exp_pairs) old_bounds = compute_best_beta_bounds(hs) # Apply Lemma 4.6 @@ -220,7 +221,6 @@ def beta_bound_examples2(): add_beta_bound(hs, newBounds, Reference.make("ANTEDB Lemma 4.6", 2025)) hs.add_hypotheses(compute_best_beta_bounds(hs)) - new_exp_pairs = beta_bounds_to_exponent_pairs(hs) new_exp_pairs = [newPair for newPair in beta_bounds_to_exponent_pairs(hs) if not(newPair in exp_pairs)] if len(new_exp_pairs) > 0: @@ -239,6 +239,7 @@ def beta_bound_examples2(): for P in Ps: print(P) + bounds = compute_best_beta_bounds(hs) #display_beta_bounds(bounds) display_two_sets_of_beta_bounds(old_bounds, bounds) From 6918b37afc50a48de38df5cacf578e4e5fd9e847 Mon Sep 17 00:00:00 2001 From: Taksh Date: Sun, 16 Aug 2026 21:23:10 +0530 Subject: [PATCH 2/2] Stop running an example on import examples.py ends with a bare beta_bound_examples2() call, left behind in "Add some usage examples to readme". Importing the module - which the README tells readers to do - therefore runs that example, so a reader following the README waits minutes for output they did not ask for, and before the previous commit crashed outright. The other entry points are called from all_examples(), which is left commented out; drop the stray call. --- blueprint/src/python/examples.py | 1 - 1 file changed, 1 deletion(-) diff --git a/blueprint/src/python/examples.py b/blueprint/src/python/examples.py index ebe29bb..c74a5cf 100644 --- a/blueprint/src/python/examples.py +++ b/blueprint/src/python/examples.py @@ -619,4 +619,3 @@ def all_examples(): # prove_exponent_pair(frac(89,3478), frac(15327,17390)) #all_examples() -beta_bound_examples2()