From f1ee29e3f2516459c1d08f6e0ae7701995ec3edf Mon Sep 17 00:00:00 2001 From: Joshua Moerman Date: Mon, 24 Jan 2022 14:17:32 +0100 Subject: [PATCH] small bugfix --- satuio/uio-incr.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/satuio/uio-incr.py b/satuio/uio-incr.py index 014a749..46248db 100644 --- a/satuio/uio-incr.py +++ b/satuio/uio-incr.py @@ -161,8 +161,9 @@ def extend(new_uios): # And follow the graph to extend to other states. # Note: these may not be the smallest UIO for that state. # But it is an UIO nevertheless. - for (s, i) in uio_implication_graph[t]: - queue.append((s, [i] + uio)) + if t in uio_implication_graph: + for (s, i) in uio_implication_graph[t]: + queue.append((s, [i] + uio)) # We extend our 1-letter UIOs extend(new_uios) @@ -377,12 +378,12 @@ for length in range(2, bound + 1): new_uios = {} +for (s, uio) in uios.items(): + console.print(s, style='bold black', end=' => ') + console.print(uio, style='bold green') + # Report some final stats start = start_total measure_time("Done with total time") print('With UIO:', len(uios)) print('without: ', len(states) - len(uios)) - -for (s, uio) in uios.items(): - console.print(s, style='bold black', end=' => ') - console.print(uio, style='bold green')